Network loops are a bit of a boogeyman. Loops are necessary for a well designed, resilient network – it’s the way to achieve redundancy with switches. Done right, loops protect your network from outages. Done wrong, a loop causes a major outage.
The Good
To achieve redundancy on a network you want to have hot duplicates of the thing you’re trying to protect from going offline. In the case of core or distribution switches you achieve this by installing a second switch. You then attach an additional cable to each of the immediate downstream distribution switches (or access switches if you have a collapsed core) that are attached to your previous solo core switch. You also want to make sure your redundant core is also connected to your upstream device (likely a router or firewall) and finally you want that your pair of core switches are directly connected to each other. Ideally you’d want two cables for connecting the two core switches together (using LACP) so that you have redundancy here too.
In this arrangement because there is a connection between every one of your distribution switches to each of the two core switches – either core could go offline and as long as the other is up, you still have a working path to every distribution switch.
The Bad
The problem with network loops is that they can cause broadcast storms. When a switch receives a frame with a destination it hasn’t seen before it sends that traffic out every port except the one it came in (in an effort to find what port the destination device is on). Any connected switch repeats the same. In a network loop without proper (and standard) protection this process will keep repeating exponentially and indefinitely – very quickly saturating the network completely, making communication nearly impossible.
The good news is that there is a lovely protocol for preventing this from happening – Spanning Tree Protocol (STP). Spanning Tree Protocol was made to break loops so that your network won’t go down. STP achieves this by electing a switch to be the root bridge. Each switch then designates a port with the lowest cost to reach the root bridge. The extra links between switches which are not designated ports are then disabled to kill the loop so a broadcast storm doesn’t happen. The cool thing is – these disabled ports still listen for STP messages in case the network topology changes. It will go through this whole process again if the topology changes.
With STP turned on and configured correctly you can use loops to achieve redundancy with your switches and protect your network.
The Ugly
Network loops become ugly when they’re unintentional and STP (or its variants) is misconfigured.
Fortunately, STP (or its variants) is a pretty standard feature for switches. Nearly every switch I’ve encountered has this feature and it’s enabled by default. So for the majority of switches they’ll disable loops out of the box. The only times I’ve encountered broadcast storms caused by network loops in the field are when STP was intentionally turned off (usually for poor reasons / misunderstanding) or STP was misconfigured. For a very large and complex network you’ll want to look into more advanced forms of STP like MSTP (useful for large numbers of VLANs).
If STP isn’t configured correctly it, an unintentional loop (not one in the design of the network but instead a random user plugging in a cable that causes a loop) can cause a broadcast storm, or a poor choice in designated ports could happen – causing large amounts of traffic to flow through an access switch. The key in configuring STP correctly is to make sure your core switches are prioritized for becoming the root bridge. You can achieve this by lowering the Bridge ID of your core switches (give the main one an even lower Bridge ID so it’s chosen first, then your secondary core).
With well configured STP you can protect your network from outages caused by network loops and enjoy redundancy of your switches to further protect your network from outages.
If you do experience an outage caused by a network loop, Auvik can help narrow down what happened. Auvik Network Management has a spanning tree change alert out of the box. If the network is performing very poorly or you are experiencing an outage and this alert fired right before the event then you’ll need to check your network for unintentional loops and verify your STP set up.
Auvik Network Management can also alert on excessive broadcast traffic, so you can investigate whether there is a potential broadcast storm.
Try Auvik Network Management
Free to try! Setup takes less than 15 minutes and you will see results in an hour.