liveBook · Manning

Root cost

As explained in Acing the CCNA Exam: Volume 1 Fundamentals and Protocols

Root cost is the cumulative spanning-tree path cost from a switch through a port to the root bridge.

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

How Acing the CCNA Exam: Volume 1 Fundamentals and Protocols covers it

How deep it goes
Explains cumulative BPDU updates, standard port costs, and tie-breakers, but does not detail configurable cost commands.
Examples
Uses SW1, SW2, SW3, and SW4 advertisements with costs 0, 4, and 8, plus link-speed port-cost values.
What it assumes
Assumes familiarity with switches and ports while defining root bridge, BPDUs, bridge IDs, port IDs, and segments.
What you can do after
Evaluate STP path choices and predict root, designated, and blocking port selections from advertised costs.
How it connects
Connects root cost to spanning tree protocol, root bridge, BPDU, root port, designated port, bridge ID, and port ID.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Acing the CCNA Exam: Volume 1 Fundamentals and Protocols. The section links point to the parts of the book it draws on.