Rapid Spanning Tree Protocol (RSTP) vs Spanning Tree Protocol (STP)

RSTP needs backwards compatibility with STP switches. Thus Discarding state merges Disabled, Blocking, Listening into one. Ideally if running a complete RSTP topology then discarding becomes practically unneeded due to the explanation below.

In STP BPDU will only be sent from root bridge > down, therefore non-root bridges would only forward on BPDUs that are received from the root-bridge via their root port. Therefore topology change will mean a longer convergence time as the TCN has to be propagated to the root bridge first then from the root bridge out to all remaining bridges in the switching domain.

For STP Hello(2 secs), max age timer (10 x hello time, by default 20s), then 15s each for Listening and Learning. If no timers are touched for STP and you haven’t enabled any add-on features like backbonefast or uplinkfast then you can be looking at ~50s for convergence time.

In RSTP all switches can send BPDUs every hello time period not just the root bridge, the BPDUs carry up to date information. This enables faster convergence as the switch that determines the failure can advise the rest of the switching domain(bridge) of the TCN(Topology Change Notification) immediately. As the failure detection time becomes 3 x hello timer. Therefore if the hello timers are left at the default of 2 secs, detection of a failure can happen within ~6 secs.

RSTP also has two additional port states:

Alternate port : Technically in discarding state but is allocated as a alternate best path to the root-bridge. If the current root port fails the alternate port will take over.

Backup port : This port is allocated as a redundant designated port. If there is already a designated port forwarding for that segment then this port will remain backup until it is needed. Technically this port is in discard state until needed.

One more point RSTP marks edge ports as ports connected to end devices (No BPDUs expected on this port). This enables STP ‘portfast’ features to ensure the host port comes up as quickly as possible to avoid dropping DHCP packets etc.

Rapid PVST vs STP

Rapid PVST combines the rapid transition of ports by Rapid Spanning Tree Protocol (RSTP) with the creation of spanning trees for each virtual LAN (VLAN) by PVST+. RSTP improves the slow transition of a Spanning Tree Protocol (STP) port to the forwarding state, thereby increasing convergence speed.
STP is used to eliminate loops in a switched network that is designed with redundant paths. There can be only one active path at any given time between any two endpoints on an Ethernet network. If multiple paths between the same two endpoints exist at the same time, switching loops can occur. STP activates and deactivates links dynamically to allow the network to respond to and reroute traffic around a failed link.

When RSTP is enabled, each port first enters the discarding state, in which a port receives bridge protocol data units (BPDUs) and directs them to the system module? however, the port neither sends BPDUs nor forwards any frames. The switch port then transitions to the learning state, in which it begins to transmit BPDUs and learn addressing information. Finally, a switch port transitions to the forwarding state, in which the switch port forwards frames. If a switch port determines at any time during the RSTP state process that a switching loop would be caused by entering the forwarding state, the switch port again enters the discarding state, in which the switch receives BPDUs and directs them to the system module but does not send BPDUs or forward frames.

STP port states are somewhat different from RSTP port states. A switch port will pass through the following STP states after a switch is turned on:

-Blocking
-Listening
-Learning
-Forwarding

When STP is enabled and a switch is turned on, each port first enters the blocking state, which is similar to the RSTP discarding state. The switch port then transitions to the listening state, in which it begins processing BPDUs as it listens for information to determine whether it should transition to the learning state. After entering the learning state, a switch port begins to transmit BPDUs and learn addressing information with which to build the switching database. Finally, a switch port transitions to the forwarding state, in which the switch port forwards frames. If a switch port determines at any time during the STP state process that a switching loop would be caused by entering the forwarding state, the switch port enters the disabled state, in which the switch receives BPDUs but does not direct them to the system module.

The primary differences between STP and RSTP are the port states and the speed of convergence. By default, STP takes 50 seconds to converge. By contrast, RSTP takes less than 10 seconds to converge.