Octet

Which Wireshark filters do you use most, and how is a capture filter different from a display filter?

Show the answer

Say this first

A capture filter uses BPF syntax, like tcpdump, and decides what gets saved: smaller files, but whatever it excludes is gone. A display filter uses Wireshark's own syntax and only hides packets already captured. My everyday display filters are ip.addr == 10.10.0.25, tcp.port == 443, tcp.analysis.flags for retransmissions and window problems, tcp.flags.reset == 1, dns, icmp, and tcp.flags.syn == 1 && tcp.flags.ack == 0 to see connection attempts.

Go deeper

Two syntaxes

Capture filter (BPF)Display filter
Examplehost 10.10.0.25 and tcp port 443ip.addr == 10.10.0.25 && tcp.port == 443
Applieswhile capturingafter capturing
Also used bytcpdump, dumpcaptshark with -Y

Display filters worth knowing by heart

FilterShows
ip.src == 10.10.0.25 && ip.dst == 10.30.0.15one direction only
tcp.analysis.flagsanything flagged: retransmissions, dup ACKs, zero window, lost segments
tcp.analysis.retransmissionretransmissions only
tcp.analysis.zero_windowa receiver advertising a zero window
tcp.flags.syn == 1 && tcp.flags.ack == 0new connection attempts
tcp.flags.reset == 1resets
tcp.stream eq 7one conversation; also Follow TCP Stream
dns.flags.rcode != 0DNS errors such as NXDOMAIN and SERVFAIL
icmp.type == 3destination unreachable, including fragmentation needed (code 4)
arp.duplicate-address-detectedtwo MAC addresses claiming one IP
frame.time_delta_displayed > 1gaps of more than a second between displayed packets

Habits

Use Statistics, Conversations to find the heavy talkers, and Expert Information for a quick list of problems. Set the time display to "seconds since previous displayed packet" when hunting for delays.

Traps

  • A capture filter so tight that ARP, DNS and ICMP errors, the evidence you needed, were never saved.
How did you do?Book 5.2 Reliable Byte Stream (TCP)