Re: per-socket keep-alive options for TCP



Andrew Alcheyev wrote:
I have recently examined the keep-alive mechanism in FreeBSD's TCP
stack and found out that it has no tunable variables for keep-alive on
a per-socket basis.
Is anyone interested in a patch like this one?
http://mail-index.netbsd.org/tech-net/2007/06/19/0001.html

Alternatively, a patch for FreeBSD may introduce a new kernel option.
I would appreciate any suggestions.

Seems reasonable. This thread talks about the Solaris implementation and the general background to keep-alives:
http://jj.tingiris.net/archives/6-TCP_KEEPALIVE-and-SO_KEEPALIVE-on-Solaris.html

And this thread mentions its use in PostgreSQL:
http://qaix.com/postgresql-database-development/336-230-re-implement-support-for-tcp-keepcnt-tcp-keepidle-tcp-keepintvl-read.shtml

I'm a bit wary of importing new features into a sensitive and heavily used module like TCP without regression tests, though, and it should probably default to the current sysctl defaults in use (default to keepalives on for each new tcp socket) for traversing stateful firewalls on the path.

However in this case we are merely introducing new knobs for fine-tuning the keep-alive behaviour, so no big worry here.

Being able to tune on a per-socket basis is *somewhat* useful, however what would be useful in the bigger picture is the ability to tune TCP behaviour based on path selection, where the path currently chosen has radically different characteristics from the general case (e.g. GPRS, UMTS, satellite systems).

Cheers,
BMS
_______________________________________________
freebsd-net@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: Notification when network connection loss...
    ... For sends the tcp stack will retry sending the data 5 times by default. ... This value controls how often TCP attempts to verify that an idle connection ... Keep-alive packets are not sent by default. ... TCP keep-alives can be sent once every ...
    (microsoft.public.windowsce.app.development)
  • Re: Should a socket client detect loss of network connection
    ... Implementors MAY include "keep-alives" in their TCP ... erroneous TCP implementations. ... I have written a socket client and a server. ...
    (microsoft.public.win32.programmer.networks)
  • Re: NAT and keepaliveopen connection over TCP
    ... Implementors MAY include "keep-alives" in their TCP ... There's no minimum set time how long a NAT router should ... time-out inactive connections at the server. ...
    (microsoft.public.win32.programmer.networks)
  • Re: sysctl_tcp_keepalive_time
    ... Implementors MAY include "keep-alives" in their TCP ... Keep-alive packets MUST only be sent when no data or ...
    (Linux-Kernel)
  • Re: what does SocketOptionName.KeepAlive mean?
    ... Why so Dave? ... SocketOptionName.KeepAlive must be associated with a TCP Socket and ... See section 4.2.3.6 TCP Keep-Alives of RFC 1122 for the standardized ... In short, enabling keep-alives causes a packet to be sent every 2 hours, ...
    (microsoft.public.dotnet.languages.csharp)