1

I'm doing some experiments with path MTU discovery in Linux - TCP connection,Client and server are configured with different MTU.(MTU 1500 and 1000 respectively).

after TCP_CONNECT between server and client, i observe the MTU configured in client as follows using below command.

  getsockopt(iSocketId,IPPROTO_IP,IP_MTU,(char *)&socket_mtu, &size);
  printf("MTU --> %d\n",socket_mtu); 

I believe that getsocketopt return "Path MTU" and not the MTU of the client.

But i receive MTU - 1500 (Client MTU) instead of Path MTU : 1000.

Please give some idea to get PATH MTU using getsockopt.Examples are really appreciated.

Thanks in advance.

sujai M J
  • 1,231
  • 3
  • 11
  • 14

1 Answers1

3

You may like to read how Path MTU Discovery works.

Path MTUs can be asymmetrical with different MTU value in different directions.

The fact that you set a low MTU on the client does not mean it cannot receive larger sized datagrams, it only means that it cannot send it.

Maxim Egorushkin
  • 131,725
  • 17
  • 180
  • 271
  • It doesn't even mean that. It's TCP. There are no datagrams. There are TCP segments, which are unconstrained except by word width, and IP packets, which are constrained by MTU. – user207421 Mar 16 '15 at 09:31
  • @EJP This is IP datagrams whose payload size MTU specifies. TCP segements are carried inside IP datagrams and the maximum payload for TCP is a different parameter called MSS. Notice `IPPROTO_IP` socket option. – Maxim Egorushkin Mar 16 '15 at 09:36