ARP
The Address Resolution Protocol (ARP) is a communication protocol used for discovering the link layer address, such as a MAC address, associated with a given internet layer address, typically an IPv4 address.
ARP is the mechanism by which the network layer can discover the link address associated with a network address it’s directly connected to.
ARP is needed because each protocol layer has its own names and addresses.
- Generates mappings between layer 2 and layer 3 addresses
- Simple request-reply protocol
- Request sent to link layer broadcast address
- Reply sent to requesting address (not broadcast)
- Packet format includes redundant data
- Request has sufficient information to generate a mapping
- Makes debugging much simpler
- No “sharing” of state: bad state will die eventually
ARP Packet Format
Example
RFC 826 - An Ethernet Address Resolution Protocol: Or Converting Network Protocol Addresses to 48.bit Ethernet Address for Transmission on Ethernet Hardware
Let there exist machines X and Y that are on the same 10Mbit Ethernet cable.
They have Ethernet address EA(X) and EA(Y) and DOD Internet addresses IPA(X) and IPA(Y).
Let the Ethernet type of Internet be ET(IP).
- Machine X has just been started, and sooner or later wants to send an Internet packet to machine Y on the same cable.
- X knows that it wants to send to IPA(Y) and tells the hardware driver (here an Ethernet driver) IPA(Y).