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 |