"Why Did the Entire Network Just Die?"
In a resilient office network, you connect switches with redundant cables — if one cable fails, traffic reroutes through the backup. This is good for reliability. But it creates a dangerous problem: loops.
Imagine Switch A is connected to Switch B by two cables. A device broadcasts a packet (like an ARP request). Switch A sends it out both cables to Switch B. Switch B receives two copies and forwards both back to Switch A. Switch A forwards them again. Within milliseconds, the network is flooded with billions of copies of the same packet. CPU usage on every switch hits 100%. All legitimate traffic is crowded out. The network appears completely dead. This is a broadcast storm.
Spanning Tree Protocol (STP) prevents this by ensuring there is only ever one active path between any two switches, even if multiple physical paths exist. It does this by putting redundant ports into a blocking state — the cable is physically connected, but the port refuses to forward traffic. If the primary path fails, STP detects the failure and unblocks the redundant port within 30–50 seconds (classic STP) or 1–6 seconds (RSTP — Rapid Spanning Tree Protocol).
How STP Chooses the Active Path:
- Switches elect a Root Bridge — the switch with the lowest Bridge ID (a combination of a configurable priority value and the switch's MAC address). All other switches calculate the shortest path to the Root Bridge.
- Ports on the shortest path to the Root Bridge become designated ports (forwarding).
- Redundant ports that would create loops become root ports or blocked ports.
Network topology:
Switch A (Root Bridge, priority 4096)
| |
Switch B Switch C
|______________|
(This link is blocked by STP to prevent a loop)
Why This Matters for Operations:
A misconfigured switch priority can cause a cheap unmanaged switch (plugged in by an employee) to accidentally become the Root Bridge, forcing all traffic to route through it. This degrades performance for the entire network. Always set explicit STP priorities on your core switches to ensure they remain the Root Bridge.
Modern enterprise networks often use RSTP (802.1w) instead of classic STP for faster convergence, and MSTP (802.1s) when multiple VLANs need independent spanning tree instances.