# arshadakl/whatsapp-p2p-traceroute architecture

> Architecture diagram of the GitHub repository arshadakl/whatsapp-p2p-traceroute, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/arshadakl/whatsapp-p2p-traceroute
- Repository: https://github.com/arshadakl/whatsapp-p2p-traceroute

## Overview

WhatsApp P2P Traceroute captures authorized TCP/UDP traffic, identifies Meta and non-Meta remote endpoints, enriches and scores flows, then produces ranked reports and optional live dashboard updates. The README documents the feature set; sampled source confirms the CLI/dashboard orchestration and core capture-to-classification path. Reverse-DNS implementation and dashboard-page behavior are represented from documented capabilities, so their internal wiring is limited to the confirmed call/serve boundaries.

Main entry points: [`dashboard/server.py`](https://github.com/arshadakl/whatsapp-p2p-traceroute/blob/main/dashboard/server.py) (Dashboard server), [`core/packet_sniffer.py`](https://github.com/arshadakl/whatsapp-p2p-traceroute/blob/main/core/packet_sniffer.py) (Packet sniffer), [`main.py`](https://github.com/arshadakl/whatsapp-p2p-traceroute/blob/main/main.py) (CLI workflow), [`core/classifier.py`](https://github.com/arshadakl/whatsapp-p2p-traceroute/blob/main/core/classifier.py) (Flow classifier)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User entrypoints"]
  node_cli["CLI workflow<br/>[main.py]"]
  node_dashboard_server["Dashboard server<br/>[server.py]"]
end

subgraph group_capture["Capture and classification"]
  node_sniffer["Packet sniffer<br/>[packet_sniffer.py]"]
  node_classifier["Flow classifier<br/>[classifier.py]"]
end

subgraph group_enrichment["Endpoint enrichment"]
  node_meta_ranges["Meta prefixes<br/>[meta_ranges.py]"]
  node_ip_filter["Meta IP filter<br/>[ip_filter.py]"]
  node_dns["Reverse DNS<br/>[dns_resolver.py]"]
  node_geo["Geo and ASN<br/>[geo_ip.py]"]
end

subgraph group_outputs["Reports and dashboard"]
  node_reporting["Report aggregation<br/>[reporting.py]"]
  node_report_files["CSV and JSON reports<br/>[reporting.py]"]
  node_pcap["PCAP log<br/>[packet_sniffer.py]"]
  node_web_ui["Live dashboard page<br/>[index.html]"]
end

node_operator(("Network operator"))
node_network(("Network interface"))
node_ripe(("RIPEstat"))
node_maxmind[("GeoLite2 databases")]
node_browser(("Dashboard user"))

node_operator -->|"starts capture"| node_cli
node_operator -->|"starts dashboard"| node_dashboard_server
node_cli -->|"refreshes prefixes"| node_meta_ranges
node_meta_ranges -.->|"fetches prefixes"| node_ripe
node_cli -->|"loads ranges"| node_ip_filter
node_cli -->|"starts capture"| node_sniffer
node_network -->|"supplies packets"| node_sniffer
node_sniffer -->|"classifies packets"| node_classifier
node_classifier -->|"checks addresses"| node_ip_filter
node_classifier -->|"resolves hostname"| node_dns
node_classifier -->|"looks up endpoint"| node_geo
node_geo -.->|"reads location and ASN"| node_maxmind
node_sniffer -->|"writes packets"| node_pcap
node_cli -->|"aggregates records"| node_reporting
node_reporting -->|"writes summaries"| node_report_files
node_dashboard_server -->|"refreshes prefixes"| node_meta_ranges
node_dashboard_server -->|"loads ranges"| node_ip_filter
node_dashboard_server -->|"starts capture"| node_sniffer
node_sniffer -->|"streams records"| node_dashboard_server
node_dashboard_server -->|"aggregates records"| node_reporting
node_dashboard_server -->|"writes summaries"| node_report_files
node_browser -->|"requests page and feed"| node_dashboard_server
node_dashboard_server -->|"serves page"| node_web_ui
node_dashboard_server -->|"sends live records"| node_browser

click node_cli "https://github.com/arshadakl/whatsapp-p2p-traceroute/blob/main/main.py"
click node_dashboard_server "https://github.com/arshadakl/whatsapp-p2p-traceroute/blob/main/dashboard/server.py"
click node_sniffer "https://github.com/arshadakl/whatsapp-p2p-traceroute/blob/main/core/packet_sniffer.py"
click node_classifier "https://github.com/arshadakl/whatsapp-p2p-traceroute/blob/main/core/classifier.py"
click node_meta_ranges "https://github.com/arshadakl/whatsapp-p2p-traceroute/blob/main/core/meta_ranges.py"
click node_ip_filter "https://github.com/arshadakl/whatsapp-p2p-traceroute/blob/main/core/ip_filter.py"
click node_dns "https://github.com/arshadakl/whatsapp-p2p-traceroute/blob/main/core/dns_resolver.py"
click node_geo "https://github.com/arshadakl/whatsapp-p2p-traceroute/blob/main/utils/geo_ip.py"
click node_reporting "https://github.com/arshadakl/whatsapp-p2p-traceroute/blob/main/core/reporting.py"
click node_report_files "https://github.com/arshadakl/whatsapp-p2p-traceroute/blob/main/core/reporting.py"
click node_pcap "https://github.com/arshadakl/whatsapp-p2p-traceroute/blob/main/core/packet_sniffer.py"
click node_web_ui "https://github.com/arshadakl/whatsapp-p2p-traceroute/blob/main/dashboard/static/index.html"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_dashboard_server,node_browser toneBlue
class node_sniffer,node_classifier,node_maxmind toneAmber
class node_meta_ranges,node_ip_filter,node_dns,node_geo toneMint
class node_reporting,node_report_files,node_pcap,node_web_ui toneRose
class node_operator,node_network,node_ripe toneIndigo
```

## Components

### User entrypoints

- [CLI workflow](https://github.com/arshadakl/whatsapp-p2p-traceroute/blob/main/main.py): `main.py`
- [Dashboard server](https://github.com/arshadakl/whatsapp-p2p-traceroute/blob/main/dashboard/server.py): `dashboard/server.py`

### Capture and classification

- [Packet sniffer](https://github.com/arshadakl/whatsapp-p2p-traceroute/blob/main/core/packet_sniffer.py): `core/packet_sniffer.py`
- [Flow classifier](https://github.com/arshadakl/whatsapp-p2p-traceroute/blob/main/core/classifier.py): `core/classifier.py`

### Endpoint enrichment

- [Meta prefixes](https://github.com/arshadakl/whatsapp-p2p-traceroute/blob/main/core/meta_ranges.py): `core/meta_ranges.py`
- [Meta IP filter](https://github.com/arshadakl/whatsapp-p2p-traceroute/blob/main/core/ip_filter.py): `core/ip_filter.py`
- [Reverse DNS](https://github.com/arshadakl/whatsapp-p2p-traceroute/blob/main/core/dns_resolver.py): `core/dns_resolver.py`
- [Geo and ASN](https://github.com/arshadakl/whatsapp-p2p-traceroute/blob/main/utils/geo_ip.py): `utils/geo_ip.py`

### Reports and dashboard

- [Report aggregation](https://github.com/arshadakl/whatsapp-p2p-traceroute/blob/main/core/reporting.py): `core/reporting.py`
- [CSV and JSON reports](https://github.com/arshadakl/whatsapp-p2p-traceroute/blob/main/core/reporting.py): `core/reporting.py`
- [PCAP log](https://github.com/arshadakl/whatsapp-p2p-traceroute/blob/main/core/packet_sniffer.py): `core/packet_sniffer.py`
- [Live dashboard page](https://github.com/arshadakl/whatsapp-p2p-traceroute/blob/main/dashboard/static/index.html): `dashboard/static/index.html`

### Other components

- **Network operator**
- **Network interface**
- **RIPEstat**
- **GeoLite2 databases**
- **Dashboard user**

## Connections

- Network operator → CLI workflow: starts capture
- Network operator → Dashboard server: starts dashboard
- CLI workflow → Meta prefixes: refreshes prefixes
- Meta prefixes → RIPEstat: fetches prefixes
- CLI workflow → Meta IP filter: loads ranges
- CLI workflow → Packet sniffer: starts capture
- Network interface → Packet sniffer: supplies packets
- Packet sniffer → Flow classifier: classifies packets
- Flow classifier → Meta IP filter: checks addresses
- Flow classifier → Reverse DNS: resolves hostname
- Flow classifier → Geo and ASN: looks up endpoint
- Geo and ASN → GeoLite2 databases: reads location and ASN
- Packet sniffer → PCAP log: writes packets
- CLI workflow → Report aggregation: aggregates records
- Report aggregation → CSV and JSON reports: writes summaries
- Dashboard server → Meta prefixes: refreshes prefixes
- Dashboard server → Meta IP filter: loads ranges
- Dashboard server → Packet sniffer: starts capture
- Packet sniffer → Dashboard server: streams records
- Dashboard server → Report aggregation: aggregates records
- Dashboard server → CSV and JSON reports: writes summaries
- Dashboard user → Dashboard server: requests page and feed
- Dashboard server → Live dashboard page: serves page
- Dashboard server → Dashboard user: sends live records
