NetTrace Visualizer is a Python-based network traffic analysis tool that visualizes global network communication patterns captured from Wireshark.
It reads a .pcap file, maps packets to geographic locations, and generates a .kml file to view connections on Google Maps or Google Earth.
It also plots a bar chart showing protocol distribution.
- 📡 Analyze Network Traffic — Reads
.pcapfiles captured via Wireshark. - 🌍 IP Geolocation — Uses
GeoLiteCityto locate destination IPs. - 🏙️ City-based Source IPs — Source IPs are anonymized using predefined city IPs (Bengaluru, Mumbai, Pune, Chennai, Delhi).
- 🗺️ Map Visualization — Generates
.kmlfiles showing packet travel routes. - 📊 Protocol Distribution Graph — Displays a bar chart of detected protocols (TCP, UDP, ICMP, ARP, IP).
Follow these steps to generate the network visualization:
- Download and install Wireshark.
- Start Wireshark and begin packet capturing on your active network interface.
- Open your web browser and visit various websites to generate traffic:
- Include sites from different regions to get packets from multiple destinations.
- For example: local news sites, Japanese news sites, Russian news sites, etc.
- Spend 10–15 seconds browsing to generate a variety of packets.
- Go back to Wireshark and stop packet capturing.
- Save the captured packets as a
.pcapfile (e.g.,recent.pcap) in your project directory.
Note: This captures only destination server IPs, your personal IP will not be exposed in the visualization thanks to city-based source IPs.
- Download the GeoLiteCity database (
GeoLiteCity.dat) from MaxMind’s database:
https://dev.maxmind.com/geoip/geolite2-free-geolocation-data/
OR get it directly from this repo: https://github.com/mbcc2006/GeoLiteCity-data - Place the
GeoLiteCity.datfile in the same directory as your script.
- Create a virtual environment (optional but recommended):
python -m venv env- Activate the environment:
- Windows:
env\Scripts\activate - Linux/Mac:
source env/bin/activate
- Install required Python packages:
pip install -r requirements.txt- Run the main script:
python main.py- The script will do the following:
- Extract source-destination IP pairs from the
.pcapfile. - Map each packet to a city-based source IP and destination geolocation.
- Generate a
.kmlfile (output.kml) with lines connecting the source city to destination IPs. - Display a bar chart of packet protocol distribution.
- Extract source-destination IP pairs from the
The script will display a bar chart showing counts of TCP, UDP, ICMP, ARP, and IP packets.
- The generated
output.kmlcan be opened in Google Maps or Google Earth. - Google Maps: Go to Google Maps, click the menu → Your Places → Maps → Create Map → Import KML, and upload
output.kml. - Google Earth: Open Google Earth, click File → Open, and select
output.kml.
The map will show lines connecting the selected city IP to all captured destination IPs.
Example Screenshots:
- Source IPs are anonymized — Real machine IPs are never exposed.
- The
.pcapfile may contain destination server IPs; no sensitive client info is shown. - For educational and visualization purposes only — do not use on unauthorized networks.
Alok Kumar Maurya – Developer | Email: alok05.maurya@gmail.com


