-1

I am trying to send some KBytes of data trough Ethernet with a proprietary simple raw TCP protocol.

Standard Windows configuration requires two (2) packets received before returning an acknowledge packet, unless you modify the registry with TcpAckFrequency = 1, in which case one received packet is enough to send back the acknowledgement, or otherwise anyway you will get an ACK after TcpDelAckTicks * 100 = 200 ms by default (this is another registry key). This is a problem if I send the data in chunks of less than 1460 bytes, because each chunk will get an acknowledge after 200 ms, and the sender will wait that before sending the next packet. One solution is to send data in pieces bigger than 1460 bytes, so that two packets will be actually sent and ACK received.

But, what about if I want to send smaller packets? Is there a way to configure the socket with setsockopt for not waiting acknowledgment packets before sending the next packet?

Thank you very much in advance.

Faghio
  • 57
  • 4
  • Your claim that 'the sender will wait [for the acknowledgement] before sending the next packet' is not correct if the Nagle algorithm is disabled. – user207421 Oct 29 '13 at 23:52

1 Answers1

0

Turn off the Nagle algorithm at the sender. In C this is the TCP_NODELAY option.

user207421
  • 305,947
  • 44
  • 307
  • 483