Ardupilot Rpanion iperf网络性能测试

Ardupilot Rpanion iperf网络性能测试

  • 1. 源由
  • 2. 分析
  • 3. 安装
  • 4. 测试
    • 4.1 第一次测试
      • 4.1.1 iperf测试参数A
        • 4.1.1.1 测试链路1
        • 4.1.1.2 测试链路2
        • 4.1.1.3 测试链路3
      • 4.1.2 iperf测试参数B - 测试链路3
        • 4.1.2.1 测试数据
        • 4.1.2.2 数据简单分析
        • 4.1.2.3 数据深入分析
        • 4.1.2.4 模拟测试网络
    • 4.2 第二次测试
      • 4.2.1 测试数据
      • 4.2.2 数据分析
      • 4.2.3 网络延迟分析
      • 4.2.4 视频效果
    • 4.3 第三次测试
      • 4.3.1 测试数据
      • 4.3.2 数据分析
      • 4.3.3 网络延迟分析
      • 4.3.4 视频效果
  • 5. 总结
  • 6. 参考资料
  • 7. ZeroTier优化办法 - Moon节点
    • 7.1 服务端配置
    • 7.2 客户端配置

1. 源由

网络性能测试主要目的是:

  • 评估网络健康状况:网络性能测试可以帮助评估网络的健康状况,包括带宽、延迟、丢包率等指标。通过了解网络的实际性能,可以及时发现并解决网络瓶颈和问题,确保网络的正常运行。

  • 优化网络性能:通过网络性能测试,可以确定网络中存在的瓶颈和性能问题,并采取相应的优化措施。这包括调整网络设备配置、优化网络拓扑、升级网络硬件等,以提高网络的吞吐量、稳定性和可靠性。

  • 规划网络扩展和升级:网络性能测试可以帮助企业规划网络的扩展和升级,以满足不断增长的业务需求。通过了解当前网络的性能状况和未来的需求,可以更好地规划网络架构、设备采购和部署策略。

  • 保障用户体验:良好的网络性能是保障用户体验的关键。网络性能测试可以帮助确保网络对用户提供良好的服务质量,包括快速的响应时间、稳定的连接和高质量的数据传输。

  • 提高网络安全:网络性能测试还可以帮助发现和解决网络安全漏洞和风险。通过测试网络的性能和安全性,可以识别潜在的安全威胁,并采取相应的防护措施,提高网络的安全性和可靠性。

最近要做的是针对视频、电传链路的评估,其在VPN/4G-LTE下性能到底如何?

  • 《ArduPilot开源代码之CompanionComputer上天计划》
  • 《Ardupilot开源代码之Rover上路计划》

2. 分析

在进行网络性能测试时,其主要步骤如下:

  • 清晰的测试目标:确定您要测试的网络性能指标,例如带宽、延迟、丢包率等。确保您的测试目标清晰明确,并且测试过程中能够量化和记录这些指标。

  • 选择适当的测试工具:根据您的测试需求选择合适的工具。一些常用的网络性能测试工具包括iperf、Wireshark、PingPlotter等。确保您选择的工具能够提供您需要的功能和数据输出。

  • 测试环境的准备:在进行测试之前,确保测试环境的稳定性和一致性。避免在网络负载较高的时段进行测试,以免影响测试结果。另外,确保测试设备和网络连接的稳定性,以避免测试过程中出现干扰或故障。

  • 数据采集和分析:在测试过程中,及时记录测试数据,并进行分析和比较。这些数据可以帮助您评估网络性能,并识别潜在的问题和瓶颈。确保您使用的工具能够提供详细的测试结果和分析功能。

  • 安全性和合规性:在进行网络性能测试时,确保您的测试活动不会对网络安全造成威胁,并遵守相关的法律法规和政策要求。在测试之前,与相关部门或团队沟通,确保您的测试活动符合组织的安全和合规标准。

  • 测试结果的验证和确认:在完成测试之后,验证和确认测试结果的准确性和可靠性。如果可能,进行多次测试以确保结果的一致性,并与预期的性能指标进行比较。

综上所述,网络性能测试需要仔细的规划和准备工作,以确保测试结果的准确性和可信度。通过遵循上述注意事项,您可以更好地评估和优化网络性能,提高网络的稳定性和效率。

3. 安装

  • Jetson Orin Nano
$ sudo apt-get install iperf
$ iperf --version
iperf version 2.1.5 (3 December 2021) pthreads
  • Raspberrry Pi 3B+
$ sudo apt-get install iperf
$ iperf --version
iperf version 2.0.14a (2 October 2020) pthreads
$ iperf --version
iperf version 2.1.5 (3 December 2021) pthreads
daniel@daniel-nvidia:~$ iperf -h
Usage: iperf [-s|-c host] [options]iperf [-h|--help] [-v|--version]Client/Server:-b, --bandwidth #[kmgKMG | pps]  bandwidth to read/send at in bits/sec or packets/sec-e, --enhanced    use enhanced reporting giving more tcp/udp and traffic information-f, --format    [kmgKMG]   format to report: Kbits, Mbits, KBytes, MBytes--hide-ips           hide ip addresses and host names within outputs-i, --interval  #        seconds between periodic bandwidth reports-l, --len       #[kmKM]    length of buffer in bytes to read or write (Defaults: TCP=128K, v4 UDP=1470, v6 UDP=1450)-m, --print_mss          print TCP maximum segment size (MTU - TCP/IP header)-o, --output    <filename> output the report or error message to this specified file-p, --port      #        client/server port to listen/send on and to connect--permit-key         permit key to be used to verify client and server (TCP only)--sum-only           output sum only reports-u, --udp                use UDP rather than TCP-w, --window    #[KM]    TCP window size (socket buffer size)-z, --realtime           request realtime scheduler-B, --bind <host>[:<port>][%<dev>] bind to <host>, ip addr (including multicast address) and optional port and device-C, --compatibility      for use with older versions does not sent extra msgs-M, --mss       #        set TCP maximum segment size (MTU - 40 bytes)-N, --nodelay            set TCP no delay, disabling Nagle's Algorithm-S, --tos       #        set the socket's IP_TOS (byte) field-Z, --tcp-congestion <algo>  set TCP congestion control algorithm (Linux only)Server specific:-p, --port      #[-#]    server port(s) to listen on/connect to-s, --server             run in server mode-1, --singleclient       run one server at a time--histograms         enable latency histograms--permit-key-timeout set the timeout for a permit key in seconds--tcp-rx-window-clamp set the TCP receive window clamp size in bytes--tap-dev   #[<dev>] use TAP device to receive at L2 layer-t, --time      #        time in seconds to listen for new connections as well as to receive traffic (default not set)--udp-histogram #,#  enable UDP latency histogram(s) with bin width and count, e.g. 1,1000=1(ms),1000(bins)-B, --bind <ip>[%<dev>]  bind to multicast address and optional device-U, --single_udp         run in single threaded UDP mode--sum-dstip          sum traffic threads based upon destination ip address (default is src ip)-D, --daemon             run the server as a daemon-V, --ipv6_domain        Enable IPv6 reception by setting the domain and socket to AF_INET6 (Can receive on both IPv4 and IPv6)Client specific:-c, --client    <host>   run in client mode, connecting to <host>--connect-only       run a connect only test--connect-retries #  number of times to retry tcp connect-d, --dualtest           Do a bidirectional test simultaneously (multiple sockets)--fq-rate #[kmgKMG]  bandwidth to socket pacing--full-duplex        run full duplex test using same socket--ipg                set the the interpacket gap (milliseconds) for packets within an isochronous frame--isochronous <frames-per-second>:<mean>,<stddev> send traffic in bursts (frames - emulate video traffic)--incr-dstip         Increment the destination ip with parallel (-P) traffic threads--incr-dstport       Increment the destination port with parallel (-P) traffic threads--incr-srcip         Increment the source ip with parallel (-P) traffic threads--incr-srcport       Increment the source port with parallel (-P) traffic threads--local-only         Set don't route on socket--near-congestion=[w] Use a weighted write delay per the sampled TCP RTT (experimental)--no-connect-sync    No sychronization after connect when -P or parallel traffic threads--no-udp-fin         No final server to client stats at end of UDP test-n, --num       #[kmgKMG]    number of bytes to transmit (instead of -t)-r, --tradeoff           Do a fullduplexectional test individually--tcp-write-prefetch set the socket's TCP_NOTSENT_LOWAT value in bytes and use event based writes-t, --time      #        time in seconds to transmit for (default 10 secs)--trip-times         enable end to end measurements (requires client and server clock sync)--txdelay-time       time in seconds to hold back after connect and before first write--txstart-time       unix epoch time to schedule first write and start traffic-B, --bind [<ip> | <ip:port>] bind ip (and optional port) from which to source traffic-F, --fileinput <name>   input the data to be transmitted from a file-H, --ssm-host <ip>      set the SSM source, use with -B for (S,G)-I, --stdin              input the data to be transmitted from stdin-L, --listenport #       port to receive fullduplexectional tests back on-P, --parallel  #        number of parallel client threads to run-R, --reverse            reverse the test (client receives, server sends)-S, --tos                IP DSCP or tos settings-T, --ttl       #        time-to-live, for multicast (default 1)-V, --ipv6_domain        Set the domain to IPv6 (send packets over IPv6)-X, --peer-detect        perform server version detection and version exchangeMiscellaneous:-x, --reportexclude [CDMSV]   exclude C(connection) D(data) M(multicast) S(settings) V(server) reports-y, --reportstyle C      report as a Comma-Separated Values-h, --help               print this message and quit-v, --version            print version information and quit[kmgKMG] Indicates options that support a k,m,g,K,M or G suffix
Lowercase format characters are 10^3 based and uppercase are 2^n based
(e.g. 1k = 1000, 1K = 1024, 1m = 1,000,000 and 1M = 1,048,576)The TCP window size option can be set by the environment variable
TCP_WINDOW_SIZE. Most other options can be set by an environment variable
IPERF_<long option name>, such as IPERF_BANDWIDTH.Source at <http://sourceforge.net/projects/iperf2/>
Report bugs to <iperf-users@lists.sourceforge.net>

