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.
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.
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
- Cisco, Catalyst 9200 Layer 2 Configuration Guide (IOS XE 16.12), Configuring Spanning Tree Protocol: port roles, root bridge by lowest bridge ID (priority, then MAC), root port and designated port by lowest path cost, default priority 32768, port priority 128, default costs, extended system ID, root primary 24576 and secondary 28672, redundant links (lowest interface number forwards).
- Cisco, Catalyst 3850 Consolidated Configuration Guide, Configuring Spanning Tree Protocol: the root port order (lowest root bridge ID, path cost, designated bridge ID, designated path cost, port ID) and root primary setting 4096 less than the lowest root priority when 24576 is not low enough.
- Cisco, Understand Rapid Spanning Tree Protocol (802.1w): root, designated, alternate and backup roles; a designated port sends the best BPDU on its segment.
- Cisco, 200-301 CCNA v2.0 exam topics (2.5 Rapid PVST+: root port, root bridge, port states and roles) and 350-401 ENCOR v1.2 exam topics (3.1.c spanning tree protocols).
- Checked 20 November 2026. The tool's own approach: topologies are generated, links are point to point, every port keeps priority 128, and two links between the same switches are numbered in the same order on both ends. An independent re-solver (all simple paths for the cost and a BPDU exchange simulation for the roles) agreed with the drill on 6,000 generated questions.
Checked 20 November 2026 against Cisco's spanning tree configuration guides and the CCNA and ENCOR exam topics.
- DrillCisco ACL practiceFind the line a packet matches and write standard and extended ACLs.
- DrillOSPF practicePick the DR and BDR, find the router ID and work out the lowest cost path.
- DrillEtherChannel and port security practicePredict whether an EtherChannel forms, what port security does with a frame and whether DTP makes a trunk.