1. 程式人生 > >iperf點到點測速

iperf點到點測速

iperf 是一個網路效能測試工具。Iperf可以測試最大TCP和UDP頻寬效能,具有多種引數和UDP特性,可以根據需要調整,可以報告頻寬、延遲抖動和資料包丟失。在嵌入式開發的過程中經常需要用到這個工具,下面我們演示一下如何利用這個工具來測兩臺機器之間的資料傳輸速度:
分別在兩臺待測機器中安裝iperf,我使用的是ubuntu

sudo apt-get install iperf3

然後其中一臺作為客戶端,一臺作為伺服器,通過客戶端連線伺服器來實現測速:

伺服器端

iperf3 -s

客戶端

iperf3 -c xxxxxx(這裡是伺服器端ip) -b 100M -t 20

結果

[ ID] Interval           Transfer     Bandwidth
[  4]   0.00-1.00   sec  46.7 KBytes   382 Kbits/sec                  
[  4]   1.00-2.00   sec  29.7 KBytes   243 Kbits/sec                  
[  4]   2.00-3.00   sec  28.3 KBytes   232 Kbits/sec                  
[  4]   3.00-4.00   sec  29.7 KBytes   243 Kbits/sec
[ 4] 4.00-5.00 sec 29.7 KBytes 243 Kbits/sec [ 4] 5.00-6.00 sec 28.3 KBytes 232 Kbits/sec [ 4] 6.00-7.00 sec 29.7 KBytes 243 Kbits/sec [ 4] 7.00-8.00 sec 28.3 KBytes 232 Kbits/sec [ 4] 8.00-9.00 sec
29.7 KBytes 243 Kbits/sec [ 4] 9.00-10.00 sec 28.3 KBytes 232 Kbits/sec [ 4] 10.00-11.00 sec 29.7 KBytes 243 Kbits/sec [ 4] 11.00-12.00 sec 28.3 KBytes 232 Kbits/sec [ 4] 12.00-13.00 sec 29.7 KBytes 243 Kbits/sec [ 4] 13.00-14.00 sec 28.3 KBytes 232 Kbits/sec [ 4] 14.00-15.00 sec 28.3 KBytes 232 Kbits/sec [ 4] 15.00-16.00 sec 29.7 KBytes 243 Kbits/sec [ 4] 16.00-17.00 sec 29.7 KBytes 243 Kbits/sec [ 4] 17.00-18.00 sec 28.3 KBytes 232 Kbits/sec [ 4] 18.00-19.00 sec 25.5 KBytes 208 Kbits/sec [ 4] 19.00-20.00 sec 26.9 KBytes 220 Kbits/sec - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bandwidth Retr [ 4] 0.00-20.00 sec 1.64 MBytes 689 Kbits/sec 0 sender [ 4] 0.00-20.00 sec 976 KBytes 400 Kbits/sec receiver