STP Definition
1. STP Spanning Tree Protocol) is a layer-2 link management protocol. Its main function is to provide redundant paths in Layer 2 links to ensure reliable and stable network operation on the basis of ensuring that there is no loop in the network.
2. The loop will cause infinite data loops in the loop, and the terminal site will receive duplicate information,VswitchObtain the MAC address of the same terminal site on multiple ports, resulting in a broadcast storm, affecting the normal operation of the entire network.
3. 802.1d is the earliest STP standard. It provides a dynamic redundancy switching mechanism and is currently the most popular and widely used STP standard. STP runs on vswitches andBridgeOn the device, a stable tree structure network is established through computing to avoid loop generation in the network.
Basic working principle of STP
1. STP transmits the data unit BPDU of the Bridge Protocol between switches and uses the Spanning Tree Algorithm STA to compare and calculate the data unit BPDU.
2. Based on the parameters provided by BPDU and Spanning Tree computing, STP selects a root bridge, which is the core of the entire spanning tree topology. All data is actually transmitted through the root bridge.
3. Then, determine the working status of the redundant link port of the switch, so that some ports enter the blocking working mode, and some other ports enter the forwarding working mode. The blocked port is still an active port, but it can only receive and read BPDU and cannot receive and forward data streams.
4. change the working status of the redundant port to block part of the redundant path in the network and make it a backup link to ensure that there is only one active path between any two terminal sites, this avoids loop generation.
5. STP also calculates the optimal paths of all switches from the root to the L2 network, and establishes a tree-like network without loops.
During network operation, if a network segment fails due to a fault in the production tree and redundant paths exist, the generation tree recalculates the generation tree topology, and force the faulty link to the backup link, and reactivate the original backup link. Reset the forwarding port and blocked port)
STP: What is the difference between a switch and a bridge?
In the STP processing process, the switch and the bridge are different. The switch must process the VLAN.
1. Specify a root switch and select a root bridge for each VLAN, because each virtual network is an independent broadcast domain. Finally, determine the working mode of the redundant port, select the backup link and the activation link, and generate a non-loop topology.
2. Root determination and tree structure generation mainly rely on the information provided by BPDU. There are two types of BPDU data packets. One is that the configuration BPDU containing the configuration information cannot exceed 35B), and the other is that the topology change notification BPDU containing the topology change information cannot exceed 4B ).
3. The BridgeID information in the BPDU package is the main basis for selecting the root bridge or the root switch. The minimum BridgeID value is the root bridge or root switch.
4. BPDU are regularly sent every 2 seconds. A new BPDU is also sent when the network transmission fails or the topology changes to maintain the tree structure.
5. If the priorities of the root bridge are the same, the root bridge is determined based on the MAC address value. The minimum MAC address value is the root bridge.