Writing / 2 Oct 2026
Reading a packet capture without guessing
A capture is evidence, not an answer. Start with a question, keep the file small, and read the handshake before the payload.
The worst packet capture is the one taken after the problem disappeared, on the wrong interface, with no idea what question it was supposed to answer.
A capture is evidence. It is not an answer, and it is not a substitute for knowing where the traffic actually flows. The useful workflow is boring: define the question, capture in the right place, keep the file small, and read the layers in order.
Start with a question
“The network is slow” is not a question. It is a complaint with a timestamp. Turn it into something a capture can falsify:
- Is one flow slow, or every flow from one client?
- Is it slow in both directions, or only on upload?
- Does it start at a particular time, or after a particular change?
- Is the delay before the first byte, or during the transfer?
- Does it happen through a middlebox, a NAT device, or only on one path?
Each answer changes where you capture. A problem that only appears after a NAT device is not going to be visible on the client’s loopback interface. A problem that appears only on large transfers is often an MTU or window issue, not a bandwidth issue.
Capture in the right place
If you can, capture on both ends. One capture tells you what arrived; two captures tell you what was sent, what was received, and what was lost in between. The difference is usually the interesting part.
# Headers only, one host, one port, 500 packets
sudo tcpdump -ni eth0 -s 128 -c 500 \
'tcp port 443 and host 192.0.2.10' \
-w /tmp/cap.pcap
-s 128 keeps the IP and TCP headers and truncates the payload. That is usually enough to diagnose handshakes, retransmissions, and window behaviour, and it keeps the file small. If you need payload, use -s 0, but treat the file as sensitive.
On a busy host, give the kernel room to buffer:
sudo tcpdump -ni eth0 -s 128 -B 4096 -w /tmp/cap.pcap 'tcp port 443'
Watch for the “packets dropped by kernel” line when you stop the capture. A capture that dropped packets is still evidence, but it is not a complete record, and the gaps can look like loss.
Read the handshake first
Before you look at payload or application logs, read the first few packets of each flow:
- SYN, SYN-ACK, ACK: did the connection establish, and how long did the round trip take?
- Window scale, MSS, SACK permitted: what did each side agree to?
- TLS ClientHello and ServerHello: which SNI, ALPN, and cipher suite were negotiated?
- Did the handshake complete, or did it stall after the ClientHello?
A surprising number of “slow network” tickets are actually a stalled handshake: a middlebox dropping a large ClientHello, a server with a full accept queue, or a path MTU problem that only shows up when the certificate chain is larger than expected.
Follow the loss, not the story
Once the flow is established, look for evidence rather than symptoms:
# Retransmissions with timestamps
tshark -r /tmp/cap.pcap \
-Y 'tcp.analysis.retransmission' \
-T fields -e frame.time_relative -e ip.src -e tcp.seq -e tcp.len
# Throughput over time, one-second buckets
tshark -r /tmp/cap.pcap -q -z io,stat,1
Retransmissions are not automatically a network problem. They can come from a receiver that is overloaded, a sender that is too aggressive, or a capture point that is dropping packets. Look at the pattern:
- periodic retransmissions with growing RTOs suggest real loss;
- fast retransmits after duplicate ACKs suggest a dropped segment in flight;
- zero-window advertisements suggest the receiver, not the path;
- retransmissions only on one direction suggest an asymmetric path or a middlebox.
If the capture shows no loss and the application is still slow, the problem may be above TCP: a slow backend, a blocking DNS lookup, or a queue in the application itself. The capture is telling you where not to look.
Beware the capture effect
A capture taken on an overloaded host is not neutral. The act of capturing can drop packets, change timing, and add CPU pressure. Timestamps come from different clocks, and one-way delay calculations without synchronization are fiction.
If you need precise timing, capture close to the source, use hardware timestamps where available, and synchronize clocks. If you cannot synchronize, stick to round-trip measurements and relative timing within a single capture.
A short checklist
- Write the question before you start the capture.
- Capture on both ends if possible.
- Use a filter and a snap length; keep the file small.
- Check for kernel drops when you stop.
- Read the handshake before the payload.
- Look for loss, reordering, and zero-window events.
- Compare the two ends before blaming the path.
- Delete the capture when you are done.
The last step matters. Packet captures contain addresses, hostnames, and sometimes credentials. Treat them like logs with a shorter half-life.