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使用指南 的相关文章

  • LINGO使用指南(转载)

    LINGO是用来求解线性和非线性优化问题的简易工具 LINGO内置了一种建立最优化模型的语言 xff0c 可以简便地表达大规模问题 xff0c 利用LINGO高效的求解器可快速求解并分析结果 1 LINGO快速入门 当你在windows下开
  • IntelliJ使用指南—— 导入Eclipse的Web项目

    通常一个团队中可能有人用eclipse xff0c 有人用intelliJ xff0c 那么经常会出现需要导入别人用eclipse建好的web项目 而IntelliJ提供了多种项目类型的导入方式 xff0c 其中就有eclipse 在初始窗
  • fio使用指南

    这个文档是对fio 2 0 9 HOWTO文档的翻译 xff0c fio的参数太多了 xff0c 翻译这个文档时并没有测试每一个参数的功能和使用方法 xff0c 只有少量参数做了试验 xff0c 大部分的参数采用的是根据字面翻译或是个人理解
  • 【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
  • mysql使用指南

    目录 一 SQL简述1 SQL的概述2 SQL的优点3 SQL的分类 二 数据库的三大范式三 数据库的数据类型1 整数类型2 浮点数类型和定点数类型3 字符串类型4 字符串类型5 日期与时间类型 四 数据库 数据表的基本操作1 数据库的基本
  • 七牛云存储 CDN 使用指南

    七牛cdn 使用指南 更新于2016 3 13 分为两种情况 xff1a 1 使用七牛存储 2 直接使用七牛cdn 一 使用七牛存储 xff08 七牛的存储默认使用cdn加速 xff09 静态资源存储到七牛后 xff0c 可以使用七牛提供的
  • linux的netperf测试,linux下Netperf使用详解

    转载自 xff1a http blog sina com cn s blog 6b1ccd6501013119 html 首先下载 http www netperf org netperf DownloadNetperf html 安装 x
  • 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
  • 七牛cdn 使用指南

    七牛cdn 使用指南 更新于2016 3 12 分为两种情况 xff1a 1 使用七牛存储 2 直接使用七牛cdn 一 使用七牛存储 xff08 七牛的存储默认使用cdn加速 xff09 静态资源存储到七牛后 xff0c 可以使用七牛提供的
  • 使用Formik轻松开发更高质量的React表单(二)使用指南

    一个基本的例子 设想你要开发一个可以编辑用户数据的表单 不过 xff0c 你的用户API端使用了具有类似下面的嵌套对象表达 xff1a id string email string social facebook string twitte
  • 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
  • 通用环形缓冲区 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
  • STC-ISP使用指南

    该软件无需安装 xff0c 下载后打开直接用 本软件是专门给STC系列单片机下载烧录程序的 xff0c 并不能适用于ARM系列的单片机 界面介绍 xff1a 打开后的界面如下 xff1a 左边的部分一般是用来下载程序的 xff0c 右面一般
  • USB系列-LibUSB使用指南(1)-Windows下的报错与踩坑

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

随机推荐