RLReadyLinks Docs

Spanning tree

How spanning tree keeps Ethernet networks loop-free, the differences between STP, RSTP, and MSTP, and the ReadyLinks defaults, CLI, and protections you reach for in the field.

Ethernet has no idea what to do with a loop. A single patch lead plugged into both ends of a switch, or two uplinks between the same pair of switches with nothing to stop them, is enough to multiply broadcast frames until the network collapses. Spanning tree is the protocol that detects redundant paths at Layer 2 and blocks just enough of them to leave exactly one active path between any two switches. If an active link fails, a blocked link is unblocked and traffic re-routes within seconds.

This page covers the three variants in common use — classic STP, RSTP, and MSTP — and documents how ReadyLinks switches implement them, including the defaults, the CLI, and the per-port protections you reach for in the field.

#Why spanning tree exists

An Ethernet frame has no time-to-live. A single loop in the L2 topology does three things at once:

  • Broadcast storms. One broadcast circulates forever and is duplicated at every switch it visits. Within seconds the network is unusable.
  • MAC table instability. The same source MAC appears on multiple ports. The switch rewrites its MAC table on every frame and stops forwarding anything correctly.
  • Duplicate frame delivery. Endpoints receive the same unicast multiple times, which breaks TCP sessions and confuses applications.

Spanning tree prevents all three by electing one switch as the root bridge and then logically disabling (blocking) enough links to leave a tree — a graph with no cycles — between the remaining switches. Blocked ports still receive and process spanning-tree frames, so if a forwarding link goes down they can be put back into service without a config change.

#Classic STP (IEEE 802.1D)

The original protocol. Still relevant because many legacy devices only speak classic STP, and RSTP and MSTP both fall back to it when the neighbour on the other end is 802.1D-only.

#Port roles

  • Root port — the port on a non-root switch with the lowest-cost path to the root bridge.
  • Designated port — on each segment, the port that forwards traffic toward the root.
  • Blocked port — receives and processes BPDUs but does not forward data.

#Port states

A port walks through these states on link-up:

StateForwards data?Learns MACs?Processes BPDUs?
DisabledNoNoNo
BlockingNoNoYes
ListeningNoNoYes
LearningNoYesYes
ForwardingYesYesYes

#Timers

  • Hello — 2 s. How often the root sends BPDUs.
  • Forward Delay — 15 s. Time spent in Listening, then again in Learning.
  • Max Age — 20 s. How long to keep BPDU information before assuming the root is gone.

A port that comes up on a classic STP network takes about 30 to 50 seconds to reach Forwarding. That delay is why RSTP exists.

#Root election

