1

As I understand it, STP is used to prevent bridge (/switch) loops, which will typically occur in the case of redundant links on a switch.

But how can a loop occur and cause a broadcast storm?

If a switch floods and forwards on all ports BUT the one it got the frame on, how can a loop occur?

1

2 Answers 2

1

A connected to B connected to C connected back to A. You now have a loop.

A new frame arriving on an edge port on A will be sent to the links to B and C. They won't hand it back to A but they will hand it to each other. As the frame didn't come from the port leading to A, they both pass the frame on to A.

Switches don't keep a hash table of every frame they've seen. So A won't know the frame it passed to others has returned. Likewise, B and C won't know they're passing the same frame between them. Spanning-tree, however, does keep track of the BPDUs it sends so it can recognize it's own BPDUs. (even on the same port -- aka "self-looped")

If it's easier, picture a single switch with a patch cable connecting two of the ports -- port 1 and port 8. Every frame that leaves P1 arrives at P8. Because it came in on P8, it can (and will) go back out P1.

(( This all assumes the frame is either broadcast or a flooded unknown unicast. If the mac-address-table knows a specific edge port for the frame, it will only go to that port. ))

0

A loop may occur in a topology with multiple switch.

Basically with 2 switches, if you connect 2 cables between those switches (without ling aggregation), then you have a loop.

With 3 switches A,B and C, and a single cable between A-B, one between A-C and one between B-C you also have a loop.

Why would we set this? To have some kind of resilience.

In practice it also happen (often) with IP phones and unaware user. Since IP phone embed a small, 2 ports, switch, it happens that a user connect both ports to a network outlet, and without a proper network config, that can take your network down.

Now why would this cause a broadcast storm ?

Say you have 2 switches with 2 cables, connected on

Switch A port 1 - Switch B - port 7 Switch A port 2 - Switch B - port 8

  • When a broadcast is received by switch A on port 13, it will send it on both ports 1 and 2 (and all other ports except 13)

  • Switch B receive a broadcast on port 7, send it back on all other ports, so on port 8

  • Switch A receive it on port 2 and send it back on port 1

.. and so on.

Same in the other way, switch B also received the first occurrence on port 8 and send it back on port 2, etc, etc...

You now have 2 packets traveling in a loop in both direction ad infinitum, since ethernet doesn't have a TTL (time to live) concept like IP.

3
  • I already know that, that's what my question is about. If I have a switch A and a switch B, and two ports on each are used to connect to each other - if switch A sends out a broadcast on all ports, won't switch B get them on both ports and thus NOT use those two ports, thus avoiding the loop? I would think Switch B only performs one broadcast (the first) and thus only uses one port, marking that as the source, and the other consequently being left to complete the loop, but I don't Know, hence the question.
    – Daniel
    Apr 29, 2020 at 6:20
  • 1
    See my answer. switch B doesn't know it's received the same frame on both ports. A frame arriving on a port is an isolated, independent event.
    – Ricky
    Apr 29, 2020 at 6:31
  • 1
    @Daniel was editing to add this part while you were writing the comment ;)
    – JFL
    Apr 29, 2020 at 6:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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