TCP keep alive and socket termination
Hi,
If there is an ESTABLISHED TCP socket over any interface, and the underlying interface is brought down (ifconfig <ifname> down), then the TCP keep-alive mechanism comes to rescue (this however requires turning on the SO_KEEPALIVE socket option). The keep-alive mechanism will probe whether the connection is alive or not after keepalive intervals. (configurable through /proc/sys/net/ipv4/tcp_keepalive_*). I have set the probes to 16 and interval as 1. But if some data is pumped over this socket after bringing the interface down and when the probing mechanism is in progress, then it gets buffered in the TCP send queue and stays there till the connection breaks. My problem is that, in such scenario, the keep alive mechanism takes too long (say 15-20 mins with this configuration) to terminate the connection which would otherwise take a few seconds. So, can anyone please let me know on how to get rid off the buffered bytes in the send queue and terminate the connection as per the configuration (keep alive probes and timeout interval). Regards, gdkool |
Can you tell us what setting you used for tcp_keepalive_time ? .. this configures how many seconds to wait after the last data packet before sending any probes
cheers |
Quote:
Regards gdkool |
I wasn't talking about tcp_keepalive_intvl, as per my previous post - have you set tcp_keepalive_time ? ... please see this link:
http://tldp.org/HOWTO/TCP-Keepalive-...keepalive.html cheers |
That too was set to 1 sec.
Quote:
|
You may need to run a sniffer to see what's happening, do you have tcpdump or ethereal/wireshark installed ?
|
Thanks for your update... I will check it out and then update..
Quote:
|
All times are GMT -5. The time now is 02:00 AM. |