New employees in the network department My name is Robert, and I am an ordinary citizen of the Linux empire. Today is my first day at work. I worked very hard to pass the imperial civil service exam. Based on my results, I was assigned to the Imperial Network Department. As soon as I entered the Empire's office park, I was stunned by the scene before me. The tall buildings were magnificent and lined up one after another. I couldn't help but stop and take a few more glances.
There are signs on these buildings. The tallest one is the office building of Empire's process and thread management department. Next to it are the office buildings of the memory management department, file management department and other departments. Network card driver department I was so busy looking around that I accidentally bumped into a guy who was running out from the side road. The pile of data in his hands fell all over the ground.
I apologized and helped him pick up the data. "This young man seems to be in a hurry. I wonder where he is going?" I asked curiously. "Oh, hello, I'm from the network card driver department. This is the data packet I just received from the network card. I have to hand it over to the protocol stack for processing." After saying this, he sorted out the data and left in a hurry. Following the direction where he came out, I saw that the network card driver department he mentioned was not far away. Could this be where my office was? I walked along the path. As soon as I entered the network card driver department, what appeared before my eyes was a scene of bustling activity, with people receiving packages, unpacking packages, and sending packages, all of them busy and having fun.
"Why are you so busy so early in the morning?" I asked the security guard at the door. "Yeah, there's usually not much network access at this time. I don't know what happened today, but data has been transmitting non-stop since early morning," said the security guard. I pointed at an employee inside and asked the security guard: "Uncle, what is that person doing? He keeps turning around." "You mean him? He's polling and reading data packets from the network card!" "Polling? Aren't network data packets interrupt notifications sent by the network card? Why do we need to poll?" I asked puzzled. "It used to be like this, but later a guy called Ah Q on the CPU side refused to work, saying that the network card data was too frequent and kept interrupting their normal work. Not only that, but when responding to interrupts, they had to turn off the interrupts to avoid errors. Over time, the keyboard, mouse and other units couldn't get a response and started to cause trouble," the security guard said before lighting a cigarette. I nodded thoughtfully, "So we should change to polling now? But this is such a waste of time." The security guard blew out a smoke ring and continued, "It's not all polling. Now the processing process is divided into two parts. The first part still relies on interrupts for notification. At this time, the interrupt needs to be turned off. However, after the notification, the data packet will not be actually processed. Instead, a soft interrupt is turned on, so it cannot be turned off for too long. The second part is processed by polling in the soft interrupt, so there is no need to turn off the interrupt at this time. By combining hard interrupts and polling, there is no need to interrupt once for each data packet, and there is no need to turn off the interrupt for too long. This technology is also named NAPI." "Security uncle, how do you know everything?" "I used to work there, but now I'm a little older and can't compare to the young people, so they asked me to work as a security guard. Alas~", the uncle said, then took another deep puff of his cigarette and tidied his increasingly thinning hair. "Oh, by the way, who are you? Why haven't I seen you before?" "I am a new employee of the Empire Network Department. I reported in today. I handed the acceptance letter to the security guard." The security guard took a look and said: "You've gone to the wrong place. This is not the place. You should go to the Network Protocol Stack Building." Protocol Stack Building After leaving the network card driver department, I continued moving forward and finally found the Network Protocol Stack Building, which is where I will work in the future. As we got closer, we found that this Internet building was not as tall as we had seen before. It was only three stories high. On the wall of each floor was a huge sign with the name of the floor written on it. From top to bottom, they were:
There is also a mail room at the entrance of the building. The doorplate reads netif_receive_skb, and there is an old man sitting in the mail room. At this moment, the guy I met before came again, put the data in his hand in the mail room and left. It seems that this is the entrance to the network protocol stack. The old man opened the data packet and took a look at it, then pressed a button, and the data packet was transmitted through the pipe to an office on the first floor of the protocol stack building behind me. I looked up and saw IPv4 written on it. Looking to the side, there were several other offices with IPv6, ICMP, IGMP, ARP, etc. written on them. I arrived at the door of this IPv4, and saw that it was also very busy, with fragmentation, packet assembly, and checksum calculation, all in an orderly manner. There is a cylindrical pipe in the center of the office that leads to the second floor. After the data packets are processed on the first floor, they are sent up through this pipe. There is another pipe on the wall with netfilter hook written on it, but I don't know where it leads to. "Who are you looking for?" I was so engrossed in watching that a person in charge inside noticed me and I quickly explained my purpose. After looking at the admission letter in my hand, he said, "You are in the transport layer. Turn right when you go out and go up to the second floor. Our entire floor is full of network layer protocol offices." I looked at the employment letter in my hand again and found that I was assigned to work in the transport layer. Transport layer work I went to the second floor and finally met my supervisor. "Robert, welcome to the Network Department. You are working in the TCP team at the transport layer. Everyone is welcome!" "Thank you, supervisor! Thank you, everyone!" "This is Cerf. You're new here, so let him guide you first. If you have any questions, just ask him." I nodded in thanks and shook hands with the man named Cerf next to me. Next, the supervisor introduced me to the situation of several groups in our transport layer: TCP, UDP, SCTP, UDP-lite... Only then did I realize that the transport layer is not just about TCP and UDP.
Cerf took me to my workstation. As expected of a state-owned unit, it was extremely spacious, and there were a bunch of strange devices on the table. "What the hell is this?" I asked Cerf. "These are timers. You will use them later when you work on TCP connections." I nodded and looked around. The wall next to my workstation was covered with something. I took a closer look and found that it was full of thousands of RFC regulations. "Look great! You'll be using these things every day in your future work," Cerf said jokingly. "I have basically memorized all of these, otherwise I wouldn't have been able to get here," I said with a smile, a little proud. Cerf also smiled and said, "Don't be careless, someone said this before, but he left anyway." I was a little embarrassed and didn't know what to say, when a data packet came out of the pipe in the middle of the office. "Robert, you just arrived, so this new connection data packet will be handed over to you to handle and familiarize yourself with the workflow," said the supervisor. My relaxed mood suddenly became tense. After all, it was all theory talk before, and I had never actually processed a data packet. I carefully took the data packet, located the TCP header, glanced at the flag bit, and found that the SYN bit was 1. It seemed that a new connection was coming. The next step was the three-way handshake, which I was very familiar with. I prepared a response packet, and after turning on both the SYN and ACK flags, I was in a dilemma. I knew that the confirmation number ACK was the other party's sequence number + 1, but what sequence number should I reply with? For a moment, I didn't know what to do. Do you know? Waiting online, it’s urgent. To be continued... Easter Eggs Ah Q from CPU workshop No. 1 is angry again. "We spent a lot of time moving the network card data to the memory. It was repetitive and technically useless. I was fed up with it!" To know what will happen next, please pay attention to the follow-up excitement······ |
<<: How to resolve the conflict between 5G intermediate frequency and satellite C band?
>>: 12 Ways 5G in Manufacturing Can Boost Industry 4.0
HostYun has launched a 15% discount coupon during...
I believe that every maintenance personnel will e...
My previous article, "Once considered the &q...
On November 7, Li Zhengmao, general manager of Ch...
Aruba, a Hewlett Packard Enterprise company, anno...
On June 6, 2019, China officially issued 5G licen...
Cables and connectors have been an integral part ...
2019 was a transformational year for the telecomm...
In recent years, with the rapid development of in...
Part 01 Physical Layer If a computer wants to tra...
When it comes to web3, many people think it is a ...
This month we have shared information about BuyVM...
With millions of machines and objects connected t...
Cloud-based unified communications (UC) tools are...
With the development of science and technology, t...