Networking

Spanning Tree Deep Dive, Part 1: The Standard Never Shuts a Port Down

A BPDU taken apart byte by byte, why the default timers are arithmetic, how topology changes flood your network, the RSTP behaviors that rarely make it into training, and the guard features the IEEE standardized under its own names.

Tony Mattke · 2026.11.17 · 30 min read

In November 2002, the network at Beth Israel Deaconess Medical Center in Boston started to crawl. It seemed to settle by evening, then fell apart again the next morning, and it didn’t come back cleanly until the following Monday. On the third day the hospital gave up on it entirely and went to paper, with handwritten prescriptions and runners carrying lab results to patients’ rooms. I’ve pointed people at that outage before, and the detail I keep coming back to is in CIO John Halamka’s own explanation, which a reader relayed onto the NANOG list a couple of weeks later. In places, the management VLAN, VLAN 1, sat 10 Layer 2 hops from the root bridge. The 802.1D default timers assume a network diameter of seven.

Spanning tree did exactly what the standard says it does with a topology that broke the standard’s assumptions, and BPDUs (bridge protocol data units, the frames switches trade to build the tree) aged out before they reached the far edge of the network. Most of us learned spanning tree from Cisco, which means we learned Cisco’s spanning tree, a per VLAN protocol with BPDU guard and err-disabled ports and root guard, and assumed all of that was the standard. Most of it is Cisco’s own additions on top of it.

This is the second protocol in the Network Protocol Deep Dive series, after link aggregation. This part is the standard itself, down to the bits on the wire, with captures from a lab of Arista cEOS switches showing where they follow it to the letter and the couple of places they don’t.

A poem, a patent, and a withdrawn standard

Radia Perlman designed the algorithm at DEC and published it at SIGCOMM in 1985. Her paper opens with a poem, “Algorhyme,” printed right under the abstract.

I think that I shall never see A graph more lovely than a tree. A tree whose crucial property Is loop-free connectivity.

It ends “A mesh is made by folks like me / Then bridges find a spanning tree,” which sums up the protocol.

Read the paper itself, because the original algorithm was much simpler than what we run today. Distance to the root was a hop count. Bridge priority and link cost both show up only in a section called “Extensions,” described as “trivial extensions to the algorithm,” with priority as a single byte bolted onto the front of the 48 bit address. Perlman even suggested setting it to “the number of levels away from the backbone LAN that the bridge is.” Her stated goals still read well, too. “It is undesirable to have a network that can be brought down so easily, merely by plugging a cable into the wrong place.” Forty years later we’re still working on that one.

DEC shipped it in 1986 in the LANBridge 100, and offered its bridge patent to anyone at no cost, which is what opened the door to an IEEE standard. That became 802.1D in 1990, revised in 1998. Then the amendments piled up. 802.1w brought Rapid Spanning Tree (RSTP) in 2001, 802.1s brought Multiple Spanning Tree (MSTP) in 2002 (as an amendment to 802.1Q, because mapping VLANs to trees is VLAN business), 802.1D-2004 folded RSTP in, and eventually 802.1Q-2014 absorbed what was left of 802.1D. 802.1D-2004 is listed as superseded, and in 2020 the 802.1 working group announced it would withdraw it outright.

So when a design doc cites “802.1D” for spanning tree behavior, it’s citing a superseded standard. The live text is clause 13 of 802.1Q. The IEEE gives the base 802.1Q text away through its GET Program, but it runs past 2,000 pages, so for the standard’s own words I also leaned on the 802.1 working group’s published YANG model, the working group’s public ballot comments and presentations, and two open source implementations that annotate their code with clause numbers, mstpd and the Linux kernel bridge.

A BPDU, byte by byte

This is a real Rapid Spanning Tree BPDU (pronounced B-P-D-U, not bippy-du), captured on a host attached to an edge port of an Arista switch in my lab.

