1. Current Location: Home >  Router Encyclopedia >  How do switches work? My dad plugged an extra cable into the router, and that night the whole house was stuck in a PPT format

How do switches work? My dad plugged an extra cable into the router, and that night the whole house was stuck in a PPT format

Switch Working Principle and Network Loop: Schematic diagram of MAC address table forwarding, flooding, and broadcast storm

Last month, I was on a three-day business trip, and my dad came to help feed the cat. The next night at 10 o'clock, I opened my phone at the hotel to check the home surveillance , but the app spun around; Entering the Mi home, dozens of machines swept through the dust together; Even NAS remote runs are reduced to just a few dozen KB per second, making it hard to send a screenshot. No one at home had ever made any changes—until my dad nervously said over the phone: "I saw two empty ports on the router, thinking of plugging in an extra cable into that black box. If there are more devices, it can also split the stream." "

was that very wire that caused the entire house's network to crash for most of the night. This article explains exactly how a switch works, why plugging in an extra cable can paralyze the entire network, and how to locate such a fault in ten seconds—all in one go.

Switch's daily work: copying from a notebook

the 8-port gigabit switch in the weak current box. When I bought it first I thought it was just a network port expander. This time, after checking the fault, I finally understood its underlying logic. At its core, it relies on a table, called the MAC address table, which you can think of as a small ledger for the front end: which device (MAC address ) is on which slot, and you record it.

manuscripts are automatic, requiring no configuration. The desktop sends any packet from port 3. The switch checks the source address—oh, this MAC is on port 3. Note that. From now on, all data sent to this MAC will be sent directly through port 3, leaving no disturbance to other ports. That's why my NAS and desktop are both plugged into a switch, and copying files to each other can run at 110MB/s at a full gigabit—the traffic between the two devices is already consumed internally by the switch, never passing through the router.

meter lookup is done by hardware—nanosecond level. Household goods costing just a few dozen yuan are essentially no different from the big machines in the data center. The difference lies in other features, which will be discussed later.

What to do

packages it doesn't recognize: shout out to every mouth

here's the question: what if the target MAC isn't in the mini notebook? For example, a newly powered device hasn't sent a packet yet, and the switch doesn't even know where it's attached.

switches handle things very simply: they send one copy to every port except the import. This action is called flooding. It makes sense—if you don't know which room the recipient is in, then send one to each room, and one will definitely arrive.

there's another type of packet that is naturally flooded: broadcast frames, with destination addresses all F, explicitly requiring all network devices to view them. There are more of these bags at home than you might think: ARP shouting is broadcast (who is 192.168.31.10?) Give me your MAC), DHCP find the transmitter also broadcast (do you have a DHCP server in the yard? Give me an IP). The more devices there are, the more frequent ARP refreshes, and the denser the broadcasts. Normally, this isn't a big deal—one broadcast frame just goes out through the other seven ports, and devices discard what they shouldn't have after viewing, with costs so small they can be neglected.

Why

two wires is deadly: the broadcast went through a revolving door

Now you want to talk about what my dad's wire did. Originally, the connection was a single cable from the router's LAN 1 to the switch, forming a neat tree structure. My dad added a router: the router's LAN2 connection was also connected to the switch. The router's LAN ports are directly connected inside the machine (essentially a small switching chip), so these two wires form a circle at the circuit level—data goes out from port 1 of the switch, passes through the router, and returns from port 2.

this circle is usually quiet. But once a broadcast frame enters the circle, things go crazy: the switch receives it from port 1, floods it, and sends it out from port 2; The router bridges it to LAN1, then returns to port 1 of the switch; Another flood of switches. After each rotation, copies were made for each of the other mouths. Replication is exponential; in a short time, the bandwidth of each port can be packed to the limit. Only then did I realize that the term "broadcast storm" is not an exaggeration, but a literal meaning.

worse, even the small notebooks were in disarray. The same MAC learns from port 1 one moment, then from port 2, flipping tables back and forth, leaving the switch confused. When it comes to devices: normal data can't squeeze through, ARP parsing times out, DHCP renewal fails—so the surveillance, Mijia, and computers all suffer together, with no one showing favoritism.

