intermediate v1 • Updated 7 hours ago

Spanning Tree Protocol (STP & RSTP)

STP (IEEE 802.1D) and RSTP (IEEE 802.1w) are Layer 2 loop-prevention network protocols that block redundant switch links to create a loop-free logical topology.

Remember This Key Rule

STP prevents Layer 2 loops by blocking redundant switch ports. Lowest Bridge ID wins Root Bridge election.

In Simple Terms

In enterprise networks, you connect switches in redundant triangles or meshes so if one cable breaks, another takes over. However, because Ethernet frames have no TTL (Time to Live), redundant switch paths create catastrophic broadcast storms that crash the entire network in seconds. STP solves this by placing redundant ports into a blocking state until a primary link fails.

Visual Diagram & Flow

SW1 (Root Bridge)
SW2 (Root Port)
──[BLOCK]──
SW3 (Root Port)
Why It Matters in Real Networks

Without STP, any redundant switch cabling creates instant Layer 2 broadcast storms and CAM table instability.

How It Works (Technical Breakdown)

1. **Root Bridge Election**: Switch with the lowest Bridge ID (Priority + MAC address) becomes Root Bridge. 2. **Root Ports (RP)**: Every non-root switch chooses the single port with lowest Root Path Cost toward the Root Bridge. 3. **Designated Ports (DP)**: One port per network segment with lowest path cost is set to Forwarding. 4. **Non-Designated Ports (NDP / Alternate)**: All other redundant ports are placed into **Blocking / Discarding** state. 5. **RSTP (802.1w)**: Faster convergence (< 1 second vs 30-50 seconds in legacy STP) using explicit proposal/agreement handshakes.
Real-World Analogy

Traffic lights at a 4-way intersection. If all lights were green simultaneously, cars would crash (broadcast storm). STP sets redundant paths to RED (blocking) until a main road is closed.

Concrete Example

Three switches (SW1, SW2, SW3) connected in a loop. SW1 (Priority 4096) is elected Root Bridge. The link between SW2 and SW3 is automatically blocked on port Gi0/2. If SW1-SW2 cable is cut, Gi0/2 immediately transitions to Forwarding.

Common Engineering Mistakes & Pitfalls

Leaving switch STP priority at default (32768), allowing an old, slow access switch to accidentally win the Root Bridge election.

Next & Related Concepts

Explore the complete curriculum roadmap.

Concept Mastery Quiz

Test your comprehension with active-recall questions.

No quiz questions generated for this topic yet.

Active Recall Flashcards

Click each flashcard to reveal the answer and test your memory.

No flashcards created for this topic yet.

Content Versioning

Audit trail of revisions and updates for this knowledge topic.

Version Change Summary Author Timestamp
v1 (Current) Active production content system Sun, Aug 23, 2026 11:09 AM
Searching...
No matching topics found for "".
Type at least 2 characters to search across all topics, protocols, and scenarios.
Navigate with mouse or click ESC to close