text
20:42:51.333671 aa:c1:ab:de:5a:5f > 01:80:c2:00:00:00, 802.3, length 39: LLC, dsap STP (0x42) Individual, ssap STP (0x42) Command, ctrl 0x03: STP 802.1w, Rapid STP, Flags [Proposal, Learn, Forward, Agreement], bridge-id 8000.00:1c:73:ad:71:c9.8003, length 36
	message-age 1.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
	root-id 1000.00:1c:73:27:48:a1, root-pathcost 20000, port-role Designated
	0x0000:  0180 c200 0000 aac1 abde 5a5f 0027 4242
	0x0010:  0300 0002 027e 1000 001c 7327 48a1 0000
	0x0020:  4e20 8000 001c 73ad 71c9 8003 0100 1400
	0x0030:  0200 0f00 00

The first thing to notice is the missing EtherType, the two byte field that tells a modern Ethernet frame which protocol it’s carrying. A BPDU is an old school 802.3 frame, so those two bytes are a length instead (0027, 39 bytes), followed by an 802.2 LLC (Logical Link Control) header. LLC names the protocol with service access points, one for the destination and one for the source (DSAP and SSAP), and both are 0x42, the value set aside for spanning tree. The control byte, 0x03, marks it as a plain connectionless frame. A classifier keyed on EtherType has nothing to match on.

After the LLC header comes the BPDU proper, 36 bytes for RSTP. tcpdump prints the frame in two byte groups counted from the first byte, and the 3 byte LLC header pushes the BPDU onto an odd offset (0x11), so its first few fields straddle the groups. In 0300 0002 027e, the 03 is still the LLC control byte, followed by the Protocol Identifier 00 00, the version 02, the type 02 and the flags 7e. From the Root ID on, the fields line up with the groups again.

BytesValue hereField
00000Protocol Identifier, always zero
022Protocol Version (0 STP, 2 RSTP, 3 MSTP)
022BPDU Type (0x00 Config, 0x80 TCN, 0x02 RST and MST)
7eflagsTopology Change, Proposal, Role, Learning, Forwarding, Agreement, TC Ack
1000 001c 7327 48a1priority 4096 + MACRoot ID
0000 4e2020000Root Path Cost
8000 001c 73ad 71c9priority 32768 + MACSender’s Bridge ID
8003priority 128, port 3Port ID
01001 secondMessage Age
140020 secondsMax Age
02002 secondsHello Time
0f0015 secondsForward Delay
000Version 1 Length

The timers are in 1/256ths of a second. Each one is a 2 byte field, whole seconds in the first byte and the fraction in the second. Max Age 20 goes on the wire as 0x1400. Outside a Linux bridge I’ve never seen the fractional byte set to anything but zero.

That last zero byte is a fossil. Version 1 Length belongs to 802.1G, a remote bridging standard from 1996 that’s since been withdrawn. Mick Seaman’s 1999 RSTP design note explains it in one line. “The Version number is 2, since Version number 1 was reserved for 802.1G. The Version 1 Length is as required by 802.1G for versions of 1 or higher.” Every RSTP and MSTP BPDU on the planet still carries a zero byte on behalf of a standard you’ll never run into.

The flags byte is where RSTP lives. 0x7e breaks down like this.

BitMaskMeaningSet here?
00x01Topology Changeno
10x02Proposalyes
2-30x0CPort Role (1 Alternate/Backup, 2 Root, 3 Designated)3, Designated
40x10Learningyes
50x20Forwardingyes
60x40Agreementyes
70x80Topology Change Ackno

Alternate and backup share role code 1, so a receiver can’t tell them apart from the wire. Cisco’s RSTP tech note says “when a designated port is in a discarding or learning state (and only in this case), it sets the proposal bit.” This port is forwarding and proposing anyway, on every BPDU, and the standard’s state machines explain why. A designated port only starts proposing while it isn’t forwarding and isn’t edge, but once it’s proposing, only an agreement from the other end clears the flag. A host never sends one, so a port that proposed on its way up keeps proposing after it’s forwarding.

Message Age is really a hop count. The original 802.1D intent was the time since the root generated the BPDU. Cisco’s timer guide says “the root bridge sends all its BPDUs with a message age value of 0, and all subsequent switches add 1 to this value,” and RSTP made it official, adding “a minimum increment to the Message Age” so information “cannot ‘go round in circles’ for long.” This switch is one hop from the root, so Message Age is 1. Max Age 20 means “20 bridges from the root, then throw it away.” (Linux’s in kernel 802.1D bridge is the exception. It adds real elapsed time plus 1/256 of a second per hop.) I tested that one, too. A hand built BPDU claiming priority 0, injected from a host port, took over as root immediately. The identical BPDU with Message Age set to 20 was ignored completely, no root change, nothing in the log.

