Social Icons

Wednesday, May 7, 2014

CCNP ROUTE: 9. BGP Path Attributes and Best Path Algorithm - summary

The term BGP best path algorithm refers to the process by which BGP on a single router examines the competing BGP paths (routes) in its BGP table, for a single prefix, choosing one route as the best route.
The Autonomous System Path (AS_Path) PA lists the ASNs in the end-to-end path.
BGP uses the AS_Path PA as its primary loop-prevention tool: When an eBGP peer receives an Update, if its own ASN is already in the received AS_Path, then that route has already been advertised into the local ASN and should be ignored.

Note: Order of the PAs considered:
          - 0. (N) Next-hop reachability - should be reachable
          - 1. (W) Weight - bigger wins - popular to influence outbound routes
          - 2. (L) Local Preference - bigger wins - popular to influence outbound routes
          - 3. (L) Locally injected routes - locally injected (network command or redistribution better than iBGP and eBGP)
          - 4. (A) AS_PATH - smaller wins - popular to influence outbound routes
          - 5. (O) ORIGIN - prefer I over E over ?
          - 6. (M) MED - smaller wins - popular to influence inbound routes
          - 7. (N) Neighbor type - prefer eBGP over iBGP
          - 8. (I) IGP Metric to next-hop - smaller wins
                                  
NEXT_HOP - Lists the next-hop IP address used to reach a prefix. If that router does not have a matching IP route for the BGP route’s Next_Hop IP address, then that router will not know how to forward packets for that particular prefix, using that particular route.
Weight - A numeric value, range 0 through (2^16 – 1), set by a router when receiving Updates, influencing that one router’s route for a prefix. Not advertised to any BGP peers.
LOCAL_PREF - A numeric value, range 0 through (2^16 – 1), set and communicated throughout a single AS for the purpose of influencing the choice of best route for all routers in that AS.
AS_PATH (length) - The number of ASNs in the AS_Path PA.
ORIGIN - Value implying the route was injected into BGP; I (IGP), E (EGP - outdated), or ? (incomplete information).
Multi Exit Discriminator (MED) - Set and advertised by routers in one AS, impacting the BGP decision of routers in the other AS.
IGP Metric to next-hop - The router compares the metrics of the IP routes for each Next_Hop IP address and chooses the BGP route with the lower IGP metric to its Next_Hop.

To check the PA settings we can use the show ip bgp command, as seen below:



Note:
If a router still did not determine a best route when finishing Step 8, the router takes several other small steps to break the tie.
At this point, the competing routes are considered to be just as good as each other.
However, unlike IGPs, BGP needs to choose one and only one route as best, in part because BGP advertises only the best routes to its neighbors.
In such cases, BGP breaks the tie with these additional steps, which would be considered Steps 9-11:

9. Oldest (longest-known) eBGP route
10. Lowest neighbor BGP RID
11. Lowest neighbor IP address

In most cases, only a subset of the core 8 BGP best path steps need be considered, as follows:
- Weight (Step 1)
- Local_Pref (Step 2)
- AS_Path Length (Step 4)
- MED (often called metric) (Step 6)

Note: BGP does allow multiple BGP routes for a prefix to be considered to tie, at least for the purpose of adding multiple routes to the IP routing table. The conditions are as follows:

If the BGP best path algorithm does not choose a best path by Step 8, the routes which still tie for being best path through Step 8 will be allowed into the IP routing table (before considering Steps 9-11), up to the number defined by the BGP maximum-paths number-of-paths router subcommand.

No comments:

Post a Comment