Octet

What do the states in ip neigh mean, such as REACHABLE, STALE, DELAY and FAILED?

Show the answer

Say this first

ip neigh is the ARP table for IPv4 and the NDP cache for IPv6, with a state machine. REACHABLE: the mapping was confirmed recently. STALE: the confirmation is old, but the entry is still used. DELAY: the entry was used while stale and the kernel waits a few seconds for an upper layer, such as a TCP ACK, to confirm it. PROBE: it is sending unicast ARP requests. FAILED: nobody answered. INCOMPLETE: first resolution in progress. PERMANENT is a static entry.

Go deeper

Example

Output
$ ip neigh show dev ens192
10.0.10.1 lladdr 00:1c:7f:3a:11:02 REACHABLE
10.0.10.30 lladdr 00:50:56:a1:9c:44 STALE
10.0.10.31 lladdr 00:50:56:a1:47:e0 DELAY
10.0.10.44 FAILED
10.0.10.5 lladdr 00:50:56:a1:00:05 PERMANENT

The lifecycle and default timers

  1. No entry: the kernel broadcasts a request, entry is INCOMPLETE (3 tries, mcast_solicit, 1 s apart).
  2. Reply received: REACHABLE for a random time between 15 and 45 seconds (base_reachable_time_ms 30000, randomised by half either way).
  3. Timer expires: STALE. Still used to send traffic, nothing is sent on the wire yet.
  4. A packet is sent using a stale entry: DELAY for 5 seconds (delay_first_probe_time). If TCP sees an ACK from that neighbour in that window, it confirms the entry and it returns to REACHABLE.
  5. No confirmation: PROBE, 3 unicast requests (ucast_solicit). No answer: FAILED.

So STALE is normal and healthy. FAILED and INCOMPLETE are the states that mean trouble.

Fixing entries

Shell
ip neigh flush dev ens192                    # clear dynamic entries on one interface
ip neigh del 10.0.10.30 dev ens192
ip neigh replace 10.0.10.5 lladdr 00:50:56:a1:00:05 dev ens192 nud permanent
ip -s neigh show 10.0.10.30                  # adds used/confirmed/updated timers

Traps

  • Calling STALE an error. It is the normal resting state of an entry nobody has confirmed lately.
  • Using arp -n and missing IPv6 entries. ip neigh shows both families.
How did you do?Book 3.3 Internet (IP)