<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Arp · Network Doodles</title><link>https://networkdoodles.com/tags/arp/</link><description>Network automation, from first playbook to agentic operations. Ansible, NetBox, MCP, Python and the occasional doodle.</description><language>en-us</language><managingEditor>David Henderson</managingEditor><lastBuildDate>Mon, 16 Nov 2026 09:00:00 -0500</lastBuildDate><atom:link href="https://networkdoodles.com/tags/arp/index.xml" rel="self" type="application/rss+xml"/><item><title>ARP on the Wire: Who Has This Address? (Wireshark 101, Lesson 3)</title><link>https://networkdoodles.com/lessons/wireshark-101/arp/</link><pubDate>Mon, 16 Nov 2026 09:00:00 -0500</pubDate><dc:creator>David Henderson</dc:creator><guid>https://networkdoodles.com/lessons/wireshark-101/arp/</guid><category>wireshark</category><category>packet-capture</category><category>networking-basics</category><category>arp</category><description>ARP on the wire: the broadcast request and unicast reply, the neighbor cache, ARP for the gateway, gratuitous ARP, and a duplicate IP address caught.</description><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>ARP, the Address Resolution Protocol, is how a host finds the MAC address that goes with an IP address on its
own network. It&rsquo;s one question, sent to everyone (<em>who has 192.168.1.20?</em>), and one answer, sent only to the
host that asked (<em>192.168.1.20 is at aa:aa:aa:22:22:22</em>). Hosts remember the answer for a while in a
<strong>neighbor cache</strong>, and only ask for addresses on their own network: for anything further away, they ask
for their gateway.</p>
<p>It&rsquo;s the first thing you&rsquo;ll see in almost every capture you take, and it&rsquo;s where a lot of &ldquo;the network is
flaky&rdquo; problems turn out to live. This lesson reads ARP field by field from the lab&rsquo;s captures, then covers
the cache, the gateway, gratuitous ARP, and what two hosts with one address look like on the wire.</p>
<hr>
<h2 id="why-does-ip-need-arp">Why does IP need ARP?</h2>
<p>An IP packet never travels on its own. On an Ethernet network it&rsquo;s carried inside a <strong>frame</strong>, and the frame
needs a destination MAC address: the address of the network card that should pick it up. The laptop knows
the printer&rsquo;s IP address, <code>192.168.1.20</code>, because someone typed it or DNS gave it. It doesn&rsquo;t know the
printer&rsquo;s MAC address. Nothing in IP tells it.</p>
<p>ARP fills that gap. It&rsquo;s defined in <a href="https://www.rfc-editor.org/rfc/rfc826">RFC 826</a>, from 1982, and it
hasn&rsquo;t needed to change much since. You met it in <a href="/lessons/wireshark-101/what-a-capture-shows/">lesson 1</a>:
before the laptop could send its first ping, it sent an ARP request. Every first conversation with a
neighbor starts like that.</p>
<hr>
<h2 id="whats-in-an-arp-request-and-reply">What&rsquo;s in an ARP request and reply?</h2>
<p>Here&rsquo;s the start of the lab&rsquo;s ARP capture, taken on the laptop&rsquo;s cable while it pings the printer:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">    2 1.071035042 aa:aa:aa:11:11:11 → Broadcast    ARP 42 Who has 192.168.1.20? Tell 192.168.1.175
</span></span><span class="line"><span class="cl">    3 1.071288709 aa:aa:aa:22:22:22 → aa:aa:aa:11:11:11 ARP 42 192.168.1.20 is at aa:aa:aa:22:22:22
</span></span><span class="line"><span class="cl">    4 1.071292167 192.168.1.175 → 192.168.1.20 ICMP 98 Echo (ping) request  id=0x092b, seq=1/256, ttl=64
</span></span></code></pre></div><p>The question, the answer 254 microseconds later, and the ping straight after: 3.5 microseconds after the
answer arrived. The laptop was holding the ping until it knew where to send it.</p>
<p>Open the request in Wireshark&rsquo;s details pane and the ARP layer has nine fields. Four of them are the ones
that matter: two pairs of addresses.</p>
<table>
  <thead>
      <tr>
          <th>Field</th>
          <th>In the request</th>
          <th>In the reply</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><strong>Opcode</strong></td>
          <td><code>request (1)</code></td>
          <td><code>reply (2)</code></td>
      </tr>
      <tr>
          <td><strong>Sender MAC address</strong></td>
          <td>the laptop&rsquo;s, <code>aa:aa:aa:11:11:11</code></td>
          <td>the printer&rsquo;s: <strong>the answer</strong></td>
      </tr>
      <tr>
          <td><strong>Sender IP address</strong></td>
          <td>the laptop&rsquo;s, <code>192.168.1.175</code></td>
          <td>the printer&rsquo;s, <code>192.168.1.20</code></td>
      </tr>
      <tr>
          <td><strong>Target MAC address</strong></td>
          <td><code>00:00:00:00:00:00</code>: unknown, that&rsquo;s the question</td>
          <td>the laptop&rsquo;s</td>
      </tr>
      <tr>
          <td><strong>Target IP address</strong></td>
          <td><code>192.168.1.20</code>: the address being asked about</td>
          <td>the laptop&rsquo;s</td>
      </tr>
  </tbody>