Why the IEEE needed a new BPDU type

RSTP was supposed to be backward compatible in the simplest possible way. Old bridges would ignore the version number and any fields they didn’t understand and process a new BPDU as if it were version 0. That plan died in a test lab. Seaman again, from 1999.

Unfortunately it appears that a conformance test house has widely disseminated a tool that checks that BPDUs of unknown version and unknown flags are discarded – thus ensuring an installed base of bridges that can not simply be resident in upgraded networks as originally envisioned.

So RSTP got a new BPDU type, legacy bridges drop it, and by Seaman’s account the whole migration machinery exists because of one test tool.

Turn spanning tree off and you become a wire

The destination address 01:80:C2:00:00:00 sits in a block of 16, 01:80:C2:00:00:00 through 01:80:C2:00:00:0F, that the IEEE reserves for frames bridges must not forward. The IEEE Registration Authority’s own wording is that frames in this range “are not relayed by MAC bridges conforming to IEEE 802.1D,” and it calls those 16 addresses “a scarce resource.” The same document says vendor proprietary protocols should use addresses from the vendor’s own block, which is why Cisco’s per VLAN BPDUs go to 01:00:0C:CC:CC:CD (VLAN 1 also gets a copy sent to the IEEE address), an ordinary multicast address that every other vendor’s switch floods.

Now turn spanning tree off and see what happens to a standard BPDU. Linux, Arista, Extreme and Cisco all start forwarding it on purpose. The Linux bridge code says it outright, in a comment. “If STP is turned off, then must forward to keep loop detection.” Arista’s manual says a switch in spanning-tree mode none “forwards inbound STP packets as multicast data packets on the VLAN where they are received.” Extreme’s EXOS has bpdu-forwarding on by default when STP is disabled. Cisco’s small business line floods them “unconditionally (without applying VLAN rules).” And the Catalyst 9300 guide manages to say both things in one paragraph, first that the switch “receives but does not forward” frames in that range “regardless of the spanning-tree state,” then a couple of sentences later that with spanning tree disabled it “forwards those packets as unknown multicast addresses.” Classic Cisco.

The forwarding is deliberate, and it goes all the way back to Perlman’s paper. “Simple bridges are ones that do not participate in this algorithm, but pass HELLO messages through transparently. Thus LANs connected with simple bridges will look to this algorithm like a single LAN.” A switch with spanning tree off is supposed to behave like a piece of wire, so the bridges around it can still see the loop. The lab shows it. With spanning tree running, the Arista switches consumed every BPDU I injected and none reached the host on the far side. With spanning-tree mode none on both switches in the path, every one went straight through. A cheap unmanaged switch that eats BPDUs instead breaks that assumption.

How the election works

Every bridge has a 64 bit Bridge ID, and the lowest one wins root. The 802.1t amendment carved the original 16 bit priority into a 4 bit priority and a 12 bit system ID extension, which holds a VLAN ID or an MST instance number. The split is why priority only comes in multiples of 4096, and it’s why a Cisco switch at default priority shows 32769 for VLAN 1. The 32768 is the 4 bit priority (8) shifted left 12 bits, and the 1 is the VLAN. VLAN 10 shows 32778. The capture above has 1000 for the root and 8000 for the sender, 4096 and 32768, with an extension of zero because this is a single RSTP tree.

With equal priority, the lowest MAC wins. You’ll hear that this means the oldest switch in the network ends up root, and that’s only partly true. Older hardware from the same vendor often has lower MAC addresses, so it tends to work out that way, but nothing guarantees it across vendors or OUIs (the vendor prefix in the first half of a MAC address). Set your priorities.

Once there’s a root, every bridge picks a root port, and every segment picks a designated port, by comparing priority vectors. The comparison goes in strict order, lowest wins at each step.

  1. Root Bridge ID
  2. Root Path Cost, meaning the cost in the BPDU plus the cost of the port it arrived on
  3. The sender’s Bridge ID
  4. The sender’s Port ID
  5. The receiving port’s own Port ID

