BGP Routing Best Path Selection

BGP consists of two parts, Network Layer Reachability Information and Path Attributes.

The path attributes are a huge factor in deciding the preferred path for traffic to take. On top of this only the best path is advertised to neighbours in BGP.

BGP automatically installs the first route it receives for a new destination as the preferred path. If additional routes are received for the same network prefix with the same prefix length, there are comparisons made against the current preferred path with the path attributes.

There is a selected order of path attributes that are compared, and if that path attribute is equal in priority, it moves onto the next comparison in the list.

BGP attributes are compared in the following order:

  1. Weight
  2. Local Preference
  3. Where did the local route originate from:
    1. Via a network statement
    2. Via Redistribution
    3. Via Aggregation
  4. Accumulated IGP Metric Attribute
  5. Origin type
  6. Lowest MED
  7. eBGP preferred over iBGP
  8. Lowest IGP next hop
  9. At this point, if both routes are eBGP, prefer the oldest route
  10. Prefer the route that comes from the BGP peer with the lower RID
  11. Prefer the route with the minimum cluster length list
  12. Prefer the path that comes from the lowest neighbour address

Network layer reachability information (NLRIs) and path attributes are maintained inside the BGP Loc-RIB table, with their best path pre-calculated. This best path is installed into the routing table, or routing information base of the router.

If the best path suddenly becomes unavailable, the BGP Loc-Rib can use any other known paths to recalculate the next preferred route to direct traffic into. The best path could become unavailable for a number of reasons such as:

  1. The next-hop reachability changes
  2. There is a failure of an interface connected to a BGP peer
  3. Redistribution into BGP changes
  4. New paths are entered into a route
  5. Paths are removed from a route



, ,




Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.