4. 测试

  • 测试指标:带宽、延迟、丢包率、稳定性。其他的可靠性、安全性等暂不考虑。
  • 测试工具:iperf

4.1 第一次测试

目前,本地已有的测试环境的【网络拓扑A】,如下所示:
在这里插入图片描述

4.1.1 iperf测试参数A

  • 服务端:iperf -u -s
  • 客户端:iperf -u -T 10 -b [1M] -c [server address]
4.1.1.1 测试链路1
  • 局域网测试:Pi --> Hub --> Jetson
  • 服务端IP地址:192.168.1.19 (Jetson)
  • 客户端IP地址:192.168.1.201 (Pi)
$ iperf -u -T 10 -b 1M -c 192.168.1.19
------------------------------------------------------------
Client connecting to 192.168.1.19, UDP port 5001
UDP buffer size:  208 KByte (default)
------------------------------------------------------------
[  3] local 192.168.1.201 port 49022 connected with 192.168.1.19 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3] 0.0000-10.0153 sec  1.25 MBytes  1.05 Mbits/sec
[  3] Sent 896 datagrams
[  3] Server Report:
[ ID] Interval       Transfer     Bandwidth        Jitter   Lost/Total Datagrams
[  3] 0.0000-10.0116 sec  1.25 MBytes  1.05 Mbits/sec   3.065 ms    0/  895 (0%)$ iperf -u -T 10 -b 2M -c 192.168.1.19
------------------------------------------------------------
Client connecting to 192.168.1.19, UDP port 5001
UDP buffer size:  208 KByte (default)
------------------------------------------------------------
[  3] local 192.168.1.201 port 46959 connected with 192.168.1.19 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3] 0.0000-10.0098 sec  2.50 MBytes  2.10 Mbits/sec
[  3] Sent 1788 datagrams
[  3] Server Report:
[ ID] Interval       Transfer     Bandwidth        Jitter   Lost/Total Datagrams
[  3] 0.0000-9.9998 sec  2.50 MBytes  2.10 Mbits/sec   2.513 ms    0/ 1787 (0%)$ iperf -u -T 10 -b 3M -c 192.168.1.19
------------------------------------------------------------
Client connecting to 192.168.1.19, UDP port 5001
UDP buffer size:  208 KByte (default)
------------------------------------------------------------
[  3] local 192.168.1.201 port 44713 connected with 192.168.1.19 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3] 0.0000-10.0079 sec  3.75 MBytes  3.15 Mbits/sec
[  3] Sent 2680 datagrams
[  3] Server Report:
[ ID] Interval       Transfer     Bandwidth        Jitter   Lost/Total Datagrams
[  3] 0.0000-10.0206 sec  3.75 MBytes  3.14 Mbits/sec   2.352 ms    1/ 2679 (0.037%)
  • 1M带宽测试:
    带宽:1.05 Mbits/sec
    丢包率:0%
    Jitter:3.065 ms

  • 2M带宽测试:
    带宽:2.10 Mbits/sec
    丢包率:0%
    Jitter:2.513 ms

  • 3M带宽测试:
    带宽:3.14 Mbits/sec
    丢包率:0.037%
    Jitter:2.352 ms

4.1.1.2 测试链路2
  • 预设条件:4G LTE SIM卡移除
  • VPN测试:Pi --> Hub --> Modem --> Server --> Modem --> Hub --> AP --> Jetson
  • 服务端IP地址:172.24.42.46 (Jetson)
  • 客户端IP地址:172.24.161.33 (Pi)
$ iperf -u -T 10 -b 1M -c 172.24.42.46
------------------------------------------------------------
Client connecting to 172.24.42.46, UDP port 5001
UDP buffer size:  208 KByte (default)
------------------------------------------------------------
[  3] local 172.24.161.33 port 43642 connected with 172.24.42.46 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3] 0.0000-10.0153 sec  1.25 MBytes  1.05 Mbits/sec
[  3] Sent 896 datagrams
[  3] Server Report:
[ ID] Interval       Transfer     Bandwidth        Jitter   Lost/Total Datagrams
[  3] 0.0000-9.9983 sec  1.25 MBytes  1.05 Mbits/sec   3.425 ms    0/  895 (0%)$ iperf -u -T 10 -b 2M -c 172.24.42.46
------------------------------------------------------------
Client connecting to 172.24.42.46, UDP port 5001
UDP buffer size:  208 KByte (default)
------------------------------------------------------------
[  3] local 172.24.161.33 port 43610 connected with 172.24.42.46 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3] 0.0000-10.0098 sec  2.50 MBytes  2.10 Mbits/sec
[  3] Sent 1788 datagrams
[  3] Server Report:
[ ID] Interval       Transfer     Bandwidth        Jitter   Lost/Total Datagrams
[  3] 0.0000-10.0097 sec  2.50 MBytes  2.10 Mbits/sec   3.465 ms    0/ 1787 (0%)$ iperf -u -T 10 -b 3M -c 172.24.42.46
------------------------------------------------------------
Client connecting to 172.24.42.46, UDP port 5001
UDP buffer size:  208 KByte (default)
------------------------------------------------------------
[  3] local 172.24.161.33 port 37048 connected with 172.24.42.46 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3] 0.0000-10.0041 sec  3.75 MBytes  3.15 Mbits/sec
[  3] Sent 2679 datagrams
[  3] Server Report:
[ ID] Interval       Transfer     Bandwidth        Jitter   Lost/Total Datagrams
[  3] 0.0000-10.0336 sec  3.75 MBytes  3.14 Mbits/sec   4.807 ms    0/ 2678 (0%)
  • 1M带宽测试:
    带宽:1.05 Mbits/sec
    丢包率:0%
    Jitter:3.425 ms

  • 2M带宽测试:
    带宽:2.10 Mbits/sec
    丢包率:0%
    Jitter:3.465 ms

  • 3M带宽测试:
    带宽:3.14 Mbits/sec
    丢包率:0%
    Jitter:4.807 ms

