网络质量指标及测试工具iperf

网络质量的指标,主要有以下几个:
    A. 带宽(throughput),网络的吞吐率,端到端之间可以传输的最大速率。
    B. 延时(latency),数据包从本地传输到对端之间需要的时间,一般是来回的时间RTT。中美海底光纤RTT一般在170ms左右。
    C. 丢包(loss),丢包率超过10%以后,网络质量会迅速劣化。
    D. 延时抖动(jitter),如果延时不稳定,忽快忽慢,网络就存在抖动。在VOIP,视频会议等场合,往往声音和图像也会抖动。
视讯直播对这四个指标都很敏感。基于UDP的srt协议直播,在部署前,需要确认网络质量参数。

网络质量测试工具iperf, 可以测试真实载荷下的网络质量,可以测试端到端的网络质量,可以测试一定吞吐率下的丢包、抖动。
iperf网站:https://iperf.fr/iperf-download.php
-b, --bitrate #[KMG][/#]  target bitrate in bits/sec (0 for unlimited)
-w, --window    #[KMG]    set window size / socket buffer size
-u, --udp                 use UDP rather than TCP
-c, --client    <host>    run in client mode, connecting to <host>
-s, --server              run in server mode
-D, --daemon              run the server as a daemon
-d, --dualtest           Do a bidirectional test simultaneously    // client only
-P, --parallel  #        number of parallel client threads to run

Source of the IPERF 3 project can be found at https://github.com/esnet/iperf
Source of the IPERF 2 project can be found at https://sourceforge.net/projects/iperf2/
Source of the IPERF project can be found at https://sourceforge.net/projects/iperf/
git clone git@github.com:esnet/iperf.git
不要用iperf3,直接用iperf2来测。

服务器上启动:# iperf -s -u -p 17029
windows client上面测试:
# iperf2 -u -c 107.150.28.246 -b 800k -i 5 -t 30  -p 17029
# iperf2 -u -c 107.150.28.246 -b 2M -i 5 -t 30 -p 17029
# iperf2 -u -c 107.150.28.246 -b 2.4M -i 5 -t 30 -p 17029
# iperf2 -u -c 107.150.28.246 -b 800k -i 5 -t 30  -p 17029 -P 3
# iperf2 -u -c 107.150.28.246 -b 800k -i 5 -t 30  -p 17029 -P 9
服务器上面生成统计报告:
^C(cmm_owms) [root@usasvr2 iperf2-code]# iperf -s -p 17029 -u
------------------------------------------------------------
Server listening on UDP port 17029
Receiving 1470 byte datagrams
UDP buffer size:  208 KByte (default)
------------------------------------------------------------
[  3] local 107.150.28.246 port 17029 connected with 114.108.219.36 port 61053 (peer 2.0.14-alpha)
[ ID] Interval       Transfer     Bandwidth        Jitter   Lost/Total Datagrams
[  3]  0.0-10.0 sec   979 KBytes   799 Kbits/sec   6.481 ms    2/  684 (0.29%)
[  4] local 107.150.28.246 port 17029 connected with 114.108.219.36 port 61700 (peer 2.0.14-alpha)
[  4]  0.0-30.0 sec  7.50 MBytes  2.09 Mbits/sec   3.060 ms    6/ 5353 (0.11%)
[  3] local 107.150.28.246 port 17029 connected with 114.108.219.36 port 52546 (peer 2.0.14-alpha)
[  3]  0.0-30.0 sec  8.98 MBytes  2.51 Mbits/sec   2.661 ms   16/ 6423 (0.25%)
[  4] local 107.150.28.246 port 17029 connected with 114.108.219.36 port 51827 (peer 2.0.14-alpha)
[  3] local 107.150.28.246 port 17029 connected with 114.108.219.36 port 51825 (peer 2.0.14-alpha)
[  5] local 107.150.28.246 port 17029 connected with 114.108.219.36 port 51826 (peer 2.0.14-alpha)
[  4]  0.0-30.0 sec  2.86 MBytes   799 Kbits/sec   4.828 ms    5/ 2044 (0.24%)
[  5]  0.0-30.0 sec  2.86 MBytes   799 Kbits/sec   5.347 ms    5/ 2044 (0.24%)
[  3]  0.0-30.0 sec  2.86 MBytes   799 Kbits/sec   5.736 ms    4/ 2044 (0.2%)
[SUM]  0.0-30.0 sec  8.58 MBytes  2.40 Mbits/sec   5.736 ms   14/ 6132 (0.23%)
[  6] local 107.150.28.246 port 17029 connected with 114.108.219.36 port 58768 (peer 2.0.14-alpha)
[  5] local 107.150.28.246 port 17029 connected with 114.108.219.36 port 58771 (peer 2.0.14-alpha)
[  4] local 107.150.28.246 port 17029 connected with 114.108.219.36 port 58774 (peer 2.0.14-alpha)
[  3] local 107.150.28.246 port 17029 connected with 114.108.219.36 port 58772 (peer 2.0.14-alpha)
[  7] local 107.150.28.246 port 17029 connected with 114.108.219.36 port 58775 (peer 2.0.14-alpha)
[  8] local 107.150.28.246 port 17029 connected with 114.108.219.36 port 58767 (peer 2.0.14-alpha)
[  9] local 107.150.28.246 port 17029 connected with 114.108.219.36 port 58769 (peer 2.0.14-alpha)
[ 10] local 107.150.28.246 port 17029 connected with 114.108.219.36 port 58773 (peer 2.0.14-alpha)
[ 11] local 107.150.28.246 port 17029 connected with 114.108.219.36 port 58770 (peer 2.0.14-alpha)
[  3]  0.0-30.4 sec  1.25 MBytes   344 Kbits/sec  34.867 ms 1155/ 2044 (57%)
[  7]  0.0-30.4 sec  1.11 MBytes   307 Kbits/sec  25.823 ms 1249/ 2044 (61%)
[  9]  0.0-30.4 sec  1.05 MBytes   289 Kbits/sec  29.907 ms 1296/ 2044 (63%)
[ 11]  0.0-30.4 sec  1.11 MBytes   305 Kbits/sec  33.732 ms 1255/ 2044 (61%)
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

草根大哥

进军大神程序员路上,谢谢支持!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值