Monday, June 7, 2010

tcp keepalive interval


$cat /proc/sys/net/ipv4/tcp_keepalive_intvl
75
$


tcp_keepalive_intvl
the interval between subsequential keepalive probes,
regardless of what the connection has exchanged in the meantime


linux/net/ipv4/tcp.c - 8 identical
368: * MUST default to no keep-alives. (does)
369: * MUST make keep-alive interval configurable. (does)
370: * MUST make default keep-alive interval > 2 hours. (does)

tcp_timer.c - 3 identical
55: #include
56: #include
57: #include
307: /*
308: * The keepalive packet must have nonzero length
309: * to get a 4.2 host to respond.
www.psc.edu/networking/ftp/tools/netbsd1.1_sackmods.tar - BSD - C



RFC related.

TCP Keepalive Interval Option
This option specifies the interval (in seconds) that the client TCP
should wait before sending a keepalive message on a TCP connection.
The time is specified as a 32-bit unsigned integer. A value of zero
indicates that the client should not generate keepalive messages on
connections unless specifically requested by an application.
The code for this option is 38, and its length is 4.
Code Len Time
+-----+-----+-----+-----+-----+-----+
| 38 | 4 | t1 | t2 | t3 | t4 |
+-----+-----+-----+-----+-----+-----+

source :

http://www.jeffrin.in/wp-content/uploads/2010/06/draft-ietf-dhc-options-1533update-00.pdf