The Address Resolution Protocol (ARP) is used to translate a manufacturer-dependent MAC address (hardware address) into an IPv4 address. While the hardware address theoretically exists only once worldwide and is difficult to trade, IPv4 addresses are assigned in the INNA (Internet Assigned Numbers Authority) and are limited. This enables communication on Layer-2 (eg Ethernet and WiFi). When a source host needs to send an IPv4 packet to a destination host on the same subnet, it will make an ARP request to get the MAC address of the destination host. The source host sends an ARP request to the Ethernet broadcast address ff: ff: ff: ff: ff: ff. All hosts on the subnet receive the ARP request that was sent, but only the destination host responds to the ARP request with the MAC address associated with the IPv4 address.
Within the Layer 2 frame, the IIv4 packet is encapsulated as soon as the source host has received its MAC address from the destination host. Now the package will be shipped to the destination host.