-->
Page 1 of 2

TCP long delay before re-transmission

PostPosted: Thu Aug 08, 2019 9:37 am
by ponasP
I have a setup where a PC (windows 8) sends a one byte request to a server running on esp module and esp module then returns a 321 byte message. The problem is when the packet is lost, it seems that it takes around a second for the esp to re-transmit the message. Naggle is disabled. Is it expected? Is there some sort of time out before the re-transmission occurs? Can this be changed? See the wireshark exerpt.
wireshark.png

Re: TCP long delay before re-transmission

PostPosted: Fri Aug 09, 2019 6:51 am
by rudy
There is no specified time before a resend but three seconds is a typical value I have seen when looking at TCP re-transmission.

Re: TCP long delay before re-transmission

PostPosted: Fri Aug 09, 2019 8:23 am
by ponasP
Can this resend time-wait be adjusted? It seems that there are some parameters associated with this in lwip/opts.h, but I guess these options are compiled into the lwip library.

In application the data from esp has to be sent to my client almost real-time, delays should be less than <0.5second. My buffer is also not able to store more than a second of data.

rudy wrote:There is no specified time before a resend but three seconds is a typical value I have seen when looking at TCP re-transmission.

Re: TCP long delay before re-transmission

PostPosted: Fri Aug 09, 2019 4:00 pm
by rudy
I have not looked at faster TCP options.

With games, TCP is too slow for quickly changing events. And what is often done is using UDP with multiple sends. A message ID count is used to determine if it has already been received. If it has it throws away the duplicate messages. Typically three messages are sent (with slight delays) and that should take care of any recoverable situations.