ARP protocol (Address Resolution Protocol) is a network protocol used to resolve connections between IPv4 addresses (IPv6 has its own systems) and MAC addresses in Ethernet networks. It enables communication within a local network using internal IP addresses instead of MAC addresses. Technically, the communication still happens using MAC addresses, but now the IP address can be changed into a MAC address.
The ARP protocol works as follows:
1. When a device wants to send a data packet to another device within the same local network using an IP address (such as 192.168.0.1), it first checks its own ARP cache (ARP table). The ARP cache contains pairs where IP addresses correspond to MAC addresses.
2. If the MAC address of the recipient of the data packet is not found in the ARP cache, the sending device sends an ARP request (ARP Request) to the entire local network (broadcast). This request includes the recipient's IP address ("Who has the IP address 192.168.0.1?").
3. When the recipient receives an ARP request, it checks if its own IP address matches the request. If the recipient's IP address matches the request, it sends an ARP response (ARP Reply) back to the sender. This response includes the recipient's MAC address ("I have! IP address 192.168.0.1 corresponds to MAC address aa:aa:aa:aa:aa:aa").
4. When the sending device receives an ARP response, it updates its ARP cache with the corresponding IP address and MAC address ("From now on, remember that 192.168.0.1 was found with MAC address aa:aa:aa:aa:aa:aa").
5. When the sending device receives the recipient's MAC address in the ARP response, it can use this information to send the data packet to the correct recipient.
Test your knowledge
What does the ARP protocol do in Ethernet networks?
Why is the ARP protocol needed?
Ready to become an ethical hacker?
Start today.
As a member of Hakatemia you get unlimited access to Hakatemia modules, exercises and tools, and you get access to the Hakatemia Discord channel where you can ask for help from both instructors and other Hakatemia members.