4.1.1.3 测试链路3
  • 预设条件:有线IP网络物理断开
  • VPN测试:Pi --> 4G LTE --> BTS --> Server --> Modem --> Hub --> AP --> Jetson
  • 服务端IP地址:172.24.42.46 (Jetson)
  • 客户端IP地址:172.24.161.33 (Pi)
$ iperf -u -T 10 -b 1M -c 172.24.42.46
------------------------------------------------------------
Client connecting to 172.24.42.46, UDP port 5001
UDP buffer size:  208 KByte (default)
------------------------------------------------------------
[  3] local 172.24.161.33 port 34869 connected with 172.24.42.46 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3] 0.0000-10.0154 sec  1.25 MBytes  1.05 Mbits/sec
[  3] Sent 896 datagrams
[  3] Server Report:
[ ID] Interval       Transfer     Bandwidth        Jitter   Lost/Total Datagrams
[  3] 0.0000-9.9907 sec  1.25 MBytes  1.05 Mbits/sec   8.210 ms    0/  895 (0%)$ iperf -u -T 10 -b 2M -c 172.24.42.46
------------------------------------------------------------
Client connecting to 172.24.42.46, UDP port 5001
UDP buffer size:  208 KByte (default)
------------------------------------------------------------
[  3] local 172.24.161.33 port 35665 connected with 172.24.42.46 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3] 0.0000-10.0098 sec  2.50 MBytes  2.10 Mbits/sec
[  3] Sent 1788 datagrams
[  3] Server Report:
[ ID] Interval       Transfer     Bandwidth        Jitter   Lost/Total Datagrams
[  3] 0.0000-9.9933 sec  2.50 MBytes  2.10 Mbits/sec   7.350 ms    0/ 1787 (0%)$ iperf -u -T 10 -b 3M -c 172.24.42.46
------------------------------------------------------------
Client connecting to 172.24.42.46, UDP port 5001
UDP buffer size:  208 KByte (default)
------------------------------------------------------------
[  3] local 172.24.161.33 port 43883 connected with 172.24.42.46 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3] 0.0000-10.0079 sec  3.75 MBytes  3.15 Mbits/sec
[  3] Sent 2680 datagrams
[  3] Server Report:
[ ID] Interval       Transfer     Bandwidth        Jitter   Lost/Total Datagrams
[  3] 0.0000-10.0150 sec  3.75 MBytes  3.14 Mbits/sec   5.268 ms    0/ 2679 (0%)
  • 1M带宽测试:
    带宽:1.05 Mbits/sec
    丢包率:0%
    Jitter:8.210 ms

  • 2M带宽测试:
    带宽:2.10 Mbits/sec
    丢包率:0%
    Jitter:7.350 ms

  • 3M带宽测试:
    带宽:3.14 Mbits/sec
    丢包率:0%
    Jitter:5.268 ms

4.1.2 iperf测试参数B - 测试链路3

为什么要引入测试参数B?主要原因是:

  1. 4G LTE视频发现花屏+卡顿现象
  2. 测试参数A给出的1/2/3链路状况都是非常理想的
    上述两个现象与实际结果发生了严重的不一致问题,太困惑了。
  • 4G LTE networks results in significant screen freezing and stuttering #225

怀疑:是否是iperf测试参数问题导致测试结果不准确。因此,调整测试参数如下:

  • 服务端:iperf -u -s
  • 客户端:iperf -u -T 10 -b [1M] -l 20 -e -i 1 -t 60 -c [server address]

预设条件:有线IP网络物理断开
VPN测试:Pi --> 4G LTE --> BTS --> Server --> Modem --> Hub --> AP --> Jetson
服务端IP地址:172.24.42.46 (Jetson)
客户端IP地址:172.24.161.33 (Pi)

