Spanning Tree Protocol (STP, RSTP & MSTP) Explained – Cisco Loop Prevention
Learn how Cisco’s Spanning Tree Protocol family (STP, RSTP, and MSTP) prevents network loops, ensures redundancy, and stabilizes switch topologies in enterprise networks.

🔹 Introduction
In Ethernet networks, redundancy is vital — but it can create a hidden danger: network loops. A single loop can flood the LAN with broadcast storms, bringing the entire network down.
That’s why Cisco uses Spanning Tree Protocol (STP) — a powerful mechanism that ensures loop-free, redundant topologies.
In this blog, we’ll explore how STP, RSTP, and MSTP work, their differences, and how to configure them.
🔹 1. What is Spanning Tree Protocol (STP)?
STP is a Layer 2 protocol that prevents network loops in Ethernet topologies with redundant links.
Developed by Radia Perlman, STP allows only one active path between switches, while keeping backup paths blocked until needed.
🔹 2. STP Core Concepts
| Term | Meaning |
|---|---|
| Root Bridge | The central switch of the STP topology (chosen automatically based on Bridge ID). |
| Bridge ID (BID) | Combination of priority (default 32768) + MAC address — used to elect the Root Bridge. |
| Root Port (RP) | The best path toward the Root Bridge. |
| Designated Port (DP) | Forwards frames toward other switches. |
| Blocked Port | Prevents loops by not forwarding frames. |
🧠 Example: If two switches have equal priority, the one with the lowest MAC address becomes the Root Bridge.
🔹 3. STP Port States
| State | Function |
|---|---|
| Blocking | Listens for BPDUs, doesn’t forward traffic. |
| Listening | Prepares to forward, still no traffic passing. |
| Learning | Learns MAC addresses. |
| Forwarding | Actively forwards traffic. |
| Disabled | Administratively turned off. |
🕒 STP convergence (time to re-calculate paths) can take up to 50 seconds, which can be slow in large networks.
🔹 4. RSTP (Rapid Spanning Tree Protocol)
RSTP (IEEE 802.1w) improves on STP by offering faster convergence — typically within 1–3 seconds. It introduces new port roles and simplified transitions.
New Port Roles:
- Alternate Port: Backup for Root Port.
- Backup Port: Backup for Designated Port.
RSTP Benefits:
- Faster topology recovery.
- Backward-compatible with STP.
- Ideal for enterprise environments needing rapid failover.
Enable RSTP:
Switch(config)# spanning-tree mode rapid-pvst
🔹 5. MSTP (Multiple Spanning Tree Protocol)
MSTP (IEEE 802.1s) allows multiple VLANs to share a single spanning tree instance — reducing CPU load and improving scalability.
Example:
Switch(config)# spanning-tree mode mst
Switch(config)# spanning-tree mst configuration
Switch(config-mst)# name NETVORX
Switch(config-mst)# instance 1 vlan 10,20,30
Switch(config-mst)# exit
🧠 Why MSTP?
- Groups VLANs logically.
- Reduces the number of STP calculations.
- Enhances performance in large VLAN environments.
🔹 6. STP Mode Comparison
| Feature | STP (802.1D) | RSTP (802.1w) | MSTP (802.1s) |
|---|---|---|---|
| Convergence | 30–50 sec | 1–3 sec | 1–3 sec |
| VLAN Support | 1 instance per VLAN | 1 per VLAN | Multiple VLANs per instance |
| Scalability | Low | Medium | High |
| Cisco Command | spanning-tree mode pvst | spanning-tree mode rapid-pvst | spanning-tree mode mst |
🔹 7. STP Configuration Example (Cisco PVST+)
Switch(config)# spanning-tree mode pvst
Switch(config)# spanning-tree vlan 10 priority 4096
Switch(config)# show spanning-tree vlan 10
Explanation:
- Enables Per VLAN Spanning Tree.
- Adjusts bridge priority to influence Root Bridge election.
🧠 Tip: Always plan which switch should become the Root Bridge — usually your core switch.
🔹 8. Troubleshooting Commands
| Command | Purpose |
|---|---|
show spanning-tree | Displays STP status and roles. |
show spanning-tree summary | Overview of STP operation. |
debug spanning-tree events | Monitors STP activity. |
🔹 Conclusion
Spanning Tree Protocol ensures that even in a network full of redundant paths, loops never occur. With RSTP and MSTP, Cisco networks achieve faster recovery and greater scalability, providing a stable and resilient foundation for enterprise switching environments.
Understanding and mastering STP is essential for every CCNP-level network engineer — because reliability starts with loop-free design.
🔗 Follow Netvorx Pro for More Cisco Insights
Stay connected with us for Cisco tutorials, network designs, and configuration examples. 👉 LinkedIn: Netvorx Pro Pvt Ltd 👉 WhatsApp Channel: Join Here


