1. Current Location: Home >  Router Encyclopedia >  My dad plugged in an extra cable to the router, and the network cards in the whole house turned into PPT, and then he understood the switch.

My dad plugged in an extra cable to the router, and the network cards in the whole house turned into PPT, and then he understood the switch.

Switch working principle and network loop: Schematic diagram of MAC address table forwarding, flooding, and broadcast storms

Last month I was on a business trip for three days, and my dad came over to help feed the cats. At ten o'clock the next night, I turned on my phone in the hotel to take a look Home surveillance , App rotates in circles ; Entering Mijia, dozens of devices were all covered in dust. ; Even the NAS remote only has a few tens of KB per second, making it difficult to upload a screenshot. No one at home had touched any settings—until my dad called me with a guilty conscience.: "I saw that there were two empty ports on the router, and I was thinking of plugging more wires into that black box so that I could divert the traffic if there were more devices. "

It was that line that shut down the entire house's network for most of the night. This article explains exactly how a switch works, why plugging in an extra wire can paralyze the entire network, and how to locate this fault in ten seconds.

What the switch does every day: Copy a notebook

The 8-port Gigabit switch in the weak current box, I originally when buying it I just thought it was a network port extender, and I figured out the logic behind it after troubleshooting this time. Its core relies on a table, which is called a MAC address table in jargon. You can think of it as a small notebook at the front desk.: Which device ( MAC address ) at which port, make a note.

Transcript is automatic and does not require any configuration. When the desktop computer sends any packet from port 3, the switch will look at the source address. Oh, this MAC is on port 3. Make a note of it. All future data sent to this MAC will go out directly through port 3, and other ports will not be disturbed at all. This is why my NAS and desktop are both plugged into the switch. When copying files to each other, they can run at 110MB/s at full Gigabit speed - the traffic between the two devices is digested inside the switch and does not pass through the router at all.

The table lookup step is completed by hardware, at the nanosecond level, and there is no essential difference between household goods worth tens of dollars and big guys in the computer room. The difference lies in other functions, which will be discussed later.

What to do with a package it doesn’t recognize?: Shout it every time

Here comes the problem: What if the target MAC is not on the notebook? For example, a device that has just been turned on has not sent a packet yet, and the switch does not know where it is hung.

The handling of the switch is particularly simple: Send a 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 always be delivered.

There is another type of package that is inherently prone to flooding.: For broadcast frames, the destination address is all F, which clearly requires all devices on the network to take a look. There are more bags like this at home than you think: ARP shoutout is broadcast (who is 192.168.31.10 ? Tell me your MAC), DHCP finds the number sender It's also broadcast (is there a DHCP server in the venue? Give me an IP). The more devices there are, the more frequently ARP is refreshed, and the denser the broadcast. Normally, this is nothing. A broadcast frame is sent out through the remaining seven ports, and each device discards the ones it shouldn't have seen. The overhead is so small that it can be ignored.

Why are two wires so fatal?: Broadcasting went through a revolving door

Now let’s talk about what my dad did with that line. The original connection method is one line from the router LAN1 to the switch, with a regular tree structure. My dad added one: Router LAN2 is also connected to the switch. The router's LAN ports are directly connected inside the machine (essentially a small switching chip), so these two lines form a circle at the circuit level - data goes out from port 1 of the switch, passes through the router, and comes back through 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 and back to switch port 1 ; The switch floods another copy. Every time it turns around, a copy is also copied to each of the remaining ports. Replication is exponential, and the bandwidth of each port can be filled up in a short time. Only then did I realize that the words "broadcast storm" were not an exaggeration, but a literal meaning.

What's worse is that the little notebook is also in disarray. The same MAC is learned from port 1 for a while, and learned from port 2 for a while. The table entries are flipped back and forth, and the switch itself is confused. Just drop it on the device: Normal data cannot be squeezed through, ARP resolution times out, and DHCP lease renewal fails - so the monitoring, Mijia, and computer systems all suffer together, and no one is partial.

