ARP - determining the next hop MAC address
ARP is a protocol that is used to determine the MAC address of the host that has been assigned a particular IPv4 address. However, in each case, the actual IP address that is used in the ARP request changes depending upon where the source and destination hosts reside.
ARP is used to determine the MAC address of the next hop device.
Refer to the following diagram:
H1, H2, and the Gi0/2 interface of C1 are all in the same subnet. Similarly, H3, H4, and the Gi0/2 interface of C2 are all on the same subnet.
When H1 sends a packet to H2, it will use ARP to determine the MAC address of H2. Because H2 is in the same subnet, the next hop in this communication is H2 itself.
However, when H1 sends a packet to H3, it will use ARP to determine the MAC address of the Gi0/2 interface of C1, which is the next hop, and not that of H3 which exists in another subnet.
Remember ARP requests use broadcasts, which are limited to the specific subnet or broadcast domain within which they are generated. In the above example, the C1 router is considered a boundary of the broadcast domain, and it will not relay any ARP requests beyond C1 to other subnets.
The only exception to this rule is the use of Proxy Arp.