The spanning Tree Protocol (STP) stops network loops that happen when switches in the network have too many links. With the help of Bridge Protocol Data Units (BPDUs), it finds the best way to connect non-root switches to root switches. BPDU sends information about changes in the network’s structure to all the switches so that they are aware of the change.
When it comes to the topology change mechanism in STP, there are two different kinds of BPDUs that are associated with it:
Configuration BPDU: is sent by the root switch, which includes a set TC (topology change) and TCA (topology change acknowledgment) bit in the flags field. This is done in order to inform all of the switches about the topology change.
Topology Change Notification (TCN) BPDUs: TCN BPDU is transmitted by a non-root switch whenever it detects a change in the topology of the network. This is done in order to inform the root switch about the topology change and to regulate the topology that is currently being utilized by the network.
Topology Change Reasons:
If the Spanning Tree Protocol is turned on, the following things can cause the network’s structure to change:
- Link failure
- Switch failure
- Port transitioning to the forwarding state
Mechanism of Topology Change:
If a switch detects a change in the link status on one of its interfaces, which could be the result of a link failure or another switch failure, then the switch will experience a topology change. After determining that there has been a change in the topology of the network, it prepares a Topology Change Notification BPDU that contains all of the information regarding the topology that is now being utilized and then transmits it to the root switch through the root port of the root switch. The BPDU will be received by an upstream switch that is connected with a switch that sent the TCN BPDU through its root port. The upstream switch will then respond to the sender with a Topology Change Acknowledgment (TCA) BPDU. Additionally, the upstream switch that was given the TCN BPDU is now responsible for generating its own TCN BPDU and sending it to the root switch through the root port of the upstream switch. till the root bridge receives TCN BPDU, this process will continue till it is completed.
To ensure that every switch in the network is alerted to any topology change, the root bridge will broadcast a configuration BPDU including the set topology change bit and the topology change acknowledgment bit as soon as it receives notification of a topology change.
TC bit within the setup the root switch sends a BPDU to the non-root switches, telling them to delete MAC address entries to speed up network convergence. The non-root switches then stop transmitting TCN BPDUs because the root switch is informed about the topology change, according to the TCA bit. By reducing the aging time to match the forward delay time, switches update the MAC address entries to prevent traffic from going to hosts that are no longer reachable by port. Devices that interact during this time period are kept in the MAC address table, while others are flushed out.