Thursday 14 March 2019

BGP Series 17: Other BGP Attributes: Origin Code, IGP Metric to Next-hop, BGP Multipath :

Other BGP Attributes: Origin Code, IGP Metric to Next-hop, BGP Multipath :

  • Origin Code:

    • BGP routes with origin attribute of ‘i’ > ‘e’ > ‘?’ is the order of preference

    • Usually, we will never see any routes with ‘e’ as origin code since that meant the routes originated on the old EGP routing protocol which is unused

    • In modern scenarios, we will see either routes having Origin code as

      • ‘i’ which means the routes originated via IGP and was injected into BGP via “network” command or “aggregate-address” command or “neighbor default-originate” command
      • ‘?’ which means the origin is unclear as the routes were redistributed into BGP
    • img

  • IGP Metric to Next-Hop:

    • If all the metric are identical for two routes from neighbors 1 and 2 (upto eBGP vs iBGP), then, BGP looks at what is the OSPF (or IGP) cost to get to neighbor1 vs neighbor2
    • If it is a lower OSPF cost to get to 1 (or lower EIGRP distance or lower RIP hop-count), then, I will select that neighbor as best route

BGP Multipath:

  • BGP supports multipath, also known as load-balancing

  • It is configured as ‘maximum-paths <number-of-paths’ to configure the maximum number of equal cost paths

  • By default, BGP only allows only one route for a given prefix/length to be present in routing table

  • We know that BGP has a lot of tie-breakers to choose only one best route. For 2 or more routes to be added as best routes for same prefix in my local routing table, the first 9 tie-breakers need to be the same. If they are same, BGP will consider them as equal cost and add all of them as best in routing table

    • img
    • All the above attributes needs to be same for routes to be considered under maximum-paths
  • Even after maximum paths is configured, bgp will still advertise only one best route to its neighbors, but, will consider all the maximum-path routes for its own routing table

  • Depending on whether iBGP or eBGP learned, there are some other conditions for two routes to be put into routing table even if all 9 tie-breakers are same:

    • If it is iBGP learned route, then, their next-hop needs to be different to be put into routing table with the ‘maximum-paths’ command
    • If the routes are eBGP learned, they should be learned from the same neighboring AS to be put into the routing table with the ‘maximum-paths’ command; otherwise, even if all the attributes tie, but, the routes are from different AS, only one will go into the routing table
  • The ‘maximum-paths’ would come in handy if we have multi-homed connection from our AS to the same ISP and we want to load-balance between both the links if the 9 attributes are same.

No comments:

Post a Comment