The Maximum Transmission unit (Maximum transmission Unit,MTU) refers to the maximum packet size (in bytes) that can be passed on a layer of a communication protocol. The network in the data link layer has a limit on the length of the data frame, the MTU value of different networks is different, the commonly used Ethernet is 1500 bytes.
If the datagram size to be transmitted at the IP layer is larger than the MTU of the link layer, then the IP layer will fragment the datagram. A datagram is divided into slices, each with a size less than or equal to the MTU value of the link layer.
After the IP datagram is fragmented, it can only be reassembled at the destination (where reassembly is assembled at the destination, rather than re-assembled at the next station as other network protocols), The Shard and assembly of the IP datagram occurs at the network layer, which is designed to enable the Shard and assembly process to the transport layer (TCP and UDP) is transparent and prevents some possible performance degradation. Datagrams that have been fragmented may be fragmented again (multiple shards are possible).
When the IP datagram is fragmented, only the first Shard has a Transport layer protocol header, the remaining shards do not contain the header of the Transport Layer protocol, but each shard has an IP header, and each piece becomes a grouping, and each group is independent of the other groupings when routing is selected. Because the groupings are independent, the IP datagrams for the shards are not necessarily in order to reach the destination, but the IP header of each shard enables the receiving side to assemble these IP datagram shards in the correct order.
The maximum segment length (Maximum Segment Size,MSS) is the maximum data segment that TCP packets can transmit at a time. When the length of TCP packets is larger than MSS, TCP packets need to be segmented.
MSS is the TCP three handshake to establish a connection between the two ends of the host is calculated, the TCP header will be written to the MSS option, tell the other side of the interface can adapt to the size of the MSS. In order to achieve optimal transmission efficiency the TCP protocol usually negotiates the MSS values of both sides when establishing a connection, and then chooses a smaller value between the two to limit the size of the transmitted data. TCP headers are in each segment of the packet, and the TCP header is reorganized at the transport layer after the endpoint (that is, the fragmentation and reassembly of TCP occurs at the transport layer).
The use of TCP protocol for data transmission is not caused by IP shards, because once the TCP data exceeds the MSS, the transport layer will be the TCP packet fragmentation, naturally to the IP layer of the datagram will certainly not exceed the MTU, so there is no fragmentation. For UDP datagrams, if the UDP IP datagram length exceeds the MTU, then the IP datagram is obviously fragmented because UDP cannot fragment itself as TCP. TCP in the transport layer is fragmented, and the IP in the network layer is fragmented. The Shard of the IP layer is more for the transport layer of UDP service, because TCP itself will avoid the IP shard, so the use of TCP transmission at the IP layer will not occur fragmentation phenomenon.
The IP layer does not have a time-out retransmission mechanism, so the entire IP datagram must be re-transmitted when the Shard of the IP datagram is lost. The timeout and retransmission mechanisms are implemented by higher levels (TCP has a timeout retransmission mechanism, but UDP does not). When a piece from a TCP packet is lost, TCP sends the entire TCP message segment after timeout, which corresponds to an IP datagram. There is no way to retransmit only one datagram in the datagram.
Resources:
"TCP/IP detailed"
"Graphic TCP/IP"
TCP Segment and IP shard
IP Shard and TCP Segmentation of Network protocol