当前位置:网站首页>[how to connect the network] Chapter 2 (next): receiving a network packet
[how to connect the network] Chapter 2 (next): receiving a network packet
2022-06-26 13:16:00 【Currybeefer】
Previously, we discussed the sending of a network packet , Now let's take a look at what a computer or server will do when it receives a network packet .
In a half duplex Ethernet , Packets sent by a device will be received by all devices connected to the hub , So the receive operation will receive many packets that may not be sent to itself .

First PHY(MAU) The module first converts the signal into a general format and then sends it to MAC modular ,MAC The module reads the synchronization clock of the header and the start frame delimiter , Convert everything behind the section break into digital information , Check the tail again FCS See if there is any error in this package , If something goes wrong, throw it away .
If FCS That's right ,MAC The module is about to query MAC Receiver's in the header MAC Address and own network card MAC Is the address consistent , To determine whether the bag was sent to you , If not, discard the bag . If yes, drop the packet into the buffer of the network card , Then the network card will call the interrupt of the operating system , Let the operating system protocol stack look at the newly received package .
After the protocol stack comes , Namely IP The work of the module ,IP The module will view the data package IP Header information , confirm IP The address of the receiver in the header is not itself . If not ,IP The module will send ICMP The message informs the sender of the error .
If correct , Then give it to TCP The module handles ,TCP Module will view IP Sender of header IP Address and receiver IP Address , as well as TCP The port numbers of the sender and receiver of the header are used to find out whether there is a corresponding socket in their protocol stack , Find the corresponding socket , Then you can carry out the corresponding operation . for example , If the contents of the package are data , Then return to confirm the received packet , Then put the data into the buffer and other upper applications ( browser ) To read . If it is a connected or disconnected package , Then the corresponding response control package , Then tell the upper application the corresponding status .
There's also a little Tips
Send the whole , forward , The whole process of receiving can refer to this animation , Very detailed :
https://www.bilibili.com/video/BV1c4411d7jb?p=9&vd_source=5898cd61d2d78c3c6feae32e4c4101c6
边栏推荐
- POJ 3070 Fibonacci
- 组合模式(Composite )
- Beifu PLC passes MC_ Readparameter read configuration parameters of NC axis
- Beifu twincat3 can read and write CSV and txt files
- Electron official docs series: Get Started
- Analysis and protection of heart blood dripping vulnerability (cve-2014-0160)
- Fire warning is completed within 10 seconds, and Baidu AI Cloud helps Kunming Guandu build a new benchmark of smart city
- Is it safe for the head teacher to open a stock account and open an account for financial management?
- Electron official docs series: Best Practices
- F - Charm Bracelet
猜你喜欢

享元模式(Flyweight)

倍福Ethercat模块网络诊断和硬件排查的基本方法

C语言:练习题二

What are the common categories of software testing?

OPLG: 新一代云原生可观测最佳实践

Composite mode

8、【STM32】定时器(TIM)——中断、PWM、输入捕获实验(一文精通定时器)

外观模式(Facade)

Update and download of Beifu EtherCAT XML description file

Beifu PLC based on NT_ Shutdown to realize automatic shutdown and restart of controller
随机推荐
HDU 3555 Bomb
Summary of wechat applet test points
sql 将数据表b字段值赋值到数据表a中某一列
Fire warning is completed within 10 seconds, and Baidu AI Cloud helps Kunming Guandu build a new benchmark of smart city
Composite mode
E - Apple Catching
Map value
Beifu PLC model selection -- how to see whether the motor is a multi turn absolute value encoder or a single turn absolute value encoder
H - Sumsets POJ 2229
To solve the difficulties of small and medium-sized enterprises, Baidu AI Cloud makes an example
Don't mess with full_ Case and parallel_ CASE
Adapter mode
scrapy——爬取漫画自定义存储路径下载到本地
Arcpy - - utilisation de la fonction insertlayer (): ajout de calques dans un document de carte
UVA10341 solve it 二分
组合模式(Composite )
Digital signal processing -- Design of linear phase type (Ⅰ, Ⅲ) FIR filter (1)
利用scrapy爬取句子迷网站优美句子存储到本地(喜欢摘抄的人有福了!)
外观模式(Facade)
Learning Processing Zoog