Cisco Systems IOS XR Laptop User Manual


 
Implementing BGP on Cisco IOS XR Software
Information About Implementing BGP on Cisco IOS XR Software
RC-19
Cisco IOS XR Routing Configuration Guide
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, it has the maximum possible MED value, or it has an
unreachable nexthop), then the other path is chosen (provided that the path is valid).
2. If the paths have unequal weights, the path with the highest weight is chosen. Note: the weight is
entirely local to the router, and can be set with the weight command or using a routing policy.
3. If the paths have unequal local preferences, the path with the higher local preference is chosen. Note:
If a local preference attribute was received with the path or was set by a routing policy, then that
value is used in this comparison. Otherwise, the default local preference value of 100 is used. The
default value can be changed using the bgp default local-preference command.
4. If one of the paths is a redistributed path, which results from a redistribute or network command,
then it is chosen. Otherwise, if one of the paths is a locally generated aggregate, which results from
an aggregate-address command, it is chosen.
Note Steps 1 through 4 implement the “Degree of Preference” calculation from Section 9.1.1 of
draft-ietf-idr-bgp4-24.txt.
5. If the paths have unequal AS path lengths, the path with the shorter AS path is chosen. This step is
skipped if bgp bestpath as-path ignore command is configured. Note: when calculating the length
of the AS path, confederation segments are ignored, and AS sets count as 1. (See Section 9.1.2.2a
of draft-ietf-idr-bgp4-24.txt.)
6. If the paths have different origins, the path with the lower origin is selected. Interior Gateway
Protocol (IGP) is considered lower than EGP, which is considered lower than INCOMPLETE. (See
Section 9.1.2.2b of draft-ietf-idr-bgp4-24.txt.)
7. If appropriate, the MED of the paths is compared. If they are unequal, the path with the lower MED
is chosen.
A number of configuration options exist that affect whether or not this step is performed. In general,
the MED is compared if both paths were received from neighbors in the same AS; otherwise the
MED comparison is skipped. However, this behavior is modified by certain configuration options,
and there are also some corner cases to consider. (See Section 9.1.2.2c of draft-ietf-idr-bgp4-24.txt.)