Recall that IP datagrams are forwarded over networks from host to
router, router to router and router to host, and that every host
and router has (at least one) unique IP address. From today's
lecture, we also see that they also have a separate, unique
MAC address -- used to address frames in the
network.
The Address Resolution Protocol provides a
mapping between IP addresses and MAC addresses. For example, in the
case of IP local delivery (see earlier) the router or host knows
the IP address of the destination machine, and also knows (from
examination of the network/subnet address) that it is connected to
the same network. In order to deliver the datagram, it:
First broadcasts an
ARP-request. In effect, the broadcast asks (eg)
"Which one of you guys is
149.144.21.60?".
The host whose IP address is 149.144.21.60
replies with its MAC address.
The datagram is then encapsulated into a frame with the correct
destination MAC address and placed "on the wire". The destination
system notes its own MAC address as the frame's destination and
picks up the frame, delivering the datagram to the IP
software.
Systems which use IP keep an ARP cache of recent
IP-to-MAC mappings to avoid the need for repeated ARP-requests.
This "ARP Table" can usually be examined by the system manager. ARP
is considered to be the "last hop" routing protocol for IP packets.