RSTP Path Cost Calculator
Work out 802.1D/802.1w port and root path costs using the long or short cost table, including aggregated links.
About RSTP Path Cost Calculator
Cost is inversely proportional to bandwidth, and the root path cost is the sum of the port costs a BPDU accumulates on its way from the root. The 16-bit short table saturates at 10 Gb — everything faster also costs 2 — which is why 802.1D-2004 introduced the 32-bit long table. Two links of very different speed can end up with the same cost under the short method, so the spanning tree happily blocks a 100 Gb link in favour of a 10 Gb one until you switch the whole domain to long costs.
Formulas
RSTP Path Cost
Long-method cost = 20,000,000 ÷ link speed in Mbps, giving 2,000,000 for 10 Mb, 200,000 for 100 Mb, 20,000 for 1 Gb, 2,000 for 10 Gb and 200 for 100 Gb.
- 20,000,000
- Numerator of the 802.1D-2004 long cost table, in Mbps
- root path cost
- Sum of the port costs along the path to the root bridge
- effective speed
- Member speed × members, because a bundle is costed as one logical link
802.1D-1998 short cost table
Short method: 100 for 10 Mb, 19 for 100 Mb, 4 for 1 Gb, 2 for 10 Gb and above.
Worked example
With the default values below, RSTP Path Cost Calculator returns Port Path Cost of 20,000. Change any input above and every figure here is recalculated in your browser.
Inputs used
- Link speedone of 10 Mbps, 100 Mbps, 1 Gbps, 10 Gbps, 25 Gbps, 40 Gbps, 100 Gbps, 400 Gbps
- 1 Gbps
- Cost methodone of Long — 802.1D-2004, 32-bit costs, Short — 802.1D-1998, 16-bit costs
- Long — 802.1D-2004, 32-bit costs
- Members in the port channelaccepts 1–32 links
- 1 links
- Hops to the root bridgeaccepts 1–40 hops
- 3 hops
Results
- Port Path Cost
- 20,000
- Root Path Cost
- 60,000
- Long-Method Cost
- 20,000
- Short-Method Cost
- 4
- Effective Link Speed
- 1,000 Mbps
- Fits the Cost Field
- Yes — 60000 of a 200000000 maximum
Step by step
- 1Values used
- 2RSTP Path Cost
- 3802.1D-1998 short cost table
- 4Port Path Cost= 20,000
- 5Root Path Cost= 60,000
- 6Long-Method Cost= 20,000
- 7Short-Method Cost= 4
- 8Effective Link Speed= 1,000 Mbps
- 9Fits the Cost Field= Yes — 60000 of a 200000000 maximum
Assumptions and limits
- The result is derived only from the 4 inputs listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax or compounding frequency into account.
- Figures are rounded for display to whole numbers, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
Frequently Asked Questions
How is RSTP Path Cost calculated?
Long-method cost = 20,000,000 ÷ link speed in Mbps, giving 2,000,000 for 10 Mb, 200,000 for 100 Mb, 20,000 for 1 Gb, 2,000 for 10 Gb and 200 for 100 Gb. Cost is inversely proportional to bandwidth, and the root path cost is the sum of the port costs a BPDU accumulates on its way from the root. The 16-bit short table saturates at 10 Gb — everything faster also costs 2 — which is why 802.1D-2004 introduced the 32-bit long table.
Why does RSTP Path Cost matter?
Two links of very different speed can end up with the same cost under the short method, so the spanning tree happily blocks a 100 Gb link in favour of a 10 Gb one until you switch the whole domain to long costs.
What values do I need to enter?
This calculator takes 4 inputs: Link speed, Cost method, Members in the port channel, Hops to the root bridge. The pre-filled defaults are a realistic starting point — replace them with figures from your own environment for a result you can act on.
Can I mix long and short costs in one domain?
No. Cost is carried in the BPDU with no indication of which table produced it, so a mixed domain compares incompatible numbers and picks the wrong root port. Change every bridge in the region together.
