According to this cisco document (https://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/13753-25.html), shortest AS_PATH is the #4 algorithm in the sequence to evaluate, out of 13 in the list, after BGP picks the first valid path from the available list. It says:

"BGP assigns the first valid path as the current best path. BGP then compares the best path with the next path in the list, until BGP reaches the end of the list of valid paths."

I'm listing the algorithms it listed for convenience:

  1. Weight: Highest
  2. Local Preference: Highest
  3. Network or Aggregate: Locally originated
  4. AS_PATH: Shortest
  5. Origin type: Lowest origin number
  6. Multi-exit discriminator (MED): Lowest
  7. eBGP over iBGP:
  8. IGP metric: Shortest IGP path to BGP next hop
  9. Multiple paths: Highest number of multiple path in the routing table
  10. External paths: Oldest (whatever received first)
  11. Router ID: Lowest
  12. Cluster list: Minimum cluster list length
  13. Neighbor address: Lowest

However, according to the most of the video tutorials out there the 'shortest AS_PATH' algorithm seems BGP’s the only best path selection algorithm to the destination.

Am I catching it correct?

  • 2
    As with many things, there's the standard, and then there's the way vendors implement it. 1-3 in Cisco's list are means of overriding standard path selection (which is AS path length.)
    – Ricky
    Nov 24, 2020 at 21:12
  • Thanks both @Ron Maupin and Ricky for clarifying. Became rusty after long time not practicing this area.
    – Rafiq
    Nov 25, 2020 at 3:10

1 Answer 1


By default, the shortest path will be the best path. If you notice, the first three are locally configured options that you can use to override any selections that would normally be made by the shortest path.

For example, there may be times that you receive prefixes from multiple other ASes, but the AS with the shortest path has the lowest bandwidth, so you want to override the shortest path to use a different AS with a longer path, but much higher bandwidth.

Also, the options below the shortest path come into play in case of ties in the path length.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.