STP spanning tree protocol is used to prevent layer-2 loop protocols.
There are several terms in the Spanning Tree: root bridge root port specifies port root path overhead optional Port
Several statuses of ports in the build tree
Disable not participating in Spanning Tree election
Blocking 20 s-> listening 15 s-> learning 15 s-> forwarding
STP convergence takes 30-50 s. When listening, only the bpdu can be processed. When learning, the MAC address is learned and the data frame is forwarded. Stp keeps the port blocked to remove the loop.
If the port does not receive the BPDU within 20 s, it will be transferred to the blocking status.
The following describes the election process of the Spanning Tree:
First, you must select a unique root switch, which is determined by the smallest bridge ID. The bridge ID contains the same priority as the MAC address. Generally, the minimum MAC address is selected as the root switch.
Next, select the root port and select a root port on each non-root switch. Select the minimum port to reach the root bridge cost. If multiple paths reach the root bridge, select the path with the least cost of reaching the bridge. If the cost is the same, select the port with a small neighbor bridge ID. If the neighboring bridge IDs are the same, select the port with the lowest local priority.
Select a specified port on each CIDR block. Achieve the minimum cost of the root bridge port. If the two ports have the same path cost, select the port with a small local bridge ID. If the bridge ID is the same, select the port with a lower local port priority.
The rest is the blocked port. The following is an example for your reference.
Author "It communication"