Reading a capture as text
On this page
One line of capture output looks like noise. Its parts follow an order you can learn. Start by finding the two ends of the exchange, then separate the machine addresses from the program numbers. By the end, you can read that direction and save the evidence for another look.
Before you start
Section titled “Before you start”Finish Choosing a capture location. Keep the lab in its starting state. Open two terminals on laptop with netlab shell laptop; both start in the shared home directory. Start each listener in terminal 1 before sending from terminal 2. Answer sudo’s password question as before.
Stop after a small exchange
Section titled “Stop after a small exchange”Keep -i eth0 to select the interface. Add -n to keep addresses and port numbers numeric, rather than converting them to names. Add -c 12 to stop after twelve captured frames. The number belongs to -c; it is not an address or a port.
learner@laptop:~$ sudo tcpdump -i eth0 -n -c 12 tcp port 80[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 bytes11:55:17.897044 IP 10.77.10.10.44096 > 10.77.20.80.80: Flags [S], seq 3843285809, win 64240, options [mss 1460,sackOK,TS val 127567022 ecr 0,nop,wscale 10], length 0
11:55:17.897097 IP 10.77.20.80.80 > 10.77.10.10.44096: Flags [S.], seq 786431138, ack 3843285810, win 65160, options [mss 1460,sackOK,TS val 3192915911 ecr 127567022,nop,wscale 10], length 0
11:55:17.897122 IP 10.77.10.10.44096 > 10.77.20.80.80: Flags [.], ack 1, win 63, options [nop,nop,TS val 127567023 ecr 3192915911], length 0
11:55:17.897204 IP 10.77.10.10.44096 > 10.77.20.80.80: Flags [P.], seq 1:84, ack 1, win 63, options [nop,nop,TS val 127567023 ecr 3192915911], length 83: HTTP: GET /hello.txt HTTP/1.1
11:55:17.897222 IP 10.77.20.80.80 > 10.77.10.10.44096: Flags [.], ack 84, win 64, options [nop,nop,TS val 3192915911 ecr 127567023], length 0
11:55:17.900601 IP 10.77.20.80.80 > 10.77.10.10.44096: Flags [P.], seq 1:173, ack 84, win 64, options [nop,nop,TS val 3192915914 ecr 127567023], length 172: HTTP: HTTP/1.0 200 OK
11:55:17.900636 IP 10.77.10.10.44096 > 10.77.20.80.80: Flags [.], ack 173, win 63, options [nop,nop,TS val 127567026 ecr 3192915914], length 0
11:55:17.900673 IP 10.77.20.80.80 > 10.77.10.10.44096: Flags [P.], seq 173:189, ack 84, win 64, options [nop,nop,TS val 3192915914 ecr 127567026], length 16: HTTP
11:55:17.900692 IP 10.77.10.10.44096 > 10.77.20.80.80: Flags [.], ack 189, win 63, options [nop,nop,TS val 127567026 ecr 3192915914], length 0
11:55:17.900727 IP 10.77.20.80.80 > 10.77.10.10.44096: Flags [F.], seq 189, ack 84, win 64, options [nop,nop,TS val 3192915914 ecr 127567026], length 0
11:55:17.900757 IP 10.77.10.10.44096 > 10.77.20.80.80: Flags [F.], seq 84, ack 190, win 63, options [nop,nop,TS val 127567026 ecr 3192915914], length 0
11:55:17.901152 IP 10.77.20.80.80 > 10.77.10.10.44096: Flags [.], ack 85, win 64, options [nop,nop,TS val 3192915914 ecr 127567026], length 0
12 packets captured
12 packets received by filter
0 packets dropped by kernellearner@laptop:~$ Steps (8)
- Type
sudo tcpdump -i eth0 -n -c 12 tcp port 80 - Press Enter
- Output:
[sudo] password for learner: - Type the password (the terminal shows nothing)
- Press Enter
- Output:
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes - Terminal 2 requested hello.txt on laptop. Return to terminal 1; the count ends the capture.
- Output:
11:55:17.897044 IP 10.77.10.10.44096 > 10.77.20.80.80: Flags [S], seq 3843285809, win 64240, options [mss 1460,sackOK,TS val 127567022 ecr 0,nop,wscale 10], length 0 11:55:17.897097 IP 10.77.20.80.80 > 10.77.10.10.44096: Flags [S.], seq 786431138, ack 3843285810, win 65160, options [mss 1460,sackOK,TS val 3192915911 ecr 127567022,nop,wscale 10], length 0 11:55:17.897122 IP 10.77.10.10.44096 > 10.77.20.80.80: Flags [.], ack 1, win 63, options [nop,nop,TS val 127567023 ecr 3192915911], length 0 11:55:17.897204 IP 10.77.10.10.44096 > 10.77.20.80.80: Flags [P.], seq 1:84, ack 1, win 63, options [nop,nop,TS val 127567023 ecr 3192915911], length 83: HTTP: GET /hello.txt HTTP/1.1 11:55:17.897222 IP 10.77.20.80.80 > 10.77.10.10.44096: Flags [.], ack 84, win 64, options [nop,nop,TS val 3192915911 ecr 127567023], length 0 11:55:17.900601 IP 10.77.20.80.80 > 10.77.10.10.44096: Flags [P.], seq 1:173, ack 84, win 64, options [nop,nop,TS val 3192915914 ecr 127567023], length 172: HTTP: HTTP/1.0 200 OK 11:55:17.900636 IP 10.77.10.10.44096 > 10.77.20.80.80: Flags [.], ack 173, win 63, options [nop,nop,TS val 127567026 ecr 3192915914], length 0 11:55:17.900673 IP 10.77.20.80.80 > 10.77.10.10.44096: Flags [P.], seq 173:189, ack 84, win 64, options [nop,nop,TS val 3192915914 ecr 127567026], length 16: HTTP 11:55:17.900692 IP 10.77.10.10.44096 > 10.77.20.80.80: Flags [.], ack 189, win 63, options [nop,nop,TS val 127567026 ecr 3192915914], length 0 11:55:17.900727 IP 10.77.20.80.80 > 10.77.10.10.44096: Flags [F.], seq 189, ack 84, win 64, options [nop,nop,TS val 3192915914 ecr 127567026], length 0 11:55:17.900757 IP 10.77.10.10.44096 > 10.77.20.80.80: Flags [F.], seq 84, ack 190, win 63, options [nop,nop,TS val 127567026 ecr 3192915914], length 0 11:55:17.901152 IP 10.77.20.80.80 > 10.77.10.10.44096: Flags [.], ack 85, win 64, options [nop,nop,TS val 3192915914 ecr 127567026], length 0 12 packets captured 12 packets received by filter 0 packets dropped by kernel
learner@laptop:~$ curl -sS http://10.77.20.80/hello.txtHello from web.learner@laptop:~$ Steps (3)
- Type
curl -sS http://10.77.20.80/hello.txt - Press Enter
- Output:
Hello from web.
The first run contains 12 frames. The second exchange has 13, including one more final acknowledgment after the display stops. Wait for the prompt; there is no Ctrl+C here. A frame is not a whole application conversation. Some lines carry the request or response, while others do work for TCP that comes later in the course.
Read the direction before the remaining numbers
Section titled “Read the direction before the remaining numbers”The first part is a timestamp, the time attached to that captured frame. Next come the sender, a > sign, and the receiver. Here, > means “sent toward.” The rest describes the carried traffic. Read only the parts you can name; you do not need to guess what the flags mean.
After each IP address comes a dot and a port number. The IP address names the machine. The port belongs to the transport header and names the program on that machine. A port is not a fifth part of an IPv4 address.
Include the link header
Section titled “Include the link header”The option -e also prints the link header. It puts the MAC address pair before the IP address pair. Compare another run of the same request:
learner@laptop:~$ sudo tcpdump -i eth0 -n -e -c 12 tcp port 80[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 bytes11:56:12.563924 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 74: 10.77.10.10.59278 > 10.77.20.80.80: Flags [S], seq 1950662312, win 64240, options [mss 1460,sackOK,TS val 3887038641 ecr 0,nop,wscale 10], length 0
11:56:12.563973 02:77:10:00:00:01 > 02:77:10:00:00:10, ethertype IPv4 (0x0800), length 74: 10.77.20.80.80 > 10.77.10.10.59278: Flags [S.], seq 2325121899, ack 1950662313, win 65160, options [mss 1460,sackOK,TS val 2573981339 ecr 3887038641,nop,wscale 10], length 0
11:56:12.563981 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 66: 10.77.10.10.59278 > 10.77.20.80.80: Flags [.], ack 1, win 63, options [nop,nop,TS val 3887038641 ecr 2573981339], length 0
11:56:12.564031 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 149: 10.77.10.10.59278 > 10.77.20.80.80: Flags [P.], seq 1:84, ack 1, win 63, options [nop,nop,TS val 3887038641 ecr 2573981339], length 83: HTTP: GET /hello.txt HTTP/1.1
11:56:12.564039 02:77:10:00:00:01 > 02:77:10:00:00:10, ethertype IPv4 (0x0800), length 66: 10.77.20.80.80 > 10.77.10.10.59278: Flags [.], ack 84, win 64, options [nop,nop,TS val 2573981339 ecr 3887038641], length 0
11:56:12.567051 02:77:10:00:00:01 > 02:77:10:00:00:10, ethertype IPv4 (0x0800), length 238: 10.77.20.80.80 > 10.77.10.10.59278: Flags [P.], seq 1:173, ack 84, win 64, options [nop,nop,TS val 2573981342 ecr 3887038641], length 172: HTTP: HTTP/1.0 200 OK
11:56:12.567079 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 66: 10.77.10.10.59278 > 10.77.20.80.80: Flags [.], ack 173, win 63, options [nop,nop,TS val 3887038644 ecr 2573981342], length 0
11:56:12.567496 02:77:10:00:00:01 > 02:77:10:00:00:10, ethertype IPv4 (0x0800), length 82: 10.77.20.80.80 > 10.77.10.10.59278: Flags [P.], seq 173:189, ack 84, win 64, options [nop,nop,TS val 2573981343 ecr 3887038644], length 16: HTTP
11:56:12.567513 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 66: 10.77.10.10.59278 > 10.77.20.80.80: Flags [.], ack 189, win 63, options [nop,nop,TS val 3887038645 ecr 2573981343], length 0
11:56:12.567544 02:77:10:00:00:01 > 02:77:10:00:00:10, ethertype IPv4 (0x0800), length 66: 10.77.20.80.80 > 10.77.10.10.59278: Flags [F.], seq 189, ack 84, win 64, options [nop,nop,TS val 2573981343 ecr 3887038645], length 0
11:56:12.567557 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 66: 10.77.10.10.59278 > 10.77.20.80.80: Flags [F.], seq 84, ack 189, win 63, options [nop,nop,TS val 3887038645 ecr 2573981343], length 0
11:56:12.567573 02:77:10:00:00:01 > 02:77:10:00:00:10, ethertype IPv4 (0x0800), length 66: 10.77.20.80.80 > 10.77.10.10.59278: Flags [.], ack 85, win 64, options [nop,nop,TS val 2573981343 ecr 3887038645], length 0
12 packets captured
13 packets received by filter
0 packets dropped by kernellearner@laptop:~$ Steps (8)
- Type
sudo tcpdump -i eth0 -n -e -c 12 tcp port 80 - Press Enter
- Output:
[sudo] password for learner: - Type the password (the terminal shows nothing)
- Press Enter
- Output:
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes - Terminal 2 on laptop finished sending. Return to terminal 1; the count ends the capture.
- Output:
11:56:12.563924 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 74: 10.77.10.10.59278 > 10.77.20.80.80: Flags [S], seq 1950662312, win 64240, options [mss 1460,sackOK,TS val 3887038641 ecr 0,nop,wscale 10], length 0 11:56:12.563973 02:77:10:00:00:01 > 02:77:10:00:00:10, ethertype IPv4 (0x0800), length 74: 10.77.20.80.80 > 10.77.10.10.59278: Flags [S.], seq 2325121899, ack 1950662313, win 65160, options [mss 1460,sackOK,TS val 2573981339 ecr 3887038641,nop,wscale 10], length 0 11:56:12.563981 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 66: 10.77.10.10.59278 > 10.77.20.80.80: Flags [.], ack 1, win 63, options [nop,nop,TS val 3887038641 ecr 2573981339], length 0 11:56:12.564031 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 149: 10.77.10.10.59278 > 10.77.20.80.80: Flags [P.], seq 1:84, ack 1, win 63, options [nop,nop,TS val 3887038641 ecr 2573981339], length 83: HTTP: GET /hello.txt HTTP/1.1 11:56:12.564039 02:77:10:00:00:01 > 02:77:10:00:00:10, ethertype IPv4 (0x0800), length 66: 10.77.20.80.80 > 10.77.10.10.59278: Flags [.], ack 84, win 64, options [nop,nop,TS val 2573981339 ecr 3887038641], length 0 11:56:12.567051 02:77:10:00:00:01 > 02:77:10:00:00:10, ethertype IPv4 (0x0800), length 238: 10.77.20.80.80 > 10.77.10.10.59278: Flags [P.], seq 1:173, ack 84, win 64, options [nop,nop,TS val 2573981342 ecr 3887038641], length 172: HTTP: HTTP/1.0 200 OK 11:56:12.567079 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 66: 10.77.10.10.59278 > 10.77.20.80.80: Flags [.], ack 173, win 63, options [nop,nop,TS val 3887038644 ecr 2573981342], length 0 11:56:12.567496 02:77:10:00:00:01 > 02:77:10:00:00:10, ethertype IPv4 (0x0800), length 82: 10.77.20.80.80 > 10.77.10.10.59278: Flags [P.], seq 173:189, ack 84, win 64, options [nop,nop,TS val 2573981343 ecr 3887038644], length 16: HTTP 11:56:12.567513 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 66: 10.77.10.10.59278 > 10.77.20.80.80: Flags [.], ack 189, win 63, options [nop,nop,TS val 3887038645 ecr 2573981343], length 0 11:56:12.567544 02:77:10:00:00:01 > 02:77:10:00:00:10, ethertype IPv4 (0x0800), length 66: 10.77.20.80.80 > 10.77.10.10.59278: Flags [F.], seq 189, ack 84, win 64, options [nop,nop,TS val 2573981343 ecr 3887038645], length 0 11:56:12.567557 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 66: 10.77.10.10.59278 > 10.77.20.80.80: Flags [F.], seq 84, ack 189, win 63, options [nop,nop,TS val 3887038645 ecr 2573981343], length 0 11:56:12.567573 02:77:10:00:00:01 > 02:77:10:00:00:10, ethertype IPv4 (0x0800), length 66: 10.77.20.80.80 > 10.77.10.10.59278: Flags [.], ack 85, win 64, options [nop,nop,TS val 2573981343 ecr 3887038645], length 0 12 packets captured 13 packets received by filter 0 packets dropped by kernel
learner@laptop:~$ curl -sS http://10.77.20.80/hello.txtHello from web.learner@laptop:~$ Steps (3)
- Type
curl -sS http://10.77.20.80/hello.txt - Press Enter
- Output:
Hello from web.
On this link, laptop sends to the router’s home interface. The MAC addresses name the sending and receiving interfaces on this link. The IP addresses name laptop and web, the machines at the two ends of the request. Times, client ports, and sequence numbers change between runs; your number will differ.
Save frames, then read the file
Section titled “Save frames, then read the file”-w hello.pcap writes captured frames into the named file instead of printing their lines. A .pcap file contains captured data, not ordinary terminal text. For this save run, remove -c 12 and stop with Ctrl+C after the request, keeping the whole exchange. Then -r hello.pcap reads that file. Reading needs no sudo in this run. Adding -e to a read shows the saved link headers too.
The final read uses -A to print packet bytes as characters. Leave interpreting that text for Following an exchange.
learner@laptop:~$ sudo tcpdump -i eth0 -n -w hello.pcap tcp port 80[sudo] password for learner: tcpdump: listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes^C12 packets captured
12 packets received by filter
0 packets dropped by kernellearner@laptop:~$ tcpdump -n -r hello.pcapreading from file hello.pcap, link-type EN10MB (Ethernet), snapshot length 262144
11:56:39.431102 IP 10.77.10.10.43958 > 10.77.20.80.80: Flags [S], seq 2888784756, win 64240, options [mss 1460,sackOK,TS val 691671072 ecr 0,nop,wscale 10], length 0
11:56:39.431256 IP 10.77.20.80.80 > 10.77.10.10.43958: Flags [S.], seq 2766705611, ack 2888784757, win 65160, options [mss 1460,sackOK,TS val 522686132 ecr 691671072,nop,wscale 10], length 0
11:56:39.431266 IP 10.77.10.10.43958 > 10.77.20.80.80: Flags [.], ack 1, win 63, options [nop,nop,TS val 691671073 ecr 522686132], length 0
11:56:39.431426 IP 10.77.10.10.43958 > 10.77.20.80.80: Flags [P.], seq 1:84, ack 1, win 63, options [nop,nop,TS val 691671073 ecr 522686132], length 83: HTTP: GET /hello.txt HTTP/1.1
11:56:39.431461 IP 10.77.20.80.80 > 10.77.10.10.43958: Flags [.], ack 84, win 64, options [nop,nop,TS val 522686132 ecr 691671073], length 0
11:56:39.435539 IP 10.77.20.80.80 > 10.77.10.10.43958: Flags [P.], seq 1:173, ack 84, win 64, options [nop,nop,TS val 522686136 ecr 691671073], length 172: HTTP: HTTP/1.0 200 OK
11:56:39.435567 IP 10.77.10.10.43958 > 10.77.20.80.80: Flags [.], ack 173, win 63, options [nop,nop,TS val 691671077 ecr 522686136], length 0
11:56:39.435605 IP 10.77.20.80.80 > 10.77.10.10.43958: Flags [P.], seq 173:189, ack 84, win 64, options [nop,nop,TS val 522686136 ecr 691671077], length 16: HTTP
11:56:39.435607 IP 10.77.10.10.43958 > 10.77.20.80.80: Flags [.], ack 189, win 63, options [nop,nop,TS val 691671077 ecr 522686136], length 0
11:56:39.435632 IP 10.77.20.80.80 > 10.77.10.10.43958: Flags [F.], seq 189, ack 84, win 64, options [nop,nop,TS val 522686136 ecr 691671077], length 0
11:56:39.435688 IP 10.77.10.10.43958 > 10.77.20.80.80: Flags [F.], seq 84, ack 190, win 63, options [nop,nop,TS val 691671077 ecr 522686136], length 0
11:56:39.435807 IP 10.77.20.80.80 > 10.77.10.10.43958: Flags [.], ack 85, win 64, options [nop,nop,TS val 522686136 ecr 691671077], length 0learner@laptop:~$ tcpdump -n -e -r hello.pcapreading from file hello.pcap, link-type EN10MB (Ethernet), snapshot length 262144
11:56:39.431102 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 74: 10.77.10.10.43958 > 10.77.20.80.80: Flags [S], seq 2888784756, win 64240, options [mss 1460,sackOK,TS val 691671072 ecr 0,nop,wscale 10], length 0
11:56:39.431256 02:77:10:00:00:01 > 02:77:10:00:00:10, ethertype IPv4 (0x0800), length 74: 10.77.20.80.80 > 10.77.10.10.43958: Flags [S.], seq 2766705611, ack 2888784757, win 65160, options [mss 1460,sackOK,TS val 522686132 ecr 691671072,nop,wscale 10], length 0
11:56:39.431266 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 66: 10.77.10.10.43958 > 10.77.20.80.80: Flags [.], ack 1, win 63, options [nop,nop,TS val 691671073 ecr 522686132], length 0
11:56:39.431426 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 149: 10.77.10.10.43958 > 10.77.20.80.80: Flags [P.], seq 1:84, ack 1, win 63, options [nop,nop,TS val 691671073 ecr 522686132], length 83: HTTP: GET /hello.txt HTTP/1.1
11:56:39.431461 02:77:10:00:00:01 > 02:77:10:00:00:10, ethertype IPv4 (0x0800), length 66: 10.77.20.80.80 > 10.77.10.10.43958: Flags [.], ack 84, win 64, options [nop,nop,TS val 522686132 ecr 691671073], length 0
11:56:39.435539 02:77:10:00:00:01 > 02:77:10:00:00:10, ethertype IPv4 (0x0800), length 238: 10.77.20.80.80 > 10.77.10.10.43958: Flags [P.], seq 1:173, ack 84, win 64, options [nop,nop,TS val 522686136 ecr 691671073], length 172: HTTP: HTTP/1.0 200 OK
11:56:39.435567 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 66: 10.77.10.10.43958 > 10.77.20.80.80: Flags [.], ack 173, win 63, options [nop,nop,TS val 691671077 ecr 522686136], length 0
11:56:39.435605 02:77:10:00:00:01 > 02:77:10:00:00:10, ethertype IPv4 (0x0800), length 82: 10.77.20.80.80 > 10.77.10.10.43958: Flags [P.], seq 173:189, ack 84, win 64, options [nop,nop,TS val 522686136 ecr 691671077], length 16: HTTP
11:56:39.435607 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 66: 10.77.10.10.43958 > 10.77.20.80.80: Flags [.], ack 189, win 63, options [nop,nop,TS val 691671077 ecr 522686136], length 0
11:56:39.435632 02:77:10:00:00:01 > 02:77:10:00:00:10, ethertype IPv4 (0x0800), length 66: 10.77.20.80.80 > 10.77.10.10.43958: Flags [F.], seq 189, ack 84, win 64, options [nop,nop,TS val 522686136 ecr 691671077], length 0
11:56:39.435688 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 66: 10.77.10.10.43958 > 10.77.20.80.80: Flags [F.], seq 84, ack 190, win 63, options [nop,nop,TS val 691671077 ecr 522686136], length 0
11:56:39.435807 02:77:10:00:00:01 > 02:77:10:00:00:10, ethertype IPv4 (0x0800), length 66: 10.77.20.80.80 > 10.77.10.10.43958: Flags [.], ack 85, win 64, options [nop,nop,TS val 522686136 ecr 691671077], length 0learner@laptop:~$ tcpdump -n -A -r hello.pcapreading from file hello.pcap, link-type EN10MB (Ethernet), snapshot length 262144
11:56:39.431102 IP 10.77.10.10.43958 > 10.77.20.80.80: Flags [S], seq 2888784756, win 64240, options [mss 1460,sackOK,TS val 691671072 ecr 0,nop,wscale 10], length 0
E..<..@.@.>.
M
M.P...P./[t........3".........
):. .......
11:56:39.431256 IP 10.77.20.80.80 > 10.77.10.10.43958: Flags [S.], seq 2766705611, ack 2888784757, win 65160, options [mss 1460,sackOK,TS val 522686132 ecr 691671072,nop,wscale 10], length 0
E..<..@.?...
M.P
M
.P......./[u....3".........
.'..):. ...
11:56:39.431266 IP 10.77.10.10.43958 > 10.77.20.80.80: Flags [.], ack 1, win 63, options [nop,nop,TS val 691671073 ecr 522686132], length 0
E..4..@.@.>.
M
M.P...P./[u.......?3......
):.!.'..
11:56:39.431426 IP 10.77.10.10.43958 > 10.77.20.80.80: Flags [P.], seq 1:84, ack 1, win 63, options [nop,nop,TS val 691671073 ecr 522686132], length 83: HTTP: GET /hello.txt HTTP/1.1
E.....@.@.>y
M
M.P...P./[u.......?3m.....
):.!.'..GET /hello.txt HTTP/1.1
Host: 10.77.20.80
User-Agent: curl/8.5.0
Accept: */*
11:56:39.431461 IP 10.77.20.80.80 > 10.77.10.10.43958: Flags [.], ack 84, win 64, options [nop,nop,TS val 522686132 ecr 691671073], length 0
E..4..@.?.`.
M.P
M
.P......./[....@3......
.'..):.!
11:56:39.435539 IP 10.77.20.80.80 > 10.77.10.10.43958: Flags [P.], seq 1:173, ack 84, win 64, options [nop,nop,TS val 522686136 ecr 691671073], length 172: HTTP: HTTP/1.0 200 OK
E.....@.?.`7
M.P
M
.P......./[....@3......
.'..):.!HTTP/1.0 200 OK
Server: netlab-web/1.0
Date: Fri, 20 Nov 2026 11:56:39 GMT
Content-type: text/plain
Content-Length: 16
Last-Modified: Thu, 19 Nov 2026 00:00:00 GMT
11:56:39.435567 IP 10.77.10.10.43958 > 10.77.20.80.80: Flags [.], ack 173, win 63, options [nop,nop,TS val 691671077 ecr 522686136], length 0
E..4..@.@.>.
M
M.P...P./[....x...?3......
):.%.'..
11:56:39.435605 IP 10.77.20.80.80 > 10.77.10.10.43958: Flags [P.], seq 173:189, ack 84, win 64, options [nop,nop,TS val 522686136 ecr 691671077], length 16: HTTP
E..D..@.?.`.
M.P
M
.P.....x./[....@3*.....
.'..):.%Hello from web.
11:56:39.435607 IP 10.77.10.10.43958 > 10.77.20.80.80: Flags [.], ack 189, win 63, options [nop,nop,TS val 691671077 ecr 522686136], length 0
E..4..@.@.>.
M
M.P...P./[........?3......
):.%.'..
11:56:39.435632 IP 10.77.20.80.80 > 10.77.10.10.43958: Flags [F.], seq 189, ack 84, win 64, options [nop,nop,TS val 522686136 ecr 691671077], length 0
E..4..@.?.`.
M.P
M
.P......./[....@3......
.'..):.%
11:56:39.435688 IP 10.77.10.10.43958 > 10.77.20.80.80: Flags [F.], seq 84, ack 190, win 63, options [nop,nop,TS val 691671077 ecr 522686136], length 0
E..4..@.@.>.
M
M.P...P./[........?3......
):.%.'..
11:56:39.435807 IP 10.77.20.80.80 > 10.77.10.10.43958: Flags [.], ack 85, win 64, options [nop,nop,TS val 522686136 ecr 691671077], length 0
E..4..@.?.`.
M.P
M
.P......./[....@3......
.'..):.%learner@laptop:~$ Steps (18)
- Type
sudo tcpdump -i eth0 -n -w hello.pcap tcp port 80 - Press Enter
- Output:
[sudo] password for learner: - Type the password (the terminal shows nothing)
- Press Enter
- Output:
tcpdump: listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes - Terminal 2 on laptop finished sending. Return to terminal 1 and press Ctrl+C to stop listening.
- Press Ctrl + C
- Output:
12 packets captured 12 packets received by filter 0 packets dropped by kernel - Type
tcpdump -n -r hello.pcap - Press Enter
- Output:
reading from file hello.pcap, link-type EN10MB (Ethernet), snapshot length 262144 11:56:39.431102 IP 10.77.10.10.43958 > 10.77.20.80.80: Flags [S], seq 2888784756, win 64240, options [mss 1460,sackOK,TS val 691671072 ecr 0,nop,wscale 10], length 0 11:56:39.431256 IP 10.77.20.80.80 > 10.77.10.10.43958: Flags [S.], seq 2766705611, ack 2888784757, win 65160, options [mss 1460,sackOK,TS val 522686132 ecr 691671072,nop,wscale 10], length 0 11:56:39.431266 IP 10.77.10.10.43958 > 10.77.20.80.80: Flags [.], ack 1, win 63, options [nop,nop,TS val 691671073 ecr 522686132], length 0 11:56:39.431426 IP 10.77.10.10.43958 > 10.77.20.80.80: Flags [P.], seq 1:84, ack 1, win 63, options [nop,nop,TS val 691671073 ecr 522686132], length 83: HTTP: GET /hello.txt HTTP/1.1 11:56:39.431461 IP 10.77.20.80.80 > 10.77.10.10.43958: Flags [.], ack 84, win 64, options [nop,nop,TS val 522686132 ecr 691671073], length 0 11:56:39.435539 IP 10.77.20.80.80 > 10.77.10.10.43958: Flags [P.], seq 1:173, ack 84, win 64, options [nop,nop,TS val 522686136 ecr 691671073], length 172: HTTP: HTTP/1.0 200 OK 11:56:39.435567 IP 10.77.10.10.43958 > 10.77.20.80.80: Flags [.], ack 173, win 63, options [nop,nop,TS val 691671077 ecr 522686136], length 0 11:56:39.435605 IP 10.77.20.80.80 > 10.77.10.10.43958: Flags [P.], seq 173:189, ack 84, win 64, options [nop,nop,TS val 522686136 ecr 691671077], length 16: HTTP 11:56:39.435607 IP 10.77.10.10.43958 > 10.77.20.80.80: Flags [.], ack 189, win 63, options [nop,nop,TS val 691671077 ecr 522686136], length 0 11:56:39.435632 IP 10.77.20.80.80 > 10.77.10.10.43958: Flags [F.], seq 189, ack 84, win 64, options [nop,nop,TS val 522686136 ecr 691671077], length 0 11:56:39.435688 IP 10.77.10.10.43958 > 10.77.20.80.80: Flags [F.], seq 84, ack 190, win 63, options [nop,nop,TS val 691671077 ecr 522686136], length 0 11:56:39.435807 IP 10.77.20.80.80 > 10.77.10.10.43958: Flags [.], ack 85, win 64, options [nop,nop,TS val 522686136 ecr 691671077], length 0 - Type
tcpdump -n -e -r hello.pcap - Press Enter
- Output:
reading from file hello.pcap, link-type EN10MB (Ethernet), snapshot length 262144 11:56:39.431102 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 74: 10.77.10.10.43958 > 10.77.20.80.80: Flags [S], seq 2888784756, win 64240, options [mss 1460,sackOK,TS val 691671072 ecr 0,nop,wscale 10], length 0 11:56:39.431256 02:77:10:00:00:01 > 02:77:10:00:00:10, ethertype IPv4 (0x0800), length 74: 10.77.20.80.80 > 10.77.10.10.43958: Flags [S.], seq 2766705611, ack 2888784757, win 65160, options [mss 1460,sackOK,TS val 522686132 ecr 691671072,nop,wscale 10], length 0 11:56:39.431266 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 66: 10.77.10.10.43958 > 10.77.20.80.80: Flags [.], ack 1, win 63, options [nop,nop,TS val 691671073 ecr 522686132], length 0 11:56:39.431426 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 149: 10.77.10.10.43958 > 10.77.20.80.80: Flags [P.], seq 1:84, ack 1, win 63, options [nop,nop,TS val 691671073 ecr 522686132], length 83: HTTP: GET /hello.txt HTTP/1.1 11:56:39.431461 02:77:10:00:00:01 > 02:77:10:00:00:10, ethertype IPv4 (0x0800), length 66: 10.77.20.80.80 > 10.77.10.10.43958: Flags [.], ack 84, win 64, options [nop,nop,TS val 522686132 ecr 691671073], length 0 11:56:39.435539 02:77:10:00:00:01 > 02:77:10:00:00:10, ethertype IPv4 (0x0800), length 238: 10.77.20.80.80 > 10.77.10.10.43958: Flags [P.], seq 1:173, ack 84, win 64, options [nop,nop,TS val 522686136 ecr 691671073], length 172: HTTP: HTTP/1.0 200 OK 11:56:39.435567 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 66: 10.77.10.10.43958 > 10.77.20.80.80: Flags [.], ack 173, win 63, options [nop,nop,TS val 691671077 ecr 522686136], length 0 11:56:39.435605 02:77:10:00:00:01 > 02:77:10:00:00:10, ethertype IPv4 (0x0800), length 82: 10.77.20.80.80 > 10.77.10.10.43958: Flags [P.], seq 173:189, ack 84, win 64, options [nop,nop,TS val 522686136 ecr 691671077], length 16: HTTP 11:56:39.435607 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 66: 10.77.10.10.43958 > 10.77.20.80.80: Flags [.], ack 189, win 63, options [nop,nop,TS val 691671077 ecr 522686136], length 0 11:56:39.435632 02:77:10:00:00:01 > 02:77:10:00:00:10, ethertype IPv4 (0x0800), length 66: 10.77.20.80.80 > 10.77.10.10.43958: Flags [F.], seq 189, ack 84, win 64, options [nop,nop,TS val 522686136 ecr 691671077], length 0 11:56:39.435688 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 66: 10.77.10.10.43958 > 10.77.20.80.80: Flags [F.], seq 84, ack 190, win 63, options [nop,nop,TS val 691671077 ecr 522686136], length 0 11:56:39.435807 02:77:10:00:00:01 > 02:77:10:00:00:10, ethertype IPv4 (0x0800), length 66: 10.77.20.80.80 > 10.77.10.10.43958: Flags [.], ack 85, win 64, options [nop,nop,TS val 522686136 ecr 691671077], length 0 - Type
tcpdump -n -A -r hello.pcap - Press Enter
- Output:
reading from file hello.pcap, link-type EN10MB (Ethernet), snapshot length 262144 11:56:39.431102 IP 10.77.10.10.43958 > 10.77.20.80.80: Flags [S], seq 2888784756, win 64240, options [mss 1460,sackOK,TS val 691671072 ecr 0,nop,wscale 10], length 0 E..<..@.@.>. M M.P...P./[t........3"......... ):. ....... 11:56:39.431256 IP 10.77.20.80.80 > 10.77.10.10.43958: Flags [S.], seq 2766705611, ack 2888784757, win 65160, options [mss 1460,sackOK,TS val 522686132 ecr 691671072,nop,wscale 10], length 0 E..<..@.?... M.P M .P......./[u....3"......... .'..):. ... 11:56:39.431266 IP 10.77.10.10.43958 > 10.77.20.80.80: Flags [.], ack 1, win 63, options [nop,nop,TS val 691671073 ecr 522686132], length 0 E..4..@.@.>. M M.P...P./[u.......?3...... ):.!.'.. 11:56:39.431426 IP 10.77.10.10.43958 > 10.77.20.80.80: Flags [P.], seq 1:84, ack 1, win 63, options [nop,nop,TS val 691671073 ecr 522686132], length 83: HTTP: GET /hello.txt HTTP/1.1 E.....@.@.>y M M.P...P./[u.......?3m..... ):.!.'..GET /hello.txt HTTP/1.1 Host: 10.77.20.80 User-Agent: curl/8.5.0 Accept: */* 11:56:39.431461 IP 10.77.20.80.80 > 10.77.10.10.43958: Flags [.], ack 84, win 64, options [nop,nop,TS val 522686132 ecr 691671073], length 0 E..4..@.?.`. M.P M .P......./[....@3...... .'..):.! 11:56:39.435539 IP 10.77.20.80.80 > 10.77.10.10.43958: Flags [P.], seq 1:173, ack 84, win 64, options [nop,nop,TS val 522686136 ecr 691671073], length 172: HTTP: HTTP/1.0 200 OK E.....@.?.`7 M.P M .P......./[....@3...... .'..):.!HTTP/1.0 200 OK Server: netlab-web/1.0 Date: Fri, 20 Nov 2026 11:56:39 GMT Content-type: text/plain Content-Length: 16 Last-Modified: Thu, 19 Nov 2026 00:00:00 GMT 11:56:39.435567 IP 10.77.10.10.43958 > 10.77.20.80.80: Flags [.], ack 173, win 63, options [nop,nop,TS val 691671077 ecr 522686136], length 0 E..4..@.@.>. M M.P...P./[....x...?3...... ):.%.'.. 11:56:39.435605 IP 10.77.20.80.80 > 10.77.10.10.43958: Flags [P.], seq 173:189, ack 84, win 64, options [nop,nop,TS val 522686136 ecr 691671077], length 16: HTTP E..D..@.?.`. M.P M .P.....x./[....@3*..... .'..):.%Hello from web. 11:56:39.435607 IP 10.77.10.10.43958 > 10.77.20.80.80: Flags [.], ack 189, win 63, options [nop,nop,TS val 691671077 ecr 522686136], length 0 E..4..@.@.>. M M.P...P./[........?3...... ):.%.'.. 11:56:39.435632 IP 10.77.20.80.80 > 10.77.10.10.43958: Flags [F.], seq 189, ack 84, win 64, options [nop,nop,TS val 522686136 ecr 691671077], length 0 E..4..@.?.`. M.P M .P......./[....@3...... .'..):.% 11:56:39.435688 IP 10.77.10.10.43958 > 10.77.20.80.80: Flags [F.], seq 84, ack 190, win 63, options [nop,nop,TS val 691671077 ecr 522686136], length 0 E..4..@.@.>. M M.P...P./[........?3...... ):.%.'.. 11:56:39.435807 IP 10.77.20.80.80 > 10.77.10.10.43958: Flags [.], ack 85, win 64, options [nop,nop,TS val 522686136 ecr 691671077], length 0 E..4..@.?.`. M.P M .P......./[....@3...... .'..):.%
learner@laptop:~$ curl -sS http://10.77.20.80/hello.txtHello from web.learner@laptop:~$ Steps (3)
- Type
curl -sS http://10.77.20.80/hello.txt - Press Enter
- Output:
Hello from web.
The read-back commands finish normally and return to the prompt. The complete exchange may have 12 or 13 frames in these lab runs; a display count is not a promise about its length.
Predict: the request and its answer travel in opposite directions. Which addresses and ports change places?
Read one captured request line
11:56:39.431426 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 149: 10.77.10.10.43958 > 10.77.20.80.80: Flags [P.], seq 1:84, ack 1, win 63, options [nop,nop,TS val 691671073 ecr 522686132], length 83: HTTP: GET /hello.txt HTTP/1.102:77:10:00:00:10 > 02:77:10:00:00:0110.77.10.104395810.77.20.8080Reading the output
Pick a step to match a marked part of the output to the picture.
Steps (9)
- Time. Time: 11:56:39.431426. Shown on laptop's eth0 as: laptop. The timestamp was added by the capture tool, not sent as a protocol header.
- Link addresses. Link addresses: 02:77:10:00:00:10 > 02:77:10:00:00:01. Link layer. Shown on laptop's eth0 as: Link addresses. The link header names laptop and the router on this home link.
- Sending machine. Sending machine: 10.77.10.10. Internet layer. Shown on laptop's eth0 as: Source address. The internet header names the source machine.
- Sending port. Sending port: 43958. Transport layer. Shown on laptop's eth0 as: Source port. This source port belongs to the transport header; your number will differ.
- Direction. Direction: >. Shown on laptop's eth0 as: laptop. This second arrow points from the IP sender toward the IP receiver.
- Receiving machine. Receiving machine: 10.77.20.80. Internet layer. Shown on laptop's eth0 as: Destination address. The internet destination remains web even though the link destination is the router.
- Receiving port. Receiving port: 80. Transport layer. Shown on laptop's eth0 as: Destination port. The number after the destination address names the server port.
- TCP summary. TCP summary: Flags [P.], seq 1:84, ack 1, win 63, options [nop,nop,TS val 691671073 ecr 522686132], length 83:. Transport layer. Shown on laptop's eth0 as: laptop. These flags and numbers describe transport work. Leave their interpretation for Opening and closing TCP connections.
- Application text. Application text: HTTP: GET /hello.txt HTTP/1.1. Application layer. Shown on laptop's eth0 as: laptop. This decoded text identifies the application request and its path.
Check your answer
The source and destination IP addresses exchange places, together with their corresponding ports. On this capture’s home link, the source and destination MAC addresses also exchange places.
| Part of this line | What it is | Header |
|---|---|---|
11:56:39.431426 |
Time | None: added by tcpdump |
02:77:10:00:00:10 > 02:77:10:00:00:01 |
Link addresses | Ethernet |
10.77.10.10 |
Sending machine | IPv4 |
43958 |
Sending port | TCP |
> |
Direction | None: added by tcpdump |
10.77.20.80 |
Receiving machine | IPv4 |
80 |
Receiving port | TCP |
Flags [P.], seq 1:84, ack 1, win 63, options [nop,nop,TS val 691671073 ecr 522686132], length 83: |
TCP summary | TCP |
HTTP: GET /hello.txt HTTP/1.1 |
Application text | HTTP (application) |
Mistakes to recognize
Section titled “Mistakes to recognize”“The greater-than sign compares numbers.” Here it separates sender from receiver. Follow its direction before interpreting addresses.
“The system keeps this file anyway.” You created hello.pcap with -w. Without a running capture, there is no saved record of that earlier exchange to open afterwards.
Good to know
Section titled “Good to know”The timestamp belongs to the capture tool, rather than a header sent by the application. The line is a summary of bytes, not the full contents of every header.
Try it yourself
Section titled “Try it yourself”Request index.html instead. Save to index.pcap, then use only its read-back to identify the request line. Explain how you distinguished it from a reply.
Solution
learner@laptop:~$ sudo tcpdump -i eth0 -n -w index.pcap tcp port 80[sudo] password for learner: tcpdump: listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes^C12 packets captured
12 packets received by filter
0 packets dropped by kernellearner@laptop:~$ tcpdump -n -r index.pcapreading from file index.pcap, link-type EN10MB (Ethernet), snapshot length 262144
11:55:44.728361 IP 10.77.10.10.55262 > 10.77.20.80.80: Flags [S], seq 3529231220, win 64240, options [mss 1460,sackOK,TS val 463099822 ecr 0,nop,wscale 10], length 0
11:55:44.728406 IP 10.77.20.80.80 > 10.77.10.10.55262: Flags [S.], seq 782732885, ack 3529231221, win 65160, options [mss 1460,sackOK,TS val 2391830854 ecr 463099822,nop,wscale 10], length 0
11:55:44.728414 IP 10.77.10.10.55262 > 10.77.20.80.80: Flags [.], ack 1, win 63, options [nop,nop,TS val 463099822 ecr 2391830854], length 0
11:55:44.728469 IP 10.77.10.10.55262 > 10.77.20.80.80: Flags [P.], seq 1:85, ack 1, win 63, options [nop,nop,TS val 463099822 ecr 2391830854], length 84: HTTP: GET /index.html HTTP/1.1
11:55:44.728485 IP 10.77.20.80.80 > 10.77.10.10.55262: Flags [.], ack 85, win 64, options [nop,nop,TS val 2391830854 ecr 463099822], length 0
11:55:44.730959 IP 10.77.20.80.80 > 10.77.10.10.55262: Flags [P.], seq 1:173, ack 85, win 64, options [nop,nop,TS val 2391830856 ecr 463099822], length 172: HTTP: HTTP/1.0 200 OK
11:55:44.730995 IP 10.77.10.10.55262 > 10.77.20.80.80: Flags [.], ack 173, win 63, options [nop,nop,TS val 463099824 ecr 2391830856], length 0
11:55:44.731622 IP 10.77.20.80.80 > 10.77.10.10.55262: Flags [P.], seq 173:444, ack 85, win 64, options [nop,nop,TS val 2391830857 ecr 463099824], length 271: HTTP
11:55:44.731642 IP 10.77.10.10.55262 > 10.77.20.80.80: Flags [.], ack 444, win 63, options [nop,nop,TS val 463099825 ecr 2391830857], length 0
11:55:44.731680 IP 10.77.20.80.80 > 10.77.10.10.55262: Flags [F.], seq 444, ack 85, win 64, options [nop,nop,TS val 2391830857 ecr 463099825], length 0
11:55:44.731778 IP 10.77.10.10.55262 > 10.77.20.80.80: Flags [F.], seq 85, ack 445, win 63, options [nop,nop,TS val 463099825 ecr 2391830857], length 0
11:55:44.731812 IP 10.77.20.80.80 > 10.77.10.10.55262: Flags [.], ack 86, win 64, options [nop,nop,TS val 2391830857 ecr 463099825], length 0learner@laptop:~$ tcpdump -n -A -r index.pcapreading from file index.pcap, link-type EN10MB (Ethernet), snapshot length 262144
11:55:44.728361 IP 10.77.10.10.55262 > 10.77.20.80.80: Flags [S], seq 3529231220, win 64240, options [mss 1460,sackOK,TS val 463099822 ecr 0,nop,wscale 10], length 0
E..<..@.@.H.
M
M.P...P.[.t........3".........
..W........
11:55:44.728406 IP 10.77.20.80.80 > 10.77.10.10.55262: Flags [S.], seq 782732885, ack 3529231221, win 65160, options [mss 1460,sackOK,TS val 2391830854 ecr 463099822,nop,wscale 10], length 0
E..<..@.?...
M.P
M
.P.....U.[.u....3".........
..qF..W....
11:55:44.728414 IP 10.77.10.10.55262 > 10.77.20.80.80: Flags [.], ack 1, win 63, options [nop,nop,TS val 463099822 ecr 2391830854], length 0
E..4..@.@.H.
M
M.P...P.[.u...V...?3......
..W...qF
11:55:44.728469 IP 10.77.10.10.55262 > 10.77.20.80.80: Flags [P.], seq 1:85, ack 1, win 63, options [nop,nop,TS val 463099822 ecr 2391830854], length 84: HTTP: GET /index.html HTTP/1.1
E.....@.@.H.
M
M.P...P.[.u...V...?3n.....
..W...qFGET /index.html HTTP/1.1
Host: 10.77.20.80
User-Agent: curl/8.5.0
Accept: */*
11:55:44.728485 IP 10.77.20.80.80 > 10.77.10.10.55262: Flags [.], ack 85, win 64, options [nop,nop,TS val 2391830854 ecr 463099822], length 0
E..4..@.?...
M.P
M
.P.....V.[.....@3......
..qF..W.
11:55:44.730959 IP 10.77.20.80.80 > 10.77.10.10.55262: Flags [P.], seq 1:173, ack 85, win 64, options [nop,nop,TS val 2391830856 ecr 463099822], length 172: HTTP: HTTP/1.0 200 OK
E.....@.?...
M.P
M
.P.....V.[.....@3......
..qH..W.HTTP/1.0 200 OK
Server: netlab-web/1.0
Date: Fri, 20 Nov 2026 11:55:44 GMT
Content-type: text/html
Content-Length: 271
Last-Modified: Thu, 19 Nov 2026 00:00:00 GMT
11:55:44.730995 IP 10.77.10.10.55262 > 10.77.20.80.80: Flags [.], ack 173, win 63, options [nop,nop,TS val 463099824 ecr 2391830856], length 0
E..4..@.@.H.
M
M.P...P.[.........?3......
..W...qH
11:55:44.731622 IP 10.77.20.80.80 > 10.77.10.10.55262: Flags [P.], seq 173:444, ack 85, win 64, options [nop,nop,TS val 2391830857 ecr 463099824], length 271: HTTP
E..C..@.?...
M.P
M
.P.......[.....@4).....
..qI..W.<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>web.lab.test</title>
</head>
<body>
<h1>web.lab.test</h1>
<p>This page comes from the lab machine web.</p>
<p><a href="hello.txt">hello.txt</a> .. <a href="signin.html">Sign in</a></p>
</body>
</html>
11:55:44.731642 IP 10.77.10.10.55262 > 10.77.20.80.80: Flags [.], ack 444, win 63, options [nop,nop,TS val 463099825 ecr 2391830857], length 0
E..4..@.@.H.
M
M.P...P.[.........?3......
..W...qI
11:55:44.731680 IP 10.77.20.80.80 > 10.77.10.10.55262: Flags [F.], seq 444, ack 85, win 64, options [nop,nop,TS val 2391830857 ecr 463099825], length 0
E..4..@.?...
M.P
M
.P.......[.....@3......
..qI..W.
11:55:44.731778 IP 10.77.10.10.55262 > 10.77.20.80.80: Flags [F.], seq 85, ack 445, win 63, options [nop,nop,TS val 463099825 ecr 2391830857], length 0
E..4..@.@.H.
M
M.P...P.[.........?3......
..W...qI
11:55:44.731812 IP 10.77.20.80.80 > 10.77.10.10.55262: Flags [.], ack 86, win 64, options [nop,nop,TS val 2391830857 ecr 463099825], length 0
E..4..@.?...
M.P
M
.P.......[.....@3......
..qI..W.learner@laptop:~$ Steps (15)
- Type
sudo tcpdump -i eth0 -n -w index.pcap tcp port 80 - Press Enter
- Output:
[sudo] password for learner: - Type the password (the terminal shows nothing)
- Press Enter
- Output:
tcpdump: listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes - Terminal 2 on laptop finished sending. Return to terminal 1 and press Ctrl+C to stop listening.
- Press Ctrl + C
- Output:
12 packets captured 12 packets received by filter 0 packets dropped by kernel - Type
tcpdump -n -r index.pcap - Press Enter
- Output:
reading from file index.pcap, link-type EN10MB (Ethernet), snapshot length 262144 11:55:44.728361 IP 10.77.10.10.55262 > 10.77.20.80.80: Flags [S], seq 3529231220, win 64240, options [mss 1460,sackOK,TS val 463099822 ecr 0,nop,wscale 10], length 0 11:55:44.728406 IP 10.77.20.80.80 > 10.77.10.10.55262: Flags [S.], seq 782732885, ack 3529231221, win 65160, options [mss 1460,sackOK,TS val 2391830854 ecr 463099822,nop,wscale 10], length 0 11:55:44.728414 IP 10.77.10.10.55262 > 10.77.20.80.80: Flags [.], ack 1, win 63, options [nop,nop,TS val 463099822 ecr 2391830854], length 0 11:55:44.728469 IP 10.77.10.10.55262 > 10.77.20.80.80: Flags [P.], seq 1:85, ack 1, win 63, options [nop,nop,TS val 463099822 ecr 2391830854], length 84: HTTP: GET /index.html HTTP/1.1 11:55:44.728485 IP 10.77.20.80.80 > 10.77.10.10.55262: Flags [.], ack 85, win 64, options [nop,nop,TS val 2391830854 ecr 463099822], length 0 11:55:44.730959 IP 10.77.20.80.80 > 10.77.10.10.55262: Flags [P.], seq 1:173, ack 85, win 64, options [nop,nop,TS val 2391830856 ecr 463099822], length 172: HTTP: HTTP/1.0 200 OK 11:55:44.730995 IP 10.77.10.10.55262 > 10.77.20.80.80: Flags [.], ack 173, win 63, options [nop,nop,TS val 463099824 ecr 2391830856], length 0 11:55:44.731622 IP 10.77.20.80.80 > 10.77.10.10.55262: Flags [P.], seq 173:444, ack 85, win 64, options [nop,nop,TS val 2391830857 ecr 463099824], length 271: HTTP 11:55:44.731642 IP 10.77.10.10.55262 > 10.77.20.80.80: Flags [.], ack 444, win 63, options [nop,nop,TS val 463099825 ecr 2391830857], length 0 11:55:44.731680 IP 10.77.20.80.80 > 10.77.10.10.55262: Flags [F.], seq 444, ack 85, win 64, options [nop,nop,TS val 2391830857 ecr 463099825], length 0 11:55:44.731778 IP 10.77.10.10.55262 > 10.77.20.80.80: Flags [F.], seq 85, ack 445, win 63, options [nop,nop,TS val 463099825 ecr 2391830857], length 0 11:55:44.731812 IP 10.77.20.80.80 > 10.77.10.10.55262: Flags [.], ack 86, win 64, options [nop,nop,TS val 2391830857 ecr 463099825], length 0 - Type
tcpdump -n -A -r index.pcap - Press Enter
- Output:
reading from file index.pcap, link-type EN10MB (Ethernet), snapshot length 262144 11:55:44.728361 IP 10.77.10.10.55262 > 10.77.20.80.80: Flags [S], seq 3529231220, win 64240, options [mss 1460,sackOK,TS val 463099822 ecr 0,nop,wscale 10], length 0 E..<..@.@.H. M M.P...P.[.t........3"......... ..W........ 11:55:44.728406 IP 10.77.20.80.80 > 10.77.10.10.55262: Flags [S.], seq 782732885, ack 3529231221, win 65160, options [mss 1460,sackOK,TS val 2391830854 ecr 463099822,nop,wscale 10], length 0 E..<..@.?... M.P M .P.....U.[.u....3"......... ..qF..W.... 11:55:44.728414 IP 10.77.10.10.55262 > 10.77.20.80.80: Flags [.], ack 1, win 63, options [nop,nop,TS val 463099822 ecr 2391830854], length 0 E..4..@.@.H. M M.P...P.[.u...V...?3...... ..W...qF 11:55:44.728469 IP 10.77.10.10.55262 > 10.77.20.80.80: Flags [P.], seq 1:85, ack 1, win 63, options [nop,nop,TS val 463099822 ecr 2391830854], length 84: HTTP: GET /index.html HTTP/1.1 E.....@.@.H. M M.P...P.[.u...V...?3n..... ..W...qFGET /index.html HTTP/1.1 Host: 10.77.20.80 User-Agent: curl/8.5.0 Accept: */* 11:55:44.728485 IP 10.77.20.80.80 > 10.77.10.10.55262: Flags [.], ack 85, win 64, options [nop,nop,TS val 2391830854 ecr 463099822], length 0 E..4..@.?... M.P M .P.....V.[.....@3...... ..qF..W. 11:55:44.730959 IP 10.77.20.80.80 > 10.77.10.10.55262: Flags [P.], seq 1:173, ack 85, win 64, options [nop,nop,TS val 2391830856 ecr 463099822], length 172: HTTP: HTTP/1.0 200 OK E.....@.?... M.P M .P.....V.[.....@3...... ..qH..W.HTTP/1.0 200 OK Server: netlab-web/1.0 Date: Fri, 20 Nov 2026 11:55:44 GMT Content-type: text/html Content-Length: 271 Last-Modified: Thu, 19 Nov 2026 00:00:00 GMT 11:55:44.730995 IP 10.77.10.10.55262 > 10.77.20.80.80: Flags [.], ack 173, win 63, options [nop,nop,TS val 463099824 ecr 2391830856], length 0 E..4..@.@.H. M M.P...P.[.........?3...... ..W...qH 11:55:44.731622 IP 10.77.20.80.80 > 10.77.10.10.55262: Flags [P.], seq 173:444, ack 85, win 64, options [nop,nop,TS val 2391830857 ecr 463099824], length 271: HTTP E..C..@.?... M.P M .P.......[.....@4)..... ..qI..W.<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>web.lab.test</title> </head> <body> <h1>web.lab.test</h1> <p>This page comes from the lab machine web.</p> <p><a href="hello.txt">hello.txt</a> .. <a href="signin.html">Sign in</a></p> </body> </html> 11:55:44.731642 IP 10.77.10.10.55262 > 10.77.20.80.80: Flags [.], ack 444, win 63, options [nop,nop,TS val 463099825 ecr 2391830857], length 0 E..4..@.@.H. M M.P...P.[.........?3...... ..W...qI 11:55:44.731680 IP 10.77.20.80.80 > 10.77.10.10.55262: Flags [F.], seq 444, ack 85, win 64, options [nop,nop,TS val 2391830857 ecr 463099825], length 0 E..4..@.?... M.P M .P.......[.....@3...... ..qI..W. 11:55:44.731778 IP 10.77.10.10.55262 > 10.77.20.80.80: Flags [F.], seq 85, ack 445, win 63, options [nop,nop,TS val 463099825 ecr 2391830857], length 0 E..4..@.@.H. M M.P...P.[.........?3...... ..W...qI 11:55:44.731812 IP 10.77.20.80.80 > 10.77.10.10.55262: Flags [.], ack 86, win 64, options [nop,nop,TS val 2391830857 ecr 463099825], length 0 E..4..@.?... M.P M .P.......[.....@3...... ..qI..W.
learner@laptop:~$ curl -sS http://10.77.20.80/index.html<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>web.lab.test</title>
</head>
<body>
<h1>web.lab.test</h1>
<p>This page comes from the lab machine web.</p>
<p><a href="hello.txt">hello.txt</a> · <a href="signin.html">Sign in</a></p>
</body>
</html>learner@laptop:~$ Steps (3)
- Type
curl -sS http://10.77.20.80/index.html - Press Enter
- Output:
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>web.lab.test</title> </head> <body> <h1>web.lab.test</h1> <p>This page comes from the lab machine web.</p> <p><a href="hello.txt">hello.txt</a> · <a href="signin.html">Sign in</a></p> </body> </html>
Find GET /index.html HTTP/1.1 on the line sent from laptop toward web. Its destination port is 80. The request’s words, together with its direction, identify it; the port alone does not prove what the application said.
Leave for later
Section titled “Leave for later”Opening and closing TCP connections in TCP, UDP, and Ports explains the flags and the numbers after the addresses.
- Read time, sender, direction, receiver, then the remaining description.
- Separate the IP address from the following port.
- Write frames with
-w; read the saved file with-r.
Next, Reading Wireshark opens the same evidence in three panes.
Further reading
Section titled “Further reading”- Ubuntu: tcpdump manual, for numeric output, link headers, counts, and saved files.