Table of Contents
In the complex realm of the networking and computing world, stability and efficiency is of paramount importance. Imagine a traffic scene where all vehicles are getting into the pathway of others, colliding and so on. Similar manners in the network traffic realm issues like loops, broadcast storms, can cause network outages and degermation in performance. The network traffic moves as per OSI model which supports many protocols for communication ensuring reliability, efficiency and help in addressing issues related to loops, broadcast storms, congestions, packet drop etc.
In today’s topic we will learn about Spanning tree protocol (SPT) used by networks widely, how STP works? types of SPTs, STP modes etc.
Spanning Tree Protocol
Spanning tree protocol (SPT) operates at layer 2 of the OSI model and is used to stop loops forming inside network topologies. It was developed way back to prevent issues which occur when complex exchange of data happens over redundant channels in local area networks (LANs). Data can be trapped in a loop which circles network segments if traffic flows are not monitored and controlled carefully. This can impact network performance drastically. Spanning tree protocol avoids loops when you have multiple links between switches.
Example Scenario
We have used the below example to explain how STP works in a given scenario.

Suppose you have three network switches, and we connect to all three of them. We see the colour state change from orange to green because the ports go through listening and learning stages and all switches perform an election process. Whenever we have multiple links for redundancy on switches connect together. STP happens automatically on network switches to take care of loop avoidance in the network. STP is an open standard protocol to avoid broadcast storms, loops, database instability or multiple frame copies.
How does the Spanning Tree Protocol work?
The spanning tree protocol works in three steps:
- Choosing root bridge
- Choosing root port
- Choosing the designated port and non-designated port
Choosing Root Bridge
Spanning tree works by choosing one of the switches as head switch, considered as ‘root bridge’ and as a result all network frames pass through the root bridge. And all redundant and backup paths are in the backlog state as there will be only one path to reach from source to destination to avoid loop issues. The root bridge is like head in L-2 topology and has all ports in forwarding state selected by an election process. All switches exchange bridge protocol data units during the election process.
BPDUs are connected to switches to exchange information such as MAC address, priority number, port, which is required for root bridge selection. The switch with the best (lowest) bridge-id is considered to be designated as the root bridge.
Choosing Root Port
Bridge-ID=priority + MAC address
The nearest port to the root bridge is the root port. Every non-root bridge will have a root port which is the shortest path to reach the root bridge as every non-root bridge will have the best path.
Choosing the Designated Port and Non-designated Port
- Root port is always in forwarding state and best path to reach root bridge
- Designated ports are in upstate always to forward data
- Non-designated ports are in state of blocking

Type of Spanning Tree Protocol
1. Spanning Tree Protocol (STP) – IEEE 802.1D
STP is the original Spanning Tree Protocol designed to eliminate loops in Layer 2 networks by creating a loop-free topology.
PROS
Prevents network loops.
Standardized by IEEE.
Works with all vendors.
CONS
Slow convergence (30–50 seconds).
Single instance for the entire network.
No VLAN load balancing.
2. Rapid Spanning Tree Protocol (RSTP) – IEEE 802.1w
RSTP is an enhancement of STP, offering faster convergence and improved network efficiency.
PROS
Faster convergence (few seconds).
Backward compatible with STP.
Introduces alternate and backup ports to improve failover.
CONS
Still has a single instance for the entire network.
Limited VLAN support without additional protocols like MSTP.
3. Multiple Spanning Tree Protocol (MSTP) – IEEE 802.1s
MSTP allows multiple spanning tree instances to be mapped to different VLANs, optimizing network traffic.
PROS
Supports VLAN grouping for better load balancing.
Reduces CPU and memory usage compared to PVST+.
Faster convergence than STP.
CONS
More complex to configure than STP and RSTP.
Requires network-wide compatibility and planning.
4. Per-VLAN Spanning Tree Protocol (PVST) – Cisco Proprietary
Cisco’s version of STP, which runs a separate instance of STP for each VLAN.
PROS
Enables VLAN-based load balancing.
Can assign different root bridges for different VLANs.
Works well with Cisco networks.
CONS
High CPU and memory usage due to multiple STP instances.
Cisco proprietary (not vendor-neutral).
5. Per-VLAN Rapid Spanning Tree Protocol (PVRST/PVRST+) – Cisco Proprietary
Cisco’s enhancement of RSTP, running a separate instance for each VLAN with rapid convergence.
PROS
Combines fast convergence of RSTP with VLAN flexibility of PVST.
Ideal for large networks with Cisco switches.
Better redundancy and load balancing.
CONS
High CPU and memory usage.
Cisco proprietary, limiting interoperability.
6. Flex Links (Cisco Feature, Not an STP Protocol)
Flex Links is an alternative to STP, offering fast failover between Layer 2 links without spanning tree.
PROS
Faster failover than STP-based protocols.
Simple configuration for specific redundancy needs.
No risk of STP loops.
CONS
No loop prevention—must be used carefully.
Only supports two uplinks per switch.
Cisco proprietary.
Comparison Table of STP Protocols
Protocol | Convergence Time | VLAN Support | Vendor Neutral | Key Feature |
STP (802.1D) | 30–50 sec | Single instance | Yes | Basic loop prevention |
RSTP (802.1w) | A few sec | Single instance | Yes | Faster convergence |
MSTP (802.1s) | Fast | Multiple VLAN groups | Yes | VLAN grouping |
PVST | Slow | Per VLAN instance | Cisco only | VLAN-based load balancing |
PVRST+ | Fast | Per VLAN instance | Cisco only | Rapid convergence per VLAN |
Flex Links | Instant | N/A | Cisco only | STP alternative |
Download: types of stp protocols comparison table
Final Thoughts
- For small networks: RSTP is a good choice due to its simplicity and fast convergence.
- For large VLAN-based networks: MSTP is efficient and scalable.
- For Cisco-heavy environments: PVST+ or PVRST+ provides better VLAN load balancing but uses more resources.
For specific failover needs: Flex Links can be a great alternative to STP-based solutions
ABOUT THE AUTHOR

I am here to share my knowledge and experience in the field of networking with the goal being – “The more you share, the more you learn.”
I am a biotechnologist by qualification and a Network Enthusiast by interest. I developed interest in networking being in the company of a passionate Network Professional, my husband.
I am a strong believer of the fact that “learning is a constant process of discovering yourself.”
– Rashmi Bhardwaj (Author/Editor)