IPerf简单使用

迷南。 2021-09-19 11:46 551阅读 0赞

一 点睛

1 IPerf是一个服务器/客户端运行的程序

2 在服务器端运行iPerf,也需要在客户端运行IPerf。

3 服务器端,在命令行下使用iperf加参数-s。

4 客户端,在命令行下使用iperf加参数-c。

5 经过一段时间测试(默认10秒),在Server端和Client端就会打印出网络连接的各种性能参数。

二 实战

1 准备服务器和客户端

服务器:192.168.0.110

客户端:192.168.0.120

2 确保服务器和客户端都关闭了防火墙

  1. [root@localhost iperf-1.7.0]# firewall-cmd --state
  2. not running

3 启动服务端

  1. [root@localhost iperf-1.7.0]# iperf -s
  2. ------------------------------------------------------------
  3. Server listening on TCP port 5001
  4. TCP window size: 85.3 KByte (default)
  5. ------------------------------------------------------------

4 运行客户端

  1. [root@localhost iperf-1.7.0]# iperf -c 192.168.0.110
  2. ------------------------------------------------------------
  3. Client connecting to 192.168.0.110, TCP port 5001
  4. TCP window size: 85.0 KByte (default)
  5. ------------------------------------------------------------

5 此时服务端打印如下

  1. [root@localhost iperf-1.7.0]# iperf -s
  2. ------------------------------------------------------------
  3. Server listening on TCP port 5001
  4. TCP window size: 85.3 KByte (default)
  5. ------------------------------------------------------------
  6. [ 4] local 192.168.0.110 port 5001 connected with 192.168.0.120 port 39046

6 使用帮助

  1. [root@localhost iperf-1.7.0]# iperf -h
  2. Usage: iperf [-s|-c host] [options]
  3. iperf [-h|--help] [-v|--version]
  4. Client/Server:
  5. -f, --format [kmKM] format to report: Kbits, Mbits, KBytes, MBytes
  6. -i, --interval # seconds between periodic bandwidth reports
  7. -l, --len #[KM] length of buffer to read or write (default 8 KB)
  8. -m, --print_mss print TCP maximum segment size (MTU - TCP/IP header)
  9. -p, --port # server port to listen on/connect to
  10. -u, --udp use UDP rather than TCP
  11. -w, --window #[KM] TCP window size (socket buffer size)
  12. -B, --bind <host> bind to <host>, an interface or multicast address
  13. -C, --compatibility for use with older versions does not sent extra msgs
  14. -M, --mss # set TCP maximum segment size (MTU - 40 bytes)
  15. -N, --nodelay set TCP no delay, disabling Nagle's Algorithm
  16. -V, --IPv6Version Set the domain to IPv6
  17. Server specific:
  18. -s, --server run in server mode
  19. -D, --daemon run the server as a daemon
  20. Client specific:
  21. -b, --bandwidth #[KM] for UDP, bandwidth to send at in bits/sec
  22. (default 1 Mbit/sec, implies -u)
  23. -c, --client <host> run in client mode, connecting to <host>
  24. -d, --dualtest Do a bidirectional test simultaneously
  25. -n, --num #[KM] number of bytes to transmit (instead of -t)
  26. -r, --tradeoff Do a bidirectional test individually
  27. -t, --time # time in seconds to transmit for (default 10 secs)
  28. -F, --fileinput <name> input the data to be transmitted from a file
  29. -I, --stdin input the data to be transmitted from stdin
  30. -L, --listenport # port to recieve bidirectional tests back on
  31. -P, --parallel # number of parallel client threads to run
  32. -T, --ttl # time-to-live, for multicast (default 1)
  33. Miscellaneous:
  34. -h, --help print this message and quit
  35. -v, --version print version information and quit
  36. [KM] Indicates options that support a K or M suffix for kilo- or mega-
  37. The TCP window size option can be set by the environment variable
  38. TCP_WINDOW_SIZE. Most other options can be set by an environment variable
  39. IPERF_<long option name>, such as IPERF_BANDWIDTH.
  40. Report bugs to <dast@nlanr.net>

发表评论

表情:
评论列表 (有 0 条评论,551人围观)

还没有评论,来说两句吧...

相关阅读

    相关 mininet iperf

    使用iperf可以在mininet两个主机之间进行发送和接受包的测试以及带宽的测试: 使用ifstat测试两个主机的带宽: ![在这里插入图片描述][watermark

    相关 IPerf简单使用

    一 点睛 1 IPerf是一个服务器/客户端运行的程序 2 在服务器端运行iPerf,也需要在客户端运行IPerf。 3 服务器端,在命令行下使用iperf加参数-s。