I have mentioned in the previous article that if an enterprise only uses one vswitch for networking, there will be a single point of failure. If the switch is broken, then several modules cannot work normally at this time, A client cannot access the server, connect to the internet, or access the printer. In other words, if a fault occurs, the entire network cannot work normally. Therefore, in a general switched network, we all need to perform redundancy on the switch, but introducing redundancy will cause another problem. A very serious problem is the network loop. Then, the network loop will bring about factors such as broadcast storms, multi-repeat data frames, and unstable MAC address tables. We can see that the network loop problem is indeed not small. The solution is to use the Spanning Tree Protocol STP.
Spanning-Tree Protocol: STP for short. This Protocol can be applied to loop networks. path redundancy is achieved through certain algorithms, and the loop is trimmed into a non-loop Tree network, this prevents the message from being "inactive" in the Loop Network ".
The RSTP (Rapid Spanning Tree Procotol) Protocol implemented by the Ethernet Exchange is an optimized version of the Spanning Tree Protocol, its "fast" is reflected in the delay between the root port and the specified port entering the forwarding state, which is greatly shortened under certain conditions, thus reducing the time required for stable network topology.
MSTP (Multiple Spanning Tree Procotol) is the abbreviation of the Multi-Spanning Tree Protocol, which is compatible with STP and RSTP.
Let's introduce STP in detail: STP was created to overcome the problem of transparent bridging in redundant networks, the purpose is to negotiate a non-circular path to the root bridge to avoid and eliminate loops in the network. It identifies the loops in the network and dynamically blocks redundant links. In this way, it ensures that there is only one path to each destination, so there will never be a loop.
Set a sub-optimal interface in the loop in the Block state to break the loop. Note: This interface is only set to Block state, but is only a state, rather than actually closing this interface. Once other links in the network have problems, the blocked interface can be restored to the forwarding status. :
Basic Idea: Every switch is called a bridge here. So when we talk about the bridge, we will know that it refers to a switch. When each switch is started, it considers itself as a root bridge, so we will discuss who is the root of the competition and define a game rule, transmit a special message BPDU (Bridge Procotol Data Unit) between bridges. The Bridge protocol Data Unit contains enough information to do the following: select a root Bridge from all the bridges in the network, then calculate the shortest path from the local bridge to the root bridge. In addition, the root bridge sends BPDU every 2 seconds. BPDU data frame contains a lot of content ,:
Here we only care about the bridge ID (including the priority of two bytes and the MAC address of six bytes ).
The root Bridge method is to compare the Bridge ID of each vswitch, that is, the Bridge ID. The format of this Bridge ID is:
There are two components: one is the bridge priority, and the other is the MAC address, but the Cisco switch priority is 32768 by default. If the priority is the same and the MAC address is compared later, the MAC address is definitely different, so the small one is the root bridge,
In a network, only one root bridge can exist. Other bridges are called non-root bridges. Each port on the root bridge is called an assigned port, it can also be said that each port on the root bridge is the root port, but the port name on the non-root bridge is different. A non-root bridge has a port called the root port, and other ports are called non-assigned ports.
As we said just now, if there are multiple switches and the root bridge uses bridgeID, how can I know which is the root port and which is the non-assigned port on the non-root bridge, there is also a rule that compares the cost, priority, MAC address, and port number of each port to the root bridge in sequence (from left to right, it is relatively soft ), it can be divided into multiple ports of a vswitch and multiple ports of a vswitch if selected.