Spanning Tree [02] detailed explanation of RSTP principles and configuration instances

Source: Internet
Author: User

Spanning Tree [02] detailed explanation of RSTP principles and configuration instances
Why do we need to use RSTP and RSTP? in the previous article, we learned the operation principle of STP. When the topology in the STP network changes, the switch port changes from the blocking status to the forwarding status, the waiting time is 30-50 seconds. The shortest is the Forward delay time of 2. The longest is the Max-age time plus the Forward delay time of two times, this time is unacceptable for high-speed and developed networks. How can we improve the disadvantages of this long time in STP? RSTP (fast Spanning Tree Protocol) RSTP introduction RSTP is also called the fast Spanning Tree Protocol. It is, which improves STP and shortens network convergence time, the convergence time of RSTP can be shortened by less than 1 s. The RSTP algorithm is basically the same as the STP algorithm. The RSTP port role adds two ports to the root port and the specified port: 1. alternative port: Used as the backup port of the root port. This port provides an alternative path from the current root port to the root bridge. backup port: serves as the backup port of the specified port. This port provides a backup path for the specified port to reach the generated leaf. This port can only exist when two ports are connected on a loop consisting of a point-to-point link, or when the switch has two or more connections to the shared lan cidr block. A port with a root port or a specified role is included in the active topology, and a port with an alternate or backup role is not in the active topology. From the comparison of the port statuses in the RSTP and STP ports, we can see that there are only three port statuses in RSTP: discard, learn, and forward. It replaces blocking, listening, and disabling in STPS with a State (discarded. In this way, the port can directly go through the listening status to enter the forwarding status, instead of waiting for time in the listening status. The principle of RSTP fast transition mechanism and the difference between RSTP and STP compared with STP, the only difference is that RSTP solves the problem that the STP algorithm must go through two times of Forward delay for any port as long as it is migrated from the blocked status to the forwarding status (including the waiting time for listening to learning and from learning to forwarding ). wait time) time disadvantage. Compared with STP, RSTP has the following improvements, which are also the principle of fast convergence of RSTP. The reason why RSTP is faster than STP is mainly reflected in the following three aspects: 1. in STP for sending BPDU packets: the root switch sends BPDU packets from the specified port, and the non-root switch accepts BPDU packets from the root port. If the non-root switch does not receive the BPDU packet from the root port, it does not send the BPDU packet by itself, so when a switch in the network does not receive the BPDU packet, it cannot determine whether the link with the upstream switch is faulty. In RSTP: the root switch sends BPDU at every HelloTime. For non-root switches, even if they do not receive the BPDU packet, they will specify the Time at every Hello Time (2 s by default) sends a BPDU packet containing its own information. For downstream switches, if the specified port does not receive the BPDU sent from the root switch within three consecutive Hello Time periods, the switch considers the link to the upstream switch to be faulty and processes the fault. In STP, the aging time of BPDU needs to be waited for 20 s. Therefore, the time required for RSTP to discover link faults is shorter. 2. edge port and link type edge port: edge port is the bridge port directly connected to the terminal site, if a port is configured as an edge port by using the spanning-tree portfast interface configuration command on an RSTP switch, the edge port is immediately changed to the forwarding status. That is to say, the port (edge port) that is directly connected to the host directly skips the listening and learning status and enters the forwarding status. So you don't have to wait for the time of listening and learning. In this way, quick convergence is achieved. Link Type: In RSTP, links are classified into point-to-point links and shared links. Point-to-point link: the port works in full duplex mode and is generally considered as a point-to-point link, you can use the spanning-tree link-type interface configuration command to set the default duplex. If a port is connected to another port through a point-to-point link and the local port is a specified port, the port uses the "suggested-agree handshaking" mechanism to negotiate with other ports, and the specified port on the RSTP switch can quickly transition to the forwarding status. You do not need to wait for a trigger delay of two times. As shown in: in Figure 1, SA is connected to SB through a point-to-point link, and the port is blocked. Assume that SA has a higher priority than SB, so SA becomes the root bridge. SA sends a suggestion message (a bpdu configured with the suggested flag) to SB through the specified port, we recommend that you use it as the specified switch. After receiving the suggestion message, the SB selects the port of the suggestion message as its new root port (2) and forces all non-edge ports to be blocked, and send an consent message through the New Root port. After receiving the consent message from SB, SA immediately changes the two ports connected to the forwarding status. This is because SB blocks all non-edge ports above it and is a point-to-point link between SA and SB. In this way, no loops are formed in the network. Shared link: In half duplex mode, the port is considered to be a shared link. If a shared link is used, the method in STPS can only be used to transition the port to the forwarding state, and listen and learn for the delay. 3. if the root port and the specified port are invalid, the replacement port and backup port will directly go to the forwarding status. Conclusion: RSTP achieves fast convergence, no matter where it is, most of them all follow the same principle: to make the port status transition from blocking to forwarding, without having to experience listening and learning, you don't have to wait twice. This is the difference with STP. The RSTP topology change mechanism is in STP: In the STP explanation, we have already said that when the network topology changes, the switch sends a tcn bpdu to the root bridge, then, the root bridge sends TC messages. The non-root switch that receives the tc bpdu packet shortens the aging time of the MAC address table to better learn about the new MAC address in RSTP: the packet only contains the tc bpdu packet, when the network topology changes, the switch sends tc bpud to all ports except the edge ports (edge ports do not participate in the RSTP operation, at the same time, clear the MAC addresses learned from all ports except the edge ports on the vswitch, and then send the tc bpdu to other vswitches. In this way, RSTP can quickly spread topology change notifications to the entire network, thus achieving rapid convergence. RSTP compatibility the RSTP protocol can be fully compatible with the STP protocol. The RSTP protocol determines whether the connected bridge supports the STP protocol or the RSTP protocol based on the received BPDU version number, if it is connected to the STP bridge, the operation is performed according to the STP protocol. Step 1 Switch> en Switch # configure terminal Switch (config) # hostname SwitchA (config) # vlan 10 SwitchA (config-vlan) # name slaes SwitchA (config-vlan) # exit SwitchA (config) # interface fastEthernet 0/3 SwitchA (config-if) # switchport access vlan 10 SwitchA (config-if) # exit SwitchA (config) # interface range fastEthernet 0/1-2 SwitchA (config-if-range) # switchport mode trunk SwitchA (confi G-if-range) # ^ Z Step 2 Switch> en Switch basic configuration of Switch B # configure terminal Switch (config) # hostname SwitchB (config) # vlan 10 SwitchB (config-vlan) # name slaes SwitchB (config-vlan) # exit SwitchB (config) # interface fastEthernet 0/3 SwitchB (config-if) # switchport access vlan 10 SwitchB (config-if) # exit SwitchB (config) # interface range fastEthernet 0/1-2 SwitchB (config-if-range) # switchport mode trunk SwitchB (con Fig-if-range) # ^ Z step 3 configure the SwitchA protocol # configure terminal! Enter global configuration mode SwitchA (config) # spanning-tree! Enable the spanning tree Protocol SwitchA (config) # spanning-tree mode rstp! Specify the Spanning Tree Protocol type as RSTP SwitchB # configure terminal! Enter the global configuration mode SwitchB (config) # spanning-tree! Enable the spanning tree Protocol SwitchB (config) # spanning-tree mode rstp! Specify the spanning tree Protocol type as RSTP verification test: Verify that SwitchA # show spanning-tree has been enabled for the quick spanning tree Protocol! View the Spanning Tree Configuration letter StpVersion: RSTP! Build Tree Protocol version SysStpStatus: Enabled! The running status of the Spanning Tree Protocol. disable is disabled. BaseNumPorts: 24 MaxAge: 20 HelloTime: 2 ForwardDelay: 15 BridgeMaxAge: 20 BridgeHelloTime: 2 bytes: 15 MaxHops: 20 TxHoldCount: 3 PathCostMethod: long BPDUGuard: Disabled BPDUFilter: Disabled BridgeAddr: 00d0. f8bc. 9835 Priority: 32768! View vswitch priority TimeSinceTopologyChange: 0d: 0 h: 1 m: 53 s TopologyChanges: 0 DesignatedRoot: 800000D0F8BC9835 RootCost: 0! The overhead of the switch to reach the root switch. 0 indicates that the switch is the root RootPort: 0! View the root port on the switch. 0 indicates that the switch is the root SwitchB # show spanning-tree! View the configuration information of Switch B Spanning Tree StpVersion: RSTP! Build Tree Protocol version SysStpStatus: Enabled! The running status of the Spanning Tree Protocol. disable is disabled. BaseNumPorts: 24 MaxAge: 20 HelloTime: 2 ForwardDelay: 15 BridgeMaxAge: 20 BridgeHelloTime: 2 bytes: 15 MaxHops: 20 TxHoldCount: 3 PathCostMethod: long BPDUGuard: Disabled BPDUFilter: Disabled BridgeAddr: 00d0. f8bf. fbbb Priority: 32768! View vswitch priority TimeSinceTopologyChange: 0d: 0 h: 2 m: 34 s TopologyChanges: 0 DesignatedRoot: 800000D0F8BC9835 RootCost: 200000! Overhead RootPort for the switch to reach the root switch: Fa0/1! View the root port on the vswitch. Note: by viewing the Spanning Tree information of the two vswitches, SwitchA is the root switch and SwitchB Fa0/1 is the root port.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.