Data Partition memo for IP protocol

Source: Internet
Author: User
Conclusion: not only can the TCP protocol divide data segments, but the IP protocol also has this function. The reason for this is that both are restricted by the underlying MTU (although TCP splits data packets according to MSS restrictions, because MTU = TCP packet header + IP packet header + MSS, it is actually restricted by MTU .). But try not to let the IP protocol take charge of packet subcontracting, because although the IP protocol will split the packet, number and package assembly, but the IP protocol is not responsible for retransmission, therefore, if the transport layer does not provide a retransmission mechanism, data may be lost. Even if the upper layer can ensure retransmission, if the packet forwarding is handled by the IP protocol, the upper-Layer Protocol cannot know which packet is lost (the Protocol is transparent). Therefore, the whole packet can only be re-transmitted, which is a waste of resources. Therefore, IP subcontracting should be avoided. 1, MTU (maximum transmission unit, MTU), maximum transmission unit
(1) Ethernet and 802.3 have a limit on the length of data frames. The maximum values are 1500 and 1492 bytes, respectively. This feature of the link layer is called MTU. Most networks of different types have an upper limit. If there is data to be transmitted on the IP layer and the data length is greater than the MTU on the link layer, fragmentation is required on the IP layer to split the data into several parts, in this way, each part is smaller than MTU.
(2) After an IP datagram is split, it is re-assembled by the IP layer at the destination end. The purpose of this process is to make the fragmentation and re-assembly process to the transport layer (TCP/UDP) is transparent. Since each part is an independent package, when the piece of the datagram arrives at the destination end, it may be out of order, but there is enough information in the IP header to allow the receiving end to correctly assemble the piece of the datagram.
(3) Although the IP sharding process Looks transparent, one thing that makes people do not want to use it: even if only one piece of data is lost, the whole datagram should be re-transmitted. Why? Because the IP layer itself does not have a timeout retransmission mechanism ------ a higher level (such as TCP) is responsible for timeout and retransmission. When a piece of data from a TCP packet segment is lost, TCP resends the entire TCP packet segment after the timeout. The packet segment corresponds to an IP datagram (instead of a shard ), there is no way to re-transmit only one data shard in the datagram.
(4) using UDP can easily cause IP sharding. TCP tries to avoid IP sharding. So how does TCP try to avoid IP sharding? To put it bluntly, using the TCP protocol for data transmission will not cause IP fragmentation, because once the TCP data is too large, it exceeds the MSS, TCP packets are segmented at the transport layer (see the following section for details about how to split them !), The data packets at the IP layer will certainly not exceed the MTU, and the parts are not required. For UDP datagram, if the length of an IP datagram consisting of UDP exceeds 1500, the IP datagram must be split, because UDP cannot segment itself like TCP. Conclusion: UDP will not be segmented, so it will be divided by my IP address. TCP will be segmented. Of course, I don't need to split the IP address!
2. the abbreviation of the Maximum Segment Size of MSs (maxitum segment size) is a concept in the TCP protocol (1) MSS is the maximum segment of data that can be transmitted by TCP packets each time. To achieve optimal Transmission Performance, TCP usually needs to negotiate the MSS value of both parties when establishing a connection, this value is often replaced by the MTU value when the TCP protocol is implemented (the size of the IP packet header must be reduced by 20 bytes and the packet header of the TCP data segment is 20 bytes). Therefore, the MSS is usually 1460. Both parties will determine the maximum MSS value for this connection based on the MSS value provided by both parties.

 


 

Data Partition memo for IP protocol

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.