Types of STP (Spanning Tree Protocol)
Types of STP (Spanning Tree Protocol)
VTP (VLAN Trunking Protocol) – Table of Contents:
1. Uplinkfast- Why do we need uplinkfast
- Uplinkfast effect and its working
- What is BackboneFast and its Working
4. RSTP (Rapid STP)
- RSTP Port States
- RSTP Ports
6. MSTP (Multiple STP)
- Steps to Configure
- STP Uplinkfast:
- Cisco proprietary feature.
- Uplinkfast is for speeding convergence when a direct link to an upstream switch fails. Specifically for access-layer switches.
- When uplinkfast is enabled, it is enabled for the entire switch & all VLANs.
Command: show
spanning-tree
Command:
spanning-tree uplinkfast
- - Why do
we need uplinkfast:
If an upstream port fails,
the switch has to wait around ~30–50 seconds, causing noticeable
network downtime. That’s a problem in real networks—especially for end users. There
would be a loss of network for this specific period of time which is a large
impact in real time environments.
Cisco realized that there is no need
for Listening, Learning process when it comes to access layer. Hence, designed
this feature called Uplinkfast.
- - Uplinkfast effect and its working:
- Topology Understanding:
- Switch1 = Root Bridge
- Switch2
- e0 = Root Port
(towards SW1)
- e2 = Designated Port
(towards SW3)
- Switch3
- e1 = Root Port
(towards SW1)
- e2 = Blocked Port (towards SW2)
- What happens WITHOUT UplinkFast:
If SW3
e1 (RP) fails:
- SW3 stops receiving
BPDUs
- It activates the B.P to
start listening and learning process before forwarding:
- e2 → Listening (15
sec)
- e2 → Learning (15 sec)
- Finally → Forwarding
Total delay ≈ 30 seconds
- Result: Network outage for hosts connected to SW3
- Now ENABLE UplinkFast on SW3:
- Scenario: e1 (Root Port) goes DOWN
Step-by-step working:
1. Immediate failure
detection (Direct link Failure)
- Physical link down on
e1
- No need to wait for timers
2. Instant role change
- Blocked Port e2
→ Forwarding immediately
- Skips:
- Listening ❌
- Learning ❌
** Convergence time ≈ < 1 second
3. Traffic path
changes
Before failure:
SW3 → SW1 (direct via e1)
After failure:
SW3 → SW2 → SW1 (via e2)
4. CAM Table
Correction (VERY IMPORTANT)
Problem:
- SW2 and SW1 still
think SW3’s MACs are reachable via old path. Due to which they’ll try
sending traffic for those MACs through Old path.
Solution by
UplinkFast:
- SW3 sends dummy
multicast frames with MAC address- 0100.0ccd.cdcd
- These frames:
- Use source
MACs from its CAM table that is source MACs of endpoint devices so as to
update the MAC table of SW1 and SW2.
- The Dummy frames Go
out via new port (e2).
** Upstream switches update MAC tables
instantly.
** Prevents blackholing
of traffic.
- Automatic Effects of UplinkFast:
When you enable UplinkFast on SW3:
1. Bridge Priority is
increased
- Set to 49152
** Ensures SW3 never becomes root bridge
2. Port Cost
Manipulation
- Backup ports are
tuned internally
- Cost of each local
Port is increased by 3000, so that other switches won’t prefer it
as a path to the root as the feature is designed to work on access layer
switches, that is at the edge of the spanning-tree topology.
- STP Backbonefast:
- Cisco proprietary feature.
- Backbonefast can reduce the maximum convergence delay only from 50s to 30s.
Command:
spanning-tree backbonefast
- What is BackboneFast and its Working?
- BackboneFast
is a Cisco enhancement in Spanning Tree Protocol (STP) that:
Reduces convergence time during indirect link failures (when a switch stops receiving BPDUs but the link is still physically up)
** Key Idea-
- Problem: STP normally
waits Max
Age (20 sec) when BPDUs stop
- Solution: BackboneFast skips this wait by verifying failure faster
Apply it to same topology as above:
Initial state:
- SW1 = Root Bridge
- SW3:
- e1 = Root Port
(towards SW1)
- e2 = Blocked Port (towards SW2)
- Scenario for BackboneFast (IMPORTANT)
- This feature works only in indirect failure, NOT
direct link down
Example:
- Link between SW1
and SW2 fails
- But SW3’s link to SW2 (e2) is still UP
- What happens WITHOUT BackboneFast:
- SW3 stops receiving superior
BPDUs on e1 (via SW2 path)
- It assumes topology
change
- Waits:
- Max
Age (20 sec) ⏳
- Then:
- e2 → Listening
(15s)
- e2 → Learning (15s)
** Total ≈ 50 seconds
- What happens WITH BackboneFast:
- Step-by-step working:
1. Inferior BPDU
received
- SW3 receives a worse
BPDU (High Priority BPDU) from SW2
· It suspects:
“Maybe upstream link is broken?”
2. Root Link Query
(RLQ) mechanism
- SW3 sends RLQ
(Root Link Query) toward SW2
·
Asking:
“Do you still have a path to the root (SW1)?”
3. Upstream response
- If SW2 replies:
- ❌ “No valid path to root”
** SW3 does NOT wait for Max Age
4. Fast transition
- SW3 immediately:
- Invalidates old
root info
- Promotes e2
as new root port
Then:
- Goes through:
- Listening → Learning
→ Forwarding
** Total ≈ 30 seconds (instead of 50 sec)
⚠️ Important Clarifications:
- BackboneFast:
- ❌ Does NOT skip Listening/Learning
- ❌ Does NOT give instant forwarding
- It only:
- ✅ Eliminates Max Age delay (20 sec)
** Compare All Enhancements
|
Feature |
Solves |
Speed |
|
UplinkFast |
Direct
failure (access layer) |
~1 sec |
|
BackboneFast |
Indirect
failure (core/backbone) |
~30 sec |
|
Normal STP |
All cases |
~50 sec |
- Portfast:
- STP concept isn’t used for switchports connected to PC or Endpoint devices.
- As the PC’s don’t send BPDU’s, so the Ports of switch connected to PC’s, Printers, etc. don’t need the listening, learning process before coming in forwarding state. Hence, if we can skip this process we can save 30 seconds.
- This is exactly what Portfast does, If enabled on the switchport the port directly comes into forwarding state skipping Listening and Learning process to save 30 seconds.
- Its only meant for the ports connected to endpoint devices or devices that don’t send BPDU’s.
- STP Types:
1. Rapid STP (RSTP) 802.1W:
- 802.1W is a method of speeding up STP convergence.
- RSTP is rapid STP as it has Inbuilt features of Portfast, Uplinkfast and Backbonefast which makes the convergence rapid.
- Path calculation remains same as STP.
- RSTP Port States:
|
Protocol
|
States |
Description |
|
|
|
|
|
STP 802.1D |
Disabled |
No activity |
|
|
Blocking |
Frames dropped, no MAC learn |
|
|
Listening |
Frames dropped, no MAC learn |
|
|
Learning |
Frames dropped, MAC learned |
|
|
Forwarding |
Frames forwarded, MAC learned |
|
|
|
|
|
RSTP 802.1W |
Discarding |
Frames dropped, no MAC learn |
|
|
Learning |
Frames dropped, MAC learned |
|
|
Forwarding |
Frames forwarded |
- RSTP Ports:
|
Port Role |
Description |
|
|
|
|
Root Port |
The best path to Root Bridge |
|
Designated Port |
Same as STP |
|
Alternate |
Backup of Root Port |
|
Backup |
Backup of Designated Port |
|
Disabled |
Not used in STP |
|
Edge |
Connected only to End User |
Command to enable
RSTP: spanning-tree mode rapid-pvst
- PVST & PVST+:
- Every VLAN runs a separate STP instance.
- Cisco proprietary (PVST is the older version which supported only ISL- Inter Switch Link, that’s why PVST+ is in use now).
- PVST+ allows interoperability b/w CST & PVST in Cisco switches & supports the IEEE 802.1D standard.
- Provides Load Balancing.
- More Overhead on the device as Each VLAN runs its own STP instance and Each VLAN sends its own BPDUs due to which the device experience:
- More CPU usage
on switches
- More BPDU traffic
on links
- More memory consumption
- More control-plane processing compared to:
- Common Spanning Tree (CST) (single STP for all VLANs)
- MST (Multiple Spanning Tree):
- Introduced as Cisco MSTP.
- Originally standard defined in IEEE 802.1s.
- Allows multiple VLANs to be mapped to single instance of STP.
Instance 1 – maps to VLAN 1-50
Instance 2 – maps to VLAN 51-100
- Reduces no. of spanning-tree instances (Processing Overhead is reduced).
- Instance handles multiple VLANs that have the same Layer-2 topology.
- MSTP Regions→ Collection of switches that have the same MST config comprises an MST region.
- Steps to configure:
1. Enable MST mode on the switch-
Command- spanning-tree mode mst
Command- spanning-tree mst configuration
3. Configure Instance Name-
This is the MST region name.
- All switches that should belong to the same MST region must have the exact same name
- Case-sensitive on many platforms
Example:
Command- name CAMPUS
Why needed:
The name helps identify switches as members of the same MST region.
4. Configure Revision Number-
This is the configuration version number of the MST region.
Example:
Command- revision 1
Why needed:
- It tracks changes to MST mapping/configuration.
- All switches in the same region must use the same revision number.
If one switch has a different revision, it may be treated as a different region.
5. Map VLANs to STP Instances-
This is the most important step.
You decide which VLANs use which MST instance.
Example Commands:
instance 1 vlan 10,20,30instance 2 vlan 40,50
instance 3 vlan 60-70
Meaning:
- VLAN 10,20,30 use MST Instance 1
- VLAN 40,50 use MST Instance 2
- VLAN 60 to 70 use MST Instance 3
l Interview questions for Network Engineer asked from Types of STP:-
## DISCLAIMER:- The questions asked in the interview are all scenario based and indirect, So you should try to understand the concept instead of cramming. You will be fortunate if you receive a direct question from the interviewer.
1. What is Uplinkfast and its command ?
2. Difference between Uplinkfast and Backbonefast ?
3. If Uplinkfast is enabled and the Uplink port goes down will the other port wait for Max age timer or How much time would it take for other port to come in forwarding state forward ?
4. Why does the switch send dummy Multicast frames in case of uplinkfast and whats the source and destination MAC address of the frames ?
5. What is Backbonefast and how does it work ?
6. What is Portfast and on which ports is it applied ?
7. What is RSTP and its Port States ?
8. What are the type of Ports in RSTP and its command ?
9. What is PVST ?
10. What is MST ?
Comments
Post a Comment