Octet

Which OSI layer does ARP belong to?

Show the answer

Say this first

ARP is carried directly inside an Ethernet frame with EtherType 0x0806, with no IP header, so by encapsulation it is layer 2. Its job is to map a layer 3 address (IPv4) to a layer 2 address (MAC), so it serves layer 3. I say it sits between the two, which is why people call it "layer 2.5". The answer the interviewer wants is that reasoning, not a single number.

Go deeper

The evidence for each side

  • Layer 2 argument. ARP messages are never routed. They have no TTL and no IP header. A router does not forward an ARP request to another network.
  • Layer 3 argument. ARP exists only because IP needs a MAC to build a frame. Its fields carry IPv4 addresses, and the ARP cache is consulted by the IP stack.

The ARP packet (IPv4 over Ethernet)

FieldValue
Hardware type1 (Ethernet)
Protocol type0x0800 (IPv4)
Hardware and protocol address lengths6 and 4
Opcode1 request, 2 reply
Sender MAC, sender IP, target MAC, target IP28 bytes total

The 28-byte ARP payload is padded to the 46-byte Ethernet minimum.

Traps

  • Saying "layer 3" flatly. ARP has no IP header and is never routed.
How did you do?Book 3.3 Internet (IP)