Home CCNA Master Spanning Tree Protocol: Ultimate Guide to Flawless Uptime (Updated 2025)
Master Spanning Tree Protocol: Ultimate Guide to Flawless Uptime (Updated 2025)

Master Spanning Tree Protocol: Ultimate Guide to Flawless Uptime (Updated 2025)

In the previous article, I have explained the redundancy. It increases the network availability by protecting the network from a single point of failure, such as a fault in a network cable or a fault in a switch. When engineers introduce physical redundancy in design, loops and duplicate frames happen. I have written in the previous lesson that loops and duplicate frames have several disadvantages for a switched network. The duplicate frames and nonstop broadcast frames in a loop network need a logical mechanism. The Spanning Tree Protocol (STP) is the mechanism that was developed to address loop issues in the switched network.

Spanning Tree Protocol (STP) ensures only one logical path between all destinations on the network. It blocks all the redundant paths that can cause a loop. Data cannot enter or leave that port. Preventing loops on the network is not an easy task.

The physical connection is still available to provide a redundant path, but the STP only disabled the paths to prevent the loops from occurring. In case of failure of the switch and cable, the STP recalculates the paths and unblocks the necessary ports to allow the redundant path to become active.

  • PC1 sends a broadcast packet out onto the network.
  • Switch-1 is configured with Spanning Tree Protocol (STP), and Port 1/0/2 is set to the blocking state, which prevents it from being used to forward user data. Switch-1 forwards a broadcast frame out all switch ports, except the originating port from PC1 and port 1/0/2.
  • Switch-3 receives the broadcast frame and forwards the frame out all of its switch ports, where it reaches Switch-4, PC4, Switch-2, and PC2. When switch-2 receives the frame, it forwards it to PC-2 and drops the frame. The Layer 2 loop is prevented.

Spanning Tree Protocol (STP) prevents loops from occurring by putting the port of the switch in “blocking state” strategically. The switches running Spanning Tree Protocol (STP) can avoid failures by dynamically unblocking the previously blocked ports and permitting traffic on that port.

Spanning Tree Protocol (STP) is based on an algorithm invented by Radia Joy Perlman is an American computer programmer and network engineer. Radia Perlman was working for Digital Equipment Corporation and published the 1985 paper “An Algorithm for Distributed Computation of a Spanning Tree in an Extended LAN“.

FAQs

What is Spanning Tree Protocol (STP)?

STP, defined by IEEE 802.1D, is a Layer 2 protocol that prevents loops in redundant Ethernet networks by creating a loop-free logical topology. It blocks redundant ports using BPDUs to elect a root bridge and assign roles, avoiding broadcast storms and MAC table instability while enabling failover. Developed by Radia Perlman, it ensures one active path per destination.

How does STP elect the root bridge?

Switches exchange BPDUs every 2 seconds; the one with the lowest Bridge ID (priority + MAC address) becomes root. Default priority is 32,768—lower it via “spanning-tree vlan 1 priority 4096” to influence election. Non-root switches calculate lowest-cost paths to root for their root ports, ensuring optimal topology.

What are the port states in STP?

STP ports cycle through: Blocking (listens for BPDUs, no forwarding); Listening (prepares topology, 15s forward delay); Learning (builds MAC table, another 15s); Forwarding (full operation). This 30-50s process stabilizes the network post-change, with timers like hello (2s) and max age (20s) for failure detection.

What are the differences between STP and RSTP?

Classic STP (802.1D) converges slowly (30-50s) with blocking/listening/learning states; RSTP (802.1w) achieves sub-second convergence by merging states into discarding/learning/forwarding, using proposal/agreement handshakes instead of timers. RSTP enhances speed for modern Gigabit networks while maintaining loop prevention.

How do you configure STP on a Cisco switch?

Enable STP globally (default on), set root with “spanning-tree vlan 1 priority 4096” on desired switch. Tune timers like “spanning-tree vlan 1 max-age 10” for faster detection. Verify via “show spanning-tree” to check root ID, port roles, and states—ensuring no loops in VLANs.

🏆 Your Progress

Level 1
🔥 0 day streak
📚
0 Articles
0 Points
🔥
0 Current
🏅
0 Best Streak
Level Progress 0 pts to next level
🎖️ Achievements
🥉 Starter
🥈 Reader
🥇 Scholar
💎 Expert

More from CCNA

Articles tailored to your interests in CCNA

Forum