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.