HSRP vs VRRP: Failover and Preemption, Packet by Packet
This walkthrough uses captures from the late Nick Russo's free packet-capture library. They are in the FHRP archive, fhrp_pcap.zip, under fhrp_pcap/ipv4/: hsrp_v2_init.pcapng, hsrp_v2_fail_and_preempt.pcapng, vrrp_v3_init.pcapng, and vrrp_v3_fail_and_preempt.pcapng. The archive is preserved by the Internet Archive, with the rest of the library listed on his job aid page. We decoded the captures with VisualEther, which turns a Wireshark PCAP into a sequence diagram with a plain-English caption on every message.
A host has one default gateway address. If the router that owns it dies, the host is cut off, even when a second router sits on the same LAN. A first-hop redundancy protocol (FHRP) fixes that: two or more routers share a virtual IP address and a virtual MAC address, one of them answers for both, and another takes over when it can't. HSRP (Hot Standby Router Protocol) is Cisco's; VRRP (Virtual Router Redundancy Protocol) is the IETF standard.
These four captures run both protocols between the same two Cisco routers, with the same priorities and the same event. Router R1's priority drops from 105 to 95, below R2's 100, and later comes back. Under HSRP, R2 took over 2 milliseconds after R1 announced the lower priority. Under VRRP, R2 took over 36 seconds after R1's last high-priority message. Both takeovers follow their specifications, and the difference is the most useful thing to understand about the two protocols.
All four captures are drawn as annotated sequence diagrams:
- HSRPv2 bring-up (31 frames, 99 s): Listen, Speak, Standby, Active, then a host's ARP and ping through the virtual IP.
- VRRPv3 bring-up (13 frames, 35 s): R1 preempts R2, then the same host traffic.
- HSRPv2 failover and preemption (29 frames, 42 s): two Coups, one each way.
- VRRPv3 failover and preemption (24 frames, 138 s): two takeovers, each after a timer runs out.
Each router gets a lane, and each message is an arrow, numbered as in Wireshark and captioned with what it does. Every diagram comes in three forms: an interactive viewer, an HTML page, and a printable PDF. In the viewer and the HTML page, clicking any message opens its full Wireshark field tree.
💡 Read the walkthrough and a diagram side by side: open the interactive diagram in a split-screen window, or open the HTML version in a new tab and snap the two windows side by side. Each capture section below links its own diagram.
What is the difference between HSRP and VRRP?
HSRP is Cisco-proprietary and VRRP an open standard, but the difference that shows up on the wire is how a better router takes over. HSRP has a Coup message for it and acts the moment it hears a weaker active router. VRRP has no such message: a better Backup ignores the weaker Master and waits for a timer to run out. Most of the other differences are in the numbers:
| HSRP version 2 | VRRP version 3 | |
|---|---|---|
| Defined by | Cisco (configuration guide); version 1 is the informational RFC 2281 | RFC 9568 (2024), which replaced RFC 5798 |
| Roles | Active, Standby, and others in Listen | Master and Backups (RFC 9568 renamed Master to Active) |
| States | Initial, Learn, Listen, Speak, Standby, Active | Initialize, Backup, Master |
| Messages | Hello, Coup, Resign, plus an Interface State TLV | Advertisement only |
| Transport | UDP port 1985 to 224.0.0.102, TTL 1 | IP protocol 112 to 224.0.0.18, TTL 255 |
| Virtual MAC | 0000.0c9f.fXXX (group 0 to 4095); here 00:00:0c:9f:f0:14 for group 20 | 0000.5e00.01XX (VRID 1 to 255); here 00:00:5e:00:01:1e for VRID 30 |
| Who sends from the virtual MAC | The Active router's Hellos | Every advertisement from the Master |
| Default timers | Hello 3 s, hold 10 s | Advertisement 1 s; Backup waits about 3.6 s |
| Timers in these captures | Hello 10 s, hold 20 s | Advertisement 10 s; Backup waits 36.1 s |
| Preemption default | Off (standby preempt to enable) | On |
| How a better router takes over | Sends a Coup at once | Waits out Active_Down_Interval |
| Measured takeover, priority drop | 2 ms (Coup), 3 ms to the first Active Hello | 36.1 s after R1's last priority-105 advertisement |
| Measured takeover, priority back | 1 ms after the next Hello from R2 | 36.3 s after the last advertisement R1 accepted |
| Authentication | MD5 TLV in these captures | None: the VRRPv3 RFCs define none (Cisco offers MD5 only for VRRPv2) |
| Load sharing | One Active per group; use several groups | One Master per VRID; use several VRIDs |
The rest of this page shows where each row comes from in the captures.
The lab
The topology is the same in all four captures:
| Device | HSRP captures (VLAN 20) | VRRP captures (VLAN 30) | Role |
|---|---|---|---|
| R1 | 192.168.20.1, priority 105 | 192.168.30.1, priority 105 | The preferred gateway |
| R2 | 192.168.20.2, priority 100 | 192.168.30.2, priority 100 | The backup gateway |
| Virtual gateway | 192.168.20.254, group 20 | 192.168.30.254, VRID 30 | The address hosts use |
| R4 | 192.168.20.4 | 192.168.30.4 | A host using the virtual gateway |
| R3 | 10.0.0.3 (loopback) | 10.0.0.3 (loopback) | A destination beyond the gateway |
Three things about these captures matter before reading them:
- No router dies. In both "fail" captures, R1 stays up and keeps sending. Its priority drops from 105 to 95 and returns, most likely through object tracking: Cisco routers can lower their priority when a tracked interface or route goes down, for example the uplink or a default route learned through OSPF or BGP. So the failovers here are preemptions on priority. What happens when a router actually dies is covered below from the timers, and labeled as derived.
- The timers are ten times slower than the defaults in both protocols. Every timer-driven wait quoted here would be about ten times shorter with default timers.
- The virtual MAC hides who is sending. A VRRP Master sends every advertisement from the virtual MAC, so R1's and R2's frames look the same at Layer 2. HSRP's Active router does the same with its Hellos. The diagrams therefore give each router a lane by IP address and draw ARP, which has no IP header, by MAC address.
The lanes run in the order traffic flows: host R4, the broadcast address, the virtual MAC, R1, the protocol's multicast group, R2, and R3 behind the gateways.
How do HSRP and VRRP elect the active router?
Both elect the router with the highest priority (0 to 255, default 100; VRRP reserves 0 and 255) and break a tie on the highest IP address. They differ in how long they wait before deciding.
RFC 9568 renamed VRRP's Master to Active, and its timers to Active_Down_Interval and Active_Down_Timer (RFC 5798's Master_Down_Interval and Master_Down_Timer). Cisco IOS and Wireshark still say Master, and so does this page; the timer names follow RFC 9568.
HSRP bring-up: about 24 seconds in Speak and Standby
R1 and R2 start HSRP 1.24 s apart; each announces itself with an Interface State TLV (frames 1 and 2). From there it takes R1 45.5 s to become Active:
| Frames | Time | R1, priority 105 | R2, priority 100 |
|---|---|---|---|
| 1, 2 | 0 s, 1.2 s | Listen, no Hellos | Listen, no Hellos |
| 3 | 20.6 s | Listen | Speak |
| 4 | 22.4 s | Speak | Back to Listen on hearing R1 |
| 9 | 42.5 s | Speak | Speak once more |
| 10 | 44.0 s | Standby | Back to Listen on hearing R1 |
| 12 to 14 | 46.7 s | Active, gratuitous ARPs | Listen |
| 18 | 64.7 s | Active | Speak, the Standby role now empty |
| 25 | 86.6 s | Active | Standby |
RFC 2281 explains every step (states in section 5.3, timers in section 5.4, the state table in section 5.7):
- Listen. Both routers have the virtual IP in their configuration, so they skip Learn. In Listen a router sends no Hellos and waits for an Active or Standby router's. None comes, and after one hold time (20 s here) each moves to Speak.
- Speak. Now both send Hellos and compare priorities. A speaker becomes Standby when its Standby timer runs out without hearing a Standby router or a higher-priority speaker. R1 does that 21.6 s after its first Hello.
- Standby to Active. With no Active router heard, R1's Active timer runs out too, and R1 becomes Active 2.66 s after it became Standby. It sends its Hello from the virtual MAC and two gratuitous ARPs.
The slow start is deliberate: every step waits a full hold time to make sure no other router already holds the role, so a router joining a working group never disturbs it unless it is configured to preempt. With the default 10 s hold time, the same path takes about half as long.
R2's path shows the table's other side. A speaker that hears a higher-priority speaker or a Standby router goes back to Listen. So R2 speaks once at 20.6 s, falls silent when R1 speaks, speaks again when its Standby timer runs out at 42.5 s, and falls silent again when R1 becomes Standby. Only once R1 is Active and the Standby role is empty does R2 stay in Speak (from 64.7 s), and one hold time later it becomes Standby. That is 42.5 s after R1's last Standby Hello: one hold time in Listen and one in Speak, plus Cisco's timer jitter.
VRRP has no Speak phase. A starting router goes straight to Backup and becomes Master only if its timer runs out, as the next capture shows.
VRRP bring-up: the Master changes in one message
When the capture starts, R2 is Master: its advertisement (priority 100) is frame 1. In frame 2, 0.41 s later, R1 advertises at priority 105 and sends a gratuitous ARP. R2 hears the higher priority and becomes Backup without a word; VRRP has no message for stepping down.
The 0.41 s is measured from the first captured frame, not from when R1 started. RFC 9568 section 6.4.1 sends every router that doesn't own the address (priority below 255) to Backup at startup, with its Active_Down_Timer set to a full Active_Down_Interval: 35.9 s for R1 with these timers. While R1 waits, it discards R2's lower-priority advertisements (section 6.4.2), so they don't restart its timer. The capture most likely began near the end of that wait.
The capture ends with host R4 using the gateway. R4 broadcasts an ARP request for 192.168.30.254, and R1 answers with the virtual MAC, not its own. R4 then pings R3's loopback, addressing the frame to the virtual MAC. The echo reply comes back from R1's own MAC, aa:bb:cc:00:01:20: the virtual MAC is only a destination for hosts, and a router forwards packets with its interface's own MAC. The HSRP capture ends the same way.
What does preemption do, and why is it off by default in HSRP?
Preemption lets a higher-priority router take the role from a lower-priority one that is working. Without it, the router that became active stays active until it fails, whatever the priorities.
HSRP leaves it off by default (Cisco), so a router coming back from a reboot or a flapping link doesn't take the role and push traffic around a second time. VRRP turns it on by default (RFC 9568 section 6.1, Preempt_Mode). In these captures, preemption is on in both: HSRP's Coups would not happen otherwise. Many designs add a preemption delay, so a recovering router waits for its routing protocols to converge before it takes over.
Preemption is also what makes object tracking useful. Tracking lowers a router's priority when its uplink fails; preemption is what lets the other router act on the new priorities. Both "fail" captures show exactly this pair.
HSRP failover: a Coup in 2 milliseconds
When the capture starts, R1 is Active and R2 Standby. At 2.038 s (frame 2), R1's Hello says it is still Active, now at priority 95. R2, Standby at priority 100 with preemption on, answers 1.99 ms later with a Coup (frame 4), and 1 ms after that sends its first Hello as Active (frame 6), followed by gratuitous ARPs. RFC 2281's state table (section 5.7) describes exactly this: a router configured to preempt that hears a Hello from a lower-priority Active router sends a Coup, a Hello, and a gratuitous ARP, and becomes Active.
frame : Frame 4: Packet, 118 bytes on wire (944 bits), 118 bytes captured (944 bits) on interface -, id 0
Interface id : 0 (-)
eth : Ethernet II, Src: aa:bb:cc:00:02:20, Dst: 01:00:5e:00:00:66
Destination : 01:00:5e:00:00:66
Source : aa:bb:cc:00:02:20
vlan : 802.1Q Virtual LAN, PRI: 0, DEI: 0, ID: 20
ip : Internet Protocol Version 4, Src: 192.168.20.2, Dst: 224.0.0.102
Differentiated Services Field : 0xc0 (DSCP: CS6, ECN: Not-ECT)
000. .... = Flags : 0x0
Time to Live : 1
Expert Info (Note/Sequence) : "Time To Live" != 255 for a packet sent to the Local Network Control Block (see RFC 3171)
udp : User Datagram Protocol, Src Port: 1985, Dst Port: 1985
Timestamps
hsrp : Cisco Hot Standby Router Protocol
Group State TLV : Type=1 Len=40
MD5 Authentication TLV : Type=4 Len=28
Failover capture, frame 4, R2's Coup. Under Cisco Hot Standby Router Protocol: the Group State TLV with Version 2, Op Code Coup, State Standby, Group 20, Identifier (R2's MAC), Priority 100, Hellotime and Holdtime 10000 and 20000 ms, and Virtual IP Address 192.168.20.254, then the MD5 Authentication TLV.
Four details in the Coup and around it:
- The Coup still says
State: Standby. R2 announces the takeover first and switches in its next Hello. - The Coup comes from R2's own MAC,
aa:bb:cc:00:02:20. Its Hello as Active, 1 ms later, comes from the virtual MAC. The HSRPv2Identifierfield always carries the sender's real MAC, so Wireshark can tell the routers apart even when the Ethernet source is the virtual MAC. - Every HSRP packet here carries an MD5 Authentication TLV, a keyed hash over the packet. Without it, any device on the VLAN could send a Coup at priority 255 and take the gateway.
- R1 sends no Resign. RFC 2281's table has an Active router that receives a higher-priority Coup send a Resign as it drops to Speak; this Cisco router went straight to Speak (frame 10), 10 ms after its own Hello.
R1 then works its way back up: Speak until a hold time passes, then Standby at 23.1 s (frame 16), 21.0 s after it entered Speak. Its Hello at 33.0 s (frame 19) still carries priority 95.
The return is the same move in reverse. At 38.900 s R2 sends its routine Active Hello (frame 20), and 1.04 ms later R1 sends a Coup at priority 105 (frame 22), then its own Active Hello and gratuitous ARPs. R1's priority came back between 33.0 s and 38.9 s; the Coup most likely waited for the next Hello from the weaker Active router.
What is the HSRPv2 Interface State TLV?
It is a Cisco packet that counts the sender's HSRP groups on the interface: how many are Active, and how many are in other states. Wireshark decodes it as HSRPv2 TLV type 2. Type 1 is the Group State TLV that carries Hello, Coup, and Resign, and type 4 is MD5 authentication.
Cisco doesn't document this TLV. Its configuration guide does describe passive HSRP advertisements, part of HSRP's support for ICMP redirects: routers send them periodically and when they enter or leave the passive state, so every HSRP router can see the others' group states. Wireshark decodes the HSRP version 1 form of these, opcode 3, with the same active and passive group counts. So the TLV is most likely the version 2 encoding of the same advertisement.
The captures fit that reading. The TLVs appear when a router starts HSRP, every 26 to 30 s while it has no Active group, whenever its counts change, and when it learns of a new Active router. R2 sends Active Groups: 1, Passive Groups: 1 just before its Coup and 1, 0 right after, and the router losing the role sends 0, 1. While R2 is Active, it sends none. They take no part in the election, so the summary diagrams on this page leave them out; the annotated diagrams keep them.
Why did VRRP wait 36 seconds when HSRP took over in 2 ms?
A VRRP Backup with preemption ignores a weaker Master instead of challenging it. RFC 9568 section 6.4.2 tells a Backup what to do with each advertisement:
- If its priority is 0, the Master is leaving: set the timer to
Skew_Timeand take over quickly. - If preemption is off, or the advertisement's priority is at least the Backup's own, restart
Active_Down_Timer. - Otherwise (preemption on and the Master's priority lower), discard the advertisement.
Discarding doesn't restart the timer. So R2 can't take over until Active_Down_Timer runs out, counted from the last advertisement it accepted. RFC 9568 section 6.1 defines the interval:
Active_Down_Interval= 3 ×Active_Adver_Interval+Skew_TimeSkew_Time= ((256 − Priority) ×Active_Adver_Interval) / 256
The skew makes the highest-priority Backup's timer expire first, so the best Backup wins without a contest.
The numbers fit to the millisecond. R2 has priority 100 and the advertisement interval is 1000 centiseconds (10 s):
| Step | Value |
|---|---|
Skew_Time for R2 | (256 − 100) × 10 / 256 = 6.094 s |
Active_Down_Interval for R2 | 3 × 10 + 6.094 = 36.094 s |
| R1's last priority-105 advertisement (frame 2) | 9.665 s |
| Predicted takeover | 9.665 + 36.094 = 45.759 s |
| R2's first advertisement as Master (frame 7) | 45.770 s, 11 ms after the prediction |
R1 had been advertising priority 95 since 17.9 s, so R2 took over 27.9 s after the first sign that it outranked R1.
frame : Frame 7: Packet, 64 bytes on wire (512 bits), 64 bytes captured (512 bits) on interface -, id 0
Interface id : 0 (-)
eth : Ethernet II, Src: 00:00:5e:00:01:1e, Dst: 01:00:5e:00:00:12
Destination : 01:00:5e:00:00:12
Source : 00:00:5e:00:01:1e
vlan : 802.1Q Virtual LAN, PRI: 0, DEI: 0, ID: 30
ip : Internet Protocol Version 4, Src: 192.168.30.2, Dst: 224.0.0.18
Differentiated Services Field : 0x00 (DSCP: CS0, ECN: Not-ECT)
000. .... = Flags : 0x0
vrrp : Virtual Router Redundancy Protocol
Version 3, Packet type 1 (Advertisement)
Failover capture, frame 7, R2's first advertisement as Master. Under Virtual Router Redundancy Protocol: Version 3, Type Advertisement, Virtual Rtr ID 30, Priority 100, Addr Count 1, Adver Int 1000 (centiseconds), and IP Address 192.168.30.254. The Ethernet source is the virtual MAC 00:00:5e:00:01:1e, the same as R1's advertisements.
The advertisement carries no takeover flag and no sender ID: it looks like R1's, except for the IP source and the priority. R2 sends three gratuitous ARPs over the next 2.4 s.
When did R1's priority come back?
The capture can't show it, because a VRRP Backup sends nothing when its priority changes. The same rule dates it anyway. After frame 7, R1 (priority 95) was a Backup, and each of R2's priority-100 advertisements restarted R1's timer. Once R1 was back at 105, it discarded them, and its timer ran out 36.29 s after the last one it accepted. That interval uses priority 95, R1's priority when the timer was last set: 3 × 10 + (256 − 95) × 10 / 256.
R1 took over at 129.240 s (frame 20). R2's advertisement in frame 15, at 92.948 s, plus 36.289 s gives 129.237 s, 3 ms off. No other advertisement fits:
- Had R1 discarded frame 15, its timer would have run from frame 14 and expired at about 119.7 s.
- Had R1 accepted frame 16 (102.6 s), it would have expired at about 138.9 s.
So R1's priority most likely returned between 92.9 s and 102.6 s, and R1 waited about 27 to 36 s before using it. HSRP's R1 needed 1 ms.
What does a gratuitous ARP do after a failover?
It moves the virtual MAC to the new router's switch port. A gratuitous ARP is an ARP reply that nobody asked for, announcing the sender's own mapping: here, the virtual IP at the virtual MAC.
The mapping doesn't change in a failover, so hosts' ARP caches are already right and have nothing to learn. The switches are the audience. Until they see a frame from the virtual MAC on the new router's port, they keep forwarding gateway traffic to the old one. A gratuitous ARP is broadcast, so every switch in the VLAN sees it and updates its MAC address table at once.
| HSRP | VRRP | |
|---|---|---|
| Gratuitous ARPs at takeover | 2, at the same instant: to broadcast and to 01:00:0c:cd:cd:cd | 1, to broadcast |
| Repeats | 1 more, about 3 s later | 2 more, about 1.2 s apart |
| From | The virtual MAC | The virtual MAC |
01:00:0c:cd:cd:cd is a Cisco reserved multicast address, which Wireshark labels STP-UplinkFast. Cisco's STP UplinkFast feature sends dummy multicast frames to it, each sourced from a MAC address that switches should relearn, and switches update their tables when they see one. Cisco doesn't document why HSRP also sends its gratuitous ARP there; the effect is the same.
RFC 9568 section 6.4.2 asks a new VRRP Master for one gratuitous ARP per virtual address; this Cisco router sends three.
How fast would HSRP and VRRP fail over if a router died?
These captures don't show it, so this section is derived from the timers, not observed.
A dead router sends nothing: no lower priority, no Coup trigger, no Resign. The backup notices only when its timer expires. HSRP's Standby router waits for the hold time without a Hello from the Active router; VRRP's Backup waits for Active_Down_Interval without an advertisement. The last message came up to one interval before the failure, so the outage is a range. Cisco also adds up to 20% jitter to HSRP's hold timer, which can stretch its worst case to 24 s here and 12 s with defaults:
| Detection after the failure | With these captures' timers | With default timers | |
|---|---|---|---|
| HSRP | Hold time − hello interval to hold time | 10 to 20 s | 7 to 10 s |
| VRRP (R2, priority 100) | Active_Down_Interval − interval to Active_Down_Interval | 26.1 to 36.1 s | 2.6 to 3.6 s |
With the defaults, VRRP detects a dead router about three times faster than HSRP. With these captures' timers, HSRP is faster, because its hold time is 2 hello intervals and VRRP's wait is more than 3.
Both can go much faster. HSRP accepts millisecond timers, and VRRPv3 accepts advertisement intervals in centiseconds. A clean shutdown is faster than a crash in both: an HSRP Active router sends a Resign (RFC 2281 section 5.7), and a VRRP Master sends an advertisement with priority 0, which cuts the Backup's wait to Skew_Time (RFC 9568 sections 6.4.3 and 6.4.2).
How to debug HSRP and VRRP from a capture
- Find who is active. For VRRP, read the IP source of the advertisements; the Ethernet source is always the virtual MAC. For HSRP, read the
Statefield, or theIdentifierfield when the source is the virtual MAC. - Check the priorities in every message. A drop of exactly the tracking decrement (10 here) points to object tracking, not to a failure on the LAN.
- Two routers both active? Neither hears the other. Look for one-way multicast loss, a mismatched group number or VRID, or an authentication mismatch: HSRP drops a Hello that fails the MD5 check.
- A takeover that took far too long? Read the timers in the packets: HSRP's
HellotimeandHoldtime, VRRP'sAdver Int. Then check whether preemption is on: without it, a recovered router never takes back the role. - Traffic still going to the old router? Look for the gratuitous ARP after the takeover, on the switch port toward the hosts.
FAQ
Is HSRP or VRRP better? On Cisco-only networks either works. VRRP is an open standard that other vendors support, preempts by default, and has faster default timers. HSRP has the Coup, so a preempting router takes over at once, and offers MD5 authentication, which VRRPv3 lacks.
What are the HSRP states? Initial, Learn, Listen, Speak, Standby, and Active (RFC 2281 section 5.3). Only the Active and Standby routers send Hellos once the election settles; others stay in Listen.
What are the VRRP states? Initialize, Backup, and Master (RFC 9568 section 6.4, which renamed Master to Active).
What multicast addresses do HSRP and VRRP use? HSRP version 1 uses 224.0.0.2 and version 2 uses 224.0.0.102, both on UDP port 1985. VRRP uses 224.0.0.18 with IP protocol 112.
What is the VRRP virtual MAC address? 00-00-5E-00-01-XX for IPv4, where XX is the virtual router ID in hex. VRID 30 gives 00:00:5e:00:01:1e. HSRP version 2 uses 0000.0c9f.f000 to 0000.0c9f.ffff, and version 1 uses 0000.0c07.acXX.
Is preemption enabled by default in VRRP? Yes. In HSRP it is off until you configure standby preempt.
Why didn't the VRRP backup take over when the master's priority dropped? A Backup with preemption discards advertisements from a lower-priority Master, without restarting its timer, and takes over only when Active_Down_Timer expires.
What is a Coup in HSRP? The message a router sends when it takes the Active role from a lower-priority Active router, which requires preemption. The old Active router drops to Speak.
Takeaways
- Both protocols elect by priority. The highest wins, and a tie goes to the highest IP address.
- HSRP preempts with a message; VRRP with a timer. R2's HSRP Coup came 2 ms after R1 announced the lower priority; its VRRP takeover came 36.1 s after R1's last higher-priority advertisement.
- The VRRP wait is predictable.
Active_Down_Interval= 3 × interval +Skew_Time, counted from the last advertisement the Backup accepted. These captures match it within 11 ms. - Preemption is off by default in HSRP and on in VRRP. It is what lets object tracking move the gateway.
- The virtual MAC never changes. Hosts keep their ARP entry; the gratuitous ARP is for the switches.
- Check the timers before quoting a failover time. These captures' timers run ten times slower than the defaults.