Address Resolution Protocol (ARP) is the small protocol that lets a host on an IPv4 network find the hardware (MAC) address that belongs to an IP address on the same link. It is defined in RFC 826 from November 1982, it runs on almost every Ethernet and Wi-Fi network, and it is a favorite topic in networking and embedded interviews. This post first explains ARP in plain words, then works through 29 interview questions and answers with the packet format, the exact receive rules and the common traps.
ARP in plain words
IP addresses tell a packet which host it is going to. Ethernet, however, only delivers frames to MAC addresses. Before a host can send an IP packet to a neighbor on the same network, it needs the neighbor's MAC address. ARP is how it asks.
The exchange is simple. The sender shouts to everyone on the link: "Who has 192.168.1.20? Tell 192.168.1.10." Every host hears the question, because it goes to the broadcast address. Only the host that owns 192.168.1.20 answers, and it answers directly to the asker: "192.168.1.20 is at 00:11:22:33:44:55." The asker stores that answer in a table called the ARP cache, so it does not have to ask again for every packet.
Why it matters
- Every IPv4 conversation on a LAN starts with it. If ARP fails, nothing above it works, even though the IP settings look correct.
- It is trusting by design. ARP has no authentication, so any host can answer for any address. That is how ARP spoofing attacks work, and why switches offer features such as dynamic ARP inspection.
- Embedded engineers implement it. A microcontroller with an Ethernet MAC and a small TCP/IP stack must answer ARP requests correctly, or other devices cannot reach it.
When you meet ARP in practice
- Running
arp -a(Windows) orip neigh(Linux) to see the cache when two devices cannot talk. - Seeing a burst of "Who has" frames in a packet capture right after a device boots or changes its address.
- Getting an "IP address conflict" warning, which the operating system detects with ARP probes.
- Working with IPv6, where ARP is not used: its job is done by Neighbor Discovery, defined in RFC 4861.
What can go wrong
- Stale entries. If a device is replaced but keeps its IP address, neighbors may keep sending to the old MAC address until their cache entry expires or is refreshed.
- Duplicate addresses. Two hosts configured with the same IP address both answer ARP requests, and traffic flips between them. Modern systems probe with ARP before using an address to catch this.
- No reply. If the target is switched off or on another network, the request goes unanswered and the sender reports the host as unreachable.
- Remote destinations. ARP never crosses a router. To reach a host on another network, the sender asks for the MAC address of its default gateway instead, and the router takes it from there.
Deep dive: the numbers and details
This part holds the interview questions, the packet format, field values and the exact receive rules. Skip it if the overview is all you need.
Quick reference: key numbers
| Item | Value |
|---|---|
| EtherType for ARP | 0x0806 |
| Hardware type for Ethernet | 1 |
| Protocol type for IPv4 | 0x0800 |
| Hardware and protocol address lengths (Ethernet, IPv4) | 6 bytes and 4 bytes |
| Opcodes | 1 = request, 2 = reply |
| ARP packet size (Ethernet, IPv4) | 28 bytes |
| Recommended maximum request rate (RFC 1122) | 1 per second per destination |
The full list of hardware types and opcodes is kept by IANA in the ARP parameters registry.
1. What is ARP?
Address Resolution Protocol (ARP) is a network protocol that maps a network layer protocol address to a data link layer hardware address. For example, ARP is used to resolve an IP address to the corresponding Ethernet address.
2. To which OSI layer does ARP belong?
ARP is usually placed at the data link layer (Layer 2), and some texts describe it as sitting between Layers 2 and 3. Its packets are carried directly inside Ethernet frames (EtherType 0x0806), not inside IP packets, but its purpose is to serve the network layer. ARP is implemented by the network protocol driver or the TCP/IP stack. In an interview, saying "Layer 2, serving Layer 3" and explaining why shows you understand it.
3. Which RFC specifies the requirements for ARP?
RFC 826 specifies the ARP packet format and the receive algorithm. Later documents add to it: RFC 1122, section 2.3.2 sets host requirements such as cache flushing and flood limits, and RFC 5227 defines IPv4 address conflict detection with ARP probes and announcements.
4. What is the use of ARP?
A host on an Ethernet network can send a frame to another host only if it knows that host's Ethernet (MAC) address. Higher level protocols such as IP use a different addressing scheme from the hardware addressing used by the link. ARP gets the Ethernet address of a host from its IP address, and every IPv4 host on an Ethernet network uses it.
5. Why does an IP address need to be mapped to a MAC address? Why can't the MAC address itself be used as the IP address?
The two addresses do different jobs. A MAC address is assigned to the network interface, usually by its manufacturer, and identifies the hardware on one link. An IP address is assigned by the network administrator according to where the host sits in the network, so routers can forward packets by prefix. A host keeps its MAC address when it moves to another network, but gets a new IP address there. The sizes also differ: an Ethernet MAC address is 6 bytes and an IPv4 address is 4 bytes, so one cannot simply be written as the other. A mapping between the two is therefore needed on every link, and ARP provides it.
6. Can ARP be used in a network other than Ethernet?
Yes. ARP is a general protocol that can be used on any broadcast-capable network. Fields in the ARP packet state the type of hardware address and the type of protocol address. ARP is used with most IEEE 802 LAN media, including Wi-Fi, and was also used with FDDI and Token Ring, in the same way as with Ethernet.
7. How does ARP resolve an IP address to an Ethernet MAC address?
When ARP needs to resolve an IP address, it broadcasts an ARP request. The request carries the sender's MAC address, the sender's IP address and the target IP address. Every host on the local network receives it. The host that owns the target IP address sends an ARP reply directly to the requester, carrying its own MAC address.
8. What is an ARP cache?
ARP keeps the mapping between IP addresses and MAC addresses in a table in memory called the ARP cache. Entries are added and removed dynamically.
9. When is an ARP request packet generated?
These steps lead to an ARP request:
- The IP module hands a packet, destined for another host on the network, to the ARP module.
- The ARP module looks up the ARP cache to resolve the IP address.
- If the IP address is in the cache, it is resolved to its Ethernet address.
- If there is no entry, the ARP module sends an ARP request through the Ethernet driver. RFC 1122 asks hosts to keep at least the latest packet queued while they wait, rather than dropping it.
- Once the address is resolved, the packet is passed to the Ethernet driver for transmission.
10. What happens when a host receives an ARP request packet?
Because the request is a broadcast, every host on the network receives and processes it. RFC 826 defines the steps:
- Check that the hardware type and protocol type are supported; if not, discard the packet.
- If the cache already holds an entry for the sender's IP address, update that entry with the sender's MAC address. This happens whether or not the request is for this host.
- If the target IP address is not this host's address, discard the packet.
- If it is this host's address, add the sender's IP to MAC mapping to the cache (if step 2 did not already update it) and send an ARP reply with this host's MAC address.
11. Will a host update its ARP cache upon receiving any ARP request?
Partly. Under RFC 826, a host refreshes an entry it already holds for the sender, even when the request is not for it. It adds a new entry only when the request is addressed to its own IP address. Requests for other hosts never create new entries.
12. What is the disadvantage if a host adds a cache entry for every ARP request it sees?
The cache would fill with entries for hosts it never talks to, wasting memory and pushing out useful entries. That is why new entries are created only for requests addressed to the host.
13. What happens when a host receives an ARP reply packet?
The reply is sent directly to the host that sent the request, not broadcast. That host's ARP module adds the MAC address to IP address mapping from the reply to its cache, then sends any packet that was waiting for it.
14. Is there a separate packet format for ARP request and ARP reply?
No. Requests and replies use the same format; only the operation field differs.
15. Which MAC address is an ARP request directed to?
An ARP request is sent to the Ethernet broadcast address, FF:FF:FF:FF:FF:FF, so that every host on the network receives it.
16. To which MAC address is an ARP reply packet directed?
To the MAC address of the host that sent the ARP request.
17. If a host does not know the other host's MAC address, how does it know its IP address?
The IP address comes from a different mechanism: a static file such as /etc/hosts, or a DNS lookup. ARP only starts once the IP address is known.
18. What will happen if an ARP reply is not received for an ARP request?
The IP address cannot be resolved to an Ethernet address, so the packet cannot be sent. The stack retries a few times, and RFC 1122 requires it to limit retries (the recommended maximum is one request per second per destination) so that it does not flood the network. If no reply arrives, the stack reports the host as unreachable.
19. When is an entry added to the ARP cache?
When an IP address is successfully mapped to a MAC address, from a reply or from a request addressed to this host. Most entries are added dynamically, but static entries can also be configured by an administrator.
20. What happens if an ARP request arrives and the mapping is already in the ARP cache?
The existing entry is overwritten with the sender's addresses from the request. This keeps the cache current when a host's MAC address changes.
21. When is an entry removed from an ARP cache?
After a timeout. RFC 1122 requires hosts to have a way to flush out-of-date entries and says the timeout should be configurable, but it does not fix a value, so it varies between operating systems (20 minutes is one example used by some implementations). Static entries are not aged out.
22. What is the format of an ARP packet?
The fields of an ARP request or reply and their lengths are shown below:
+--------+
Hardware 2 bytes
MAC
Address
Type
+--------+
Protocol 2 bytes
Address
Type
+--------+
Hardware 1 byte
MAC
Address
Size
+--------+
Protocol 1 byte
Address
Size
+--------+
Op 2 bytes
+--------+
Sender 6 bytes (depends on the above size field)
MAC
Address
+--------+
Sender 4 bytes (depends on the above size field)
IP
Address
+--------+
Target 6 bytes (depends on the above size field)
MAC
Address
+--------+
Target 4 bytes (depends on the above size field)
IP
Address
+--------+
The fields are further explained below:
+---------+-------------------------------------------------------+
Ethernet For a ARP request, source MAC address is the MAC
Header address of the host sending the ARP request,
destination MAC address is the Ethernet broadcast
address (FF:FF:FF:FF:FF:FF), frame type field is 0x806.
For ARP reply, source MAC address is the MAC address of
the host replying to the ARP request, destination MAC
address is the MAC address of the host that sent the
ARP request, and the frame type field is 0x806.
+---------+-------------------------------------------------------+
Hardware Type of the hardware MAC address which is being mapped.
Address For Ethernet the value of this field is 1.
Type
+---------+-------------------------------------------------------+
Protocol Type of the protocol address to which the MAC address
Address is mapped. For IP address the value of this field is
Type 0x800.
+---------+-------------------------------------------------------+
Hardware Size of the hardware MAC address. For Ethernet, the
Address value of this field is 6.
Size
+---------+-------------------------------------------------------+
Protocol Size of the protocol address. For IP, the value of
Address this field is 4.
Size
+---------+-------------------------------------------------------+
OperationType of operation being performed. The value of this
field can be 1 (ARP request), 2 (ARP reply)
+---------+-------------------------------------------------------+
Source The hardware MAC address of the host sending the ARP
MAC request or reply. This is same as the source MAC
address address present in the Ethernet header.
+---------+-------------------------------------------------------+
Source The IP address of the host sending the ARP request or
IP reply.
address
+---------+-------------------------------------------------------+
Target The hardware MAC address of the host receiving the ARP
MAC request or reply. This is same as the destination MAC
address address present in the Ethernet header.
+---------+-------------------------------------------------------+
Target The IP address of the host receiving the ARP request
IP or reply.
address
+---------+-------------------------------------------------------+
23. What is the size of an ARP request and reply packet?
For Ethernet and IPv4, the ARP packet is 28 bytes: 8 bytes of fixed fields plus two 6-byte MAC addresses and two 4-byte IP addresses (8 + 12 + 8 = 28). Ethernet needs at least 46 bytes of payload, so the frame is padded with 18 bytes, giving a 64-byte minimum frame on the wire including the 14-byte header and 4-byte frame check sequence.
24. How do you tell an ARP request from an ARP reply, since the Ethernet type field is the same?
By the operation field in the ARP packet: 1 for a request and 2 for a reply.
25. Why is the MAC address present in both the Ethernet header and the ARP packet?
The Ethernet header is processed by the data link driver and removed before the packet reaches the ARP module. ARP still needs the hardware and protocol addresses to update its table, so they are repeated inside the ARP packet. It also keeps ARP independent of the link type.
26. What is proxy ARP?
Proxy ARP is when one system answers an ARP request on behalf of another. For example, host A sends an ARP request for host B's IP address, and host C answers with its own MAC address instead of host B. The technique is described in RFC 1027.
27. What is the use of proxy ARP?
A router can answer ARP requests for hosts that sit on another network. Say host A is on one network, host B on another, and router C connects them. When host A sends an ARP request for host B, router C replies with its own MAC address. Host A then sends all packets for host B to router C, which forwards them. Proxy ARP also helps when a host does not understand subnetting: if hosts A and B are on different subnets but host A assumes they are on the same network, a router using proxy ARP can carry traffic between them.
28. What is gratuitous ARP?
Gratuitous ARP is an ARP packet a host sends about its own IP address, without being asked. In the common form, the sender and target IP addresses are both the host's own address and the destination MAC address is the broadcast address, FF:FF:FF:FF:FF:FF. RFC 5227 calls this form an ARP announcement. It also defines an ARP probe, in which the sender IP address is all zeros so that the probe does not change other hosts' caches.
29. What is the use of gratuitous ARP?
- Detecting duplicate addresses. On a correctly configured network, nobody answers a request for the sender's own address. If another host replies, it is using the same IP address. RFC 5227 notes that a single gratuitous ARP is not reliable for this, and specifies a better procedure: send three ARP probes 1 to 2 seconds apart, and only claim the address if nobody answers, then send two announcements 2 seconds apart.
- Updating other hosts' caches. When a network card is replaced, or an address moves to another machine in a failover cluster, the IP to MAC mapping changes. The host broadcasts a gratuitous ARP, and other hosts that already have an entry for that IP address update it (see question 10, step 2).
Common interview traps
- "ARP works across routers." It does not. ARP resolves addresses only on the local link. For a remote destination, the host ARPs for its default gateway's MAC address.
- "Every host adds every request to its cache." No. Only existing entries are refreshed; new ones are added only by the target (questions 10 and 11).
- "ARP is used with IPv6." No. IPv6 uses Neighbor Discovery over ICMPv6 (RFC 4861).
- "ARP is secure." It has no authentication, so forged replies can redirect traffic. Defenses live in the network (switch inspection) or in higher layers (encryption).
Further reading
- RFC 826: An Ethernet Address Resolution Protocol (David C. Plummer, 1982)
- RFC 1122, section 2.3.2: ARP requirements for hosts
- RFC 5227: IPv4 Address Conflict Detection (Stuart Cheshire, 2008)
- RFC 1027: Using ARP to implement transparent subnet gateways (proxy ARP)
- RFC 4861: Neighbor Discovery for IPv6


Your comments will be moderated before it appears here.