Difference between revisions of "Manual:BGP Best Path Selection Algorithm"

From MikroTik Wiki
Jump to: navigation, search
Line 48: Line 48:
[[Category:Case Studies]]
[[Category:Case Studies|B]]

Revision as of 12:00, 14 April 2010



You should note that MikroTik and Cisco BGP routers have weight as the first criteria in the table where other brands do not.

Best path algorithm compares routes received by a single BGP instance. Routes installed by different BGP instances are compared by the general algorithm, i.e. route distances are compared and the route with lower distance is preferred.


  1. Router is ignoring received path if the route is not valid. Route is valid if:
    • NEXT_HOP of the route is valid and reachable
    • AS_PATH received from external peers does not contain the local AS
    • route is not rejected by routing filters

    For more information read nexthop selection and validation.

  2. The first path received is automatically considered 'best path'. Any further received paths are compared to first received to determine if the new path is better.
  3. Prefer the path with the highest WEIGHT.
  4. Prefer the path with the highest LOCAL_PREF. It is used only within an AS.
    A path without LOCAL_PREF attribute have a value of 100 by default.
  6. Prefer the path that was locally originated via aggregate or BGP network
  7. Prefer the path with the lowest ORIGIN type.
    in other words IGP < EGP < INCOMPLETE
  8. Prefer the path with the lowest multi-exit discriminator (MED).
    The router compare MED attribute only for paths that have the same neighboring (leftmost) AS. Paths without explicit MED value are treated as with MED of 0
  9. Prefer eBGP over iBGP paths
  10. Prefer the route that comes from the BGP router with the lowest router ID. If a route carries the ORIGINATOR_ID attribute, then the ORIGINATOR_ID is used instead of router ID.
  11. Prefer the route with the shortest route reflection cluster list. Routes without a cluster list are considered to have a cluster list of length 0.
  12. Prefer the path that comes from the lowest neighbor address