The path cost detail trips people up. A BPDU carries the sender’s cost to the root, and the receiver adds the cost of its own ingress port. Change the cost on the upstream end of a link and the downstream bridge doesn’t care, because it never adds that number.

Step 4 is where port priority matters. Two links between the same pair of switches, with equal port costs, tie on everything through step 3, and the tie is broken by the sender’s port ID. If you want to steer which of the downstream switch’s ports becomes root port, you change port priority on the upstream switch. Step 5, the receiving port’s own ID, only matters when two ports hear the identical BPDU, which means a hub or a port looped back to its own switch. Cisco’s 9300 configuration guide gets this wrong in two places. It describes the port identifier as “port priority and MAC address,” and it says “the port priority and port ID are added together.” The port ID is a 4 bit priority (default 8, displayed as 128) and a 12 bit port number, concatenated, the 8003 in the capture. Nothing gets added. (802.1D-1998 used 8 bits of each, and Linux’s kernel STP still uses its own 6 bit priority and 10 bit port number.)

Path cost brings the first real vendor trap, because there are two cost tables.

Link speed802.1D-1998 (short, 16 bit)802.1D-2004 / 802.1Q (long, 32 bit)
10 Mb/s1002,000,000
100 Mb/s19200,000
1 Gb/s420,000
10 Gb/s22,000
100 Gb/sn/a200

Short costs bottom out at 1, so above 10 gig the short table can’t tell faster links apart, and the standard moved to the long one. My Arista lab uses long costs out of the box (that’s the 20000 in the capture), and so does HPE Aruba. Juniper’s sample output shows 20000 on gigabit ports too, though its prose still lists the old short values. Cisco in PVST+ (Per VLAN Spanning Tree Plus) and Rapid PVST+ mode defaults to short, and its 9300 guide says “the short path cost method is the default STP path cost method used” and then prints a default table full of long values… Switch the same Catalyst to MST and it moves to long on its own. In a mixed network, one vendor adds 4 for a gigabit hop and the next adds 20,000, the summed path costs mix both scales, and the root port lands wherever the arithmetic says. spanning-tree pathcost method long on the Cisco side fixes it, and Arista’s interop white paper recommends it.

The timers are arithmetic

Hello 2, Max Age 20, Forward Delay 15. Most of us memorized these without ever asking where they came from, and they come from a formula. Cisco’s timer tuning guide reproduces the IEEE derivation, and the inputs are a picture of 1990 networking. A diameter of seven bridges, three lost BPDUs in a row, a full second for a bridge to relay a BPDU, a second of transit delay per frame, half a second of media access delay. Run those through and you get

max_age       = (4 x hello) + (2 x diameter) - 2        = 20
forward_delay = ((4 x hello) + (3 x diameter)) / 2      = 15 (rounded)

Cisco’s own comment on the inputs is wonderfully dry. “These values can seem quite conservative in a modern network, in which you are not likely to lose three BPDUs or to have 1 second of latency for a frame through a switch.” Diameter in this formula counts switches, including the first and last switch on the path, and only the root’s Max Age and Forward Delay matter. Every bridge uses the values the root advertises, so tuning those anywhere else does nothing until that switch becomes root. If you collect timer trivia, I keep a list of well known intervals, and 20 seconds of Max Age is on it.

Max Age is a hop budget, and at Beth Israel VLAN 1 was ten hops deep on timers sized for seven. Halamka’s explanation says BPDUs past that depth get discarded, and under 802.1D a bridge that stops hearing the root declares itself root and starts a new election. Halamka’s writeup called the Layer 2 design “out of specification with 802.1d standards,” and the fix was to wall off the PACS (picture archiving and communication system) imaging network behind a Layer 3 boundary, strip redundant links until the tree held, and then add redundancy back at the core.

The classic worst case for 802.1D convergence is 50 seconds, 20 of Max Age waiting for old information to expire, then 15 of listening and 15 of learning. Perlman’s paper explains why the wait exists at all. Loops “are far more serious than temporary partitions,” so every bridge that should stop forwarding has to stop before any bridge starts.

