A NEW TODAY IS DAWNING!

TB0030 - TCP/IP KEEPALIVE Settings

Number: TB0030

Availability: All Platforms as of 8.02.01


Introduction

A problem has been identified where TCP/IP Keep-Alive Timeouts occur when a BuildProfessional Windows Client is idle for an extended period. These settings may need to be adjusted if the Windows Client is connecting over corporate WANs and firewalls.

Background

The KEEPALIVE option of the TCP/IP Protocol ensures that connections are kept alive even while they are idle. When a connection to a client is inactive for a period of time (the timeout period), the operating system sends KEEPALIVE packets at regular intervals. On most systems, the default timeout period is two hours (7,200,000 ms). If the network hardware or software drops connections that have been idle for less than the two hour default, the Windows Client session will fail. KEEPALIVE timeouts are configured at the operating system level for all connections that have KEEPALIVE enabled.

If the network hardware or software (including firewalls) have a idle limit of one hour, then the KEEPALIVE timeout must be less than one hour. To rectify this situation TCP/IP KEEPALIVE settings can be lowered to fit inside the firewall limits. The implementation of TCP KEEPALIVE may vary from vendor to vendor. The original definition is quite old and described in RFC 1122.

NOTE. The use of Keep-alive was not consistent across platforms prior to BuildProfessional 8.02.01. Specifically SUN and HP were not did not have keep-alive enabled on all connections.
Minimizing Client/Server Disconnects due to Dropped Connections

There are three KEEPALIVE parameters (the name may be slightly different across platforms):

  1. tcp_keepalive_time. The tcp_keepalive_time parameter tells the TCP/IP stack how often to send TCP keepalive packets to keep an connection alive if it is currently unused. Default is 7,200 seconds (2 hours).
  2. tcp_keepalive_intvl. The tcp_keepalive_intvl parameter tells the kernel how long to wait for a reply on each keepalive probe. Default is 75 seconds.
  3. tcp_keepalive_probes. The tcp_keepalive_probes parameter tells the kernel how many TCP keepalive probes to send out before it decides a specific connection is broken. Default is 9. On some systems, this is a total time, not number of probes.

When a connection is idle, the kernel waits tcp_keepalive_time before sending keepalives. The kernel then waits tcp_keepalive_intvl for a response or to send another keepalive. Finally if no response is received for tcp_keepalive_probes number of probes, the connection is terminated.

Setting tcp_keepalive_time to 30-45 minutes will resolve most issues of dropped connections.

Setting KEEPALIVE Parameters

Use the following commands for displaying and changing parameters.

Note: Whilst every endeavour has been made to accurately identify commands, these should be validated prior to use.
 

HP 11.0

1. ndd -get /dev/tcp tcp_keepalive_interval
Result is in milliseconds (Default 2hrs)

2. ndd -get /dev/tcp tcp_time_wait_interval
Result is in milliseconds (Default 1min)

3. Ensure that this value is below 1 hour.
ndd -get /dev/tcp tcp_keepalives_kill

To set tcp parameters:
ndd -set /dev/tcp <tcp_parameter> <value>


AIX 5.2

1. no -L tcp_keepidle
Result is in half seconds (default is 2hrs)

2. no -L tcp_keepintvl
Result is in half seconds (default is 75 seconds)

3. no -L tcp_keepcnt
Result is number of probes (default is 8)

To set tcp parameters:

no -r -o <tcp_parameter>=<value> no -r -o tcp_sendspace=32768


SUN 5.8

1. NOTE No setting for "Parameter wait time before probing the connection"

2. ndd -get /dev/tcp tcp_keepalive_interval
Result is in milliseconds (Default is 2hrs).

3. NOTE: No setting for "Parameter maximum time or tries to probe connection before dropping"

To set tcp parameters:
ndd -set /dev/tcp <tcp_parameter> <value>


Linux (RHEL 3)

1. sysctl -a | grep tcp_keepalive_time
Result is in seconds (default is 7200 or two hours)

2. sysctl -a | grep tcp_keepalive_intvl
Result is in seconds (default is 75 seconds)

3. sysctl -a | grep tcp_keepalive_probes
Result is in number (default is 9)

To set tcp parameters:

sysctl -w <tcp_parameter>=<value>


WINDOWS (All)

Only required when the BuildProfessional Server is on Windows. This setting need not be changed on every client.

Seek assistance on setting KeepAliveTime in the registry. Default is two hours.