How do ARP cache entries age out in IPv4, what do RFC 826 and RFC 1122 each require, and how do static entries differ?
answer
- 826 left it out of scope
- 1122 made flushing a MUST
- four ways to notice staleness
- timer reset by overheard broadcasts
- static never ages
basics
~20 sRFC 826 sets no lifetime; RFC 1122 requires a mechanism to flush out-of-date entries, with a configurable timeout if one is used. Dynamic entries age out and are re-resolved; static entries are configured by hand and never age.
solid answer
~40 sRFC 826 called ageing "outside the scope of this protocol" and only suggested timeouts. RFC 1122 §2.3.2.1 made it mandatory: an ARP implementation MUST provide a way to flush out-of-date entries, and a timeout SHOULD be configurable. It lists four mechanisms: a **timeout**, restarted whenever an ARP broadcast from that host is seen; a **unicast poll** of the cached address; **link-layer advice**; and **higher-layer advice** when delivery is failing. The actual lifetime is an implementation choice, from under a minute to hours. A **static** entry is added by an administrator and, in common implementations, never expires and is not overwritten by received ARP packets. That resists forged replies but turns a MAC change into a silent outage until someone edits the entry.
go deeper
Remember that ARP entries expire and are re-learned, and that a static entry is a hand-made one that never expires.
Explain the split: RFC 826 left ageing out of scope, RFC 1122 made flushing a MUST and listed timeout, unicast poll, link-layer and higher-layer advice. Say that the timer restarts on overheard broadcasts.
Show judgment about lifetimes as a trade between broadcast load and staleness, and treat any specific number as an implementation default. Know when a static entry is worth its maintenance cost.
Weigh static entries and long timeouts against the operational cost of hardware changes across a fleet, and prefer confirmation-based ageing where the platform offers it.
## What the original specification said RFC 826 (1982) defines the ARP packet and the receive algorithm, but it deliberately stops short of cache management: "It may be desirable to have table aging and/or timeouts. The implementation of these is outside the scope of this protocol." Its discussion sketches options (resetting a timer whenever a packet arrives from a host, or a background task that re-asks a host directly before forgetting it) and notes that 48-bit Ethernet addresses "shouldn't change", so the problem seemed minor at the time. ## What host requirements added RFC 1122 (1989), §2.3.2.1 "ARP Cache Validation", turned the suggestion into a rule: - an implementation **MUST** provide a mechanism to flush out-of-date cache entries; - if that mechanism is a timeout, it **SHOULD** be possible to configure the timeout value; - an implementation **MUST** include a mechanism to prevent ARP flooding, with a recommended maximum of **1 request per second per destination**. Its reasoning: hosts do change hardware addresses, proxy ARP had made invalid entries much more likely, and even without it a long timeout corrects bad data that would otherwise persist. ## The four flushing mechanisms RFC 1122 lists four mechanisms that implementations had used, sometimes combined: | Mechanism | How it works | Cost | |---|---|---| | Timeout | entries expire even if in use; the timer restarts when the source fields of an ARP broadcast from that host are seen, whatever its target | re-resolution traffic | | Unicast poll | send a point-to-point ARP request to the cached MAC; delete after N unanswered polls, typically N = 2 | one unicast per entry per period | | Link-layer advice | the driver reports a delivery problem and the entry is flushed | needs a link that can detect failures | | Higher-layer advice | the internet layer tells ARP that delivery to that neighbour is failing | needs the transport layer to notice | For the first two it suggests timeouts "on the order of a minute" where proxy ARP is in use, and warns that such short values create noticeable overhead on a very large Ethernet, so a host may need a longer one. ## Choosing a lifetime is a trade 1. **Short lifetimes** correct a wrong mapping quickly but cost broadcasts every time an active entry expires, and every host on the link processes each broadcast. 2. **Long lifetimes** cut that traffic but leave a wrong mapping in place for as long as the entry lives. 3. **Confirmation-based schemes** avoid the choice: keep using an entry while traffic proves it works, and probe only when nothing does. Some systems apply IPv6 Neighbor Discovery's state machine to ARP for exactly this reason. Whatever an implementation picks is its own default. Lifetimes in use range from about a minute, the scale RFC 1122 suggests where proxy ARP is in use, to several hours on some routers. Neither end is a protocol value. ## Static versus dynamic entries | | Dynamic entry | Static entry | |---|---|---| | Origin | learned from ARP requests and replies | typed in by an administrator | | Lifetime | flushed by the implementation's mechanism | kept until removed | | Updated by received ARP | yes, by RFC 826's merge | not in common implementations | | Follows a MAC change | eventually | never | | Typical use | everything | a few critical neighbours, or devices that answer ARP badly | Static entries are not part of any ARP specification; they are an implementation feature. Their appeal is that a forged reply cannot overwrite them. Their cost is that nothing ever corrects them, and they must be maintained on every host that holds one. ## Flushing by hand RFC 826 already anticipated it: "Perhaps manually resetting (or clearing) the address mapping table will suffice." Clearing one entry, or the whole cache, is the operator's tool when an entry is known to be wrong. The next packet triggers a fresh request, so clearing a dynamic entry is cheap; clearing a static one means it is gone until someone adds it back. ## Misconceptions - "The standard ARP timeout is N minutes" is false for any N; the RFCs fix no lifetime. - "Shorter is always better" ignores the broadcast load RFC 1122 itself warns about. - "A static entry expires, just more slowly" confuses static with a long-lived dynamic entry.
- With a long ARP timeout, how else can a host notice that an entry has gone bad?RFC 1122 names three alternatives to waiting: unicast-poll the cached MAC and delete the entry after a couple of unanswered polls; take link-layer advice when the driver detects a delivery failure; or take higher-layer advice when the internet or transport layer sees no progress to that neighbour. Combined with a timeout, they shorten the window without shortening the lifetime.
- When is a static ARP entry the right choice, and what does it cost?It suits a small number of critical, rarely changing neighbours, such as a gateway on a segment where forged replies are a concern, or a device that answers ARP unreliably. The cost is maintenance: a hardware change silently breaks traffic until every host holding the entry is edited, and nothing on the network will warn you.
saying these in an interview costs you the question
- RFC 826 defines the ARP entry lifetime that every host uses.
- The ARP timeout is fixed by the standard and cannot be configured.
- Static ARP entries expire too, just on a longer timer.
- A static ARP entry updates itself when the neighbour's NIC is replaced.
- Shorter ARP timeouts are always better because stale entries vanish sooner.