Topology changes, the quieter outage

When people picture a spanning tree problem, they picture a loop. The far more common pain is the topology change, because every one of them makes switches drop MAC entries early (802.1D shortens the aging timer, RSTP flushes outright) and flood traffic until they relearn.

In classic 802.1D, a bridge that sees a port go to forwarding, or a forwarding port go to blocking, sends a Topology Change Notification out its root port. A TCN is the saddest BPDU there is, 4 bytes long, carrying nothing but “something changed.” It goes upstream one hop at a time, with each bridge acknowledging it (the TC Ack flag) and relaying it further toward the root. The root then sets the Topology Change flag in its own BPDUs for Max Age plus Forward Delay, 35 seconds by default, and every bridge that sees that flag cuts its MAC aging time from 300 seconds to Forward Delay, 15 seconds. (The Linux kernel, of course, uses twice Forward Delay, 30 seconds.)

Two smaller details. The root never sends a TCN. It sets the Topology Change flag in its own BPDUs. And per the Linux implementation, a bridge only announces a port coming up if it’s designated for at least one port, so a leaf switch bringing up its root port doesn’t start the whole process.

Now picture a user’s PC on a port without PortFast. Every time it reboots, the port goes through listening and learning and comes up forwarding, and every bridge in the network spends the next 35 seconds aging MAC entries at 15 seconds. A building full of PCs being rebooted on a Tuesday morning keeps that up for a good while. This is the main reason PortFast matters on host ports. The DHCP timeouts most people cite are the smaller problem.

RSTP turned the whole process inside out.

  • Only gaining forwarding counts. Cisco’s RSTP note says “only non-edge ports that move to the forwarding state cause a topology change,” so “a loss of connectivity is not considered as a topology change any more.” A port going down or going to discarding no longer starts one.
  • The initiator floods it. The bridge that sees the change sends TC flagged BPDUs out all its non-edge designated ports and its root port itself. The root isn’t involved. “The TC propagation is now a one-step process.”
  • The flush is immediate. A bridge receiving a TC clears “the MAC addresses learned on all its ports, except the one that receives the topology change.”

The lab shows how edge ports sit out. Flapping a non-edge interswitch link on one Arista switch moved its topology change counter, and the MAC entry on its edge port stayed. The entry learned on the flapped link went away too, but a link going down removes those whether or not there’s a TC, so that part doesn’t prove the flush.

The counter moved by more than one, though. The flapped link was the switch’s root port, and a single shut and no shut did this…

Number of topology changes 58 last change occurred 123 seconds ago
        from Ethernet2
--- shut / no shut Ethernet2 ---
Number of topology changes 65 last change occurred 32 seconds ago
        from Ethernet2

Arista doesn’t say what the counter counts, at least anywhere I can find, so I turned on the Stp agent’s topology change trace and captured BPDUs on both links. EOS adds one every time a port’s topology change state machine enters DETECTED, meaning this switch saw one of its own non-edge ports go forwarding, or NOTIFIED_TC, meaning a BPDU arrived with the TC flag set. This flap produced one DETECTED, when Ethernet2 came back as root port, and six NOTIFIED_TC, three BPDUs from each neighbor. RSTP keeps the TC flag set for hello time plus one second, long enough for two hellos, and in this triangle each neighbor sent it in two or three BPDUs, so seven runs of the same flap moved the counter by 6 or 7. IEEE’s MSTP MIB (the SNMP definition of these counters) defines the count as “the times tcWhile has been non-zero for any Port,” and mstpd, the Linux implementation, adds one only when no port had tcWhile running before. EOS counts every TC it detects or hears, so expect its number to climb much faster than the number of things that changed.

Flapping the PortFast edge port on the same switch didn’t move the counter at all, and the entries on the other ports stayed put.

RSTP converges faster and floods more, and Cisco says so plainly… “This approach results in potentially more temporary flooding”. Every non-edge port that comes up forwarding sends a TC through the tree, and each bridge it reaches flushes what it learned on its non-edge ports, except the one the TC arrived on.

What else RSTP changed

