Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set TCP_QUICKACK and TCP_NODELAY

Tags:

If you set the TCP_QUICKACK setting on every call on the socket, having previously set TCP_NODELAY, will the QUICKACK option overwrite the NODELAY call?

On connect:

int i = 1; setsockopt( iSock, IPPROTO_TCP, TCP_NODELAY, (void *)&i, sizeof(i)); 

On each write:

int i = 1; setsockopt( iSock, IPPROTO_TCP, TCP_QUICKACK, (void *)&i, sizeof(i)); 

Will the call to TCP_QUICKACK null the previous call to TCP_NODELAY?

like image 760
donalmg Avatar asked Sep 02 '11 16:09

donalmg


1 Answers

There's no direct relationship between those two options, they are just for different purposes.

TCP_NODELAY is intended to disable/enable segment buffering so data can be sent out to peer as quickly as possible, so this is typically used to improve network utilisation. TCP_QUICKACK is used to send out acknowledgements as early as possible than delayed under some protocol level exchanging, and it's not stable/permanent, subsequent TCP transactions (which may happen under the hood) can disregard this option depending on actual protocol level processing or any actual disagreements between user setting and stack behaviour.

NOTE TCP_NODELAY is portable while TCP_QUICKACK is not (only works under Linux 2.4.4+).

like image 161
Fei Avatar answered Oct 11 '22 18:10

Fei