Root cost measures how efficient a switch’s path to the root bridge is. It is the cumulative cost of the ports along that path, not merely the local port’s cost. Lower values represent better paths. section 14.3.2
The root bridge advertises a root cost of 0 in its BPDUs. Each non-root switch forwards the BPDU after adding the cost of the port on which it received it, allowing downstream switches to calculate their paths. section 14.3.2 section 14.6
Root cost affects two important STP decisions:
- A non-root switch selects the port offering the lowest root cost as its root port. Equal costs require the neighbor BID, then the neighbor port ID, as tie-breakers. section 14.3.2 section 14.6
- Each link selects a designated port by comparing the connected switches’ root costs; the lower-cost side wins, with BID as the tie-breaker. section 14.3.3
Comparing advertised costs
If SW3 is the root bridge, it advertises cost 0. SW1 and SW4 advertise cost 4, while SW2 advertises cost 8. SW4 therefore selects the port with the lowest available root cost. Where costs tie, STP continues with BID or port-ID comparisons.
Table 14.1 STP port cost values (view table figure)
| Speed |
Cost |
|---|---|
| 10 Mbps |
100 |
| 100 Mbps |
19 |
| 1 Gbps |
4 |
| 10 Gbps |
2 |
Use the port-cost table to compare the default costs associated with common link speeds: 10 Mbps, 100 Mbps, 1 Gbps, and 10 Gbps. section 14.3.2
