Home

keepalives

Keepalives are mechanisms used to verify that a network connection or path remains active between two endpoints. They help detect broken or idle connections, reclaim resources, and assist intermediaries such as routers, proxies, and NAT devices in maintaining state. Keepalives can operate at different layers, including the transport layer and application layer, and may take the form of periodic probes or policy-based messages.

In the transport layer, TCP keepalive is a low-level feature that sends periodic probes if no data

Application-layer keepalives are often implemented as heartbeats or ping/pong messages to confirm liveness even when no

Considerations for using keepalives include network overhead, false positives, security implications (such as potential abuse or

has
been
exchanged
for
a
configured
idle
period.
If
the
peer
fails
to
respond
to
a
probe,
after
a
number
of
attempts
the
connection
is
considered
dead.
Common
parameters
include
the
idle
time
before
probes
start,
the
interval
between
probes,
and
the
maximum
number
of
probes.
Defaults
vary
by
operating
system
and
can
be
adjusted
to
balance
timely
detection
against
network
overhead.
TCP
keepalives
can
prevent
silent
drops
due
to
NAT
or
firewall
timeouts
but
can
increase
unnecessary
traffic
and
risk
premature
termination
in
congested
networks.
user
data
is
being
sent.
Examples
include
WebSocket
ping/pong
frames
and
custom
heartbeat
messages
in
chat
or
game
servers.
HTTP
keep-alive,
or
persistent
connections,
allows
reuse
of
a
single
TCP
connection
for
multiple
requests,
reducing
connection
setup
overhead;
this
is
a
separate
mechanism
from
transport
keepalives
but
complements
connection
longevity
in
HTTP
traffic.
congestion
during
attacks),
and
the
need
for
appropriate
configuration
on
clients,
servers,
and
intermediaries.
Tools
such
as
network
monitors
can
help
diagnose
keepalive
behavior.