The port states collapsed from five to three. Cisco’s own RSTP note points out that “there is no difference between a port in the blocking state and a port in the listening state,” which is why RSTP merged disabled, blocking and listening into discarding. Ports also got explicit roles. Root and designated forward, alternate is a blocked port with a backup path to the root, and backup is a blocked port with a redundant connection to a segment this bridge already serves.

Backup ports deserve a footnote, because you’ll almost never see one. Per Cisco, a backup port “can exist only when two ports are connected in a loopback by a point-to-point link or when a device has two or more connections to a shared LAN segment,” which in practice means a hub or a cable looped back into the same switch.

Every bridge says hello

In 802.1D, a non root bridge is a relay that only sends BPDUs when it receives one from upstream. In RSTP, every bridge originates its own BPDUs every hello time, and a bridge that misses three in a row from a neighbor declares that neighbor gone after 6 seconds, without waiting out a 20 second Max Age. Cisco puts the difference well… “If a bridge fails to receive BPDUs from a neighbor, it is certain that the connection to that neighbor is lost. This is opposed to 802.1D, where the problem can be anywhere on the path to the root.”

RSTP also absorbed two Cisco features. BackboneFast became the rule that “when a bridge receives inferior information from its designated or root bridge, it immediately accepts it and replaces the one previously stored.” UplinkFast became the rule that a bridge losing its root port can move its best alternate port straight to forwarding, minus the dummy multicast frames UplinkFast used to send to update everybody’s MAC tables. The uplinkfast and backbonefast lines that still live in a lot of Rapid PVST+ configs don’t do anything anymore.

Proposal, agreement, and the sync wave

The headline RSTP feature is that a link between two bridges goes forwarding in about the time it takes to exchange two BPDUs. A designated port that isn’t forwarding yet sends a proposal. The bridge on the other end receives it on what will become its root port, and before it answers, it syncs. Every non edge designated port on that bridge drops to discarding. Only then does it unblock its root port and send back an agreement, which is a copy of the proposal with the agreement bit set instead. Cisco’s note says the copy is there so the proposing port knows exactly which proposal the agreement answers.

The ports it just blocked now send proposals of their own, and the handshake ripples outward, so the brief blocking moves one bridge further from the root with each exchange until it reaches the edge.

Two things decide whether that wave is harmless. Edge ports are considered already in sync, so they don’t block during it. Host ports you forgot to mark as edge do, and Cisco’s note warns that the hosts on them lose connectivity while the wave passes. And the agreement only counts on point to point links. Full duplex is assumed point to point, half duplex is assumed shared, and on a shared link there’s no handshake at all. The port waits out Forward Delay twice, old school 802.1D style. A forced half duplex port, or a duplex mismatch that leaves one end at half, brings back 30 second convergence on that link.

(Cisco also mentions, in passing, an enhancement to sync “that allows a bridge to put only its former root port in the discarding state,” and then says the details are “beyond the scope of this document.” So it’s proprietary, and the details stay undocumented.)

Edge ports, and what happens when one hears a BPDU

The standard has two knobs for edge ports. adminEdge marks a port as edge from the moment it comes up, the standardized version of PortFast, and its recommended default is false. AutoEdge, default true, lets the bridge figure it out. A port that proposes and hears no BPDU for the edge delay (3 seconds on a point to point link) promotes itself to edge. So on a switch that implements AutoEdge, a host port with no PortFast configured still goes forwarding in a few seconds.

When an edge port receives a BPDU, the standard does almost nothing dramatic. The 802.1 working group’s own management model says the operational edge value “becomes false(2) if a BPDU has been received.” The port stops being an edge port and goes through normal role selection like any other port. The port stays up the whole time and nothing gets err-disabled.

I tested that on the Arista lab. An access port with spanning-tree portfast, forwarding as a designated edge port, and then a Linux container on the other end sending it a handful of hand built RSTP BPDUs with a bad priority, one every 2 seconds.

s3#show spanning-tree interface Ethernet3 detail
 Port 3 (Ethernet3) of MST0 is designated discarding
   ...
   BPDU: sent 28, received 6, taggedErr 0, otherErr 0, rateLimiterCount 1
