STP Animator — watch switches elect a root bridge
Spanning Tree is the protocol CCNP ENCOR candidates must see, not just memorize. On this page four switches share a looped topology, elect a root, choose root and designated ports, and block the redundant ones — and then a rogue switch tries to steal the root, and you stop it. Every step is graded.
The scenario — a looped network that must not loop
CertCrack.com runs a small enterprise network. Four switches — S1, S2, S3 and S4 — are wired in a square with a diagonal link for redundancy, so there are five links and at least two loops. Ethernet frames have no time-to-live: one loop would flood the network forever. Spanning Tree's job is to pick one loop-free tree and block the rest — and to unblock a backup the moment the active path fails.
Your job, in five stages: 1) watch the switches elect a root bridge, 2) work out which port forwards and which one blocks, 3) break a link and an EtherChannel member and compare 802.1D with RSTP, 4) catch the rogue switch that tries to steal the root, and 5) prove it with six graded exercises. The lab saves your progress in this browser.
Stage 1 — Watch the root bridge get elected
Press Elect the root → and watch the switches exchange BPDUs. Each one starts by claiming to be the root; the lowest bridge ID — lowest priority first, then lowest MAC address — wins, and the tree is built out from there. Then change a priority below and watch the root move — that is the rule, drawn.
All four switches have just powered on. Each one believes it is the root bridge, and each one is about to send BPDUs claiming so.
Try it: set S1's priority to 4096 and press Elect the root again — S1 becomes the root and S3 drops to an ordinary switch, because the lowest priority wins outright. Set S1 and S3 to the same priority and the tie is broken by MAC address: S1's MAC ends in :01, so S1 still wins. Real-world note: on a real network the root does not change when a higher-priority switch joins later — the election only runs while the tree first forms, or when the root disappears. This simulator re-runs the election when you change a priority so you can see the rule working.
Stage 2 — Port roles: who forwards, who blocks
The tree is built from three rules. Every non-root switch keeps one root port — its cheapest path to the root. Every segment keeps one designated port — the end with the cheapest path to the root. Every other port is an alternate port in Blocking: it listens to BPDUs, drops traffic, and waits. Change a cost or kill a link below and watch the tree reconverge.
| Switch | Root port | Cost to root | Blocked ports |
|---|
Convergence: the tree is converged — every switch has exactly one root port and every segment has one designated port.
Try it: kill the S2 — S3 link. Whichever switch was reaching the root through that link loses its root port, so its blocked port unblocks and becomes its new root port — in about 2 seconds under RSTP, or after the 20-second Max Age plus 30 seconds of Listening and Learning under classic 802.1D. Change the mode above and kill the link again to feel the difference. (Which switch reroutes depends on where the root is — with the default root S3 it is S2; after moving the root to S1 in Stage 1 it is S3.)
Stage 3 — EtherChannel and RSTP: what survives a failure
SW-A is the root. It reaches SW-B over a two-member LACP EtherChannel, and SW-C gives the triangle its backup path — SW-C's port on the SW-B — SW-C segment is blocked today. Break things below and watch what STP does about it.
STP sees Port-channel 1, not two separate links. Fail one member and the bundle stays up on the other — STP never notices. Fail the whole bundle and SW-B loses its root port, so the blocked port via SW-C has to take over.
The RSTP difference, in seconds: under classic 802.1D the alternate port waits out Max Age (20 s) and then Listening (15 s) and Learning (15 s) — about 50 seconds with no traffic. Under RSTP the switches agree by proposal and agreement, and the alternate port forwards in about 2 seconds. Press Fail the whole bundle in each mode and watch the timer.
Stage 4–5 — Prove it: six graded exercises
Work each exercise, press Check, and read the explanation — right or wrong, the explanation is where the learning happens. Your best score is saved in this browser.
Exercise 1 — Put convergence in order (7 points)
Click the seven steps of STP convergence in the order they happen, from the moment the switches power on to a stable, loop-free tree.
Exercise 2 — Elect the root bridge (2 points)
Four switches share one network. Their priorities and MAC addresses are:
| Switch | Priority | MAC address |
|---|---|---|
| S1 | 32768 | 00:00:00:00:00:11 |
| S2 | 4096 | 00:00:00:00:00:1a |
| S3 | 8192 | 00:00:00:00:00:33 |
| S4 | 4096 | 00:00:00:00:00:09 |
Exercise 3 — Which port blocks? (3 points)
S1 is the root. S2 and S3 each connect to S1 at cost 19, and S2 — S3 connect to each other at cost 19. S2's bridge ID is lower than S3's.
Exercise 4 — Match the timers and roles (6 points)
Match each description to the STP timer or port role it describes.
Exercise 5 — EtherChannel: what survives? (2 points)
SW-A and SW-B are joined by a two-member LACP EtherChannel, and SW-C provides a blocked backup path.
Exercise 6 — Fault challenge: the rogue root (2 points)
A new switch, S5, was plugged into the network this morning. Since then, traffic between the floors takes a strange path. Read the evidence and find the fault.
Work the six exercises above — your score updates after every check. 80% (18 of 22) is the pass mark.
Port states at a glance
| State | Receives BPDUs | Learns MACs | Forwards traffic |
|---|---|---|---|
| Disabled | No | No | No — administratively shut down |
| Blocking | Yes | No | No — the backup path, waiting |
| Listening | Yes | No | No — 15 seconds (Forward Delay) |
| Learning | Yes | Yes | No — 15 seconds (Forward Delay) |
| Forwarding | Yes | Yes | Yes — root and designated ports |
RSTP simplifies this to three states — Discarding (Blocking + Listening combined), Learning and Forwarding — and skips the waiting wherever it can negotiate instead.
Timers and roles at a glance
| Item | Value / rule | What it does |
|---|---|---|
| Hello time | 2 seconds | How often the root sends BPDUs |
| Max Age | 20 seconds | How long a switch waits for a BPDU before the root is declared gone |
| Forward Delay | 15 seconds | Time spent in Listening, then again in Learning |
| 802.1D convergence | 30–50 seconds | Max Age + Listening + Learning after a failure |
| RSTP convergence | ~1–2 seconds | Proposal / agreement handshake; alternate ports forward at once |
| Root port | One per non-root switch | Lowest-cost path to the root |
| Designated port | One per segment | Lowest-cost end of the segment; forwards BPDUs and traffic |
| Alternate port | Blocking | The backup path — receives BPDUs, drops traffic |
Keep going
STP is one piece of ENCOR Layer 2. The same habits — read the evidence, work the numbers, verify — carry into every other topic: try the OSPF Routing Visualizer for the Layer 3 half of the same story, the Journey of a Packet to follow a packet through NAT and routing, and the CLI Trainer for configuration practice. This is the second tool in the CCNP ENCOR suite — more are coming.
Questions students ask
Why do switches stop at Blocking instead of just using the link?
Because Ethernet has no time-to-live. A frame on a looped network circles forever, gets flooded out of every port on every lap, and every switch learns the same source MAC on a different port each time. Blocking the redundant port breaks the loop while keeping the link as a backup that can unblock in seconds if the active path fails.
What is the difference between a root port and a designated port?
A root port is the one port on a non-root switch that points toward the root — the cheapest way home. A designated port is the one port on a segment that is allowed to forward for that segment — the end of the segment closest to the root. A root port never forwards BPDUs downstream; a designated port does. The root switch has no root port: all of its ports are designated.
Does PortFast skip STP?
PortFast skips Listening and Learning so an access port forwards immediately — but it must only ever face an end device, never another switch. A switch plugged into a PortFast port can loop the network before STP notices, which is why PortFast ports should always have BPDU Guard: the first BPDU received shuts the port down (err-disable).
Why is the root bridge's placement worth planning?
Because every path in the tree is measured from the root. If an old access switch with a low MAC becomes root by accident, all traffic hairpins through it — slow links, overloaded CPU, and a spanning tree shaped around the weakest box in the building. Set the core switch's priority low (4096 or 8192) on purpose, and guard the edge with Root Guard.