Same idea, much faster
RSTP (IEEE 802.1w) keeps everything from the Common Spanning Tree lessons: choosing the root, root and designated ports, costs and tie-breakers. What changes is how fast it reacts. Switches don't wait for timers. Instead, two neighbour switches agree directly, with a quick exchange of messages (a handshake). Backup ports are also worked out in advance, so they can take over at once. Rapid PVST+ is Cisco's version, with one RSTP tree for each VLAN.
How slow was classic STP, really?
Situation: the simplest network there is: two switches and one cable. Both switches have just been turned on. With classic PVST+, how long until a PC on SW1 can reach a PC on SW2?
| Classic PVST+ | Rapid PVST+ | |
|---|---|---|
| How a port decides it's safe to forward | Waits for timers to run out | Asks the neighbour switch and gets an answer |
| Steps | Up to max age (20 s) + listening (15 s) + learning (15 s) | Proposal → agreement |
| Time | Up to 50 s | Usually less than a second |
Making the timers shorter helps a little. But a protocol based on timers can never safely get much below tens of seconds. PortFast, UplinkFast and BackboneFast (the PVST+ lessons) fixed some cases, but each one needed extra setup. With RSTP, it is fast by default.
From STP to Rapid PVST+: the family tree
| Protocol | Standard / owner | Trees | Speed | Cisco mode (name shown) |
|---|---|---|---|---|
| STP | IEEE 802.1D | One (CST) | Timers, 30–50 s | — |
| PVST+ | Cisco, on 802.1D | One per VLAN | Timers, 30–50 s | pvst (ieee) |
| RSTP | IEEE 802.1w | One | Handshake, < 1 s | — |
| Rapid PVST+ | Cisco, on 802.1w | One per VLAN | Handshake, < 1 s | rapid-pvst (rstp) |
| MST | IEEE 802.1s | A few, each with a group of VLANs | Handshake | mst (mstp) |
On Cisco networks, people usually say "classic STP" to mean PVST+, and "RSTP" to mean Rapid PVST+. Rapid PVST+ is the default on today's Cisco switches.
What changed in the BPDU
The RSTP BPDU keeps the same layout as 802.1D, so old and new switches can still read each other's BPDUs. But it has version number 2, and it uses all 8 bits of the flags byte:
Classic STP only used the two grey bits (TC and TCA). RSTP adds the green ones: the sender's port role and state, and the proposal and agreement bits used in the handshake.
Another big change: in 802.1D, only the root creates BPDUs, and other switches pass them on. In RSTP, every switch creates its own BPDUs every 2 seconds. So if a neighbour goes silent, it is noticed quickly.
Port roles
| Role | Meaning | 802.1D equivalent |
|---|---|---|
| Root | Best path to the root | Root port |
| Designated | Forwarding end of a link | Designated port |
| Alternate | A backup path to the root through another switch, ready to use | Blocking |
| Backup | A backup for a designated port on the same segment (needs a hub, so it is rare) | Blocking |
| Disabled | Shut down | Disabled |
Port states: three instead of five
| RSTP state | Replaces 802.1D | Forwards | Learns MACs |
|---|---|---|---|
| Discarding | Disabled, blocking, listening | No | No |
| Learning | Learning | No | Yes |
| Forwarding | Forwarding | Yes | Yes |
Link types decide how fast a port can start
| Link type | Detected from | Behaviour |
|---|---|---|
| Edge | PortFast is configured | Forwards at once. No topology change when it goes up or down. |
| Point-to-point | Full duplex | Can use the fast proposal/agreement handshake (the “Understanding RSTP synchronization” lesson) |
| Shared | Half duplex (e.g. a hub) | Goes back to the slow, timer-based way |
BPDUs as keepalives
In RSTP, every switch sends its own BPDUs every 2 seconds. It doesn't just pass on the root's BPDUs. If a switch misses three in a row (6 s) from a neighbour, it decides that neighbour's information is gone. It doesn't wait the 20 s max age.
A link failure, the rapid way
- 1. Normal. SW3's root port goes straight to SW1. Its alternate port toward SW2 is discarding (blocked).
- 2. The root port fails. SW3 loses the SW1–SW3 link.
- 3. Instant switch-over. SW3 already knows the alternate port leads to the root. So it becomes the root port and forwards straight away, usually in much less than a second.
- 4. MAC tables flushed. SW3 sends topology-change BPDUs itself. The switches remove the affected MAC entries at once.
Topology changes in RSTP
| 802.1D | RSTP | |
|---|---|---|
| What counts as a change | A port going up or down (unless it has PortFast) | Only a non-edge port that starts forwarding. A port going down or to discarding doesn't count. |
| Who announces it | A TCN goes up to the root, and then the root turns on TC | The switch that saw it sends TC BPDUs itself, for 4 seconds, out of its root port and its non-edge designated ports |
| Effect | MAC aging shortened to 15 s | MAC entries are removed at once, on all ports except the one the TC came in on. Neighbours pass the TC on. |
Configure and verify
spanning-tree mode rapid-pvstOn every switch. If a port hears old 802.1D BPDUs, RSTP goes back to the slow way on that port. So a mixed network loses the speed.
interface GigabitEthernet1/0/1
spanning-tree link-type point-to-pointOnly needed if a full-duplex link is not seen as point-to-point (for example, auto-negotiation set it to half duplex).
SW3#show spanning-tree vlan 10 VLAN0010 Spanning tree enabled protocol rstp Root ID Priority 24586 Address 0200.0000.0001 Cost 4 Port 1 (GigabitEthernet1/0/1) ... Interface Role Sts Cost Prio.Nbr Type ------------------- ---- --- --------- -------- -------------------------------- Gi1/0/1 Root FWD 4 128.1 P2p Gi1/0/2 Altn BLK 4 128.2 P2p Gi1/0/10 Desg FWD 4 128.10 P2p Edge
If a port has auto-negotiated to half duplex, it shows Shr (shared) in the Type column. It then loses the fast handshake, without any warning. So it is a good idea to set speed and duplex by hand on important uplinks, and to check for Shr after changes.
⚠️ Changing spanning-tree mode restarts STP on the switch. Ports go through their states again, and traffic can stop for a short time. The switch warns you about this. Do it at a quiet time that has been planned for changes.
Check yourself
Which RSTP role is a backup path to the root through a different switch, worked out in advance?
How long does an RSTP switch wait before deciding a neighbour has gone silent?