Physical topology vs. logical topology
STP doesn't change the cables. It only changes which ports are allowed to forward traffic. The physical topology (how the cables connect) is still a triangle. The logical topology (the paths traffic can really use) becomes a tree. A tree has exactly one path between any two switches, so a frame has no circle to go round.
- 1. The same broadcast as the “Why is Spanning Tree needed?” lesson… PC A sends one broadcast.
- 2. SW2 floods it… to SW1 and to SW3, the same as before.
- 3. …but one port is blocked. STP has blocked SW3's port on the SW2–SW3 link. So SW3 throws away the copy from SW2.
- 4. Exactly one copy arrives. The copy from SW1 reaches PC B. There is no loop and no storm.
Why one blocked port is enough: a loop needs a full circle of forwarding ports. Break the circle in one place and the loop is gone. In bigger networks, STP blocks one port for every extra path.
What a blocked port still does
| Blocked port | Forwarding port | |
|---|---|---|
| Forwards user frames | No: throws them away | Yes |
| Learns MAC addresses | No | Yes |
| Receives BPDUs (STP messages) | Yes: keeps listening | Yes |
| Link light | On: the cable is up | On |
A blocked port is not broken. It is a standby path. It keeps listening to STP messages, so it knows straight away when it is needed.
When a link fails, STP unblocks the backup
- 1. Normal. PC B reaches SW1 directly.
- 2. The SW1–SW3 cable fails. SW3 stops hearing from SW1 on that cable.
- 3. The backup takes over. STP unblocks SW3's port toward SW2. Now traffic goes through SW2. How fast this happens depends on the STP version (Modules 2 and 4).
What STP gives you
- No loops: exactly one working path between any two switches.
- Automatic backup: spare paths stay connected and are turned on when needed.
- No manual work: the switches agree on it by sending messages to each other.
The downside: a blocked link carries no traffic while it waits, so some bandwidth is wasted. Per-VLAN Spanning Tree (Module 3) can block different links for different VLANs, so more links are used.
Check yourself
Does STP physically disconnect the redundant cable?
A network has 4 switches in a square (4 links). How many ports must STP block to remove the loop?