Saturday, March 19, 2011

The 'keepalive' Interface Subcommand

Keepalive messages are often being sent by a network device via a physical or virtual circuit to inform another network device at the other end that the circuit between them is functioning. The keepalive mechanism on broadcast media (eg: Ethernet) is different. Since there are often many devices reside on an Ethernet network, the keepalive is not designed to determine whether the path to a particular device is available; instead, it is designed to verify that the local device has read and write access to the Ethernet media. A device would send an Ethernet frame with itself as the source and destination MAC addresses and the EtherType of 0x9000. The device would receive this frame immediately after the frame is being sent. This checks the transmit and receive hardware of an Ethernet adapter, and the integrity and quality of the cable connected to it.

Cisco implemented the Ethernet Loopback Protocol or Ethernet Configuration Test Protocol which is in the original Xerox Ethernet specification (but not in the IEEE 802.* specification).

Another well known keepalive mechanism is HDLC keepalive on Serial lines. HDLC keepalives sent between the routers at both ends are tracked and acknowledged using sequence numbers. A router declares a serial interface is down (line protocol is down) when it misses 3 keepalives.

The keepalive [interval [retries]] interface subcommand enables the sending of keepalives to itself (eg: Ethernet and Token Ring) or another end (eg: Serial and Tunnel) to ensure that an interface is operational. The parameters specify the interval between keepalives and the number of retries to continue to send keepalives without response before declaring an interface is down. The default values for interval and retries are 10 seconds and 5 retries respectively.

Ethernet link failure detection often occurs between 1 and 9 seconds. Setting the keepalive interval to a low value is very useful for rapidly detecting Ethernet interface failures.

A typical Serial line failure often caused by the lost of the Carrier Detect (CD) signal, which can be noticed within milliseconds; therefore adjusting the keepalive interval for faster routing convergence is not useful. Additionally, adjusting the keepalive interval for a very low bandwidth serial line can cause large packets to delay the delivery of small keepalive messages long enough and cause the interface to go down.

Disabling the keepalive mechanism on an Ethernet interface would stop a router from sending Ethernet Configuration Test Protocol LOOP frames.
RT1#sh int fa0/0 | in Keepalive
  Keepalive set (10 sec)
RT1#
RT1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
RT1(config)#int fa0/0
RT1(config-if)#no keepalive
RT1(config-if)#do sh int fa0/0 | in Keepalive
  Keepalive not set

An Ethernet interface can be enabled with the keepalive 0 or no keepalive interface subcommand when it is not being connected to a switch (or hub) port. The interface will be considered active and included in the IP routing table as a directly connected network.

No comments:

Post a Comment