A Linux CLI utility designed for real-time network traffic monitoring. Inspired by tools like iftop, this application sniffs packets on a specified interface, tracks network flows, and dynamically renders live bandwidth statistics.
sudo ./isa-top -i INTERFACE [-t TIME] [-s SORT_METHOD]| Switch | Argument | Requirement | Description |
|---|---|---|---|
-i, --interface |
<string> |
Required | Network interface to sniff on (e.g., eth0, enp0s3). |
-t, --time |
<int> |
Optional | Update/refresh interval in seconds (range: 1..100). Default: 1s. |
-s, --sort |
b | p |
Optional | Defines the sorting metric: • b – sort by bits/s (default) • p – sort by packets/s |
- Uses
libpcapto capture live packets directly from the network layer. - Parses and distinguishes between
TCP,UDP,ICMP,IGMP, andICMPv6protocols. - Implements a hash table with bucket chaining to aggregate bidirectional traffic metrics (RX/TX bits and packets) independently of the initial packet direction.
- Uses POSIX threads to separate the infinite packet capturing loop from the timed statistics display loop.
- Implements an optimized Bubble Sort to display the top 10 most active flows using a clean, auto-scaled visual interface (K, M, G suffixes for speeds).
- Language: C (C99 standard compliant)
- Libraries:
libpcap– low-level packet capturepthread– POSIX multi-threadingncurses– terminal screen rendering
- Target OS: Linux (developed & tested on Ubuntu)
sudo apt update
sudo apt install libpcap-dev libncurses5-dev libncursesw5-dev build-essentialmake buildclean up compiled binaries with
make clean