โ† Back to the chapter

Technical detail ยท Network Traffic Analysis: Capture Points and Tools

Minimal capture commands and display filters

20.4.1 Minimal Capture Examples

Use command snippets as starting points, not as unreviewed production procedures.

# Capture one device's broker traffic on a gateway.
sudo tcpdump -i eth0 host 192.0.2.40 and port 8883 -w device-broker.pcap

# Extract a repeatable packet summary from an existing capture.
tshark -r device-broker.pcap -Y "tcp.analysis.retransmission or tcp.flags.reset == 1" \
  -T fields -e frame.time -e ip.src -e ip.dst -e tcp.stream -e _ws.col.Info

Useful display filters depend on the protocol and visibility. The Wireshark Display Filter Reference defines the fields and filter syntax:

mqtt
coap
tcp.analysis.retransmission
tcp.flags.reset == 1
dns or mdns
ip.addr == 192.0.2.40
frame.time_delta > 1

โ† Back to the chapter