Course contents

Chapter 6: Spanning Tree ProtocolLesson 17 of 25

Introduction to Rapid PVST+

RSTP's roles, states and link types, and how it converges in seconds.

Intermediate · 8 min read

Technical definition

Rapid PVST+ is Cisco’s per-VLAN implementation of RSTP (Rapid Spanning Tree Protocol, IEEE 802.1w). It runs one RSTP instance per VLAN and converges in seconds or less by using alternate and backup port roles, a proposal/agreement handshake and edge ports, instead of waiting for timers.

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?

Diagram
How slow was classic STP, really?
How slow was classic STP, really?
Classic PVST+Rapid PVST+
How a port decides it's safe to forwardWaits for timers to run outAsks the neighbour switch and gets an answer
StepsListening (15 s) + learning (15 s), plus max age (20 s) after some failuresProposal → agreement
TimeAbout 30 s (up to 50 s after some failures)Less than a second (with PortFast on the PC ports)
Read each row across: the left box names the item, the others describe it.

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

ProtocolStandard / ownerTreesSpeedCisco mode (name shown)
STPIEEE 802.1DOne (CST)Timers, 30–50 sNone
PVST+Cisco, on 802.1DOne per VLANTimers, 30–50 spvst (ieee)
RSTPIEEE 802.1wOneHandshake, < 1 sNone
Rapid PVST+Cisco, on 802.1wOne per VLANHandshake, < 1 srapid-pvst (rstp)
MSTIEEE 802.1sA few, each with a group of VLANsHandshakemst (mstp)

On Cisco networks, people usually say "classic STP" to mean PVST+, and "RSTP" to mean Rapid PVST+. Rapid PVST+ is the default on current Catalyst 9000 switches, but many older models default to PVST+.

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:

TCA
bit 7
Agreement
bit 6
Forwarding
bit 5
Learning
bit 4
Port role
bits 3–2
Proposal
bit 1
TC
bit 0

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.

Alternate and backup: the new port roles

Diagram
Alternate and backup: the new port roles
Alternate and backup: the new port roles
RoleMeaning802.1D equivalent
RootBest path to the rootRoot port
DesignatedForwarding end of a linkDesignated port
AlternateA backup path to the root through another switch, ready to useBlocking
BackupA backup for a designated port on the same segment (needs a hub, so it is rare)Blocking
DisabledShut downDisabled
Read each row across: the left box names the item, the others describe it.

Port states: three instead of five

RSTP stateReplaces 802.1DForwardsLearns MACs
DiscardingDisabled, blocking, listeningNoNo
LearningLearningNoYes
ForwardingForwardingYesYes

Link types decide how fast a port can start

Diagram
Link types decide how fast a port can start
Link types decide how fast a port can start
Link typeDetected fromBehaviour
EdgePortFast is configuredForwards at once. No topology change when it goes up or down.
Point-to-pointFull duplexCan use the fast proposal/agreement handshake (see the RSTP synchronization lesson)
SharedHalf duplex (e.g. a hub)Goes back to the slow, timer-based way
Read each row across: the left box names the item, the others describe it.

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

Diagram
Rapid PVST+ failover
Rapid PVST+ failover
DPRPDPRPDPALTSW1priority 24576SW2priority 32768SW3priority 32768PC APC B

Device key: SW1, SW2, SW3 (switch) · PC A, PC B (computer)

Lines show the example’s network connections. The coloured path and envelope follow the current step; its text identifies the sender, receiver and traffic type. Blocked: forwarding prevented by a port or policy. Down: failed link. Read the step for the cause.

  1. 1. Normal. SW3's root port goes straight to SW1. Its alternate port toward SW2 is discarding (blocked).
  2. 2. The root port fails. SW3 loses the SW1–SW3 link.
  3. 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. 4. MAC tables flushed. SW3 sends topology-change BPDUs itself. The switches remove the affected MAC entries at once.

What counts as a topology change now

Diagram
What counts as a topology change now
What counts as a topology change now
802.1DRSTP
What counts as a changeA 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 itA TCN goes up to the root, and then the root turns on TCThe switch that saw it sends TC BPDUs itself, for 4 seconds, out of its root port and its non-edge designated ports
EffectMAC aging shortened to 15 sMAC entries are removed at once, on all ports except the one the TC came in on. Neighbours pass the TC on.
Read each row across: the left box names the item, the others describe it.

Switching to rapid-pvst and checking it

spanning-tree mode rapid-pvst

On 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-point

Only needed if a full-duplex link is not seen as point-to-point (for example, auto-negotiation set it to half duplex).

Example output · based on Cisco documentation; exact format varies by platform and software version
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
protocol rstp shows the switch runs Rapid PVST+. Altn BLK is the alternate (discarding) port. P2p and Edge are the link types.

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.

A related trap: once a port has fallen back to 802.1D because it heard an old-style BPDU, it can stay in that mode after the old switch is removed. clear spanning-tree detected-protocols makes the port check again.

Warning: 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.

Test yourself on Rapid PVST+

Predict · scenario 1

Which RSTP role is a backup path to the root through a different switch, worked out in advance?

Predict · scenario 2

How long does an RSTP switch wait before deciding a neighbour has gone silent?