A real-time network connection monitoring tool built with Rust and GTK4, displaying active connections with live I/O statistics in a modern graphical interface.
- Real-time monitoring: Continuously monitors active network connections
- I/O statistics: Shows live upload/download rates for each connection
- Process identification: Displays the program and PID associated with each connection
- Modern GTK4 UI: Clean, responsive graphical interface with Libadwaita styling
- Address resolution: Simplifies common addresses (localhost, any, mDNS)
- Connection filtering: Filters out localhost connections for cleaner output
- Rust 1.70+ (2021 edition)
- GTK4 development libraries
- Libadwaita development libraries
- Linux system with
/procfilesystem
sudo apt update
sudo apt install libgtk-4-dev libadwaita-1-devsudo dnf install gtk4-devel libadwaita-devel- Clone the repository:
git clone <repository-url>
cd network-monitor- Build and run:
cargo runOr build in release mode:
cargo build --release
./target/release/network-monitorLaunch the network monitor application:
cargo runThe application will open a GTK4 window displaying:
- Protocol: TCP/UDP protocol
- State: Connection state (ESTABLISHED, LISTEN, etc.)
- Local Address: Local endpoint (resolved to readable format)
- Remote Address: Remote endpoint (resolved to readable format)
- Program(PID): Process name and PID
- RX Rate: Download rate
- TX Rate: Upload rate
Common addresses are simplified for readability:
0.0.0.0:*or*:*→ANY127.0.0.1:*or[::1]:*→LOCALHOST224.0.0.251:*→MDNS
- Uses
ss -tulnapeto get active connections with process information - Reads
/proc/[pid]/iofor real-time I/O statistics - Calculates rates by comparing I/O between updates
- Updates GTK4 interface every second with current connection state
- GTK4: Modern cross-platform GUI framework
- Libadwaita: GNOME-style UI components
- Tokio: Async runtime for concurrent operations
- System calls: Direct interaction with
/procfilesystem
This project is open source. See the LICENSE file for details.
