Concepts / Ethernet and ARP

Ethernet and ARP

Ethernet frame

Also called frame, ethertype

The envelope a packet travels in across one link: destination MAC, source MAC, type, payload.

The problem

A packet alone cannot say which card on the cable should take it, or what kind of data it is.

  1. Alice wraps her ping packet in a frame: a 14-byte header in front of it.
  2. The header starts with the destination MAC, bob's 66:72:05:84:ed:66, then the source MAC, her own 1e:fa:0f:8d:39:1e.
  3. Two more bytes, the ethertype, name what is inside: 0x0800 an IPv4 packet, 0x0806 an ARP message.
  4. Bob's card sees its own MAC, strips the header and hands the packet to IPv4, because the ethertype says so.
One packet, two frames
One packet, two frames

A frame lasts one link: each router takes the packet out and puts it in a new frame with new MACs, while the IP addresses stay. From the MAC and ARP: how an IP address finds a card lab.

What you'd see

$ tcpdump -e -nn -i eth0
18:28:30.582693 1e:fa:0f:8d:39:1e > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 10.0.1.11 tell 10.0.1.10, length 28
18:28:30.582754 66:72:05:84:ed:66 > 1e:fa:0f:8d:39:1e, ethertype ARP (0x0806), length 42: Reply 10.0.1.11 is-at 66:72:05:84:ed:66, length 28
18:28:30.582755 1e:fa:0f:8d:39:1e > 66:72:05:84:ed:66, ethertype IPv4 (0x0800), length 98: 10.0.1.10 > 10.0.1.11: ICMP echo request, id 64, seq 1, length 64
18:28:30.582780 66:72:05:84:ed:66 > 1e:fa:0f:8d:39:1e, ethertype IPv4 (0x0800), length 98: 10.0.1.11 > 10.0.1.10: ICMP echo reply, id 64, seq 1, length 64
  • 1e:fa:0f:8d:39:1e > 66:72:05:84:ed:66: the two MAC addresses of each frame, source then destination.
  • ethertype ARP (0x0806) and ethertype IPv4 (0x0800): what each frame carries.
  • length 98: the whole frame, 14 bytes of header around the 84-byte ping packet.

Guess first

The ping crosses the router to the file server. Does this same frame reach the server?

Show answer

No. The router takes the packet out and puts it in a new frame, with new MAC addresses; only the packet travels end to end.

In short

A 14-byte header: destination and source MAC addresses, then the ethertype naming the payload (0x0800 IPv4, 0x0806 ARP, 0x8100 a VLAN tag). tcpdump -e prints it. The frame is rebuilt at every router; only its payload, the IP packet, travels end to end.

See it on real machines

Read next

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Sign in with Google or email to start.

Start this lab