HSRP stands for Hot Standby Router Protocol, which is a Cisco proprietary redundancy protocol for establishing a fault-tolerant default gateway. It provides network redundancy for IP networks and ensures that user traffic immediately and transparently recovers from first hop failures in network edge devices or access circuits. HSRP allows you to configure two or more routers as standby routers and only a single router as an active router at a time. All the routers in a single HSRP group share a single MAC address and IP address, which acts as a default gateway to the local network. The active router is responsible for forwarding the traffic. If it fails, the standby router takes up all the responsibilities of the active router and forwards the traffic.
Some important terms related to HSRP include:
- Virtual IP: IP address from the local subnet is assigned as the default gateway to all local hosts in the network.
- Virtual MAC address: MAC address is generated automatically by HSRP. The first 24 bits will be the default CISCO address (i.e. 0000.0c). The next 16 bits are HSRP ID (i.e. 07.ac). The next 8 bits will be the group number in hexadecimal.
HSRP is not a routing protocol as it does not advertise IP routes or affect the routing table in any way. Instead, it provides stateless redundancy for IP routing. HSRP gateways send multicast hello messages to other gateways to notify them of their priorities (which gateway is preferred) and current status (active or standby) . HSRP is useful for hosts that do not support a router discovery protocol and cannot switch to a new router when their selected router reloads or loses power. Because existing TCP sessions can survive the failover, this protocol also provides a more transparent recovery for hosts that dynamically choose a next hop for routing IP traffic.
HSRP has different states, including Initial, Learn, Listen, Speak, Standby, and Active. The protocol has two versions, with version 2 introducing stability, scalability, and diagnostic improvements. It is not compatible with version 1 HSRP, and there is no RFC for version 2 of the protocol. Version 2 of the protocol includes improvements and supports IPv6, but there is no corresponding RFC published for this version. It increases the number of HSRP groups from 256 to 4096.