简体   繁体   中英

Path MTU Discovery using Socket option - IP_MTU & IP_MTU_DISCOVER

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM