Skip to content

MAC addresses and frames

Module
Ethernet and Local Delivery
Difficulty
Easy
Updated
Tested on
Ubuntu 24.04.5 LTS, netlab 1.0, GNU Bash 5.2.21, tcpdump 4.99.4
On this page

You read link/ether in Reading a machine’s network settings. The router then changed the link header in Following one exchange. What do those addresses name? Here you will find the receiving interface, the sending interface and the carried type in one captured header.

Seven questions from laptop to web A horizontal line joins laptop to web through seven numbered circles. Station 4 is the focus: how a message reaches the next device on the cable. laptop web 1 2 3 4 5 6 7
Seven questions from laptop to web A horizontal line joins laptop to web through seven numbered circles. Station 4 is the focus: how a message reaches the next device on the cable. laptop web 1 2 3 4 5 6 7
Station 4: how a message reaches the next device on the cable. The other numbered questions remain open.

Finish Practice: Your First Packet Capture. Leave machine shells and run netlab reset from the VM terminal to restore the starting state. Keep modes off. Terminal 1 begins at learner@rootvolt:~$. Terminal 2 enters laptop with netlab shell laptop. Start the listener before sending. Answer sudo’s password questions when they appear.

netlab shell <machine> -- <command> runs one command on that machine and returns to the VM prompt. Here, ip link show eth0 shows the named interface’s link information.

Read laptop and phone link addresses
learner@rootvolt:~$ netlab shell laptop -- ip link show eth0[sudo] password for learner: 4: eth0@if3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
    link/ether 02:77:10:00:00:10 brd ff:ff:ff:ff:ff:ff link-netns sw-homelearner@rootvolt:~$ netlab shell phone -- ip link show eth06: eth0@if5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
    link/ether 02:77:10:00:00:11 brd ff:ff:ff:ff:ff:ff link-netns sw-homelearner@rootvolt:~$ 

Step-by-step replay of a verified session · Recorded on Ubuntu 24.04.5 LTS, networking lab (netlab 1.0), GNU Bash 5.2.21. Read laptop and phone link information from the VM terminal.
Steps (9)
  1. Type netlab shell laptop -- ip link show eth0
  2. Press Enter
  3. Output: [sudo] password for learner:
  4. Type the password (the terminal shows nothing)
  5. Press Enter
  6. Output: 4: eth0@if3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000 link/ether 02:77:10:00:00:10 brd ff:ff:ff:ff:ff:ff link-netns sw-home
  7. Type netlab shell phone -- ip link show eth0
  8. Press Enter
  9. Output: 6: eth0@if5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000 link/ether 02:77:10:00:00:11 brd ff:ff:ff:ff:ff:ff link-netns sw-home

The value after link/ether is its MAC address, an address used to name an interface on a local link. It contains six bytes, written as six hexadecimal pairs separated by colons. Each pair represents one byte. Laptop’s address ends in 10; phone’s ends in 11. Read all six pairs when comparing addresses.

An Ethernet frame is the link’s unit of data: its header names interfaces and describes the data carried inside. The destination comes first in the bytes. The source follows. EtherType is the two-byte field that says which kind of data the frame carries.

Save one frame with -w frame.pcap; -c 1 stops after one captured frame. The filter icmp keeps ping traffic. It leaves out the earlier frame asking who has an address; Reaching Another Device explains that question.

After terminal 2 sends, -r frame.pcap reads the saved file. Keep -n for numeric output and -e for the link summary. Add -xx to print the frame’s bytes in hex, starting with the link header. The other options were taught in Reading a capture as text.

Predict: the frame is going to phone. Whose address comes first in the bytes?

Save one frame and read its header bytes
learner@rootvolt:~$ netlab shell phone[sudo] password for learner: learner@phone:~$ sudo tcpdump -i eth0 -n -c 1 -w frame.pcap icmp[sudo] password for learner: tcpdump: listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes1 packet captured
2 packets received by filter
0 packets dropped by kernellearner@phone:~$ tcpdump -n -e -xx -r frame.pcapreading from file frame.pcap, link-type EN10MB (Ethernet), snapshot length 262144
13:55:17.444900 02:77:10:00:00:10 > 02:77:10:00:00:11, ethertype IPv4 (0x0800), length 98: 10.77.10.10 > 10.77.10.11: ICMP echo request, id 178, seq 1, length 64
	0x0000:  0277 1000 0011 0277 1000 0010 0800 4500
	0x0010:  0054 875c 4000 4001 8a9e 0a4d 0a0a 0a4d
	0x0020:  0a0b 0800 c2a2 00b2 0001 c5a2 016b 0000
	0x0030:  0000 a8c9 0600 0000 0000 1011 1213 1415
	0x0040:  1617 1819 1a1b 1c1d 1e1f 2021 2223 2425
	0x0050:  2627 2829 2a2b 2c2d 2e2f 3031 3233 3435
	0x0060:  3637learner@phone:~$ exitlogoutlearner@rootvolt:~$ 

