前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Net之iperf3

Net之iperf3

作者头像
Taishan3721
发布2024-03-26 11:01:35
880
发布2024-03-26 11:01:35
举报
文章被收录于专栏:这里只有VxWorks这里只有VxWorks

除了之前的socket performance test tool,Vx7 24.03还集成了iperf-3.14

http://software.es.net/iperf/

iperf3这个网络带宽测量工具,支持TCPUDPSCTP。跑了一下,不麻烦

先在VSB里使能Layer IPERF3

VIP里include组件INCLUDE_IPERF3,如果使用cmd的话,可以把INCLUDE_IPERF3_CMD也加上

启动target,先看一下help

代码语言:javascript
复制
-> iperf3 "-h"
Usage: iperf3 [-s|-c host] [options]
       iperf3 [-h|--help] [-v|--version]
Server or Client:
  -p, --port      #         server port to listen on/connect to
  -f, --format   [kmgtKMGT] format to report: Kbits, Mbits, Gbits, Tbits
  -i, --interval  #         seconds between periodic throughput reports
  -I, --pidfile file        write PID file
  -F, --file name           xmit/recv the specified file
  -B, --bind      <host>    bind to the interface associated with the address <host>
  -V, --verbose             more detailed output
  -J, --json                output in JSON format
  --logfile f               send output to a log file
  --forceflush              force flushing output at every interval
  --timestamps<=format>     emit a timestamp at the start of each output line (optional "=" and format string as per strftime(3))
  --rcv-timeout #           idle timeout for receiving data (default 120000 ms)
  -d, --debug[=#]           emit debugging output (optional optional "=" and debug level: 1-4. Default is 4 - all messages)
  -v, --version             show version information and quit
  -h, --help                show this message and quit
Server specific:
  -s, --server              run in server mode
  -D, --daemon              run the server as a daemon
  -1, --one-off             handle one client connection then exit
  --server-bitrate-limit #[KMG][/#]   server's total bit rate limit (default 0 = no limit) (optional slash and number of secs interval for averaging total data rate.  Default is 5 seconds)
  --idle-timeout #          restart idle server after # seconds in case it got stuck (default - no timeout)
Client specific:
  -c, --client <host>[%<dev>] run in client mode, connecting to <host> (option <dev> equivalent to `--bind-dev <dev>`)
  -u, --udp                 use UDP rather than TCP
  --connect-timeout #       timeout for control connection setup (ms)
  -b, --bitrate #[KMG][/#]  target bitrate in bits/sec (0 for unlimited) (default 1 Mbit/sec for UDP, unlimited for TCP) (optional slash and packet count for burst mode)
  --pacing-timer #[KMG]     set the timing for pacing, in microseconds (default 1000)
  -t, --time      #         time in seconds to transmit for (default 10 secs)
  -n, --bytes     #[KMG]    number of bytes to transmit (instead of -t)
  -k, --blockcount #[KMG]   number of blocks (packets) to transmit (instead of -t or -n)
  -l, --length    #[KMG]    length of buffer to read or write (default 128 KB for TCP, dynamic or 1460 for UDP)
  --cport         <port>    bind to a specific client port (TCP and UDP, default: ephemeral port)
  -P, --parallel  #         number of parallel client streams to run
  -R, --reverse             run in reverse mode (server sends, client receives)
  --bidir                   run in bidirectional mode. Client and server send and receive data.
  -w, --window    #[KMG]    set send/receive socket buffer sizes (indirectly sets TCP window size)
  -M, --set-mss   #         set TCP/SCTP maximum segment size (MTU - 40 bytes)
  -N, --no-delay            set TCP/SCTP no delay, disabling Nagle's Algorithm
  -4, --version4            only use IPv4
  -6, --version6            only use IPv6
  -S, --tos N               set the IP type of service, 0-255. The usual prefixes for octal and hex can be used, i.e. 52, 064 and 0x34 all specify the same value.
  --dscp N or --dscp val    set the IP dscp value, either 0-63 or symbolic. Numeric values can be specified in decimal, octal and hex (see --tos above).
  -L, --flowlabel N         set the IPv6 flow label (only supported on Linux)
  -Z, --zerocopy            use a 'zero copy' method of sending data
  -O, --omit N              perform pre-test for N seconds and omit the pre-test statistics
  -T, --title str           prefix every output line with this string
  --extra-data str          data string to include in client and server JSON
  --get-server-output       get results from server
  --udp-counters-64bit      use 64-bit counters in UDP test packets
  --repeating-payload       use repeating pattern in payload, instead of randomized payload (like in iperf2)

把当前target当做server,启动iperf3,监听端口10000

代码语言:javascript
复制
sp iperf3, "-s -B 192.168.11.111 -p 10000"

使用这个image,再启动一个target,当作client,使用TCP测试网速

代码语言:javascript
复制
sp iperf3,"-c 192.168.11.111 -t 10 -p 10000 -i 2 -l 64 -f m -P 1 -N"

保持这个server不动,在client使用UDP再测试一次

代码语言:javascript
复制
sp iperf3,"-c 192.168.11.111 -u -t 10 -p 10000 -i 2 -b 0 -l 512 -f m"

上文用的是Kernel Mode,这个iperf3也支持User Mode,使用$(VSB)\usr\root\llvm\bin\iperf3.vxe即可,参数都是一样的

有时间把这个iperf3移植到低版本上试试!

本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2024-03-25,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 这里只有VxWorks 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
腾讯云服务器利旧
云服务器(Cloud Virtual Machine,CVM)提供安全可靠的弹性计算服务。 您可以实时扩展或缩减计算资源,适应变化的业务需求,并只需按实际使用的资源计费。使用 CVM 可以极大降低您的软硬件采购成本,简化 IT 运维工作。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档