网络性能测试工具iperf介绍

iperf3是一个强大的网络性能测试工具,可用于测试TCP和UDP的带宽性能。它提供了丰富的参数选项,如设置带宽、窗口大小、数据包长度等。在服务器端,通过`iperf3 -s`启动服务;在客户端,使用`iperf3 -c <主机>`连接到服务器进行测试。测试结果显示包括带宽、传输速率和丢包率等信息。
摘要由CSDN通过智能技术生成

说明

Iperf 是一个网络性能测试工具。Iperf可以测试最大TCP和UDP带宽性能,具有多种参数和UDP特性,可以根据需要调整,可以报告带宽、延迟抖动和数据包丢失。

用法介绍

# iperf3 -h
Usage: iperf [-s|-c host] [options]
       iperf [-h|--help] [-v|--version]

Server or Client:
  -p, --port      #         server port to listen on/connect to
  -f, --format    [kmgKMG]  format to report: Kbits, Mbits, KBytes, MBytes
  -i, --interval  #         seconds between periodic bandwidth reports
  -F, --file name           xmit/recv the specified file
  -A, --affinity n/n,m      set CPU affinity
  -B, --bind      <host>    bind to a specific interface
  -V, --verbose             more detailed output
  -J, --json                output in JSON format
  --logfile f               send output to a log file
  -d, --debug               emit debugging output
  -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
  -I, --pidfile file        write PID file
  -1, --one-off             handle one client connection then exit
Client specific:
  -c, --client    <host>    run in client mode, connecting to <host>
  -u, --udp                 use UDP rather than TCP
  -b, --bandwidth #[KMG][/#] target bandwidth in bits/sec (0 for unlimited)
                            (default 1 Mbit/sec for UDP, unlimited for TCP)
                            (optional slash and packet count for burst mode)
  -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, --len       #[KMG]    length of buffer to read or write
                            (default 128 KB for TCP, 8 KB 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)
  -w, --window    #[KMG]    set window size / socket buffer size
  -C, --congestion <algo>   set TCP congestion control algorithm (Linux and FreeBSD only)
  -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'
  -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              omit the first n seconds
  -T, --title str           prefix every output line with this string
  --get-server-output       get results from server
  --udp-counters-64bit      use 64-bit counters in UDP test packets
  --no-fq-socket-pacing     disable fair-queuing based socket pacing
                            (Linux only)

[KMG] indicates options that support a K/M/G suffix for kilo-, mega-, or giga-

iperf3 homepage at: http://software.es.net/iperf/
Report bugs to:     https://github.com/esnet/iperf

使用示例

服务端

例如:iperf3 -s

# iperf3 -s
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------

客户端

例如:iperf3 -c 127.0.0.1

iperf3 -c 127.0.0.1
Connecting to host 127.0.0.1, port 5201
[  4] local 127.0.0.1 port 49246 connected to 127.0.0.1 port 5201
[ ID] Interval           Transfer     Bandwidth       Retr  Cwnd
[  4]   0.00-1.00   sec   125 MBytes  1.04 Gbits/sec    0    639 KBytes
[  4]   1.00-2.01   sec   129 MBytes  1.08 Gbits/sec    0    639 KBytes
[  4]   2.01-3.00   sec   135 MBytes  1.14 Gbits/sec    0    639 KBytes
[  4]   3.00-4.00   sec   128 MBytes  1.07 Gbits/sec    0    639 KBytes
[  4]   4.00-5.00   sec   134 MBytes  1.12 Gbits/sec    0    639 KBytes
[  4]   5.00-6.00   sec   119 MBytes   997 Mbits/sec    0    639 KBytes
[  4]   6.00-7.00   sec   131 MBytes  1.10 Gbits/sec    0    639 KBytes
[  4]   7.00-8.01   sec   129 MBytes  1.08 Gbits/sec    0    639 KBytes
[  4]   8.01-9.01   sec   118 MBytes   983 Mbits/sec    0    639 KBytes
[  4]   9.01-10.01  sec   134 MBytes  1.13 Gbits/sec    0    639 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Retr
[  4]   0.00-10.01  sec  1.25 GBytes  1.07 Gbits/sec    0             sender
[  4]   0.00-10.01  sec  1.25 GBytes  1.07 Gbits/sec                  receiver

iperf Done.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值