/tool/bandwidth-test
bandwidth-test
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...
tool/bandwidth-test
Type: Command
对另一台 RouterOS 设备的带宽测试服务器(/tool/bandwidth-server)运行带宽测试,并每秒打印结果,直到 duration 结束或您停止它。测试在一个或两个方向上发送 TCP 或 UDP 流量;服务器必须已启用、可通过 TCP 端口 2000 和从其 allocate-udp-ports-from 开始的 UDP 端口访问,并且必须开启 bandwidth-test 设备模式(参见设备模式)。服务器在 /tool/bandwidth-server/session 中列出正在运行的测试。要在一次运行中测量延迟以及 TCP 和 UDP 的双向性能,请使用 /tool/speed-test。参见带宽测试。
| 参数 | 类型 | 描述 |
|---|---|---|
address | address (flags=46viD) | 服务器的 IPv4 或 IPv6 地址。IPv6 链路本地地址需要接口,例如 fe80::1%ether1。 |
protocol | enum (udp | tcp) { udp:0, tcp:1 } | 要发送的流量: - udp(默认)- 大小为 local-udp-tx-size 和 remote-udp-tx-size 字节的 UDP 数据包;接收方统计丢失的数据包。 - tcp - TCP 连接(connection-count);TCP 会根据路径调整其速率。 |
local-udp-tx-size | range | 客户端发送的 UDP 数据包大小,以整个 IP 数据包的字节数计:1500 发送 1472 字节的 UDP 载荷。在 IPv4 上,低于 52 的值会失败并显示 failure: size too small。范围 28..64000。默认值:1500。 |
remote-udp-tx-size | range | 服务器发送的 UDP 数据包大小,计数方式与 local-udp-tx-size 相同。默认值:1500。 |
direction | enum (receive | transmit | both) { receive:0x00000100, transmit:0x00000200, both:0x00000300 } | 哪一侧发送: - receive(默认)- 服务器发送,客户端接收(rx-* 值)。 - transmit - 客户端发送,服务器接收(tx-* 值)。 - both - 双方同时发送。 |
connection-count | num | 测试使用的 TCP 连接数,或使用各自端口的 UDP 流数。范围 1..255。默认值:20;在超过 20 核的路由器上为 CPU 核心数。 |
local-tx-speed | num | 客户端发送的最大速率,单位为比特每秒(支持 50M 等后缀)。未设置时,客户端尽可能快地发送:无限制的 UDP 测试会在最初约一秒内泛洪,随后发送量超过接收方报告的数量,因此 lost-packets 会保持大于零。 |
remote-tx-speed | num | 服务器发送的最大速率,单位为比特每秒(支持 50M 等后缀)。未设置时,服务器尽可能快地发送。 |
user | string | 服务器上的用户名。用户所在组需要同时具有 test 和 winbox 策略(参见 /user/group)。服务器设置 authenticate=no 时不需要。 |
password | string | 服务器上 user 的密码。 |
duration | time | How long the test runs. Without it, the test runs until you stop it, for example with <kbd>Control</kbd>+<kbd>C</kbd>. |
random-data | bool | 是否用随机的不可压缩数据填充载荷,以便压缩流量的链路不会显示高于其实际承载能力的速率。这会增加双方的 CPU 开销。默认值:no。 |
| 只读参数 | 类型 | 描述 |
|---|---|---|
status | enum (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 } | 测试状态: - connecting - 客户端正在连接服务器。 - running - 测试正在运行。 - done testing - 测试在 duration 后结束。 - authentication failed - 服务器拒绝了用户名或密码,或服务器要求身份验证时未提供用户。 - can not connect - 服务器已禁用或不可达,客户端不在其 allowed-addresses4/allowed-addresses6 中,或已达到 max-sessions。 - disconnected - 测试期间与服务器的连接结束,测试使用的连接数超过服务器的 max-sessions 时也是如此。 其他值表示服务器拒绝了测试或无法启动测试。 |
duration | time | 测试已运行的时间。 |
tx-current | num | 客户端在最后一秒发送的速率。UDP 统计整个 IP 数据包(包括 IP 和 UDP 头),TCP 仅统计 TCP 载荷。 |
tx-10-second-average | num | 客户端在过去 10 秒内发送的平均速率。 |
tx-total-average | num | 客户端自测试开始以来发送的平均速率。 |
rx-current | num | 客户端在最后一秒接收的速率。UDP 统计整个 IP 数据包(包括 IP 和 UDP 头),TCP 仅统计 TCP 载荷。 |
rx-10-second-average | num | 客户端在过去 10 秒内接收的平均速率。 |
rx-total-average | num | 客户端自测试开始以来接收的平均速率。 |
lost-packets | num | 最后一秒内丢失的 UDP 数据包数,不是自开始以来的总数。 |
random-data | bool | 测试是否使用随机数据(random-data)。 |
direction | enum (receive | transmit | both) { receive:0x00000100, transmit:0x00000200, both:0x00000300 } | 测试方向(direction)。 |
tx-size | range | 客户端发送的 UDP 数据包大小,以整个 IP 数据包的字节数计。 |
rx-size | range | 客户端接收的 UDP 数据包大小,以整个 IP 数据包的字节数计。 |
connection-count | num | 测试使用的 TCP 连接数或 UDP 流数。 |
local-cpu-load | num | 测试期间客户端的 CPU 负载,在最初几秒后显示。 |
remote-cpu-load | num | 测试期间服务器的 CPU 负载,在最初几秒后显示。 |
tcp-info | multi { name: string } |