STP algorithms and advanced features
Step 1: select the least bridge ID for the root bridge: bridge priority + MAC address composition Step 2: select the root port (on a non-root bridge) 1. select the minimum overhead from the port to the root bridge: Generally, the port rate is 2. select 3. step 3: select the specified port (all switches involved in the calculation. select the minimum overhead from the bridge to the root bridge.
2. Select the smallest sender bridge ID
3. Select the smallest sender port ID Step 4: block other ports to form a ring-free topology
Methods To accelerate STP convergence:
1. Adjust STP time parameters 2. use STP enhancement features of CISCO 3. Upgrade the protocol and use RSTP or MSTP to adjust STP time parameters: CISCO: switch (config) # spaning-treeVLAN # (hello-time | forward-delay | maxage )#
Huawei:
H3C:
STP enhancement of CISCO
The portfast feature is an STP feature used to accelerate the convergence of the port (access) on the port connecting to the terminal device on the switch. Theoretically, the STPS convergence time can be changed to 0, that is, directly from the disabled state to the forwarding state. The STP feature is not disabled after the portfast feature is enabled. If the port is connected to the STP switch, normal STP election convergence will still be executed. The status change of portfast port does not trigger the global configuration mode of TCNBPDU: spanning-treeportfastdefault interface mode: spanning-treeportfast Uplinkfast is a fast convergence feature that accelerates the switching time of the active/standby link on the access layer switch. Notes for uplinkfast: only deployed on the access layer switch. The access layer switch has only two uplink links. Only applicable to uplink failures of access layer switches. All VLANs on the vswitch are affected. The bridge priority and port overhead will increase, the grid priority will change to 49152, and the port overhead will increase by 3000. Global mode: spanning-treeuplinkfast Backbonefast is a feature that accelerates STP convergence of indirect link faults. It must be deployed on all switches in the STP network. rscsi: the root link query packet, cisco private. It is generated by the switch that receives the second advantage BPDU configuration. It is sent from the root port to the root bridge to check whether the link to the root or the root is stable. STP protection mechanism BPDUGuard is an STP protection feature to prevent loops in the switching network caused by portfast ports. The portfast port with BPDUguard configured enters the errdisable status when the BPDU is received. Bpduguard's global enabling and interface enabling correspond to portfast's global enabling and interface enabling. SW (config) # spanning-treeportfastbpduguarddefault (globally enabled) SW (config-if) # spanning-treebpduguardenable (interface enabled) When STPBPDUguard disables the port, the port will always be in the errdisable state. You can use either of the following methods to restore the port to normal: manually re-activate the port through shutdown/noshutdown; automatically restore the port by setting the time period; Switch (config) # errdisablerecoverycausebpduguard Switch (config) # errdisablerecoveryinterval400 BPDUFilter is similar to BPDUGuard and is also defined on the portfast port. However, it performs a lighter action than BPDPGuard. The port using this mechanism does not send BPDU configuration. In addition, the new vswitch does not affect the original network and can communicate with other hosts in the network. SW (config) # spanning-treeportfastbpdufilterdefault (globally enabled) // The porstfast port does not send configuration BPDU. After receiving the BPDU, it is transferred to normal STP convergence SW (config-if) # spanning-treebpdufilterenable (interface enabled) ROOTGuard root protection ensures that the port with root protection enabled is a specified port, and root protection is configured based on each port, this port cannot be an STP root port. If a root-protected port receives a new BPDU better than the original BPDU, it sets this port to the root-inconsIistent status, which is equivalent to the listening status. In this status, data is not sent and received, and it is not the root port. It only listens to BPDU. When the optimal BPDU with an error is stopped, the port is automatically restored after the Spanning Tree process. In interface mode: spanning-treerootguard UDLD unidirectional link detection function: checks whether a pair of optical fiber link transmission and receiving are faulty. If one-way link failure occurs, it is easy to cause UDLD in the loop. Working principle: the UDLD layer-2 frame (UDLDhello packet) is periodically sent, and the peer has a UDLD response, indicating that the link is normal. If the three UDLDhello cycles do not receive a response from the peer UDLD, the link is considered to have a one-way fault. Enable the global or optical fiber interface separately: udld {aggressive | Enable | disable} Aggressive Mode: The enable mode is unavailable when the port enters the errdisable state: the port enters the undetermined status and generates syslogs. The port is still enabled by default with LOOPDetection. The system automatically detects and determines whether a loop exists downstream of the device. If a loop exists, the interface is unavailable.
Enhanced STP features of Huawei switches:
H3C switch STP enhancement features:
Reference