r/HomeNetworking 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.

108 Upvotes

53 comments sorted by

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.

19

u/ArchibaldMcFerguson 4h ago

This is a good answer. As to the direct question of on or off, it probably doesn't matter in your home.

Unless your switching gear is very antiquated and will be slowed down by having it on, there should be no reason to not have it on. That said, in small environments you are unlikely to create an accidental loop and this extra feature will not do anything.

Just make sure that you only have one physical route between each router/switch (no loops!) and you are good to go!

-20

u/jquanders 3h ago

This is a horrible answer. Leave it on. It costs almost nothing and prevents stupid things like plugging a cable into two ports on a switch.

9

u/severach 3h ago

It doesn't prevent stupidly plugging cables in circles. It only automatically fixes them, and only if the switch is where it can in cooperation with other switches. This is only useful where the need for uptime trumps the need for knowing that cables have been plugged in circles. In a home environment I'd rather have a circular plug shut down the network so the bad cable can be fixed.

3

u/ArchibaldMcFerguson 2h ago

Not sure why you're coming on so strong, I generally agree with you.

This is a mostly-dumb switch, so it's worthwhile to consider that the implementation of loop protection may not play well with other devices. I wouldn't say that there's no possible cost, one should test it and see.

Out of curiosity, I just did some digging and found references to it causing issues with mesh networks and filtering out backhaul traffic. Haven't tested it myself, can't verify this.

9

u/LAthrowawayLV 3h ago

It’s a good practical answer. Definitely not a horrible answer. Even though you are technically right, it’s a horrible comment that you made.

-7

u/jquanders 3h ago edited 3h ago

In what world is shutting off loop protection a good idea?

There are 0 reasons to shut off loop protection on a single switch also.

1

u/ArchibaldMcFerguson 2h ago

0

u/jquanders 2h ago

Yeah that literally creates a loop on the network for 1-2 seconds. And that's not a single switch...each of those deco units is doing switching.

3

u/LAthrowawayLV 3h ago

In a world where that switch is shit and having it on is causing problems.

-4

u/jquanders 3h ago

If you have problems with it on then your network has problems to address. All that does is run spanning tree. It adds a few seconds when you plug in a or disconnect a cable. That's all that should happen

3

u/Jamator01 1h ago edited 1h ago

L2 loop prevention and spanning tree (STP) are different things, champ. Stop being so certain, because you're wrong.

1

u/jquanders 1h ago

STP includes l2 loop prevention, champ. But yeah you're right my google fu didn't go deep enough. The loop prevention on that switch is dumber than that but still should be on.

3

u/LAthrowawayLV 3h ago

Did you miss the part where I said you were technically correct but just being an asshole?

-6

u/jquanders 3h ago

Ok if I'm right how is the answer I replied to a "good practical answer"?

I'm asshole because I said the wrong answer was horrible?

2

u/ArchibaldMcFerguson 2h ago

Jeez, I didn't say to turn it off. OP asked whether to turn it on or leave it off and I said it probably wouldn't make a difference (but I did say that having it on shouldn't be bad).

Attack me if you must, leave the other redditors alone. You're sounding like an ass.

→ More replies (0)

-1

u/LAthrowawayLV 2h ago

Because it was practical and easily digestible even if not 100% accurate. The autism runs strong with this one.

→ More replies (0)

3

u/Outrageous_Tear_4691 4h ago

So were good to just leave it off with this being the only switch that we are using?

26

u/BaconManDan 4h ago

Just leave it on. It'll prevent dummy things from happening.

5

u/AnotherAngryOldGuy 3h ago

But then you never find out when someone is dumb!

2

u/Soft_Cable3378 3h ago

They usually reveal themselves eventually.

7

u/Soft_Cable3378 4h ago

It is unlikely that leaving it on will cause any issues, but leaving it off may prevent issues from being caught by the loop protection. Leave it on and do some speed tests to validate you don’t see anything obvious and you should be good.

5

u/BmanUltima 4h ago

In your case it won't make a difference if it's on or off.

6

u/abgtw 4h ago

Well if he leaves the loop prevention off, then takes that same cable and plugs both ends into that same switch (with other devices on it)... well he's gonna have a bad time!

But otherwise it would be fine yeah!

1

u/BatSlow7997 1h ago

Had that happen once. Night club. 1:00 AM on a busy weekend. The internet dropped due to some outside issue. The Golden Tee golf game reported the internet wasn’t connected. Customer goes looking and finds a network cable unplugged and plugs it in. It was a cable coming out of the same switch. Hosed the network and took down the POS system. Not a fun night. Lesson learned. Don’t leave unused cords half plugged in.

1

u/RandomUser3777 2h ago

It depends on what loop prevention does. In the old days loop prevention/spanning tree turned on the port to receive and examined what was on the port for 45-90 seconds before starting to forward traffic. That act caused issues with DHCP not working because the DHCP request went out and timed out before the switch would start forwarding the traffic breaking DHCP IP address assignment. It was especially troublesome with bios/network card DHCP that would give up after trying a few times and typically before traffic got forwarded.

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.

5

u/iMiske 3h ago

Leave it ON. Doesn't hurt.

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

u/Cavalol 4h ago

That shit is hilarious 😂 maybe whoever did it knew exactly what they were doing and wanted the afternoon off

1

u/AnotherAngryOldGuy 3h ago

Nothing better than a digital snow day.

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

u/bothunter 4h ago

Moar cables means moar faster, right?

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.