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:
- The neighbour recognises its new path to the root (root port).
- It briefly blocks its own designated ports (synchronisation) so that no loop can form anywhere, and sends proposals there itself.
- 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
| Role | State | Meaning |
|---|---|---|
| Root port | forwarding | best path to the root |
| Designated | forwarding | forwards on this link away from the root |
| Alternate | discarding | prepared backup for the root port |
| Edge | forwarding | end 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” 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
| Protocol | Layer | Simplification in the simulation |
|---|---|---|
| RSTP | 2 | RST 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)