Xfr
A modern iperf3 alternative with a live TUI, multi-client server, and QUIC support. Built in Rust.
Install / Use
/learn @lance0/XfrREADME
xfr
<p align="center"> <img src="xfr-logo.png" alt="xfr logo" width="200"> </p>A modern iperf3 alternative with a live TUI, multi-client server, MPTCP, and QUIC support. Built in Rust.
Quick Start
# Server
xfr serve
# Client (in another terminal or machine)
xfr 192.168.1.1 # Basic TCP test
xfr 192.168.1.1 -b 100M # TCP at 100 Mbps
xfr 192.168.1.1 -P 4 # 4 parallel streams
xfr 192.168.1.1 -u -b 1G # UDP at 1 Gbps
See Installation below for setup instructions.
TUI Preview
<p align="center"> <img src="xfr-ss.png" alt="xfr TUI interface" width="800"> </p>Features
- Live TUI with real-time throughput graphs and per-stream stats
- Server dashboard -
xfr serve --tuifor monitoring active tests - Multi-client server - handle multiple simultaneous tests
- TCP, UDP, QUIC, and MPTCP with configurable bitrate pacing and parallel streams
- Firewall-friendly - single-port TCP, QUIC multiplexing, and
--cportfor pinning UDP/QUIC/TCP data source ports - Bidirectional testing - measure upload and download simultaneously
- Multiple output formats - plain text, JSON, JSON streaming, CSV
- Result comparison -
xfr diffto detect performance regressions - LAN discovery - find xfr servers with mDNS (
xfr discover) - Prometheus metrics - export stats for monitoring dashboards
- Config file - save defaults in
~/.config/xfr/config.toml - Environment variables -
XFR_PORT,XFR_DURATIONoverrides
vs iperf3
| Feature | iperf3 | xfr |
|---------|--------|-----|
| Live TUI | No | Yes (client & server) |
| Multi-client server | No | Yes |
| MPTCP | No | Yes (auto on server, --mptcp on client, Linux 5.6+) |
| Firewall-friendly | --cport (TCP/UDP) | Single-port TCP + --cport (UDP/QUIC/TCP data) |
| Output formats | Text/JSON | Text/JSON/CSV |
| Prometheus metrics | No | Yes (optional feature) |
| Compare runs | No | xfr diff |
| LAN discovery | No | xfr discover |
| Config file | No | Yes |
Real-World Use Cases
VPN Tunnel Testing
Measure actual throughput through your VPN:
# On VPN server
xfr serve
# From client, through VPN
xfr 10.8.0.1 -t 30s
UDP Congestion Detection
Test UDP at your expected rate to detect packet loss:
xfr <host> -u -b 500M -t 60s # Watch for loss percentage in TUI
Before/After Comparison
Quantify the impact of network changes:
xfr <host> --json -o before.json
# ... make changes ...
xfr <host> --json -o after.json
xfr diff before.json after.json --threshold 5
Multi-Stream for Bonded Connections
Test aggregate bandwidth across bonded/LACP interfaces:
xfr <host> -P 8 -t 30s # 8 streams to utilize all links
Prometheus Monitoring
Continuous performance monitoring:
xfr serve --prometheus 9090 --push-gateway http://pushgateway:9091
# Scrape metrics or view in Grafana
Installation
From crates.io (Recommended)
Requires Rust 1.88+:
# Install Rust (if not already installed)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source ~/.cargo/env
# Install xfr
cargo install xfr
Homebrew (macOS/Linux)
brew install lance0/tap/xfr
Pre-built Binaries
Download from GitHub Releases:
| Platform | Target |
|----------|--------|
| Linux x86_64 | xfr-x86_64-unknown-linux-musl.tar.gz |
| Linux ARM64 | xfr-aarch64-unknown-linux-gnu.tar.gz |
| macOS Apple Silicon | xfr-aarch64-apple-darwin.tar.gz |
| macOS Intel | Use cargo install xfr |
| Android (Termux) | xfr-aarch64-linux-android.tar.gz |
| Windows | Use WSL2 (native support is experimental) |
# Example: Linux x86_64
curl -LO https://github.com/lance0/xfr/releases/latest/download/xfr-x86_64-unknown-linux-musl.tar.gz
tar xzf xfr-*.tar.gz && sudo mv xfr /usr/local/bin/
eget
eget lance0/xfr
Arch Linux (AUR)
yay -S xfr-bin
From Source
git clone https://github.com/lance0/xfr
cd xfr && cargo build --release
sudo cp target/release/xfr /usr/local/bin/
Quick Install Script
Note: Review scripts before piping to sh. See the install script source.
curl -fsSL https://raw.githubusercontent.com/lance0/xfr/master/install.sh | sh
Termux (Android)
Download the aarch64-linux-android binary from releases, or build from source:
pkg install rust
cargo install xfr
Nix
nix run github:lance0/xfr # Run without installing
nix profile install github:lance0/xfr # Install to profile
Or add to your flake inputs:
inputs.xfr.url = "github:lance0/xfr";
A dev shell is also available via nix develop.
NetBSD
Available via pkgsrc:
pkgin install xfr
Optional Features
| Feature | Default | Description |
|---------|---------|-------------|
| discovery | Yes | mDNS LAN discovery (xfr discover) |
| prometheus | No | Prometheus metrics endpoint and Push Gateway support |
cargo install xfr --features prometheus # Prometheus support
cargo install xfr --all-features # All features
Shell Completions
# Bash
xfr --completions bash > ~/.local/share/bash-completion/completions/xfr
# Zsh (add ~/.zfunc to fpath in .zshrc first)
xfr --completions zsh > ~/.zfunc/_xfr
# Fish
xfr --completions fish > ~/.config/fish/completions/xfr.fish
# PowerShell (add to $PROFILE)
xfr --completions powershell >> $PROFILE
# Elvish
xfr --completions elvish > ~/.elvish/lib/xfr.elv
Usage
Server
xfr serve # Listen on port 5201
xfr serve -p 9000 # Custom port
xfr serve --tui # Live dashboard showing active tests
xfr serve --one-off # Exit after one test
xfr serve --max-duration 60s # Limit test duration
xfr serve --push-gateway http://pushgateway:9091 # Push metrics on test complete
xfr serve --psk mysecret # Require PSK authentication
xfr serve --rate-limit 2 # Max 2 concurrent tests per IP
xfr serve --allow 192.168.0.0/16 --deny 0.0.0.0/0 # IP ACL
Client
xfr 192.168.1.1 # TCP test, 10s, single stream
xfr 192.168.1.1 -t 30s # 30 second test
xfr 192.168.1.1 -P 4 # 4 parallel streams
xfr 192.168.1.1 -R # Reverse (download test)
xfr 192.168.1.1 --bidir # Bidirectional
xfr 192.168.1.1 -6 # Force IPv6 only
xfr ::1 -6 # IPv6 localhost
UDP Mode
xfr 192.168.1.1 -u # UDP mode
xfr 192.168.1.1 -u -b 1G # UDP at 1 Gbps
xfr 192.168.1.1 -u -b 100M # UDP at 100 Mbps
QUIC Mode
xfr 192.168.1.1 --quic # QUIC transport (encrypted)
xfr 192.168.1.1 --quic -P 4 # QUIC with 4 parallel streams
xfr 192.168.1.1 --quic -R # QUIC download test
QUIC provides built-in TLS 1.3 encryption with stream multiplexing over a single connection.
Security Note: QUIC encrypts traffic but does not verify server identity by default. For authenticated connections, use --psk on both client and server to prevent MITM attacks.
MPTCP Mode
xfr 192.168.1.1 --mptcp # MPTCP (Multi-Path TCP, Linux 5.6+)
xfr 192.168.1.1 --mptcp -P 4 # MPTCP with 4 parallel streams
xfr 192.168.1.1 --mptcp -R # MPTCP download test
MPTCP enables a single connection to use multiple network paths simultaneously (e.g., WiFi + Ethernet). The server automatically creates MPTCP listeners — no flag needed on the server side. All TCP features (nodelay, congestion control, window size, bidir, multi-stream) work transparently with MPTCP.
Output Formats
xfr <host> --json # JSON summary
xfr <host> --json-stream # JSON per interval (for scripting)
xfr <host> --csv # CSV output
xfr <host> -q # Quiet mode (summary only)
xfr <host> -o results.json # Save to file
xfr <host> --no-tui # Plain text, no TUI
xfr <host> --timestamp-format iso8601 # ISO 8601 timestamps
Note: Log messages go to stderr, allowing clean JSON/CSV piping: xfr <host> --json 2>/dev/null
Interval Control
xfr <host> -i 2 # Report every 2 seconds
xfr <host> --omit 3 # Skip first 3s of intervals (TCP ramp-up)
Compare Results
xfr diff baseline.json current.json
xfr diff baseline.json current.json --threshold 5
Discovery
xfr discover # Find xfr servers on LAN
xfr discover --timeout 10s # Extended search
Keybindings (Client TUI)
| Key | Action |
|-----|--------|
| q | Quit (cancels test) |
| p | Pause/Resume display |
| s | Settings modal |
| t | Cycle color theme |
| d | Toggle per-stream view |
| ? / F1 | Help |
| j | Print JSON result |
| u | Dismiss update notification |
Keybindings (Server TUI)
| Key | Action |
|-----|--------|
| q | Quit server |
| ? / F1 | Help |
| Esc | Close help |
Themes
xfr includes 11 built-in color themes. Select with --theme or press t during a test:
xfr <host> --theme dracula # Dark purple theme
xfr <host> --theme matrix # Green on black hacker style
xfr <host> --theme catppuccin # Soothing pastels
xfr <host> --theme nord # Arctic blue tones
Available themes: default, kawaii, cyber, dracula, monochrome, `matr
