Section 9.3: HSRP Operations

9.3.1: The Active Router

One router in each group is elected to be the active router. The election process occurs through the sending and receiving of hello messages. The hello message contains a priority level for the sending router. The router with the highest standby priority in the group becomes the active router responsible for forwarding the packets sent to the virtual router. If the priority level is the same for each router in the group, the first router to come up and obtain the virtual router IP address becomes the active router.

9.3.2: Locating the Virtual Router MAC Address

The ARP process makes an association between Layer 3 network addresses and Layer 2 hardware addresses. Each router maintains a table of resolved addresses. The router checks this ARP cache before attempting to contact a device to determine if the address has already been resolved. The IP address and corresponding MAC address of the virtual router is maintained in the ARP table of each router in an HSRP standby group.

9.3.3: Standby Router Behavior

The function of the active router is to forward packets sent to the virtual router. Another router in the group is elected as the standby router. The active router assumes and maintains its active role through the transmission of hello messages. Meanwhile the standby router monitors the operational status of the HSRP group and assumes packet-forwarding responsibility if the active router becomes inoperable. The standby router also transmits hello messages to inform all other routers in the group of the standby router's role and status.

When the active router fails, it stops transmitting hello messages. If the HSRP group misses three hello messages, it realizes that the active router is down and the standby router then assumes the role of the active router. Because the new active router assumes both the IP and MAC addresses of the virtual router, the end stations see no disruption in service. The end-user stations continue to send packets to the virtual router MAC address, and the new active router delivers the packets to the destination. In the event that both the active and standby routers fail, all routers in the group contend for the active and standby router roles, and the highest priority router will become the active router.

9.3.4: HSRP Messages

All routers in a standby group send or receive HSRP messages. These messages are used to determine and maintain the router roles within the group. HSRP messages are encapsulated in the data portion of User Datagram Protocol (UDP) packets and use port number 1985. These packets are addressed to an "all router" multicast address with a Time to Live (TTL) of one (1). Once the HSRP protocol has completed the election process, only the active and the standby routers will send HSRP messages. The HSRP message contains a Version field, which indicates the version of the HSRP; an Op Code, which describes the type of message contained in the HSRP message packet; Hello messages that are sent to indicate that a router is running and capable of becoming either the active or standby router; Group messages that are sent when a router wants to become the active router; Reserved messages that are sent when a router no longer wants to be the active router; a State field, which describes the current state of the router sending the message; a Hellotime field, which contains the approximate period between the hello messages that the router sends; a Holdtime field, contains the amount of time that the current hello message should be valid; a Priority field, which is used to elect the active and standby routers; a Group field, which identifies the standby group; a Authentication Data field, which contains a clear-text, eight-character reused password; and a Virtual IP Address field, which contains the IP address of the virtual router used by this group.

9.3.5: HSRP States

HSRP defines six states in which an HSRP configured router may exist. These states are the Initial State; the

Learn State; the Listen State; the Speak State; the Standby State; and the Active State.

• All routers begin in the Initial State. This state indicates that HSRP is not running and is entered via a configuration change or when an interface first comes up.

• In the Learn State, the router has not yet seen a hello message from the active router, nor learned the IP address of the virtual router and is thus still waiting to hear from the active router.

• In the Listen State, the router knows the virtual IP address, but is neither the active router nor the standby router.

• In the Speak State, the router sends periodic hello messages and is actively participating in the election of the active and standby router. However, a router cannot enter the speak state unless the router has the IP address of the virtual router.

• In the Standby State, the router is the standby router and sends periodic hello messages.

• In the Active State, the router is currently the active router.