Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am trying to think of a mechanism to use repeaters to detect loops and then shutdown ports in order to break the loops. Is it possible for any solution to work 100%?

share|improve this question

closed as off-topic by Xavierjazz, Tog, Heptite, Raystafarian, Dave M Mar 25 '14 at 21:06

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question is not about computer hardware or software, within the scope defined in the help center." – Xavierjazz, Tog, Heptite, Raystafarian, Dave M
If this question can be reworded to fit the rules in the help center, please edit the question.

I'd say it's possible for it to work 110% - I recently tangled with an issue where a Cisco switch was a little too trigger-happy shutting down ports permanently... –  thkala Mar 24 '14 at 7:46
How are cycles (not loops) in the network (which is an undirected graph) a problem? It is GOOD that there is more than one path from A to B, even if it is not parallel to an existing connection. TCP guarantees that if a packet sent 2nd comes a faster route (and thus first) that it will be re-ordered before the application is given the data, UDP is fire-and-forget, it could get there in any order at any time (ish) if it gets there at all, it could come any route. –  Alec Teal Mar 24 '14 at 11:32
@AlecTeal, at the IP layer, it's good to have multiple paths for routers to choose between. But at the Ethernet layer, which doesn't have routing the way IP does, cycles in the network cause broadcast frames to be repeated in a loop forever. –  Wyzard Mar 24 '14 at 11:58
@Wyzard: The question starts out with "in theory...". Assuming a particular limited technology is irrelevant. In theory we can have Ethernet with STP. –  MSalters Mar 24 '14 at 13:20
I agree with MSalters we already have STP that makes this basically irrelevant on intelligent switches. –  mikebabcock Mar 24 '14 at 15:05

2 Answers 2

up vote 30 down vote accepted

There's a standard protocol for that, called the Spanning Tree Protocol.

As the name suggests, it works by building a spanning tree of the network — a subset of the network that includes all nodes but contains no loops — and then disabling any ports that aren't part of the spanning tree. If a link in the spanning tree fails, e.g. if someone unplugs a cable, the protocol can automatically update the spanning tree and activate another path (that was previously disabled because it would've formed a loop).

share|improve this answer

Smart switches that implement the Spanning Tree Protocol (STP) will attempt to break loops by selectively shutting down ports if they detect their own BPDU packets getting back to them. In addition, their security protocols may shutdown ports where any BPDU was detected, if said port was designated to be single-terminal only.

That said, pure repeaters and hubs are not generally aware of the concept of a network packet, let alone of a network loop. They operate at the physical layer (L1), often doing little more than amplifying the signal and trying to keep the port clocks synchronized. And most (all?) unmanaged switches are not really any better when it comes to network loops.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.