PCATTCP使用笔记——TCP UDP速度测试工具

0.PCATTCP简介

    PCATTCP的前身为Test TCP,Test TCP是BSD操作系统的原生工具,该工具通过控制台输入参数,用于测试TCP或者UDP的通信速度。该项目于1984年启动,现在该工具的源代码早已开放。PCATTCP是Test TCP的windows移植版本,是一个用于测试TCP和UDP通信速度的windows控制台程序。

1.PCTATCP的安装
【1】下载可执行文件和源代码包,下载网址
【2】解压可执行文件到某文件件,例如D:\tools
【3】把D:\tools加入环境变量PATH中

2.简单测试
    测试需要两台设备参与,开始之前需记录两台设备的IP地址。例如在本例中的两台设备。
    设备A 服务器端 IP地址为192.168.1.103
    设备B 客户端    IP地址为192.168.1.102
    其中设备A通过网线接入路由器,设备B通过Wifi接入路由器。

【设备A】控制台中输入
pcattcp -r -c
参数-r表示服务器端模式,该设备处于接收状态。
参数-c表示该设备工作于连续模式。
控制的输出入下图所示,从图中的反馈信息可以看出,pcattcp工作于5001端口。也可通过-p参数修改指定端口。

图1 设备A工作于服务器模式

【设备B】控制台中输入
pcattcp -t 192.168.1.103
-t 客户端模式,发送。

图2 设备B工作于客户端模式
    输入命令之后,PCATTCP工具通过网络发送一些列数据包,默认情况下,单个数据包的大小为8192,数据包的个数为2048。此时,从设备B到设备A的TCP传输速度为2311.71KB/s。

3.修改参数
    在一般测试过程中往往存在限制,例如数据包的长度的限制或者数据包个数的限制,此时便可利用-l和-n参数。
pcattcp -t -l 1024 -n 1024 192.168.1.103
-t 客户端模式,发送。
-l 被传输的数据包大小,此时单个数据包的长度为1024,默认大小为8192。
-n 发送数据包个数,此时重复数据包的个数为1024,默认数据包个数为2048。

图3 修改数据包长度和数据包个数

4.参考资料
【2】pcattcp指令活命
pcattcp -h

PCAUSA Test TCP Utility V2.01.01.13 (IPv4/IPv6)
       Usage: pcattcp -t [-4|-6] [-options] host [ < in ]
       pcattcp -r [-4|-6] [-options > out]
Common options:
   -4 use IPv4 (default)
   -6 use IPv6
   -l ## length of bufs read from or written to network (default 8192)
   -u use UDP instead of TCP
   -p ## port number to send to or listen at (default 5001)
            Can specify multiple sequential ports two ways:
            -p #first-#last
            -p #first+#additional
   -s toggle sinkmode (enabled by default)
            sinkmode enabled:
               -t: source (transmit) fabricated pattern
               -r: sink (discard) all received data
            sinkmode disabled:
               -t: reads data to be transmitted from stdin
               -r: writes received data to stdout
   -A align the start of buffers to this modulus (default 16384)
   -O start buffers at this offset from the modulus (default 0)
   -v verbose: print more statistics
   -d set SO_DEBUG socket option
   -b ## set socket buffer size (if supported)
   -f X format for rate: k,K = kilo{bit,byte}; m,M = mega; g,G = giga
   -c -t: send continuously
            -r: accept multiple connections sequentially
   -a bind to local host interface IP address
Options specific to -t:
   -n ## number of source bufs written to network (default 2048)
   -D don't buffer TCP writes (sets TCP_NODELAY socket option)
   -w ## milliseconds of delay before each write (default 0)
   -R ## desired transmit data rate in bytes/second
Options specific to -r:
   -M concurrent TCP/UDP multithreaded receiver
   -B for -s, only output full blocks as specified by -l (for TAR)
   -T "touch": access each byte as it's read


  • 2
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
PCAUSA Test TCP (PCATTCP) Release Notes Printing Communications Associates, Inc. 4201 Brunswick Court Smyrna, GA 30080 USA TEL: (770) 432-4580 FAX: (770) 436-7246 E-Mail: tdivine@pcausa.com ====================================================================== Component Part No.: N/A Component Name : PCAUSA Test TCP (PCATTCP) ====================================================================== Component Version : 2.01.01.11 Release Date : February 4, 2010 1.) Now flush stderr/stdout for all exit paths. ====================================================================== Component Version : 2.01.01.10 Release Date : November 3, 2009 1.) Added new -a option to specifiy local host IP address. 2.) Now built using Visual Studio 2008 (for better or worse...). ====================================================================== Component Version : 2.01.01.07 Release Date : November 23, 2003 1.) Incorporated fix identified by Clarkson University that reduces hangs when ending the UDP transmitter test. See additional comments in TTCP_TransmitUDP module. ====================================================================== Component Version : 2.01.01.06 Release Date : April 5, 2003 1.) Fixed minor bug in TTCP transmitter. PCAUSA PCATTCP preamble was not inserted correctly when building transmit buffer. ====================================================================== Component Version : 2.01.01.05 Release Date : May 31, 2002 1.) Modification to allow SO_RVCBUF and SO_SNDBUF values of zero(0) to be handled. Original implementation did not set these options if their value was zero. 2.) Added -w write delay option. ====================================================================== Component Version : 2.01.01.04 Release Date : May 30, 2002 1.) Minor fix to test exit routines. ====================================================================== Component Version : 2.01.01.03 Release Date : May 29, 2002 Externally Visible Differences ------------------------------ 1.) Added -c "continuous" option: -c -t: send continuously -r: accept multiple connections sequentially 1.) Added -R multi-threaded concurrent TCP/UDP receiver option. 2.) Fixed error codes. Now fetch using WSAGetLastError instead of perror. The latter did not handle socket errors. 3.) Revised test output messages. 4.) New PCATTCP.chm HtmlHelp documentation. Implementation Differences -------------------------- Extensive rework to suit author's style. ====================================================================== Component Version : 1.00.00.02 Release Date : January, 2000 Fix setting of setsockopt call for TCP_NODELAY. ====================================================================== Component Version : 1.00.00.01 Release Date : April, 1999 Initial release of PCAUSA's port of TTCP to Windows.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值