3

I understand that the Address Resolution Protocol (ARP) has a cache table, which stores the MAC addresses to the according IP addresses until the entry gets removed if it gets not used anymore for some time (timeout).

This timeout depends on the operating system and varies between a few seconds and a couple hours.

I have a router as gateway for a subnet and if that router gets faulty then I plug another router in with the same IP address. The most devices recognize within a few seconds that the IP address is now on another MAC address available, but I have one device which still tries to communicate via the old MAC address which is not available anymore.

I don't think you have to wait up to a few hours (until the timeout) to get the communication working with another device at the same IP address, so I guess there is some mechanism to get that working faster.

How does the ARP protocol handle this situation, when I move an IP address from one device to another?

2
  • Arp cache can last between 1 and 25 minutes by default, depending on the system. Windows is 2 minutes, but with use can be extended every 2 min up to 10 before it is dropped and gathered again. Many linux distros set it at 60 seconds, but routers tend to set things higher (eg, cisco defaults to 20 min). If a system's IP changes, that system will issue a GARP to update all other devices on the local network. If its IP remains, then it will simply try to use the existing MAC until the timer times out and then will re-arp. Most systems have a method to manually flush the arp cache.
    – MaQleod
    Feb 15, 2017 at 22:23
  • Some lower end routers may not initially send a GARP when they are set up either. Some operating systems may also update ARP cache automatically with new entry when traffic comes in with same IP and a different MAC, without the need for new ARP requests. This is a common function for higher end routers and nix based systems. Some systems will also mark an entry as incomplete (such as a gateway since it is defined) and keep trying to re-arp until it gets something, so if the router failed, it will keep trying and as soon as the new one is plugged in, its gets a response and is back up quickly.
    – MaQleod
    Feb 15, 2017 at 22:30

2 Answers 2

2

The operating system should send a Gratuitous ARP message when it detects an IP address change or (usually) when the interface is brought up.

On Linux systems, you can also send one yourself using the arping utility.

4
  • GARPs are typically sent on IP address change, if the IP address doesn't change, then there is no reason for a device to send a GARP. In the case of adding a different router. If you add a router with the exact same settings (and no DHCP), then a device with a fixed IP will not necessarily send a GARP out when the new router comes online.
    – MaQleod
    Feb 15, 2017 at 22:18
  • 1
    Wouldn't the new router start up with an empty cache and make its own ARP queries as necessary?
    – Devin R
    Feb 16, 2017 at 3:15
  • Thanks guys, I found in the meanwhile out, that my router system (OpenWRT) does not send out these Gratuitous ARP Messages for some reason and this causes the problem. In my opinion every device should send out such a packet on its bootup, on an IP address change and when its Ethernet link gets active. It looks as if the ARP timeout on this device is set to 20 minutes. Please see my post there if you are further interested in it: forum.openwrt.org/viewtopic.php?pid=352093 Feb 16, 2017 at 18:05
  • @DevinR, nope, it actually isn't something most SOHO routers do. Most of them are designed with limited functionality to save as much on resources as possible so they can devote what little they have to their primary purpose - routing.
    – MaQleod
    Feb 16, 2017 at 18:29
3

The dynamic ARP cache timeout is usually only about 2 minutes on most systems I believe.

Also, many systems do "gratuitous ARP" -- unsolicited, broadcast ARP announcements -- when they boot, or start using a new IP address, or hot-failover to a different NIC (and thus a new MAC address) for a given IP address. Some devices use these ARP announcements (when they receive them) to update their ARP tables.

2
  • broadcast are UDP. what if a device does not receive this "gratuitous ARP" in LAN. Then what will happen ?
    – Number945
    Aug 18, 2019 at 16:24
  • @BreakingBenjamin Not all broadcasts are UDP. ARP is not UDP- or even IP-based. Gratuitous ARPs are usually sent 2-3 times, and given the extremely low packet error rate of Ethernet LANs, that's plenty reliable.
    – Spiff
    Aug 18, 2019 at 18:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .