Rapid Spanning Tree Protocol

STP ensures a loop-free network but has a slow network topology convergence speed, leading to service deterioration. If the network topology changes frequently, the connections on the STP capable network are frequently torn down, causing regular service interruption.

RSTP employs a proposal and agreement process which allows for immediate negotiation of links to take place, effectively removing the time taken for convergence based timers to expire before spanning tree convergence can occur. The proposal and agreement process tends to follow a cascading effect from the point of the root bridge through the switching network, as each downstream switch begins to learn of the true root bridge and the path via which the root bridge can be reached.

Switches operating in RSTP mode implement two separate port roles for redundancy. The alternate port represents a redundant path to the root bridge in the event that the current path to the root bridge fails. The backup port role represents a backup for the path for the LAN segment in the direction leading away from the root bridge. It can be understood that a backup port represents a method for providing redundancy to the designated port role in a similar way that an alternate port provides a method of redundancy to the root port.

The backup port role is capable of existing where a switch has two or more connections to a shared media device such as that of a hub, or where a single point-to-point link is used to generate a physical loopback connection between ports on the same switch. In both instances however the principle of a backup port existing where two or more ports on a single switch connect to a single LAN segment still applies.

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 switching devices. An edge port does not receive configuration BPDU, so it does not participate in the RSTP calculation.

It can directly change from the Disabled state to the Forwarding state without any delay, just like an STP-incapable port. If an edge port receives bogus configuration BPDU from attackers, it is deprived of the edge port attributes and becomes a common STP port. The STP calculation is implemented again, causing network flapping.

RSTP introduces a change in port states that are simplified from five to three types. These port types are based on whether a port forwards user traffic and learns MAC addresses. If a port neither forwards user traffic nor learns MAC addresses, the port is in the Discarding state. The port is considered to be in a learning state where a port does not forward user traffic but learns MAC addresses. Finally where a port forwards user traffic and learns MAC addresses, the port is said to be in the Forwarding state.

The BPDU format employed in STP is also applied to RSTP with variance in some of the general parameters. In order to distinguish STP configuration BPDU from Rapid Spanning Tree BPDU, thus known as RST BPDU, the BPDU type is defined. STP defines a configuration BPDU type of 0 (0x00) and a Topology Change Notification BPDU (TCN BPDU) of 128 (0x80), RST BPDU are identified by the BPDU type value 2 (0x02). Within the flags field of the RST BPDU, additional parameter designations are assigned to the BPDU fields.

The flags field within STP implemented only the use of the Topology Change (TC) and Acknowledgement (TCA) parameters as part of the Topology Change process while other fields were reserved. The RST BPDU has adopted these fields to support new parameters. These include flags indicating the proposal and agreement process employed by RSTP for rapid convergence, the defining of the port role, and the port state.

In STP, after the topology becomes stable, the root bridge sends configuration BPDU at an interval set by the Hello timer. A non-root bridge does not send configuration BPDU until it receives configuration BPDU sent from the upstream device. This renders the STP calculation complicated and time-consuming. In RSTP, after the topology becomes stable, a non-root bridge sends configuration BPDU at Hello intervals, regardless of whether it has received the configuration BPDU sent from the root bridge; such operations are implemented on each device independently

The convergence of RSTP follows some of the basic principles of STP in determining initially that all switches upon initialization assert the role of root bridge, and as such assign each port interface with a designated port role. The port state however is set to a discarding state until such time as the peering switches are able to confirm the state of the link.

Each switch proclaiming to be the root bridge will negotiate the port states for a given LAN segment by generating an RST BPDU with the proposal bit set in the flags field. When a 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 peering device with its own RST BPDU that includes a set proposal bit.

Since timers do not play a role in much of the RSTP topology convergence process as found with STP, it is important that the potential for switching loops during port role negotiation be restricted. This is managed by the implementation of a synchronization process that determines that following the receipt of a superior BPDU containing the proposal bit, the receiving switch must set all downstream designated ports to discarding as part of the sync process.

Where the downstream port is an alternate port or an edge port however, the status of the port role remains unchanged. The example demonstrates the temporary transition of the designated port on the downstream LAN segment to a discarding state, and therefore blocking any frame forwarding during the upstream proposal and agreement process.

The confirmed transition of the downstream designated port to a discarding state allows for an RST BPDU to be sent in response to the proposal sent by the upstream switch. During this stage the port role of the interface has been determined to be the root port and therefore the agreement flag and port role of root are set in the flags field of the RST BPDU that is returned in response to the proposal.

During the final stage of the proposal and agreement process, the RST BPDU containing the agreement bit is received by the upstream switch, allowing the designated port to transition immediately from a discarding state to forwarding state. Following this, the downstream LAN segment(s) will begin to negotiate the port roles of the interfaces using the same proposal and agreement process.

In STP, a device has to wait a Max Age period before determining a negotiation failure. In RSTP, if a port does not receive configuration BPDUs sent from the upstream device for three consecutive Hello intervals, the communication between the local device and its peer fails, causing the proposal and agreement process to be initialized in order to discover the port roles for the LAN segment.