</table>
<p>The other five (hardware type Ethernet, protocol type IPv4, sizes 6 and 4) say what kind of addresses are
being mapped. ARP was designed to work for more than Ethernet and IPv4, and those fields are where that
shows. On an Ethernet network carrying IPv4 they never change.</p>
<p>Notice that the MAC addresses are in the frame twice: once in the <strong>Ethernet header</strong>, which the switch reads
to deliver the frame, and once in the <strong>ARP body</strong>, which the hosts read to learn the mapping. They usually
agree. When you&rsquo;re investigating something odd, check that they do.</p>
<p>An ARP message is small: 42 bytes on the wire, header included. That&rsquo;s 14 bytes of Ethernet header and 28 bytes
of ARP.</p>
<hr>
<h2 id="why-is-the-request-a-broadcast-and-the-reply-unicast">Why is the request a broadcast and the reply unicast?</h2>
<p>The request goes to <code>ff:ff:ff:ff:ff:ff</code>, the <strong>broadcast</strong> MAC address, which Wireshark shows as
<code>Broadcast</code>. It has to: the laptop doesn&rsquo;t know who has the address, so it asks everyone. Every host on the
network receives it, and every host except the owner ignores it.</p>
<p>The reply goes <strong>unicast</strong>, straight to the laptop&rsquo;s MAC address. The printer knows exactly who asked,
because the request told it (the Sender fields). There&rsquo;s no reason to bother anyone else.</p>
<p>That difference decides what a capture sees. In lesson 1&rsquo;s capture of two switch ports, the printer&rsquo;s cable
carried the laptop&rsquo;s ARP request for r1, because it was a broadcast, but not r1&rsquo;s reply, which the switch sent
only to the laptop. If you&rsquo;re capturing on a third host&rsquo;s port and see an ARP request with no reply, that&rsquo;s
normal. It&rsquo;s only a problem if you&rsquo;re on the <em>asker&rsquo;s</em> cable.</p>
<p>The broadcast is also why ARP stops at the router. A router doesn&rsquo;t forward broadcasts: the edge of a
broadcast domain, from Networking 101&rsquo;s <a href="/lessons/networking-101/task-2-2/">lesson on domains</a>, is the edge of
where ARP can ask.</p>
<hr>
<h2 id="why-does-a-host-arp-for-its-gateway-and-not-the-far-host">Why does a host ARP for its gateway and not the far host?</h2>
<p>Because the far host can&rsquo;t hear the question. A host only ARPs for addresses <strong>on its own network</strong>, which it
works out from its own address and subnet mask. For anything else, it sends the packet to its <strong>default
gateway</strong>, the router on its network, so the MAC address it needs is the gateway&rsquo;s.</p>
<p>The lab&rsquo;s capture shows the laptop doing both. After pinging the printer, it pings web, <code>192.168.2.10</code>, on
another network:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">    8 1.423931125 aa:aa:aa:11:11:11 → Broadcast    ARP 42 Who has 192.168.1.1? Tell 192.168.1.175
</span></span><span class="line"><span class="cl">    9 1.424048667 aa:c1:ab:d8:b6:be → aa:aa:aa:11:11:11 ARP 42 192.168.1.1 is at aa:c1:ab:d8:b6:be
</span></span><span class="line"><span class="cl">   10 1.424050834 192.168.1.175 → 192.168.2.10 ICMP 98 Echo (ping) request  id=0x092c, seq=1/256, ttl=64
</span></span></code></pre></div><p>It never asks <em>who has 192.168.2.10?</em>. It asks for <code>192.168.1.1</code>, r1. And the ping in frame 10 carries two
destinations that look like they disagree:</p>
<table>
  <thead>
      <tr>
          <th>Layer</th>
          <th>Destination</th>
          <th>Means</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Ethernet</td>
          <td><code>aa:c1:ab:d8:b6:be</code> (r1)</td>
          <td>the next stop</td>
      </tr>
      <tr>
          <td>IP</td>
          <td><code>192.168.2.10</code> (web)</td>
          <td>the final stop</td>
      </tr>
  </tbody>
