Ethernet and ARP
Ethernet frame
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.
- Alice wraps her ping packet in a frame: a 14-byte header in front of it.
- The header starts with the destination MAC, bob's
66:72:05:84:ed:66, then the source MAC, her own1e:fa:0f:8d:39:1e. - Two more bytes, the ethertype, name what is inside:
0x0800an IPv4 packet,0x0806an ARP message. - Bob's card sees its own MAC, strips the header and hands the packet to IPv4, because the ethertype says so.
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)andethertype 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.
Read next
- MAC address The 48-bit address of a network card, used to deliver frames within one network.
- VLAN Several separate networks on one switch, kept apart by a tag in each frame.
- MTU The largest IP packet a link carries in one frame: 1500 bytes on ordinary Ethernet.
- OSI model Seven layers that split networking into jobs, from signals on a cable to the program, each wrapping the one above.
- Wi-Fi standards The 802.11 family: how fast a wireless link goes, on which band, and why the air is shared.