RSTP / RPVST Explained with Examples
A switching loop occurs when a switch has more than one path to reach a destination. Switches forward broadcast frames from all ports except the incoming port. If the network contains a switching loop, switches will receive the frame they forwarded back on other ports. They will forward them again. This cycle will never end. A network never works with a switching loop. Spanning tree protocol removes switching loops. It dynamically builds a virtual network topology, identifies loops, and blocks the ports that cause them.
There are many variations of the spanning tree protocol. The two most popular and widely used variations are STP and RSTP. RSTP is the upgraded version of STP. STP and RSTP use a similar mechanism to find and remove loops. However, RSTP converges more quickly. Convergence is a state in which the switch forwards user frames.
RSTP port states
Ports on an RSTP switch go through the following three states to reach convergency.
- Discarding
- Learning
- Forwarding
Discarding state
When a switch starts or a network change occurs, the switch moves all ports to the discarding state. In this state, the switch does not accept user frames. It accepts only BPDUs. A BPDU is an STP frame. It includes all the information STP/RSTP needs to learn and build the network topology.
Learning State
In the learning state, the switch accepts user frames but does not forward them. From the incoming frames, it builds the CAM table entries.
Forwarding state
In the forwarding state, the switch accepts and forwards user frames.
Electing the root bridge
All STP/RSTP running switches elect one switch as the root bridge. After electing the root bridge, they check all network paths. If a switch has more than one path to reach the root path, it chooses only one path to reach the root bridge. Apart from the root bridge, all other switches become the non-bridge switches.
RSTP port types
There are five RSTP port types. These types are root, alternative, designated, backup, and disabled. A port can play one role. A root port connects a non-root bridge to the root bridge. The non-root bridge switch uses the alternative port to reach the root bridge when the link connected to the root port fails. A designated port connects the non-root bridge switch to the local segment. The non-root bridge switch uses the backup port to reach the local segment when the link attached to it fails. A disabled port does not forward any user frames. It removes loops.
RSTP configuration (Packet Tracer Example)
Create a Packet Tracer lab as shown in the following image.

Download the Packet Tracer lab for RSTP configuration.
By default, all Cisco switches run STP. You can use the show spanning-tree command in privileged exec mode to verify it. Run this command on S1.

If you see IEEE in the output, it indicates the switch is running STP. As shown above, the switch is running STP.
A long time ago, DCE developed the original version of STP. It is called DCE's STP. Later, IEEE developed an open-sourced version of STP. Cisco improved it for its switches. It is called PVST. STP/PVST has slow convergence. IEEE updated the STP to speed up the convergence. The updated version is called RSTP. Cisco also updated its version for the same reason. The updated version is called RPVST. PVST/RPVST is similar to STP/RSTP but has some additional features. Both use the same terminology and algorithm.
RSTP / RPVST configuration
The spanning-tree mode command changes the STP mode. The following command changes the STP mode to RSTP.
Router(config)#spanning-tree mode rapid-pvst
Configure RSTP on S1

STP and RSTP are compatible. You can run both on the same network. However, it will increase the network convergence time. Since the network is running both protocols, it will converge when STP completes its operation. If all switches are RSTP-compatible, use only RSTP to speed convergence and take advantage of its added benefits.
Configure RSTP / RPVST on S2

Configure RSTP / RPVST on S3

Download the Packet Tracer lab with the RSTP/RPVST configuration.
Verifying RSTP / RPVST ports
The show spanning-tree command displays all information about the STP instances. The following image shows the output of this command on S1.

S1 is the root bridge. On the root bridge, all ports are designated ports. The following image shows the output of this command on S2.

S2 is a non-root bridge switch. It has a root and a designated port. The following image shows the output of this command on S3.

S3 is a non-root bridge switch. It has a root port and an alternate port. The alternate port remains blocked till the root port is up. If the root port goes down, the switch enables the alternate port.
The following image shows the output of the spanning-tree command on S3 when the link connected to the root port is down.

The following image shows the output of the spanning-tree command on S3 after the link connected to the root port comes back up.

This tutorial is part of the tutorial series "STP, RSTP, PVST, RPVST, and MSTP Explained with Examples". Other parts of this series are the following.
Chapter 01 Introduction and overview of STP and RSTP
Chapter 02 STP, RSTP, PVST, RPVST, and MSTP
Chapter 03 Similarities and Differences between STP and RSTP
Chapter 04 STP and RSTP Terminology
Chapter 05 STP/RSTP Timers Explained
Chapter 06 The Bridge ID and System ID Extension Explained
Chapter 07 PVST/STP Root Bridge Election Process Explained
Chapter 08 STP Port and Path Costs Explained
Chapter 09 STP Port States:- Blocking, Listing, Learning, and Forwarding
Chapter 10 STP - Spanning Tree Protocol Explained With Examples
Chapter 11 RSTP Port States and Types Explained
Chapter 12 PVST/RPVST and EtherChannel Explained
Chapter 13 RSTP / RPVST Explained with Examples
Conclusion
RSTP / RPVST dynamically manages all links. If a link creates a loop, it blocks the port to which it is connected. If a link goes down, the backup link automatically takes over to maintain connectivity.
By ComputerNetworkingNotes Updated on 2026-05-12