Bandwidth Test
Bandwidth Test
Section titled “Bandwidth Test”TL;DR (Quick Start)
Section titled “TL;DR (Quick Start)”For the impatient: test bandwidth between two MikroTik routers.
On the server router:
/tool/bandwidth-server/set enabled=yes authenticate=yesOn the client router:
/tool/bandwidth-test 192.168.88.1 user=admin password=yourpass direction=both duration=10sOverview
Section titled “Overview”What this does: The Bandwidth Test tool measures TCP and UDP throughput between a MikroTik router and another Bandwidth Test server (another MikroTik or compatible software). It’s useful for verifying link capacity, testing network performance, and troubleshooting throughput issues.
When to use this:
- Verify actual throughput on a link
- Test performance between two sites
- Troubleshoot slow connections
- Baseline network performance
- Validate QoS configurations
Prerequisites:
- Bandwidth Test server enabled on target router
- Network connectivity between client and server
- Authentication credentials (if server requires authentication)
- Firewall allowing TCP port 2000 (control) and test ports
CPU Impact
Bandwidth Test is CPU-intensive. Running tests at high speeds can impact router performance and affect other traffic. Test during maintenance windows on production networks.
Bandwidth Test Server Configuration
Section titled “Bandwidth Test Server Configuration”Enable the Server
Section titled “Enable the Server”/tool/bandwidth-server/set enabled=yesView Current Settings
Section titled “View Current Settings”/tool/bandwidth-server/printDefault output:
enabled: yes authenticate: yesallocate-udp-ports-from: 2000 max-sessions: 100Require Authentication
Section titled “Require Authentication”Force users to authenticate before testing:
/tool/bandwidth-server/set authenticate=yesWhen enabled, clients must provide valid RouterOS user credentials.
Configure UDP Port Range
Section titled “Configure UDP Port Range”Set the starting port for UDP tests:
/tool/bandwidth-server/set allocate-udp-ports-from=2000UDP tests use ports starting from this number.
Limit Concurrent Sessions
Section titled “Limit Concurrent Sessions”Restrict how many simultaneous tests can run:
/tool/bandwidth-server/set max-sessions=10Prevents resource exhaustion from too many concurrent tests.
Bandwidth Test Client Usage
Section titled “Bandwidth Test Client Usage”Basic Test
Section titled “Basic Test”Test to another MikroTik router:
/tool/bandwidth-test 192.168.88.1 user=admin password=secretSpecify Direction
Section titled “Specify Direction”Test upload, download, or both:
# Download only (receive)/tool/bandwidth-test 192.168.88.1 direction=receive user=admin password=secret
# Upload only (transmit)/tool/bandwidth-test 192.168.88.1 direction=transmit user=admin password=secret
# Both directions simultaneously/tool/bandwidth-test 192.168.88.1 direction=both user=admin password=secretSet Test Duration
Section titled “Set Test Duration”Run test for specific time:
/tool/bandwidth-test 192.168.88.1 duration=30s user=admin password=secretChoose Protocol
Section titled “Choose Protocol”Test with TCP or UDP:
# TCP test (default)/tool/bandwidth-test 192.168.88.1 protocol=tcp user=admin password=secret
# UDP test/tool/bandwidth-test 192.168.88.1 protocol=udp user=admin password=secretProtocol differences:
- TCP: More reliable results; reflects real-world TCP performance; affected by latency
- UDP: Tests raw throughput capacity; not affected by TCP windowing; may show higher speeds
Use Random Data
Section titled “Use Random Data”Send random data instead of zeros (more realistic):
/tool/bandwidth-test 192.168.88.1 random-data=yes user=admin password=secretRandom data tests compression performance on links with hardware compression.
Common Scenarios
Section titled “Common Scenarios”Scenario: Test WAN Link Capacity
Section titled “Scenario: Test WAN Link Capacity”Verify your ISP connection speed:
/tool/bandwidth-test isp-router.example.com protocol=tcp direction=both duration=20s \ user=admin password=secretScenario: Test VPN Tunnel Throughput
Section titled “Scenario: Test VPN Tunnel Throughput”Measure throughput through a VPN tunnel:
/tool/bandwidth-test 10.0.0.1 protocol=tcp direction=both duration=30s \ user=admin password=secretRun from one end of the tunnel to the other end’s internal IP.
Scenario: Test Without Authentication
Section titled “Scenario: Test Without Authentication”If server allows unauthenticated tests:
/tool/bandwidth-test 192.168.88.1 protocol=tcp direction=bothDisabling authentication on the bandwidth server allows anyone to run tests, potentially impacting router performance. Only disable on trusted networks.
Scenario: UDP Test with Custom Packet Size
Section titled “Scenario: UDP Test with Custom Packet Size”Test with specific UDP packet size:
/tool/bandwidth-test 192.168.88.1 protocol=udp direction=transmit \ local-udp-tx-size=1500 user=admin password=secretUseful for testing MTU issues or specific application behavior.
Scenario: Limit Test Bandwidth
Section titled “Scenario: Limit Test Bandwidth”Cap the test at a specific rate:
/tool/bandwidth-test 192.168.88.1 protocol=tcp direction=transmit \ local-tx-speed=50M user=admin password=secretPrevents the test from consuming all available bandwidth.
Scenario: Multiple Connection Test
Section titled “Scenario: Multiple Connection Test”Use multiple TCP connections for higher throughput:
/tool/bandwidth-test 192.168.88.1 protocol=tcp direction=both \ connection-count=5 user=admin password=secretMultiple connections can overcome single-connection TCP limitations on high-latency links.
Scenario: Test from Winbox/WebFig
Section titled “Scenario: Test from Winbox/WebFig”The graphical tools provide real-time graphs:
- Open Tools > Bandwidth Test
- Enter server address and credentials
- Select direction and protocol
- Click Start
Results display as a live graph showing throughput over time.
Understanding Results
Section titled “Understanding Results”Test output shows:
status: running duration: 10s tx-current: 94.5Mbps tx-10-second-average: 93.8Mbps tx-total-average: 93.2Mbps rx-current: 94.1Mbps rx-10-second-average: 93.5Mbps rx-total-average: 93.0Mbps lost-packets: 0 random-data: no direction: both| Field | Description |
|---|---|
tx-current | Current transmit rate |
rx-current | Current receive rate |
tx-10-second-average | Rolling 10-second average (transmit) |
rx-10-second-average | Rolling 10-second average (receive) |
tx-total-average | Average over entire test (transmit) |
rx-total-average | Average over entire test (receive) |
lost-packets | UDP packets lost (UDP only) |
Firewall Configuration
Section titled “Firewall Configuration”If bandwidth test isn’t working, allow the required ports:
/ip/firewall/filter/add chain=input protocol=tcp dst-port=2000 action=accept \ comment="Bandwidth Test control"/ip/firewall/filter/add chain=input protocol=udp dst-port=2000-2100 action=accept \ comment="Bandwidth Test UDP"Place these rules before any drop rules.
Verification
Section titled “Verification”Confirm Bandwidth Test is working:
Check 1: Verify Server Status
Section titled “Check 1: Verify Server Status”/tool/bandwidth-server/printExpected: enabled: yes
Check 2: Check Active Sessions
Section titled “Check 2: Check Active Sessions”/tool/bandwidth-server/session/printShows currently running tests.
Check 3: Test Locally
Section titled “Check 3: Test Locally”From the router itself:
/tool/bandwidth-test 127.0.0.1 user=admin password=secret duration=5sTests local loopback (useful for verifying server is running).
Troubleshooting
Section titled “Troubleshooting”| Symptom | Cause | Solution |
|---|---|---|
| ”connection refused” | Server disabled or firewalled | Enable server; check firewall rules |
| ”login failure” | Wrong credentials | Verify username/password; check authenticate setting |
| Low throughput | CPU bottleneck | Check CPU usage; test with lower connection-count |
| CHR capped at ~400Mbps | License level or VM config | Check CHR license tier; verify VM network settings (virtio) |
| UDP packet loss | Network congestion or MTU issues | Check for congestion; verify MTU settings |
| Test hangs | Firewall blocking | Allow TCP 2000 and UDP ports |
| Inconsistent results | Other traffic on link | Test during low-usage periods |
| ”no route to host” | Routing issue | Verify connectivity with ping |
Debug: Check CPU During Test
Section titled “Debug: Check CPU During Test”/system/resource/printHigh CPU usage (>80%) limits throughput results.
Debug: Monitor Active Sessions
Section titled “Debug: Monitor Active Sessions”/tool/bandwidth-server/session/printShows client IP and current throughput.
Common Mistakes
- Testing through NAT - Bandwidth test requires direct IP connectivity or port forwarding
- Forgetting authentication - Default requires credentials; provide user/password
- Testing during production hours - Can saturate links and affect users
- Comparing TCP vs UDP - Different protocols give different results; compare consistently
- Ignoring CPU limits - Router CPU may be the bottleneck, not the link
Related Topics
Section titled “Related Topics”Traffic Analysis
Section titled “Traffic Analysis”- Torch - real-time traffic analysis
- Graphing - historical bandwidth graphs
- Speed Test - internet speed testing
Bandwidth Management
Section titled “Bandwidth Management”- Simple Queues - bandwidth limiting
- Queue Tree - advanced QoS
Related Topics
Section titled “Related Topics”- Firewall Basics - allow bandwidth test traffic
- User Management - authentication for tests
Reference
Section titled “Reference”Server Properties (/tool/bandwidth-server)
Section titled “Server Properties (/tool/bandwidth-server)”| Property | Type | Default | Description |
|---|---|---|---|
enabled | yes/no | yes | Enable bandwidth test server |
authenticate | yes/no | yes | Require user authentication |
allocate-udp-ports-from | integer | 2000 | Starting port for UDP tests |
max-sessions | integer | 100 | Maximum concurrent sessions |
Client Parameters (/tool/bandwidth-test)
Section titled “Client Parameters (/tool/bandwidth-test)”| Parameter | Type | Default | Description |
|---|---|---|---|
address | IP/hostname | - | Server address (required) |
protocol | tcp/udp | tcp | Test protocol |
direction | receive/transmit/both | receive | Traffic direction |
duration | time | unlimited | Test duration |
interval | time | 1s | Result update interval |
user | string | - | Authentication username |
password | string | - | Authentication password |
local-tx-speed | rate | unlimited | Limit transmit rate |
remote-tx-speed | rate | unlimited | Limit remote transmit rate |
local-udp-tx-size | integer | 1500 | UDP packet size |
remote-udp-tx-size | integer | 1500 | Remote UDP packet size |
connection-count | integer | 1 | Number of TCP connections |
random-data | yes/no | no | Use random data |
Ports Used
Section titled “Ports Used”| Port | Protocol | Purpose |
|---|---|---|
| 2000 | TCP | Control connection |
| 2000+ | UDP | UDP test traffic |