4.1.2.1 测试数据
$ iperf -u -T 10 -b 2M -l 20 -e -i 1 -t 60 -c 172.24.42.46
------------------------------------------------------------
Client connecting to 172.24.42.46, UDP port 5001 with pid 950 (1 flows)
Write buffer size: 20.0 Byte
UDP buffer size:  208 KByte (default)
------------------------------------------------------------
[  3] local 172.24.161.33%zt44xhvvrc port 57316 connected with 172.24.42.46 port 5001
[ ID] Interval            Transfer     Bandwidth      Write/Err  PPS
[  3] 0.0000-1.0000 sec   256 KBytes  2.10 Mbits/sec  13104/0    13105 pps
[  3] 1.0000-2.0000 sec   256 KBytes  2.10 Mbits/sec  13111/0    13112 pps
[  3] 2.0000-3.0000 sec   256 KBytes  2.10 Mbits/sec  13108/0    13106 pps
[  3] 3.0000-4.0000 sec   256 KBytes  2.10 Mbits/sec  13106/0    13108 pps
[  3] 4.0000-5.0000 sec   256 KBytes  2.10 Mbits/sec  13107/0    13108 pps
[  3] 5.0000-6.0000 sec   256 KBytes  2.10 Mbits/sec  13107/0    13105 pps
[  3] 6.0000-7.0000 sec   256 KBytes  2.10 Mbits/sec  13107/0    13107 pps
[  3] 7.0000-8.0000 sec   256 KBytes  2.10 Mbits/sec  13109/0    13108 pps
[  3] 8.0000-9.0000 sec   256 KBytes  2.10 Mbits/sec  13103/0    13103 pps
[  3] 9.0000-10.0000 sec   256 KBytes  2.10 Mbits/sec  13108/0    13112 pps
[  3] 10.0000-11.0000 sec   256 KBytes  2.10 Mbits/sec  13111/0    13106 pps
[  3] 11.0000-12.0000 sec   256 KBytes  2.10 Mbits/sec  13106/0    13108 pps
[  3] 12.0000-13.0000 sec   256 KBytes  2.10 Mbits/sec  13108/0    13107 pps
[  3] 13.0000-14.0000 sec   256 KBytes  2.10 Mbits/sec  13105/0    13107 pps
[  3] 14.0000-15.0000 sec   256 KBytes  2.10 Mbits/sec  13105/0    13102 pps
[  3] 15.0000-16.0000 sec   256 KBytes  2.10 Mbits/sec  13112/0    13113 pps
[  3] 16.0000-17.0000 sec   256 KBytes  2.10 Mbits/sec  13104/0    13104 pps
[  3] 17.0000-18.0000 sec   256 KBytes  2.10 Mbits/sec  13109/0    13111 pps
[  3] 18.0000-19.0000 sec   256 KBytes  2.10 Mbits/sec  13109/0    13107 pps
[  3] 19.0000-20.0000 sec   256 KBytes  2.10 Mbits/sec  13105/0    13107 pps
[  3] 20.0000-21.0000 sec   256 KBytes  2.10 Mbits/sec  13108/0    13105 pps
[  3] 21.0000-22.0000 sec   256 KBytes  2.10 Mbits/sec  13105/0    13109 pps
[  3] 22.0000-23.0000 sec   256 KBytes  2.10 Mbits/sec  13097/0    13107 pps
[  3] 23.0000-24.0000 sec   256 KBytes  2.10 Mbits/sec  13120/0    13107 pps
[  3] 24.0000-25.0000 sec   256 KBytes  2.10 Mbits/sec  13106/0    13105 pps
[  3] 25.0000-26.0000 sec   256 KBytes  2.10 Mbits/sec  13107/0    13110 pps
[  3] 26.0000-27.0000 sec   256 KBytes  2.10 Mbits/sec  13107/0    13105 pps
[  3] 27.0000-28.0000 sec   256 KBytes  2.10 Mbits/sec  13107/0    13109 pps
[  3] 28.0000-29.0000 sec   256 KBytes  2.10 Mbits/sec  13108/0    13105 pps
[  3] 29.0000-30.0000 sec   256 KBytes  2.10 Mbits/sec  13107/0    13107 pps
[  3] 30.0000-31.0000 sec   256 KBytes  2.10 Mbits/sec  13106/0    13106 pps
[  3] 31.0000-32.0000 sec   256 KBytes  2.10 Mbits/sec  13109/0    13110 pps
[  3] 32.0000-33.0000 sec   256 KBytes  2.10 Mbits/sec  13108/0    13108 pps
[  3] 33.0000-34.0000 sec   256 KBytes  2.10 Mbits/sec  13104/0    13107 pps
[  3] 34.0000-35.0000 sec   256 KBytes  2.10 Mbits/sec  13109/0    13105 pps
[  3] 35.0000-36.0000 sec   256 KBytes  2.10 Mbits/sec  13109/0    13109 pps
[  3] 36.0000-37.0000 sec   256 KBytes  2.10 Mbits/sec  13106/0    13108 pps
[  3] 37.0000-38.0000 sec   256 KBytes  2.10 Mbits/sec  13107/0    13105 pps
[  3] 38.0000-39.0000 sec   256 KBytes  2.10 Mbits/sec  13108/0    13109 pps
[  3] 39.0000-40.0000 sec   256 KBytes  2.10 Mbits/sec  13106/0    13107 pps
[  3] 40.0000-41.0000 sec   256 KBytes  2.10 Mbits/sec  13107/0    13107 pps
[  3] 41.0000-42.0000 sec   256 KBytes  2.10 Mbits/sec  13109/0    13107 pps
[  3] 42.0000-43.0000 sec   256 KBytes  2.10 Mbits/sec  13105/0    13107 pps
[  3] 43.0000-44.0000 sec   256 KBytes  2.10 Mbits/sec  13108/0    13107 pps
[  3] 44.0000-45.0000 sec   256 KBytes  2.10 Mbits/sec  13107/0    13107 pps
[  3] 45.0000-46.0000 sec   256 KBytes  2.10 Mbits/sec  13107/0    13104 pps
[  3] 46.0000-47.0000 sec   256 KBytes  2.10 Mbits/sec  13109/0    13109 pps
[  3] 47.0000-48.0000 sec   256 KBytes  2.10 Mbits/sec  13107/0    13108 pps
[  3] 48.0000-49.0000 sec   256 KBytes  2.10 Mbits/sec  13107/0    13106 pps
[  3] 49.0000-50.0000 sec   256 KBytes  2.10 Mbits/sec  13105/0    13105 pps
[  3] 50.0000-51.0000 sec   256 KBytes  2.10 Mbits/sec  13110/0    13110 pps
[  3] 51.0000-52.0000 sec   256 KBytes  2.10 Mbits/sec  13104/0    13108 pps
[  3] 52.0000-53.0000 sec   256 KBytes  2.10 Mbits/sec  13110/0    13106 pps
[  3] 53.0000-54.0000 sec   256 KBytes  2.10 Mbits/sec  13108/0    13108 pps
[  3] 54.0000-55.0000 sec   256 KBytes  2.10 Mbits/sec  13105/0    13108 pps
[  3] 55.0000-56.0000 sec   256 KBytes  2.10 Mbits/sec  13108/0    13107 pps
[  3] 56.0000-57.0000 sec   256 KBytes  2.10 Mbits/sec  13108/0    13107 pps
[  3] 57.0000-58.0000 sec   256 KBytes  2.10 Mbits/sec  13107/0    13106 pps
[  3] 58.0000-59.0000 sec   256 KBytes  2.10 Mbits/sec  13106/0    13106 pps
[  3] 59.0000-60.0000 sec   256 KBytes  2.10 Mbits/sec  13107/0    13108 pps
[  3] 0.0000-60.0007 sec  15.0 MBytes  2.10 Mbits/sec  786443/0    13107 pps
[  3] Sent 786443 datagrams
[  3] Server Report:
[ ID] Interval       Transfer     Bandwidth        Jitter   Lost/Total Datagrams
[  3] 0.0000-60.1233 sec  7.88 MBytes  1.10 Mbits/sec   0.145 ms 373400/786443 (47%)
[  3] 0.0000-60.1233 sec  32 datagrams received out-of-order
4.1.2.2 数据简单分析
  • 测试设置为使用UDP协议,目标带宽为2Mbps,发送数据包大小为20字节,持续时间为60秒。
  • 客户端连接到IP地址为172.24.42.46的服务器。
  • 在整个测试期间,每秒发送的数据包数量保持在大约13100个左右,除非有数据包丢失,否则保持稳定。
  • 服务器报告显示,在60秒的测试期间,共发送了786443个数据包,其中约47%的数据包丢失,且有32个数据包接收时顺序错乱。
  • 带宽的实际测量结果约为1.10 Mbits/sec,明显低于设定的2Mbps目标带宽。

综上所述,这些数据表明在给定的网络环境下存在丢包和顺序错乱的问题,导致带宽表现不佳。可能的原因包括网络拥塞、传输延迟、或网络设备配置问题。为解决这些问题,可以考虑优化网络配置、增加带宽、或改善网络连接质量。

4.1.2.3 数据深入分析

本次测试已经发现一些线索,至少确实可能存在链路状况不佳的情况。

分析对比测试线A v/s B的差异:

  1. 测试参数A:默认v4 UDP=1470, v6 UDP=1450
  2. 测试参数B:数据包大小20字节,每秒报文数量13105

在维持带宽情况下,小包数量增加,会引起网络拥塞,进而导致丢包率明显增加。此时,出现花屏和卡顿就不足为奇。

从这里可以认识到,之前的测试过于简单。
因为视频流并非只是发送一种长度的报文,可能是变化的;另外,在编码完成后,会有发送报文需求;在图像编码时,视频数据尚没有准备好,此时,并无数据发送需求,网络带宽是空闲的。

引入以下思考:视频传输H264编码P/I帧的数据发送是如何分布的(时空概念)?

  1. 报文大小分布情况如何?
  2. 报文发送速率如何?
  • Bit Rate Throttling Algorithm on Video over RTP

