Understand how the BGP Best Path Selection Algorithm works on your router


BGP is a path-vector routing protocol, which simply means that its job is to exchange routing information between autonomous systems to find the most efficient path for your data to the Internet. Each BGP router connects to its neighbor (or neighbors) with neighbor statements. Once it forms that neighbor relationship, the BGP routers exchange routes.

What is the BGP Best Path Selection Algorithm?

.Let’s look at the selection criteria, in order, that BGP uses to select the best routes to install into the IP Routing table:

#1 Weight — This is a Cisco-defined attribute that is assigned locally to your router and does not get carried through to the router updates. If there are multiple paths to a particular IP address (which is very common), then BGP looks for the path with the highest weight. There are several ways to set the weight parameter, such as the neighbor command, the as-path access list, or route maps.

#2 Local Preference — This is an indicator to the AS as to which path has local preference, with the highest preference being preferred. The default is 100. For example:
bgp default local-preference 150

#3 Network or Aggregate — This criterion prefers the path that was locally originated via a network or aggregate. The aggregation of specific routes into one route is very efficient and saves space on your network. For more information on aggregate, please see the Cisco article “Understanding Route Aggregation in BGP.”

#4 Shortest AS_PATH — BGP uses this one only when there is a “tie” comparing weight, local preference, and locally originated vs. aggregate addresses.

#5 Lowest origin type — This deals with protocols such as Interior Gateway Protocol (IGP) being a lower preference than Exterior Gateway Protocol (EGP).

#6 Lowest multi-exit discriminator (MED) — This is also known as the external metric of a route. A lower MED value is preferred over a higher value.

#7 eBGP over iBGP — Similar to #5, BGP AS Path prefers eBGP over iBGP.

#8 Lowest IGP metric — This criterion prefers the path with the lowest IGP metric to the BGP next hop.

#9 Multiple paths — This determines if multiple paths require installation in the routing table. Check out this link for information on BGP Multipath.

#10 External paths — When both paths are external, it prefers the path that was received first (the oldest one).

#11 Lowest router ID — This prefers the route that comes from the BGP router with the lowest router ID.

#12 Minimum cluster list — If the originator or router ID is the same for multiple paths, it prefers the path with the minimum cluster list length.

#13 Lowest neighbor address — This prefers the path that comes from the lowest neighbor address.
There are some commands that you will use over and over with the BGP metrics. They are show ip bgp and show ip bgp summary.

RTA# show ip bgp
BGP table version is 14, local router ID is 203.250.15.10
Status codes: s suppressed, d damped, h history, * valid, > best, i -internal
Origin codes: i - IGP, e - EGP, ? - incomplete
Network          Next Hop          Metric LocPrf Weight Path
*>i128.213.0.0      128.213.63.2           0    200      0 200 i
> 192.208.10.0     192.208.10.5           0    300      0 300 i
*>i200.200.0.0/16   128.213.63.2                200      0 200 400 i
>i203.250.13.0     203.250.13.41          0    100      0 i
*>i203.250.14.0     203.250.13.41          0    100      0 i
*> 203.250.15.0     0.0.0.0                0         32768 i

Aucun commentaire:

Enregistrer un commentaire