online posts 16
wireshark 101

task 3.2 · chapter 3 of 8: arp · 15 min

Two answers

objective

Watch broken-pc claim the printer’s IP address, see two different hosts answer the same ARP question, and let Wireshark’s expert info point it out.

you edit, in the labanswers/3.2.yml

open a file in VS Code: Ctrl+P (Cmd+P on a Mac), type its name, Enter

given
Capturemake capture AT=laptop:eth1 NAME=3.2 X=dupip
Filterarp, then _ws.expert
Your answersanswers/3.2.yml
new to this? step by stepbeginner
  1. make capture AT=laptop:eth1 NAME=3.2 X=dupip, open it, filter arp.
  2. Find the question that got two answers. Which MAC isn’t the printer’s?
  3. Challenge: one ARP frame wasn’t an answer to anything. Who sent it?
  4. Fill in answers/3.2.yml, then make check T=3.2.

more in meet the lab

1 explain

When two hosts have one address

A duplicate IP address

Every host on a network needs its own IP address. When two have the same one (someone typed an address by hand that DHCP had already given out, a cloned virtual machine, a misconfigured printer) the network doesn’t refuse. Both hosts carry on, and both answer ARP for that address. Which answer the asker keeps depends on its operating system (in this lab’s reference capture, the laptop went with the first one), and it can change the next time it asks. So the traffic can flip between the two, and the symptom is maddening: it works, then it doesn’t, then it does.

On the wire it’s easy to see: one question, two different answers.

in one sentence A duplicate IP address shows up as two ARP replies with different MAC addresses for the same IP address.

Gratuitous ARP

A host can also send ARP nobody asked for: a gratuitous ARP, announcing 192.168.1.20 is me, at this MAC address. Hosts send one when they bring an address up, or when an address moves to a new box (a failover), so everyone else updates their tables straight away. Wireshark labels it in the packet list. It’s sent as a broadcast, so every host on the network hears it.

Expert info

Wireshark doesn’t only decode packets; it also notices things across them, and flags them as expert info: a retransmission, a reply with no request, a duplicate address. They show in the packet list as colored rows and in Analyze › Expert Information, and you can filter on them with _ws.expert.

2 show

Same question, two answers

The ARP frames of the reference capture:

    1 0.000000000 aa:aa:aa:33:33:33 → Broadcast    ARP 42 Gratuitous ARP for 192.168.1.20 (Request)
    3 0.584692875 aa:aa:aa:11:11:11 → Broadcast    ARP 42 Who has 192.168.1.20? Tell 192.168.1.175
    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
    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

Wireshark flags the duplicate on frame 5, the second MAC address it saw claim 192.168.1.20 in this file. Click it and the details pane ends with the expert info line:

[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)]

Expert info only knows what’s in the file. If your capture happens to start with a frame from the printer, the warning lands on a different frame, even on the gratuitous ARP itself. You may also see hosts ARPing for each other at the very start: hosts re-check the entries in their tables every so often, and a capture catches whatever happens to be going on.

3 follow along

Find the duplicate

  1. Capture it. The lab gives broken-pc the printer’s address for a few seconds, has it announce that, has the laptop look for the printer, then takes the address away again:

    run in the terminal
    make capture AT=laptop:eth1 NAME=3.2 X=dupip
    
  2. Open /captures/3.2.pcapng and filter arp. Find the Who has 192.168.1.20? with two is at lines after it.

  3. One of those MAC addresses is the printer’s: you found it in task 3.1. The other one isn’t.

  4. Open Analyze › Expert Information and look for the warning about a duplicate address.

  5. Fill in the follow-along lines:

    editanswers/3.2.ymlCtrl+P → 3.2.yml
    duplicate_ip: 192.168.1.20
    impostor_mac: aa:aa:aa:33:33:33
    
4 challenge

The announcement

One ARP frame wasn’t an answer to any question. Who sent it?

  • gratuitous_mac: the MAC address that sent the gratuitous ARP.
hint

Filter arp.isgratuitous == 1.

show the solutionanswers/3.2.yml

or pull it into your lab: make solve T=3.2, then git diff --staged shows what changed

gratuitous_mac: aa:aa:aa:33:33:33

broken-pc announced itself as 192.168.1.20 before anyone asked. Hosts that hear a gratuitous ARP may update the entry they already have for that address (whether they do depends on the operating system and its settings), and from then on send the printer’s traffic to broken-pc. Nothing on those hosts would say so. The capture does.

5 check: run it, then prove it

$ make check T=3.2

when it's right, you'll see

╭─ task 3.2 · two answers
│  ✓ captures/3.2.pcapng: taken on laptop:eth1, 12 frames
│  ✓ the address two computers claimed (follow along): 192.168.1.20
│  ✓ the MAC address that isn't the printer's (follow along): ...
│  ✓ who sent the gratuitous ARP (challenge): ...
╰─ 4/4 checks passed  verified