举了一个例子:

  • 高峰时刻I帧,5ms 15个数据包,而I帧又是完整的帧图像,如果此时出现丢包,那可不就是花屏、卡顿。
  • 每间隔2秒,传输报文数量出现一个2倍峰值
  • 15FPS(66.7ms)下,H264每隔62ms出现一个峰值大包传输集中点(时刻)

在这里插入图片描述在这里插入图片描述

4.1.2.4 模拟测试网络

模拟高峰时刻带宽测试:5ms 15包数据(每秒15x1000/5=3000pps),1400字节一包。

  • 实际测试网络,还存在其他视频链路,应用程序等等网络开销
  • 模拟始终高压传输,导致带宽更加紧张,容易导致UDP丢包

最终结果:81%丢包率,压根没法看视频了(妥妥的2-8定律)

$ iperf -b 3000pps -u -e -i 1 -l 1400 -c 172.24.42.46
------------------------------------------------------------
Client connecting to 172.24.42.46, UDP port 5001 with pid 1137 (1 flows)
Write buffer size: 1.37 KByte
UDP buffer size:  208 KByte (default)
------------------------------------------------------------
[  3] local 172.24.161.33%zt44xhvvrc port 49273 connected with 172.24.42.46 port 5001
[ ID] Interval            Transfer     Bandwidth      Write/Err  PPS
[  3] 0.0000-1.0000 sec  4.01 MBytes  33.6 Mbits/sec  3001/0     3002 pps
[  3] 1.0000-2.0000 sec  4.01 MBytes  33.6 Mbits/sec  3001/0     3000 pps
[  3] 2.0000-3.0000 sec  4.00 MBytes  33.6 Mbits/sec  2996/0     3000 pps
[  3] 3.0000-4.0000 sec  4.01 MBytes  33.6 Mbits/sec  3003/0     2999 pps
[  3] 4.0000-5.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3001 pps
[  3] 5.0000-6.0000 sec  4.01 MBytes  33.6 Mbits/sec  3001/0     3000 pps
[  3] 6.0000-7.0000 sec  4.00 MBytes  33.6 Mbits/sec  2999/0     3000 pps
[  3] 7.0000-8.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 8.0000-9.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 9.0000-10.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 0.0000-10.0009 sec  40.1 MBytes  33.6 Mbits/sec  30005/0     3000 pps
[  3] Sent 30005 datagrams
[  3] Server Report:
[ ID] Interval       Transfer     Bandwidth        Jitter   Lost/Total Datagrams
[  3] 0.0000-10.3893 sec  7.64 MBytes  6.17 Mbits/sec   2.070 ms 24283/30007 (81%)

4.2 第二次测试

鉴于第一次测试的网络拓扑问题,现在只用一个4G LTE链路:因此链路独享,功能单一,不会有太多的竞争关系。【网络拓扑B】调整如下:

在这里插入图片描述

4.2.1 测试数据

$ iperf -b 3000pps -u -e -i 1 -l 1400 -c 172.24.42.46
------------------------------------------------------------
Client connecting to 172.24.42.46, UDP port 5001 with pid 1426 (1 flows)
Write buffer size: 1.37 KByte
UDP buffer size:  208 KByte (default)
------------------------------------------------------------
[  3] local 172.24.161.33%zt44xhvvrc port 51044 connected with 172.24.42.46 port 5001
[ ID] Interval            Transfer     Bandwidth      Write/Err  PPS
[  3] 0.0000-1.0000 sec  4.01 MBytes  33.6 Mbits/sec  3001/0     3002 pps
[  3] 1.0000-2.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 2.0000-3.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 3.0000-4.0000 sec  4.01 MBytes  33.6 Mbits/sec  3001/0     3001 pps
[  3] 4.0000-5.0000 sec  4.00 MBytes  33.6 Mbits/sec  2999/0     2999 pps
[  3] 5.0000-6.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 6.0000-7.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 7.0000-8.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 8.0000-9.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 9.0000-10.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 0.0000-10.0009 sec  40.1 MBytes  33.6 Mbits/sec  30005/0     3000 pps
[  3] Sent 30005 datagrams
[  3] Server Report:
[ ID] Interval       Transfer     Bandwidth        Jitter   Lost/Total Datagrams
[  3] 0.0000-10.2656 sec  37.5 MBytes  30.7 Mbits/sec   0.268 ms 1890/30004 (6.3%)

注:更多测试数据供参考。

