Work  /  Data engineering

Network traffic analyzer

Reads packet captures, shows who is using the network and how, flags port scans and spikes, and suggests what to fix.

merciven.co/work/network-traffic-analyzer/live/LiveOpen ↗
The Network traffic analyzer app, running with sample data

The problem

Small offices and labs have no network monitoring. Slowdowns get blamed on the internet provider, and a machine probing the network can go unnoticed for weeks.

Objectives

  1. Turn raw packets into a readable picture
  2. Find the hosts using the most bandwidth
  3. Flag port scans and unusual spikes
  4. Recommend concrete fixes

Process

  1. DiscoverListed the questions admins ask: who, how much, and is anything wrong.
  2. DefineGroup packets by protocol, host and port; set a port-scan threshold.
  3. BuildPacket parsing with Scapy, analysis with pandas, charts with Matplotlib.
  4. ProveChecked results against Wireshark on the same captures.

Who it's for

Network admins

See top talkers and protocol mix at a glance.

Security

Get alerted when one host touches too many ports.

Challenges

  • Captures are large and noisy
  • Scans look like normal traffic packet by packet
  • Alerts must be specific enough to act on

What we built

Traffic breakdown

By protocol, source, destination and port, with total bandwidth.

Top talkers

The hosts sending and receiving the most.

Port-scan detection

Flags a source that reaches more distinct ports than the threshold.

Recommendations

Each alert comes with a suggested fix.

Flow

  1. Packet capture
  2. Parse with Scapy
  3. Group by protocol and host
  4. Bandwidth and top talkers
  5. Port-scan check
  6. Alerts
  7. Recommendations

Tools & languages

  • Python
  • Scapy
  • pandas
  • Matplotlib
  • Wireshark (validation)

The code

The analyzer script: packet parsing, protocol and host analysis, port-scan detection and charts.

View the code on GitHubTalk it through on a call