BGP decision process with ADD-PATH

To use multiple paths per NLRI for forwarding and to advertise multiple paths per NLRI to add-path peers, a router implementing an add-path must run a modified version of the BGP decision process. The existing BGP decision algorithm selects the one best path for any particular NLRI. Paths that are second best or third best remain in the RIB-IN but are not installed in the LOC-RIB and not advertised to peers.

The system automatically changes its BGP decision process for routes belonging to a particular address family whenever either of the following applies:

When BGP PIC is enabled, the BGP decision process selects a backup path per prefix or NLRI to install in the LOC_RIB. The algorithm is summarized as follows:

  1. Select the single best path based on a full evaluation of all the BGP tie-breaking rules, as described in the following examples:

    1. Select the route with the highest route preference.

    2. From all routes with an AIGP metric, select the route with the lowest sum of the AIGP metric value stored with the RIB-IN copy of the route and the iteratively resolved distance between the calculating router and the BGP NEXT_HOP of the route.

    3. Select the route with the highest local preference (LOCAL_PREF).

    4. Select the route with the shortest AS path.

    5. Select the route with the lowest origin.

    6. Among routes advertised by the same neighbor AS (unless always-compare-med is configured). Select the route with the lowest MED.

    7. Prefer routes learned from eBGP peers over routes learned from iBGP peers.

    8. Select the route with the lowest IGP cost (unless ignore-nh-metric is configured).

    9. Select the route received by the peer with the lowest originator ID or BGP identifier.

    10. Select the route with the shortest cluster list.

    11. Select the route received from the lowest peer IP address.

  2. Select up to one additional second best path among the paths remaining after removing from consideration all paths with a NEXT_HOP or BGP identifier (or originator ID) in common with any of the previously-selected best paths. A full evaluation of all the BGP tie-breaking rules is required to find this single second-best path, as shown in the following examples:

    1. Select the route with the highest route preference.

    2. Select the route with the highest local preference (LOCAL_PREF).

    3. Select the route with the shortest AS path (unless as-path-ignore is configured).

    4. Select the route with the lowest origin.

    5. Among routes advertised by the same neighbor AS (unless always-compare-med is configured) select the route with the lowest MED.

    6. Prefer routes learned from eBGP peers over routes learned from iBGP peers.

    7. Select the route with the lowest IGP cost.

    8. Select the route received by the peer with the lowest originator ID or BGP identifier.

    9. Select the route with the shortest cluster list.

    10. Select the route received from the lowest peer IP address.