Why do home switches refuse to save themselves?: it has no safety valve

This problem is so common, can't the manufacturer let the machine detect it on its own? Yes, but that is a function only available on managed switches. The principle of mechanisms such as loop detection and spanning tree protocol is that switches greet each other and when they find a loop in the topology, they will actively block one of the paths and leave the other one to work. This is true in all computer rooms. But the non-network-managed stupid switch that costs more than 50 yuan in my home has no such logic at all in the chip - it only learns, forwards, and floods honestly, and it does not control whether it forms a loop or not.

Do you want to switch to a management type? It's really not worth it for home use. Only like me before Build a wall between monitoring and NAS The need for VLAN isolation is worthy of management. To simply prevent loops, it is enough to control the physical connections without spending a penny.

I listed the three most common wiring methods at home that are prone to loops for this fault.:

Connection method Why does it form a ring?
Both LAN ports of the router are connected to the same switch. The router's LAN port is connected internally, and two wires equal a circle (this time in my house)
Two level cables are inserted between the two switches. Between the 8-port Gigabit and 4-port POE of my weak current box Leave only one , insert one more piece to form a ring
When the old router is converted to AP, the WAN port and LAN port are connected to the main router at the same time. The AP should only be plugged into the LAN port. This is WAN port and LAN port Undistinguishable high-incidence variants

How to tell if your family has been tricked?: Three symptoms check

There is an iron law for loop failures: The whole network is in trouble together. If there is only one device card, it probably has nothing to do with the switch. I have classified the three common "network problems" at home according to their symptoms, and found out the answers.:

symptom High probability reason Verification method
The whole house is jammed together, and all lights on the switch are flashing simultaneously. broadcast storm caused by loop Unplug an uplink cable and it will be restored in about ten seconds.
A single device goes offline, but everything else is normal. Poor network port contact or network cable problem Try another plug, or try another cord.
The internet speed is always stuck at around 93 MB 100Mbps negotiation (four-core cable or old switch) Look at the negotiation rate and check Eight-core network cable

That "lights flashing simultaneously" deserves a separate sentence. Normally, the lights on a switch will flash separately, and the one who is transmitting data will flash. ; During the loop, all the ports were filled with the same batch of broadcast frames, and the lights flashed together. I saw the picture of my weak current box in the video, which was like a heartbeat monitor. This is the easiest signal to judge the loop with the naked eye.

aftermath: Ten seconds positioning, three insurances

That night I was video coaching my dad in the hotel, just one move: Staring at the light on the switch, unplug one of the two wires from the router to the switch. After about ten seconds after he pulled it out, the Mijia App icons came back green one by one, and the surveillance screen was also displayed. ""Pull one out and live immediately" is the most ironclad evidence of the loop. Other faults are not so immediate.

Afterwards, I bought three types of insurance for my home. First, put it in the weak current box Labels attached during organization After checking everything, there was a separate red sign saying "Don't Move" posted on the online link. ; Second, I talked about this matter in detail in a video with my dad. The central idea is just one sentence.: From the router to the switch, always only plug one in. If you plug in more, no points will be added, it will be a disaster. ; Third, I blocked the two empty ports of the switch with dustproof plugs, leaving less room for plugging in wires.

Give a general order at the end: The whole house suddenly freezes together. First check whether the switch lights are flashing simultaneously. ; Yes, just unplug the connected cables one by one. Whichever cable is restored is the culprit. ; Just ask anyone in your family who has touched the weak current box recently. There is only one device card. Don't rely on the switch. Change the port and line first. As for the old problem of constant 93 MB, it is a matter of the core number of the network cable, which is different from the loop mentioned in this article. Find out before taking action.

Read More


Copyright Notice Scan to read on mobile
All Rights Reserved: 《SHUNOT》 => 《My dad plugged in an extra cable to the router, and the network cards in the whole house turned into PPT, and then he understood the switch.》
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