Wire VRRP: a virtual gateway that answers, fails over, and re-points the switches #1056
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge!1056
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/vrrp-wired"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
engine/vrrp.jsimplemented the election — priorities, skew,Master_Down_Interval, the00:00:5E:00:01:<vrid>virtual MAC — andengine/simulator.jsnever required it. The CLI had novrrpcommand at all:So a lab could read about a virtual gateway and never build one. Nothing answered ARP for the VIP,
every host pointed at it black-holed, and the failure looked like a routing mistake.
Four defects, found in this order, each by a failing test
1. Both routers elected themselves. Peer discovery filtered the segment on
isRouter(), whichdoes not exist on
Device— the capability isisL3(), and a bridged L3 switch can hold a virtualgateway too. With no peers, each side won its own election.
2. The master answered ARP as its own address.
owner.ipis the interface's own address, whichfor a virtual gateway is not the VIP — so the reply told the host that
10.0.0.254lived at therouter's MAC under
10.0.0.1. The address being defended is the one that was asked for.3. The reply to the virtual MAC was dropped. After fixing (2), the host resolved the gateway and
still could not reach it: the frame was addressed to a MAC no port owns, so it was discarded as "not
addressed to this device". A master must accept frames sent to its group's virtual MAC.
4. Failover black-holed with zero ARP replies. The switch's MAC table still pointed the virtual
MAC at the old master's port, so traffic was unicast into a box that no longer owned it. This is
what gratuitous ARP on takeover exists for, and the model needed it for the same reason real
hardware does. RFC 826 completes the picture: a station updates its table from any ARP it receives,
not only replies — the GARP is a request, and that rule is what lets hosts that never asked
believe it.
What now works
interface address (RFC 5798 §6.3.2), with address ownership outranking any configured priority.
ownsIpOn()serves it, so an echo is delivered instead of beingforwarded and killed at TTL 1 — and answered with the virtual MAC, so a host's cache survives a
failover.
backup takes the VIP with the same virtual MAC, and the gratuitous ARP re-points the switches.
The host never relearns.
vrrp <vrid> ip|priority|preempt|advertiseinside an interface, plusshow vrrp. A groupis per interface, so the command is refused outside one rather than attaching to whichever
interface happened to be selected last — and a refused command no longer leaves an empty group
behind, which
show vrrpwas reporting as a configured gateway.Test
test/vrrp-in-path.test.js— 49 assertions: the CLI surface and its refusals, one election persegment, the master holding the address, the virtual MAC on the wire and in the host's cache, no
"not mine" drops, failover on interface-down, preemption by priority, the equal-priority tiebreak,
address-owner precedence, convergence (no ownership before Master_Down), and a save/load round trip.
Three of them failed first, one per defect above.
Docs
docs/SIMULATION.md§5.4 read "absent from the data path … there is no first-hop redundancy of anykind, and no HA failover to demonstrate." It now documents what is modelled and, precisely, what is
not: no VRRPv3, no IPv6 virtual addresses, and no detection of a master that goes quiet — a
master is displaced by losing its interface, never by stopping its advertisements. HSRP and GLBP do
not exist.
99 suites, 4840 assertions, all passing.
Closes #1052.