daniel@rpanion:~ $ iperf -b 3000pps -u -e -i 1 -l 1400 -c 172.24.42.46
------------------------------------------------------------
Client connecting to 172.24.42.46, UDP port 5001 with pid 1510 (1 flows)
Write buffer size: 1.37 KByte
UDP buffer size:  208 KByte (default)
------------------------------------------------------------
[  3] local 172.24.161.33%zt44xhvvrc port 43161 connected with 172.24.42.46 port 5001
[ ID] Interval            Transfer     Bandwidth      Write/Err  PPS
[  3] 0.0000-1.0000 sec  4.01 MBytes  33.6 Mbits/sec  3001/0     3002 pps
[  3] 1.0000-2.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 2.0000-3.0000 sec  4.01 MBytes  33.6 Mbits/sec  3001/0     3001 pps
[  3] 3.0000-4.0000 sec  4.00 MBytes  33.6 Mbits/sec  2999/0     2999 pps
[  3] 4.0000-5.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 5.0000-6.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 6.0000-7.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 7.0000-8.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 8.0000-9.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 9.0000-10.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 0.0000-10.0009 sec  40.1 MBytes  33.6 Mbits/sec  30005/0     3000 pps
[  3] Sent 30005 datagrams
[  3] Server Report:
[ ID] Interval       Transfer     Bandwidth        Jitter   Lost/Total Datagrams
[  3] 0.0000-10.0739 sec  39.7 MBytes  33.0 Mbits/sec   0.191 ms  278/30004 (0.93%)
daniel@rpanion:~ $ iperf -b 3000pps -u -e -i 1 -l 1400 -c 172.24.42.46
------------------------------------------------------------
Client connecting to 172.24.42.46, UDP port 5001 with pid 1516 (1 flows)
Write buffer size: 1.37 KByte
UDP buffer size:  208 KByte (default)
------------------------------------------------------------
[  3] local 172.24.161.33%zt44xhvvrc port 59910 connected with 172.24.42.46 port 5001
[ ID] Interval            Transfer     Bandwidth      Write/Err  PPS
[  3] 0.0000-1.0000 sec  4.01 MBytes  33.6 Mbits/sec  3001/0     3002 pps
[  3] 1.0000-2.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 2.0000-3.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 3.0000-4.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 4.0000-5.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 5.0000-6.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 6.0000-7.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 7.0000-8.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 8.0000-9.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 9.0000-10.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 0.0000-10.0008 sec  40.1 MBytes  33.6 Mbits/sec  30005/0     3000 pps
[  3] Sent 30005 datagrams
[  3] Server Report:
[ ID] Interval       Transfer     Bandwidth        Jitter   Lost/Total Datagrams
[  3] 0.0000-10.2943 sec  36.7 MBytes  29.9 Mbits/sec   0.462 ms 2551/30004 (8.5%)
daniel@rpanion:~ $ iperf -b 3000pps -u -e -i 1 -l 1400 -c 172.24.42.46
------------------------------------------------------------
Client connecting to 172.24.42.46, UDP port 5001 with pid 1520 (1 flows)
Write buffer size: 1.37 KByte
UDP buffer size:  208 KByte (default)
------------------------------------------------------------
[  3] local 172.24.161.33%zt44xhvvrc port 40583 connected with 172.24.42.46 port 5001
[ ID] Interval            Transfer     Bandwidth      Write/Err  PPS
[  3] 0.0000-1.0000 sec  4.01 MBytes  33.6 Mbits/sec  3001/0     3001 pps
[  3] 1.0000-2.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 2.0000-3.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 3.0000-4.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 4.0000-5.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 5.0000-6.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 6.0000-7.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 7.0000-8.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 8.0000-9.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 9.0000-10.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 0.0000-10.0022 sec  40.1 MBytes  33.6 Mbits/sec  30009/0     3000 pps
[  3] Sent 30009 datagrams
[  3] Server Report:
[ ID] Interval       Transfer     Bandwidth        Jitter   Lost/Total Datagrams
[  3] 0.0000-10.0383 sec  38.3 MBytes  32.0 Mbits/sec   0.262 ms 1311/30008 (4.4%)
daniel@rpanion:~ $ iperf -b 3000pps -u -e -i 1 -l 1400 -c 172.24.42.46
------------------------------------------------------------
Client connecting to 172.24.42.46, UDP port 5001 with pid 1524 (1 flows)
Write buffer size: 1.37 KByte
UDP buffer size:  208 KByte (default)
------------------------------------------------------------
[  3] local 172.24.161.33%zt44xhvvrc port 47580 connected with 172.24.42.46 port 5001
[ ID] Interval            Transfer     Bandwidth      Write/Err  PPS
[  3] 0.0000-1.0000 sec  3.96 MBytes  33.2 Mbits/sec  2967/0     3002 pps
[  3] 1.0000-2.0000 sec  4.00 MBytes  33.6 Mbits/sec  2997/0     3000 pps
[  3] 2.0000-3.0000 sec  4.03 MBytes  33.8 Mbits/sec  3015/0     2979 pps
[  3] 3.0000-4.0000 sec  4.03 MBytes  33.8 Mbits/sec  3016/0     3014 pps
[  3] 4.0000-5.0000 sec  3.98 MBytes  33.4 Mbits/sec  2982/0     3007 pps
[  3] 5.0000-6.0000 sec  4.04 MBytes  33.9 Mbits/sec  3024/0     3000 pps
[  3] 6.0000-7.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 7.0000-8.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 8.0000-9.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 9.0000-10.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 0.0000-10.0009 sec  40.1 MBytes  33.6 Mbits/sec  30005/0     3000 pps
[  3] Sent 30005 datagrams
[  3] Server Report:
[ ID] Interval       Transfer     Bandwidth        Jitter   Lost/Total Datagrams
[  3] 0.0000-10.0151 sec  39.7 MBytes  33.3 Mbits/sec   0.302 ms  235/30004 (0.78%)
daniel@rpanion:~ $ iperf -b 3000pps -u -e -i 1 -l 1400 -c 172.24.42.46
------------------------------------------------------------
Client connecting to 172.24.42.46, UDP port 5001 with pid 1527 (1 flows)
Write buffer size: 1.37 KByte
UDP buffer size:  208 KByte (default)
------------------------------------------------------------
[  3] local 172.24.161.33%zt44xhvvrc port 44434 connected with 172.24.42.46 port 5001
[ ID] Interval            Transfer     Bandwidth      Write/Err  PPS
[  3] 0.0000-1.0000 sec  4.01 MBytes  33.6 Mbits/sec  3001/0     3001 pps
[  3] 1.0000-2.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 2.0000-3.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 3.0000-4.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 4.0000-5.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 5.0000-6.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 6.0000-7.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 7.0000-8.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 8.0000-9.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 9.0000-10.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 0.0000-10.0009 sec  40.1 MBytes  33.6 Mbits/sec  30005/0     3000 pps
[  3] Sent 30005 datagrams
[  3] Server Report:
[ ID] Interval       Transfer     Bandwidth        Jitter   Lost/Total Datagrams
[  3] 0.0000-10.0227 sec  40.1 MBytes  33.5 Mbits/sec   0.474 ms    0/30004 (0%)

4.2.2 数据分析

根据提供的iperf数据,我们可以得到以下分析:

  1. 带宽:
    平均带宽为33.6 Mbits/sec,这是UDP流量在网络上的平均传输速率。

  2. 丢包率:
    总共发送了30005个数据包,其中有1890个数据包丢失。
    丢包率为6.3%。这意味着有6.3%的数据包未能成功到达目的地。这可能是由于网络拥塞、丢包或其他网络问题引起的。

  3. Jitter:
    Jitter指的是数据包传输之间的时延变化。在本例中,Jitter为0.268毫秒。Jitter越小,表示数据包传输的稳定性越高。

  4. PPS(每秒数据包数):
    平均每秒传输了3000个数据包。这是一个可用于评估网络负载的指标。

综合来看,虽然仍存在6.3%的丢包率,实际情况不可能长时间高压力,视频码流也有FEC等纠错机制。相对于第一次测试情况,相对来说该网络链路环境更为理想,也更加符合实际使用情况。

4.2.3 网络延迟分析

通过ping命令,iperf(Linux端)和QGC(Windows端),分析网络延时:

  • iperf(Linux端):平均3.35ms
64 bytes from 172.24.161.33: icmp_seq=1 ttl=64 time=3.07 ms
64 bytes from 172.24.161.33: icmp_seq=2 ttl=64 time=3.14 ms
64 bytes from 172.24.161.33: icmp_seq=3 ttl=64 time=3.83 ms
64 bytes from 172.24.161.33: icmp_seq=4 ttl=64 time=3.35 ms
  • QGC(Windows端):平均7.75ms
Reply from 172.24.161.33: bytes=32 time=7ms TTL=64
Reply from 172.24.161.33: bytes=32 time=3ms TTL=64
Reply from 172.24.161.33: bytes=32 time=12ms TTL=64
Reply from 172.24.161.33: bytes=32 time=9ms TTL=64

4.2.4 视频效果

实测效果: ~ 245 ms 时延;???貌似VPN没啥时延啊?呵呵,后面说,卖个关子。
在这里插入图片描述

Rpanion OV5647 ZeroTier 网络拓扑B 性能实测

4.3 第三次测试

使用更加贴近实际场景,两个4G LTE独享带宽【网络拓扑C】。

在这里插入图片描述

4.3.1 测试数据

$ iperf -b 3000pps -u -e -i 1 -l 1400 -c 172.24.42.46
------------------------------------------------------------
Client connecting to 172.24.42.46, UDP port 5001 with pid 860 (1 flows)
Write buffer size: 1.37 KByte
UDP buffer size:  208 KByte (default)
------------------------------------------------------------
[  3] local 172.24.161.33%zt44xhvvrc port 36516 connected with 172.24.42.46 port 5001
[ ID] Interval            Transfer     Bandwidth      Write/Err  PPS
[  3] 0.0000-1.0000 sec  4.01 MBytes  33.6 Mbits/sec  3002/0     3002 pps
[  3] 1.0000-2.0000 sec  4.00 MBytes  33.6 Mbits/sec  2999/0     3000 pps
[  3] 2.0000-3.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 3.0000-4.0000 sec  4.00 MBytes  33.6 Mbits/sec  2999/0     3000 pps
[  3] 4.0000-5.0000 sec  4.01 MBytes  33.6 Mbits/sec  3001/0     3000 pps
[  3] 5.0000-6.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 6.0000-7.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     2999 pps
[  3] 7.0000-8.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3001 pps
[  3] 8.0000-9.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 9.0000-10.0000 sec  4.01 MBytes  33.6 Mbits/sec  3001/0     3001 pps
[  3] 0.0000-10.0015 sec  40.1 MBytes  33.6 Mbits/sec  30007/0     3000 pps
[  3] Sent 30007 datagrams
[  3] Server Report:
[ ID] Interval       Transfer     Bandwidth        Jitter   Lost/Total Datagrams
[  3] 0.0000-10.3614 sec  37.5 MBytes  30.4 Mbits/sec   0.469 ms 1882/30006 (6.3%)
[  3] 0.0000-10.3614 sec  2921 datagrams received out-of-order

