1, MTU (Maximum Transmission Unit, MTU), Maximum Transmission Unit
(1) Both Ethernet and 802.3 have a limit on the length of data frames, with a maximum of 1500 and 1492 bytes respectively. This characteristic 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 transmit, and the length of the data is greater than the MTU of the link layer, then the IP layer has to perform fragmentation, dividing the datagram into a number of slices, so that each slice is less than the MTU.
(2) After an IP datagram is fragmented, it is reassembled by the IP layer that reaches the destination end, which is intended to make the fragmentation and reassembly process more efficient for the transport. The purpose is to make the fragmentation and reassembly process transparent to the transport layer (TCP/UDP). Since each slice is a separate packet, it is possible for these 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 datagram slices correctly.
(3) Although the IP slicing process seems transparent, there is one thing that makes people not want to use it: retransmitting the entire datagram even if only one slice of data is lost. why? Because the IP layer itself does not have a timeout retransmission mechanism ------ It is the higher layers, such as TCP, that take care of the timeout and retransmission. When a piece from a TCP message segment is lost, TCP retransmits the entire TCP message segment after a timeout, which corresponds to an IP datagram (not a slice), and there is no way to retransmit only a slice of the data in the datagram.
(4) Using UDP can easily lead to IP fragmentation, which TCP tries to avoid. So how does TCP try to avoid IP fragmentation? In fact, to put it bluntly, the use of TCP protocol for data transmission does not cause IP fragmentation, because once the TCP data is too large, more than the MSS, then in the transport layer will be segmented TCP packets (how to split, see below!) Naturally, the datagrams that reach the IP layer will certainly not exceed the MTU, and of course will not need to be fragmented. For UDP datagrams, if the length of the IP datagram composed of UDP exceeds 1500, then the IP datagram will obviously have to be sliced, because UDP can not segment itself like TCP. To summarize: UDP won't segment, so it's up to my IP to do it. tcp will segment, so of course it doesn't have to be up to my IP to do it!
2, MSS (Maxitum Segment Size) Maximum Segment Size acronym, is a concept within the TCP protocol (1) MSS is the TCP packet each time you can transmit the maximum data segmentation. In order to achieve optimal transmission performance TCP protocol in the establishment of the connection is usually negotiated between the two sides of the MSS value, the value of the TCP protocol in the realization of the MTU value is often used instead (need to subtract the size of the header of the IP packet 20Bytes and the header of the TCP data segment of the packet 20Bytes), so often the MSS is 1460. communication between the two sides will be based on the two sides to provide the value of the MSS The minimum value is determined as the maximum MSS value for this connection.
(2) I believe that to see here, there is a final question: How does TCP realize the segmentation? In fact, TCP does not matter segmentation, because each TCP datagram in the composition of its size before the MSS has been limited, so the length of the TCP datagram is not greater than the MSS, of course, by which the length of the formation of IP packets will not be greater than the MTU, and naturally do not need to be IP sliced