Docs/Recipe: PCAP traffic summarizer
Recipe

Recipe: PCAP traffic summarizer

Ingest a PCAP file and produce a human-readable summary of protocols, top talkers, and connection patterns.

Overview

This recipe walks through building a lightweight PCAP summarizer that extracts key metadata without full packet inspection. Output includes protocol distribution, IP pair rankings, and byte counts.

Ingredients

  • tshark or tcpdump for capture replay
  • Python 3.11+ with scapy or dpkt
  • Meridian agent for file-watch trigger
  • Output target: JSON blob or Markdown report

Steps

  1. Watch directoryConfigure Meridian to monitor /incoming/pcaps.
  2. Parse on arrivalOn new file, invoke summarizer script. Extract Ethernet, IP, and transport-layer headers.
  3. Aggregate statsCount packets per protocol, track src/dst IP pairs, sum bytes transferred.
  4. Emit reportWrite structured JSON to /outgoing/reports.

Sample output

{
  "total_packets": 18420,
  "protocols": { "TCP": 0.72, "UDP": 0.21, "ICMP": 0.07 },
  "top_talkers": [
    { "src": "10.0.0.5", "dst": "93.184.216.34", "bytes": 1048576 }
  ]
}

Next steps

Extend with GeoIP enrichment, TLS JA3 fingerprinting, or anomaly scoring. See the recipes index for related patterns.

Meridian · getnimbus.net