注:更多测试数据供参考。

$ iperf -b 3000pps -u -e -i 1 -l 1400 -c 172.24.42.46
------------------------------------------------------------
Client connecting to 172.24.42.46, UDP port 5001 with pid 1484 (1 flows)
Write buffer size: 1.37 KByte
UDP buffer size:  208 KByte (default)
------------------------------------------------------------
[  3] local 172.24.161.33%zt44xhvvrc port 39651 connected with 172.24.42.46 port 5001
[ ID] Interval            Transfer     Bandwidth      Write/Err  PPS
[  3] 0.0000-1.0000 sec  4.01 MBytes  33.6 Mbits/sec  3001/0     3002 pps
[  3] 1.0000-2.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 2.0000-3.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 3.0000-4.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 4.0000-5.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 5.0000-6.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 6.0000-7.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 7.0000-8.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 8.0000-9.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 9.0000-10.0000 sec  4.01 MBytes  33.6 Mbits/sec  3000/0     3000 pps
[  3] 0.0000-10.0005 sec  40.1 MBytes  33.6 Mbits/sec  30004/0     3000 pps
[  3] Sent 30004 datagrams
[  3] Server Report:
[ ID] Interval       Transfer     Bandwidth        Jitter   Lost/Total Datagrams
[  3] 0.0000-10.1356 sec  36.8 MBytes  30.4 Mbits/sec   0.174 ms 2446/30003 (8.2%)

4.3.2 数据分析

  1. 测试参数:
    使用了以下参数进行测试:带宽设置为3000pps、使用UDP协议、启用错误报告、设置报告间隔为1秒、每个数据包大小为1400字节,连接到IP地址为172.24.42.46的服务器。

  2. 客户端信息:
    客户端IP地址为172.24.161.33,端口36516,连接到服务器IP地址为172.24.42.46,端口5001。

  3. 传输数据:
    在每个1秒的时间间隔内,传输了大约4.01兆字节的数据。
    带宽在每秒都维持在约33.6兆位/秒。
    平均每秒发送的数据包数(PPS)为3000左右。

  4. UDP错误:
    未发现UDP错误。

  5. 服务器报告:
    在10.36秒的测试期间,总共传输了37.5兆字节的数据。
    平均带宽为30.4兆位/秒。
    报告的抖动(jitter)为0.469毫秒。
    6.3%的数据包丢失率,共丢失1882个数据包。
    有2921个数据包收到时是乱序的。

综上所述,该iperf测试表明UDP连接在设定的条件下运行良好,但存在一定程度的数据包丢失和乱序。

4.3.3 网络延迟分析

通过ping命令,iperf(Linux端)和QGC(Windows端),分析网络延时:

  • iperf(Linux端):平均607.5ms
64 bytes from 172.24.161.33: icmp_seq=1 ttl=64 time=668 ms
64 bytes from 172.24.161.33: icmp_seq=2 ttl=64 time=583 ms
64 bytes from 172.24.161.33: icmp_seq=4 ttl=64 time=565 ms
64 bytes from 172.24.161.33: icmp_seq=5 ttl=64 time=614 ms
  • QGC(Windows端):平均822.25ms
Reply from 172.24.161.33: bytes=32 time=825ms TTL=64
Reply from 172.24.161.33: bytes=32 time=854ms TTL=64
Reply from 172.24.161.33: bytes=32 time=801ms TTL=64
Reply from 172.24.161.33: bytes=32 time=809ms TTL=64

4.3.4 视频效果

实测效果: ~ 569 ms 时延; Linux端607.5/2 = 303ms, 569 - 303 = 266 ms左右。

在这里插入图片描述

Rpanion OV5647 ZeroTier 网络拓扑C 性能实测

5. 总结

综上所述:

  1. 【网络拓扑A】~ 200 ms, 参考:《ArduPilot开源飞控之lida2003套机+伴机电脑首飞》
  2. 【网络拓扑B】~ 245 ms
  3. 【网络拓扑C】~ 569 ms
  4. 局域网点对点性能最好,直接就是Rpanion+Rpi3B+ 200ms时延。
  5. 统一WLAN出口,VPN仍然能够很好的优化,与局域网性能相当。
  6. 实际不同发射/接受链路网络,若VPN不做好优化,时延会很显著。

实际使用场景,需要看链路情况,若要进行商业部署,必须做好优化,或者自建网络(VPN/P2P等等)来控制好链路时延问题。

Ardupilot + Rpi3B+ + OV5647 + 4G LTE Copter

6. 参考资料

【1】zerotier - Securely connect any device, anywhere.

7. ZeroTier优化办法 - Moon节点

7.1 服务端配置

  • Step1:安装zerotier-one
# curl -s https://install.zerotier.com/ | sudo bash
  • Step2:加入自己的网络
# zerotier-cli join <Network ID>
  • Step3:生成moon.json文件
# cd  /var/lib/zerotier-one
# zerotier-idtool initmoon identity.public > moon.json
  • Step4:修改moon.json文件 //服务器,打开安全组,开放9993端口,采用UDP协议
# vi moon.json  //字段中修改:“stableEndpoints”: [“服务器的ip/9993”]
  • Step5:生成签名文件 //生成一个000000xxxxxxxxx.moon的文件
# zerotier-idtool genmoon moon.json
  • Step6:新建自己的moon节点配置
# mkdir moons.d
# mv 000000xxxxxxxxx.moon moons.d
# service zerotier-one restart  //之后重启服务器端B的Zerotier

7.2 客户端配置

  • Step1:下载配置文件
# scp usrname@ServerIP:/var/lib/zerotier-one/moons.d/000000xxxxxxxxx.moon .
  • Step2:前往zerotier安装目录 //window一般在 C:\ProgramData\ZeroTier\One
  • Step3:新建ZeroTier\One\moons.d目录,并复制00000xxxx.moon
  • Step4:重启windows服务
    在这里插入图片描述- Step5:查看moon服务器 //确认服务器(IP)和节点已经在列表中,表示成功
# zerotier-cli listpeers
  • Step6:查看ping延迟 //网络跳转越少,路线越短,性能越好。国内典型值在20ms左右。

在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://xiahunao.cn/news/3031240.html

如若内容造成侵权/违法违规/事实不符,请联系瞎胡闹网进行投诉反馈,一经查实,立即删除!

相关文章

订单管理系统(OMS):一文扫盲,订单的全生命周期管理

一、什么是OMS系统 OMS&#xff08;Order Management System&#xff09;即订单管理系统&#xff0c;是一种用于管理和处理订单的软件系统。它主要用于跟踪订单的生命周期&#xff0c;从订单的创建、处理、配送到最终的交付和结算。OMS系统在电子商务、零售、物流等领域广泛应…

[Kubernetes] 云原生 Istio 介绍

