If a host has the IP address of where it would like to send traffic, how does it know what MAC address to send it to? Address Resolution Protocol was built to solve this problem. ARP determines the MAC address in one of two ways:
On-Net means that the IP address the host is trying to learn the MAC for exists on a connected or local subnet.
Off-Net means that the IP address the host is trying to learn the MAC for exists on an outside network (not local).
In order for a device to obtain the MAC address of a host it has the IP for on-net, the host machine will send out an ARP request to the broadcast address of the subnet it’s on. So this frame will be processed by every device on the network. If one of the hosts has the IP it will respond back with an ARP Reply which basically is a message that includes the MAC address of itself so the originating workstation can begin forwarding traffic to it across the LAN.
If the IP address belongs to a host that is not connected, or not local, (outside of the local network like the internet) the host machine will instead begin forwarding traffic to it’s default gateway. If it is unaware of the MAC address for it’s gateway then it will ARP for the MAC of the gateway first on-net since the gateway is on-net before sending the traffic to the gateway.