The difference between IP fragmentation and TCP segmentation

Source: Internet
Author: User
the difference between IP fragmentation and TCP segmentation

1, MTU (Maximum transmission UNIT,MTU), Maximum transmission unit
(1) Ethernet and 802.3 have a limit on the length of the data frame, with a maximum value of 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 pass, and the length of the data is larger than the MTU of the link layer, then the IP layer will be fragmented (fragmentation), the datagram into several slices, so that each fragment is less than the MTU.
(2) After the partition of an IP datagram, it is reassembled by the IP layer at the end of the destination, the purpose of which is to make the slicing and reassembly process transparent to the transport layer (TCP/UDP). Since each fragment is a separate package, it is possible for the datagram slices to be out of order when they reach the destination, but there is enough information in the IP header to allow the receiver to assemble the datagrams correctly.
(3) Although the IP fragmentation process appears transparent, there is one thing that people do not want to use: even if only one piece of data is lost, the whole datagram will be sent back. Why Because the IP layer itself does not have a timeout-transfer mechanism-it is up to the higher levels (such as TCP) to be responsible for timeouts and retransmissions. When a piece of TCP segment is lost, TCP sends out the entire TCP segment after timeout, which corresponds to an IP datagram (rather than a fragment), and there is no way to retransmit only one data fragment in the datagram.
(4) The use of UDP can easily lead to IP fragmentation, TCP attempts to avoid IP fragmentation. So how does TCP try to avoid IP fragmentation? In fact, the use of TCP protocol for data transmission will not cause IP fragmentation, because once the TCP data is too large, over the MSS, the TCP packet at the transport layer will be segmented (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 is obviously going to be fragmented because UDP cannot segment itself like TCP. Summary: UDP does not fragment, by my IP to divide. TCP will segment, of course, do not need my IP to divide.
2, the acronym for the maximum Fragment size of MSS (maxitum Segment size) is a concept within the TCP Protocol (1) MSS is the maximum data fragment that TCP packets can transmit at a time. In order to achieve optimal transmission efficiency the TCP protocol usually negotiates the MSS value of both parties when establishing a connection, This value TCP protocol is often implemented with the MTU value instead (need to subtract the size of the IP packet header 20Bytes and TCP data segment of the Baotou 20Bytes) so often MSS is 1460. The two sides of the communication will determine the maximum MSS value for this connection based on the MSS provided by the two sides worth the minimum value.
(2) Believe to see here, there is one last question: How TCP realizes the segmentation. In fact, TCP does not care about segmentation, because each TCP datagram before the composition of its size has been limited by MSS, so the length of the TCP datagram is not greater than the MSS, of course, the IP packet formed by the length of it will not be greater than the MTU, and naturally do not use IP fragmentation

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.