Stp[1418]: %SPANTREE-6-INTERFACE_STATE: Interface Ethernet3 instance MST0 moving from forwarding to discarding
Stp[1418]: %SPANTREE-6-INTERFACE_STATE: Interface Ethernet3 instance MST0 moving from discarding to learning
Stp[1418]: %SPANTREE-6-INTERFACE_STATE: Interface Ethernet3 instance MST0 moving from learning to discarding
Stp[1418]: %SPANTREE-6-INTERFACE_STATE: Interface Ethernet3 instance MST0 moving from discarding to learning
...
Stp[1418]: %SPANTREE-6-INTERFACE_STATE: Interface Ethernet3 instance MST0 moving from learning to forwarding

The edge status vanished with the first BPDU, the port was back to forwarding a few seconds after the last one, and it was never err-disabled, which matches the standard.

But look at that flapping between discarding and learning, once every 2 seconds, in time with my BPDUs. My best explanation comes from a different part of RSTP. My hand built BPDU claimed the designated role with the learning and forwarding flags set, while carrying worse information than the switch’s own. In RSTP that combination is a dispute, the standard’s one way link check.

The guards the standard already has

The usual list of spanning tree protection features goes BPDU guard, BPDU filter, root guard, loop guard, Bridge Assurance. None of those names appear anywhere in 802.1Q. They’re vendor features, and Cisco describes loop guard in its own docs as “a Cisco proprietary optimization.”

What’s less well known is that 802.1Q grew its own versions of several of them, under names you won’t see in a Cisco config guide.

Dispute is what I believe my lab BPDU triggered. A designated port that receives an inferior BPDU from a neighbor claiming to be designated, with the learning flag set, concludes that the neighbor can’t be hearing it. Two ports both believing they’re designated for the same link is the signature of a one way link, so the port marks itself disputed and drops to discarding. The 802.1 model defines disputed as “more than one Bridge Port apparently believes itself to be the CIST Designated Port for the LAN and has incorrectly transitioned to a Learning or Forwarding port state.” (The CIST is the common and internal spanning tree, the one tree every MSTP region shares.) My fake neighbor was claiming to be designated and learning, every 2 seconds, so the switch kept disputing it.

Perlman’s 1985 paper already had one way link detection, in a section called “One Way Connectivity.” The standard left it out. In 802.1D-1998, a designated port that hears an inferior BPDU from a neighbor sends its own BPDU back and carries on, and a blocked port that stops hearing BPDUs becomes designated when Max Age runs out and heads for forwarding. That’s the hole Cisco’s UDLD (UniDirectional Link Detection) and loop guard ended up filling. (I couldn’t find a copy of the 1990 text, but the 1998 edition lists what it changed from it, and none of those changes touch spanning tree.) Dispute arrived in 802.1D-2004, and its text was published wrong. Seaman’s 2010 ballot comment on the standard’s reaffirmation says “there was an editorial mishap at the end of 802.1D-2004 development which made the content of the recordDispute() procedure incorrect,” and the fix was turned down because a reaffirmation ballot makes no changes to the standard. Meanwhile Cisco’s current 9300 MST guide describes unidirectional link detection as something “not yet present in the IEEE MST standard,” which hasn’t been true since 802.1Q-2005. (Seriously, Cisco? Who writes these docs?)

restrictedRole is the standard’s root guard. Set it on a port and the bridge won’t select that port as root port, even if it hears the best priority vector on the network. The port becomes an alternate instead. The 802.1Q description is refreshingly honest about the tradeoff. It’s there to stop bridges outside “a core region of the network” from influencing the active topology, “at the risk of causing a lack of spanning tree connectivity.” Cisco’s root guard puts the port into a special root-inconsistent state with its own syslog message. restrictedRole just makes the port an ordinary alternate, which is quieter and harder to spot if you don’t know to look.

restrictedTcn stops a port from propagating topology changes, so a flapping bridge on the far side can’t keep flushing your MAC tables.

isolate is the one that caught my eye. Current 802.1Q has a rule where a point to point port with both adminEdge and AutoEdge set false is expected to hear BPDUs. If it doesn’t, and it’s trying to go forwarding, the standard concludes the neighbor’s spanning tree process has “apparently failed,” sets isolate, and keeps the port discarding. Cisco’s Bridge Assurance is the same idea. The standard has it in the managed object list.

