A story about computer network concepts: gateway, DHCP, IP addressing, ARP spoofing, routing, DDOS, etc.

A story about computer network concepts: gateway, DHCP, IP addressing, ARP spoofing, routing, DDOS, etc.

What is the role of a host computer gateway?

Suppose your name is Little One, you live in a big yard, you have many friends as neighbors, and there is an old man named Li who guards the gate at the entrance. Old Man Li is your gateway. When you want to play with a friend in the yard, you just need to shout his name in the yard, and he will respond to you and run out to play with you.

[[255221]]

But you are not allowed to go out of the gate. All your contacts with the outside world must be made by Uncle Li at the gate (gateway). Suppose you want to chat with your classmate Xiao Ming. Xiao Ming lives in another yard far away. There is also an Uncle Wang (Xiao Ming's gateway) who guards the gate in his yard. But you don't know Xiao Ming's home phone number. However, your head teacher has a list of all the classmates in your class and a phone number comparison table. Your teacher is your DNS server. So you dial Uncle Li at the gate at home, and the following conversation occurs:

Little One: Uncle Li, I want to ask the class teacher to check Xiao Ming's phone number, is that ok?

Uncle Li: OK, wait for me. (Uncle Li then calls your class teacher and asks for Xiao Ming’s phone number) I got it, his home number is 211.99.99.99

Little One: That’s great! Uncle Li, I want to find Xiao Ming. Can you help me contact Xiao Ming?

Uncle Li: No problem. (Uncle Li then sent a request to the telephone company to connect to Xiao Ming's home. The last hurdle was of course to be transferred to Uncle Wang in Xiao Ming's yard, and then Uncle Wang transferred the call to Xiao Ming's home)

In this way, you got in touch with Xiao Ming.

As for the DHCP server, it can be compared like this:

There are more and more residents living in your yard, and the telephone exchange of Mr. Li in the message room can no longer meet the needs of so many residents, so they have to adopt a new technology called DHCP. When residents turn on their phones, they will get a random phone number, and the number they get each time may be different.

Uncle Li at your door: He is your gateway

Your class teacher: It is your DNS server

The telephone switch in the reception room: your DHCP server

Similarly, the conversation between Mr. Li and Mr. Wang is called routing.

Another: If there is another kid named Xiao An, and the gatekeeper of the yard where he lives is Grandpa Sun, because Xiao An's yard has just been built and Grandpa Sun has just arrived, he does not have the office phone numbers of Grandpa Li and Grandpa Wang (of course, Grandpa Li and Grandpa Wang do not have his phone number either), then there will be two situations:

1. Aunt Zhao from the neighborhood committee told Uncle Sun about Uncle Li and Uncle Wang’s phone numbers (Aunt Zhao also told Li and Wang about Sun’s phone numbers). This is called static routing.

2. Aunt Zhao was sick, so Grandpa Sun made phone calls everywhere and told everyone he met: "I'm the telephone manager of Xiao An's courtyard." Li and Wang heard it and wrote it down in their address books. Then Li and Wang called Grandpa Sun back and said: "I'm the telephone manager of Xiao Ming (Xiaobutian)'s courtyard." This is called dynamic routing.

Then one day Xiaobudian wanted to find Xiaoan, so naturally Xiaobudian called Uncle Li and said, "Uncle, I'm looking for Xiaoan" (the process of Uncle Li looking for Xiaoan's phone number is omitted here, assuming that he knew Xiaoan's phone number). Uncle Li looked in the address book and said, "Oh, the phone number of Xiaoan's yard is managed by Uncle Sun. If I want to find Xiaoan, I naturally have to notify Uncle Sun first. I can notify Uncle Wang and ask him to find Uncle Sun, or I can find Uncle Sun directly myself. Of course, it is more convenient to find Uncle Sun directly." So Uncle Li called Uncle Sun, and then Uncle Sun transferred the call to Xiaoan's house.

Here, Mr. Li’s address book is called a routing table.

Mr. Li's choice of whether to contact Mr. Sun directly or ask Mr. Wang to help transfer is called routing selection.

There is a reason why Mr. Li chose to contact Mr. Sun directly, because he can get the call in one step if he contacts Mr. Sun directly. If Mr. Wang is asked to transfer the call, it will take two steps to complete. The "step" here is called "number of hops". Mr. Li's choice follows the principle of minimum steps (number of hops) (If he does not follow this principle, Xiao Budian may have to wait longer to find Xiao An, and the final result may lead to Mr. Li being fired for poor work performance. This is called "too long delay, unreasonable routing principle, and changing a router")

Of course, things are always changing. Xiaobudian and Xiaoming had a quarrel. Xiaobudian kept calling Xiaoan these days. Xiaoming thought to himself: "Fuck, is he saying bad things about me?" So Xiaoming decided to eavesdrop on the conversation between Xiaobudian and Xiaoan, but he couldn't leave the yard. What should he do? Xiaoming made such a decision:

First, he told Uncle Wang, who was in charge of the telephone in his yard, "Call Uncle Li and tell him that Xiao An has moved to our yard. I will answer all calls to him from now on." Uncle Wang didn't react (after all, he is old!), so he called Uncle Li and said, "I am in charge of Xiao An's phone now. Sun is no longer in charge." As a result, Uncle Li changed his address book. This is called route spoofing.

When Xiaobudian calls Xiaoan again, Uncle Li will transfer the call to Uncle Wang (actually it should be transferred to Uncle Sun). Uncle Wang will transfer the call to Xiaoming (because he has already agreed with Xiaoming). Xiaoming will pretend to be Xiaoan and communicate with Xiaobudian. Xiaoming is guilty and afraid that Xiaobudian will ask him face to face when Xiaoan meets Xiaoan tomorrow. So after the communication is cut off, he calls Xiaoan again in the name of Xiaobudian and repeats what he just said. This is called data eavesdropping.

Later, Xiaobudian continued to contact Xiaoan, but Xiaoming was left behind. Xiaoming muttered in his heart: "I can't always talk to Xiaobudian as Xiaoan. What if I get caught one day?" So he thought of a more sinister trick: "I might as well not eavesdrop on your phone calls. Xiaobudian, you won't call me! Then I'll make sure you can't call Xiaoan either, humph!" How did he do it? Let's see:

He contacted a group of bad friends and colluded with them. At a fixed time every day, everyone called the Xiao'anyuan message room together. The content was all kinds of things. As long as Grandpa Sun in the message room answered the phone, he would hear "Thunder, it's raining, collect the clothes!", "Humans are born by human mothers, monsters are born by monster mothers", "What's your mother's surname", etc. It was so annoying to hear them, but he had to listen. The phone kept ringing! Finally one day, Grandpa Sun couldn't stand it anymore and shouted, "I can't stand it anymore!!!!", so he hanged himself!

This is the simplest DDOS attack. Grandpa Sun's weak psychological endurance is called "the datagram processing module has a bug", and Grandpa Sun's suicide is called "the router is paralyzed". If it were me, I would smile and chat with them, such as telling them "I have already listened to the weather forecast and put away the clothes 10 minutes ago" or "Is your mother a human or a demon?" or "She has the same last name as your grandmother", etc. My healthy psychology is called "robust datagram processing, which can resist any attack"

After Grandpa Sun became paralyzed, Xiaobutian finally stopped calling Xiaoan because no matter how many times he called, the other party always got a busy tone. This phenomenon is called "denial of service", so Xiaoming's approach is also called "denial of service attack".

Xiao Ming finally stayed quiet for a few days,...

A few days later, a beautiful girl came to Xiao Ming's yard. Her name was Xiao Li. Xiao Ming liked her very much (why did she fall in love at such a young age?). But Xiao Li had a very handsome boyfriend, so Xiao Ming could only stare at her. Of course, the above principle still applies: Xiao Li cannot leave the yard. The man wanted to flirt with Xiao Li, so he could only call her. So Xiao Ming was ready to make another move:

Remember that Grandpa Wang was the telephone manager of the courtyard? The reason why he could manage the telephone was because he had an address book. In the same courtyard, there might be two children named Xiao Ming, and they could not be distinguished by their names. Therefore, each line in the address book had only two items:

House number phone

Door No. 1 1234567 (This is Xiao Ming's)

Door No. 2 7654321 (This is Xiaoli's)

......

Grandpa Wang has a bad memory, but this can't be wrong, right? (There won't be two "Door No. 2s" in the same yard, right?) Every time he makes a phone call, he has to say the phone number he's looking for, and then he goes to the yard and knocks on the door through the address book. For example, if someone says I'm looking for "1234567", then Grandpa Wang compares them and finds that it's Door No. 1, so he goes to knock on Door No. 1 to "answer the phone". If it's "7654321", then he goes to Door No. 2 to "answer the phone".

The phone number here is the legendary "IP address"

The house number here is the legendary 'MAC' address of the network card (the MAC address of each network card is different, which is hard-coded into the chip of the network card by the manufacturer of the network card)

Xiao Ming thought to himself, "Damn it, if I can't get you, then you can't get me either", so he set his sights on Grandpa Wang's address book. After careful observation and thorough preparation, he finally discovered that Grandpa Wang had a problem with frequent urination (after all, he is an old man...). Finally, on a dark and windy day, Grandpa Wang went to the toilet. Xiao Ming sneaked into the communication room and carefully changed Grandpa Wang's address book...

A few days later, Xiaoli's boyfriend called her again. The phone number he reported was "7654321". Grandpa Wang looked at the address book and was shocked:

House number phone

Door No. 1 1234567 (This is Xiao Ming's)

Door No. 1 7654321 (Note: This was originally Xiaoli's, but was changed by Xiaoming)

......

Grandpa Wang didn't know how to change, so he went to find Xiao Ming at Gate No. 1. Xiao Ming was so happy that he severely reprimanded the man for the improper relationship between him and Xiao Li in the tone of Xiao Li's father. As a result, the man hung up the phone respectfully. Of course, Xiao Li didn't know what happened...

Here, Xiao Ming's behavior is called "ARP spoofing" (because it is achieved by sending ARP packets on the actual network, so it is called "ARP spoofing"), and Grandpa Wang's address book is called "ARP table"

Please note here: Grandpa Wang now has two address books. One is a book that records the telephone number of each courtyard’s communication room, called the “routing table”, and the other is a book that records detailed information in the courtyard, called the “ARP table”.

There is a saying that "people are always pursuing perfection, even though they can never achieve it" (please remember this sentence, because it was said by a famous person - that is, me)

One of Grandpa Wang's rules states that "every month, the correspondence between house numbers and telephone numbers (i.e., the ARP table) must be rechecked." This action is called "refreshing the ARP table," and the monthly time limit is called "refreshing the ARP table cycle." In this way, Xiao Ming has to secretly change the address book every month in order to prevent the man from finding Xiao Li forever. But this is something he has to do!

One more thing to add, Xiao Ming is very smart. If the address book (ARP table) is changed to this:

House number (MAC) Phone (IP)

Door No. 1 1234567 (This is Xiao Ming's)

Door No. 2 1234567 (Note: This was changed by Xiao Ming, but he made a mistake in a moment of dizziness)

......

Then a dialog box pops up on the computer saying "duplicate IP address", which eventually causes Grandpa Wang to be at a loss, so he notifies Gate 1 and Gate 2 that your phone number is duplicated. In this way, Xiaoli knows that someone is ruining her good deeds. This phenomenon is called "the scam is exposed"

Xiao Budian knew that Xiao Ming had eavesdropped on his phone call with Xiao An, so he agreed on a code with Xiao An. Xiao Budian encrypted what he wanted to say at home and told Xiao An. Potato-〉Wednesday, sweet potato-〉treat, idiot-〉Xiao Budian's home. So Xiao Budian told Xiao An: potato, idiot, sweet potato. Xiao Ming didn't understand... He was depressed... This is encryption.

In addition, Xiaoli also knew that Xiaoming had changed his phone number. So Grandpa Wang went to their homes and wrote down the phone numbers and house numbers one by one. He hid them and did not allow outsiders to modify them. Only he had the key (password). This is the binding of the IP address and the MAC address. When someone changes the phone number, they have to ask Grandpa Wang to change it. It is troublesome, but safe. However, Xiaoming secretly made a copy of Grandpa Wang's key (successfully stole the password), so he could still change it. That's it, that's it.

<<:  Miao Wei: 5G temporary licenses will be issued this year and 5G terminals will be launched in the second half of the year

>>:  5 ways 5G will change the world

Recommend

After reading this, do you still feel that IPV6 is far away from you?

IPV6? I think I've heard of it. [[331219]] As...

How fiber optic networks can create more efficient and secure connections

We live in a technologically advanced age where h...

Breaking the shackles of proprietary systems: the open path to 5G networks

As technology continues to change, the era of pro...

Hostio: €5/month KVM-2GB/25GB/5TB/Netherlands data center

Hostio is a foreign hosting company founded in 20...

On the eve of 5G, mobile phone companies should not panic

Not long ago, a video about 5G experience by &quo...

Easy-to-understand illustrated network knowledge - Part 2

Continuing from the previous article "​​Easy...

Guidelines for Protecting RS-232 Serial Connections

RS-232 connections are an integral part of serial...