After get off work, you feel empty and miss her far away. The days seem to have an end, but in reality, it seems to have no end. When others are happy, you have your own sorrow; when you are happy, someone is experiencing the test of life and death. People's joys and sorrows are not synchronized, but at this moment, you just want to find someone to chat with. There are thousands of words in your heart, but in the end you are unable to express them. After careful consideration, you take out your mobile phone. "Have you eaten yet?" Three large square characters, with punctuation marks that expressed curiosity, concern, and uneasiness, broke through endless obstacles and rushed out.
Feelings don't need words. At this time, the loyal Internet spreads your sadness and attachment. You are not an employee of Mahua Family, but you vaguely guessed the data transmission process. Before she replied from afar, you imagined the whole process in your mind. It makes sense, but why do I feel a little sad? Unreadable ciphertextYou use a Huawei phone instead of an Apple phone because you think it’s the only one that’s worthy of you; you don’t upgrade to Hongmeng OS because you think it’s a waste of time. When all kinds of red, pink and green fans are boiling, you only care about whether your message can be delivered. Even if it is such an ordinary three words, you don't want it to be seen by others like naked body. In fact, your information is transmitted through an encrypted channel. Since you have logged in with your account password, this connection already exists. You let out a long sigh of relief, finally not having to think about that old four-turn-three handshake again. This connection should be HTTPS. Each connection generates a unique encryption key. Others will not know what you are saying even if they see it, so you can speak with confidence. Although the programmers who have the private key in the background can see it, everyone is busy making money, so who cares about your trivial matters?
At this time, "Have you eaten?" will be encrypted into a string of incomprehensible messages and sent out. This is a string of data in the TLS protocol format, working at the application layer. Next, the data will be transmitted at the transport layer, which is TCP. The IP+port number on your mobile phone, plus the IP+port number on the server, constitute the secret channel for your tryst. Run, data packSince you are connected to your own Wi-Fi, your IP address undergoes a layer of PNAT conversion. The router eventually maps the IP bound to the public network plus a certain port to your 192 network segment IP. Hiding behind the router, you actually feel an inexplicable sense of security. However, the lower network layer (IP protocol) does not have any port number. Your network packets will be sent directly by your router. At this time, the port number has become the message content of the IP protocol. Even at the speed of light, when it is transmitted to the server, it is unknown whether the port number exists. In fact, even the existence of this connection is unknown. You think the connection is a straight line, A and B are solid and messy, but in fact it is just two points. One point can never know whether the other point is alive at the same time. Sometimes, if there is no heartbeat, a point will wait there stupidly forever. The moon is bright over the sea, and we are all the same at this moment? You shook your head. You should leave this philosophical question to the abbot of Longquan Temple. The IP protocol sends information in a best-effort way, running in a relay race according to the routing table on the path node. Maybe an unreliable node will lose your lovely data packet; or when RIP reaches 15, your data packet will be ruthlessly lost. Fortunately, TCP at the transport layer has a retransmission mechanism. ACK ensures the data packet and also ensures your love. Then it finally reaches the unreasonable connection layer, because at this point, even the IP address becomes a message, because the transmission here is completely unreasonable, it is just a naked Frame (Ethernet frame). Your data packet is sent out as this raw data. We all know what happened next. The physical layer network card uses high voltage to represent 1 and low voltage to represent 0, which eventually gave birth to all things.
But wait, it’s not that simple, it’s not that smooth. The reason is that TCP at the transport layer does not write data directly to the network card, it also has a buffer, such as SO_SNDBUF, which means setting the buffer size of the socket sender. This buffer will always exist before the other end returns ACK, it is not as ruthless as UDP. So the buffer is a thing that is inserted in front of TCP and is like a light bulb that comes in randomly. Well, it's time to send the buffer. Since the buffer is in memory, this is the process of sending the data in memory to the network card. The TLS packet generates a TCP message in user mode, and when sending the buffer, it must switch to kernel mode. Through a series of encapsulation and network card driver conversion, sk_buff is transferred to the network card. Who will send it? The CPU is too lazy to do this kind of work, so let it be handed over to DMA through interruption. This way, the CPU can have more time to do more meaningful things. UnpackingAfter 9981 difficulties, the server's network card received the relevant data packet. It found that the target machine was actually an LVS load balancer. Through routing lookup, it found that there was an Nginx server behind it. Sorry, behind Nginx is actually a two-layer microservice gateway. Behind the microservice gateway, there are many machines serving as servers, waiting for you to fall into the trap. Through the load balancing strategy, a machine was finally located. After obtaining your user ID, the system intends to query another microservice module to assemble your personal information, such as your avatar. Finally, it is time to process the words “Have you eaten?” It is very exciting. What effect will this message have? Will she reply to you? Or will she fall into an endless void? Finally, there was a reply. It turned out to be that hurtful string of words: "XX has turned on friend verification, you are not her friend yet..." Well, let the machines in the entire link interact less frequently and take more rest. You thought as you kicked the cat under your feet hard. |
HostDare, which has been silent for almost a year...
RAKsmart is a foreign hosting company operated by...
[[420910]] Market Introduction Market research fi...
The total sales volume of the entire network reac...
At present, the hottest topic is none other than ...
[[379482]] This article is reprinted from the WeC...
A few days ago, we shared the information about S...
Recently, a plan for WeChat and Alipay to connect...
Before the full resumption of work, production an...
There are two basic types of industrial network s...
The network industry in the first half of 2018 ca...
Although 5G communication technology has always b...
PacificRack released several special products thi...
[51CTO.com original article] The WOTD 2017 Global...
Preface The TCP three-way handshake process is a ...