How to identify the MTU in network layer as there is fragmentation happening in transport layer due to TCP/IP?
It is easy to gather MTU information from Transmission Control Protocol (TCP) and User Datagram Protocol (UDP) within transport layer by modifying the parameters. However, it is not guaranteed that IP packets would not be fragmented even MTU has been identified.
Although it is difficult to find out the minimum transmission unit of the path between two parties, the TCP protocol decided to use its own method to figure it out.
When TCP uses the Maximum Segment Size (MSS) option for handshaking, these two parties exchange their MSSs, and agree to use the smaller one between these two MSSs, but this method is not effective.
For example, the client MTU = 1500, the server MTU = 1500, and the MSS = 1460 on both sides. Two of them will be negotiated as 1460 bytes for transmission of TCP segments.
For another case, if the client is using ISP’s PPPoE dial-up, 8 byte will be utilized as header of the packet. As a result, the MTU = 1500 -8 =1492, then the client’s and servers’ 1500 byte IP packets will eventually be fragmented.
How to detect the minimum transmission unit in a path?
We just need to modify Don’t Fragment (DF) bit = 1, so it will not able to fragment in case of necessary and an error message will be sent to the source. The source host will learn the value of minimum transmission unit then the source host's IP layer will record a special host route. This host route leads to a unique destination and labels its minimum transmission unit so that it can communicate with the destination host with such minimum transmission unit.
This solution maybe suitable but communication obstacles may appear due to some devices has been disabled the ICMP error notification function, dynamic path MTU detection.
As standardized MTU for Windows 10 is 1300, this may became a solution to avoid fragmentation of 99%+ network scenarios.