TCP Keep-Alive Messages

A Keep-Alive telegram is a confirmation message or an acknowledge. This makes it possible to check in the background whether a communication partner who has established a connection is still active and thus still participating in the communication. If a communication partner is no longer active, the communication channel is closed cleanly and regularly to be free for a new participant.

Keep-Alive under Windows

Keep-Alive can be configured under Windows by the keys "KeepAliveTime" and "KeepAliveInterval" in the registry. The default value for the keep alive time is set to two hours, the interval time, i.e. the time until a non-answered alive request is repeated, is set to one second by default. All values are given in milliseconds. If the corresponding keys do not already exist in the registry, they must be created as follows.

TCP Keep-Alive Messages 1:

These are not TwinCAT settings, but specific settings of the operating system. Further information can therefore be found in the operating system documentation, for example, on the Microsoft website.

Under Windows W2K, XP, Windows Embedded Standard:

Under Windows CE:

TCP Keep-Alive Messages 2:
TCP Keep-Alive Messages 3:

Keep-Alive under TC/BSD

The "sysctl" parameters are used by the operating system to configure TCP Keep-Alive messages.

> sysctl -d net.inet.tcp | grep -e keep

net.inet.tcp.keepidle: time before keepalive probes begin

net.inet.tcp.keepintvl: time between keepalive probes

net.inet.tcp.keepinit: time to establish connection

net.inet.tcp.keepcnt: Number of keepalive probes to send

net.inet.tcp.always_keepalive: Assume SO_KEEPALIVE on all TCP connections

Sample:

keepidle is set to 4000 (ms) and keepintvl to 4000 (ms).

sysctl net.inet.tcp.keepidle=4000

sysctl net.inet.tcp.keepintvl=4000

Permanent (persistent) configuration of TCP Keep-Alive messages is done in the file /etc/sysctl.conf.

See also here: https://www.freebsd.org/cgi/man.cgi?query=tcp