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
- The port is administratively shut down or physically disconnected.
- No BPDU (Bridge Protocol Data Unit) frames are sent or received.
🔹 Command to Disable a Port:
Switch(config)# interface GigabitEthernet0/1
Switch(config-if)# shutdown
2️⃣ Blocking State
🟡 Prevents network loops
- The port listens for BPDUs but does NOT forward traffic.
- The switch does not learn MAC addresses on this port.
- Used for backup links that will only be activated if needed.
🔹 When does a port stay in Blocking?
- When a redundant link exists and a better path is available.
- If the port receives a superior BPDU from another switch.
🔹 Verification Command:
Switch# show spanning-tree
3️⃣ Listening State (15 sec, STP only)
🟠 Preparing to forward
- The port is evaluating BPDUs to determine its role (Root, Designated, or Blocking).
- The port is NOT forwarding frames yet.
🔹 Why does it exist?
- To prevent temporary loops before full STP convergence.
4️⃣ Learning State (15 sec, STP only)
🔵 Learning MAC addresses
- The switch starts learning MAC addresses but does NOT forward traffic yet.
- The port continues to process BPDUs.
🔹 Why does it exist?
- Helps build the MAC address table before forwarding starts.
5️⃣ Forwarding State
🟢 Port is fully operational
- The port forwards traffic normally.
- It learns MAC addresses and processes BPDUs.
🔹 Conditions for Forwarding:
- The port is a Root Port (RP) or Designated Port (DP).
- No superior BPDUs are received.
🔹 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 |
|---|---|---|
| Blocking | Discarding | Blocks traffic, prevents loops |
| Listening | (Removed) | Not needed in RSTP |
| Learning | Learning | Learns MAC addresses |
| Forwarding | Forwarding | Normal data forwarding |
🚀 RSTP Converges in <6 seconds!
Leave a comment