Glossary

STP

Spanning Tree Protocol

What is STP

STP (Spanning Tree Protocol) is a Layer 2 management protocol that eliminates loops in switched Ethernet networks by selectively blocking redundant links, while also providing link backup. Redundant links between switches are a common way to build resilient networks, but without a loop-prevention mechanism they create broadcast storms, duplicate frames, and MAC address table instability that can take down an entire Layer 2 domain within seconds.

STP solves this by pruning the physical topology — which may contain loops — into a single loop-free logical tree, blocking just enough ports to remove every loop while keeping every switch reachable. If an active link then fails, STP recalculates the tree and brings a previously blocked port into forwarding state, restoring connectivity through the backup path.

The original STP standard has since been extended by two evolutions built on the same core principles: RSTP (Rapid Spanning Tree Protocol), which shortens convergence from tens of seconds down to 1–2 seconds, and MSTP (Multiple Spanning Tree Protocol), which maps different VLANs to different spanning tree instances so that traffic can be load-balanced across redundant links instead of leaving them idle.

Feature

STP

RSTP

MSTP

Standard

IEEE 802.1D

IEEE 802.1w

IEEE 802.1s

Convergence rate

30–50 seconds

1–2 seconds

1–2 seconds

VLAN support

Single instance

Single instance

Multiple instances

Load balancing

Not supported

Not supported

Supported

Backup path

Not supported

Supported

Supported

Applicable scenarios

Small networks

Medium-sized networks

Large, multi-VLAN networks

Given its faster convergence, VLAN-aware load balancing, and backward compatibility with STP/RSTP-only neighbors, MSTP is the mode most commonly recommended for production deployments today.

How STP Works

All three modes share the same underlying election logic: switches exchange configuration messages (BPDUs) to agree on a root bridge, then each non-root switch works out the best path back to that root and blocks any port that would otherwise create a loop.

· Root bridge election: Every switch advertises a bridge ID. The switch with the lowest bridge ID network-wide is elected the root bridge — the reference point from which the rest of the tree is calculated.

· Root port election: Each non-root switch compares the configuration messages received on all of its ports and selects the one offering the lowest-cost path to the root as its root port.

· Designated port election: On each network segment, the switch offering the best path to the root becomes the designated bridge for that segment, and its corresponding port becomes the designated port, forwarding traffic. Any other port on that segment that would duplicate the path is blocked instead.

· Steady-state monitoring: Once the tree has converged, switches continue exchanging BPDUs on a Hello timer. If a port stops receiving BPDUs from its neighbor for several consecutive Hello intervals, the switch treats that link as failed and re-triggers the calculation, unblocking an alternate port where one is available.

MSTP layers additional structure on top of this base algorithm. It groups switches sharing the same region name, VLAN-to-instance mapping, and revision level into an MSTP region. Inside a region, VLANs are bound to MSTIs (Multiple Spanning Tree Instances), each computing its own independent tree — and by default, all VLANs belong to instance 0, the CIST (Common and Internal Spanning Tree), which also connects every region into a single network-wide tree by treating each region as one node. This is what allows MSTP to give different VLANs different active paths across the same physical links, rather than forcing all traffic onto one shared tree.

Why STP is Beneficial

The core value of STP lies in making redundant Layer 2 topologies safe and self-healing:

· Eliminates broadcast storms: By pruning the physical topology down to a loop-free tree, STP prevents the traffic amplification that redundant links would otherwise cause.

· Enables safe link redundancy: Network designers can wire in backup links for resilience without worrying about creating loops — STP keeps the extra paths blocked until they're needed.

· Automatic failover: When an active link or switch fails, STP recalculates the tree and activates a blocked backup port, restoring connectivity without manual reconfiguration.

· Scales from small to large networks: STP, RSTP, and MSTP cover a spectrum from simple small networks up to large, multi-VLAN environments that need both fast convergence and load balancing across links.

At Asteraix

What We Can Do at Asteraix

AsterNOS supports STP, RSTP, and MSTP for building loop-free, resilient Layer 2 topologies:

· Selectable working mode: stp enable stp/rstp/mstp lets administrators choose the protocol version that fits the network, with MSTP enabled by default.

· Tunable timers and domain identity: Forward delay (4–30 seconds), hello interval (1–10 seconds), and max age (1–1,000,000 seconds) are all configurable per device, alongside the MSTP domain (region) name, so that regions and convergence behavior can be tuned to the deployment.

· MSTP instance and VLAN binding: stp instance <instance-id> creates an MSTI, and stp bind vlan <instance-id> <vlan-id> maps specific VLANs onto it — the basis for directing different VLANs' traffic along different physical paths.

· Priority-based path control: Both instance priority and per-port priority are configurable (0–15 range), giving administrators direct control over which switch becomes the domain root for each instance and which links carry which VLANs.

· Display and maintenance: show stp status reports the spanning-tree mode, and for every MST instance and port, the port role (Root, Designated, Alternate, Backup, Master, Disabled) and STP state (Discarding/Blocking/Listening, Learning, Forwarding) — letting administrators confirm the active topology at a glance.

· Typical deployment: Three switches interconnected with redundant links can be placed in the same MST domain, with VLAN 40 and VLAN 41 each bound to their own MSTI and given a different priority on each device. This lets VLAN 40 take one physical path through the network as its active tree while VLAN 41 takes another, load-balancing traffic across both redundant links instead of leaving one permanently idle — verifiable directly through show stp status on each device, which shows the differing port roles per instance.