Test network throughput performance

在執行 Windows 和 LINUX 的 VM 之間進行測試:
在此案例中,我們應該啟用非同步模式,才能執行測試。 若要執行上述動作,請針對 Linux 使用 -N 旗標;針對 Windows 使用 -ns 旗標。

從 Linux 到 Windows:
接收者 Windows : ntttcp -r -m <2 x nr cores>,*,Windows IP -ns
傳送者 Linux: ntttcp -s -m <2 x nr cores>,*,Windows IP -N -t 30


從 Windows 到 Linux:
接收者 Linux: ntttcp -r -m <2 x nr cores>,*,Linux IP -N
傳送者 Windows: ntttcp -s -m <2 x nr cores>,*,Linux IP -ns -t 30

https://github.com/MicrosoftDocs/azure-docs.zh-tw/blob/master/articles/virtual-network/virtual-network-bandwidth-testing.md

WINDOW和LINUX之間IPERF測試的一個坑(IPERF WINDOW SIZE)

有次在使用iperf測試wifi吞吐率時候發現了問題,上午測的時候速度還可以,下午就不行了,發現上午是linux對linux,下午是window對linux,先貼測試圖如下:

./iperf -s -w


Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)

[ 4] local 192.168.0.108 port 5001 connected with 192.168.0.100 port 54743
[ ID] Interval Transfer Bandwidth
[ 4] 0.0- 3.4 sec 4.40 MBytes 10.8 Mbits/sec
[ 5] local 192.168.0.108 port 5001 connected with 192.168.0.100 port 54750
[ 5] 0.0- 5.3 sec 18.6 MBytes 29.5 Mbits/sec
C:\Users\Administrator\Desktop\iperf for windows\iperf命令行工具>iperf.exe -c 19
2.168.0.108 -i 1 -t 5

Client connecting to 192.168.0.108, TCP port 5001
TCP window size: 8.00 KByte (default)

[204] local 192.168.0.100 port 54743 connected with 192.168.0.108 port 5001
[ ID] Interval Transfer Bandwidth
[204] 0.0- 1.0 sec 1.16 MBytes 9.76 Mbits/sec
[204] 1.0- 2.0 sec 1.51 MBytes 12.6 Mbits/sec
[204] 2.0- 3.0 sec 1.27 MBytes 10.7 Mbits/sec
[204] 0.0- 3.4 sec 4.40 MBytes 10.8 Mbits/sec

C:\Users\Administrator\Desktop\iperf for windows\iperf命令行工具>iperf.exe -c 19
2.168.0.108 -i 1 -t 5 -w1M

Client connecting to 192.168.0.108, TCP port 5001
TCP window size: 1.00 MByte

[204] local 192.168.0.100 port 54750 connected with 192.168.0.108 port 5001
[ ID] Interval Transfer Bandwidth
[204] 0.0- 1.0 sec 3.91 MBytes 32.8 Mbits/sec
[204] 1.0- 2.0 sec 4.09 MBytes 34.3 Mbits/sec
[204] 2.0- 3.0 sec 3.75 MBytes 31.5 Mbits/sec
[204] 3.0- 4.0 sec 3.87 MBytes 32.4 Mbits/sec
[204] 4.0- 5.0 sec 2.99 MBytes 25.1 Mbits/sec
[204] 0.0- 5.3 sec 18.6 MBytes 29.4 Mbits/sec
發現windows端的默認window size是8.00 KByte,而linux是85.3 KByte (default),當linux做server,windows做client上傳(反過來沒有問題),會因爲windows size導致傳輸速率受限,當在window 端將window size設置成1M時候,iperf速率有明顯上升,10.8 Mbits/sec->29.5 Mbits/sec,執行iperf –help發現
-w, –window #[KM] TCP window size (socket buffer size)
window szie 就是socket buffer size,當兩端不統一的時候,會造成傳輸速率下降,影響真實的測量結果
所以建議在iperf測試的時候,在server和client端都加上-w的參數
iperf -s -w 1M
iperf -c 192.168.0.1 -w 1M -i 1 -t 5

實際在Dell R740上跑iperf(iperf2)測試10Gb 的頻寬仍會有幾個Port的速度未達上限1.15G GBytes/sec

改試iperf3參數如下拿掉-w TCP windows加入-P –parallel # number of parallel client streams to run
Example:
iperf3.exe -c 192.168.17.31 -P 8 -i 1 -t 10