TCP Keep Alive probes

G

grant_holler

Hi All,

I have a java client app and want to send TCP Keep Alive probes to my
server every 10 minutes as opposed to the default 2 hours. I see a
setKeepAlive() call in the API, but that only turns on whether you want
to send Keep Alives or not. How do i specify the Keep Alive probe
interval?

Thanks,

Grant.
 
T

Thomas Weidenfeller

Hi All,

I have a java client app and want to send TCP Keep Alive probes to my
server every 10 minutes as opposed to the default 2 hours. I see a
setKeepAlive() call in the API, but that only turns on whether you want
to send Keep Alives or not. How do i specify the Keep Alive probe
interval?

(a) TCP keep-alive is not what you think it is. It is a mechanism to
keep the TCP connection below the application alive (prevent that
timeouts kill the idle connection). It is not a mechanism to verify the
application layer end-to-end. E.g. the TCP/IP stack below a
server-process that hangs still processes the superfluous segments and
ACKs them, thus keeping the TCP connection alive while the server in
fact no longer works. On the other hand, missing keep-alive ACKs can't
be interpreted as connection failure, since empty ACKs are not reliable.

(b) The standard requires a minimum(!) of 2 hours. Any implementation
supporting smaller intervals is broken.

(c) Consider implementing a heartbeat on the application layer if you
really need to reliably know that your server-application is alive .

(d) If you work with a heartbeat consider doing it separately from your
application connections and instead use some separate management
protocol.

(e) If you don't need to know that your server is alive all the time,
just don't care about a connection. If you need to connect to the server
and you still have an open connection use it. If not, don't make a big
fuss and just establish a new one. Keeping connections alive for no
apparent reason is just a waste of network resources. So only have
connections to the server if you need one.

/Thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top