STP Cost / Root Bridge
Sum the STP path cost of a route to the root (by link speed, short and long IEEE 802.1t/w cost) and find the root bridge by priority and MAC among several switches.
Per-link breakdown
Cost by speed table (IEEE)
| Speed | Short cost (16-bit) | Long cost (32-bit) |
|---|
How STP / RSTP works
Long cost IEEE 802.1t/w (RSTP/MST) uses 32 bits:
cost = 20·10¹² / bps. It is the default on modern gear.
Short cost Classic STP (16 bits) saturates early:
any link ≥ 10 Gb stays at 2, which is why long cost is preferred.
Path cost Each switch picks its root port by the lowest cumulative cost to the root (sum of the links on the path).
Bridge ID priority (16 bits) + MAC (48 bits).
Priority comes in multiples of 4096 (default 32768).
Lowest priority wins; on a tie, the lowest MAC.
Runs locally in your browser · no sign-up · nothing leaves your browser
How it works
The tool has two modes. In path cost, you add the links along the path between your switch and the root (by speed, from 10 Mb to 100 Gb) and get the total cost on both scales: the long cost from IEEE 802.1t/w (32-bit, cost = 20·10¹² / bps, the one RSTP and MST use on modern gear) and the short cost from classic STP (16-bit: 100 for 10 Mb, 19 for 100 Mb, 4 for 1 Gb, 2 for 10 Gb and above).
In root bridge mode you enter several switches with their priority (multiples of 4096, between 0 and 61440, defaulting to 32768) and their MAC address. The Bridge ID packs the priority into the upper 16 bits and the MAC into the lower 48, and the lowest value wins the election: priority decides first and, on a tie, the lowest MAC, exactly as IEEE 802.1D defines.
Example: 3-link path (1 Gb + 1 Gb + 100 Mb)
- Long cost per link: 1 Gb →
20·10¹² / 10⁹ = 20,000; 100 Mb →200,000. - Total long cost: 20,000 + 20,000 + 200,000 = 240,000.
- Total short cost: 4 + 4 + 19 = 27. The 100 Mb link dominates the cost on both scales: upgrading it to 1 Gb pays off before touching anything else.