ManageEngine recognized in the 2024 Gartner® Magic Quadrant™ for Digital Experience Monitoring. Get the full report

Switching loops

Networks are built using multiple, interconnecting switches that connect devices and transfer data. However, if two switches aren't connected properly, something called a switching loop is created. To prevent this from happening, it's important to know why and how they occur.

In a typical local area network (LAN), it's common for multiple switches to be interconnected for redundancy, meaning more than one path is possible between two switches. Redundancy is a safety measure that ensures the network won't fail completely if a link breaks. However, with interconnected switches comes a potential problem: a Layer 2 switching loops.

A switching loop, or bridge loop, occurs when more than one path exists between the source and destination devices. As broadcast packets are sent by switches through every port, the switch repeatedly sends broadcast messages, flooding the network and creating a broadcast storm.

When switching loops start, they don't stop; there's no time-to-live (TTL) value on the broadcast packets, meaning they'll keep bouncing around forever between two switches. And herein lies the real problem—as the loop continues, so does the build up blocking traffic between switches.

Effect of switching loops on network performance

Switches determine where a packet goes based on the destination MAC address; every device has a unique MAC address, so every packet is directed to a single place. When multiple MAC addresses broadcast to all devices in the network, it can become problematic. This is especially true for switch loops, where all broadcasts and multicasts repeat around the looped network path in rapid succession, very quickly bringing down the network.

If a broadcast packet is sent out over a network with a loop, it will continue to rebroadcast the message as it loops around the network. As more traffic packets pass through the network, they're added to the loop; soon, the network is unable to communicate at all because it's spending all of its time sending data packets through the loops.

Fortunately, there's a way to prevent this from happening using the Spanning Tree Protocol.

Preventing switching loops with the Spanning Tree Protocol

The Spanning Tree Protocol (STP) is a networking standard designed specifically to prevent loops in Layer 2 switching, and to select the fastest network path if there are redundant links in the network.

Here's how STP works:

  • First, all of the switches in the STP domain elect a root bridge, or root switch. The root bridge acts as a point of reference for every other switch in the network. The root bridge's ports remain in forwarding mode, and there can only be one root bridge in any network using STP.
  • On all of the other switches, the interface closest to the root switch is the one designated as the root port. The root port allows traffic to traverse that particular interface, while other ports on this switch that allow traffic are called designated ports.
  • If multiple ports are connected to the same switch or LAN segment, the switch selects the port with the shortest path and marks it as the designated port.
  • Once the root port and designated ports are selected, the switch blocks all remaining ports to remove any possible loop from the network.

STP operations

Thanks to STP's automated configuration mentioned above, network communication can occur without worrying about any loops causing disruptions. When a new switch is introduced to the network, the spanning tree algorithm and port states are recalculated to prevent a loop.

Switches communicate with Bridge Protocol Data Units (BPDU), which are frames that contain information about STP, every two seconds. If the remote switch doesn’t respond, it's assumed that the switch and its links are down, and the spanning tree algorithm is recalculated.

If a port on a switch has been configured to use the Spanning Tree Protocol, there are a certain set of states that this particular port might be in.

  • Blocking state: The blocking state occurs when a switch decides that if it allows traffic to go through a particular interface that a loop would occur in the network, leading STP to administratively block any traffic from going through that port.
  • Listening state: This state generally happens when the spanning tree is converging where the interface isn't passing traffic, but is listening to find out what other STP devices might be in the network.
  • Learning state: When a port begins hearing other devices in the network, it starts adding them to a spanning tree table, putting that particular port into a learning state.
  • Forwarding state: Once traffic is allowed through the port, it goes into a forwarding state, which allows traffic packets to communicate using STP.
  • Disabled state: This state occurs when an administrator completely disallows any traffic from passing through an interface by disabling the port.

Switch monitoring with OpManager

ManageEngine OpManager is comprehensive network monitoring software that offers monitoring for switch availability, health, and performance. OpManager's switch monitoring automatically discovers switches in a network and places them on a special switch map. All the switch ports are also discovered and intuitively placed on the map. Using OpManager's switch monitoring, operators can gain visibility into the status and availability of switch ports. OpManager actively monitors switch ports and quickly notifies operators whenever the port or switch goes down. IT admins can configure OpManager to monitor only critical ports, an industry best practice for switch monitoring, which prevents unnecessary alarms from being generated.

Switching Loops - ManageEngine OpManager

OpManager comes bundled with real-time switch monitoring tools like the Switch Port Mapper, which can quickly list devices connected to switch ports along with their MAC addresses and critical parameters, and a feature for on-demand STP port details. By enabling this option, admins can view valuable information about the spanning tree state of each port, such as which ports are blocking and which are forwarding.

Explore OpManager using our online demo, or download OpManager's free, 30-day trial here.

FAQs

What is a switching loop?

A switching loop occurs when more than one path exists between the source and destination devices. With switching loops, when broadcast packets are sent by switches through every port, the switch repeatedly sends broadcast messages, flooding the network and creating a broadcast storm.

What causes switching loops?

A switching loop forms when there is more than one layer 2 path(redundancy) between two endpoint devices.

How to prevent switching loops?

Switching loops can be prevented using Spanning Tree Protocol (STP). The purpose of Spanning Tree Protocol is to select the fastest network path if there are redundant links in the network.

 
 Pricing  Get Quote