当前位置:网站首页>TCP slicing and PSH understanding

TCP slicing and PSH understanding

2022-07-04 11:21:00 Ascetic monk runnercai

First of all IP section :

The link layer is the largest MTU( Maximum transmission unit ) It's usually 1500, Link layer is not included 14 Byte header , therefore jIP Transmitted from the network layer to the link layer IP The maximum package size cannot exceed 1500, But if more than 1500 What do I do ?
In fact, this situation will not happen , When IP When the layer receives data and is ready to send it to the link layer , Will definitely detect IP Whether the size of the package exceeds that of the current host MTU, If it exceeds, it will be divided , We know ,MTU Can be set , If the next route MTU What if it is smaller than the last one ? It's simple , Routing will be in IP Layer is divided ? But the premise is IP It is set to allow segmentation , If IP Fragmentation is not allowed , Then the bag will be discarded , So some people are cheap , The routing has been enlarged MTU, I found that all networks can't be linked ( It's bigger MTU, Cause the next hop of the route to receive more than yourself MTU Large link packets , Unable to deal with , discarded ).

Router MTU Why is the setting too large to open the website
IP Slice and recombine

except IP Out of slice ,TCP Also in pieces , therefore TCP Your bag is usually IP The layers will not be divided , Only UDP and ICMP Your bag will be in IP Layering .
But the latest operating system supports NPU Fragmentation , So there's no need to TCP It's split , Can reduce the TCP The transmission bandwidth of the header is wasted .
Why? TCP/IP The package length will be greater than MTU?

TCP Transmitted data slices and ACK Introduce

The following article talks about TCP After slicing, its TCP package flag The change of .
TCP Protocol flag bit PSH The role of

stay tcp In transit , The party we accept data recv(), When can I read the data , The first is that the cache is full , The second is PSH sign ( Whether the cache is full or not ) All are immediately handed over to the application layer .
 Insert picture description here

TCP Three and four waves of

Transport layer TCP\UDP Why port ? Used to distinguish which one fd Receive the data .
IP The layer is determined by the protocol field in its header to be TCP still UDP.

TCP One packet at a time , The receiver replies with a ack Do you ?
Linux Of TCP SACK(Selective Acknowledgment)

原网站

版权声明
本文为[Ascetic monk runnercai]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202141408352914.html