Most Layer 2 issues are related to some kind of loop within the domain and this has multiple problems associated with it, including network downtime. Often when you are working with switch configurations and you are plugging/unplugging a device, you should be careful that you don’t create a loop. To mitigate such problems, you should usually configure Spanning Tree Protocol on switches to avoid situations that might occur if you happen to accidently create a loop somewhere in the network. Details about Spanning Tree Protocol functionality can be found in Chapter 4.
Every switch in a network communicates using MAC addresses. As packets come in, the MAC address is analyzed and the switch determines where that packet goes based on the destination MAC address in the Layer 2 header. Every device in the network has its own MAC address so all the packets have a specific destination. Unfortunately, things like Broadcasts and Multicasts go to every port on the switch. If a Broadcast frame arrives at a switch port, it copies that Broadcast to every other device that might be connected to that switch. This process can often be a problem when there are loops in the network.
You should also keep in mind that the MAC address packets have no mechanism inside of them to time out. With TCP/IP, the IP protocol has a function called Time To Live (TTL) in its header, which refers to the number of hops through a router, not to a specific unit of time. If IP packets happen to be in a loop and go through multiple routers, they will eventually time out and be removed from the network. On the other hand, switches do not offer that kind of mechanism. Layer 2 frames can theoretically loop forever, as there is no mechanism to time them out. In other words, if a loop is created, it will be there until it is manually removed from the network.
If you are simply plugging in one workstation to the network and a Broadcast reaches it, it will terminate at that point and will not be a problem for the network. On the other hand, if you misconfigure a port configuration on the switch side, or you plug both ends into a switch without enabling STP, this might lead to a Broadcast storm within the Layer 2 domain. When this happens, Broadcast packets are forwarded to all other ports so the Broadcast packet keeps exiting and entering the switch on the same cable, causing a Layer 2 loop. This can lead to high resource usage and even network downtime.
If you enable STP on such a misconfigured network, the switch will recognize that a loop has occurred and it will block certain ports to avoid Broadcast storms. Every other port on the switch continues to operate normally so the network is not affected. If STP is not configured, the only options would be to unplug the network cable that is causing the problem or administratively disable it if you can still operate the switch at that moment.