A powerful terminal-based application for monitoring and analyzing PTPv2 (Precision Time Protocol) networks in real-time.
- ๐ Real-time dashboard with multiple panels
- ๐จ Multiple themes: Default, Monokai, Matrix
- โจ๏ธ Intuitive keyboard navigation
- ๐ฑ Responsive layout that adapts to terminal size
- ๐ Live updates without screen flicker
- โธ๏ธ Pause mode to temporarily stop network parsing for UI inspection
- ๐ Automatic PTP host discovery on port 319 and 320
- ๐ก Real-time packet capture and analysis
- ๐ท๏ธ Host classification by PTP state
- ๐ Network statistics and quality metrics
- ๐ Timing relationship tracking
- ๐ณ Visual hierarchy mapping of leader-follower relationships
- ๐ Comprehensive host table with sortable columns
- ๐ณ Hierarchical tree view showing leader-follower relationships
- ๐ข Multiple sort options (State, IP, Clock Identity, Domain, etc.)
- ๐ฏ Selection tracking across operations
- ๐ Quality indicators and confidence levels
- ๐ OUI database integration to show vendor information
- ๐ Real-time packet history
- ๐จ Color-coded message types (ANNOUNCE, SYNC, DELAY_REQ, etc.)
- ๐ฆ Rust 1.70.0 or later
- ๐ง Privilege to bind ports < 1024 (root)
# Clone the repository
git clone https://github.com/holoplot/ptp-trace.git
cd ptp-trace
# Build from source
cargo build --release
# Run with default settings
./target/release/ptp-trace
# ๐ Monitor specific interface
./target/release/ptp-trace --interface eth0
# ๐ Monitor multiple interfaces
./target/release/ptp-trace --interface eth0 --interface eth1
# ๐ Monitor all interfaces (default behavior)
./target/release/ptp-trace
# โก Faster updates (500ms)
./target/release/ptp-trace --update-interval 500
# ๐จ Use Matrix theme
./target/release/ptp-trace --theme matrix
# ๐ Enable debug mode
./target/release/ptp-trace --debug
# ๐ง Combine options
./target/release/ptp-trace --interface eth0 --interface eth1 --theme matrix --update-interval 500
โ
/k
- ๐ Move selection upโ
/j
- ๐ Move selection downPgUp
/PgDn
- ๐ Page navigation (10 items)Home
/End
- ๐ Jump to top/bottom
s
- ๐ Cycle sort columnsS
-โ๏ธ Toggle sort directiont
- ๐ณ Toggle hierarchical tree view- Green headers indicate active sort column
r
- ๐ Refresh/rescan networkc
- ๐๏ธ Clear hosts and packet historyp
- โธ๏ธ Toggle pause mode (stops network parsing, shows "PAUSED" in header)e
- ๐ Toggle expanded packet historyd
- ๐ Toggle debug mode
h
/F1
- โ Show/hide helpEsc
- ๐ช Close help or quitq
- ๐ซ Quit application
Choose from multiple built-in themes. See the output of ptp-trace --help
to get a list of available themes.
- ๐ผ๏ธ Complete terminal UI framework
- ๐ฎ Application structure and navigation
- ๐ Host table with sorting and scrolling
- ๐ณ Hierarchical tree view for PTP topology visualization
- ๐ฆ Packet history with detailed view
- ๐จ Multiple theme support
- โจ๏ธ Comprehensive keyboard controls
- ๐ Debug mode with scroll information
- ๐ค Data export - JSON, PCAP output formats
- ๐ Advanced filtering - Search and filter capabilities
- ๐ Enhanced analytics - Statistical analysis of timing data
- ๐ง Configuration management - Save/load application settings
# Development build
cargo build
# Optimized release build
cargo build --release
# Run tests
cargo test
# Format code
cargo fmt
# Lint code
cargo clippy
This project features an integrated OUI database for MAC address lookup. The information is compiled into the binary at build time so that it can be used without an internet connection from a single binary. To update the database, follow these steps:
# Update OUI database
python3 -r oui/requirements.txt
python3 oui/gen_oui_rust_phf.py >src/oui_map.rs
# Make sure to lint the code after updating the database
cargo clippy
Feel free to contribute to this project by submitting pull requests with the updated OUI database.
- ๐ฅ๏ธ ratatui - Terminal UI framework
- โก tokio - Async runtime
- โจ๏ธ crossterm - Cross-platform terminal handling
- ๐ clap - Command line argument parsing
- โ anyhow - Error handling
We welcome contributions! Please:
- ๐ด Fork the repository
- ๐ฟ Create a feature branch
- ๐ง Make your changes
- โ Add tests if applicable
- ๐ Update documentation
- ๐ Submit a pull request
- ๐ฆ Follow Rust best practices
- ๐ Document public APIs
- โ Include tests for new features
- ๐จ Use
cargo fmt
for formatting - ๐ Pass
cargo clippy
lints
This project is licensed under the GPLv2 License - see the LICENSE file for details.
- ๐ฐ๏ธ statime - Rust PTP implementation
- ๐ง ptp4l - Linux PTP daemon
- ๐ผ๏ธ ratatui - Terminal UI library
- โก tokio - Async runtime for Rust
- ๐ Use
h
orF1
in the application for interactive help - ๐ Enable debug mode with
d
for troubleshooting - ๐ง Report issues on the project's issue tracker
- ๐ฌ Join discussions for feature requests and support
๐ฐ๏ธ Built for precision timing networks โข ๐ฆ Written in Rust โข ๐ฅ๏ธ Runs in your terminal