In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > IT Information >
Share
Shulou(Shulou.com)11/24 Report--
This article comes from the official account of Wechat: programming Technology Universe (ID:xuanyuancoding), author: Xuanyuan Wind O
My name is Robert, an ordinary citizen of the Linux empire.
Today is my first day at work, I made a lot of efforts to be admitted to the Imperial Civil Service, according to my grades, I was assigned to the Imperial Network Department.
As soon as I entered the office park of the Empire, I was stunned by the sight of high-rise buildings, magnificent and row upon row, and I couldn't help but stop and take a look.
There are signs on top of these buildings, and the tallest one is the office building of the Imperial process & Thread Management Department, next to the office buildings of memory management, document management and other departments.
In the network card driver department, I only looked around and accidentally bumped into a little brother who ran out of the side road, and the pile of data in his hand was scattered all over the floor.
As I apologized, I helped him pick up the data.
"this little brother is in a hurry. I don't know where he's going," I asked curiously.
"Oh, hello, I'm from the network card driver department. This is the packet I just got from the network card. I have to hand it over to the protocol stack for processing." he sorted out the data and left in a hurry.
Looking for the place where he came out, not far away is the network card driver department he said. Is this where I work? I walked along the path.
As soon as you enter the network card driver department, what appears in front of you is a hot scene, including receiving, unpacking, sending out packets, and a group of people are very busy.
"it's so busy so early," I asked the security guard at the door.
"Yes, there is usually no network access at this point. I don't know what's going on today, but the data is constantly transmitted early in the morning," the security guard said.
I pointed to an employee inside and asked the security guard, "Uncle, what is that man doing?" he's been spinning around. "
"you mean him, he is polling and reading data packets from the network card!"
"polling? the network packet is not the network card to send interrupt notification, why go to the poll?" Well, I asked inexplicably.
"it used to be like this, but then there was a guy named Ah Q in CPU who quit, saying that the network card data was too frequent and always interrupted their normal work. Not only that, when the interrupt response, you have to turn off the interrupt to avoid errors. After a long time, the keyboard, mouse and other units will not respond and make trouble," the security guard said and lit a cigarette.
I nodded thoughtfully. "so now it's a poll? but it's a waste of time."
The security guard spit out a smoke ring and continued, "it's not all polling. Now the process is divided into two stages. The first part of the process is notified by interrupts. At this time, interrupts need to be turned off. However, instead of actually processing data packets after notification, a soft interrupt is turned on, so it can't be shut down for long." The second part polls for processing in the soft interrupt, so there is no need to turn off the interrupt at this time. With the combination of hard interrupt and polling, you don't have to interrupt every packet once, and you don't have to turn off the interrupt for too long, and the technology is called NAPI. "
"Uncle Security, how do you know everything?"
"I used to work in it, but now I'm a little older, so I'm not as good as a young man, so I'm going to be a security guard," he said, taking another puff of his cigarette and tidying up his increasingly sparse hair.
"Oh, by the way, who are you? how come I haven't seen you before?"
"I'm a new employee from the Imperial Network Department. I'm here to report today. I handed the admission letter in my hand to the security guard."
The security guard looked at it and said, "you're going the wrong way, not here. You should go to the network protocol stack building."
Protocol stack building left the network card driver department, I moved on and finally found the network protocol stack building, this is where I will work in the future.
When we get closer, we can see that the network building is not as tall as we saw before. it is only three stories high, and there is a huge sign on the wall of each floor, with the name of this floor written on it, from top to bottom:
Application layer
Transport layer
Network layer
There is also a mailroom at the door of the building. the door number says netif_receive_skb, and there is an uncle sitting in the mailroom.
Just then, the little brother I met before came again, put the data in his hand in the mailroom and left. It seems that this is the entrance to the network protocol stack.
The uncle opened the packet and then pressed the button, and the packet was sent down the pipe to an office on the first floor of the protocol stack building behind it. I looked up and saw IPv4 written on it. Looking to the side, there are several offices where IPv6, ICMP, IGMP and ARP are written.
When I came to the door of this IPv4, I was busy, too, with slicing, grouping, calculating checksum and methodically.
There is a cylindrical pipe in the middle of the office, which leads to the second floor, and the data packet is sent up after processing on the first floor.
There is another pipe on the wall with netfilter hook written on it. I don't know where it leads.
"who are you looking for?" I was fascinated when a person in charge found me and I hastened to indicate my purpose.
After reading the admission letter in my hand, he said, "you are on the transport floor. Just turn right and go to the second floor." our floor is full of network layer protocol offices. "
I looked at the offer letter in my hand again, and found that I was assigned to work in the transport layer.
When I came to the second floor on the transport floor, I finally met my supervisor.
"Robert, welcome to the network department, the TCP group whose job is at the transport layer, welcome!"
"Thank you, supervisor! thank you!"
"this is Cerf. As soon as you get here, let him take you first. If you don't understand anything, ask him for advice."
I nodded my thanks and shook hands with Cerf, who was beside me.
Next, the supervisor introduced to me several groups in our transport layer: TCP, UDP, SCTP, UDP-lite. I just knew that the original transport layer is not just TCP and UDP.
Cerf took me to the work station, which is really a state-owned unit, extremely spacious, and there are a lot of strange equipment on the desk.
"what kind of stuff is this?" I asked Cerf.
"these are all timers, which will be used later when you work on TCP connections."
I nodded and looked around. There was something else on the wall next to the station. I took a closer look and found that it was full of thousands of rules of RFC.
"take a good look, but you have to use these things every day for your future work," Cerf said slightly jokingly.
"I can basically memorize all this, otherwise I wouldn't have come here," I said with a smile, with a little complacency.
Cerf also smiled. "Don't be careless. Someone has said this before, but then he left."
I was embarrassed and didn't know what to say when a data packet appeared in the pipe in the middle of the office.
"Robert, as soon as you arrive, this new connection packet will be handed over to you to deal with and familiarize yourself with the workflow," the supervisor said.
I just relaxed my mood and became nervous. After all, I used to talk on paper, and I had never really dealt with data packets.
I carefully received the packet, located to the head of the TCP, looked at the flag bit, found that the SYN bit is 1, it seems that a new connection has arrived, followed by a three-way handshake, I am all too familiar with it.
I prepared a response package that lit up both the SYN tag and the ACK tag, and then I made a mistake. I do know that the confirmation number ACK is the serial number + 1 of the other party, but what is the serial number I reply? For a moment, I didn't know what to do.
You know what? Wait online. I'm in a hurry.
Not finished to be continued
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.