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-23
Cisco IOS XR Routing Configuration Guide
OL-14356-01
the path. The path with the lowest cost community number is preferred. Paths that are not specifically
configured with the cost community number are assigned a default cost community number of
2147483647 (the midpoint between 0 and 4294967295) and evaluated by the best-path selection process
accordingly. When two paths have been configured with the same cost community number, the path
selection process prefers the path with the lowest cost community ID. The cost-extended community
attribute is propagated to iBGP peers when extended community exchange is enabled.
The following commands can be used to apply the route policy that is configured with the cost
community set clause:
route-policy at:
aggregate-address
redistribute
network
How BGP Cost Community Influences the Best Path Selection Process
The cost community attribute influences the BGP best-path selection process at the point of insertion
(POI). By default, the POI follows the Interior Gateway Protocol (IGP) metric comparison. When BGP
receives multiple paths to the same destination, it uses the best-path selection process to determine which
path is the best path. BGP automatically makes the decision and installs the best path in the routing table.
The POI allows you to assign a preference to a specific path when multiple equal cost paths are available.
If the POI is not valid for local best-path selection, the cost community attribute is silently ignored.
Cost communities are sorted first by POI then by community ID. Multiple paths can be configured with
the cost community attribute for the same POI. The path with the lowest cost community ID is
considered first. In other words, all cost community paths for a specific POI are considered, starting with
the one with the lowest cost community. Paths that do not contain the cost community cost (for the POI
and community ID being evaluated) are assigned the default community cost value (2147483647). If the
cost community values are equal, then cost community comparison proceeds to the next lowest
community ID for this POI.
To select the path with the lower cost community, simultaneously walk through the cost communities of
both paths. This is done by maintaining two pointers to the cost community chain, one for each path, and
advancing both pointers to the next applicable cost community at each step of the walk for the given POI,
in order of community ID, and stop when a best path is chosen or the comparison is a tie. At each step
of the walk, the following checks are done:
If neither pointer refers to a cost community,
Declare a tie;
Elseif a cost community is found for one path but not for the other,
Choose the path with cost community as best path;
Elseif the Community ID from one path is less than the other,
Choose the path with the lesser Community ID as best path;
Elseif the Cost from one path is less than the other,
Choose the path with the lesser Cost as best path;
Else Continue.
Note Paths that are not configured with the cost community attribute are considered by the best-path selection
process to have the default cost value (half of the maximum value [4294967295] or 2147483647).
Applying the cost community attribute at the POI allows you to assign a value to a path originated or
learned by a peer in any part of the local autonomous system or confederation. The cost community can
be used as a “tie breaker” during the best-path selection process. Multiple instances of the cost
community can be configured for separate equal cost paths within the same autonomous system or