Information About TCP Keepalive Timer

Restrictions for TCP Keepalive Timer

The TCP Keepalive timer parameters can be configured only on vty and TTY applications.

Information About TCP Keepalive Timer

TCP Keepalive Timer

The TCP Keepalive Timer feature provides a mechanism to identify dead connections.

When a TCP connection on a routing device is idle for too long, the device sends a TCP keepalive packet to the peer with only the Acknowledgment (ACK) flag turned on. If a response packet (a TCP ACK packet) is not received after the device sends a specific number of probes, the connection is considered dead and the device initiating the probes frees resources used by the TCP connection.

The following parameters are used to configure TCP keepalive:

  • TCP Keepalive idle time: The value of this parameter indicates the time for which a TCP connection can be idle before the connection initiates keepalive probes.

  • TCP Keepalive retries: The value of this parameter is the number of unacknowledged probes that a device can send before declaring the connection as dead and tearing it down.

  • TCP Keepalive interval: The time between subsequent probe retries.

How to Configure TCP Keepalive Timer

Configuring Keepalive Parameters

Procedure

  Command or Action Purpose

Step 1

enable

Example:

Device> enable

Enables privileged EXEC mode.

  • Enter your password if prompted.

Step 2

configure terminal

Example:

Device# configure terminal

Enables global configuration mode.

Step 3

ip tcp keepalive interval seconds

Example:

Device(config)# ip tcp keepalive interval 23

Configures the keepalive interval.

Step 4

ip tcp keepalive retries number-of-retries

Example:

Device(config)# ip tcp keepalive retries 5

Configures the number of unacknowledged probes that can be sent before declaring the connection as dead.

Step 5

end

Example:

Device(config)# end

Exits global configuration mode and returns to privileged EXEC mode.

Step 6

show running-config

Example:

Device# show running-config

(Optional) Displays the running configuration.

Configuration Examples for TCP Keepalive Timer

Example: Configuring Keepalive Parameters

The following example shows how to configure TCP keepalive parameters.

Device> enable
Device# configure terminal
Device(config)# ip tcp keepalive interval 2
Device(config)# ip tcp keepalive retries 5
Device(config)# end

The following is a sample output of the show running-config command:


Device# show running-config

ip tcp keepalive retries 5
ip tcp keepalive interval 2

Additional References for TCP Keepalive Timer

Standards and RFCs

Standard/RFC

Title

RFC 793

Transmission Control Protocol

RFC 1191

Path MTU discovery

RFC 1323

TCP Extensions for High Performance

RFC 2018

TCP Selective Acknowledgment Options

RFC 2581

TCP Congestion Control

RFC 3168

The Addition of Explicit Congestion Notification (ECN) to IP

RFC 3782

The NewReno Modification to TCP’s Fast Recovery Algorithm

RFC 4022

Management Information Base for the Transmission Control Protocol (TCP)

Technical Assistance

Description

Link

The Cisco Support and Documentation website provides online resources to download documentation, software, and tools. Use these resources to install and configure the software and to troubleshoot and resolve technical issues with Cisco products and technologies. Access to most tools on the Cisco Support and Documentation website requires a Cisco.com user ID and password.

http://www.cisco.com/cisco/web/support/index.html

Feature Information for TCP Keepalive Timer

The following table provides release information about the feature or features described in this module. This table lists only the software release that introduced support for a given feature in a given software release train. Unless noted otherwise, subsequent releases of that software release train also support that feature.

Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to www.cisco.com/go/cfn. An account on Cisco.com is not required.
Table 1. Feature Information for TCP Keepalive Timer

Feature Name

Releases

Feature Information

TCP Keepalive Timer

Cisco IOS XE Fuji 16.8.1a

Cisco IOS XE Gibraltar 16.11.1

The TCP Keepalive Timer feature introduces the capability to identify dead connections between multiple routing devices.

The following command was introduced or modified by this feature: ip tcp keepalive .