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 客戶端配置
  • 8. DJI RC系統性能

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左右。

在這里插入圖片描述

8. DJI RC系統性能

DJI RC Pro features O3+ video transmission technology, capable of sending a 1080p/60fps live feed from up to 15 km away and latency as low as 120 ms.

在這里插入圖片描述

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/web/10136.shtml
繁體地址,請注明出處:http://hk.pswp.cn/web/10136.shtml
英文地址,請注明出處:http://en.pswp.cn/web/10136.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

Vue 中使用 el-date-picker 限制只能選擇當天、當天之前或當天之后日期的方法詳解

網上很多都是不完整的&#xff0c;我這里發布一個完整的 - 8.64e7 表示可選擇當天時間&#xff08;注&#xff1a;小于當前時間&#xff0c;- 8.64e7 則是禁用日期不包含當前日&#xff0c;若大于當前日期&#xff0c; 8.64e7 則是禁用日期包含當前日&#xff09; time.getTi…

c++ 讀寫鎖的理解

1.概要 讀寫鎖的理解 讀的時候&#xff0c;只要是讀的線程都不受限制&#xff0c;但不能寫。 寫的時候&#xff0c;線程獨占&#xff0c;任何寫和讀的線程都不可以。 最初我以為&#xff0c;只有限制寫就可以了&#xff0c;讀完全不受現在&#xff0c;但是有可能讀到不完整的…

【初始類和對象】(實例講解!超級詳細!)

【初始類和對象】 前言1. 面向對象的初步認知1.1什么是面向對象1.2 面向對象與面向過程 2. 類的定義和使用2.1 簡單認識類2.2 類的定義格式 3. 知識的代碼舉例講解3.1 創建類、實例化類3.2 構造方法初始化類、this 3. 總結 前言 由于類和對象是我們在學習過程中需要接受的概念…

AI賦能未來教育:中國教學科研新藍圖

設“人啊 前言 回顧過去&#xff0c;傳統的教育模式以知識灌輸和應試為主&#xff0c;雖培養出大量人才&#xff0c;但也存在著學生創新能力不足、實踐經驗缺乏等問題。隨著時代的進步和科技的發展&#xff0c;傳統教育模式已難以滿足當今社會對人才的需求。然而&#xff0c;當…

LoadIncrementalHFiles 流程和原理

目錄 1. HBase Bulk Load 簡介 2. 流程 3. 原理 4. 使用注意事項 5.補充說明之"什么是移動文件" 1. HBase Bulk Load 簡介 LoadIncrementalHFiles是用于HBase的Bulk Load工具&#xff0c;允許用戶高效地將大量數據直接加載到HBase表中&#xff0c;而不是使用傳…

中國現代十大杰出人物顏廷利:好的司機不如好的同機

找好‘同機’者, 要比找好‘司機’者, 原因就是, ‘司機’雖好, 但不是‘同路人’, 再多努力的攀附都是徒勞, 至于‘同機’者, 即便是對方在自己的眼里心中都一無是處, 只不過, 他/她才是您旅途之中, 真真正正、風雨同舟的人…(升命學說) 21世紀東方哲學家思想家、科學家、當代…

孩子學編程和不學編程的差距?

隨著信息技術的飛速發展&#xff0c;編程已經成為一項非常重要的技能&#xff0c;不僅僅是在計算機領域&#xff0c;而且在各個行業都有著廣泛的應用。因此&#xff0c;讓孩子學習編程已經成為很多家長的選擇。那么&#xff0c;孩子學習編程和不學習編程之間有哪些差距呢&#…

TODESK遠控快捷鍵在哪里

在當今高度數字化的世界中&#xff0c;遠程工作和協作已經成為日常生活和業務運營的重要組成部分。Todesk作為一款出色的遠程協作軟件&#xff0c;為用戶提供了諸多功能&#xff0c;以確保流暢、高效的遠程連接體驗。其中&#xff0c;快捷鍵功能極大地提升了用戶的操作便捷性。…

高速、簡單、安全的以太彩光,銳捷網絡發布極簡以太全光 3.X 方案

從 2021 年 3 月正式推出到現在&#xff0c;銳捷網絡極簡以太全光方案已經走進第四個年頭。IT 仍在不斷向前發展&#xff0c;數字化進程深入&#xff0c;數字化業務增多&#xff0c;更廣泛的終端設備接入企業級園區網絡&#xff0c;對園區網絡提出了更高的要求&#xff0c;例如…

GDB斷點執行的次數

