2.2 Given a scenario, configure switching technologies and features
📘CompTIA Network+ (N10-009)
What is STP?
STP (Spanning Tree Protocol) is a Layer 2 protocol used in switching networks to prevent loops.
In a network where switches are connected to each other with multiple paths, loops can happen. Loops can cause problems like:
- Broadcast storms (messages circulating endlessly)
- Multiple copies of the same frame
- Network slowdown or crash
STP solves this by blocking redundant paths while keeping the network connected.
How STP Works
STP creates a loop-free logical topology by selecting:
- Root Bridge – the “main switch” of the network.
- Root Ports – the port on each non-root switch with the best path to the root bridge.
- Designated Ports – ports on each network segment that are chosen to forward traffic.
- Blocked Ports – ports that are not used to prevent loops.
Step 1: Electing the Root Bridge
- All switches in the network exchange Bridge Protocol Data Units (BPDUs).
- The switch with the lowest Bridge ID becomes the Root Bridge.
- Bridge ID = Bridge Priority + MAC address
- Lower value wins.
Example in IT environment: If you have 3 switches in a server room, the switch with the lowest Bridge ID becomes the Root Bridge, controlling traffic paths.
Step 2: Selecting Root Ports
- Each switch identifies the port with the shortest path to the Root Bridge.
- This port is called the Root Port.
Think of it as the “best exit” toward the main switch in the network.
Step 3: Selecting Designated Ports
- On each network segment, the switch port with the lowest cost to the Root Bridge is the Designated Port.
- This port forwards traffic for that segment.
Step 4: Blocking Redundant Ports
- Ports that could cause loops but are not the Root Port or Designated Port are put into a blocked state.
- Blocked ports don’t forward frames but can become active if the topology changes.
STP Port States
STP uses several port states to prevent loops when topology changes occur:
| State | Description |
|---|---|
| Blocking | Port does not forward frames. Receives BPDUs. |
| Listening | Port listens to BPDUs to make sure no loops occur. |
| Learning | Port starts learning MAC addresses but doesn’t forward frames yet. |
| Forwarding | Port forwards frames and learns MAC addresses. |
| Disabled | Port is administratively down, not participating in STP. |
Exam tip: The progression is Blocking → Listening → Learning → Forwarding.
STP Path Cost
- Each port has a cost based on its speed:
- Fast ports = lower cost
- Slow ports = higher cost
| Speed | Default STP Cost |
|---|---|
| 10 Mbps | 100 |
| 100 Mbps | 19 |
| 1 Gbps | 4 |
| 10 Gbps | 2 |
STP always chooses the path with the lowest total cost to the Root Bridge.
STP Timers
STP uses timers to prevent loops and allow convergence:
| Timer | Default Value | Purpose |
|---|---|---|
| Hello Timer | 2 seconds | How often BPDUs are sent |
| Forward Delay | 15 seconds | Time spent in Listening & Learning states |
| Max Age | 20 seconds | Time before a BPDU is considered outdated |
STP Variants
- PVST+ (Per-VLAN Spanning Tree Plus)
- Cisco proprietary
- Each VLAN has its own STP instance
- Rapid STP (RSTP / 802.1w)
- Faster convergence
- Reduces downtime when network topology changes
- MSTP (Multiple Spanning Tree Protocol / 802.1s)
- Maps multiple VLANs into fewer STP instances
- Optimizes resource usage
Why STP is Important in IT Environments
- Prevents broadcast storms in data centers.
- Avoids duplicate frames between servers and switches.
- Ensures high availability by using blocked ports as backup.
- Works with VLANs using PVST+ for more efficient traffic separation.
Exam Tips
- Remember STP prevents loops in a Layer 2 network.
- Know the port roles: Root Port, Designated Port, Blocked Port.
- Memorize the port states: Blocking → Listening → Learning → Forwarding.
- Understand path cost and how root bridge is elected.
- Be familiar with STP variants: PVST+, RSTP, MSTP.
This is the complete overview you need for the CompTIA Network+ exam on STP. It focuses on how STP works, port states, timers, path costs, and variants—everything exam-relevant.
