1 | initial version |
This is same for clients, servers, routers, etc. An ARP request is sent when there isn't an ARP entry for the destination address. The destination address is in the same subnet as the local interface. The exception is multicast because it uses a special MAC because it is not assigned to any device.
An example if your PC address is 192.168.1.2 subnet mask 255.255.255.0, gateway 192.168.1.1. The PC will check its ARP table for any traffic with the destination address in the range 192.168.1.0 - 192.168.1.254 excluding 192.168.1.2. The address 192.168.1.255 is broadcast and it is assigns ff:ff:ff:ff:ff:ff.
If the user was to try to ping 192.168.1.5, the PC checks the ARP table for 192.168.1.5. If it finds an entry, it uses the entry as the destination MAC. If there isn't an ARP entry, it must send ARP request. If it doesn't receive an ARP reply, the application will timeout.
If the user was to try to ping 8.8.8.8, the PC checks for an ARP entry for the gateway 192.168.1.1 (this is from my example). The destination mac address for 8.8,8,8 will be the MAC address for 192.168.1.1.