STP Cost Calculator
Calculate the Spanning Tree Protocol (STP) path cost for a link based on its speed, using IEEE 802.1D/802.1T values.
Inputs
Used to estimate cumulative path cost across multiple identical links.
Total STP Path Cost
60,000
Cost per Link
20,000
Link Speed
1 Gbps
Standard Used
IEEE 802.1T (long)
Step by step
Values used
Link Speed = 1 Gbps (Gigabit Ethernet); Number of Hops to Root = 3; Cost Standard = IEEE 802.1T (long, current)
STP path cost
path_cost = per_link_cost(speed) × number_of_hops
Total STP Path Cost
= 60,000
Cost per Link
= 20,000
Link Speed
= 1 Gbps
Standard Used
= IEEE 802.1T (long)
How it works
Spanning Tree Protocol assigns a cost to each link based on its speed, and switches sum these costs along every path to the root bridge to determine the lowest-cost (fastest, most direct) path, which becomes the active forwarding path while redundant paths are blocked to prevent loops. The legacy 802.1D 'short' cost values used a 16-bit scale poorly suited to modern high-speed links, so the 802.1T 'long' cost values use a much wider 32-bit range that better differentiates between 1G, 10G, 40G, and 100G links.
Formula
STP path cost
path_cost = per_link_cost(speed) × number_of_hops
- C_{link}(v)
- Cost assigned to a link of speed v
- h
- Number of hops to the root bridge
Frequently Asked Questions
What are the standard STP cost values by link speed?
Under the IEEE 802.1T 'long' method (current default): 10 Mbps = 2,000,000; 100 Mbps = 200,000; 1 Gbps = 20,000; 10 Gbps = 2,000; 40/100 Gbps = 500/200. Under the older 802.1D 'short' method: 10 Mbps = 100; 100 Mbps = 19; 1 Gbps = 4; 10 Gbps and above = 2.
Why does a lower cost win in Spanning Tree?
STP's root path cost represents the cumulative 'expense' of reaching the root bridge — lower cost implies a faster, more direct path. Switches select the path with the lowest total accumulated cost as the active forwarding path, blocking higher-cost redundant paths to prevent Layer 2 loops.
Why did IEEE introduce the 'long' cost method?
The original 'short' method used an 8-bit-derived scale (values like 2, 4, 19, 100) that couldn't meaningfully distinguish between very fast modern links — 10G, 40G, and 100G all round to nearly the same cost. The 'long' method uses much larger, more granular values so higher-speed links are still clearly favored over slower ones even at multi-gigabit scale.