netperf使用指南

2023-05-16

netperf使用笔记

netperf 是一种非常常见的测量网络带宽的工具,其安装非常简单:
1. 下载netperf包
2. 进入netperf目录,./configure
3. make
4. make install
netperf是一个C/S软件,进行test的时候画风是这样的:
netperf -H 172.18.11.203 -t TCP_STREAM -- -m 64B,64B
Usage: netperf [global options] -- [test options] 

Global options:
    -a send,recv      Set the local send,recv buffer alignment
    -A send,recv      Set the remote send,recv buffer alignment
    -B brandstr       Specify a string to be emitted with brief output
    -c [cpu_rate]     Report local CPU usage
    -C [cpu_rate]     Report remote CPU usage
    -d                Increase debugging output
    -D time,[units] * Display interim results at least every time interval
                      using units as the initial guess for units per second
                      A negative value for time will make heavy use of the
                      system's timestamping functionality
    -f G|M|K|g|m|k    Set the output units
    -F lfill[,rfill]* Pre-fill buffers with data from specified file
    -h                Display this text
    -H name|ip,fam *  Specify the target machine and/or local ip and family
    -i max,min        Specify the max and min number of iterations (15,1)
    -I lvl[,intvl]    Specify confidence level (95 or 99) (99) 
                      and confidence interval in percentage (10)
    -j                Keep additional timing statistics
    -l testlen        Specify test duration (>0 secs) (<0 bytes|trans)
    -L name|ip,fam *  Specify the local ip|name and address family
    -o send,recv      Set the local send,recv buffer offsets
    -O send,recv      Set the remote send,recv buffer offset
    -n numcpu         Set the number of processors for CPU util
    -N                Establish no control connection, do 'send' side only
    -p port,lport*    Specify netserver port number and/or local port
    -P 0|1            Don't/Do display test headers
    -r                Allow confidence to be hit on result only
    -s seconds        Wait seconds between test setup and test start
    -S                Set SO_KEEPALIVE on the data connection
    -t testname       Specify test to perform
    -T lcpu,rcpu      Request netperf/netserver be bound to local/remote cpu
    -v verbosity      Specify the verbosity level
    -W send,recv      Set the number of send,recv buffers
    -v level          Set the verbosity level (default 1, min 0)
    -V                Display the netperf version and exit
    -y local,remote   Set the socket priority
    -Y local,remote   Set the IP_TOS. Use hexadecimal.
    -Z passphrase     Set and pass to netserver a passphrase

