Basic points of RSTP (Part 1)

Introduction background of RSTP

Although the STP protocol can solve the loop problem, due to the slow convergence of the network topology, the quality of user communication is affected, and if the topology structure in the network changes frequently, the network will also lose connectivity frequently, resulting in frequent interruption of user communication. This is also unbearable for users. Due to the deficiency of STP, the 802.1w standard issued by IEEE in 2001 defines RSTP. RSTP has made many improvements and optimizations on the basis of STP, which makes the protocol clearer and more standardized, and also realizes the rapid convergence of the Layer 2 network topology.

Problems with STP

  1. Long convergence time: STP has five states. It takes 30 seconds to forward from start to start. It takes only 10 seconds for Bolt to run 100 meters, and it only takes a few seconds to delete browsing records. It can be seen that 30 seconds is actually very, very long .
  2. Long fault recovery time: Suppose you have endured 30s now, and the switch wants to test your bottom line, and a BP or RP port suddenly fails. If it is good (directly connected to the fault, you can directly perceive it), it can be recovered in 30s, and if it is bad (non-directly connected Fault, 20s for BPDU to age) and 50s for recovery, have you decided to throw away the switch?
  3. Terminal access switch delay time: Now you are full of joy, the STP protocol of the switch can be forwarded, and then you connect your computer to the switch, because the stupid switch does not know that the port connected to your computer is an edge port, so you have to wait again 30s, and then confirm the port status before forwarding.
  4. Topology change: If the network topology of STP changes, TCN, TCA, and TC packets will all be sent. If the switch has a depth of 5 layers, how low is the efficiency.
  5. Port status: Disabled, Blocking, and Listening are not used, but they are still given three names, which only increases the difficulty of use. It is recommended to merge them here.

The improvement of RSTP over STP

Port role reclassification

In STP there are: RP, DP, BP (Block Port), but in RSTP there are the following roles: RP, DP, AP (Alternative Port), BP (Backup Port).
Next, explain the generation and function of AP: when receiving a better BPDU from the opposite end, it will become an AP. The AP is used as the backup interface of the RP. When the RP falls, the AP will stand on top.
In the simplest triangular topology, it looks like this:
insert image description here

After the BP receives the BPDU from itself, it will become a BP port, and the BP port is used as the backup of the DP port. As follows:
insert image description here

Port status reclassification

Based on the five states of STP, RSTP simplifies the states into three types, which are Discarding (corresponding to Discarding, Blocking, and Listening of STP), Learning (corresponding to Learning of STP), and Forwarding (corresponding to Forwarding of STP).

Fast convergence mechanism: PA mechanism

P (Proposal) suggests, A (Agreement) agrees, RSTP uses the flag bit, and there are P and A values ​​in the flag bit, when the corresponding bit becomes 1, it means that P or A is set. The working mechanism is like this. Between two interconnected switches, one of them first sends a P setting from the interconnection interface, and then the peer device blocks all ports except the interconnection interface, and then responds with the interconnection interface. A is set, and then the two will forward without any waiting. Wait until the negotiation is complete, release the previously blocked interface, and repeat the same process.
The principle of RST election is essentially the same as that of STP: electing the root switch - electing the root terminal on the non-root switch → electing the designated port - electing the standby port and the backup port. However, RSTP adds a confirmation mechanism of "initiate request-reply agreement" (P/A mechanism) during the election process. Since each step is confirmed, it does not need to rely on timers to ensure that the network topology is loop-free before forwarding. It is necessary to consider the time for sending BPDU packets and calculating the loop-free topology (generally at the second level).

Port Quick Switch

  1. Root port fast switching: The two ports of a switch are AP and RP. If the RP fails, the AP can switch the interface within seconds.
  2. Suboptimal BPDU processing mechanism: That is, non-direct connection failures. At this time, there will always be switches that receive suboptimal BPDUs. At this time, in order to speed up convergence, the two will directly select port roles through the PA mechanism.

Introduction of edge ports

In RSTP, if the edge port is set, it can directly enter the forwarding state. After receiving the BPDU, the edge port will lose the characteristics of the edge port, and then directly become a common STP port, and recalculate the spanning tree.

Guess you like

Origin blog.csdn.net/ssslq/article/details/129350385