Step-by-step replay of a verified session · Recorded on Ubuntu 24.04.5 LTS, networking lab (netlab 1.0), GNU Bash 5.2.21. Terminal 1 saves one frame, then reads its summary and bytes from frame.pcap.
Steps (19)
  1. Type netlab shell phone
  2. Press Enter
  3. Output: [sudo] password for learner:
  4. Type the password (the terminal shows nothing)
  5. Press Enter
  6. Type sudo tcpdump -i eth0 -n -c 1 -w frame.pcap icmp
  7. Press Enter
  8. Output: [sudo] password for learner:
  9. Type the password (the terminal shows nothing)
  10. Press Enter
  11. Output: tcpdump: listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes
  12. Terminal 2 on laptop finished sending. Return to terminal 1.
  13. Output: 1 packet captured 2 packets received by filter 0 packets dropped by kernel
  14. Type tcpdump -n -e -xx -r frame.pcap
  15. Press Enter
  16. Output: reading from file frame.pcap, link-type EN10MB (Ethernet), snapshot length 262144 13:55:17.444900 02:77:10:00:00:10 > 02:77:10:00:00:11, ethertype IPv4 (0x0800), length 98: 10.77.10.10 > 10.77.10.11: ICMP echo request, id 178, seq 1, length 64 0x0000: 0277 1000 0011 0277 1000 0010 0800 4500 0x0010: 0054 875c 4000 4001 8a9e 0a4d 0a0a 0a4d 0x0020: 0a0b 0800 c2a2 00b2 0001 c5a2 016b 0000 0x0030: 0000 a8c9 0600 0000 0000 1011 1213 1415 0x0040: 1617 1819 1a1b 1c1d 1e1f 2021 2223 2425 0x0050: 2627 2829 2a2b 2c2d 2e2f 3031 3233 3435 0x0060: 3637
  17. Type exit
  18. Press Enter
  19. Output: logout
Send from terminal 2 on laptop
learner@laptop:~$ ping -c 1 10.77.10.11PING 10.77.10.11 (10.77.10.11) 56(84) bytes of data.
64 bytes from 10.77.10.11: icmp_seq=1 ttl=64 time=0.096 ms

--- 10.77.10.11 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.096/0.096/0.096/0.000 mslearner@laptop:~$ 

Step-by-step replay of a verified session · Recorded on Ubuntu 24.04.5 LTS, networking lab (netlab 1.0), GNU Bash 5.2.21. Terminal 2 on laptop sends the ping while phone saves the frame.
Steps (3)
  1. Type ping -c 1 10.77.10.11
  2. Press Enter
  3. Output: PING 10.77.10.11 (10.77.10.11) 56(84) bytes of data. 64 bytes from 10.77.10.11: icmp_seq=1 ttl=64 time=0.096 ms --- 10.77.10.11 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.096/0.096/0.096/0.000 ms

Read the Ethernet header bytes

13:55:17.444900 02:77:10:00:00:10 > 02:77:10:00:00:11, ethertype IPv4 (0x0800), length 98: 10.77.10.10 > 10.77.10.11: ICMP echo request, id 178, seq 1, length 64
	0x0000:  0277 1000 0011 0277 1000 0010 0800 4500
phone
machine
eth0
Destination · Link0277 1000 0011
Source · Link0277 1000 0010
EtherType · Link0800

Reading the output

Pick a step to match a marked part of the output to the picture.

Step-by-step reading of a captured output · Output of tcpdump -n -e -xx -r frame.pcap on phone, on Ubuntu 24.04.5 LTS, networking lab (netlab 1.0), GNU Bash 5.2.21. The values are the capture's. Compare the saved frame's summary with its first hex line. The marks select destination, source and EtherType in the bytes.
Steps (3)
  1. Destination. Destination: 0277 1000 0011. Link layer. Shown on phone's eth0 as: Destination. The first six bytes name the receiving interface: phone.
  2. Source. Source: 0277 1000 0010. Link layer. Shown on phone's eth0 as: Source. The next six bytes name the sending interface: laptop.
  3. EtherType. EtherType: 0800. Link layer. Shown on phone's eth0 as: EtherType. These two bytes say that the frame carries IPv4.
Check your answer

Phone’s address comes first. The summary prints source, then destination around >, but the bytes store destination first. Do not use the summary’s printing order to guess the header’s byte order.

Count byte positions from zero. The four hex digits in each printed group hold two bytes. Colons belong to the address notation; they are not extra bytes in the frame.

Bytes Field Value What it names
0–5 Destination 02:77:10:00:00:11 Phone’s interface
6–11 Source 02:77:10:00:00:10 Laptop’s interface
12–13 EtherType 0x0800 IPv4 inside

The 4500 after 0800 starts the carried IPv4 header. Leave its fields for later. Stop reading this Ethernet header after the type. Your timestamps, ping identifiers and round-trip times will differ; those values do not change these three fields.

On hardware with a manufacturer-assigned address, the first three bytes identify its assigned maker prefix. That is not a rule for every address you meet. The lab tool sets these addresses locally; their first byte, 02, marks them as locally administered. A maker lookup cannot identify the lab’s devices from that prefix.

