Layer 2 Switching Loops in Network Explained

For backup purposes, administrators create redundant links. A redundant link is a backup link of the primary link. If the primary link fails, the redundant link prevents the network from going down. The Redundant or backup link is helpful only when the primary link fails. Until the primary link is functioning, the backup link should be disabled. If you enable both links at the same time, it creates a switching Loop.

Let us take an example.

Suppose you have two switches. If you connect these switches with a single link, that link will serve as the primary link. As long as the switches have only one link, there will be no Loop between the switches. However, connecting switches with a single link always has a chance of connectivity loss. If switches work in the core layer, it could bring the entire network down.

To avoid this situation, you can use backup links. However, using more than one link between two switches creates switching Loops. A switching Loop creates many performance-related issues. Among them, three are the main ones. These are broadcast storms, unstable cam tables, and network bandwidth.

switching loop issues

When a switch receives an incoming frame, it reads the frame's destination MAC address and looks it up in the CAM table. If the CAM table has an entry for the destination MAC address, it forwards the frame from the port mentioned in the entry.

building cam table

If the CAM table does not have an entry for the destination MAC address, it forwards the frame from all ports except the port on which it arrived. Forwarding a frame from all ports except the port on which it arrived is called frame flooding.

A switch floods a frame if the destination address field contains an unknown unicast, multicast, or broadcast address.

An unknown unicast address is one that is not present in the CAM table. A multicast address belongs to a group of devices. A broadcast address is used by all devices on the local network.

Multicast and broadcast are destination-only addresses. End devices never use these addresses in the frame's source address field. Since a frame never contains these addresses in the source address field and a switch uses the frame source field to learn MAC addresses, a switch never learns about these addresses. These addresses always remain unknown to the switch.

unknow address

A switch always floods frames that have an unknown unicast, multicast, or broadcast address in the destination address field.

frame flooding

Switching Loop example

The following image shows a switching Loop.

switching loop

PC1 generates a broadcast frame. The frame reaches S1 on switch Port one. The S1 switch reads the source and destination addresses of the frame.

It adds the Source address to the CAM table and uses the destination address to make a forwarding decision. Since it is a broadcast frame, and you know that a switch always forwards it from all ports, S1 forwards it from all active ports.

loop

S2 receives it on ports 4 and 6. Let us suppose, first, that it receives it on port 4. S2 reads the frame source and destination addresses. It adds the source address to the CAM table and forwards the frame from all ports except the one on which it arrived.

switch read address

Right now, S2 knows Mac 1 is available on port 4. Now, it receives the same frame on port 6. It reads the source and destination addresses of the frame. It uses the source address to update the CAM table.

switching loop

If the switch receives a frame on the same port from the same source, it only updates the timer. But if it receives the frame on a new port, it assumes the device has relocated and attaches the source address to the new port. After updating the cam table, it forwards the frame from all ports.

switching loop

S1 receives both frames back from S2 in reverse order. On port 4, it gets the frame forwarded by port 6. On port 4, it receives the frame forwarded by port 4.

When it receives the frame on port 6, it repeats the same process. It reads the source address to update the CAM table and the destination address to make the forwarding decision. It repeats the same process when it receives the frame on port 4. Similarly, S2 receives its forwarded frames back on ports 4 and 6 in reverse order. It takes the same learning and forwarding steps. It forwards the frames to S1, and S1 forwards them back to it.

Switches forward frames blazingly fast. They can forward millions of frames per second. It means this process can be repeated millions of times per second. It creates a broadcast storm.

fast forwarding

A broadcast storm consumes most of the network bandwidth. A few broadcast storms can bring down the entire network.

switching loop bring network down

Since the switch updates the cam table each time it receives a frame. It also makes the cam table unstable. Switches use the CAM table to make forwarding decisions. If the CAM table is unstable, the switch fails to make the correct forwarding decisions.

unstable cam table

All of this happens just because of a single broadcast frame. In real life, networks and devices generate many broadcast frames every second. Considering these facts, if a loop exists, the network will not work. However, Ethernet switches are smart enough to automatically detect and remove Loops. They use the Spanning Tree Protocol to prevent loops. The STP protocol creates a virtual topology of the entire network and disables ports that form loops. If the primary link goes down, it automatically enables the disabled port to maintain the connectivity.

Conclusion

Redundant links are essential for network reliability, but they must be managed carefully to avoid switching loops that can cause severe network disruptions, such as broadcast storms and unstable CAM tables. Proper implementation of protocols such as Spanning Tree Protocol (STP) ensures that backup links provide failover protection without compromising network stability. By understanding and addressing the risks associated with redundant connections, network administrators can maintain both resilience and performance in their infrastructures.

ComputerNetworkingNotes CCNA Study Guide Layer 2 Switching Loops in Network Explained

We do not accept any kind of Guest Post. Except Guest post submission, for any other query (such as adverting opportunity, product advertisement, feedback, suggestion, error reporting and technical issue) or simply just say to hello mail us ComputerNetworkingNotes@gmail.com