Advantages of RSTP
In 2001, IEEE 802.1w was published to introduce the Rapid Spanning Tree Protocol (RSTP), an extension of the Spanning Tree Protocol (STP). RSTP was developed based on STP and makes supplements and modifications to STP.
Disadvantages of STP
STP ensures a loop-free network but is slow to converge, leading to service quality deterioration. If the network topology changes frequently, connections on the STP network are frequently torn down, causing frequent service interruption.
STP has the following disadvantages:
STP does not differentiate between port roles according to their states, making it difficult for less experienced administrators to learn about and deploy this protocol.
Ports in Listening, Learning, and Blocking states are the same for users because they are all prevented from forwarding service traffic.
In terms of port use and configuration, the essential differences between ports lie in the port roles but not port states.
Both root and designated ports can be in Listening state or Forwarding state, so the port roles cannot be differentiated according to their states.
The STP algorithm does not determine topology changes until the timer expires, delaying network convergence.
The STP algorithm requires the root bridge to send configuration BPDUs after the network topology becomes stable, and other devices process and spread the configuration BPDUs through the entire network. This also delays convergence.
Improvements Made in RSTP
RSTP deletes three port states, defines two new port roles (alternate port and backup port), and makes port attributes identifiable according to port states and roles. In addition, RSTP provides enhanced features and protection measures to ensure network stability and fast convergence.
More port roles are defined to simplify the learning and deployment of the STP protocol.
As shown in Figure 9-11, RSTP defines four port roles: root port, designated port, alternate port, and backup port.
The functions of the root port and designated port are the same as those defined in STP. The alternate port and backup port are described as follows:- During configuration BPDU transmission:
- An alternate port is blocked after learning a configuration BPDU sent by another bridge.
- A backup port is blocked after learning a configuration BPDU sent by itself.
- During user traffic forwarding:
- An alternate port acts as a backup of the root port and provides an alternate path from the designated bridge to the root bridge.
- A backup port acts as a backup of the designated port and provides a backup path from the root bridge to the related network segment.
After roles of all RSTP ports are determined, the topology convergence is completed.
RSTP redefines port states.
RSTP deletes two port states defined in STP, reducing the number of port states to three. Depending on whether a port can forward user traffic and learn MAC addresses, the port may be in any of the following states:
- If the port does not forward user traffic or learn MAC addresses, it is in Discarding state.
- If the port does not forward user traffic but learns MAC addresses, it is in Learning state.
- If the port forwards user traffic and learns MAC addresses, it is in Forwarding state.
Table 9-12 compares the port states defined in STP and RSTP. Port states are not necessarily related to port roles. Table 9-12 lists possible states for different port roles.
Table 9-12 Comparison between port states defined in STP and RSTPSTP Port State
RSTP Port State
Port Role
Forwarding
Forwarding
Root port or designated port
Learning
Learning
Root port or designated port
Listening
Discarding
Root port or designated port
Blocking
Discarding
Alternate port or backup port
Disabled
Discarding
Disabled port
RSTP changes the configuration BPDU format and uses the Flags field to describe port roles.
RSTP retains the basic configuration BPDU format defined in STP and makes the following minor changes:- The value of the Type field is changed from 0 to 2. Devices running STP will drop the configuration BPDUs sent from devices running RSTP.
- The Flags field uses the six bits reserved in STP. This configuration BPDU is called an RST BPDU. Figure 9-12 shows the Flags field in an RST BPDU.
- Configuration BPDUs are processed in a different way.
Transmission frequency of configuration BPDUs
In STP, the root bridge sends configuration BPDUs at Hello intervals after the topology becomes stable. Non-root bridges send configuration BPDUs only after they receive configuration BPDUs from upstream devices. This complicates the STP calculation and slows down network convergence. RSTP allows non-root bridges to send configuration BPDUs at Hello intervals after the topology becomes stable, regardless of whether they have received configuration BPDUs from the root bridge.
BPDU timeout period
In STP, a device has to wait for one period of Max Age before determining a negotiation failure. In RSTP, a device determines that the negotiation between its port and the upstream device has failed if the port does not receive any configuration BPDUs sent from the upstream device for three consecutive Hello intervals.
Processing of inferior BPDUs
When an RSTP port receives an RST BPDU from the upstream designated bridge, the port compares the received RST BPDU with its own RST BPDU.
If its own RST BPDU is superior to the received one, the port discards the received RST BPDU and immediately responds to the upstream device with its own RST BPDU. After receiving the RST BPDU, the upstream device replaces its own RST BPDU with the received RST BPDU.
In this manner, RSTP processes inferior BPDUs more rapidly, independent of any timer.
Rapid convergence
Proposal/Agreement mechanism
In STP, a port that is selected as a designated port needs to wait at least one Forward Delay interval (Learning state) before it enters the Forwarding state. In RSTP, such a port enters the Discarding state, and then the Proposal/Agreement mechanism allows the port to immediately enter the Forwarding state. The Proposal/Agreement mechanism must be applied on P2P links in full-duplex mode.
For details, see Technical Details of RSTP.
Fast switchover of the root port
If a root port fails, the best alternate port immediately becomes the root port and enters the Forwarding state. This is because the network segment connected to this alternate port has a designated port connected to the root bridge.
When the port role changes, the network topology changes accordingly. For details, see Technical Details of RSTP.
Edge ports
In RSTP, a designated port on the network edge is called an edge port. An edge port directly connects to a terminal and does not connect to any other switches.
An edge port cannot receive or process configuration BPDUs and does not participate in RSTP calculation. This port can transition from Disable to Forwarding state without a delay. An edge port becomes a common STP port once it is connected to a switch and receives a configuration BPDU. The spanning tree needs to be recalculated, causing network flapping.
Protection functions
Table 9-13 describes protection functions provided by RSTP.
Table 9-13 Protection functionsProtection Function
Scenario
Implementation
BPDU protection
On a switch, ports directly connected to a user terminal such as a PC or file server are edge ports.
Usually, no RST BPDUs are sent to edge ports. If a switch receives bogus RST BPDUs on an edge port, the switch automatically sets the edge port to a non-edge port and performs STP calculation. This causes network flapping.
BPDU protection enables a switch to set the state of an edge port to error-down if the edge port receives an RST BPDU. In this case, the port remains the edge port, and the switch sends a notification to the NMS.
Root protection
The root bridge on a network may receive superior RST BPDUs due to incorrect configurations or malicious attacks. When this occurs, the root bridge is incorrectly changed. As a result, traffic may be switched from high-speed links to low-speed links, leading to network congestion.
If root protection is enabled on a designated port, the port role cannot be changed. When the designated port receives a superior RST BPDU, the port enters the Discarding state and does not forward packets. If the port does not receive any superior RST BPDUs within a period (generally two Forward Delay periods), the port automatically enters the Forwarding state.NOTE:Root protection takes effect only on designated ports.
Loop prevention
On an RSTP network, a switch can only maintain the states of the root port and blocked ports if it is continuously receiving RST BPDUs from the upstream switch.
If the ports cannot receive RST BPDUs from the upstream switch because of link congestion or unidirectional link failures, the switch re-selects a root port. Then, the previous root port becomes a designated port and the blocked ports change to the Forwarding state. As a result, loops may occur on the network.
When loop prevention is enabled, if the root port or alternate port does not receive RST BPDUs from the upstream switch for a long time, the switch sends a notification to the NMS. The root port enters the Discarding state, whereas the blocked port remains in Blocking state and does not forward packets, preventing loops on the network. The root port or alternate port restores the Forwarding state after receiving new RST BPDUs.NOTE:Loop prevention takes effect only on the root port and alternate ports.
TC BPDU attack defense
A switch deletes its MAC address entries and ARP entries after receiving TC BPDUs. An attacker can use this to their advantages by sending a large number of bogus TC BPDUs to the switch in a short time, causing the device to frequently delete MAC address entries and ARP entries. This increases the load on the switch and threatens network stability.
After enabling TC BPDU attack defense on a switch, you can set the number of times the device processes TC BPDUs within a given time. If this number is exceeded, the switch processes only the specified number of TC BPDUs. Excess TC BPDUs are processed in one go by the switch after the specified period expires. This function prevents the switch from frequently deleting its MAC address entries and ARP entries, reducing the load on the switch and guaranteeing network stability.