Unlike traditional IGPs, BGP uses a complex path selection process before electing a path which will be used to forward packets destined to each destination prefix. Understanding and being intimately familiar with the BGP path selection process is a mandatory requirement of the ROUTE exam. It is imperative that you take your time to ensure that you are very comfortable with the path selection process that is described in this section.
By default, a BGP speaker receiving UPDATES selects only a single best path from this set of multiple UPDATES and installs that into the IP routing table. Having stated this, it is very important to remember that multiple paths may be installed into the BGP Table; however, only one of those paths (by default) will be installed into the IP routing table.
The BGP best path selection process is performed based on attributes. Each received UPDATE is compared against all others until one UPDATE wins and is placed into the routing table. By default BGP assigns the first valid path received as the best path; however, as other UPDATES are received, this path is compared against those received UPDATES, and so forth through the received list until all valid paths have been compared. The following section lists the sequence of steps in the BGP best path selection process:
- If the path specifies a NEXT_HOP that is inaccessible, drop the update. This means that the NEXT_HOP for each route must be reachable in the local routing table; otherwise, the local router discards the route
- Prefer the path with the largest WEIGHT. WEIGHT is a Cisco proprietary attribute that is locally significant to the BGP speaker on which it is configured
- If the WEIGHT values are the same, prefer the path with the largest LOCAL_PREF. Unlike WEIGHT, LOCAL_PREF is propagated throughout the AS; higher values are preferred
- If LOCAL_PREF values are the same, prefer the path that was originated by BGP running on this router. This could be via the use of the network or aggregate-address router configuration commands or through redistribution of another routing protocol into BGP via the redistribute command. Local paths sourced using the network or redistribute commands are preferred over those sourced using the aggregate-address command
- If no route was originated, prefer the route that has the shortest AS_PATH. However, if the bgp bestpath as-path ignore command is issued on the router, the AS_PATH attribute is not used in BGP best path selection. Also, when comparing this attribute, an AS_SET is counted once, regardless of the number of autonomous systems in the set. And, finally, the AS_CONFED_SEQUENCE is not included in the AS_PATH length
- If all paths have the same AS_PATH length, then prefer the path with the lowest ORIGIN. An ORIGIN of IGP (I) is more preferred (lower) than EGP (E) , which in turn in more preferred (lower) than Incomplete (?). In mathematical terms, IGP < EGP < Incomplete
- If the ORIGIN codes are the same, prefer the path with the lowest MED attribute. This step is executed, by default, only for routes from the same neighboring AS. MED values are not compared for routes received from different autonomous systems unless the bgp always-compare-med command is enabled on the router. Additionally, the bgp deterministic-med command can also be used to influence this step. This command is beyond the scope of the ROUTE exam and is not illustrated in this guide
- If the paths have the same MED, prefer the external path over the internal path. In other words, prefer the path known via eBGP versus the one known via iBGP
- If the paths are still the same, prefer the path through the closest IGP neighbor. In other words, prefer the path with the lowest IGP metric to the NEXT_HOP IP address
- Determine if multiple paths require installation into the routing table for BGP Multipath. Unlike other routing protocols that can load balance over up to 4 equal cost paths, by default, BGP only installs a single route into the routing table. However, BGP Multipath allows installation of multiple BGP paths to the same destination into the routing table
- When both paths are external, then prefer the path that was received first, i.e. the oldest one. This step minimizes route-flap because a newer path does not displace an older one, even if the newer path would be the preferred route based on the next decision criteria. This step can be omitted by issuing the bgp bestpath compare-routerid router subcommand
- Prefer the route that comes from the BGP router with the lowest router ID. The router ID is the highest IP address on the router, with preference given to Loopback addresses. You can use the bgp router-idcommand to manually set the RID. If a path contains Route Reflector (RR) attributes, the ORIGINATOR_ID is substituted for the RID in the BGP path selection process. The ORIGINATOR_ID attribute was described earlier in this chapter
- If the ORIGINATOR_ID or router ID is the same for multiple paths, prefer the path with the minimum cluster list length. This is only applicable to Route Reflector environments. It allows clients to peer with Route Reflectors or clients in other clusters. In this scenario, the client must be aware of the Route Reflector-specific BGP attribute
- Prefer the path that comes from the lowest neighbor address. This address is the IP address that is used for BGP peering and not the RID of the BGP peer. The address corresponds to the remote peer that is used in the TCP connection with the local router
Now that we have the BGP fundamentals covered, the following sections delve into the actual configuration of BGP in Cisco IOS software. We will begin by looking at how to enable BGP routing in Cisco IOS software followed by the configuration and validation of eBGP peers, followed by the configuration and validation of i BGP peers. We will conclude this chapter by learning how to advertise networks using BGP.