[CLUE-Tech] Linux TCP sockets SYN -> long delay waiting for tcp_syn_retries

David Anselmi anselmi at anselmi.us
Sat Oct 2 18:08:49 MDT 2004


Sorry I'm not much help...

You didn't say what telnet you're using and there seem to be several for 
Linux.  Perhaps you can find a "better" one or one that allows you to 
configure the part that's causing problems.

Jim Ockers wrote:
[...]
> According to ethereal here's what happens for the Windows attempt:
> 
> SYN is sent to 6.7.8.9:23
> RST is received from 6.7.8.9:23
> SYN sent
> RST received
> SYN sent
> RST received
> ...then the telnet command returns and the error message above is 
> printed.  Elapsed time is 8-9 seconds.

What's the time between SYNs (all the same or using a back-off algorithm)?

> According to ethereal the same sequence of events happens for the
> Linux telnet, but the SYN/RST happens 5 times.  This is the default
> number of retries in /proc/sys/net/ipv4/tcp_syn_retries and is fine.  
> Plus we can change it to a smaller number if we want.
> 
> The real problem is the timing - the RST is received within 2-3 
> seconds of the SYN being sent, but it takes 3 minutes and 9 seconds 
> for the telnet application, tcp/ip stack, or kernel to close the 
> socket so the telnet process exits.

What's the SYN timing for this one?  You didn't say how long the delay 
is between the last RST and the app exiting.  If it is small it would 
seem to be a TCP stack issue (that you may be able to work around with 
the right options).  If it is long then the bug is in the telnet code 
and you need to debug it to find the cause and whether there might be a 
reason for it (or use different code).

Seems broken that something would wait a long time after being told a 
port is closed.  But it seems broken that several SYNs would be sent 
after a RST ('course I don't know nuthin bout the TCP specs).

Dave



More information about the clue-tech mailing list