ARP - Address Resolution Protocol
ARP - Address Resolution Protocol
IP packets are sent to the data link layer. If the data link layer is using
a point-to-point link then no address is needed, but if the data link layer
is on a broadcast medium like a LAN, then the frame generated for the IP
packet must be given a LAN data link address (e.g. Ethernet or Token Ring).
How does the IP address get mapped to the correct Ethernet address?
Hosts on the Internet also have unique-to-the-world NIC addresses. Why
not use that for the IP address?
-
Not all hosts have NICs (PPP connections, mobile devices, TVs, etc)
-
The IP address contains a network portion for routing. NIC addresses are
only divided by manufacturer, they give no hint about where a host is attached
to the net.
The network layer looks at the IP address, sees that it is either the local
network or a remote network. If it is local, then the host sends an ARP
request (which is broadcast to all hosts on the local net) asking "who
has this IP address?" All NICs examine this broadcast frame and the machine
who is configured with that IP address responds to the ARP request with
a frame containing its own LAN address. Caching isused thereafter to improve
performance but maintain flexibility. ARP frees network administrators
from having to configure and maintain the IP/LAN address mapping.
For remote addresses the host might know to send to the NIC of the proper
router, or the routers might know the hosts on their networks and respond
to the ARP (known as proxy ARP).
Another related problem is the assignmet of IP addresses to diskless
workstations. NIC addresses live in ROM on the NIC, but IP addresses are
an attribute of the OS, and hence live on disk. When a machine without
a disk boots it can use RARP to find out what IP address it should use.
Each network must have a RARP server to respond to these requests since
routers don't pass data link broadcast frames.
So where does ARP fit? The network layer or the data link layer?
The network layer doesn't know about LAN addresses, since those are
data link addresses. But the data link layer doesn't know about IP addresses.
ARP sits between the IP and the Ethernet driver (which after all are both
portions of the kernel). The best answer is that it is part of the network
layer, since it is in charge of a table of IP-Ethernet mappings into which
the Ethernet driver (data link layer) can do its job.