What is ARP? How does it works?
Arp (Address Resolution Protocol) is a computer networking protocol used to determine the Media Access Control address (MAC) of a device on a network. When an application requests to connect to a remote computer, ARP provides the IP address and MAC address of the target computer so that the connection can be established.

The main purpose of ARP is to map between IP addresses and MAC addresses in order to allow devices to communicate on a network. When a device sends a datagram to another device on the network, the source and destination mac addresses are checked against an active ARP table to determine the proper hardware address for the communication.

ARP works by having each device running a small program called an "ARP monitor" that listens on the network for incoming data packets. Whenever a packet with a specific Ethernet frame type arrives at a device, the arp monitor calculates the hardware address associated with the sender's IP address using its own tables. The arp monitor then updates its local ARP table with this information.

When a device needs to send a message out onto the network, it looks up the physical address of the recipient in its ARP table. It then checks if there is already a pending request for the same address from that machine. If there is not, the device generates an ARP request and passes it to its neighbors on the network. Each neighboring device then replies back with its own MAC address, which the device uses to complete the transmission.

Overall, ARP is a fundamental component of Internet Protocol (IP), allowing computers to easily identify and connect to other devices on the network. However, as with any technology, misuse or misconfigurations of ARP can lead to security vulnerabilities and interference with network traffic.