Bandwidth Test
Bandwidth Test
Section titled âBandwidth TestâTL;DR (Quick Start)
Section titled âTL;DR (Quick Start)âEnable bandwidth test server:
/tool bandwidth-server set enabled=yes authenticate=noRun a basic test to another router:
/tool bandwidth-test 192.168.1.1 protocol=udp direction=both duration=10sRun authenticated test:
/tool bandwidth-test 192.168.1.1 user=admin password=mypass duration=10sQuick speed test (ping + jitter + throughput):
/tool speed-test address=192.168.1.1 user=admin password=mypassOverview
Section titled âOverviewâWhat this covers: Using the Bandwidth Test tool to measure network throughput between MikroTik devices for link verification, troubleshooting, and performance testing.
When to use this:
- Verifying ISP link speeds after installation
- Testing wireless link throughput
- Measuring WAN connection performance
- Identifying network bottlenecks
- Validating QoS configurations
How it works:
- One router runs as a BTest server (listens on TCP port 2000)
- Another router runs the client to initiate the test
- Data flows in configured direction (transmit, receive, or both)
- Statistics report throughput, packet loss, and CPU usage
Key concepts:
- Server: Listens for incoming test connections (
/tool bandwidth-server) - Client: Initiates tests to a server (
/tool bandwidth-test) - UDP mode: Best for measuring raw throughput (includes headers in stats)
- TCP mode: Tests with acknowledgments (excludes headers from stats)
- Speed Test: Simplified tool combining ping, jitter, and bandwidth (
/tool speed-test)
Test Through, Not To/From
For accurate results, test through a router, not from or to it. Testing on the device itself skews results due to CPU overhead from generating/receiving test traffic.
Prerequisites:
- BTest server enabled on target device
- Firewall rules allowing TCP 2000 and UDP 2000-65535
- Authentication credentials (if server requires them)
Part 1: Server Configuration
Section titled âPart 1: Server ConfigurationâEnable the Bandwidth Test Server
Section titled âEnable the Bandwidth Test ServerâWithout authentication (open testing):
/tool bandwidth-server set enabled=yes authenticate=noWith authentication (requires credentials):
/tool bandwidth-server set enabled=yes authenticate=yesServer Parameters
Section titled âServer Parametersâ| Parameter | Default | Description |
|---|---|---|
enabled | yes | Enable/disable the server |
authenticate | yes | Require client credentials |
allocate-udp-ports-from | 2000 | Starting port for UDP allocation |
max-sessions | 100 | Maximum concurrent test sessions |
Check Server Status
Section titled âCheck Server Statusâ/tool bandwidth-server printExample output:
enabled: yes authenticate: yesallocate-udp-ports-from: 2000 max-sessions: 100View Active Sessions
Section titled âView Active Sessionsâ/tool bandwidth-server session printPart 2: Running Bandwidth Tests
Section titled âPart 2: Running Bandwidth TestsâBasic UDP Test
Section titled âBasic UDP TestâUDP mode gives the most accurate throughput measurement:
/tool bandwidth-test 192.168.1.1 protocol=udp direction=both duration=30sExample output:
status: running duration: 15s tx-current: 487.2Mbps tx-10-second-average: 485.1Mbps tx-total-average: 483.8Mbps rx-current: 491.3Mbps rx-10-second-average: 489.7Mbps rx-total-average: 488.2Mbps lost-packets: 12 local-cpu-load: 45% remote-cpu-load: 42%Authenticated Test
Section titled âAuthenticated TestâWhen the server has authenticate=yes:
/tool bandwidth-test 192.168.1.1 user=admin password=mypassword duration=30sTCP Test with Multiple Connections
Section titled âTCP Test with Multiple ConnectionsâTCP mode with parallel connections improves throughput on high-latency links:
/tool bandwidth-test 192.168.1.1 protocol=tcp connection-count=10 duration=30sSpeed-Limited Test
Section titled âSpeed-Limited TestâAvoid saturating the link during production hours:
/tool bandwidth-test 192.168.1.1 local-tx-speed=100M remote-tx-speed=100M duration=30sTest Parameters
Section titled âTest Parametersâ| Parameter | Default | Description |
|---|---|---|
address | (required) | Target server IP |
direction | receive | Data flow: both/receive/transmit |
duration | unlimited | Test duration (e.g., 30s, 1m) |
protocol | udp | Transport: tcp or udp |
user | - | Authentication username |
password | - | Authentication password |
local-tx-speed | 0 (unlimited) | Local transmit limit |
remote-tx-speed | 0 (unlimited) | Remote transmit limit |
connection-count | 1 | TCP parallel connections (1-255) |
random-data | no | Use incompressible random data |
Part 3: Speed Test (Simplified)
Section titled âPart 3: Speed Test (Simplified)âSpeed Test provides a quick combined measurement of ping, jitter, and throughput:
/tool speed-test address=192.168.1.1 user=admin password=mypasswordExample output:
status: done ping-min: 1.2ms ping-avg: 1.8ms ping-max: 3.1ms jitter: 0.4ms tcp-download: 892.3Mbps tcp-upload: 876.1Mbps udp-download: 941.2Mbps udp-upload: 923.8MbpsSpeed Test runs 5 sequential tests (ping, TCP receive/send, UDP receive/send) totaling about 55 seconds.
Part 4: IPv6 Testing
Section titled âPart 4: IPv6 TestingâTest to IPv6 Address
Section titled âTest to IPv6 Addressâ/tool bandwidth-test 2001:db8::1 protocol=udp duration=30sTest to Link-Local Address
Section titled âTest to Link-Local AddressâInclude the interface suffix:
/tool bandwidth-test fe80::1%ether1 protocol=udp duration=30sPart 5: Firewall Configuration
Section titled âPart 5: Firewall ConfigurationâServer-Side Rules
Section titled âServer-Side RulesâAllow incoming test connections:
/ip firewall filter add chain=input protocol=tcp dst-port=2000 action=accept \ comment="BTest TCP control"/ip firewall filter add chain=input protocol=udp dst-port=2000-65535 action=accept \ comment="BTest UDP data"IPv6 Firewall Rules
Section titled âIPv6 Firewall Rulesâ/ipv6 firewall filter add chain=input protocol=tcp dst-port=2000 action=accept/ipv6 firewall filter add chain=input protocol=udp dst-port=2000-65535 action=acceptPart 6: Scripted Testing
Section titled âPart 6: Scripted TestingâBasic Script
Section titled âBasic Scriptâ:local result/tool bandwidth-test 192.168.1.1 duration=10s user=admin password=pass do={ :set result $"rx-total-average"}:log info "Bandwidth: $($result / 1000000) Mbps"Capture Multiple Metrics
Section titled âCapture Multiple Metricsâ:local txAvg:local rxAvg
/tool bandwidth-test 192.168.1.1 duration=15s protocol=udp direction=both \ user=admin password=pass do={ :set txAvg $"tx-total-average" :set rxAvg $"rx-total-average"}
:log info "TX: $($txAvg / 1000000) Mbps, RX: $($rxAvg / 1000000) Mbps"Threshold Alert Script
Section titled âThreshold Alert Scriptâ:global btestThreshold 50000000:local result
/tool bandwidth-test 192.168.1.1 duration=10s user=admin password=pass do={ :set result $"rx-total-average"}
:if ($result < $btestThreshold) do={ :log warning "Bandwidth below threshold: $($result / 1000000) Mbps"}Troubleshooting
Section titled âTroubleshootingâProblem 1: âCanât Connectâ Error
Section titled âProblem 1: âCanât Connectâ ErrorâSymptoms: Connection refused or timeout.
Causes:
- BTest server disabled
- Firewall blocking port 2000
- Network routing issue
Solutions:
# Check server is enabled/tool bandwidth-server print
# Verify connectivity/ping 192.168.1.1
# Check firewall on server/ip firewall filter print where dst-port=2000Problem 2: Authentication Failed
Section titled âProblem 2: Authentication FailedâSymptoms: âauth.failedâ error despite correct credentials.
Cause: RouterOS 6.43+ uses EC-SRP5 authentication, incompatible with older versions.
Solutions:
- Ensure both devices run compatible RouterOS versions
- Or disable authentication:
/tool bandwidth-server set authenticate=no
Problem 3: UDP Test Shows 0 Bytes
Section titled âProblem 3: UDP Test Shows 0 BytesâSymptoms: UDP test fails while TCP works.
Cause: Firewall blocking incoming UDP on non-established connections.
Solution:
/ip firewall filter add chain=input protocol=udp dst-port=2000-65535 action=acceptProblem 4: Low Throughput Results
Section titled âProblem 4: Low Throughput ResultsâSymptoms: Measured speed much lower than expected.
Causes:
- Testing on the device instead of through it
- Single-core limitation (pre-6.44beta39)
- CPU overload from test generation
Solutions:
- Test through the router using 3 devices:
[Server] ââ [Router Under Test] ââ [Client]
- Upgrade to RouterOS 6.44+ for multi-core support
- Use shorter test durations
Problem 5: Test Impacts Production Traffic
Section titled âProblem 5: Test Impacts Production TrafficâSymptom: Network slows down during test.
Cause: Bandwidth test uses all available bandwidth by default.
Solution: Set speed limits:
/tool bandwidth-test 192.168.1.1 local-tx-speed=50M remote-tx-speed=50M duration=30sProblem 6: TCP vs UDP Show Different Speeds
Section titled âProblem 6: TCP vs UDP Show Different SpeedsâSymptom: TCP reports lower throughput than UDP.
Explanation: This is expected behavior:
- TCP statistics count only payload data (excludes headers)
- UDP statistics include IP + UDP headers
- UDP better represents raw link throughput
Understanding Results
Section titled âUnderstanding ResultsâOutput Fields
Section titled âOutput Fieldsâ| Field | Description |
|---|---|
tx-current | Current transmit speed |
tx-10-second-average | 10-second transmit average |
tx-total-average | Overall transmit average |
rx-current | Current receive speed |
rx-10-second-average | 10-second receive average |
rx-total-average | Overall receive average |
lost-packets | Dropped packets (UDP only) |
local-cpu-load | Local device CPU usage |
remote-cpu-load | Remote device CPU usage |
Interpreting CPU Load
Section titled âInterpreting CPU Loadâ- High CPU (>80%): Results may be limited by CPU, not network
- Low CPU (<50%): Network is the limiting factor
- If testing on the device itself, high CPU is expected and skews results
Verification Commands
Section titled âVerification Commandsâ# Check server configuration/tool bandwidth-server print
# View active test sessions/tool bandwidth-server session print
# Quick connectivity test/tool bandwidth-test 192.168.1.1 protocol=udp duration=5s
# Full speed test/tool speed-test address=192.168.1.1 user=admin password=passRelated Topics
Section titled âRelated Topicsâ- Ping - Latency and reachability testing
- Traceroute - Path discovery
- Torch - Real-time traffic analysis
- Netwatch - Automated host monitoring
- Traffic Monitor - Interface statistics
Reference
Section titled âReferenceâOfficial Documentation
Section titled âOfficial DocumentationâQuick Reference Commands
Section titled âQuick Reference Commandsâ# Server/tool bandwidth-server set enabled=yes authenticate=no/tool bandwidth-server print/tool bandwidth-server session print
# Client - Basic tests/tool bandwidth-test 192.168.1.1 protocol=udp duration=30s/tool bandwidth-test 192.168.1.1 protocol=tcp connection-count=10 duration=30s/tool bandwidth-test 192.168.1.1 user=admin password=pass duration=30s
# Speed test/tool speed-test address=192.168.1.1 user=admin password=pass
# Limited speed test/tool bandwidth-test 192.168.1.1 local-tx-speed=100M remote-tx-speed=100M duration=30sSummary
Section titled âSummaryâBandwidth Test measures network throughput between MikroTik devices:
- Server setup - Enable on target device with
/tool bandwidth-server - UDP tests - Best for raw throughput measurement
- TCP tests - Use with
connection-countfor high-latency links - Speed Test - Quick combined ping + jitter + throughput
- Firewall rules - Open TCP 2000 and UDP 2000-65535
Key points:
- Test through routers, not from/to them, for accurate results
- UDP includes headers in stats; TCP excludes them
- RouterOS 6.43+ uses different authentication (EC-SRP5)
- Multi-core support requires RouterOS 6.44beta39+
- Limit test speeds to avoid impacting production traffic