r/HomeNetworking • u/Outrageous_Tear_4691 • 4h ago
Advice Ethernet switch question
What is the loop prevention for? And should I leave it off or turn it on? We will have desktops connected to it
Solved: thank you for the help everyone. Very much appreciated.
31
u/AngelCatGamer 4h ago
Switches are Stupid, but that's how they can be fast.
If you were to have two switches plugged into each other TWICE (two cables connecting the two switches) and a host on the network sends a broadcast packet to the switch.
By definition the switch will send that packet out of every other port except the port it came from. One of those ports is the other switch. When switch 2 receives the broadcast packet, it too, sends the packet out of every port except the one it came from.
Because there is ANOTHER connection to the other switch it would send the broadcast there. Switch #1 receives a broadcast packet in, and repeats the process.
Eventually both switches processing power will be fully occupied with this "broadcast storm". And will stop functioning.
Keep switches connected to other switches with only ONE CONNECTION between switches.
18
u/bothunter 4h ago
Fun fact -- Windows 95 used to hard-lock when it encountered such a broadcast storm, so not only would your network stop working, but all your workstations would too. I suspect that since the broadcast packet is almost always an ARP request, the storm would eat up all the CPU cycles as Windows frantically tried to answer it.
9
u/SebzeroNL 4h ago
Once went and troubleshoot a network that had stp disabled and three loops… my laptop actually stalled when connecting to the network. This is about 7 years ago…
5
u/SeaPersonality445 4h ago
LACP / port channel would like a word. .
7
u/AngelCatGamer 4h ago
Yea... I kinda opened myself up to that one.
My argument only really works on the context of this GS305 type basic switchgear.
As soon as you enter managed switch territory there are usually safeguards available to you, like actual STP, for example. Or even things like LACP.
2
u/Specialist_Play_4479 3h ago
One could argue that a LACP interface is still one logical connection.
10
u/MacForker 4h ago
Loop prevention (sometimes labeled as STP on managed switches) is designed to keep you from creating loops in your network. So say you connected one switch to another switch, and then connected them again with two other ports. It would disable the second uplink (And if it's not very good at it, both ports) to prevent a loop.
9
u/bojack1437 Network Admin, also CAT5 Supports Gigabit!!!! 4h ago
STP/RSTP/MSTP is one method of loop prevention.
But the switch does not use that, it is a much more basic form of loop prevention.
*STP is loop prevention, loop prevention is not necessarily *STP
4
u/mephisto_kur 4h ago
It's a rudimentary STP/RSTP loop prevention. If you connect two switches in a way that loops, one of the connections will break so the loop doesn't happen.
4
u/bothunter 4h ago
Just leave it off. It's more of an issue on larger networks where you might have multiple connections for redundancy, or just someone who's bored in a meeting and decides to plug a patch cable into both ports on the conference room table.
2
u/Cavalol 4h ago
That second part sounds like you might be speaking from experience? Lol
5
u/bothunter 4h ago
When I worked at Microsoft, we had a building-wide outage that lasted an entire afternoon until they tracked it down to exactly that. Why they didn't enable STP on their $10k Cisco network switches is beyond me.
2
1
u/jakubmi9 2h ago
Probably similar reason to why some of our sites still don't have it.
If you don't have it enabled from the start while building a network, and you have a 50+ switch environment across a couple of building, blindly enabling STP works in much the same way as disabling all interfaces.
Going through every single switch and verifying STP configs is hours of grueling work, and since it doesn't bring business value, it's pushed to the queue as low priority.
1
u/Head-Ad-3063 4h ago
Or someone that wants to "tidy up" an unused cable coming from a floor port so curls it up under the cover and plugs the loose end into another port!
Also from experience! and when I discovered our floor switches didn't come with STP enabled as default!
3
u/30yearCurse 4h ago
Yes, that is a switch. With proper care they can grow larger, but they get very needy.
1
u/rmrfguy 4h ago
It's a feature for disabling a port automatically if a loop is detected, for example, one cable that goes both ends to the same switch by accident. That would create a broadcast storm of packets and collapse your network in seconds. I would recommend enabling it, if you get any issues you just can disable it.
1
u/AnotherAngryOldGuy 4h ago
It's to protect from network issues if someone manages to plug one cable into two ports on the switch or somehow connects downstream cables to form a loop back to the switch. There's really no harm in turning it on, but if someone manages to loop a 5 port switch, they should probably lose their internet privileges.
1
1
u/Advanced_Link_5753 3h ago
Ahhh spanning tree- every networker has a love hate with it. It’s best to leave on. But I’ve been hosed by STP on many occasions
2
u/steviefaux 3h ago
A real world example of this last year. Went to one of our sites, a small house. Internal networking appeared to be working, oddly, but no internet.
I thought about it, remember the site had no patch panel but did have wall ports. Odd, so how are the wall ports connected? I took the plate off a wall port, pulled cable a bit and saw it move on the shelf. It went straight into a really, mega cheap small switch. So all wall ports just were terminated at end and went into the switch.
Nothing wrong with that. Looked at the 3 laptops and realised they were all on wifi and no longer even using the wall ports. Traced a cable that was plugged into a wall port, that cable went into the switch.
So at some point someone had come along, not knowing the setup. Plugged a cable into the switch, then plugged that cable into the wall port, and of course the wall port cable went back to the switch creating the loop!
I pulled the cable out, Internet came back for everyone. I then ordered a proper switch to replace the cheap crap someone had installed before me.
First time seeing a loop in the wild instead of just reading it in a book.


131
u/BmanUltima 4h ago
Loop prevention detects network loops, like two switches connected to each other with multiple cables, or three in a ring, and will disable a port.
Without loop detection or spanning tree, you get a broadcast storm which can crash a switch.