(Why) does FreeBSD 'net.inet.tcp.always_keepalive' violate RFC1122?
Rationale for turning keep-alive on by default was given here: https://svnweb.freebsd.org/base?view=revision&revision=47752
Add handle to control global TCP keepalives and turn them on as default.
Despite their name it doesn't keep TCP sessions alive, it kills them if the other end has gone AWOL. This happens a lot with clients which use NAT, dynamic IP assignment or which has a 2^32 * 10^-3 seconds upper bound on their uptime.
There is no detectable increase in network trafic because of this: two minimal TCP packets every two hours for a live TCP connection.
Many servers already enable keepalives themselves.
The host requirements RFC is 10 years old, and doesn't know about the loosing clients of todays InterNet.
Anyway it is better to turn keep-alive off if requested by application, for example (in C):
int val = 0;
setsockopt(s, SOL_SOCKET, SO_KEEPALIVE, &val, sizeof(val));
but it is not easy to fix this.