← Quick references

Packet analysis: a first pass through an unfamiliar PCAP

Move from capture metadata to one conversation, using Wireshark's command-line tools without collecting new traffic.

Write the question before opening packets

A packet capture becomes easier to navigate when you have a specific question. Did a connection start? Did a DNS response arrive? Where did an application pause? Pick one question and note the expected endpoints and time window before looking for dramatic-looking packet labels.

In every command below, capture.pcap means an existing capture you own and are authorized to inspect. These examples read that file; they do not start a live capture. Use an installed copy of Wireshark's capinfos and TShark tools, and keep the original file unchanged.

Check the capture's boundaries

Start with capinfos. Review the file type, packet count, duration, earliest and latest timestamps, and available interface information. Check that the recording actually overlaps the incident or lab action you want to explain.

Write down the capture point and any known collection filter. A tiny file could contain exactly the exchange you need, while a large file may omit it completely. Missing packets are a limit on your conclusion, not evidence that the application never sent them.

capinfos capture.pcap
tshark -n -r capture.pcap -q -z io,phs
tshark -n -r capture.pcap -q -z conv,tcp

Find a conversation worth following

The protocol hierarchy gives a broad inventory; the TCP conversation summary identifies endpoint pairs and their activity. The -n option disables name resolution, keeping addresses visible and avoiding lookup traffic during this review. UDP-heavy captures need a corresponding UDP conversation view.

Use a display filter to narrow the packet list. DNS records can help establish a timeline, but visible DNS is not guaranteed: the capture may exclude it, an application may reuse cached results, or name resolution may be encrypted. An empty result is still a useful boundary to record.

tshark -n -r capture.pcap -Y 'dns'
tshark -n -r capture.pcap -Y 'tcp' -T fields -E header=y -e frame.number -e frame.time_relative -e tcp.stream -e ip.src -e ip.dst

Read the sequence, not just the warning

Choose a tcp.stream value from the results. Replace 0 below with that value, then examine the conversation in order. The IPv4 address fields in the previous command are blank for IPv6; add ipv6.src and ipv6.dst when appropriate.

Look for the opening handshake, payload exchange, acknowledgments, and close or reset. Wireshark's TCP analysis labels are calculated from observed packet sequences. A retransmission label deserves investigation, but it does not by itself identify the failing device or prove congestion. Check timing, direction, and capture completeness before assigning a cause.

tshark -n -r capture.pcap -Y 'tcp.stream == 0'

Leave a compact evidence trail

Finish with a few packet numbers and a plain explanation of what they show. Separate the observation from the proposed cause. Another reader should be able to open the same file, apply the same filter, and understand why you reached that conclusion.

  • Record the file identity, tool version, and time window.
  • Save the display filter and relevant frame numbers.
  • State what the capture cannot establish.
  • Share only the evidence needed; captures may contain sensitive application data.