skip to content

What happens to an 802.1D spanning tree when someone plugs in a new switch whose bridge ID is lower than the current root's?

level: seniorimportance: should knowfreq 20%

answer

  1. no incumbency in the election
  2. a better claim propagates
  3. every path re-points
  4. listening and learning again
  5. make the default unwinnable

basics

~20 s

The new switch's BPDUs announce a better root, every bridge accepts it, and the tree is rebuilt around the newcomer. Under 802.1D, ports that must start forwarding wait about 30 seconds and MAC entries age out early, so traffic drops and floods.

solid answer

~50 s

A new switch starts by claiming to be root. If its bridge ID is lower than the current root's, through a lower priority or the same default priority with a lower MAC address, its neighbour treats the BPDU as a better root, adopts it and relays it, and soon every bridge names the newcomer as root. Every bridge then recomputes its path, so the forwarding topology re-points toward a switch that may sit at the edge on a thin link. Under 802.1D, ports that must move to forwarding pass through listening and learning, about 30 seconds at the IEEE default Forward Delay, while ports that must block stop at once; the topology change makes bridges age MAC entries after Forward Delay instead of the usual 300 seconds, so frames flood while tables refill. The prevention is deliberate low priorities on the intended primary and secondary roots, plus guards where no root should appear.

go deeper

for a junior

Recall that the root election never closes: any switch with a lower bridge ID that joins the network becomes the new root.

for a middle

Walk the sequence: the superior claim spreads, every bridge recomputes its path, 802.1D ports wait through listening and learning, and the topology change shortens MAC ageing.

for a senior

Explain both outages, joining and removal, how to confirm the root moved from each bridge's reported root and topology-change counters, and which priorities and port guards prevent a repeat.

for a principal

Treat an unplanned root change as a policy failure: decide where root claims may legitimately appear, and make the default configuration of new switches unable to win.

## Why a new switch can take over The spanning-tree root election has **no incumbency**. Every bridge compares the Root Identifier in each BPDU it receives with the root it currently holds, and a lower one always wins. Seniority, uptime and position count for nothing. So a switch that joins later with a lower **bridge ID** (2-octet priority, then 6-octet MAC address, lowest winning) takes the root role as soon as its claim is heard. Nothing in the protocol asks whether the newcomer is welcome; a BPDU with a lower Root Identifier is simply believed. That newcomer is rarely malicious. Common causes: - a switch from a manufacturer whose MAC addresses sort lower, plugged in at the **default priority** of 32,768 in a network where nobody tuned the root; - a lab or spare switch whose configuration still carries a **low priority** from a previous job; - a **replacement unit** configured from a copy of the core switch's settings and connected in a closet. ## The sequence under 802.1D 1. The new switch starts by claiming to be root and sends Configuration BPDUs naming itself. 2. Its neighbour compares that Root Identifier with the current root's, finds it lower, accepts the newcomer as root and relays the claim to its other segments. 3. The better claim spreads hop by hop until every bridge names the new switch as root. 4. Every bridge recomputes its path toward the new root, so many ports change role. 5. **Ports that must block** go to blocking at once, so traffic using them stops immediately. 6. **Ports that must start forwarding** pass through **listening** and **learning**, each lasting Forward Delay, about **30 seconds** in total at the IEEE default of 15 seconds. 7. The change is signalled as a **topology change**, and bridges age their MAC entries after Forward Delay instead of the normal ageing time (300 seconds by default, RFC 4188), so unknown destinations are flooded until tables refill. A faster protocol version replaces the timed waits of steps 5 and 6 with an explicit handshake between neighbours, but the topology still re-points toward the new root and MAC tables are still flushed. ## What users see | Effect | Cause | Typical scale under 802.1D | |---|---|---| | Traffic loss on re-routed paths | ports waiting in listening and learning | about 30 seconds | | Flooding and extra load | MAC entries aged out after the topology change | until tables refill | | Lasting slowness | forwarding now radiates from an edge switch on thin links | until the root is fixed | | A second outage later | unplugging the newcomer triggers another re-election | can approach 50 seconds | The last row surprises people. When the newcomer is removed, bridges that do not see a link go down still hold information naming it as root. That information has to age out after Max Age (20 seconds by the IEEE default) before they re-elect, and then the ports wait through listening and learning again, so the second disruption can be longer than the first. ## Prevention | Measure | What it does | What it does not do | |---|---|---| | Primary root at a low priority, for example 24,576 | a default-priority newcomer can no longer win | stop a newcomer configured even lower | | Secondary root at the next value, 28,672 | keeps the root at distribution if the primary fails | protect against a misconfigured newcomer | | A guard on edge and downstream ports | refuses a superior root claim from where none belongs | replace deliberate root placement | - Setting the intended root to **priority 0** is not a lock: another bridge at 0 with a lower MAC address still wins. - Port-level guards that refuse BPDUs or superior root claims on access ports are separate features, with their own placement rules. - Do not rely on new hardware having a higher MAC address than the old: address order is a tendency of each manufacturer, not a guarantee. ## How to tell it happened RFC 4188 gives each bridge a `dot1dStpDesignatedRoot` (the root it believes in), a `dot1dStpTopChanges` counter and a `dot1dStpTimeSinceTopologyChange` timer. A root ID that belongs to none of your distribution switches, or a topology-change count that jumped when users complained, is the signature of an unplanned root change.

  • Why can unplugging the new switch cause a second, possibly longer outage?
    Removing the root forces another election. Bridges that do not see a link go down keep information naming the departed switch until it ages out after Max Age, 20 seconds by the IEEE default; then the root moves back and ports that must start forwarding wait through listening and learning again, about 30 seconds more under 802.1D.
  • How can you tell after the fact that the root moved?
    Every bridge records the root it currently believes in, which RFC 4188 exposes as `dot1dStpDesignatedRoot`, and counts topology changes with the time since the last one. A root ID that is not one of your distribution switches, or a counter that jumped when users complained, is the signature of an unplanned root change.

saying these in an interview costs you the question

  • A new switch cannot become root while the current root is still running.
  • The existing root keeps its role because it was elected first.
  • Only the ports on the new switch are affected by the change.
  • Spanning tree re-elects the root only on a periodic timer.
  • Setting the intended root to priority 0 makes it impossible to displace.