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:
- Compare local preference. Prefer path with highest local preference.
- Compare with locally originated routes. Prefer locally originated routes.
- Compare the AS path length. Prefer lowest AS path unless configured to ignore AS path length.
- Compare the origin code number. If origin code is different - Lower is better. (IGP is preferred over EGP which is preferred over INCOMPLETE)
- Compare the MED. Prefer routes with lower MED.
- Prefer routes received from EBGP over IBGP - This is checked by comparing the remote AS number for the neighbor with our local AS number.
- 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. - 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
- 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.
- Compare the peer addresses.
- First compare the address type - IPv6 is preferred over IPv4.
- If both peer addresses are same address type – lower peer IP is preferred.
- Compare remote ports. Lower port is preferred.
- 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.