Versa BGP Path Selection - Internal KB


Question

What is the Versa BGP Path Selection?


Solution

Note : Versa does not compare AS path when same route is received from both SD-WAN and EBGP with same preference.

Other vendors may also not compare AS path if route with same preference is received from both SD-WAN and EBGP.


This is Versa BGP Path selection algorithm:

  1. Compare local preference. Prefer path with highest local preference.
  2. Compare with locally originated routes. Prefer locally originated routes.
  3. Compare the AS path length. Prefer lowest AS path unless configured to ignore AS path length.
  4. Compare the origin code number. If origin code is different - Lower is better. (IGP is preferred over EGP which is preferred over INCOMPLETE)
  5. Compare the MED. Prefer routes with lower MED.
  6. Prefer routes received from EBGP over IBGP - This is checked by comparing the remote AS number for the neighbor with our local AS number.
  7. Compare IGP cost for BGP nexthop.
    Lower IGP cost is preferred - This comparison can only be made if both routes have a valid IGP cost.
  8. Compare the BGP identifier of the neighbor. If either route has an ORIGINATOR_ID, this is used as the BGP identifier (in accordance with draft-ietf-idr-rfc2796bis-01) - BGP identifiers are different, lower is better
  9. Compare the CLUSTER_LIST lengths of routes. The route with the shorter length is preferred. A route with no CLUSTER_LIST is considered to have a length of zero.
  10. Compare the peer addresses.
    1. First compare the address type - IPv6 is preferred over IPv4.
    2. If both peer addresses are same address type – lower peer IP is preferred.
  11. Compare remote ports. Lower port is preferred.
  12. Compare path IDs
    Lower is preferred - This ensures deterministic results when a peer re-advertises the same route with a different path ID, and advertises the new route before withdrawing the old one.