IP shards and TCP Shard MTU and MSS

Source: Internet
Author: User

The concept of fragmentation is a bit unclear in the early stages, see a good article, Mark

This article transferred from: http://blog.csdn.net/keyouan2008/archive/2010/08/27/5843388.aspx

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 at the time of implementation is often replaced with the MTU value (need to subtract the IP packet header size 20Bytes and TCP data Segment header 20Bytes) so often MSS for 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 packets formed by it will not be greater than the MTU, nature will not use IP shards.

IP shards and TCP Shard MTU and MSS

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.