Instiq
Chapter 2 · Routing & switching·v1.0.0·Updated 7/10/2026·~14 min

What's changed: Initial version

2.4STP and loop prevention

Key points

Covers the Layer 2 loop and its harmful consequence, a broadcast storm, that arise when switches are connected redundantly with multiple links; the Spanning Tree Protocol (STP/RSTP) that prevents this; root bridge election, determined by priority and MAC address; and the port states a port transitions through, along with the difference in convergence speed between STP and RSTP.

It is natural to want to connect switches redundantly with multiple physical links to improve availability, but in a Layer 2 network this directly creates a serious failure mode: an L2 loop. A network designer reconciles the seemingly contradictory requirements of "we want redundancy, but we want to avoid loops" using STP (Spanning Tree Protocol). This section covers the causal chain of why a loop becomes a catastrophic failure and how STP prevents it while still preserving redundancy.

2.4.1L2 loops and broadcast storms

  • An L2 loop occurs when switches are connected redundantly in a ring and frames circulate endlessly. An L3 IP packet has a TTL (time-to-live) and is discarded after a fixed number of hops, but an L2 Ethernet frame has no equivalent mechanism, so once a loop forms, frames keep multiplying forever.
  • A broadcast storm is a phenomenon in which looping broadcast frames (such as ARP requests) multiply until they saturate the entire network, exhausting bandwidth and effectively bringing the whole network to a halt. A switch's MAC address table also becomes unstable as the same frame appears to arrive from constantly shifting sources, causing even otherwise-healthy traffic to fail as collateral damage.

2.4.2STP/RSTP and root bridge election

  • STP (Spanning Tree Protocol) automatically builds a logically loop-free tree structure (a spanning tree) out of a redundantly wired L2 topology, placing some of the links that would otherwise form a loop into a blocking state on standby—preventing loops while preserving the physical redundancy.
  • The root bridge is the single switch that serves as the root (reference point) of the spanning tree. The switch with the smallest bridge ID (bridge priority + MAC address) is elected. When priorities are tied, the switch with the smallest MAC address wins, so the standard practice for ensuring a specific switch becomes the root bridge is to explicitly lower its priority value.
  • Each switch designates the port on its lowest-cost path to the root bridge as the root port, and the lowest-cost port for each segment as the designated port—both are placed in the forwarding state—while all other ports on redundant links are placed in the blocking state, breaking the loop.
Exam point

Most-tested: "an L2 loop has no TTL, so frames multiply endlessly and directly cause a broadcast storm", "STP builds a loop-free tree by placing some links in blocking state", and "the root bridge is the switch with the smallest bridge ID (compared by priority, then MAC address)". Remember the operational practice of lowering the priority when you want a specific switch to become the root bridge.

A company's network administrator connected a core switch and an access switch with two redundant links to improve availability. Immediately afterward, communication across the entire network became extremely slow, and eventually every port stopped passing traffic. Investigating the cause revealed that the redundant links had been wired with STP disabled, forming an L2 loop; broadcast frames such as ARP requests circulated endlessly around the loop, triggering a broadcast storm that exhausted the available bandwidth. The remedy is first to enable STP (or, if possible, the faster-converging RSTP), which automatically drops one of the redundant links into the blocking state, reconstructing a logically loop-free tree. Now, if the design policy calls for the core switch to always serve as the root bridge, relying on the default bridge-ID comparison risks having some other access switch—whose MAC address happens to be smaller—elected as the root instead. This is undesirable, since it can result in an inefficient tree rooted at an access switch, or an unintended single point of failure at that switch. The fix is to explicitly set the core switch's bridge priority to a value lower than every other switch's, guaranteeing that it is always elected as the root bridge. Furthermore, since classic STP's convergence time (the time for a port to transition from blocking to forwarding) can take up to about 50 seconds, if there is an additional requirement that link-failure outages be much shorter, the appropriate judgment is to adopt RSTP (Rapid STP), which speeds up port-state transitions and shrinks convergence to roughly a few seconds.

ItemSTPRSTP
StandardIEEE 802.1DIEEE 802.1w
Typical convergence timeUp to about 50 secondsA few seconds
Port statesBlocking / listening / learning / forwarding, etc.Reorganized states for fast transitions (discarding, etc.)
Warning

Trap: "Simply connecting switches with redundant links automatically improves availability" is wrong—unless STP is enabled, redundant links form a loop, risking a broadcast storm that halts the entire network, so redundancy and enabling STP must always be designed together. Also wrong: "the root bridge is automatically the switch with the highest processing performance"—the election criterion is the bridge ID (priority, then MAC address) only, unrelated to processing performance. To ensure a specific switch is elected, its priority must be explicitly configured.

STP/RSTP, root bridge.
Preventing L2 loops

2.4.3Section summary

  • An L2 loop has no TTL, so it directly leads to a broadcast storm that can disable the entire network
  • STP/RSTP places some redundant links in the blocking state to build a loop-free tree, achieving both availability and loop prevention
  • Root bridge election is decided by bridge ID (priority, then MAC address); to designate a specific switch, its priority must be lowered

Sign in to track progress — Log in.

Quick check

(just a quick review)

Q1. A core switch and an access switch were connected redundantly with two physical links to improve availability. Immediately afterward, network-wide communication became extremely slow and eventually stopped entirely. What is the most likely direct cause of this failure?

Q2. In an STP-enabled network, you want to guarantee that a specific core switch is elected as the root bridge, rather than leaving the outcome to the default bridge-ID comparison. Which configuration most reliably achieves this?

Q3. In an STP-enabled network, an outage of up to about 50 seconds after a link failure is causing operational problems. Which measure is most appropriate for shrinking this convergence time to roughly a few seconds?

Check your understandingPractice questions for Chapter 2: Routing & switching