iperf是一個很好的網絡流量測試工具,最近想在工具里面集成iperf最新的版本iperf3,希望借助iperf3測試以太網口的吞吐量,客戶要求測試雙工模式下吞吐量,可是,整了一圈,原來iperf3並不支持雙工模式測試,iperf2是指支持的。
官方原文是這么說的:
Not planning to support these iperf2 flags. If you really miss these options, please submit a request in the issue tracker:
(不計划支持如下的iperf2選項。如果你真的需要這些選項,請在問題跟蹤表中提交請求:)
-d, --dualtest Do a bidirectional test simultaneously -r, --tradeoff Do a bidirectional test individually -T, --ttl time-to-live, for multicast (default 1) -x, --reportexclude [CDMSV] exclude C(connection) D(data) M(multicast) S(settings) V(server) reports -y, --reportstyle C report as a Comma-Separated Values
現將iperf的使用方法記錄如下:
1、啟動服務端
iperf3.exe -s

2、啟動客戶端連接服務端
iperf3 -c 127.0.0.1 -t 10 -w 512k -f M
-c 表示服務端地址
-t 表示測試持續時間,這里是10秒
-w 表示報文大小
-f 表示測試結果的度量單位,這里是兆

服務端統計結果

以上測試的上行流量,如果需要測試下行流量,步驟類似,不過客戶端連接命令需要增加-R選項,譬如:
iperf3 -c 127.0.0.1 -t 10 -w 512k -f M
具體詳細的選項,請參考iperf幫助,只要敲下iperf命令,iperf即會顯示詳細的命令選項。
