Packet segmentation, IP packet, and frame length constraints

Source: Internet
Author: User

Reposted for study

1,Data Link LayerThere is a limit on the length of the data frame, that is, the maximum data length that the link layer can bear. This value is called the maximum transmission unit (MTU. Taking Ethernet as an example, this value is usually 1500 bytes.

2. for IP packets, there is also a length. In the IP packet header, the length of the IP packet is described in 16 bits, that is, an IP packet, the maximum value may be 65535 bytes (most network devices limit it to 576 bytes ).

3. In combination with the above two concepts, the first important conclusion is that if the size of the IP package exceeds the MTU value, it needs to be split, that is, dividing an IP package into multiple parts, this concept is very easy to understand. If a truck with a 5 TB load needs to pull 10 TB of goods, it certainly scores several times.

4,IP shardingThis is often the content of many materials, but I think it is not important to split parts. What matters is another thing. A data packet passes through a large network, and it passes through multiple networks. The MTU value of each network is different. We can imagine that if both the receiver and the sender are Ethernet and Their MTU is 1500, we assume that at the time of sending,IP data packetsIt will be encapsulated in 1500. However, unfortunately, there is an X.25 network in the transmission, and its MTU is 576. What will happen? I think this is what we care about.

Of course, the conclusion is obvious. This data packet will be split again. We started to pull it by train. When we got halfway through the train, we couldn't get through the train, and we only needed to get through the car, that car would be divided into many cars ...... That's all. More importantly, in this case, if the IP package is set with the "Do Not Allow fragment flag", what will happen? Yes, the packet will be discarded. However, an ICMP (Internet Control Message Protocol, Internet Control Message Protocol) Non-reachable error will be received, telling you that you need to split the packet!

The smallest MTU value in this network is called the path MTU. We should have an effective way to find this value. the most stupid way is to use traceroute to view all nodes and Ping them one by one ......

5. When it comes to the transport layer, there will also be a maximum value limit. Of course, we will not discuss UDP that only sends and does not care about others. TCP is used here. When it comes to the size, it may make people think of the window size of the famous TCP sliding window, which is related to the cache at both ends of the transmission and receiving. Here we discuss the maximum data packet size of the transmission, so, it is not discussed.

In the TCP option field, there is a maximum segment length (MSS, maximum segment size), which indicates the maximum length of data transmitted by TCP to the other end. When a connection is established, both parties to the connection should announce their respective MSS, that is, it is said to be associated with the tcp syn mark. Of course, in terms of transmission, we always hope that the larger the MSS, the better, the more severe the overload is now ...... However, Mss always has a limit, that is, the length of the MTU-IP header-the length of the TCP Header, for Ethernet

It is usually 1500-20-20 = 1460, although it is always expected to be large (such as 1460), but most BSD implementations, It is a multiple of 512, such as 1024 ......

6. Return to the shard. For example, run the following command in Win2000:

"Ping 192.168.0.1-l 1473

As mentioned earlier, if 1473 + 20 (IP header) + 8 (ICMP header) = 1501, it is better than 1500, and it will be split.

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.