Multi-connection mode is not supported and causes near-zero throughput. Updated README, user guide, MikroTik CLI examples, and troubleshooting. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
5.2 KiB
btest-rs User Guide
Quick Start
# Server mode (MikroTik connects to you)
btest -s
# Client mode (you connect to MikroTik)
btest -c 192.168.88.1 -r
Server Mode
Run btest-rs as a server and let MikroTik devices connect for bandwidth testing.
Basic Server
btest -s
Listens on TCP port 2000 (default). Any MikroTik device can connect without authentication.
Server with Authentication
btest -s -a admin -p mysecretpassword
MikroTik devices must provide matching credentials. Uses MD5 challenge-response authentication.
Custom Port
btest -s -P 3000
Verbose/Debug Output
btest -s -v # Show connection info and debug messages
btest -s -vv # Show hex dumps of status exchange (for debugging)
MikroTik Configuration (connecting to our server)
Important: Always set Connection Count to 1. Multi-connection mode is not supported and will cause severely degraded speeds.
On the MikroTik device (WinBox or CLI):
# CLI — always include connection-count=1
/tool/bandwidth-test address=<server-ip> direction=both protocol=udp user=admin password=mysecretpassword connection-count=1
Or via WinBox: Tools → Bandwidth Test, enter server address, credentials, set Connection Count to 1, and click Start.
Client Mode
Connect to a MikroTik device's built-in bandwidth test server.
Prerequisites
Enable btest server on MikroTik:
/tool/bandwidth-server set enabled=yes
Note: If the MikroTik uses RouterOS >= 6.43 with authentication enabled, you'll need to either disable auth or use credentials. EC-SRP5 auth is not yet supported; MD5 auth works on older RouterOS versions.
Download Test (receive)
btest -c 192.168.88.1 -r
Measures download speed from MikroTik to your machine.
Upload Test (transmit)
btest -c 192.168.88.1 -t
Measures upload speed from your machine to MikroTik.
Bidirectional Test
btest -c 192.168.88.1 -t -r
Tests both directions simultaneously.
UDP Mode
btest -c 192.168.88.1 -r -u # UDP download
btest -c 192.168.88.1 -t -u # UDP upload
btest -c 192.168.88.1 -t -r -u # UDP bidirectional
Bandwidth Limiting
btest -c 192.168.88.1 -r -b 100M # Limit to 100 Mbps
btest -c 192.168.88.1 -t -b 1G # Limit to 1 Gbps
btest -c 192.168.88.1 -r -b 500K # Limit to 500 Kbps
NAT Traversal
If you're behind NAT and need to receive UDP data:
btest -c 192.168.88.1 -r -u -n
The -n flag sends a probe packet to open the NAT firewall hole.
With Authentication
btest -c 192.168.88.1 -r -a admin -p password
Reading the Output
[ 1] TX 264.50 Mbps (33062912 bytes)
[ 2] TX 263.98 Mbps (32997376 bytes)
[ 2] RX 263.98 Mbps (32997012 bytes)
[ 3] RX 430.51 Mbps (53813376 bytes) lost: 5
| Field | Meaning |
|---|---|
[ N] |
Interval number (1 per second) |
TX |
Data we sent (upload) |
RX |
Data we received (download) |
Mbps |
Megabits per second |
bytes |
Raw bytes transferred in this interval |
lost: N |
UDP packets lost (UDP mode only) |
CLI Reference
btest-rs — MikroTik Bandwidth Test server & client in Rust
Usage: btest [OPTIONS]
Options:
-s, --server Run in server mode
-c, --client <HOST> Run in client mode, connect to HOST
-t, --transmit Client: upload test
-r, --receive Client: download test
-u, --udp Use UDP instead of TCP
-b, --bandwidth <BW> Bandwidth limit (e.g., 100M, 1G, 500K)
-P, --port <PORT> Port number [default: 2000]
-a, --authuser <USER> Authentication username
-p, --authpass <PASS> Authentication password
-n, --nat NAT traversal mode
-v, --verbose Increase log verbosity (-v, -vv)
-h, --help Show help
-V, --version Show version
Tips
- Connection Count MUST be 1 when MikroTik connects to your server. Multi-connection mode is not supported and will cause speeds to drop to near zero. Single-connection performance is excellent (1+ Gbps).
- TCP mode generally gives more stable results than UDP due to TCP flow control.
- UDP mode is better for measuring raw link capacity without TCP overhead.
- First interval may show higher or lower numbers as the connection stabilizes. Look at intervals 3+ for steady-state throughput.
- WiFi testing: bidirectional tests on WiFi will show lower per-direction speeds because WiFi is half-duplex at the MAC layer.
Troubleshooting
| Problem | Solution |
|---|---|
EC-SRP5 authentication not supported |
Disable auth on MikroTik btest server, or use older RouterOS |
Connection refused |
Check port 2000 is open, firewall allows it |
| Server shows 0 RX | Check MikroTik is actually sending (direction setting) |
| Speed drops over time (server mode) | Set Connection Count to 1 on MikroTik. Multi-connection is not supported |
| Very low speed with multiple connections | Multi-connection mode is broken — set Connection Count to 1 |
UDP lost packets high |
Network congestion or MTU issues, try reducing bandwidth with -b |