Rapid Spanning Tree Protocol (RSTP) is an upgrade of Spanning Tree Protocol (STP) that was developed to avoid the slow convergence problems of STP.
The goal of RSTP is to provide a fast and efficient method for forwarding path selection in a Spanning Tree Protocol (STP) network to avoid loops and ensure that there is only one active path between any pair of devices in the network.
RSTP is based on the shortest path selection algorithm (Dijkstra) and uses a set of messages to detect and avoid loops in the network. Messages are sent between the devices in the network to determine the shortest path to the root bridge of the spanning tree. The root is the device that acts as the reference point in the network.
When a device starts up, it sends a configuration message to determine the network state and the path to the root. If the device discovers that it is not the root device, it chooses the shortest path to the root and begins sending BPDU (Bridge Protocol Data Unit) messages to notify other devices on the network of its existence and its path to the root.
If there is a change in the network topology, the devices send BPDU messages to notify the other devices in the network of the changes. When a device receives a BPDU message indicating that there is a shorter path to the root, it immediately changes its forwarding path to the new shorter path.
In addition, RSTP uses a wait timer to detect link failures in the network. If a device does not receive a BPDU message from a neighbor within the timeout, it considers the neighbor to have failed and recalculates the spanning tree to find a new path to the root.
In summary, RSTP is a significant improvement over STP by providing faster convergence time and better use of network resources, resulting in improved network efficiency and reliability.
Rapid Spanning Tree Protocol (RSTP) uses different types of ports to ensure fast network convergence and avoid traffic forwarding loops. The most common RSTP port types are described below:
- Root Port: is the port that has the shortest path to the root of the spanning tree. The root port is the port used to forward traffic in the root direction and is automatically activated on the device with the shortest path.
- Forwarding Port: is the port that is active and forwards traffic on the network. The forwarding port is used to send and receive packets between network devices. The forwarding port is the port that is active on the device that does not have the shortest path to the root.
- Alternate Port: is a backup port that is used in case the root port or the forwarding port fails. The alternate port is blocked to avoid traffic forwarding loops, but is automatically activated in case of failure of the root or forwarding port.
- Backup Port: is a backup port that is used in case the root port or forwarding port fails. The backup port is blocked to prevent traffic forwarding loops and does not forward traffic under normal conditions, but is automatically activated in case of root or forwarding port failure.
- Edge Port: A port that is located at the edge of the network and is connected to an end device, such as a computer or server. Edge ports do not send or receive BPDUs and are configured to prevent BPDU propagation on the network .
In general, RSTP port types are used to ensure fast network convergence and avoid traffic forwarding loops. Choosing the right port types for each device and network segment is critical to achieving a stable and reliable network.
For this example, the topology we will use is the following. Please note that the root node or Root Bridge will be the Ruijie Team:
Before closing the ring we will configure each device:
- Root Bridge SW0 Ruijie configuration: One of the most important aspects is that this equipment has a lower priority than the rest of the switch devices in the network so that it can be proclaimed as a Root Bridge.
Now it is necessary to configure the Switch ports, in this case for the ring we will only use ports 23 and 24. The rest of the RJ45 ports are going to be used by PCs or other terminal equipment that should not cause changes in the RSTP based ring. For this reason they will be configured as Port Fast or as Edge. BPDU Guard is also enabled on these same ports since no switch sending BPDUs will be connected to them. If a switch is connected, the port will be in an errdisable state.
- SW1 X-Security configuration:
The first step is to enable the RSTP protocol within the Network Settings section and click Save
We enable the protocol on ports 5 and 6 because in this topology we are completely sure that no other switches will be connected to other ports of SW1, only cameras and other devices that are not relevant to RSTP itself will be connected.
- SW2 X-Security configuration: Same configuration as in SW1
The first step is to enable the RSTP protocol in the Network Settings section and click Save
We enable the protocol on ports 5 and 6 since in this topology we are absolutely sure that no more switches will be connected to other ports of SW1, only cameras and other devices that are not relevant for the RSTP itself will be connected.
- SW3 X-Security configuration: Same configuration as in SW1
The first step is to enable the RSTP protocol in the Network Settings section and click Save
We enable the protocol on ports 5 and 6 since in this topology we are fully confident that no more switches will be connected to other ports of SW1, only cameras and other devices that are not relevant to the RSTP itself will be connected.
We check the status of the ports on all devices:
- SW0
- SW1
- SW2
- SW3
We will already have configured the ring based on the RSTP protocol.