Why

Home Switch Doesn't Help Us Fail: It Has No Safety Valve

this issue is so common, can't manufacturers let the machines detect it themselves? Yes, but that's a feature only managed switches have. Mechanisms like loop detection and spanning tree protocols work by the switch signaling each other; when a loop is found in the topology, it proactively blocks one path and leaves the other to work, with the entire server room carrying this system. But my fifty-something yuan non-admin foolproof switch doesn't have that logic in the chip at all—it just obediently learns, forwards, floods, and whether it forms a loop or not, it doesn't care.

should we switch to a management type? Household expenses really don't matter. Only those need to do VLAN-isolation, like I built walls for surveillance and NAS before, are worth going for the managed type. If it's just about loop protection and controlling the physical connection, it's enough without spending a cent.

the three easiest connections to form rings at home, I listed them all for this fault:

Why does
connection form a loop
Both LAN ports of the router are connected to the same switch the router's LAN port is directly connected, and the two wires equal one loop (this time at my home)
two levels of wiring are plugged into two switches between the 8 gigabit ports and 4 POE ports in my weak current box only leaving one wire, and one more connects to form a loop
When changing an old router to an AP, both the WAN port and LAN port are connected to the main router but when changing the AP, only the LAN port should be plugged in. This is a common variant where it's hard to distinguish between the WAN port and the LAN port

How

know if your family is affected: Three symptoms correspond to


There is an iron rule regarding the

ring road fault: the entire network suffers together. If there is only one device card, it probably has nothing to do with the switch. I categorized the three common "internet weirdos" at home by symptoms, and I took them as they were:

symptoms most likely cause verification method
Whole house is stuck at once, all switchboard lights flash simultaneously Broadcast storm triggered by loop unplug one upstream cable, it recovers in about ten seconds. If it
a single device disconnected, everything else is normal but poor network port contact or cable issues try replacing the port or cable
network speed is always stuck around 93Mbps 100Mbps negotiation (four-core cable or old switches) check the negotiation speed, check network cable with eight cores

that "flashing lights in sync" deserves a special mention. Normal switch lights flash separately—whoever transmits data flashes; During the loop, all the ports were packed with the same batch of broadcast frames, and the lights flashed in unison. I saw the footage of my weak current box in the video, like a heartbeat monitor. This is the easiest signal to visually judge the loop.

Aftermath: Ten-second location, three safeguards

night I was teaching my dad a video at the hotel, with one trick: stare at the switch light and casually unplug one of the two wires connected to the router. About ten seconds after he unplugged, the Mi Home app icons turned green one by one, and the surveillance footage flashed back. "Pulling one and it works instantly" is the strongest proof of the loop; other faults don't have such immediate effects.

afterwards, I put three insurance policies on the family. First, I checked all the labels put during in the weak current box and attached a red label reading 'Don't Move' separately on the upper wiring; Second, I video-called my dad and explained the whole story, with one main idea: from a router to a switch, always only one is plugged in; adding more doesn't add points, it's a disaster; Third, I plugged two of the switch's open ports with dust plugs, leaving one less spot for easy cable plugging.

wrap up with a general order: if the whole house suddenly freezes, first check if the switch lights flash wildly in sync; Yes, they would disconnect each wiring one by one, and whichever one was pulled to restore it would be the culprit; Casually asking who at home has recently had a weak current box installed. If you only have one device card, don't blame the switch—first change the port and cable. As for the old issue of maintaining a constant 93Mbps, it's about the number of network cables. It's a completely different matter from the loop mentioned in this post. Investigate thoroughly before taking action.

Read More


Copyright Notice Scan to read on mobile
All Rights Reserved: 《SHUNOT》 => 《How do switches work? My dad plugged an extra cable into the router, and that night the whole house was stuck in a PPT format》
Article URL: https://www.shunot.com/en/lybk/1052.html
Unless otherwise stated, all articles are original by 《SHUNOT》. Reposting is welcome! Please indicate the original URL when reposting, thank you.

Contact Us

Online Consultation: Click here to send me a message

WeChat ID: master_135

Scan to follow