If you've ever connected two switches with two cables (for redundancy, or by mistake), you've probably seen it can bring down the entire network within seconds. This is called a switching loop, and Spanning Tree Protocol (STP) is designed exactly to prevent it — one of the most important and least-understood networking protocols.
The problem: why is a loop dangerous?
Switches operate on broadcasts — when a broadcast packet (like an ARP request) enters a switch, it goes out every port except the one it came in on. If two switches are connected by two physical paths, this packet circulates endlessly between the two switches and quickly consumes the entire network's bandwidth — this is called a broadcast storm.
The solution: how STP works
STP automatically, with no manual configuration needed, identifies redundant paths between switches and logically blocks one of them so only one active path remains — exactly like a tree, which has no loops in its structure (hence the name: Spanning Tree). If the active path fails, STP automatically activates the backup path.
Step 1: Check STP's default status
The good news is STP is enabled by default on most Cisco switches. To view its status:
enable
show spanning-tree
Step 2: Reading the output
In this command's output, you'll see a few key concepts:
Root Bridge: the switch chosen as the "root of the tree" — all paths are calculated relative to this switch.
Ports in Forwarding state: ports actively passing traffic.
Ports in Blocking state: ports STP has kept disabled to prevent a loop (but ready to activate if the primary path fails).
Step 3: Viewing the root bridge specifically
show spanning-tree root
This command directly shows which switch is the network's root bridge — very useful info when troubleshooting network issues.
Pro tip
In real enterprise networks, the admin usually manually designates which switch should be the root bridge (typically the network's central, most powerful switch) instead of letting STP choose based purely on default values — this is done with the spanning-tree vlan 1 priority 4096 command on the target switch.
Why should STP be understood, not just ignored?
Many strange, intermittent enterprise network issues (sudden slowness, brief outages after plugging in a new cable) trace back to STP changes. Understanding this protocol is exactly the kind of real network mastery covered in my CCNA courses.
Blog