0

Which TCP Options can I set for outgoing TCP packets on unprivileged socket (not raw) in a Linux C program? I refer to TCP Options in TCP Header.

I've checked http://linux.die.net/man/7/tcp so for now I can add/edit:

MSS, Timestamp, Window Scale, Sack, Fast Open (see answer below)

Is there a way to add other options? I'm especially interested in Multipath but any option will be helpful.

Thank you!

the structure
  • 89
  • 1
  • 10

1 Answers1

1

TCP Fast Open can be used with the MSG_FASTOPEN flag e.g.:

sendto(fd, data, len, MSG_FASTOPEN, ...

Note that it must be supported by the server side - on Linux this can be done with:

echo 2 > /proc/sys/net/ipv4/tcp_fastopen

There's a handy reference here

superTyphoon
  • 150
  • 8