A MAC address belongs to an interface. A computer with several interfaces can have several addresses. Software can change an interface’s address, so an address alone proves nothing about who controls a device. An unexpected address change is a reason to check other evidence, rather than proof of a particular person.

“A MAC address identifies a computer everywhere.” These reads identify two local interfaces. They do not establish a permanent identity for either computer.

“The MAC address travels to the web server.” Recall the changed link header in Following one exchange. The next link names its own interfaces, while the carried request continues toward its destination.

The one-frame listener stops itself. Wait for its prompt instead of pressing Ctrl+C.

Reset from the VM. Before sending from phone to router, write down the expected destination, source and type. In terminal 1 enter router with netlab shell router and run sudo tcpdump -i eth0 -n -e -xx -c 1 icmp. In terminal 2 enter phone with netlab shell phone and run ping -c 1 10.77.10.1. Compare your prediction with the first fourteen captured bytes, explaining which interface each address names.

Solution
Read a frame from phone to router
learner@rootvolt:~$ netlab shell router[sudo] password for learner: learner@router:~$ sudo tcpdump -i eth0 -n -e -xx -c 1 icmp[sudo] password for learner: tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes14:58:40.336730 02:77:10:00:00:11 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 98: 10.77.10.11 > 10.77.10.1: ICMP echo request, id 178, seq 1, length 64
	0x0000:  0277 1000 0001 0277 1000 0011 0800 4500
	0x0010:  0054 f580 4000 4001 1c83 0a4d 0a0b 0a4d
	0x0020:  0a01 0800 0c3d 00b2 0001 a0b1 016b 0000
	0x0030:  0000 8520 0500 0000 0000 1011 1213 1415
	0x0040:  1617 1819 1a1b 1c1d 1e1f 2021 2223 2425
	0x0050:  2627 2829 2a2b 2c2d 2e2f 3031 3233 3435
	0x0060:  3637
1 packet captured
2 packets received by filter
0 packets dropped by kernellearner@router:~$ exitlogoutlearner@rootvolt:~$ 

Step-by-step replay of a verified session · Recorded on Ubuntu 24.04.5 LTS, networking lab (netlab 1.0), GNU Bash 5.2.21. Terminal 1 enters router and listens on its home interface, eth0.
Steps (16)
  1. Type netlab shell router
  2. Press Enter
  3. Output: [sudo] password for learner:
  4. Type the password (the terminal shows nothing)
  5. Press Enter
  6. Type sudo tcpdump -i eth0 -n -e -xx -c 1 icmp
  7. Press Enter
  8. Output: [sudo] password for learner:
  9. Type the password (the terminal shows nothing)
  10. Press Enter
  11. Output: tcpdump: verbose output suppressed, use -v[v]... for full protocol decode listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes
  12. Terminal 2 on phone finished sending. Return to terminal 1.
  13. Output: 14:58:40.336730 02:77:10:00:00:11 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 98: 10.77.10.11 > 10.77.10.1: ICMP echo request, id 178, seq 1, length 64 0x0000: 0277 1000 0001 0277 1000 0011 0800 4500 0x0010: 0054 f580 4000 4001 1c83 0a4d 0a0b 0a4d 0x0020: 0a01 0800 0c3d 00b2 0001 a0b1 016b 0000 0x0030: 0000 8520 0500 0000 0000 1011 1213 1415 0x0040: 1617 1819 1a1b 1c1d 1e1f 2021 2223 2425 0x0050: 2627 2829 2a2b 2c2d 2e2f 3031 3233 3435 0x0060: 3637 1 packet captured 2 packets received by filter 0 packets dropped by kernel
  14. Type exit
  15. Press Enter
  16. Output: logout
Send from terminal 2 on phone
learner@phone:~$ ping -c 1 10.77.10.1PING 10.77.10.1 (10.77.10.1) 56(84) bytes of data.
64 bytes from 10.77.10.1: icmp_seq=1 ttl=64 time=0.813 ms

--- 10.77.10.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.813/0.813/0.813/0.000 mslearner@phone:~$ 

Step-by-step replay of a verified session · Recorded on Ubuntu 24.04.5 LTS, networking lab (netlab 1.0), GNU Bash 5.2.21. Terminal 2 on phone sends to router's home address.
Steps (3)
  1. Type ping -c 1 10.77.10.1
  2. Press Enter
  3. Output: PING 10.77.10.1 (10.77.10.1) 56(84) bytes of data. 64 bytes from 10.77.10.1: icmp_seq=1 ttl=64 time=0.813 ms --- 10.77.10.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.813/0.813/0.813/0.000 ms

The destination is 02:77:10:00:00:01, source is 02:77:10:00:00:11, and type is 0800.

The check value at the end of an Ethernet frame is normally absent from these captures. VLAN tags belong to VLANs and Trunks later in the course.

  • Read destination, source, then type in the bytes.
  • Compare interface addresses, rather than permanent computer identities.
  • Use a fresh capture to check your field prediction.

Next, How switches learn follows the source address into the switch’s table.