Packet Loss Analysis for MSS, MTU, and iOS

Source: Internet
Author: User

MSS and MTU, iOS Packet Loss Analysis [background knowledge] MTU: Maxitum Transmission Unit maximum Transmission Unit MSS: Maxitum Segment Size Maximum Segment Size (even literal translation, poor translation, PPPoE: PPP Over Ethernet (carrying the PPP protocol Over Ethernet) [analysis process] First, let's talk about the maximum transmission unit of MTU, this maximum transmission unit is actually closely related to the link layer protocol. Let's take a closer look at the EthernetII Frame Structure DMAC + SMAC + Type + Data + CRC due to the electrical limitations of Ethernet transmission, each Ethernet frame has a minimum size of 64 bytes and a maximum size of 1518 bytes. For an Ethernet frame smaller than or greater than this limit, we can regard it as a wrong data frame, generally, Ethernet forwarding devices discard these data frames. (Note: data frames smaller than 64 bytes are generally produced by "Fragmentation" caused by Ethernet conflicts, line interference, or bad Ethernet interfaces, for data frames larger than bytes, we generally call it a Giant frame, which is generally generated due to line interference or bad Ethernet ports. Because the maximum data frame of Ethernet EthernetII is 1518Bytes, deplane the frame header of an Ethernet frame (DMAC destination MAC address 48bit = 6 Bytes + SMAC source MAC address 48bit = 6 Bytes + Type domain 2 bytes) 14Bytes and frame-end CRC verification Part 4 Bytes (this department is also called the FC sometimes ), then the rest of the places that carry the upper-layer protocol, that is, the maximum Data domain can only have bytes, which we call MTU. This is where the network layer protocol is very concerned, because the network layer protocol, for example, the IP protocol, determines whether to split the data transmitted from the upper layer based on this value. It is like a box that cannot hold a big chunk of bread. We need to cut the bread into slices and put it in multiple boxes. When two remote PCs are interconnected, their data must pass through many routers and a variety of network media to reach the peer end. The MTU of different media in the network is different, it is better than a long pipe, which is composed of different water pipes of different thickness (different MTU). The maximum water volume of the pipe is determined by the finest water pipe in the middle. For the upper-layer protocols at the network layer (we take the TCP/IP protocol family as an example), they do not care about the pipe width. They think this is the network layer. The Network Layer IP protocol checks the size of each packet from the upper layer protocol, and determines whether to perform "sharding" based on the MTU size of the local machine. The biggest disadvantage of sharding is that it reduces the transmission performance. The tasks that can be done once are divided into multiple tasks. Therefore, a higher layer (that is, the transport layer) at the network layer is achieved) you will pay attention to this! For some reason, some high-rise personnel may require that I cannot slice this bread. I want a full bread, so I will add a label in the IP packet header: DF (Donot Fragment ). In this way, when the IP packet is transmitted in a large network (in the pipe), if the MTU is smaller than the IP packet, the forwarding device will discard the packet as required. Then, an error message is returned to the sender. This will often cause some communication problems, but fortunately most network links are MTU1500 or greater than 1500. For UDP, this protocol itself is a connectionless protocol, which does not concern much about the arrival sequence of data packets and whether the packets arrive correctly. Therefore, UDP applications generally have no special requirements on fragment. The TCP protocol is different. This protocol is a connection-oriented protocol. For TCP, it is very concerned about the arrival sequence of data packets and whether errors occur during transmission. Therefore, some TCP applications have requirements on fragment-they cannot fragment (DF ). Let's talk about the story of MTU. Today's second pig-PPPoE is a so-called PPPoE that runs the PPP protocol over Ethernet. Someone is wondering, are PPP and Ethernet both link layer protocols? Why does one link layer go to another link layer? Cannot it be upgraded to a network layer protocol. In fact, this is a misunderstanding: a certain layer of Protocol can only carry a higher layer of protocol. Why is this strange demand? This is because with broadband access (this type of broadband access is generally Cable Modem, xDSL, or Ethernet Access) due to the lack of authentication and billing mechanisms for Ethernet, the traditional operator uses the PPP protocol to authenticate and charge for dial-up and other access services, so this is a freak: PPPoE. (For more information about PPPoE, see the Introduction articles provided by Party V and other members of this site. I will not mention this article.) PPPoE brings benefits and some disadvantages, such: secondary encapsulation consumes resources and reduces transmission efficiency. The biggest disadvantage is that PPPoE reduces MTU by 1500, the overhead (8 Bytes) of the end of the PPP packet header is reduced to 1492. If PPPoE is used in a network segment between the two hosts, some applications that cannot be split cannot communicate. At this time, we need to adjust the MTU of the host to reduce the MTU of the host so that we can smoothly communicate with each other. Of course, there are other solutions for TCP applications. Please leave the third pig today: MSS. The abbreviation of the Maximum Transmission size of MSS is a concept in TCP. MSS is the maximum data segment that TCP data packets can transmit 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. After introducing these three pig's, let's look back at the question in the preface. Let's think about it, if we adjust the maximum MSS of each TCP connection on the intermediate router so that the maximum mss value of the PPPoE link plus the end Of the data packet header will not exceed the MTU size of PPPoE 1492, this will not cause communication failure. therefore, the above problem can be solved through ip tcp adjust-mss 1452. Of course, the problem can also be solved by modifying the MTU of the PC. The size of the iosTCP header is 32 bytes.

Related Article

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.