Legacy mode is sticky

Thanks to that conformance test tool, RSTP can’t simply talk to an 802.1D bridge. It has to notice one and fall back. When a port comes up, it starts a 3 second migration timer, and when the timer expires, the port adapts to the version of the next BPDU it hears. Hear a version 0 BPDU, and that port drops to legacy 802.1D. Each port makes that decision on its own.

Getting back out is the hard part. The standard returns a legacy port to RSTP when its link goes down or when it hears an RST BPDU, and short of a manual check, nothing else tells it the legacy bridge has gone away. Cisco’s RSTP note walks through the case where that fails, a shared segment where the old bridge leaves and the link stays up, and ends with “for this particular (rare) case, user intervention is required.” The intervention is clear spanning-tree detected-protocols on Cisco. The standard calls the same thing mcheck, which “forces transmission of RST (or MST or SPT) BPDUs for migrate-time to check that all STP Bridges have been removed.” If nothing left on that link ever sends the port an RST BPDU, it stays on 802.1D timers until somebody remembers the command exists.

I tried it on Arista. A few version 0 BPDUs flipped an RSTP port to legacy, which EOS shows as a boundary.

s3#show spanning-tree interface Ethernet3 detail
 Port 3 (Ethernet3) of MST0 is designated forwarding
   ...
   Link type is point-to-point by default, Boundary STP

Then I ran clear spanning-tree detected-protocols, on the interface and then globally. EOS accepted both without complaint… and more than 100 seconds after the last legacy BPDU, the port was still Boundary STP. In my run, the only thing that looked like it would bring the port back was hearing a real RSTP BPDU from the other end, which is exactly what you won’t get if the old switch is gone and nothing left on the link speaks RSTP.

Where the standard stops and BPDU guard starts

The IEEE standard describes a protocol that heals. A port that hears an unexpected BPDU rejoins the tree. A port with restrictedRole set becomes an alternate instead of a root port. A port whose neighbor goes quiet is isolated, and a port whose neighbor seems deaf is disputed. At every step the standard keeps the port inside the protocol and lets the algorithm route around the problem.

Everything that shuts a port down is vendor code, and BPDU guard has the best origin story of the lot. Cisco’s own BPDU guard document, which dates back to 2001, explains why the feature exists. “A user PC running a Linux-based bridging application was connected to an access port. Because the application sent BPDUs claiming a low bridge priority, the network elected the PC as the root bridge.” The standard’s answer to that PC is to make it root, because it has the best Bridge ID. I reproduced it with the first priority 0 BPDU from a Linux container on an unprotected port.

%SPANTREE-6-ROOTCHANGE: Root changed for instance MST0: new root interface is Ethernet3, new root bridge mac address is 02:00:00:00:00:d0

Turn on root guard and the same BPDUs get %SPANTREE-4-ROOTGUARD_BLOCK and a port stuck in discarding. Cisco’s answer to that PC was BPDU guard, which shuts the port.

Beth Israel’s network did what 802.1D said and fell over anyway, because nobody had checked the design against the assumptions the standard was built on. The PC that won root did what the standard said too, and Cisco answered it with a feature the standard never had. Both failures live in the gap between the protocol and the version of it we learned. Before you trust a design doc or a vendor guide on spanning tree, figure out which of the two it’s describing, because the err-disabled port you’re used to seeing is Cisco’s call, made on top of a standard that would rather route around the problem.

What to take back to your own network is the boring list. Set root and backup root priorities by hand so the oldest MAC address never decides for you. Run spanning-tree pathcost method long on every Cisco box in a mixed network. Keep the Layer 2 diameter inside seven hops, or retune Max Age if you can’t. And turn on BPDU guard on edge ports, knowing it’s Cisco’s answer, while the standard’s answer is to let that PC become root.

Has a host ever won root on your network? Tell me in the comments what it was running.

Related Posts

Automation & Tools · 21 min read

octomon: Is It the Wi-Fi, the ISP or the Internet?

2026.11.12

The video call freezes, and everyone in the house has a theory. The Wi-Fi is bad again. Comcast is doing Comcast things. Something is wrong with “the internet.

Comments