Initial commit: MikroTik btest server & client in Rust

Full reimplementation of the MikroTik Bandwidth Test protocol:
- Server mode: accepts connections from MikroTik devices on port 2000
- Client mode: connects to MikroTik btest servers
- TCP and UDP protocols with bidirectional support
- MD5 challenge-response authentication
- Dynamic speed adjustment (1.5x algorithm)
- Status exchange matching original C pselect() behavior
- Docker support with multi-stage build

Tested against MikroTik RouterOS achieving:
- 1.05 Gbps server RX (single connection)
- 530 Mbps client TCP download
- 840 Mbps client TCP upload
- 433 Mbps client UDP download

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Siavash Sameni
2026-03-31 11:56:34 +04:00
commit d9007dc169
18 changed files with 2801 additions and 0 deletions

22
docker-compose.yml Normal file
View File

@@ -0,0 +1,22 @@
services:
btest-server:
build: .
container_name: btest-server
ports:
- "2000:2000/tcp"
- "2001-2100:2001-2100/udp"
- "2257-2356:2257-2356/udp"
command: ["-s", "-v"]
restart: unless-stopped
# Server with authentication enabled
btest-server-auth:
build: .
container_name: btest-server-auth
ports:
- "2010:2000/tcp"
- "2101-2200:2001-2100/udp"
command: ["-s", "-a", "admin", "-p", "password", "-v"]
restart: unless-stopped
profiles:
- auth