Spanning Tree Practice: Root Bridge and Port Roles

Unlimited spanning tree practice for the CCNA: find the root bridge, root ports, designated and blocked ports and root path costs on a new switch topology each time. Tap an answer to check it; a wrong pick names the slip, such as fewer hops instead of lower cost.

Pick an answer to see the election.

Costs are Cisco's defaults (short method): 100 Mbps 19, 1 Gbps 4, 10 Gbps 2. Priorities are shown without the VLAN number.

Practise for the CCNA

Spanning tree is CCNA topic 2.5 and ENCOR topic 3.1.c. Start with the free real exam questions, then get the full pack.

CCNA 200-3011,395 real exam questions · US$39
Free: 349 questionsGet the full pack
CCNP ENCOR 350-4011,066 real exam questions · US$39
Free: 266 questionsGet the full pack

Spanning tree FAQ

How is the root bridge elected?

The switch with the lowest bridge ID becomes the root bridge. The priority is compared first and the lowest value wins; the default is 32768. If priorities tie, the lowest MAC address wins, so with every switch on the default the lowest MAC is root.

How does a switch choose its root port?

Every switch except the root picks the port with the lowest total path cost to the root bridge: add the cost of every link on the way, not the number of hops. On a tie Cisco compares, in order, the lowest designated (neighbour) bridge ID, the lowest designated path cost and the lowest port ID.

Which port is designated on a link?

Each link (segment) gets one designated port: the port on the switch with the lowest path cost from that link to the root. If both switches have the same cost, the one with the lower bridge ID wins, because it sends the better BPDU. Every port on the root bridge is designated.

What are the default spanning tree port costs?

With the default short path cost method: 10 Mbps 100, 100 Mbps 19, 1 Gbps 4, 10 Gbps 2. A lower cost means a faster link.

What is an alternate port?

In Rapid PVST+ (802.1w) a port that is neither root nor designated is blocked. An alternate port receives a better BPDU from another switch and is a ready path to the root if the root port fails. A backup port receives a better BPDU from its own switch, which Cisco describes as a loopback configuration. Every link in the drill joins two different switches, so it has no backup ports.

What happens with two links between the same two switches?

If one link is faster, the slower link blocks. If both have the same speed and port priority, the interface with the lowest interface number forwards and the other blocks.

Why does show spanning-tree show 32769 instead of 32768?

With the extended system ID, Cisco splits the 2 priority bytes into a 4 bit priority and a 12 bit system ID equal to the VLAN number, so the VLAN number is added: the default 32768 on VLAN 1 shows as 32769. Priorities can only be set in steps of 4096. The drill shows the plain priority, which gives the same election.

What do root primary and root secondary set?

spanning-tree vlan 1 root primary sets the switch priority to 24576 if that makes it the root; if a root already has a lower priority, it sets 4096 less than the lowest. Root secondary sets 28672, so that switch takes over if the primary root fails.

Sources

Checked 20 November 2026 against Cisco's spanning tree configuration guides and the CCNA and ENCOR exam topics.

More free tools

All free tools