ELEC3506

Data LinkLecture 314 min

ARP — Address Resolution Protocol

How a host with only an IP address finds the matching MAC address, and the fields the request and reply packets actually carry.

By the end of this page you should be able to

  • State what ARP resolves and describe its broadcast-query mechanism
  • List the fields of an ARP packet and what each one carries
  • Read an ARP operation code and say whether it is a request or a reply
  • Explain why ARP sits awkwardly between the network and data link layers

The idea

Module 1 already set up the gap this fills: a router or host can know the next hop’s logical (IP) address without knowing its physical (MAC) address, and a frame cannot be built without one. ARP — the Address Resolution Protocol — is the mechanism that closes that gap.

How it works

How it works

Broadcast, then only one reply

  1. The host or router forms a broadcast ARP query packet that includes the IP address it is trying to resolve.
  2. It broadcasts that packet over the network.
  3. Every host on the network receives and processes it.
  4. Only the host that recognises the IP address as its own replies, sending back its physical address.

The lecture’s own shorthand for this: N for the IP address being resolved, L for the physical address being sought.

Check yourself

A query goes out for IP address N. Five other hosts on the network are not N’s owner. What do they do with the broadcast?

Answer: they receive and process it — that is unavoidable, since it is a broadcast — but each one recognises it is not the target and does not reply. Only the host that owns N sends back its physical address, L.

The ARP packet

The slides reference an ARP packet diagram without the field content being extracted from the text — this page’s field list and widths were not stated by the lecture. They are the standard RFC 826 layout for Ethernet/IPv4 ARP, which is what the lecture’s own referenced diagram draws from:

An ARP packet: 2-byte hardware type, 2-byte protocol type, 1-byte hardware address length, 1-byte protocol address length, 2-byte operation code, 6-byte sender hardware address, 4-byte sender protocol address, 6-byte target hardware address, and 4-byte target protocol address.BYTESHardware Type2 BProtocol Type2 B11Operation2 BSender Hardware Address6 BSender Protocol Address4 BTarget Hardware Address6 BTarget Protocol Address4 B
Operation 1 is a request, 2 is a reply — the target hardware address is left blank in the request because finding it is the whole point of sending one.

How it works

What each field carries

  • Hardware Type / Protocol Type — which physical network and which higher-layer protocol this ARP packet applies to (Ethernet and IPv4, in the ordinary case).
  • HLEN / PLEN — the length, in bytes, of the hardware address and the protocol address used here. Kept as separate fields because ARP is not tied to one specific addressing scheme.
  • Operation1 for a request, 2 for a reply.
  • Sender Hardware Address / Sender Protocol Address — the MAC and IP address of whoever sent this packet.
  • Target Hardware Address / Target Protocol Address — the MAC and IP address of who the packet is about.

Where marks get lost

The Target Hardware Address is blank in a request — on purpose

A request and a reply share the same packet format. In a request, the sender fills in its own hardware and protocol addresses and the target’s protocol address — but the Target Hardware Address is left blank, because finding that value is the entire reason the packet was sent. It only gets filled in on the way back, in the reply.

Aside

ARP does not sit cleanly inside a single OSI layer. It consumes a network-layer input — an IP address — and produces a data-link-layer output — a MAC address — so different textbooks draw the boundary differently. This is not something to resolve; it is worth knowing only so an exam question naming “the layer ARP belongs to” does not read as having one clean answer.

In the exam

  • What ARP resolves. IP address known, MAC address needed, on the same network.
  • The four-step mechanism. Form the query with the IP address, broadcast it, every host processes it, only the owner replies with its MAC address.
  • Operation codes. 1 = request, 2 = reply.
  • Why Target Hardware Address is blank in a request. It is what the request exists to discover.
  • Field widths are RFC 826-sourced, not lecture-stated. Say so if asked where they come from.
  • ARP’s layer. Genuinely ambiguous — it uses a network-layer address to produce a data-link-layer one. Do not force a single confident answer.

Check yourself

  1. A host knows the IP address of another host on its network but not its MAC address. What does it do?
  2. An ARP query is broadcast on the local network. What does a host that is NOT the target do with it?
  3. In an ARP packet, what value in the Operation field marks a reply, and what does a value of 1 mean?
  4. Why is ARP awkward to place cleanly into either the network layer or the data link layer?