In this user interface, you can configure the spanning tree.
The STP and RSTP are used in the loop network. The two protocols realize routing redundancy by adopting certain algorithms and break the loop network into a loop-free tree network, preventing packets from increasing and cycling in an endless manner in the loop network. In this manner, the application of the two protocols can prevent the occurrence of the broadcast storm and MAC address table flapping.
In a Layer 2 switching network, loops often exist in the topology. This may result in broadcast storm and MAC address table flapping. The problems are described as follows:
Broadcast packets are copied and forwarded repeatedly on the loops, until the bandwidth of the entire network is exhausted. In this case, normal services and communication equipment are affected to a great extent. The unicast packets are broadcast before the equipment learns their destination MAC addresses, which also causes the broadcast storm.
In the case of a broadcast storm, a great number of packets with the same source MAC address are broadcast to the loops and reach different ports on the opposite equipment. This source MAC address is repeatedly learned and replaced on these ports. This process is called the MAC address table flapping. More loads are placed on the equipment because the equipment resources are used for the unnecessary address learning.
The difference between the STP and RSTP is as follows:
The RSTP is used to avoid loops in the user network and thus to prevent broadcast storm, or is used to back up links so that the spanning tree topology can be recalculated and the backup link can be used to restore the network connectivity when the working link is faulty.
When BPDUs are transmitted between bridges, the STP determines the topology structure of the network. The BPDU contains adequate information that is required to implement the calculation of the spanning tree.
The BPDU is classified into the following categories:
The CBPDU refers to a packet that is used to calculate the spanning tree and maintain the spanning tree topology. The CBPDU contains the root bridge ID, root path cost, designated bridge ID, designated port ID, and related timing information.
The TCN BPDU refers to a packet that is used to notify the relevant equipment of the network topology change.
A bridge refers to a functional unit that realizes the interconnection of two or more LANs.
A bridge ID is used to identify a bridge. The bridge ID is 64-bit long. The most significant 16 bits indicate the priority of the bridge, and the least significant 48 bits indicate the MAC address of the bridge. In the STP, the bridge ID also indicates the priority of the bridge. The smaller the value of the bridge ID, the higher is the priority.
A port ID is used to identify a certain port on a bridge. The port ID is 16-bit long. The most significant eight bits indicate the priority of the port, and the least significant eight bits indicate the port number. In the STP, the port ID also indicates the priority of the port. The smaller the value of the port ID, the higher is the priority.
Only one root bridge exists in a network where the STP is enabled. The root bridge is selected based on the running of the STP. The bridge with the smallest bridge ID is selected as the root bridge. When a network the STP enabled is stabilized, the root bridge transmits the CBPDU periodically. The other bridges only transparently transmit the CBPDU. This can ensure a stable network topology. If the network topology is changed, the root bridge may also change.
The root port refers to a port on the bridge that transmits frames to or receives frames from the root bridge. Each non-root bridge has only one root port. The root port is selected based on the running of the STP. The port on a bridge whose root path cost value is the smallest is selected as the root port. If several ports have the smallest root path cost, the port that has the smallest port ID is selected as the root port.
The designated port refers to a port of a LAN that transmits frames to or receives frames from the root bridge. Each LAN has only one designated port. The designated port is selected based on the running of the STP. The port that is connected to the LAN and whose root path cost value is the smallest is selected as the designated port. If several ports have the smallest root path cost and if these ports are on different bridges, the port whose bridge ID is smallest is selected as the designated port. If several ports whose root path cost values are the smallest are on the same bridge, the port with a smallest port ID is selected as the designated port.
The designated bridge refers to the bridge where the designated port resides. One designated bridge exists in each LAN. The designated bridge is selected after the root port is determined because the designated port copies the information of the bridge.
The path cost indicates the status of the network that a certain port is connected to. The higher the rate of the port, the smaller is the path cost.
The root path cost refers to the cost of the path from a certain port to the root bridge. That is, the root path cost value is equal to the sum of the path cost values of all the ports that the path from this port to the root bridge traverses.
Figure 1 shows the port states when the STP is enabled.
A port in the blocking state receives and processes the BPDU but does not transmit the BPDU. When a port is in the blocking state, it does not learn the MAC address or forward the user packet.
It is a transitional state. A port in the listening state transmits, receives, and processes the BPDU. When a port is in the listening state, it neither learns the MAC address nor forwards the user packet.
It is a transitional state. A port in the learning state transmits, receives, and processes the BPDU. When a port is in the learning state, it learns the MAC address but does not forward the user packet.
A port in the forwarding state transmits, receives, and processes the BPDU. When a port is in the forwarding state, it learns the MAC address and forwards the user packet.
A port in the disabled state cannot forward frames or implement the spanning tree algorithm and STP.
According to the forwarding and learning modes of ports, the disabled, blocking, and learning states are classified as a discarding state in the RSTP. Hence, three port states exist in the RSTP, that is, learning, forwarding, and discarding.
Port timers are classified into the following categories:
The hold timer is used to measure the interval between two CBPDU transmissions. The timeout value is the Hold Time parameter of the bridge.
The message age timer is used to measure the age of the CBPDU packet recorded by a port. When the age of the CBPDU packet stored by the bridge exceeds the Message Age parameter, the bridge discards the packet. The Message Age parameter determines the initialization age when the CBPDU packet is stored in the bridge. When the root bridge generates the packet, the value of the Message Age parameter is equal to 0. Each time the packet is forwarded by a port, a fixed increment value is added to the value of the Message Age parameter.
The forward delay timer is used to measure the holding time in the listening state or in the learning state. When the listening state lasts for a period that is the same as the value of the Forward Delay parameter, the port state is changed to learning. When the learning state lasts for a period that is the same as the value of the Forward Delay parameter, the port state is changed to forwarding.
Bridge timers are classified into the following categories:
The hello timer is used to measure the interval between two times when a bridge transmits CBPDU packets. The expiry value is the Bridge Hello Time of the bridge.
The topology change notification timer indicates the duration for which the bridge periodically transmits the TCN. The timer is used to notify the designated bridge (in the LAN that is attached to the root port of the bridge) of any detected topology change. The timeout value is the Bridge Hello Time of the bridge.
On receiving the TCN, the root bridge transmits the TCN after the topology change is complete and the time period indicated by the topology change timer elapses. The timeout value is the Topology Change Time of the bridge.
The Max Age, Hello Time, and Forward Delay parameters that are used by different bridges are unified to the values of the three parameters that are used by the root bridge, with CBPDUs transmitted between these bridges.