中文网站
  Advanced Search
Read the latest Blogs from IT professionals in the field. Read and write community created documents. Need IT help? Ask our staff. Connect with your peers. Check our Tech Shop for posters, books and software tools. Home

HSRP: Hot Standby Routing Protocol

Hot Standby Router Protocol (HSRP) is designed to support non-disruptive failover of IP traffic in certain circumstances and to allow hosts to appear to use a single router and to maintain connectivity even if the actual first hop router they are using fails. In other words, HSRP protects against the failure of the first hop router when the source host cannot learn the IP address of the first hop router dynamically. Multiple routers participate in HSRP and in concert create the illusion of a single virtual router. HSRP insures that one and only one of the routers is forwarding packets on behalf of the virtual router. End hosts forward their packets to the virtual router.

The router forwarding packets is known as the active router. A standby router is selected to replace the active router should it fail. HSRP provides a mechanism for determining active and standby routers, using the IP addresses on the participating routers. If an active router fails a standby router can take over without a major interruption in the host"s connectivity.

HSRP runs on top of UDP, and uses port number 1985. Routers use their actual IP address as the source address for protocol packets, not the virtual IP address. This is necessary so that the HSRP routers can identify each other.

Protocol Structure

8 bits 16 bits 24 bits 32 bits
Version Opcode State Hellotime
Holdtime Priority Group Reserved
Authentication data
Authentication data
Virtual IP address
  • Version -- HSRP version number. The current version is 0.
  • Op code -- Type of message contained in the packet. Possible values are:
    • 0 - Hello, sent to indicate that a router is running and is capable of becoming the active or standby router.
    • 1 - Coup, sent when a router wishes to become the active router.
    • 2 - Resign, sent when a router no longer wishes to be the active router
  • State -- Internally, each router in the standby group implements a state machine. The State field describes the current state of the router sending the message. Possible values are: 0 Initial; 1 Learn; 2 Listen; 4 Speak; 8 Standby; 16 Active.
  • Hellotime -- Approximate period between the Hello messages that the router sends (for Hello messages only). If the Hellotime is not configured on a router, then it may be learned from the Hello message from the active router.
  • Holdtime -- The amount of time, in seconds, that the current Hello message should be considered valid. (For Hello messags only.)
  • Priority -- Used to elect the active and standby routers. When comparing priorities of two different routers, the router with the numerically higher priority wins. In the case of routers with equal priority the router with the higher IP address wins.
  • Group -- Identifies the standby group. For Token Ring, values between 0 and 2 inclusive are valid. For other media, values between 0 and 255 inclusive are valid.
  • Authentication data -- Clear-text 8 character reused password. If no authentication data is configured, the recommended default value is 0x63 0x69 0x73 0x63 0x6F 0x00 0x00 0x00.
    Virtual IP address -- Virtual IP address used by this group. If the virtual IP address is not configured on a router, then it may be learned from the Hello message from the active router. An address should only be learned if no address was configured and the Hello message is authenticated.

Related Terms: IP, UDP

Sponsor Source:HSRP is a Cisco protocol and circulated by IETF RFC 2281.

Reference Links: http://www.javvin.com/protocol/rfc2281.pdf : Cisco Hot Standby Router Protocol (HSRP)