需求背景&#xff1a;條件斷點可能執行多次&#xff0c;但是可能在最后一次執行引發了后續的問題&#xff0c;但是斷點位置并非問題現場&#xff0c;如何使得斷點在最后一次停下來&#xff1f; 方法&#xff1a; 1.首先設置條件斷點 (gdb) b (gdb) cond breakpoint_number…

Linux NFS共享目錄配置漏洞

Linux NFS共享目錄配置漏洞 一、實驗目的二、實驗原理三、復現準備四、漏洞復現4.1、復現前提4.2、正式復現 一、實驗目的 利用 NFS共享目錄配置漏洞讀取目標主機的 /etc/passwd 文件內容NFS 服務配置漏洞&#xff0c;賦予了根目錄遠程可寫權限&#xff0c;導致 /root/.ssh/au…

關系型數據庫VS非關系型數據庫

數據庫是存儲和組織數據的系統&#xff0c;主要分為兩大類&#xff1a; 關系型數據庫&#xff08;Relational Database Management Systems, RDBMS&#xff09; 非關系型數據庫&#xff08;NoSQL Databases&#xff09; 下面分別介紹這些類型及其區別&#xff1a; 關系型數…

im8mm 網絡卡死 Rx packets:1037578 errors:66 dropped:0 overruns:66 frame:0

1&#xff1a;網絡接收數據包異常 2&#xff1a;問題復現 問題在進行網絡數據包同吞吐量測試的時候出現的。同時發現&#xff0c;在使用iperf2測試時&#xff0c;是不會出現網絡中斷卡死的情況&#xff0c;使用 iperf3時才會出現此問題 指令(下面的指令運行在PC2上面&#xff…

AGV混合型電機驅動器|伺服控制器CNS-MI50H系列對電機的要求

混合型電機驅動器 CNS-MI50H系列涵蓋CNS-MI50HB-A、CNS-MI50HBN-A、CNS-MI50HDN-A、CNS-MI50HSN-A型號&#xff0c;專為 AGV 舵輪控制需求設計&#xff0c;集成舵輪轉向角度控制和驅動電機閉環控制。支持增量式編碼器&#xff0c;霍爾傳感器&#xff0c; 角度電位計&#xff0c…

自動化測試基礎 --- Jmeter

前置環境安裝 首先我們需要知道如何下載Jmeter 這里貼上下載網站Apache JMeter - Download Apache JMeter 我們直接解壓,然后在bin目錄下找到jemter.bat即可啟動使用 成功打開之后就是這個界面 每次打開可以用這種方式切換成簡體中文 或者直接修改properties文件修改對應的語言…

目標檢測算法YOLOv8簡介

YOLOv8論文尚未發布&#xff0c;YOLOv8由Ultralytics公司推出并維護&#xff0c;源碼見&#xff1a;https://github.com/ultralytics/ultralytics &#xff0c;于2024年1月發布v8.1.0版本&#xff0c;最新發布版本為v8.2.0&#xff0c;License為AGPL-3.0。 以下內容主要來自&am…

FFmpeg 中 -f 命令參數詳解

FFmpeg FFmpeg是一個開源的、功能強大的多媒體框架,它能夠處理幾乎所有格式的音頻和視頻文件。FFmpeg由Fabrice Bellard創立,并由Michael Niedermayer等人繼續開發。它包括了libavcodec(用于編解碼)、libavformat(用于格式轉換)、libavfilter(用于音視頻過濾)、libavd…

微信授權登錄01-PC端

目錄 ## 前言 1.準備工作 1.1 網站域名 1.2 微信開放平臺 2.授權授權登錄開發 2.1 前端開發 2.1.1 發起授權登錄跳轉至掃碼頁面 2.1.2 掃碼成功后回調處理 2.2 后端開發 2.2.1 根據code查詢用戶信息 2.2.2 自動注冊登錄 ## 后記 ## 前言 最近整了個AI助手網站&am…

React 學習-5

React 條件渲染: 與js中的寫法一致 注意&#xff1a;在 JavaScript 中&#xff0c;true && expression 總是返回 expression&#xff0c;而 false && expression 總是返回 false。 因此&#xff0c;如果條件是 true&#xff0c;&& 右側的元素就會被渲…

BL120協議Modbus RTU和Modbus TCP互轉

Modbus網關BL120是一款專注于Modbus協議之間相互轉換的通信設備。Modbus網關BL120支持多種下行采集協議&#xff0c;包括Modbus RTU和Modbus TCP&#xff0c;同時在上行轉發協議方面同樣支持Modbus RTU和Modbus TCP。Modbus網關為Modbus RTU和Modbus TCP協議的相互轉換提供了穩…