-1

I have an issu with my device when I connect by TCP sockets, because the client send the MSS in the SYN connection and the server (my device) is setting with the same MSS, but I don't want set this MSS in my device.

So how can I force setting this value in the MSS?

I tried setting the MTU value with the setsockopt function with the IP_DONTFRAG

  • Mobile devices often ignore socket options, like send and receive buffer size, MTU and MSS. The carriers simply don't let you override their choice of parameters. You probably need to use Android and a mod, like Cyanogenmod. – jww Aug 24 '18 at 20:54

1 Answers1

1

You should be able to call setsockopt with the TCP_MAXSEG option to set the TCP maximum segment size. Take a look at tcp(4) for the available options. You probably have to set the option before connect or listen.

As for setting the IP MTU, the IP_DONTFRAG option will cause the packet to be dropped if a segment has a smaller MTU. The IP layer should negotiate to a reasonable MTU value by retransmitting a smaller packet after receiving a "fragmentation needed" response. TCP segments and IP packets are at different layers of the protocol stack -- in other words, a single TCP segment can span multiple IP packets. Changing the size of the IP packet does not effect the size of the TCP segment.

D.Shawley
  • 58,213
  • 10
  • 98
  • 113