Topology changes affect RSTP similarly to the way STP is affected, however there are some minor differences between the two. In the example, a failure of the link has occurred on switch C. Switch A and switch C will detect the link failure immediately and flush the address entries for ports connected to that link. An RST BPDU will begin to negotiate the port states as part of the proposal and agreement process, following which a Topology Change notification will occur, together with the forwarding of the RST BPDU containing the agreement. 

This RST BPDU will have both the Agreement bit and also the TC bit set to 1, to inform upstream switches of the need to flush their MAC entries on all port interfaces except the port interface on which the RST BPDU containing the set TC bit was received.

The TC bit will be set in the periodically sent RST BPDU, and forwarded upstream for a period equivalent to Hello Time+1 second, during which all relevant interfaces will be flushed and shall proceed to re-populate MAC entries based on the new RSTP topology. The red (darker) ‘x’ in the example highlights which interfaces will be flushed as a result of the topology change.

The implementation of STP within an RSTP based switching topology is possible, however is not recommended since any limitation pertaining to STP becomes apparent within the communication range of the STP enabled switch. A port involved in the negotiation process for establishing its role within STP must wait for a period of up to 50 seconds before convergence can be completed, as such the benefits of RSTP are lost.

The configuration of the spanning tree mode of Sx7 switches requires that the stp mode command be used to set the mode to RSTP. In doing so the Sx7 series switch will generate RST BPDU in relation to RSTP, as opposed to other spanning tree implementations. This command is configured from the system-view and should be applied to all switches participating in the rapid spanning tree topology.

The display stp command will provide relative information regarding RSTP configuration as many of the parameters follow the principle STP architecture. The mode information will determine as to whether a switch is currently operating using RSTP.

An edge interface defines a port that does not participate in the spanning tree topology. These interfaces are used by end systems to connect to the switching network for the purpose of forwarding frames. Since such end systems do not require to negotiate port interface status, it is preferable that the port be transitioned directly to a forwarding state to allow frames to be forwarded over this interface immediately.

The stp edged-port enable command is used to switch a port to become an edge port, as all ports are considered non-edge ports on a switch by default. In order to disable the edge port the stp edged-port disable command is used. These commands apply only to a single port interface on a given switch. It is important to note that the edge port behavior is associated with RSTP as defined in the IEEE 802.1D-2004 standards documentation, however due to the VRP specific application of the underlying RSTP state machine to STP (which also results in the RSTP port states being present in STP), it is also possible to apply the RSTP edge port settings to STP within Huawei Sx7 series products.

In the event that multiple ports on a switch are to be configured as edge ports, the stp edged-port default command is applied which enforces that all port interfaces on a switch become edge ports. It is important to run the stp edged-port disable command on the ports that need to participate in STP calculation between devices, so as to avoid any possible loops that may be caused as a result of STP topology calculations.

The port that is directly connected to a user terminal such as a PC or a file server, is understood to be configured as an edge port to ensure fast transition of the port status. Usually, no BPDU are sent to edge ports, however if the switch is attacked by pseudo BPDU, the switch sets edge ports as non-edge ports. After these edge ports receive a BPDU the spanning tree topology is recalculated, and as a result network flapping occurs.

To defend against pseudo BPDU attacks, RSTP provides BPDU protection. After BPDU protection is enabled, the switch shuts down the edge port that receives BPDU and informs any active network management station (NMS). The edge ports that are shut down by the switch can be manually started only by the network administrator. The stp bpdu-protection command should be used to enable BPDU protection and is configured globally within the system-view. 

 
The switch maintains the status of the root port and blocked ports by continually receiving BPDU from the upstream switch. If the root switch cannot receive BPDU from the upstream switch due to link congestion or unidirectional link failure, the switch re-selects a root port. The previous root port then becomes a designated port and the blocked ports change to the forwarding state. As a result, loops may occur on the network.

The switch provides loop protection to prevent network loops. After the loop protection function is enabled, the root port is blocked if it cannot receive BPDU from the upstream switch. The blocked port remains in the blocked state and does not forward packets. This prevents loops on the network. If an interface is configured as an edge interface or root protection is enabled on the interface, loop protection cannot be enabled on the interface. The stp loop-protection command should be applied to enable this feature in the interface-view.

Validation of the RSTP configuration for a given interface is attained through the display stp interface <interface> command. The associated information will identify the port state of the interface as either Discarding, Learning or Forwarding. Relevant information for the port interface including the port priority, port cost, the port status as an edge port or supporting point-to-point etc, are defined. 

SUMMARY

The sync is a stage in the convergence process that involves the blocking of designated ports while RST BPDU are transmitted containing proposal and agreement messages to converge the switch segment. The process is designed to ensure that all interfaces are in agreement as to their port roles in order to ensure that no switching loops will occur once the designated port to any downstream switch is unblocked.