Networking – How does TCP get the MSS values for a certain path

networkingtcp

when a TCP client initiates a TCP connection with a remote TCP server, it will announce its MSS in the TCP option.

I'm at a loss how TCP knows the path MSS value. This value is specific to the path between the client and the server, and generally speaking, path MTU detection can be used to get the value, but that will be before TCP SYN packet is sent and will cause some delay.

So, in practice, how does TCP get the MSS values for a certain path?

Best Answer

TCP must make an initial guess at the MSS, which will be the MTU of the local interface through which the SYN is about to be sent, minus the appropriate constant to account for the IP header.

Thereafter it may learn a smaller MSS value through one of the following means:

  • A smaller MSS announced by the other peer
  • path MTU detection (ICMP packet-too-big messages)

Once it learns such a reduced value, it can cache it for a while and use it as the initial MSS for future connections to the same remote address.

Related Question