What is ARP protocol?
The ARP full form is Address Resolution Protocol. From full form says that the protocol is to resolve the destination address of a network packet. To understand the purpose of the ARP protocol, we need to understand the message routing over the internet or IP network. For example, if you are using the computer which is connected to the LAN over wifi router. The router assigns an internal or LAN IP address (e.g 192.168.1.4) to the computer connected to LAN via DHCP (maybe a static IP as well). There might be other computers also connected to the wifi router, all get an IP address. You can consider a connection between computer and wifi router as a communication link. So there may be multiple links, the number of links depends on the connected devices to the router. If you browse a website from the web browser. The request is sent to the router and in response router sends the request to the public server, hosting the website. When a response comes, the router knows the IP address of your LAN computer but does not know which device to send. Here comes the ARP protocol. From ARP, the router gets the physical address of the device or computer on LAN. The router sends the response to the device to which the message needs to deliver.
From the above example, it is clear what is the role of ARP in computer networks. Now how the translation is done we will discuss. When the sending device needs to send a message, it broadcast the ARP request with the destination IP address. All devices over LAN gets the request. But the device which matches the self IP address with the address in ARP request. It only sends an ARP response back to the sending device with its own MAC address.
In computer networks, there are various layers of protocols. Each layer has addressed for communication over the network. ARP is the protocol that works as layer 2 of the OSI model. Means ARP works on the data link layer. It has an interface with the network layer, which initiates the ARP request.