IP Shard Loss Retransmission-sacrifice log-NetEase blog

Source: Internet
Author: User

Although IP shards appear to be transparent, there is one thing that you do not want to use: even if you lose only one piece of data, you need to retransmit the entire datagram. Why is this happening?Because the IP layer itself does not have a time-out retransmission mechanism-the higher layers are responsible for timeouts and retransmissions (TCP has timeout and retransmission mechanisms, but UDP does not.) Some UDP applications themselves also perform timeouts and retransmissions. When a piece from a TCP packet is lost, TCP sends the entire TCP message segment after timeout, which corresponds to an IP datagram. There is no way to retransmit only one piece of data in the datagram. In fact, if the data is fragmented by intermediate routers rather than from the start-up system, then the hyper-start system knows how the datagram is fragmented. For this reason, it is often to avoid sharding.
Note: When a copy of an IP datagram is fragmented, it is only re-assembled at the destination (the reassembly here differs from the other network protocols, which require reassembly at the next station rather than the final destination). Reassembly is done by the IP layer of the destination, which is designed to make the Shard and reassembly process transparent to the transport layer (TCP and UDP), in addition to some possible leapfrog operations. It is possible for a datagram that has been fragmented to be fragmented again (possibly more than once). The data contained in the IP header provides sufficient information for fragmentation and reassembly. 1,MTU (Maximum transmission UNIT,MTU), Max transmission Unit
(1) Ethernet and 802.3 have a limit on the length of the data frame, the maximum value is 1500 and 1492 bytes respectively. This feature of the link layer is called the MTU. Most of the different types of networks have an upper limit. If the IP layer has a data to be transmitted, and the length of the data is greater than the MTU of the link layer, then the IP layer will be fragmented (fragmentation), the datagram is divided into several slices, so that each shard is less than the MTU.
(2) After a copy of an IP datagram is partitioned, it is reassembled by the IP layer at the destination end, which is designed to make the Shard and reassembly process transparent to the transport layer (TCP/UDP). Since each shard is a separate package, it may be out of order when the slices of the datagram arrive at the destination, but there is enough information in the IP header to allow the receiving side to assemble the data sheets correctly.
(3) Although the IP shard process looks transparent, there is one thing that you don't want to use: even if you just lose one piece of data, you need to retransmit the entire datagram. Why Because the IP layer itself does not have a time-out retransmission mechanism------is responsible for timeouts and retransmissions by higher-level (such as TCP). When a piece from a TCP packet is lost, TCP will re-send the entire TCP segment after the timeout, which corresponds to an IP datagram (not a shard), and there is no way to retransmit only one of the data shards in the datagram.
(4) using UDP can easily lead to IP sharding, TCP attempts to avoid IP shards. So how does TCP try to avoid IP fragmentation? In fact, the use of TCP protocol data transmission is not caused by IP shards, because once the TCP data is too large, more than MSS, the transport layer will be the TCP packet segmentation (how to divide, see below!) ), naturally to the IP layer of the datagram will certainly not exceed the MTU, of course, there is no fragmentation. For UDP datagrams, if the IP datagram consisting of UDP is longer than 1500, then the IP datagram will obviously be fragmented because UDP cannot fragment itself as TCP. Summary: UDP does not fragment, it is divided by my IP. TCP will fragment, of course, I do not have to divide the IP!
2,MSS (maxitum Segment size) abbreviation for maximum fragment size is a concept within the TCP protocol
(1) MSS is the maximum data segment that TCP packets can transmit at a time. In order to achieve optimal transmission efficiency, the TCP protocol usually negotiates the MSS values of both sides when establishing the connection. This value TCP protocol in the implementation of the time is often replaced with the MTU value (need to subtract the size of the IP packet header 20Bytes and TCP data segment of the packet 20Bytes) so often MSS is 1460. Both sides of the communication will determine the maximum MSS value for this connection based on the MSS value provided by both parties.
(2) I believe there is one last question: How does TCP implement fragmentation? In fact, TCP does not matter fragmentation, because each TCP datagram in the composition before its size has been limited by the MSS, so the length of the TCP datagram is not greater than the MSS, of course, the length of the IP packet formed by it will not be greater than the MTU, nature will not use IP shards


Please click on the promotion link below, thank you



From for notes (Wiz)

IP Shard Loss Retransmission-sacrifice log-NetEase blog

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.