Names, time and addressesLayer 2RFC 826

ARP: who has this IP?

How your laptop finds the hardware address of a neighbour on the same network.

Ports and use: Carried directly in Ethernet frames

In one sentenceARP asks the whole local network "who has this IP address?" and the owner answers with its hardware (MAC) address.

Think of it like thisIt is shouting a name in a room and waiting for that person to wave, so you know who to talk to.

Watch it happen

3 steps and 2 byte-by-byte decodes. Use the buttons or the arrow keys. Hover or focus a field to find its bytes.

  1. Your laptop
  2. Router (192.168.1.1)
  1. Broadcast: "Who has 192.168.1.1?"Your laptop to Router (192.168.1.1)
  2. Reply: "That is me"Router (192.168.1.1) to Your laptop
  3. Your laptop remembersYour laptop to Your laptop

Step 1 of 3 Broadcast: "Who has 192.168.1.1?"

Your laptop → Router (192.168.1.1)

To reach the internet, your laptop must send frames to the router's hardware address. It only knows the router's IP address, so it asks everyone on the network.

ARP request in an Ethernet frame 42 bytes

ff ff ff ff ff ff aa bb cc 00 00 02 08 06 00 01 08 00 06 04 00 01 aa bb cc 00 00 02 c0 a8 01 0a 00 00 00 00 00 00 c0 a8 01 01

FieldBytesWhat it means
Ethernet destinationff ff ff ff ff ffff:ff:ff:ff:ff:ff is the broadcast address, so every device on the network receives it.
Ethernet sourceaa bb cc 00 00 02aa:bb:cc:00:00:02: your laptop's hardware address.
EtherType08 060x0806 means the frame carries an ARP message.
Hardware type00 011 means Ethernet.
Protocol type08 000x0800 means the addresses being asked about are IPv4.
Address sizes06 04A hardware address is 6 bytes and an IP address is 4 bytes.
Operation00 011 means request: "who has this IP address?"
Sender hardware addressaa bb cc 00 00 02Your laptop's own hardware address.
Sender IP addressc0 a8 01 0a192.168.1.10: your laptop's own IP address, so the owner knows who is asking.
Target hardware address00 00 00 00 00 00All zeros: that is the answer your laptop is asking for.
Target IP addressc0 a8 01 01192.168.1.1: the address being asked about.

Step 2 of 3 Reply: "That is me"

Router (192.168.1.1) → Your laptop

Only the router owns that IP address, so only it answers, and it sends the reply directly to your laptop.

ARP reply in an Ethernet frame 42 bytes

aa bb cc 00 00 02 aa bb cc 00 00 01 08 06 00 01 08 00 06 04 00 02 aa bb cc 00 00 01 c0 a8 01 01 aa bb cc 00 00 02 c0 a8 01 0a

FieldBytesWhat it means
Ethernet destinationaa bb cc 00 00 02aa:bb:cc:00:00:02: sent only to your laptop.
Ethernet sourceaa bb cc 00 00 01aa:bb:cc:00:00:01: the router's hardware address.
EtherType08 060x0806 means the frame carries an ARP message.
Hardware type00 011 means Ethernet.
Protocol type08 000x0800 means the addresses being asked about are IPv4.
Address sizes06 04A hardware address is 6 bytes and an IP address is 4 bytes.
Operation00 022 means reply.
Sender hardware addressaa bb cc 00 00 01aa:bb:cc:00:00:01: the answer your laptop wanted.
Sender IP addressc0 a8 01 01192.168.1.1: the IP address that was asked about.
Target hardware addressaa bb cc 00 00 02aa:bb:cc:00:00:02: your laptop, the one who asked.
Target IP addressc0 a8 01 0a192.168.1.10: your laptop's IP address.

Step 3 of 3 Your laptop remembers

Your laptop

Your laptop stores "192.168.1.1 is at aa:bb:cc:00:00:01" in its ARP table for a few minutes, so it does not have to ask again for every packet.

Where you meet it

  • Every time a device on a local network needs to send something to another local address.
  • Seeing who is on your network: the ARP table lists nearby devices.
  • Spotting attacks: fake ARP replies are the basis of "ARP spoofing".

Common mistakes

  • Thinking ARP crosses the internet. It works only on the local network.
  • Confusing IP addresses (they change with the network) with MAC addresses (fixed to the network card, though some phones randomise them).
  • Ignoring duplicate IP addresses, which cause two devices to answer the same ARP request.
  • Forgetting that IPv6 replaces ARP with a similar method called neighbour discovery.

Try it yourself

Run these on your own computer and compare the output with the lesson above.

  • arp -aShows the IP and hardware addresses your computer has learned.
  • ip neighLinux: the same table in a newer form.

Back to Network Lab

Addresses and values in the examples are made up for teaching (the 203.0.113.x range is reserved for documentation). Real traffic carries more options and details. Check the standard named above for the full rules.