Skip to main content
Version: 7.25

bandwidth-test


tool/bandwidth-test​

Type: Command

Runs a bandwidth test against the bandwidth test server of another RouterOS device (/tool/bandwidth-server) and prints the results every second until duration ends or you stop it. The test sends TCP or UDP traffic in one or both directions; the server must be enabled, reachable on TCP port 2000 and UDP ports from its allocate-udp-ports-from, and the bandwidth-test device mode must be on (see Device mode). The server lists running tests in /tool/bandwidth-server/session. To measure latency and both directions of TCP and UDP in one run, use /tool/speed-test. See Bandwidth test.

ArgumentTypeDescription
addressaddress (flags=46viD)IPv4 or IPv6 address of the server. A link-local IPv6 address needs the interface, for example fe80::1%ether1.
protocolenum (udp | tcp) { udp:0, tcp:1 }

Traffic to send:

  • udp (default) - UDP packets of local-udp-tx-size and remote-udp-tx-size bytes; the receiver counts lost packets.
  • tcp - TCP connections (connection-count); TCP adapts its rate to the path.
local-udp-tx-sizerangeSize of the UDP packets the client sends, in bytes of the whole IP packet: 1500 sends a 1472-byte UDP payload. Values below 52 fail with failure: size too small over IPv4. Range 28..64000. Default: 1500.
remote-udp-tx-sizerangeSize of the UDP packets the server sends, counted the same way as local-udp-tx-size. Default: 1500.
directionenum (receive | transmit | both) { receive:0x00000100, transmit:0x00000200, both:0x00000300 }

Which side sends:

  • receive (default) - The server sends, the client receives (rx-* values).
  • transmit - The client sends, the server receives (tx-* values).
  • both - Both sides send at the same time.
connection-countnumNumber of TCP connections, or of UDP streams with their own ports, that the test uses. Range 1..255. Default: 20, or the number of CPU cores on routers with more than 20 cores.
local-tx-speednumMaximum rate the client sends at, in bits per second (suffixes such as 50M work). Without it, the client sends as fast as it can: an unlimited UDP test floods for about the first second and then sends more than the receiver reports, so lost-packets stays above zero.
remote-tx-speednumMaximum rate the server sends at, in bits per second (suffixes such as 50M work). Without it, the server sends as fast as it can.
userstringUser name on the server. The user's group needs both the test and winbox policies (see /user/group). Not needed when the server has authenticate=no.
passwordstringPassword of user on the server.
durationtimeHow long the test runs. Without it, the test runs until you stop it, for example with Control+C.
random-databoolWhether to fill the payload with random, incompressible data, so that links that compress traffic do not show a higher rate than they carry. It costs more CPU time on both sides. Default: no.
Read-only ArgumentTypeDescription
statusenum (connecting | can not start test | can not connect | remote is busy | test unsupported | running | disconnected | authentication failed | done testing) { connecting:0, can not start test:1, can not connect:2, remote is busy:3, test unsupported:4, running:5, disconnected:6, authentication failed:7, done testing:8 }

State of the test:

  • connecting - The client is connecting to the server.
  • running - The test runs.
  • done testing - The test ended after duration.
  • authentication failed - The server refused the user name or password, or no user was given while the server authenticates.
  • can not connect - The server is disabled or not reachable, the client is not in its allowed-addresses4/allowed-addresses6, or max-sessions is reached.
  • disconnected - The connection to the server ended during the test, also when the test uses more connections than the server's max-sessions.

Other values report that the server refused or could not start the test.

durationtimeHow long the test has run.
tx-currentnumRate the client sent at in the last second. UDP counts whole IP packets (IP and UDP headers included), TCP counts the TCP payload only.
tx-10-second-averagenumAverage rate the client sent at over the last 10 seconds.
tx-total-averagenumAverage rate the client sent at since the test started.
rx-currentnumRate the client received at in the last second. UDP counts whole IP packets (IP and UDP headers included), TCP counts the TCP payload only.
rx-10-second-averagenumAverage rate the client received at over the last 10 seconds.
rx-total-averagenumAverage rate the client received at since the test started.
lost-packetsnumUDP packets lost in the last second, not a total since the start.
random-databoolWhether the test uses random data (random-data).
directionenum (receive | transmit | both) { receive:0x00000100, transmit:0x00000200, both:0x00000300 }Direction of the test (direction).
tx-sizerangeSize of the UDP packets the client sends, in bytes of the whole IP packet.
rx-sizerangeSize of the UDP packets the client receives, in bytes of the whole IP packet.
connection-countnumNumber of TCP connections or UDP streams the test uses.
local-cpu-loadnumCPU load of the client during the test, shown after the first seconds.
remote-cpu-loadnumCPU load of the server during the test, shown after the first seconds.
tcp-infomulti { name: string }