🌳 Spanning Tree Protocol (STP)
🌳 Spanning Tree Protocol (STP)
🧠 Top 5 Key Points
-
Prevents Switching Loops:
STP detects and blocks redundant links in a network to prevent broadcast storms and MAC table instability. -
Selects a Root Bridge:
The switch with the lowest Bridge ID (Priority + MAC address) becomes the Root Bridge for the network. -
Blocks Redundant Links:
Non-essential paths are put into a blocking state, ensuring a single active path between any two switches. -
Uses Bridge Protocol Data Units (BPDUs):
Switches exchange BPDUs to share information about the network topology and root bridge. -
Automatically Reconfigures:
If an active link fails, STP recalculates and unblocks a redundant link to restore connectivity — ensuring fault tolerance.
⚙️ Technical Summary
| Feature | Description |
|---|---|
| Layer | 2 (Data Link Layer) |
| Standard | IEEE 802.1D (Classic STP) |
| Types | STP, RSTP (802.1w), MSTP (802.1s) |
| Convergence Time | 30–50 seconds (STP), faster in RSTP |
| BPDU Transmission | Every 2 seconds |
🧰 Packet Tracer Lab: STP in Action
🎯 Goal:
Demonstrate how STP prevents loops when multiple switches are interconnected.
🖥️ Network Topology
Lab Description
-
All switches connected in a triangle (loop).
-
STP ensures one redundant link is blocked automatically to prevent loops.
🪜 Step-by-Step Configuration
🔹 On All Switches (S1, S2, S3)
This enables STP for VLAN 1 (default VLAN).
(It’s enabled by default on Cisco switches, but this reinforces the concept.)
🔹 Check Root Bridge
Run the command:
Example output:
-
The switch with the lowest Bridge ID (Priority + MAC) is the Root Bridge.
-
Other switches will have some ports in forwarding state and one port in blocking state.
🔹 Force a Specific Root Bridge
Let’s make Switch1 the Root Bridge (for demonstration).
💡 Lower priority = higher chance of becoming Root Bridge.
(Default is 32768, so 4096 makes this switch root.)
Now verify again:
Switch1 will now show:
🔹 Observe Port Roles
-
Root Port: Best path to Root Bridge.
-
Designated Port: Forwarding port on the segment.
-
Blocked Port: Prevents loops (in “Blocking” or “Discarding” state).
You can see port roles using:
🔹 Test STP in Action
-
From the topology, disconnect one active link between Switch1 and Switch2.
-
Watch STP automatically unblock a previously blocked link between Switch2 and Switch3 — restoring full connectivity.
✅ This demonstrates STP convergence and loop prevention dynamically.
🧠 Key Learning Summary
| Concept | Description |
|---|---|
| STP Purpose | Prevents loops in Layer 2 networks |
| Root Bridge | Central switch selected by lowest Bridge ID |
| BPDU | Control messages exchanged between switches |
| Blocked Ports | Avoid loops by disabling redundant links |
| Failover | Automatically unblocks redundant link on failure |
💬 Teaching Tip
“STP is like a traffic controller — it lets only one car (frame) pass on a given path and keeps the others waiting, but if the main road closes, it quickly opens an alternate route.”
Comments
Post a Comment