Re: Regarding Keep-Alive doubt

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Apr 19, 2004 at 15:59:51 +0530, Vishal wrote:
>    Hi Linux Pals,
> 
> 
>    We have a tcp keepalive options in the kernel, like when i do "cat /proc/sys/
> 
>    net.ipv4.tcp_keepalive_time"   = 7200 (sec)
>    net.ipv4.tcp.keepalive_probes" = 9 
> 
> 
>    What i understand is that kernel's default time to keep the connection live is 2 hours and kernel sends total
>    of 9 packets in interval of 12 minutes and 15 seconds before assuming the connection is dead.
> 
>    As far as i belived that we use keep Alive at application level (HTTP).  i.e if client request the connection to be kept alive,
>    this is implemented in the server and then accordinging we close the socket.
>    But this says that before assuming the connection is dead, kernel probes 9 times in the duration of 2 hours and then if 
>    there is no response, kernel closes the socket.

You seem to mess two things together!

HTTP KeepAlive (application layer) means the socket should stay open
after completing the request for a specified amount of time. And it just
will.

TCP KeepAlive (link layer) means, that, in absence of other traffic, the
TCP stack sends empty packets, just to see, if the other end is still
there.

*IF* those probes are not acked within some time, kernel considers that
connection broken, declares it as such to the application and frees the
port.

Now the settings you talk about are about the TCP KeepAlive. They say
"send 9 probes in 2 hours and IF THEY ALL FAIL close the connection".

As long as there is no network outage, your connection to HTTP server
will stay alive, because the probes are promptly acknowledged by the
other end.

-------------------------------------------------------------------------------
						 Jan 'Bulb' Hudec <bulb@ucw.cz>

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux