You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+24Lines changed: 24 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,7 @@ A cross-platform network monitoring tool built with Rust. RustNet provides real-
15
15
16
16
-**Real-time Network Monitoring**: Monitor active TCP, UDP, ICMP, and ARP connections with detailed state information
17
17
-**Connection States**: Track TCP states (`ESTABLISHED`, `SYN_SENT`, `TIME_WAIT`), QUIC states (`QUIC_INITIAL`, `QUIC_HANDSHAKE`, `QUIC_CONNECTED`), DNS states, SSH states, and activity-based UDP states
18
+
-**Interface Statistics**: Real-time monitoring of network interface metrics including bytes/packets transferred, errors, drops, and collisions
18
19
-**Deep Packet Inspection (DPI)**: Detect application protocols including HTTP, HTTPS/TLS with SNI, DNS, SSH with version detection, and QUIC with CONNECTION_CLOSE frame detection
19
20
-**TCP Network Analytics**: Real-time detection of TCP retransmissions, out-of-order packets, and fast retransmits with per-connection and aggregate statistics
20
21
-**Smart Connection Lifecycle**: Protocol-aware timeouts with visual staleness indicators (white → yellow → red) before cleanup
@@ -56,6 +57,28 @@ See [EBPF_BUILD.md](EBPF_BUILD.md) for more details and [ARCHITECTURE.md](ARCHIT
@@ -192,6 +193,7 @@ Log files are created in the `logs/` directory with timestamp: `rustnet_YYYY-MM-
192
193
### Views and Tabs
193
194
194
195
-`Tab` - Switch between tabs (Overview, Details, Help)
196
+
-`i` - Toggle Interface Statistics view
195
197
-`Enter` - View detailed information about selected connection
196
198
-`Esc` - Go back to previous view or clear active filter
197
199
-`h` - Toggle help screen
@@ -463,6 +465,126 @@ Fast retransmit frequency indicates how well TCP is recovering from packet loss
463
465
- SYN and FIN flags are properly accounted for in sequence number tracking (each consumes 1 sequence number)
464
466
- Only TCP connections show analytics; UDP, ICMP, and other protocols do not have these metrics
465
467
468
+
## Interface Statistics
469
+
470
+
RustNet provides real-time network interface statistics across all supported platforms (Linux, macOS, FreeBSD, Windows). Interface stats are displayed in two locations:
471
+
472
+
### Accessing Interface Statistics
473
+
474
+
**Overview Tab (Main Screen):**
475
+
- Interface stats appear in the right panel below Network Stats
476
+
- Shows up to 3 active interfaces with current rates
477
+
- Displays: `InterfaceName: X KB/s ↓ / Y KB/s ↑`
478
+
- Shows cumulative totals: `Errors (Total): N Drops (Total): M`
479
+
480
+
**Interfaces Tab (Detailed View):**
481
+
- Press `i` to toggle the Interface Statistics view
482
+
- Shows a detailed table of all network interfaces
483
+
- Displays comprehensive metrics for each interface
484
+
485
+
### Statistics Displayed
486
+
487
+
| Metric | Description | Notes |
488
+
|--------|-------------|-------|
489
+
|**RX Rate**| Current receive rate (bytes/sec) | Calculated from recent activity |
490
+
|**TX Rate**| Current transmit rate (bytes/sec) | Calculated from recent activity |
491
+
|**RX Packets**| Total packets received | Cumulative since boot/interface up |
492
+
|**TX Packets**| Total packets transmitted | Cumulative since boot/interface up |
493
+
|**RX Err**| Receive errors | Cumulative total (not recent) |
494
+
|**TX Err**| Transmit errors | Cumulative total (not recent) |
**Important**: Error and drop counters are **cumulative totals** since the system booted or the interface came up, not recent activity. These help identify long-term interface reliability but won't show immediate issues.
500
+
501
+
### Platform-Specific Behavior
502
+
503
+
**All Platforms:**
504
+
- All counters (bytes, packets, errors, drops) are cumulative from boot/interface up
505
+
- Rates (bytes/sec) are calculated from snapshots taken every 2 seconds
506
+
- Loopback interface is included for monitoring local traffic
507
+
508
+
**Windows:**
509
+
- Filters out virtual/filter adapters to show only physical interfaces:
- Excludes: Disconnected "Local Area Connection" adapters
513
+
- Uses LUID-based deduplication to prevent duplicate interface entries
514
+
- Collisions: Always 0 (not available on modern Windows interfaces)
515
+
516
+
**macOS:**
517
+
- Includes data validation to detect corrupt counters on virtual interfaces
518
+
- TX Drops: Always 0 (limited availability on macOS)
519
+
- Sanitizes error/drop counters if values appear corrupted (>2^31 or errors>packets)
520
+
521
+
**FreeBSD:**
522
+
- TX Drops: Always 0 (not typically available on FreeBSD)
523
+
- Uses BSD getifaddrs API with AF_LINK filtering
524
+
525
+
**Linux:**
526
+
- Reads statistics from `/sys/class/net/{interface}/statistics`
527
+
- All counters typically available and reliable
528
+
529
+
### Interpreting the Statistics
530
+
531
+
**Healthy Interface:**
532
+
```
533
+
Ethernet: 2.40 KB/s ↓ / 1.96 KB/s ↑
534
+
Errors (Total): 0 Drops (Total): 0
535
+
```
536
+
Zero or very low error/drop counts indicate a reliable network connection.
537
+
538
+
**Problematic Interface:**
539
+
```
540
+
WiFi: 150 KB/s ↓ / 45 KB/s ↑
541
+
Errors (Total): 1089 Drops (Total): 2178
542
+
```
543
+
High error/drop counts may indicate:
544
+
- Signal interference (WiFi)
545
+
- Cable issues (Ethernet)
546
+
- Network congestion
547
+
- Driver or hardware problems
548
+
549
+
**Note**: Since error/drop counters are cumulative, evaluate them relative to total packets. A few errors out of millions of packets is normal; thousands of errors with low packet counts indicates problems.
550
+
551
+
### Interface Filtering
552
+
553
+
**Which Interfaces Are Shown:**
554
+
- Interfaces must be operationally "up" OR have traffic statistics
555
+
- Loopback interface is included (useful for monitoring local connections)
556
+
- Virtual/filter adapters are excluded on Windows (they mirror physical interfaces)
557
+
558
+
**Overview Tab Filtering:**
559
+
- Windows: Shows all active interfaces (NPF device path detected automatically)
0 commit comments