Add GARP retransmit capability
authorvangyzen <vangyzen@FreeBSD.org>
Sun, 2 Oct 2016 01:42:45 +0000 (01:42 +0000)
committervangyzen <vangyzen@FreeBSD.org>
Sun, 2 Oct 2016 01:42:45 +0000 (01:42 +0000)
commite993e06c3b7243240df5bd40c6e5eb171819a22e
tree1c937dad17254271d62c8b3dd77d6e4244d991ac
parente3e51c190ed1781944b6ab21d84e6d4a8597623f
Add GARP retransmit capability

A single gratuitous ARP (GARP) is always transmitted when an IPv4
address is added to an interface, and that is usually sufficient.
However, in some circumstances, such as when a shared address is
passed between cluster nodes, this single GARP may occasionally be
dropped or lost.  This can lead to neighbors on the network link
working with a stale ARP cache and sending packets destined for
that address to the node that previously owned the address, which
may not respond.

To avoid this situation, GARP retransmissions can be enabled by setting
the net.link.ether.inet.garp_rexmit_count sysctl to a value greater
than zero.  The setting represents the maximum number of retransmissions.
The interval between retransmissions is calculated using an exponential
backoff algorithm, doubling each time, so the retransmission intervals
are: {1, 2, 4, 8, 16, ...} (seconds).

Due to the exponential backoff algorithm used for the interval
between GARP retransmissions, the maximum number of retransmissions
is limited to 16 for sanity.  This limit corresponds to a maximum
interval between retransmissions of 2^16 seconds ~= 18 hours.
Increasing this limit is possible, but sending out GARPs spaced
days apart would be of little use.

Submitted by: David A. Bright <david.a.bright@dell.com>
MFC after: 1 month
Relnotes: yes
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D7695
sys/netinet/if_ether.c
sys/netinet/in.c
sys/netinet/in_var.h