Infrastructure · Topic 3 of 13

Rapid PVST+ and MST Spanning Tree

Configure and verify Rapid PVST+ and MST on Catalyst switches: port roles and states, root bridge setup, MST regions and instances, and show commands.

  • 6 min
  • Includes a diagram
In a nutshell
  • RSTP is IEEE 802.1w, and Cisco runs it per VLAN as Rapid PVST+.
  • The lowest bridge ID wins the root election, and priority steps are 4096.
  • RSTP roles are root, designated, alternate and backup. States are discarding, learning and forwarding.

What it is

Rapid Spanning Tree Protocol (RSTP) and Multiple Spanning Tree (MST) keep a switched network free of loops while converging quickly.

RSTP is defined in IEEE 802.1w. On Cisco switches it runs per VLAN as Rapid PVST+. MST is defined in IEEE 802.1s and groups many VLANs into a few spanning tree instances, which saves switch resources.

Switchesredundant linkselectRoot bridgelowest bridge IDblocks loops withDiscarding portsalternate or backupleavesForwarding portsactive paths

How it works

Both protocols elect a root, pick the best paths and block the rest.

The root bridge

All switches elect one root bridge, and the commands here are IOS XE. The winner has the lowest bridge ID. The bridge ID is made of a priority and the MAC address, and the priority moves in steps of 4096 because part of it carries the VLAN number.

Switch(config)# spanning-tree mode rapid-pvst
Switch(config)# spanning-tree vlan 10 root primary
Switch(config)# spanning-tree vlan 20 priority 4096

The root primary keyword sets a priority lower than the current root, and the macro does this once at the time it is entered. Setting priority gives you exact control. The default priority is 32768, and the extended system ID adds the VLAN number to it.

RSTP port roles and states

Three switches in a triangle. SW1 is the root bridge with designated ports, SW2 and SW3 have root ports toward it, and the link between SW2 and SW3 has a designated port on SW2 and a discarding alternate port on SW3. SW3 also has an edge port to a PC. RSTP has four port roles and three states.

RoleMeaning
Root portBest path toward the root, one per non root switch
Designated portBest path toward a segment, forwards for that segment
Alternate portA backup path to the root through another switch
Backup portA backup path to the same segment, on the same switch
StateMeaning
DiscardingDoes not forward frames and does not learn MAC addresses
LearningLearns MAC addresses but does not forward
ForwardingForwards frames and learns

RSTP merges the old blocking, listening and disabled states into discarding. Alternate and backup ports are discarding. If the root port fails, an alternate port can take over at once, which is why convergence is fast.

Why RSTP is faster

RSTP does not depend on timers on point to point links. Neighbouring switches use a proposal and agreement exchange to move a link to forwarding. An edge port goes straight to forwarding, because it connects to an end device and cannot form a loop.

Switch(config)# interface GigabitEthernet1/0/5
Switch(config-if)# spanning-tree portfast

RSTP treats a full duplex link as point to point and a half duplex link as shared. Fast transitions need a point to point link.

Path cost

The path cost decides which port becomes the root port. Default costs depend on the speed and the cost method.

SpeedShort methodLong method
10 Mbps1002000000
100 Mbps19200000
1 Gbps420000
10 Gbps22000

The command spanning-tree pathcost method long selects the long method. All switches in the network should use the same method. Rapid PVST+ uses the short method by default on Catalyst switches, though defaults can differ by platform.

MST basics

MST maps many VLANs to a small number of instances. Each instance has its own tree and its own root. Instance 0 is the IST, and it carries the information for the region as a whole.

Switches belong to the same region only if the name, the revision number and the VLAN to instance mapping all match.

Switch(config)# spanning-tree mode mst
Switch(config)# spanning-tree mst configuration
Switch(config-mst)# name REGION1
Switch(config-mst)# revision 1
Switch(config-mst)# instance 1 vlan 10,20
Switch(config-mst)# instance 2 vlan 30,40
Switch(config-mst)# exit
Switch(config)# spanning-tree mst 1 root primary
Switch(config)# spanning-tree mst 2 priority 4096

VLANs that you do not map belong to instance 0. A mismatch in any of the three items puts a switch in a different region, and it then connects to the others as if it were on another spanning tree.

Switch AREGION1, revision 1same name, revision, mappingSwitch BREGION1, revision 1same regionOne MST regionshared instances

Comparing the protocols

FeatureRapid PVST+MST
StandardCisco, based on 802.1wIEEE 802.1s
TreesOne per VLANOne per instance
CPU useGrows with VLAN countLow and stable
SetupSimpleNeeds matching region settings

Verifying

Switch# show spanning-tree vlan 10
Switch# show spanning-tree summary
Switch# show spanning-tree mst
Switch# show spanning-tree mst configuration

show spanning-tree vlan 10 shows the root, the local bridge ID, and each port with its role, state and cost. In MST, show spanning-tree mst configuration shows the name, revision and mapping that must match between switches.

What to remember for the exam

Eight facts cover most questions on this topic.

  • RSTP is IEEE 802.1w, and Cisco runs it per VLAN as Rapid PVST+.
  • The lowest bridge ID wins the root election, and priority steps are 4096.
  • RSTP roles are root, designated, alternate and backup. States are discarding, learning and forwarding.
  • An edge port, set with spanning-tree portfast, goes straight to forwarding.
  • RSTP uses proposal and agreement on point to point links.
  • MST is IEEE 802.1s and maps VLANs to instances.
  • An MST region needs the same name, revision and VLAN mapping.
  • Unmapped VLANs belong to MST instance 0.
Exam tip

If two MST switches do not agree on the tree, compare the name, revision and VLAN mapping first.

Common mistakes

These four mistakes appear often.

Mixing the old and new states. RSTP has discarding, learning and forwarding, not blocking and listening.

Forgetting the revision number. A different revision puts a switch in a different MST region.

Using portfast on switch links. It is meant for edge ports, and a loop can form if a switch is attached.

Leaving the root to chance. Set the root bridge deliberately, rather than letting the lowest MAC address win.

Watch out

Changing the spanning tree mode on a live network can briefly interrupt traffic, so plan the change.

Check yourself

Work through these three questions.

  • Which RSTP port role provides a backup path to the root through another switch?

    The alternate port provides that backup path, and it can take over quickly if the root port fails.

  • What must match for two switches to be in the same MST region?

    The region name, the revision number and the VLAN to instance mapping must all match.

  • What does spanning-tree portfast do on an edge port?

    It sends the port straight to forwarding, because the port connects to an end device.

Topic 3 of 13 in Infrastructure

Test yourself on Infrastructure

The full Cisco CCNP 350-401 ENCOR question bank has 854 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by Cisco. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.