设为首页 收藏本站
查看: 22775|回复: 0

[经验分享] iperf3命令使用

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2016-9-20 10:38:06 | 显示全部楼层 |阅读模式
1,iperf3安装iperf3下载:https://iperf.fr/iperf-download.php#fedora
1
2
3
4
[iyunv@localhost home]# rpm -ivhiperf3-3.1.3-1.fc24.x86_64.rpm
Preparing...                         ################################# [100%]
Updating / installing...
  1:iperf3-3.1.3-1.fc24             ################################# [100%]



2,常用几种命令服务器端:
1
[iyunv@localhost home]# iperf3 –s



客户端:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[iyunv@localhost home]# iperf3 -c 192.168.0.222
Connecting to host 192.168.0.222, port 5201
[  4]local 192.168.0.221 port 47864 connected to 192.168.0.222 port 5201
[ ID] Interval           Transfer     Bandwidth       Retr Cwnd
[ 4]   0.00-1.00   sec  639 MBytes  5.36 Gbits/sec   86   366 KBytes      
[ 4]   1.00-2.00   sec  514 MBytes  4.31 Gbits/sec    0   393 KBytes      
[  4]   2.00-3.00  sec   570 MBytes  4.78 Gbits/sec   16   301 KBytes      
[ 4]   3.00-4.00   sec  605 MBytes  5.08 Gbits/sec    0   322 KBytes      
[ 4]   4.00-5.00   sec  555 MBytes  4.65 Gbits/sec    0   334 KBytes      
[ 4]   5.00-6.00   sec  581 MBytes  4.87 Gbits/sec    0   341 KBytes      
^C[ 4]   6.00-6.54   sec  284 MBytes  4.44 Gbits/sec    0   344 KBytes      
- - - - - - - - - - - - - - - - - - - - - -- - -
[ ID] Interval           Transfer     Bandwidth       Retr
[ 4]   0.00-6.54   sec 3.66 GBytes  4.81 Gbits/sec  102             sender
[ 4]   0.00-6.54   sec 0.00 Bytes  0.00 bits/sec                  receiver
iperf3: interrupt - the client hasterminated



解释:
默认情况客户端使用TCP协议
-s:指明是服务器端
-c: 指明是客户端
192.168.0.222为服务端IP地址

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[iyunv@localhost home]# iperf3 -u -c 192.168.0.222 -b 100M
Connecting to host 192.168.0.222, port 5201
warning: Unable to set socket pacing, usingapplication pacing instead
[  4]local 192.168.0.221 port 46516 connected to 192.168.0.222 port 5201
[ ID] Interval           Transfer     Bandwidth       Total Datagrams
[  4]  0.00-1.00   sec 10.8 MBytes  90.8 Mbits/sec  1386
[ 4]   1.00-2.00   sec 11.9 MBytes  99.7 Mbits/sec  1521
[ 4]   2.00-3.00   sec 11.9 MBytes   100 Mbits/sec  1526
[ 4]   3.00-4.00   sec 11.9 MBytes   100 Mbits/sec  1526
[ 4]   4.00-5.00   sec 11.9 MBytes   100 Mbits/sec  1528
^C[ 4]   5.00-5.38   sec 4.75 MBytes   104 Mbits/sec  608
- - - - - - - - - - - - - - - - - - - - - -- - -
[ ID] Interval           Transfer     Bandwidth       Jitter   Lost/Total Datagrams
[ 4]   0.00-5.38   sec 63.2 MBytes  98.5 Mbits/sec  0.000 ms 0/8095 (0%)
[  4]Sent 8095 datagrams
iperf3: interrupt - the client hasterminated



解释:
-u:指定是udp报文
-b:指定发送带宽大小。

服务器端:
1
[iyunv@localhost home]# iperf3 -s -p 2480



客户端:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
[iyunv@localhost home]# iperf3 -u -c 192.168.0.222 -b 100M -p 2480
Connecting to host 192.168.0.222, port 2480
warning: Unable to set socket pacing, usingapplication pacing instead
[  4]local 192.168.0.221 port 53812 connected to 192.168.0.222 port 2480
[ ID] Interval           Transfer     Bandwidth       Total Datagrams
[ 4]   0.00-1.00   sec 10.8 MBytes  90.6 Mbits/sec  1383
[ 4]   1.00-2.00   sec 11.9 MBytes  99.9 Mbits/sec  1524
[ 4]   2.00-3.00   sec 11.9 MBytes  99.9 Mbits/sec  1524
[ 4]   3.00-4.00   sec 12.0 MBytes   100 Mbits/sec  1530
^C[ 4]   4.00-4.06   sec 1.20 MBytes   167 Mbits/sec  154
- - - - - - - - - - - - - - - - - - - - - -- - -
[ ID] Interval           Transfer     Bandwidth       Jitter   Lost/Total Datagrams
[ 4]   0.00-4.06   sec 47.8 MBytes  98.7 Mbits/sec  0.000 ms 0/6115 (0%)
[  4]Sent 6115 datagrams
iperf3: interrupt - the client hasterminated



解释:
-p:指定端口

iperf3 –h 查看所有参数含义
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
[iyunv@localhost home]# 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 bandwidthreports
  -F,--file name           xmit/recv thespecified file
  -A,--affinity n/n,m      set CPU affinity
  -B,--bind      <host>    bind to a specific interface
  -V,--verbose             more detailedoutput
  -J,--json                output in JSONformat
--logfile f               sendoutput to a log file
  -d,--debug               emit debuggingoutput
  -v,--version             show versioninformation and quit
  -h,--help                show this messageand 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 clientconnection then exit
Client specific:
  -c,--client    <host>    run in client mode, connecting to<host>
  -u,--udp                 use UDP rather thanTCP
  -b,--bandwidth #[KMG][/#] target bandwidth in bits/sec (0 for unlimited)
                            (default 1 Mbit/secfor UDP, unlimited for TCP)
                            (optional slash andpacket 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 forTCP, 8 KB for UDP)
--cport         <port>    bind to a specific client port (TCP andUDP, default: ephemeral port)
  -P,--parallel  #         number of parallel client streams torun
  -R,--reverse             run in reverse mode(server sends, client receives)
  -w,--window    #[KMG]    set window size / socket buffer size
  -C,--congestion <algo>   set TCPcongestion control algorithm (Linux and FreeBSD only)
  -M,--set-mss   #         set TCP/SCTP maximum segment size (MTU- 40 bytes)
  -N,--no-delay            set TCP/SCTP nodelay, disabling Nagle's Algorithm
  -4,--version4            only use IPv4
  -6,--version6            only use IPv6
  -S,--tos N               set the IP 'type ofservice'
  -L,--flowlabel N         set the IPv6 flowlabel (only supported on Linux)
  -Z,--zerocopy            use a 'zero copy'method of sending data
  -O,--omit N              omit the first nseconds
  -T,--title str           prefix every outputline with this string
--get-server-output       getresults from server
--udp-counters-64bit      use64-bit counters in UDP test packets
--no-fq-socket-pacing     disablefair-queuing based socket pacing
                            (Linux only)
  
[KMG] indicates options that support aK/M/G suffix for kilo-, mega-, or giga-
  
iperf3 homepage at:http://software.es.net/iperf/
Report bugs to:     https://github.com/esnet/iperf






运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-274855-1-1.html 上篇帖子: Linux下查看网卡流量 下篇帖子: 如何在Linux下安装xs-tool.iso
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表