Skip to content

Practice: Your First Packet Capture

Module
Your First Packet Capture
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 need to show another learner what happened when laptop requested a file. A screenshot of a successful curl result would show the outcome, but it would leave out the path and the recorded frames. Make a small evidence package that another person can read without repeating your run.

Use your own lab request. The solution refers to the saved example already used in the lessons, so its changing numbers need not match yours. Distinguish recorded facts from things the capture point could not observe.

Finish Following an exchange. Keep the lab in its starting state, with no modes or faults. Open two terminals on laptop, both in the shared home directory. Choose an output filename that will not overwrite evidence you still need.

Do not start with a count limit. A short lab exchange can have 12 or 13 frames. Keep the whole request and response, including the final frames, instead of stopping after a set number.

Meet these five goals. Choose the commands from the preceding lessons and explain your choices alongside the evidence.

  1. Save one request for hello.txt made from laptop to web’s address. Name the machine and interface where you listened.
  2. Read the saved file as numeric text. Identify the sender and receiver of the request, separating their addresses from their ports.
  3. Open the file in Wireshark. Record the request’s frame number and connect that row to its IPv4 source bytes.
  4. Apply a display filter for web’s address, then remove it. Explain what would differ if you had used a capture filter instead.
  5. Follow the conversation and write a short account of the request and answer. Include one thing this capture cannot tell you about phone.

Keep the PCAP, your explanation, and the request frame number together. Record the command that sent traffic, the capture point, the capture filter, and how you stopped listening. Keep those notes after closing the terminal.

Predict before running: if the request succeeds but phone shows no matching frames, which observation should your report describe? Compare your prediction with the capture-location lesson.

“The recording speaks for itself.” A file without a capture point leaves the reader guessing where it came from. State laptop:eth0, rather than “the network.”

“A short display means a short exchange.” A count limit can stop before one last frame. A display filter can hide recorded rows. Say which action limited your evidence.

You do not need to explain the flags or sequence numbers to produce an honest report. Mark those fields as work for Opening and closing TCP connections. Keep them in the file so the evidence remains available when you learn their meanings.

Run the experiment and compare your explanation with the goals before opening the solution. If the file is empty, first check the prompt, interface, filter, and whether you started listening before sending. Record what was missing before repeating.

Hint

Reuse the save workflow from Reading a capture as text. Start terminal 1 first, send from terminal 2, then return and stop with Ctrl+C. Use a saved-file read to make sure the evidence exists before opening Wireshark.

Solution

One solution uses the hello.pcap save run shown in Reading a capture as text. The listener command is sudo tcpdump -i eth0 -n -w hello.pcap tcp port 80; terminal 2 runs curl -sS http://10.77.20.80/hello.txt. The listener ends with Ctrl+C. The -r read-back uses no sudo.

That saved example contains 12 frames. Frame 4 carries GET /hello.txt HTTP/1.1, from 10.77.10.10 to 10.77.20.80. The client port is 43958, and the server port is 80. Your number will differ for the client port. The reverse direction contains HTTP/1.0 200 OK and Hello from web.

An acceptable report says: “I listened at laptop:eth0, keeping TCP port 80. Laptop requested /hello.txt from web and received the file. This point showed that exchange; it does not show every frame delivered only to phone.”

Apply ip.addr == 10.77.20.80 to the saved file, then clear it. That changes visible rows. A capture filter would decide which frames could enter the file at all. The request row’s source address occupies four bytes inside the IPv4 header.

  1. Can a display filter recover frames excluded by a capture filter?
  2. Does an empty capture on phone prove the web request failed?
  3. Does > compare the numeric sizes of addresses?
  4. Which view connects a decoded field to its recorded bytes?
  5. Does every row carry application text?
Answers
  1. No. They never entered that recording.
  2. No. Phone can be outside the path of a successful request.
  3. No. It points from sender toward receiver in tcpdump output.
  4. Click the field in packet details and inspect its selection in packet bytes.
  5. No. TCP also exchanges frames without application payload.
  • Keep the capture point and filter with the file.
  • Identify the request from its direction and application text.
  • Explain the limits of the evidence as well as what it shows.

Next, Ethernet and Local Delivery explains the link behavior behind the different capture locations.