Sub topic 1
Why Redundant Switch Links Create Loops
Prerequisites
This chapter assumes you understand MAC address learning, broadcast and unknown-unicast flooding, VLANs, trunks, and basic switch CLI output.
Why Redundant Switch Links Create Loops
Redundant links improve availability. If one link fails, another can carry traffic. However, Ethernet frames have no hop limit. A broadcast frame can therefore circulate around a Layer 2 loop indefinitely.
Each switch floods a broadcast out every eligible port except the port where it arrived. The same frame returns through another link, so switches flood it again. This creates a broadcast storm. Switches also learn the same source MAC address on different ports repeatedly, causing MAC table instability.
Spanning Tree Protocol (STP) prevents this by building a loop-free logical tree. Physical links can remain connected, but STP places some ports into a non-forwarding state.
BPDUs: How Switches Talk About the Topology
A Bridge Protocol Data Unit (BPDU) is a control message exchanged by switches. BPDUs advertise a switch's view of the spanning-tree topology. They carry information such as the claimed root bridge, the sender's bridge ID, and the path cost to the root.
Switches compare received BPDU information. Better information spreads through the network, allowing switches to agree on one root and on the preferred paths toward it.
The Bridge ID and Why Priority Comes First
A bridge ID identifies a switch in STP. It consists mainly of a bridge priority and a MAC address. The switch with the lowest bridge ID becomes the root bridge.
Priority is compared before the MAC address, so administrators can choose the root deliberately. If priorities tie, the switch with the lowest MAC address wins. In per-VLAN STP, the comparison occurs separately for each VLAN.
| Comparison order | Lower value wins |
|---|---|
| Bridge priority | Preferred root |
| MAC address | Tie-breaker |
Electing the Root Bridge
Initially, each switch may claim to be the root. After exchanging BPDUs, every switch adopts the lowest bridge ID it has learned. The resulting root should normally be a stable, central distribution switch rather than an access switch.
Path Cost and Root Path Cost
Path cost represents the expense of reaching the root through a link. Faster links generally have lower costs. A switch adds the costs along a path to calculate its root path cost. When multiple paths exist, it prefers the path with the lowest total cost.
Exercise
Two switches advertise equal root path costs, but one has a lower bridge ID. Which path is preferred?
Show answer
The path advertised by the switch with the lower bridge ID, because bridge ID breaks the tie after path cost.