Does BGP do load balancing ???

Does bgp protocol has the facility to do loadbalancing among multiple links....

Also let me know the difference between load balancing and load sharing in bgp .....

 

Many thanks

Comments

  • No. BGP does not do load balancing.  BGP does what's called "multi-path".  This means it presents multiple forwarding paths to the lower level processes.

     

    The process that actually load-shares/balances the traffic depends on the software and hardware platform.  In general practice, CEF is in charge of the actual load-distribution.  For example if you have two equal cost routes in iBGP, CEF would try to hash the traffic out two links based on the input src/dst mac, src/dst ip, src/dst tcp/udp port per-flow.

     

    How "balanced" the traffic is really depends on what the inputs are to the load-balance hash.  Sometimes you'll get close to an equal or fair share distribution on your links, other times not.  This is why the software generally allows you to edit what variables go into the load-balancing hash.

     

    HTH,

     

    Brian

  • Thanks a lot Brian 

     

    Appreciated !!!

  • yes, if 2 and more networks have same internal costu can use  maximum-paths [ibgp] under the BGP process to install multiple equal-cost routes.  Still one path is marked as the best and advertise as such. 

     

  • Be aware that more than the single bestpath can be advertised in such multipathing situations.  

    In IPv4 Unicast this is implemented as BGP Add-Path.  

    In VPNv4/VPNv6 it's implemented with multiple Route Distinguishers, which allows internal IGP load balancing to VPN exit paths.

    Also make sure to familiarize yourself with the BGP Bestpath selection rules, as they are generally very strict for these types of cases the allow for multipath.

  • Hi Brian,

     

    I thought when you did something like the config I did below, this is able to load share traffic?  Since, if you do a #sh ip route x.x.x.x on one of the subnets with mutliple paths it shows that each path has a "traffic share count is 1".  Bit confused why you say this is not what load sharing is? I understand that CEF actually chooses which packets will go over which flow based on the load sharing mechanism.  I always thought that the example below was actually referred to as load sharing though.

     

    #router bgp 1

    #bgp maximum-paths 2

    #bgp bestpath as-path multipath-relax

     

     

  • Even if the traffic share count is 1:1 you won't get an actual ratio of 1:1 because you don't load balance per-packet. It just means that both paths are seeded equally into the CEF hashing. Which one will be used depends on the flow data. 

    To check this issue the "show up CEF exact-route"'command and give it the input values. 

    Brian McGahan, 4 x CCIE #8593 (R&S/SP/SC/DC), CCDE #2013::13
    [email protected]
     
    Internetwork Expert, Inc.
    http://www.INE.com

    On Oct 24, 2014, at 2:45 AM, "sg4rb0" <[email protected]> wrote:

    Hi Brian,

     

    I thought when you did something like the config I did below, this is able to load share BGP traffic?  Since, if you do a #sh ip route x.x.x.x on one of the subnets with mutliple paths it shows that each path has a "traffic share count is 1".  Bit confused why you say this is not what load sharing is?

     

    #router bgp 1

    #bgp maximum-paths 2

    #bgp bestpath as-path multipath-relax

     

     




    INE - The Industry Leader in CCIE Preparation

    http://www.INE.com



    Subscription information may be found at:

    http://www.ieoc.com/forums/ForumSubscriptions.aspx
  • Excuse me Brian,

    and it is possible for you that in VPNV4 AFI-SAFI where a local PE router can clearly load balance the local originated traffic via its VRF table, when the local CE router forwards through the same PE router it doesn't obtain the same load balancing transmission as it was originated locally from its PE router?

    I recreated the same lab that you used in Multipath bgp over layer 3 vpns and although the BGP multipath and load balancing is achieved and tested from the PE router, when i source traffic from the local CE router it is never load balanced across the MPLS network.

    From the PE it is shared on paths R1-R3 and R6-R7

    R8#traceroute vrf A 150.1.100.100
    Type escape sequence to abort.
    Tracing the route to 150.1.100.100
    VRF info: (vrf in name/id, vrf out name/id)
      1 155.1.58.5 [MPLS: Labels 27/28 Exp 0] 172 msec 80 msec *
      2 155.1.45.4 [MPLS: Labels 16/30 Exp 0] 108 msec 136 msec 92 msec
      3 155.1.146.1 [MPLS: Labels 26/28 Exp 0] 160 msec
        155.1.146.6 [MPLS: Labels 16/30 Exp 0] 108 msec
        155.1.146.1 [MPLS: Labels 26/28 Exp 0] 120 msec
      4 155.1.79.7 [MPLS: Label 30 Exp 0] 60 msec
        155.1.23.3 [MPLS: Label 28 Exp 0] 88 msec
        155.1.79.7 [MPLS: Label 30 Exp 0] 60 msec
      5 155.1.23.2 132 msec
        155.1.79.9 108 msec *

     

    From the CE the traffic always follow the same path.

    R10#traceroute 150.1.100.100
    Type escape sequence to abort.
    Tracing the route to 150.1.100.100
    VRF info: (vrf in name/id, vrf out name/id)
      1 155.1.108.8 16 msec 16 msec 16 msec
      2 155.1.58.5 [MPLS: Labels 27/28 Exp 0] 140 msec 148 msec 144 msec
      3 155.1.45.4 [MPLS: Labels 26/28 Exp 0] 164 msec 136 msec 156 msec
      4 155.1.146.1 [MPLS: Labels 26/28 Exp 0] 156 msec 148 msec 120 msec
      5 155.1.23.3 [MPLS: Label 28 Exp 0] 120 msec 124 msec 124 msec
      6 155.1.23.2 156 msec *  148 msec

     

    Additionally there are no route-reflector servers in my configuration. BGP is configured in full mesh for every PE router

  • There's an example of this is the new Full Scale Lab 2 that was just posted. It's part of the MPLS section and says something like "ensure that traffic is load balanced over the MPLS core to the remote site". 

    If you look at the config you need to make sure there are unique RDs so the RR sees it as 2 paths, and then turn multipathing on. 

    The traffic will balance but only when you vary the input to CEF. 

    Brian McGahan, 4 x CCIE #8593 (R&S/SP/SC/DC), CCDE #2013::13
    [email protected]
     
    Internetwork Expert, Inc.
    http://www.INE.com

    On Oct 24, 2014, at 11:13 AM, "[email protected]" <[email protected]> wrote:

    Excuse me Brian,

    and it is possible for you that in VPNV4 AFI-SAFI where a local PE router can clearly load balance the local originated traffic via its VRF table, when the local CE router forwards through the same PE router it doesn't obtain the same load balancing transmission as it was originated locally from its PE router?

    I recreated the same lab that you used in Multipath bgp over layer 3 vpns and although the BGP multipath and load balancing is achieved and tested from the PE router, when i source traffic from the local CE router it is never load balanced across the MPLS network.

    From the PE it is shared on paths R1-R3 and R6-R7

    R8#traceroute vrf A 150.1.100.100
    Type escape sequence to abort.
    Tracing the route to 150.1.100.100
    VRF info: (vrf in name/id, vrf out name/id)
      1 155.1.58.5 [MPLS: Labels 27/28 Exp 0] 172 msec 80 msec *
      2 155.1.45.4 [MPLS: Labels 16/30 Exp 0] 108 msec 136 msec 92 msec
      3 155.1.146.1 [MPLS: Labels 26/28 Exp 0] 160 msec
        155.1.146.6 [MPLS: Labels 16/30 Exp 0] 108 msec
        155.1.146.1 [MPLS: Labels 26/28 Exp 0] 120 msec
      4 155.1.79.7 [MPLS: Label 30 Exp 0] 60 msec
        155.1.23.3 [MPLS: Label 28 Exp 0] 88 msec
        155.1.79.7 [MPLS: Label 30 Exp 0] 60 msec
      5 155.1.23.2 132 msec
        155.1.79.9 108 msec *

     

    From the CE the traffic always follow the same path.

    R10#traceroute 150.1.100.100
    Type escape sequence to abort.
    Tracing the route to 150.1.100.100
    VRF info: (vrf in name/id, vrf out name/id)
      1 155.1.108.8 16 msec 16 msec 16 msec
      2 155.1.58.5 [MPLS: Labels 27/28 Exp 0] 140 msec 148 msec 144 msec
      3 155.1.45.4 [MPLS: Labels 26/28 Exp 0] 164 msec 136 msec 156 msec
      4 155.1.146.1 [MPLS: Labels 26/28 Exp 0] 156 msec 148 msec 120 msec
      5 155.1.23.3 [MPLS: Label 28 Exp 0] 120 msec 124 msec 124 msec
      6 155.1.23.2 156 msec *  148 msec

     

    Additionally there are no route-reflector servers in my configuration. BGP is configured in full mesh for every PE router




    INE - The Industry Leader in CCIE Preparation

    http://www.INE.com



    Subscription information may be found at:

    http://www.ieoc.com/forums/ForumSubscriptions.aspx
  • Create a bunch of new random loop backs on the CEs and trace between them. Eventually you should see it split some of the load. 

    Brian McGahan, 4 x CCIE #8593 (R&S/SP/SC/DC), CCDE #2013::13
    [email protected]
     
    Internetwork Expert, Inc.
    http://www.INE.com

    On Oct 24, 2014, at 11:13 AM, "[email protected]" <[email protected]> wrote:

    Excuse me Brian,

    and it is possible for you that in VPNV4 AFI-SAFI where a local PE router can clearly load balance the local originated traffic via its VRF table, when the local CE router forwards through the same PE router it doesn't obtain the same load balancing transmission as it was originated locally from its PE router?

    I recreated the same lab that you used in Multipath bgp over layer 3 vpns and although the BGP multipath and load balancing is achieved and tested from the PE router, when i source traffic from the local CE router it is never load balanced across the MPLS network.

    From the PE it is shared on paths R1-R3 and R6-R7

    R8#traceroute vrf A 150.1.100.100
    Type escape sequence to abort.
    Tracing the route to 150.1.100.100
    VRF info: (vrf in name/id, vrf out name/id)
      1 155.1.58.5 [MPLS: Labels 27/28 Exp 0] 172 msec 80 msec *
      2 155.1.45.4 [MPLS: Labels 16/30 Exp 0] 108 msec 136 msec 92 msec
      3 155.1.146.1 [MPLS: Labels 26/28 Exp 0] 160 msec
        155.1.146.6 [MPLS: Labels 16/30 Exp 0] 108 msec
        155.1.146.1 [MPLS: Labels 26/28 Exp 0] 120 msec
      4 155.1.79.7 [MPLS: Label 30 Exp 0] 60 msec
        155.1.23.3 [MPLS: Label 28 Exp 0] 88 msec
        155.1.79.7 [MPLS: Label 30 Exp 0] 60 msec
      5 155.1.23.2 132 msec
        155.1.79.9 108 msec *

     

    From the CE the traffic always follow the same path.

    R10#traceroute 150.1.100.100
    Type escape sequence to abort.
    Tracing the route to 150.1.100.100
    VRF info: (vrf in name/id, vrf out name/id)
      1 155.1.108.8 16 msec 16 msec 16 msec
      2 155.1.58.5 [MPLS: Labels 27/28 Exp 0] 140 msec 148 msec 144 msec
      3 155.1.45.4 [MPLS: Labels 26/28 Exp 0] 164 msec 136 msec 156 msec
      4 155.1.146.1 [MPLS: Labels 26/28 Exp 0] 156 msec 148 msec 120 msec
      5 155.1.23.3 [MPLS: Label 28 Exp 0] 120 msec 124 msec 124 msec
      6 155.1.23.2 156 msec *  148 msec

     

    Additionally there are no route-reflector servers in my configuration. BGP is configured in full mesh for every PE router




    INE - The Industry Leader in CCIE Preparation

    http://www.INE.com



    Subscription information may be found at:

    http://www.ieoc.com/forums/ForumSubscriptions.aspx
  • Create a bunch of new random loop backs on the CEs and trace between them. Eventually you should see it split some of the load. 

    Brian McGahan, 4 x CCIE #8593 (R&S/SP/SC/DC), CCDE #2013::13
    [email protected]
     
    Internetwork Expert, Inc.
    http://www.INE.com

     

    Hi Brian, thanks for the reply.

    Yes it split the load on a per prefix basis. PE router choose sometimes one path over the other regardless if it was installed as bestpath or not.

    I was not understanding correctly the final goal of this feature. I was thinkin before, since the PE router can do ECMP here cause it can "see" both paths as equal cost that it should serve the CE traceroute traffic in the same way. But the load balancing occurs on a lower level here. is that correct? When the CE router traffic enters the PE router indeed the lookup is made already on its MPLS LFIB label + VPN label instead ECMP works at routing level. Not sure if i'm right here.

  • Yes, load balancing is a lower level feature. Hardware based platforms make the decision at the linecard level. The RIB which BGP feeds the paths to is the central control plane. How forwarding in the data plane happens is a separate function of the box on purpose. 

    Brian McGahan, 4 x CCIE #8593 (R&S/SP/SC/DC), CCDE #2013::13
    [email protected]

    Internetwork Expert, Inc.
    http://www.INE.com

    On Oct 24, 2014, at 4:14 PM, "[email protected]" <[email protected]> wrote:

    imageBrian McGahan:
    Create a bunch of new random loop backs on the CEs and trace between them. Eventually you should see it split some of the load. 

    Brian McGahan, 4 x CCIE #8593 (R&S/SP/SC/DC), CCDE #2013::13
    [email protected]
     
    Internetwork Expert, Inc.
    http://www.INE.com

     

    Hi Brian, thanks for the reply.

    Yes it split the load on a per prefix basis. PE router choose sometimes one path over the other regardless if it was installed as bestpath or not.

    I was not understanding correctly the final goal of this feature. I was thinkin before, since the PE router can do ECMP here cause it can "see" both paths as equal cost that it should serve the CE traceroute traffic in the same way. But the load balancing occurs on a lower level here. is that correct? When the CE router traffic enters the PE router indeed the lookup is made already on its MPLS LFIB label + VPN label instead ECMP works at routing level. Not sure if i'm right here.




    INE - The Industry Leader in CCIE Preparation

    http://www.INE.com



    Subscription information may be found at:

    http://www.ieoc.com/forums/ForumSubscriptions.aspx
Sign In or Register to comment.