</table>
<p>That one frame is the whole of routing. The IP destination stays the same for the whole journey. The Ethernet
destination is rewritten at every hop, and ARP is how each sender finds the next one. (r1&rsquo;s MAC address is
generated when the lab starts, so yours will be different.)</p>
<p>This is also how a wrong subnet mask shows up in a capture. Give the laptop a mask that&rsquo;s too wide and it
thinks web is a neighbor, so it broadcasts <em>who has 192.168.2.10?</em>, and nobody on its network answers (unless the router is set up to
answer on the far host&rsquo;s behalf, which is called <em>proxy ARP</em>). The
capture shows the same question, over and over, with no reply, and no ping ever leaves.</p>
<hr>
<h2 id="what-is-the-neighbor-cache-and-why-do-entries-go-stale">What is the neighbor cache, and why do entries go stale?</h2>
<p>Asking before every packet would be wasteful, so every host keeps the answers in a table: the <strong>ARP cache</strong>,
or <strong>neighbor cache</strong>. On Linux, <code>ip neigh</code> shows it. On Cisco-style routers, <code>show ip arp</code>. When the
laptop wants to send to an address that&rsquo;s in the table, it uses the stored MAC address and sends no ARP at
all.</p>
<p>That&rsquo;s why the lab empties the laptop&rsquo;s cache before each ARP task. Without that, a capture of the laptop
pinging the printer would show the ping and no ARP, because the laptop already knew. It&rsquo;s worth remembering
when you&rsquo;re troubleshooting: <strong>no ARP in a capture doesn&rsquo;t mean ARP is broken</strong>. Usually it means the
answer was already cached.</p>
<p>Entries don&rsquo;t last forever, because the answer can change: a host gets a new network card, a virtual
machine moves to another server, a device is replaced and its address reused. A cached entry that&rsquo;s wrong
sends traffic to a MAC address that isn&rsquo;t there any more. So hosts let entries age, and check them again
before trusting them. How long an entry lives varies by operating system and is configurable. Linux&rsquo;s
<code>ip neigh</code> shows each entry&rsquo;s state, such as <code>REACHABLE</code> (recently confirmed) or <code>STALE</code> (needs checking
before it&rsquo;s trusted again).</p>
<p>You can see a recheck on the wire. The lab&rsquo;s DHCP capture starts with this:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">    1 0.000000000 aa:aa:aa:33:33:33 → aa:aa:aa:11:11:11 ARP 42 Who has 192.168.1.175? Tell 192.168.1.30
</span></span><span class="line"><span class="cl">    2 0.000042375 aa:aa:aa:11:11:11 → aa:aa:aa:33:33:33 ARP 42 192.168.1.175 is at aa:aa:aa:33:33:33
</span></span></code></pre></div><p>Look at the destination of frame 1: not <code>Broadcast</code>, but the laptop&rsquo;s own MAC address. broken-pc already had
an entry for the laptop and was checking it with a <strong>unicast</strong> request, straight to the MAC address it
expected. The laptop confirmed it. Nobody else on the network had to hear the question.</p>
<hr>
<h2 id="what-is-gratuitous-arp">What is gratuitous ARP?</h2>
<p>A <strong>gratuitous ARP</strong> is an ARP message nobody asked for: a host announcing its own mapping to everyone. In the
lab it looks like this:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">    1 0.000000000 aa:aa:aa:33:33:33 → Broadcast    ARP 42 Gratuitous ARP for 192.168.1.20 (Request)
</span></span></code></pre></div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">Address Resolution Protocol (request/gratuitous ARP)
</span></span><span class="line"><span class="cl">    Opcode: request (1)
</span></span><span class="line"><span class="cl">    [Is gratuitous: True]
</span></span><span class="line"><span class="cl">    Sender MAC address: aa:aa:aa:33:33:33 (aa:aa:aa:33:33:33)
</span></span><span class="line"><span class="cl">    Sender IP address: 192.168.1.20
</span></span><span class="line"><span class="cl">    Target MAC address: Broadcast (ff:ff:ff:ff:ff:ff)
</span></span><span class="line"><span class="cl">    Target IP address: 192.168.1.20
</span></span></code></pre></div><p>The giveaway is that the sender IP and the target IP are the same address. It isn&rsquo;t a question; it&rsquo;s an
announcement: <em>192.168.1.20 is me, at this MAC address</em>. <code>[Is gratuitous: True]</code> is in square brackets
because Wireshark worked it out; it isn&rsquo;t a field in the packet. You can filter on it with
<code>arp.isgratuitous == 1</code>.</p>
<p>Hosts send them for good reasons:</p>
<ul>
<li><strong>Bringing an address up.</strong> A host announces its new address so that anyone with an old entry for it
updates straight away.</li>
<li><strong>Failover.</strong> When a standby device takes over an address from a failed one (a redundant router pair, a
server cluster), it sends a gratuitous ARP so every neighbor starts sending to the new MAC address
immediately, instead of waiting for their caches to age.</li>
<li><strong>Conflict detection.</strong> <a href="https://www.rfc-editor.org/rfc/rfc5227">RFC 5227</a> describes how a host can check
that nobody else is using an address before claiming it, and announce it afterwards.</li>
</ul>
<hr>
<h2 id="what-does-a-duplicate-ip-address-look-like-on-the-wire">What does a duplicate IP address look like on the wire?</h2>
<p>Two hosts with the same IP address is a common mistake: a static address typed onto a device that DHCP had
already given out, a cloned virtual machine, a replacement device configured from the old one&rsquo;s notes. The
network doesn&rsquo;t stop it. Both hosts carry on, and both answer ARP for the address.</p>
<p>In the lab, broken-pc briefly takes the printer&rsquo;s address and announces it (the gratuitous ARP above). Then
the laptop looks for the printer:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">    3 0.584692875 aa:aa:aa:11:11:11 → Broadcast    ARP 42 Who has 192.168.1.20? Tell 192.168.1.175
</span></span><span class="line"><span class="cl">    4 0.584883875 aa:aa:aa:33:33:33 → aa:aa:aa:11:11:11 ARP 42 192.168.1.20 is at aa:aa:aa:33:33:33
</span></span><span class="line"><span class="cl">    5 0.584884584 aa:aa:aa:22:22:22 → aa:aa:aa:11:11:11 ARP 42 192.168.1.20 is at aa:aa:aa:22:22:22
</span></span></code></pre></div><p><strong>One question, two different answers</strong>, less than a microsecond apart. Wireshark notices, and marks
frame 5 with <strong>expert info</strong>, its name for problems it spots across packets rather than inside one:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">[Duplicate IP address detected for 192.168.1.20 (aa:aa:aa:22:22:22) - also in use by aa:aa:aa:33:33:33 (frame 4)]
</span></span><span class="line"><span class="cl">    [Expert Info (Warning/Sequence): Duplicate IP address configured (192.168.1.20)]
</span></span></code></pre></div><p>It&rsquo;s a Warning in the Sequence group, so it shows up in <strong>Analyze › Expert Information</strong> and with the
filter <code>_ws.expert</code>. It&rsquo;s worth opening that window on any capture you&rsquo;re handed: it&rsquo;s the quickest way to
find what&rsquo;s odd.</p>
<p>Which answer does the laptop believe? That depends on the operating system. In the lab&rsquo;s reference capture,
the laptop&rsquo;s pings went to the <em>first</em> reply. Here are the pings that followed, as frame number, Ethernet
source and destination, IP source and destination, and ICMP type (8 is a request, 0 a reply):</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">6	aa:aa:aa:11:11:11	aa:aa:aa:33:33:33	192.168.1.175	192.168.1.20	8
</span></span><span class="line"><span class="cl">7	aa:aa:aa:33:33:33	aa:aa:aa:11:11:11	192.168.1.20	192.168.1.175	0
</span></span></code></pre></div><p>broken-pc answered the pings meant for the printer, with the printer&rsquo;s IP address. From the laptop&rsquo;s point of
view, everything worked. That&rsquo;s what makes duplicate addresses so miserable to troubleshoot: depending on
who answered last time and whose cache entry has aged, traffic goes to one host, then the other. Users report
&ldquo;it works, then it doesn&rsquo;t&rdquo;. The ping succeeds, and still the print job vanishes. The capture is the only
place you can see two MAC addresses claiming one IP.</p>
<hr>
<h2 id="why-does-arps-trust-matter">Why does ARP&rsquo;s trust matter?</h2>
<p>ARP has no authentication. A host believes any reply, and often any announcement, without checking who sent
it. The duplicate address above was an accident, but nothing stops a host doing the same thing on purpose:
claiming the gateway&rsquo;s address so that its neighbors send it their traffic. That&rsquo;s <strong>ARP spoofing</strong>, and
it&rsquo;s the reason enterprise switches offer features such as dynamic ARP inspection, which check ARP messages
against the addresses DHCP actually handed out. For troubleshooting, the lesson is simpler: an ARP reply is
a claim, not a proof. When two MAC addresses claim one IP, find out which one should.</p>
<hr>
<h2 id="what-i-see-go-wrong">What I see go wrong</h2>
<p><strong>&ldquo;There&rsquo;s no ARP in the capture, so ARP is the problem.&rdquo;</strong> Usually the answer was cached. Look for the
traffic that follows instead, and at the cache itself.</p>
<p><strong>A request with no reply, read on the wrong cable.</strong> Replies are unicast. On a third host&rsquo;s port you&rsquo;ll
never see one. On the asker&rsquo;s own cable, a request with no reply means nobody has that address, or the host
that has it is down, or the asker has the wrong subnet mask and is asking for a host that isn&rsquo;t on its
network.</p>
<p><strong>Replaced hardware, old entries.</strong> A device is swapped, keeps its IP address, and gets a new MAC address.
Neighbors keep sending to the old one until their entries age out, unless the new device sends a gratuitous
ARP. A capture shows frames to a MAC address that never answers.</p>
<p><strong>Duplicate addresses that come and go.</strong> The symptom moves between hosts and times of day. Capture on the
asker&rsquo;s cable and look for two different <strong>is at</strong> answers, or open Expert Information.</p>
<p><strong>Ignoring the Ethernet header.</strong> The ARP body says one thing, and the Ethernet source says another? Then
something is answering on another host&rsquo;s behalf. Find out what, and why.</p>
<hr>
<h2 id="try-it">Try it</h2>
<p><a href="/labs/wireshark-101/#chapter-3">Chapter 3 of the lab</a> has you capture the laptop finding the printer and
then the web server, read which address it asked for each time, and then catch broken-pc claiming the
printer&rsquo;s address, with Wireshark&rsquo;s expert info pointing at the frame.</p>
<h2 id="whats-next">What&rsquo;s next</h2>
<p>ARP needs the host to have an IP address already. <a href="/lessons/wireshark-101/dhcp/">Lesson 4</a> is about how it
gets one: the four DHCP messages, sent before the laptop has any address at all, and the router that carries
them to a server two hops away.</p>
]]></content:encoded></item></channel></rss>