Cisco Systems OL-14356-01 Network Router User Manual


 
Implementing BGP on Cisco IOS XR Software
Information About Implementing BGP on Cisco IOS XR Software
RC-27
Cisco IOS XR Routing Configuration Guide
OL-14356-01
Adding Routes to the Routing Information Base
If a nonsourced path becomes the best path after the best-path calculation, BGP adds the route to the
Routing Information Base (RIB) and passes the cost communities along with the other IGP extended
communities.
When a route with paths is added to the RIB by a protocol, RIB checks the current best paths for the
route and the added paths for cost extended communities. If cost-extended communities are found, the
RIB compares the set of cost communities. If the comparison does not result in a tie, the appropriate best
path is chosen. If the comparison results in a tie, the RIB proceeds with the remaining steps of the
best-path algorithm. If a cost community is not present in either the current best paths or added paths,
then the RIB continues with the remaining steps of the best-path algorithm. See the “BGP Best Path
Algorithm” section on page RC-27 for information on the BGP best-path algorithm.
BGP Best Path Algorithm
BGP routers typically receive multiple paths to the same destination. The BGP best-path algorithm
determines the best path to install in the IP routing table and to use for forwarding traffic. This section
describes the Cisco IOS XR implementation of BGP best-path algorithm, as specified in Section 9.1 of
the Internet Engineering Task Force (IETF) Network Working Group draft-ietf-idr-bgp4-24.txt
document.
The BGP best-path algorithm implementation is in three parts:
Part 1—Compares two paths to determine which is better.
Part 2—Iterates over all paths and determines which order to compare the paths to select the overall
best path.
Part 3—Determines whether the old and new best paths differ enough so that the new best path
should be used.
Note The order of comparison determined by Part 2 is important because the comparison operation is not
transitive; that is, if three paths, A, B, and C exist, such that when A and B are compared, A is better,
and when B and C are compared, B is better, it is not necessarily the case that when A and C are
compared, A is better. This nontransitivity arises because the multi exit discriminator (MED) is
compared only among paths from the same neighboring autonomous system (AS) and not among all
paths.
Comparing Pairs of Paths
The following steps are completed to compare two paths and determine the better path:
1. If either path is invalid (for example, a path has the maximum possible MED value or it has an
unreachable next hop), then the other path is chosen (provided that the path is valid).
2. If the paths have unequal pre-bestpath cost communities, the path with the lower pre-bestpath cost
community is selected as the best path.
Note See the “BGP Cost Community” section on page RC-22 for details on how cost communities are
compared.