之前介绍的pingtraceroute能够测量网络的延迟以及节点间的跳数。

iperf能够提供更多的网络性能指标。系统中默认并没有安装该命令,可以通过发行版的包管理器自行安装。

实战演练

iperf必须安装在链路的两端(服务器端和客户端)。安装好之后,启动服务器端:

  1. $ yum install iperf3 -y
  2. $ iperf3 -s

然后运行客户端,生成吞吐量统计:

  1. $ iperf3 -c 192.168.1.36
  2. Client connecting to 192.168.1.36, TCP port 5001
  3. TCP window size: 19.3 KByte (default)
  4. [ 3] local 192.168.1.44 port 46526 connected with 192.168.1.36 port 5001
  5. [ ID] Interval Transfer Bandwidth
  6. [ 3] 0.0-10.0 sec 113 MBytes 94.7 Mbits/sec

选项-m会使得iperf找出最大传输单元(Maximum Transfer Size,MTU):

  1. $ iperf3 -mc 192.168.1.36
  2. Client connecting to 192.168.1.36, TCP port 5001
  3. TCP window size: 19.3 KByte (default)
  4. [ 3] local 192.168.1.44 port 46558 connected with 192.168.1.36 port 5001
  5. [ ID] Interval Transfer Bandwidth
  6. [ 3] 0.0-10.0 sec 113 MBytes 94.7 Mbits/sec
  7. [ 3] MSS size 1448 bytes (MTU 1500 bytes, ethernet)