Every switch starts by claiming to be root with its own Bridge ID (an 8-byte value: 2 bytes of priority followed by the switch's base MAC). The lowest Bridge ID wins. Priority is 16 bits, default 32768; lower is better. If two switches have the same priority, the lower MAC wins.

Once the root is elected, every other switch chooses a root port by comparing the root path cost advertised in incoming BPDUs. Ties are broken by sender Bridge ID, then by port ID.

#BPDUs

  • Sent out every port every two seconds by default.
  • Carry the Root Bridge ID, the sender Bridge ID, the root path cost, and the port ID.
  • A Topology Change Notification propagates toward the root when a port changes state. The root flags the next few BPDUs so the rest of the network flushes its MAC tables faster.

#Rapid Spanning Tree (RSTP, 802.1w / 802.1D-2004)

RSTP is the default on nearly every modern switch, ReadyLinks included. Same bridge-ID election, same BPDU format on the wire, but convergence drops from tens of seconds to sub-second on a point-to-point link.

What changed:

  • Three port states instead of five. Discarding, Learning, Forwarding. Discarding replaces Disabled, Blocking, and Listening.
  • Two new port roles. Alternate (a backup root port, offered by a different switch) and Backup (a backup designated port on the same shared segment, rare in practice).
  • Proposal/agreement handshake. Adjacent switches negotiate forwarding directly rather than waiting out the Listening and Learning timers.
  • Edge ports. A port that faces an endpoint, not another switch, is marked edge and goes straight to Forwarding on link-up. This is the equivalent of Cisco's PortFast.
  • BPDUs are heartbeats. Every switch originates its own BPDUs every hello interval. If three hellos in a row go missing, the neighbour is declared dead.
  • Topology changes flood directly instead of being funnelled through the root.

RSTP decides whether a link can converge fast based on how it's cabled:

  • Point-to-point — full-duplex between two switches. Fast convergence is available.
  • Shared — half-duplex or a hub. Falls back to classic STP timers.
  • Edge — endpoint-facing. Skips the state machine entirely.

The default link-type detector uses duplex: full-duplex is treated as point-to-point. You can override it per port if a specific deployment misbehaves.

#Edge ports, BPDU guard, and root guard

An edge port that suddenly receives a BPDU means someone has plugged a switch into an access port. Two protections apply:

  • BPDU guard shuts the port the moment a BPDU arrives. Preferred on access ports. See loop protection and BPDU guard for the full write-up.
  • Root guard keeps the port in the designated role. If a superior BPDU arrives, the port is blocked until the BPDUs stop. Used on uplinks facing downstream switches you don't want to let win the root election.

#Multiple Spanning Tree (MSTP, 802.1s / 802.1Q)

RSTP runs one spanning tree for the whole L2 domain. If you have fifty VLANs and two uplinks, every VLAN ends up using the same blocked link — which wastes the bandwidth on it.

MSTP solves this by mapping VLANs into instances, each with its own spanning tree. Different instances can block different links, so both uplinks forward some of the time.

  • MST region — a group of switches that share the same MST configuration (region name, revision, and VLAN-to-instance map). From the outside, the region looks like one giant switch.
  • MST instance (MSTI) — one spanning tree inside the region. Instance 0, the IST, always exists. MSTIs 1 through 4094 are user-defined.
  • CIST — the Common and Internal Spanning Tree. The tree the region presents to non-MSTP neighbours, so that an MSTP region and the surrounding RSTP network interoperate as if the region were a single bridge.

Typical use: put odd VLANs on MSTI 1 with Switch A as root, even VLANs on MSTI 2 with Switch B as root. Both uplinks forward; neither is wasted.

GL-series switches implement all three variants in a single spanning-tree module. The mode is chosen globally; one switch runs STP, RSTP, or MSTP at a time, and switching modes restarts the task.

#Supported modes

  • STP (802.1D) — supported for interop with legacy equipment.
  • RSTP (802.1w / 802.1D-2004) — the recommended mode for most sites.
  • MSTP (802.1s) — supported, with per-instance priority and VLAN-to-instance mapping. Use this when you have multiple VLANs and redundant uplinks and want to spread the load.

#Defaults

ParameterDefaultValid rangeNotes
Spanning treeDisabledenabled / disabledEnabled explicitly as part of switch staging
ModeRSTPSTP, RSTP, MSTPSet globally; changing restarts the task
Bridge priority (STP)655350 to 65535Lower is more likely to be root
Bridge priority (RSTP / MSTP)327680 to 65535
Hello Time2 s1 to 10 s
Max Age20 s6 to 40 s
Forward Delay15 s4 to 30 s
Max Hops (MSTP)20—TTL across the MST region
Region name (MSTP)FMCup to 32 charsChange this before deploying — two defaulted sites meeting across a trunk will unexpectedly auto-form a region
Revision (MSTP)0integer
Port priority1280 to 255
Path costAuto1 to 200,000,0000 in the dashboard means Auto
MSTI priority327680 to 65535, multiples of 4096The UI rejects any value that isn't a multiple of 4096

The three timer values are constrained by the usual 802.1D relationship, which the dashboard enforces: 2 × (Forward_Delay − 1) ≥ Max_Age ≥ 2 × (Hello_Time + 1).

#Per-port controls

Each port exposes the following, from both the dashboard and the CLI:

  • Edge — mark the port as endpoint-facing so it skips the state machine on link-up. The classic STP mode calls the same thing PortFast.
  • Point-to-point — Auto (default), Force_True, or Force_False. Auto classifies full-duplex links as point-to-point.
  • Protocol migration — a manual trigger to re-detect the neighbour's spanning-tree version, used when a legacy device has been replaced on the far end.
  • BPDU filter — silently drop BPDUs on the port. Use rarely; it effectively disables spanning tree on that link.
  • Root guard — block the port if a superior BPDU arrives, protecting the intended root.
  • Loopback detection — detect self-looped cabling independently of spanning tree.
  • Path cost override — set the cost manually instead of letting the switch pick it from link speed.
  • Port priority — break ties when two ports on the same switch have equal cost to the root.

#CLI reference

Spanning tree is configured from the global config and the per-interface mode. These are the commands used on ReadyLinks GL-series switches; the full list is in the CLI quick reference.

markup
GL-24xT-P600D# configure terminal
GL-24xT-P600D(config)# spanning-tree
GL-24xT-P600D(config)# spanning-tree mode rstp
GL-24xT-P600D(config)# spanning-tree priority 4096
GL-24xT-P600D(config)# spanning-tree bpdu-guard
GL-24xT-P600D(config)# interface ethernet RJ45/G1
GL-24xT-P600D(RJ45/G1)# spanning-tree
GL-24xT-P600D(RJ45/G1)# spanning-tree edge
GL-24xT-P600D(RJ45/G1)# end
GL-24xT-P600D(config)# interface ethernet Fiber/G1
GL-24xT-P600D(Fiber/G1)# spanning-tree root-guard
GL-24xT-P600D(Fiber/G1)# end
GL-24xT-P600D(config)# write

To see spanning-tree state at a glance:

markup
GL-24xT-P600D# show spanning-tree
GL-24xT-P600D# show spanning-tree ethernet Fiber/G1

#Dashboard paths

The embedded web UI groups spanning tree under its own menu:

  • STP → STP Global. Enable or disable, set the mode, set bridge priority and the three timers.
  • STP → Port Config. Per-port enable, PortFast, root protection, path cost, priority.
  • STP → STP Info. Current roles and states.
  • MSTP → Global. Mode selector and MSTP timers, including Max Hops.
  • MSTP → Region. Region name and revision — change these before deploying.
  • MSTP → VLAN to Instance. Map VLANs to MSTIs.
  • MSTP → Instance Priority. Per-instance bridge priority.
  • MSTP → Port. Per-port edge, point-to-point, protocol migration, BPDU filter, root guard, loopback detection.

#Hospitality and MDU, single root

A head-end switch terminates the uplinks from each unit or floor; room switches hang off it in a star or short chain. One spanning tree is enough.

  • Set bridge priority to 4096 on the head-end so it stays root even if a larger core switch is added later.
  • Leave room switches at the default priority (32768).
  • Mark every room-facing port as edge and enable BPDU guard globally.
  • RSTP is the right mode. MSTP buys nothing here — there is no redundancy to load-balance across.

Two uplinks between every distribution switch and the core. MSTP lets both uplinks carry traffic.

  • Use MSTP with two instances. Make the first core switch root for MSTI 1, the second for MSTI 2.
  • Split VLANs so roughly half the traffic lands on each root.
  • Enable root guard on the core-facing ports of distribution switches.
  • Keep the region name, revision, and VLAN-to-instance map identical across every MSTP switch at the site.

#Mixed-vendor environments

Stay on RSTP unless you can confirm every switch in the L2 domain supports MSTP with the same region configuration. A region mismatch is silent and drops the mismatched switch back to CIST only, which usually means losing the per-VLAN load balancing you added MSTP for in the first place.

#Troubleshooting

SymptomLikely causeFirst check
Whole site goes dark seconds after a cable moveA loop with spanning tree disabled or filteredshow spanning-tree — is STP actually running on both switches?
An access port keeps shutting downBPDU guard tripped by a downstream switch on a port marked edgeShould that port be edge, or does it face another switch?
Convergence takes 30+ seconds on a modern networkOne neighbour is still 802.1D-onlyTrigger protocol migration or replace the legacy device
An unexpected switch has become rootA switch with a lower Bridge ID appeared on the networkSet bridge priority 4096 on your intended root; enable root guard on uplinks
MSTP region has silently split in twoRegion name, revision, or VLAN-to-instance map mismatchCompare the MST config on both sides line-for-line
A port is blocked and you don't know whyIt's an alternate or backup role, by designCompare path costs; raise the cost on the undesired link if you want the other one preferred
Edit this page on GitLab

Last updated October 20, 2026