-d 在debug的时候还是很有用的。。。
不过netperf在测latency的时候不是很方便,在netperf 2.5.0之后,将一部分代码迁移到了`src/nettest_omni.c'中,能够选择统计包括latency在内的指标。
命令的画风是这样的:
netperf-H 172.18.28.10 -t omni -- -T tcp -d rr-r 64B,64B -O "THROUGHPUT, THROUGHPUT_UNITS, MIN_LATENCY,MAX_LATENCY, MEAN_LATENCY, REQUEST_SIZE, RESPONSE_SIZE,STDDEV_LATENCY"
真是醉了。。。
输入选项是这样的:
-c This explicitly declares that the test is to include connection establishment and tear-down as in either a TCP CRR or TCP CC test.
-d <direction> This option sets the direction of the test relative to the netperf process. As of version 2.5.0 one can use the following in a case-insensitive manner:
send, stream, transmit, xmit or 2
Any of which will cause netperf to send to the netserver.
recv, receive, maerts or 4
Any of which will cause netserver to send to netperf.
rr or 6 Either of which will cause a request/response test.
Additionally, one can specify two directions separated by a '|' character and
they will be OR'ed together. In this way one can use the "Send|Recv" that will be emitted by the
Section 9.3.1 [Omni Output Selectors], page 51 Section 9.3 [Omni Output Selection], page 50 when used with a request/response test.
-k [Section 9.3 [Omni Output Selection], This option sets the style of output to \keyval" where each line of output has the form:
key=value
For example:
$ netperf -t omni -- -d rr -k "THROUGHPUT,THROUGHPUT_UNITS"
OMNI TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to localhost.localdomain (127.0.0.1) THROUGHPUT=59092.65
THROUGHPUT_UNITS=Trans/s
Using the `-k' option will override any previous, test-speci c `-o' or `-O' option.

还有好多好多啊,此处省略一万字。。。
输出选项是这样的:
OUTPUT_NONE
This is essentially a null output. For `-k' output it will simply add a line that reads \OUTPUT NONE=" to the output. For `-o' it will cause an empty column" to be included. For `-O' output it will cause extra spaces to separate
real" output.
SOCKET_TYPE
This will cause the socket type (eg SOCK STREAM, SOCK DGRAM) for the data connection to be output.
PROTOCOL This will cause the protocol used for the data connection to be displayed.
DIRECTION
This will display the data  ow direction relative to the netperf process. Units: Send or Recv for a unidirectional bulk-transfer test, or Send|Recv for a request/response test.
ELAPSED_TIME
This will display the elapsed time in seconds for the test.
THROUGHPUT
This will display the throughput for the test. Units: As requested via the global `-f' option and displayed by the THROUGHPUT UNITS 
output selector.
THROUGHPUT_UNITS
This will display the units for what is displayed by the THROUGHPUT output selector.
LSS_SIZE_REQ
This will display the local (netperf) send socket bu er size (aka SO SNDBUF) requested via the command line. Units: 
Bytes.

还有一堆一堆又一堆。。。不写了,大家去看netperf文档吧!

有的时候,netperf会突然出现连接不上的bug:

establish control:are you sure there is a netserver listening on 172.18.11.203 at port 12865?
establish_control could not establish the control connection from 0.0.0.0 port0 address family AF_UNSPEC to 172.18.11.203 port 12865 address familyAF_INET

想了两个小时啊,我关闭了firewall.service,又尝试了其他端口,以及其他的地址,最后怀疑是不是端口被屏蔽了。。。尝试了一下:

sudo iptables -IINPUT 1 -p tcp --dport 12865 -j ACCEPT

好像真的是这样,晕!

那看来是iptables的锅。。。关闭iptables:

sudo serviceiptables stop

再次尝试,终于能连接上了!!!

我的启示是:以后一定要先把防火墙firewall.service和iptables先关掉!!!

最后再次致敬netperf文档!
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

netperf使用指南 的相关文章

  • 【Linux】Ubuntu 使用指南

    content 1 换清华源2 更新三步走3 1 换清华源 备份 Ubuntu 的软件源配置文件 etc apt sources list span class token function sudo span span class tok
  • netperf使用笔记

    一 netperf是什么 netperf是一个基于client server模式的网络测试工具 xff0c 可以测量TCP和UDP传输的吞吐量 时延 CPU占用率等性能参数 它可以测试以下几种模式的TCP核UDP网络性能 xff1a TCP
  • 性能测试工具iPerf和Netperf使用介绍

    实验教程 任务目的 1 掌握iPerf的功能和基本命令 xff0c 利用iPerf测试主机之间的吞吐量 xff0c 熟悉基本命令参数的作用 xff0c 为后期实验做准备 2 掌握Netperf的功能和基本命令 xff0c 能够根据不同的测试
  • mysql使用指南

    目录 一 SQL简述1 SQL的概述2 SQL的优点3 SQL的分类 二 数据库的三大范式三 数据库的数据类型1 整数类型2 浮点数类型和定点数类型3 字符串类型4 字符串类型5 日期与时间类型 四 数据库 数据表的基本操作1 数据库的基本
  • ubuntu-desktop 设置为默认桌面_WSL 使用指南——05 自定义桌面环境

    WSL 使用指南 05 自定义桌面环境 当我们完成安装桌面环境后 xff0c 我们或许希望改变一成不变的桌面环境UI xff0c 不过在尝试通过系统设置美化UI时 xff0c 我们会发现这并不起作用 对于这个问题 xff0c 我们的解决方案
  • netperf使用指南

    netperf使用笔记 netperf 是一种非常常见的测量网络带宽的工具 xff0c 其安装非常简单 xff1a 1 下载netperf包 2 进入netperf目录 xff0c configure 3 make 4 make insta
  • Github使用指南(持续更新中)

    一 简介 Github的网页端是www github com GitHub是一个面向开源及私有软件项目的托管平台 xff0c 因为只支持Git作为唯一的版本库格式进行托管 xff0c 故名GitHub GitHub于2008年4月10日正式
  • Github使用指南

    文章目录 注册成为用户GitHub功能及常用词汇板块说明Your profile使用仓库上传资源查找资源 注册成为用户 首次使用GitHub并准备长期使用需要先注册 xff0c 当然也可以以游客的方式进行浏览 登录官网GitHub Wher
  • mask rcnn使用指南

    做姿态估计的小伙伴们肯定经常用检测器 xff0c 为了方便大家 xff0c 这里给出一个很方便的教程 让大家快速上手 xff0c 不用再纠结配置环境 xff01 欢迎加入我们的姿态估计群 xff1a 970029323 xff08 xff1
  • Podman 使用指南

    原文链接 xff1a Podman 使用指南 Podman 原来是 CRI O 项目的一部分 xff0c 后来被分离成一个单独的项目叫 libpod Podman 的使用体验和 Docker 类似 xff0c 不同的是 Podman 没有
  • Idea使用指南

    安装 只选一个X64 xff0c 其余一路next 使用 xff1a
  • 通用环形缓冲区 LwRB 使用指南

    什么是 LwRB xff1f LwRB 是一个开源 通用环形缓冲区库 xff0c 为嵌入式系统进行了优化 源码点击这里 Github LwRB 特性 使用 ANSI C99 编写FIFO xff08 先进先出 xff09 无动态内存分配 x
  • 【MATLAB UAV Toolbox】使用指南(二)

    可视化和回放MAVLink飞行日志 这个例子将展示如何将包含MAVLink包的遥测日志 xff08 TLOG xff09 加载进MATLAB 提取的详细信息用来绘图 然后再次仿真飞行 xff0c 这些消息通过MAVLink通信接口重新发布
  • CMakeList.txt使用指南

    cmake minimum required 设置所需的最低cmake版本 cmake minimum required VERSION major minor patch tweak FATAL ERROR execute process
  • USB系列-LibUSB使用指南(1)-Windows下的报错与踩坑

    成就更好的自己 时隔一年再次开始撰写博客 xff0c 这一年的时间经历了很多 xff0c 现在终于稳定下来 以后很长一段时间都能够稳定的学习和更新 时间将会聚焦于USB和PCIe的开发进行 xff0c 能和大家共同进步真的很高兴 本篇为US
  • Podman 使用指南

    原文链接 xff1a Podman 使用指南 Podman 原来是 CRI O 项目的一部分 xff0c 后来被分离成一个单独的项目叫 libpod Podman 的使用体验和 Docker 类似 xff0c 不同的是 Podman 没有
  • JavaParser使用指南

    抱歉这个博客是很久以前写的 xff0c 现在我已经不用javaparser了 xff0c 这个包也一直在更新所以这篇博客参考意义不大 大家可以根据官网的例子去试试 JavaParser使用指南 前言入门 StartJavaParser Cl
  • iperf3 使用指南

    iperf3的参数 xff1a s表示做服务器 c表示做客户端 t 表示表示发送时间 i 表示间隔多久报告一次 u 表示UDP xff0c 不加表示tcp R 表示服务器发客户端收 xff0c 不加默认客户端发 xff0c 服务器收 f 表
  • 【MATLAB UAV Toolbox】使用指南(三)

    可视化自定义飞行日志 通过配置flightLogSignalMapping可从自定义的飞行日志中可视化数据 加载自定义的飞行日志 在本例中 xff0c 假设飞行数据已经被解析到MATLAB 中 xff0c 并存储为M文件 本示例重点介绍如何
  • QLExpression学习使用教程

    文章目录 QLExpress 简介 支持特性 Maven引入 例子github源码 图分解 提示 例子 初次使用 Runner执行器设置 执行器执行命令的设置 支持普通的Java语法执行 运算符支持 运算符分类 示例 部分运算符列举 样例使

随机推荐