PVST/RPVST PortFast Explained

PortFast is a feature PVST (Per VLAN Spanning Tree) / RPVST (Rapid Per VLAN Spanning Tree) uses to move a switch port from the blocking state to the forwarding state, bypassing listening and learning states. It reduces the convergence time. However, enabling it on the port connected to another switch could create switching loops. You should enable this feature only on the ports connected to non-STP speaking devices.

When we start an PVST/RPVST speaking switch, it enables its ports through various states. A port can not forward user frames until it goes through these states. During these states, PVST/RPVST selects a role for each port. A port role defines whether the port will forward user frames or remain blocked to remove loops.

PVST runs all ports through four states: blocking, listing, learning, and forwarding. During these states, it selects the root port, designated ports, and disabled ports. Only the root and designated ports forward user frames. 

RPVST runs all ports through three states: discarding, learning, and forwarding. During these states, it selects the root, alternate, designated, backup, and disabled ports. Only the root and designated ports forward user frames. 

Running ports through these states ensure that no loop occurs in the network. However, it also increases the network convergence time. Convergence refers to a state where all ports have transitioned through all states and their roles have been finalized. Switches running PVST reach convergence in 50 seconds. Switches running RPVST reach convergence in 10 seconds.  

The faster the network reaches convergence, the less disruption it causes for the users. You can use the PortFast feature to speed up the convergence time. A switch always places the PortFast-enabled port in the forwarding state. A PortFast-enabled port does not go through the PVST states. It can forward traffic while other ports go through the PVST states.

Let's take an example. We start an eight-port PVST running switch. PortFast feature is enabled on ports 1 and 2. The switch enables ports 1 and 2 immediately. Ports 1 and 2 can forward frames without waiting for the remaining ports to reach convergency. Ports 3 to 8, based on their allocated role, can forward frames only after PVST finishes its operation. As we know, PVST takes 50 seconds to finish its operation. So, ports 3 to 8 can't forward frames till 50 seconds. 

portfast feature

When PVST is running, PortFast ports on the same switch can forward traffic among themselves. It limits the PVST disruption. However, if the devices connected to PortFast ports want to communicate with devices connected to non-PortFast ports, they must wait until the PVST process is completed and the root and designated ports have moved into a forwarding state.

You should use the PortFast feature only on the ports that do not create switching loops, such as ports connected to PCs, servers, and routers. You should never enable this feature on a port that connects to another switch. 

PortFast Packet Tracer example

Create a Packet Tracer practice lab, as shown in the following image.

portfast lab

Download Packet Tracer lab.

Enabling PortFast feature

The PortFast feature works with all variations of PVST supported by Cisco switches. The configuration of the PortFast feature is simple. You can enable it globally or on an interface-by-interface basis. The following command enables it globally. 

Switch(config)# spanning-tree portfast default

The above command enables PortFast on all non-trunking ports on the switch. It does not enable PortFast on trunk ports.

The following command enables PortFast on the given interface.

Switch(config)# interface type [slot_#/]port_#
Switch(config-if)# spanning-tree portfast [trunk]

The trunk parameter allows us to enable PortFast on a trunk connection. You can use this option on the port connected to a non-switch device, such as a router or server with a trunk card.

The following image shows an example of the PortFast configuration. It enables the PortFast feature on port 1. 

enable portfast

Download Packet Tracer lab with PortFast configuration.

Since Port 1 is connected to a PC, enabling PortFast on this port does not create any issues. To see the benefits of PortFast, you can restart the switch. The following image shows the ports' state when PVST is running on non-PortFast ports.

portfast example

As we can see in the above image, the PortFast port is accepting and forwarding user frames while all non-PortFast ports are running PVST operations.

Conclusion

The PortFast feature allows us to bypass PVST states. It speeds up the convergence process. A switch always keeps PortFast ports in the forwarding state. You should use this feature only on the ports connected to end devices. You should never use this feature on the ports connected to another switch. PVST and RPVST are Cisco's STP variations. Cisco builds them on STP/RSTP. EtherChannel and PortFast features are available only on PVST and RPVST. They are not available on STP/RSTP. You can use these features only on Cisco switches.

ComputerNetworkingNotes CCNA Study Guide PVST/RPVST PortFast Explained