Skip to content
Tutorials Center
My learning

Topics

Lesson 13 of 37 ยท Protocol Analysis

Ethernet and ARP

Read Ethernet II frames, MAC addresses, VLAN tags and ARP request and reply packets in Wireshark, with filters, gratuitous ARP and duplicate address checks.

Every capture starts with a link-layer header, and on wired networks that means Ethernet. Next to it, almost every local conversation begins with ARP, the protocol that translates an IPv4 address into the MAC address needed to deliver a frame on the local network. Reading these two correctly shows you what is happening on the wire before any IP routing comes into play.

The Ethernet II frame

An Ethernet II frame in a capture has a 14-byte header:

Bytes Field Notes
0-5 Destination MAC ff:ff:ff:ff:ff:ff = broadcast
6-11 Source MAC Always a unicast address
12-13 Type 0x0800 IPv4, 0x86dd IPv6, 0x0806 ARP, 0x8100 VLAN tag

After the header comes the payload (46 to 1500 bytes). Short frames are padded to the 60-byte minimum (64 with the FCS), which Wireshark shows as Padding. The 4-byte frame check sequence is normally removed by the network card before capture, so you rarely see it.

MAC addresses

A MAC address has 48 bits, written as six hex bytes. The first three bytes are the OUI (organizationally unique identifier) assigned to the manufacturer, so Wireshark can show Dell_aa:bb:cc or Cisco_12:34:56 when name resolution for MAC addresses is on. Two bits of the first byte have meaning:

  • Lowest bit = 1: a group address (multicast or broadcast).
  • Second-lowest bit = 1: a locally administered address (not assigned by the manufacturer). Phones and operating systems use random locally administered MACs for privacy, and virtual machines often do too.

Filters: eth.addr == 00:00:5e:00:53:01, eth.dst == ff:ff:ff:ff:ff:ff, eth.type == 0x0806, eth.src[0:3] == 00:00:5e (OUI), eth.ig == 1 (group address bit).

VLAN tags

A VLAN tag (IEEE 802.1Q) inserts four bytes after the source MAC: the type 0x8100, then priority (3 bits), a drop-eligible bit and a 12-bit VLAN ID, followed by the real EtherType. Wireshark shows 802.1Q Virtual LAN, PRI: 0, DEI: 0, ID: 100. Filter with vlan.id == 100. A capture on an access port usually shows no tags, while a trunk port or a mirror port may show tagged frames.

ARP: who has this IP?

Before a host can send an IPv4 packet to a neighbor on the same subnet, it needs the neighbor's MAC address. It asks everyone with an ARP request (a broadcast): "Who has 192.0.2.20? Tell 192.0.2.10." The owner answers with an ARP reply (unicast): "192.0.2.20 is at 00:00:5e:00:53:20." The asker stores the answer in its ARP cache for a short time (seconds to minutes).

sequenceDiagram
    participant A as Host A 192.0.2.10
    participant B as Host B 192.0.2.20
    A->>B: ARP request (broadcast): who has 192.0.2.20?
    B->>A: ARP reply (unicast): 192.0.2.20 is at 00:00:5e:00:53:20
    A->>B: IPv4 packet, now sent to B's MAC

An ARP exchange: a broadcast question and a unicast answer.

Wireshark summarizes these in the Info column as Who has 192.0.2.20? Tell 192.0.2.10 and 192.0.2.20 is at 00:00:5e:00:53:20. The fields are arp.opcode (1 = request, 2 = reply), arp.src.hw_mac, arp.src.proto_ipv4, arp.dst.hw_mac and arp.dst.proto_ipv4. ARP has no IP header: it sits directly on Ethernet, so ip.addr filters never show it. Use arp.

If the traffic goes to a different subnet, the host does not ARP for the remote address but for its default gateway and sends the packet to the gateway's MAC address. That is why the destination MAC of Internet-bound traffic is the router's.

Special ARP packets

  • ARP probe: sender IP 0.0.0.0 asking "is anyone using this address?" before a host claims it.
  • Gratuitous ARP: a host announces its own IP-to-MAC mapping (target IP equals sender IP). It appears when an interface comes up, after a failover, or to refresh others' caches.
  • Proxy ARP: a router answers on behalf of another host. It is usually a legacy feature.
  • Duplicate address: two different MACs claim the same IP. Wireshark's expert info flags this as Duplicate IP address configured, and the filter is arp.duplicate-address-detected.

A burst of ARP requests that nobody answers means the host cannot reach a local neighbor or the gateway: a classic reason for "no network" complaints.

Build and parse an ARP packet

An ARP packet is 28 bytes. The stand-in builds a request and a reply with the struct module and prints them the way Wireshark's Info column does (all addresses invented; reserved example ranges).

Python Build and decode ARP packets (stand-in)

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Watching for conflicts

Because ARP has no authentication, any host can claim any IP. That is exactly why defenders watch for it: one IP that is suddenly announced by a second MAC is either a configuration mistake (two devices with the same static address) or an attack, covered in the security chapter. The stand-in keeps a table of IP-to-MAC mappings from a sequence of replies and reports changes, which is the logic behind Wireshark's duplicate-address warning and tools like arpwatch. It only reads data you give it.

Python Detect an IP claimed by two MAC addresses (stand-in)

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Useful ARP and Ethernet filters

TEXT
arp                                       all ARP
arp.opcode == 1                           requests only
arp.opcode == 2                           replies only
arp.src.proto_ipv4 == arp.dst.proto_ipv4  gratuitous ARP
eth.dst == ff:ff:ff:ff:ff:ff              broadcasts
!(arp or icmpv6 or mdns or ssdp)          hide chatty local protocols
vlan.id == 100                            one VLAN
eth.len < 60                              short, padded frames (rare in captures)

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. An ARP request is sent to which destination MAC address?

    The sender does not know the target's MAC yet, so it asks everyone on the local network with a broadcast.
  2. 2. Why do you not see ARP when you use the filter 'ip.addr == 192.0.2.20'?

    ARP carries IP addresses in its own fields (arp.src.proto_ipv4), not in an IP header.
  3. 3. A host sends an Internet-bound packet. What destination MAC address does the Ethernet frame have?

    MAC addresses only matter on the local link, so the frame goes to the router, which forwards the IP packet.
  4. 4. Two different MACs answer ARP for the same IP address. What does it indicate?

    An IP should map to one MAC. A change or conflict needs investigation.

Summary

  • An Ethernet II header has destination MAC, source MAC and an EtherType; a VLAN tag adds a 12-bit VLAN ID.
  • OUIs identify manufacturers; the group and local bits of the first byte have meaning.
  • ARP resolves IPv4 to MAC with a broadcast request and a unicast reply; it has no IP header.
  • Gratuitous ARP, probes and duplicate-address warnings tell you about address changes and conflicts.
  • Off-subnet traffic is sent to the gateway's MAC.

Next: IP and ICMP