BGP Best-Path Simulator
Enter the candidate routes and see which one wins, and at which step it won. The order below is the common one; it is not universal, and every step applied is named.
Local toolYour network plan stays in your browser. Nothing you enter is uploaded, logged, or sent to any server.
How it was decided
Full ordering
The decision order, and where it is not universal
BGP compares candidate routes attribute by attribute and stops at the first difference. The order applied here is:
- Highest weight — platform-specific and local to one router. Off unless you turn it on, because it does not exist everywhere.
- Highest local preference — carried within your AS, and the usual lever for choosing an exit.
- Locally originated routes beat learned ones.
- Shortest AS path. An AS_SET counts as one entry however many ASNs it contains.
- Lowest origin type — IGP beats EGP beats incomplete.
- Lowest MED, but see below.
- eBGP over iBGP.
- Lowest IGP metric to the next hop — the "hot potato" step, handing traffic off at the nearest exit.
- Lowest router ID, then lowest neighbour address, as tie-breaks.
The MED rule catches everyone. MED is only compared between routes learned from the same neighbouring AS, because it is a hint from that neighbour about which of its own entry points to prefer. Comparing MEDs from two different providers compares numbers that were never on the same scale. Most platforms behave this way by default and offer a knob to change it; switching that on has surprised a great many people.
Real deployments also insert policy — route maps, filters, communities acting on local preference — before any of this runs. A simulator shows the algorithm, not your configuration.
Related tools
AS-Path Visualizer breaks down a path. OSPF Area Designer covers the interior protocol.