Wiki DE Start in the browser

Wiki › Protocols

Rapid Spanning Tree (RSTP)

The fast variant of STP: proposal and agreement instead of waiting, a prepared backup port and failover in milliseconds.

Layer
2 (Sicherung)
Standard
IEEE 802.1Q, IEEE 802.1D
See an example
See demo

Why faster?

Classic Spanning tree (STP) only allows a new path after the forward delay (up to 50 seconds in real networks). Calls and connections stand still that long. RSTP (formerly IEEE 802.1w, now part of IEEE 802.1Q) elects the root bridge the same way but switches over in milliseconds.

Proposal and agreement

A port that becomes designated does not simply start forwarding. It sends a proposal to its neighbour:

  1. The neighbour recognises its new path to the root (root port).
  2. It briefly blocks its own designated ports (synchronisation) so that no loop can form anywhere, and sends proposals there itself.
  3. Then it answers with an agreement. Both ports forward at once.

The release travels like a wave away from the root through the network, without timers.

Roles and states

RoleStateMeaning
Root portforwardingbest path to the root
Designatedforwardingforwards on this link away from the root
Alternatediscardingprepared backup for the root port
Edgeforwardingend device attached, active at once

If the root port fails, the alternate port becomes the new root port without waiting. When the tree changes, the switches send BPDUs with the TC flag (topology change); whoever receives it forgets the learned MAC addresses on the other ports and passes the message on.

The RST BPDU

RSTP uses the same frame format as STP, but protocol version 2 and type 0x02. The flag byte holds proposal, agreement, role, learning, forwarding and TC. A switch that only speaks STP does not understand this: on that port RSTP falls back to STP (version 0) and waits as STP does.

In leyoNET

Choose RSTP in the switch under Switching → Spanning tree → Variant, or on the command line spanning-tree mode rstp (also rapid-pvst). show spanning-tree shows «protocol rstp», roles and states. The packet list filters with rstp; the packet details show the flags. In the demo a continuous ping keeps running while you remove a cable.

How to do it in leyoNET

The same text as in the app’s help (F1 key).

Rapid Spanning Tree (RSTP)

RSTP (formerly IEEE 802.1w, now part of IEEE 802.1Q) is the fast variant of Spanning tree (STP). The root bridge is elected the same way, but ports no longer wait for the forward delay:

  • A new designated port sends a proposal. The neighbour briefly blocks its own ports (synchronisation) and sends an agreement; then both forward at once – in milliseconds instead of seconds.
  • An alternate port is the prepared backup: if the root port fails, it takes over without waiting.
  • Blocked ports are called discarding (instead of blocking/listening).
  • Switches tell each other about a topology change (TC flag) so that all flush their MAC tables.
  • If a switch with classic STP is attached, the port talks STP (version 0) to it and waits as STP does.

Turn it on in the switch under Switching → Spanning tree → Variant or with spanning-tree mode rstp. In the packet list, the filter rstp shows the RST BPDUs.

See an example

  • RSTP: failover without waiting

    Three switches in a triangle with Rapid Spanning Tree. The core is the root bridge, the link Switch A–Switch B is blocked as a backup (alternate, discarding). Proposal and agreement open ports within milliseconds.

    PC 1 pings PC 2 continuously. Remove the cable Core–Switch B: the alternate port takes over at once, the ping continues without loss. Packet list with filter «rstp»: flags proposal, agreement and TC. For comparison, set the switches to STP.

    Watch live Project file

“Watch live” opens the network in leyoNET, the simulation runs in a loop. In the app you find it under File → Demo networks, with a step-by-step tour.

Practise

  • ★★★★☆ Failover without waiting (RSTP) · 3 goals · Worksheet (German)

In leyoNET under Tools → Exercise catalogue. Every exercise checks itself.

What leyoNET simplifies

ProtocolLayerSimplification in the simulation
RSTP2RST BPDU (version 2) with proposal/agreement, roles and TC flag; the root port forwards at once, a designated port after the agreement, otherwise after the forward delay (2 s, half discarding, half learning); edge ports automatic (end device attached); failure of a direct link takes effect at once; neighbour with STP: version 0 as there; no backup port, no MSTP, no port priorities

Standards

  • IEEE 802.1Q – Bridges and Bridged Networks (current edition: IEEE 802.1Q-2022)
  • IEEE 802.1D – Media Access Control (MAC) Bridges (current edition: IEEE 802.1D-2004)

Read on

Found a mistake or have an idea? Source of this page on GitHub.