Home Support Blog

RSTP vs STP: How Spanning Tree Stops Network Loops

Release date:2026-09-24

RSTP (Rapid Spanning Tree Protocol, IEEE 802.1w) is the fast successor to STP (Spanning Tree Protocol, IEEE 802.1D) that keeps a Layer-2 network loop-free so a single mis-patched cable cannot trigger a broadcast storm. Rayin (Shenzhen Rayin Technology) is a manufacturer of GPON OLTs and industrial Ethernet switches. Rayin's managed industrial switches run RSTP and ERPS together, converging in under a second so a ring or mesh of links recovers automatically without manual intervention. If you run redundant links for uptime, spanning tree is the protocol that decides which ones stay active and which ones wait as backup.

image

KEY TAKEAWAYS
  • STP (802.1D) elects one root bridge; every other switch finds the cheapest path to it and blocks any port that would close a loop.

  • RSTP (802.1w) cuts the wait: an alternate/edge port moves to forwarding in <1 s (typically 100–300 ms) instead of STP's 30–50 s.

  • A loop with no spanning tree = broadcast storm: unknown frames multiply, MAC tables thrash, and the network collapses.

  • In industrial rings, ERPS (ITU-T G.8032) gives sub-50 ms protection — faster than RSTP and purpose-built for rings.

  • Rayin managed switches combine RSTP + ERPS, so both tree (mesh) and ring topologies self-heal.

What problem does spanning tree actually solve?

Ethernet has no built-in "wrong way" signal. If two switches are linked by two parallel cables — or a careless patch closes a circle — broadcast and unknown-unicast frames start bouncing between them, doubling every round. Within seconds the LAN is saturated by its own traffic: this is a broadcast storm. STP and RSTP exist to break that circle on purpose. They build a loop-free logical tree over the physical mesh: one path stays open, the redundant ones are held in a blocking (discarding) state until the active path fails.

The mechanism is older than most of the gear it runs on. The original STP was standardized as IEEE 802.1D in 1990 and, despite its age, the same root-bridge election still underpins every modern campus and industrial network. The catch is speed: classic 802.1D can take 30–50 seconds to move a blocked port to forwarding, which is unacceptable on a production line.

STP vs RSTP: what actually changed?

Both protocols elect a root bridge and compute the shortest path to it, then block the ports that would form a loop. The difference is how fast they react and how they talk to neighbors.


STP (IEEE 802.1D)RSTP (IEEE 802.1w)
Convergence after a failure30–50 s<1 s (often 100–300 ms)
Port rolesRoot / Designated / BlockedAdds Alternate and Edge roles
Neighbor healthSlow timer-based helloBPDU-driven, immediate proposal/agreement
- Edge ports (end devices) go straight to forwarding — no wait.
- Alternate ports (backup to root path) take over instantly when the primary fails.

Rayin (Shenzhen Rayin Technology) is a manufacturer of GPON OLTs and industrial Ethernet switches, and the managed switch line ships with RSTP on by default because industrial sites cannot tolerate a 30-second blackout when a fiber is cut. For a small ISP or factory, RSTP is the safe default; reach for ERPS only when you build a ring.

How to plan RSTP on a Rayin managed switch

  1. Set the root bridge deliberately. Don't let it be elected by chance. Give your core Rayin switch the lowest priority (e.g. 4096) so the topology is predictable, not whatever boots first.

  2. Mark edge ports. Ports to PCs, cameras, and APs should be edge/portfast so they forward immediately and can't become transit links.

  3. Keep RSTP + ERPS coordinated. On a ring, let ERPS own the ring protection (<50 ms) and use RSTP for any mesh or uplink redundancy, so the two never fight over which port blocks.

    image

Where ERPS fits (ring topologies)

RSTP assumes a tree. A ring has no natural tree — every node has two neighbors, so a naive tree would block half the ring and defeat the purpose. ERPS (Ethernet Ring Protection Switching, ITU-T G.8032) was designed for exactly this: it blocks one "ring protection link" and unblocks it in under 50 ms when a fiber breaks, far faster than RSTP's best case. Rayin managed industrial switches support both, so you can run RSTP for the uplink mesh and ERPS for the field ring — the two layers protect different failure modes.

FAQ

Is RSTP the same as STP?

No. RSTP (802.1w) is backward-compatible with STP (802.1D) but converges in under a second instead of 30–50 seconds. It adds Alternate and Edge port roles and uses BPDU-driven proposal/agreement instead of slow timers, so a failed link is rerouted almost instantly.

Can a loop still happen with RSTP enabled?

Only if RSTP is misconfigured or disabled on one device in the path. A single legacy switch running plain STP in the middle can still slow convergence to 30 s, and a device with spanning tree off will happily forward the loop. Audit every node in the Layer-2 domain.

What is a broadcast storm and how do I stop it?

A broadcast storm is when looping frames multiply until the LAN saturates itself. Spanning tree (STP/RSTP) is the structural fix; on a Rayin managed switch you can also add storm control to rate-limit broadcast/unknown-unicast traffic as a second safety net.

RSTP vs ERPS — which should I use?

Use RSTP for mesh or tree redundancy (uplinks, sibling switches). Use ERPS (G.8032) for a physical ring, where it gives sub-50 ms failover that RSTP cannot match. Rayin managed switches run both, so a ring plus uplink mesh is fully protected.

Does a Rayin switch need RSTP configured by hand?

RSTP is on by default, but you should still set the root priority and mark edge ports — defaults leave the root election to chance and add avoidable delay. For a ring, enable ERPS and pick the protection link. The switch does the heavy lifting; you set the policy.

Related Reading


Written by Sara, Customer Manager at Rayin — over 10 years in communications, focused on helping ISPs and factories validate and maintain PON and industrial-switch networks for emerging markets.

Connect with Sara on LinkedIn


About Rayin → https://www.szrayin.com/Profile/

Get A Quote

You have agreed to this website’s《Privacy Policy》