Spanning Tree Protocol (STP) Port States

STP operates by transitioning ports through different states to avoid loops while still allowing network connectivity. Each port in STP can be in one of the following states:


1️⃣ Disabled State

🔴 Not part of STP operation

🔹 Command to Disable a Port:

Switch(config)# interface GigabitEthernet0/1
Switch(config-if)# shutdown

2️⃣ Blocking State

🟡 Prevents network loops

🔹 When does a port stay in Blocking?

🔹 Verification Command:

Switch# show spanning-tree

3️⃣ Listening State (15 sec, STP only)

🟠 Preparing to forward

🔹 Why does it exist?


4️⃣ Learning State (15 sec, STP only)

🔵 Learning MAC addresses

🔹 Why does it exist?


5️⃣ Forwarding State

🟢 Port is fully operational

🔹 Conditions for Forwarding:

🔹 Verification Command:

Switch# show spanning-tree interface GigabitEthernet0/1

Port State Transition Diagram (STP – 802.1D)

   Blocking → Listening → Learning → Forwarding
| ↑
|——> (If better path found) ——→ |

🚨 Total Convergence Time in Classic STP: ~50 sec


STP vs RSTP Port States

RSTP (802.1w) removes Listening State and introduces new roles:

STP (802.1D)RSTP (802.1w)Function
BlockingDiscardingBlocks traffic, prevents loops
Listening(Removed)Not needed in RSTP
LearningLearningLearns MAC addresses
ForwardingForwardingNormal data forwarding

🚀 RSTP Converges in <6 seconds!

renjithbs Avatar

Posted by

Leave a comment