文章目录 1.Istio 介绍2.Istio 特征3.Istio 与服务治理4.Istio与Kubernetes4.1 Istio是Kubernetes的好帮手4.2 Kubernetes是Istio的好基座 5.Istio与服务网格5.1 时代选择服务网格5.2 服务网格选择Istio 1.Istio 介绍 服务网格是一个独立的基础设施层&#xff0c;用来处理服务之…

Web前端开发 小实训(三) 商品秒杀小练习

学生能够在本次实训中完成商品秒杀页面的基本逻辑 任务要求 能够实现某一个商品的秒杀&#xff0c;在倒计时结束后不再进行秒杀。 操作步骤 1、打开预设好的页面 <html><head><meta charset"utf-8"><title>秒杀</title><link …

若依生成树表和下拉框选择树表结构(在其他页面使用该下拉框输入)

1.数据库表设计 生成树结构的主要列是id列和parent_id列&#xff0c;后者指向他的父级 2.来到前端代码生成器页面 导入你刚刚写出该格式的数据库表 3.点击编辑&#xff0c;来到字段 祖籍列表是为了好找到直接父类&#xff0c;不属于代码生成器方法&#xff0c;需要后台编…

[js] 递归,数组对象根据某个值进行升序或者降序

一、效果图 1.1 父级 1.2 父级与子级 二、代码 升序降序&#xff0c;只要把 a.num - b.num 改成 b.num - a.num <html lang"en"><head><meta charset"UTF-8" /><meta name"viewport" content"widthdevice-width, i…

Apache Flume概述

Apache Flume概述 1.Flume定义 ​ Flume是cloudera(CDH版本的hadoop) 开发的一个分布式、可靠、高可用的海量日志收集系统。 它将各个服务器中的数据收集起来并送到指定的地方去&#xff0c;比如说送到HDFS、Hbase&#xff0c;简单来说flume就是收集日志的。 2.Flume基础架构…

读天才与算法:人脑与AI的数学思维笔记24_预测性文本生成器

1. 起源 1.1. 人类讲故事可能起源于“假如……”这种问答结构 1.2. 讲故事是人类做安全试验的一种方式 1.2.1. 如果你问一个人“假如……”&#xff0c;其实是在探索你的行为对他可能带来的影响 1.3. 最早出现的故事极有可能就源自我们对在周遭混乱的环境中寻找某种秩序的渴…

西门子PLC定时器使用与疑难杂症

一、简介 S7-200提供了256个定时器&#xff0c;依据分辨率分三种类型&#xff1a;1ms&#xff0c;10ms和100ms&#xff1b;依据功能分为接通延时定时器&#xff08;TON&#xff09;、有记忆的接通延时定时器&#xff08;TONR)和断开延时定时器&#xff08;TOF)。 接通延时定时…

【架构】MVC架构模式 三层架构

1 不使用MVC架构模式完成银行账户转账 <% page contentType"text/html;charsetUTF-8" language"java" %> <html><head><base href"${pageContext.request.scheme}://${pageContext.request.serverName}:${pageContext.request.…

多个.C文件被编译为一个可执行文件的详细过程

多个.C文件被编译为一个可执行文件的详细过程 文章目录 多个.C文件被编译为一个可执行文件的详细过程前言一、一个.C文件的编译过程二、多个.C文件的链接过程1.文件信息2.链接过程3.makefile 总结 前言 C语言经典的 “hello world ” 程序从编写、编译到运行&#xff0c;看到屏…

大型外企都在用的邮件大附件系统,究竟哪里好?

外企的业务往来复杂&#xff0c;内部沟通频繁&#xff0c;且普遍采用邮件作为沟通方式&#xff0c;外企一般使用的邮件系统多种多样&#xff0c;但其中一些较为常见和广泛使用的包括Zoho Mail和Outlook等。 Outlook作为微软旗下的全球主流电子邮件服务提供商之一&#xff0c;也…

GAME101-Lecture06学习

前言 上节课主要讲的是三角形的光栅化。重要的思想是要利用像素的中心对三角形可见性的函数进行采样。 这节课主要就是反走样。 课程链接&#xff1a;Lecture 06 Rasterization 2 (Antialiasing and Z-Buffering)_哔哩哔哩_bilibili 反走样引入 ​ 通过采样&#xff0c;得到…

Spring Boot集成activiti快速入门Demo

1.什么事activiti&#xff1f; Activiti是一个工作流引擎,可以将业务系统中复杂的业务流程抽取出来,使用专门的建模语言BPMN2.0进行定义,业务流程按照预先定义的流程进行执行,实现了系统的流程流activiti进行管理,减少业务系统由于流程变更进行系统升级改造的工作量,从而提高系…

2024全新小狐狸AI免授权源码

源码安装说明&#xff1a; 下 载 地 址 &#xff1a; runruncode.com/php/19757.html 1. 在宝塔新建一个站点&#xff0c;选择 PHP 版本为 7.2、7.3 或 7.4。将压缩包上传到站点的根目录&#xff0c;并设置运行目录为 /public。 2. 导入数据库文件&#xff0c;该文件位于 …

如何通过汽车制造供应商协同平台,提高供应链的效率与稳定性?

汽车制造供应商协同是指在汽车制造过程中&#xff0c;整车制造商与其零部件供应商之间建立的一种紧密合作的关系。这种协同关系旨在优化整个供应链的效率&#xff0c;降低成本&#xff0c;提高产品质量&#xff0c;加快创新速度&#xff0c;并最终提升整个汽车产业的竞争力。以…

Vue3专栏项目 -- 三、使用vue-router 和 vuex(上)

前面我们开发了两个页面的组件&#xff0c;现在我们需要把它们分成几个页面了&#xff0c;那么一个网页多个页面我们都熟悉&#xff0c;针对不同的url渲染不同的html静态页面&#xff0c;这是web世界的基本工作方式。 有时候我们点击一个东西&#xff0c;地址栏的路由跳转&…

二级等保与三级等保的区别有哪些

二级等保和三级等保的区别主要体现在保护能力、安全要求、监管严格程度等方面。以下是根据提供的搜索结果中关于二级和三级等保的具体差异&#xff1a; 1. 保护能力&#xff1a; 二级等保要求信息系统能够防护来自外部小型组织的威胁&#xff0c;发现重要的安全漏洞和事件&…

机器学习实战宝典:用scikit-learn打造智能应用

书接上文——《数据探险家的终极指南&#xff1a;用Python挖掘机器学习的奥秘》 前文我们在这段精彩的机器学习探险之旅中&#xff0c;从基础概念出发&#xff0c;深入探索了使用Python和scikit-learn库进行数据分析和模型构建的全过程。 我们首先了解了机器学习的基本原理&am…

Nextcloud私有云盘-重新定义云存储体验

Nextcloud私有云盘-重新定义云存储体验 1. 什么是Nextcloud ​ Nextcloud是一个开源的云存储和协作平台&#xff0c;旨在为个人用户、企业和团队提供安全、隐私保护的数据存储和共享解决方案。它允许您在不同设备之间同步、共享文件&#xff0c;提供了强大的协作工具和应用生…

上网卡免费领取,无成本,免费领,超暴力蓝海项目

随着短视频和直播的流行&#xff0c;对大流量电话卡的需求日益增加。我们提供100G-300G大流量电话卡&#xff0c;包含100多分钟语音通话&#xff0c;月费仅19-29元。这些都是三大运营商的靠谱已有号卡&#xff0c;全国免费领取并包邮到家。客户收到卡片后&#xff0c;可在线充值…