Network redundancy is essential for modern enterprise networks. Networks must operate 24/7/365, and even brief downtime can cause significant business impact. Network engineers must implement redundancy at every possible point to ensure infrastructure resilience.
Layer 2 loops are catastrophic without a prevention mechanism. Unlike the IP header which contains a TTL field to prevent infinite loops at Layer 3, the Ethernet header has no such mechanism. Without STP, broadcast frames will loop indefinitely through redundant switch connections.
Spanning Tree Protocol prevents Layer 2 loops by strategically blocking redundant ports. STP creates a loop-free logical topology by placing certain ports in a blocking state while keeping others in a forwarding state. Blocked ports serve as backups that can transition to forwarding if active links fail.
STP elects a root bridge as the central reference point for the entire network. All other switches calculate their best path to reach the root bridge, and port roles are assigned based on these calculations.
Cisco switches use PVST (Per-VLAN Spanning Tree), which runs a separate STP instance for each VLAN. This allows different VLANs to have different root bridges and different ports forwarding/blocking, optimizing traffic flow.
Classic STP is IEEE 802.1D (industry standard)
STP runs by default on switches from ALL vendors
Switches send Hello BPDUs every 2 seconds (default timer)
Only switches participate in STP (not routers, PCs, or other devices)
The root bridge is the switch with the lowest Bridge ID
All ports on the root bridge are designated ports (forwarding)
Each non-root switch has exactly ONE root port
Every collision domain has exactly ONE designated port
Root ports and designated ports are in forwarding state
Non-designated ports are in blocking state
Term
Definition
Redundancy
Having multiple paths/components so that if one fails, another can take over with minimal or no downtime
Broadcast Storm
Network congestion caused by broadcast frames looping infinitely through a Layer 2 network
MAC Address Flapping
When a switch continuously updates its MAC address table because frames with the same source MAC arrive on different interfaces
BPDU (Bridge Protocol Data Unit)
STP messages that switches send to advertise themselves and learn about other switches
Root Bridge
The switch with the lowest Bridge ID; serves as the central reference point for STP calculations
Bridge ID
A unique identifier consisting of Bridge Priority (4 bits) + Extended System ID/VLAN ID (12 bits) + MAC Address (48 bits)
Root Port
The port on a non-root switch with the lowest cost path to the root bridge (one per switch)
Designated Port
The port on a network segment responsible for forwarding traffic toward the root bridge (one per collision domain)
Non-Designated Port
A port placed in blocking state to prevent loops
Root Cost
The cumulative cost of all outgoing interfaces along the path to the root bridge
Port ID
Port Priority (default 128) + Port Number; used as final tiebreaker for root port selection
PVST (Per-VLAN Spanning Tree)
Cisco's implementation that runs a separate STP instance per VLAN
Collision Domain
In a switched network, each point-to-point link between devices
STP Port Costs (IEEE Standard)
Speed
Cost
10 Mbps (Ethernet)
100
100 Mbps (Fast Ethernet)
19
1 Gbps (Gigabit Ethernet)
4
10 Gbps (10-Gig Ethernet)
2
Bridge Priority Values
Default Bridge Priority: 32768
Default Bridge Priority in VLAN 1: 32769 (32768 + 1)
Minimum unit of change: 4096
Valid priority values: 0, 4096, 8192, 12288, 16384, 20480, 24576, 28672, 32768, 36864, 40960, 45056, 49152, 53248, 57344, 61440
Timers
Hello Timer: 2 seconds (default)
Standards
Classic STP: IEEE 802.1D
Forgetting that the LOWEST Bridge ID wins - Not the highest! Lower priority = more likely to be root bridge.
Confusing which port ID is used in tiebreakers - The NEIGHBOR switch's port ID breaks the tie, not the local switch's port ID.
Forgetting to add VLAN ID to bridge priority - In PVST, the actual priority = configured priority + VLAN ID.
Miscounting root cost - Only count OUTGOING interface costs, not receiving interface costs.
Forgetting that ports across from root ports must be designated - Never block a root port's neighbor.
Not recognizing that all root bridge ports are designated - The root bridge never has root ports or non-designated ports.
Confusing blocking vs. forwarding behavior - Blocking ports still send/receive BPDUs; they only block regular traffic.
Forgetting that each collision domain needs exactly one designated port - Even if both switches have the same root cost, one must be designated.
Wrong order of tiebreakers - Root cost → Neighbor Bridge ID → Neighbor Port ID (for root port selection).
"1-1-4-2" pattern (reading the costs): 100, 19, 4, 2
Or remember: As speed increases by 10x, cost roughly divides by 5
32768 = 2^15 (the 16th bit set to 1)
4096 = 2^12 (minimum increment, 13th bit)
Think: "32K default, 4K increments"
"Priority, then MAC" - Lower wins both times
"Cost → Bridge → Port" or "CBP"
Lowest root Cost
Lowest neighbor Bridge ID
Lowest neighbor Port ID
"Cost → Bridge"
Lowest root cost
Lowest bridge ID
Root Port = Best path TO root (Forwarding)
Designated Port = Best path FROM root on segment (Forwarding)
Non-Designated = Blocked to prevent loops (Blocking)
Root Bridge (1 per network)
└── Designated Ports (all ports on root bridge)
Non-Root Switches
└── Root Port (1 per switch) → points toward root
└── Designated Ports → on winning end of each link
└── Non-Designated Ports → blocked, losing end of link
SW1
/ \
SW2---SW3
PC sends ARP broadcast to SW1
SW1 floods to SW2 and SW3
SW2 floods to SW3, SW3 floods to SW2
Both flood back to SW1
Process repeats infinitely → Broadcast Storm
SW1: Priority 32769, MAC AAA
SW2: Priority 32769, MAC BBB
SW3: Priority 32769, MAC CCC
Winner: SW1 (same priority, lowest MAC: AAA < BBB < CCC)
SW1 (Root) ----G0/0---- SW2
----G0/1----
Both paths have same cost (4). SW2 must choose root port.
G0/0 connects to SW1's G0/0 (Port ID: 128.1)
G0/1 connects to SW1's G0/1 (Port ID: 128.2)
Winner: SW2's G0/0 (connects to lower neighbor port ID)
What is the IEEE standard for Classic Spanning Tree Protocol?
IEEE 802.1D
What is the default Hello BPDU timer in STP?
2 seconds
What is the STP port cost for a 10 Mbps Ethernet interface?
What is the STP port cost for a 100 Mbps Fast Ethernet interface?
What is the STP port cost for a 1 Gbps Gigabit Ethernet interface?
What is the STP port cost for a 10 Gbps interface?
What is the default bridge priority in STP?
32768
What is the default bridge priority in VLAN 1 (with extended system ID)?
32769 (32768 + VLAN ID of 1)
In what increments can STP bridge priority be changed?
4096
What are the components of the modern Bridge ID?
Bridge Priority (4 bits) + Extended System ID/VLAN ID (12 bits) + MAC Address (48 bits)
Which switch becomes the root bridge?
The switch with the lowest Bridge ID (lowest priority wins; if tied, lowest MAC address wins)
What state are all ports on the root bridge?
Designated ports in a forwarding state
How many root ports does each non-root switch have?
Exactly one (1)
How many designated ports exist per collision domain/network segment?
What is a BPDU?
Bridge Protocol Data Unit - STP messages switches use to advertise themselves and learn about other switches
What is root cost?
The total cost of outgoing interfaces along the path to the root bridge
What three port roles exist in STP?
Root port, Designated port, Non-designated port
Which STP ports are in forwarding state?
Root ports and Designated ports
Which STP ports are in blocking state?
Non-designated ports
What traffic can blocking ports send/receive?
Only BPDUs and some other specific traffic (not regular data traffic)
What is the order of tiebreakers for root port selection?
1) Lowest root cost, 2) Lowest neighbor bridge ID, 3) Lowest neighbor port ID
What is the order of tiebreakers for designated port selection?
1) Lowest root cost, 2) Lowest bridge ID
When selecting a root port, whose port ID is used as the final tiebreaker?
The NEIGHBOR switch's port ID (not the local switch's)
What is a broadcast storm?
Network congestion caused by broadcast frames looping infinitely through a Layer 2 network without STP
What is MAC address flapping?
Why doesn't Layer 2 have built-in loop prevention like Layer 3?
The Ethernet header has no TTL (Time to Live) field like the IP header does
What is PVST?
Per-VLAN Spanning Tree - Cisco's STP implementation that runs a separate STP instance for each VLAN
Why is the VLAN ID included in the bridge priority (extended system ID)?
To give each switch a different Bridge ID in each VLAN for PVST operation
What happens when a switch first powers on regarding STP?
It assumes it is the root bridge until it receives a superior BPDU (from a switch with a lower bridge ID)
After STP topology converges, which switch(es) generate original BPDUs?
Only the root bridge generates BPDUs; other switches forward them
What is the port state of the port directly connected to another switch's root port?
Designated port (must be designated to not block the path to root)
What are the valid bridge priority values (without VLAN ID)?
0, 4096, 8192, 12288, 16384, 20480, 24576, 28672, 32768, 36864, 40960, 45056, 49152, 53248, 57344, 61440
What is the default STP port priority?
128
What is the STP Port ID composed of?
Port Priority + Port Number
Do devices like PCs and routers participate in STP?
No, only switches send BPDUs and participate in STP
If a switch port is not receiving BPDUs, what does this indicate?
The port is connected to a non-switch device (PC, router, etc.) and is safe to go into forwarding mode
In a network with SW1 (Priority 32769, MAC AAA), SW2 (Priority 32769, MAC CCC), and SW3 (Priority 32769, MAC BBB), which is the root bridge?
SW1 (same priority, but AAA is the lowest MAC address)
How do you calculate the root cost for a switch?
Add up the costs of all outgoing interfaces along the path to the root bridge (don't count receiving interfaces)
What problem does STP solve?
Prevents Layer 2 loops in networks with redundant paths while still allowing those paths to serve as backups
Why is the default bridge priority 32768?
Because the bridge priority field is 16 bits, and the most significant bit is set to 1 by default (2^15 = 32768)
Zuletzt geändertvor 15 Tagen