sipp使用秘笈-v1.2.doc_第1页
sipp使用秘笈-v1.2.doc_第2页
sipp使用秘笈-v1.2.doc_第3页
sipp使用秘笈-v1.2.doc_第4页
sipp使用秘笈-v1.2.doc_第5页
已阅读5页,还剩20页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Sipp测试工具使用文档 1. Sipp软件简介sipp是对sip协议进行性能测试的一款软件系统。sipp能够对远程系统发起一个或者多个呼叫。Sipp提供呼叫发起端(uac)和呼叫接收端(uas)的功能,通过呼叫完成对中间设备(TG等)的性能测试。sipp会根据xxx.xml场景描述文件来进行sip呼叫的建立、处理和释放。2. 使用前的准备(这里假设读者已经安装好了的sipp)考虑到测试时操作的方便性,因此写了几个批处理文件,封装内部细节,只须指定服务器的IP与端口即可进行测试。(约定 uac指定端口,uas占用5090端口,使用前请确定端口没占用)呼叫前请注意是否配置好了所需文件,如果您是第一次使用请首先参考第4节和第5节相关内容修改2.1. 系统相关修改1) 关闭系统防火墙,杀毒软件,下载程序以及其他跟网络相关的应用程序以防干扰测试。2) 添加ip 。有时候设备ip段和本机ip段不一样(本机ip段可能用于公网)那么只需要添加一个ip即可。添加方法:网上邻居-右键属性-本地连接-右键属性-选择Tcp/ip选择属性点击高级在ip地址那个框内,选择添加即可。3. 使用方法考虑到测试时操作的方便性,因此写了几个批处理文件,封装内部细节,只须指定服务器的IP与端口即可进行测试。(约定 uac占用5061端口,uas占用5090端口,使用前请确定这两个端口没占用)3.1. 注册:test.bat直接在sip的安装目录下点击test.bat3.2. 启动uas在弹出的对话框中输入uas(注明:uas是呼叫接收端,无需输入任何参数)3.3. 启动uacUac.bat hostip hostport 每秒呼叫个数 总呼叫个数例如:uac 172.16.55.201 5060 10 1000上面表示呼叫目标(配置中使用的TG)目标IP,172.16.55.201,对端端口5060,每秒发起呼叫10,总呼叫数目为1000 (注:uac后面的参数次序不能有错,必须按照此顺序进行) 3.4. 程序启动后的常用操作+ 呼叫速率加1- 呼叫速率减1* 呼叫速率加10/ 呼叫速率减10 暂停呼叫:按键盘上的p键来暂停呼叫,再次按p键则重新开始。停止呼叫:按键盘上的q键来停止呼叫。注意千万不要用Ctrl+c来强行终止程序,应该使用q键来停止程序,用q键停止程序后程序会发送bye消息来释放呼叫。如果强行停止会导致呼叫被吊死在设备上。高级进阶4. 命令修改 4.1. uas命令修改方法在弹出的dos命令行中输入uas即可。这样就启动了uas这是启动了uas.bat批处理文档实际启动命令如下:sipp -sn uas -p 5090 -sf uas.xml -inf call.csv -trace_err -trace_screenrem -s 2000可以看到监听端口为5090因此在TG的配置中对局端口应该填写为此端口,如果用户需要修改端口则修改uas.bat文件即可。-sn指定sipp启动的是uas服务既服务器端。-sf指定使用的场景文件为uas.xml . call.csv 这个主要是呼叫号码的文件,下文将会详细介绍。-trace_err跟踪所有错误消息,并把错误消息保存到文件场景文件描述的_errors.log文件中-trace_screen 当程序结束时候打印统计信息并弹出屏幕(如果在后台运行的话)4.2. uac命令修改方法uac启动启动方式同uas在dos中输入uac hostip hostport 每秒呼叫个数 总呼叫个数比如uac 172.16.55.204 5060 4 10000表示呼叫的目标主机是172.16.55.204 对方端口是5060 每秒发起4个呼叫,总呼叫数目为10000注:对本公司的TG测试中hostip就是指TG产品中配置的对局地址是本机IP地址的TG产品。如下为TG1000配置sip中继的窗口对局就是您现在所用电脑的ip地址。0如果作为呼出端也就是您启用uac这个命令,那么该TG配置端口为5060,或者5070都可以。但是如果您电脑作为呼叫接收端也就是启动uas命令,那么这里的ip地址填您自己的主机地址,端口需要填uas默认端口(5090),具体参考uas命令修改。实际启动文件为uac.bat这个批处理文档(注:rem 后面内容表示注释)实际启动命令为:sipp %1:%2 -sf uac.xml -inf call.csv -p 5070 -r %3 -rp 1s -m %4 -trace_err -trace_screen其中%1,%2为传递命令行参数第一个和第二个即uac 172.16.55.204-sf,-inf,-p 同上 -r指定每秒发起呼叫数(如果指定参数-rp则即为-rp所指定的时间内发起的呼叫数)rp 表示频率周期,即-r的周期。后面详述上例指定-rp为1s则-r就表示1s内发起的呼叫数目-m 指定测试的呼叫总数,当达到m指定的数目时候停止呼叫,程序结束5. 配置文件修改5.1. 被叫号码的修改主被叫号码放在文件xxx.csv文件中,从3.1节我们看到实际启动时候指定了-inf参数都默认指向了call.csv文件因此需要修改call.csv文件。call.csv文件第一行需要说明数据读取方式,SEQUENTIAL为顺序读取,RANDOM为随机读取,USER为用户习惯,#后面的内容为注释例如下面是截取一个call.csv文件的内容SEQUENTIAL81000;9129;10000;81001;9129;10001;81011;9129;10011;我们看到除了第一行,每一行都有三个字段。这就对应了场景文件中的field0,field1,field2如下截取uac.xml场景文件,假如是第一个呼叫,使用第二行!CDATA INVITE sip:field1对应9129remote_ip:remote_port SIP/2.0 Via: SIP/2.0/transport local_ip:local_port;branch=branch From: sipp;tag=call_number To: sut Call-ID: call_id CSeq: 1 INVITE Contact: sip:sipplocal_ip:local_port Max-Forwards: 70 Subject: Performance Test Content-Type: application/sdp Content-Length: len v=0 o=user1 53655765 2353687637 IN IPlocal_ip_type local_ip s=- c=IN IPlocal_ip_type local_ip t=0 0 m=audio field2对应10000 RTP/AVP 8 a=rtpmap:8 PCMA/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-11,16 从上可以看出,call.csv文件定义了sip协议中呼叫的号码和主叫号码,因此这个文件的配置相当重要,否则电话有可能拨不通,我们看field1字段,是填充在to中的,是要拨出去的电话号码,因此TG上的字冠设置应该与此字段项匹配。使用多个.csv文件如果你想使用几个文件配合使用,比如你想让field0的名字是顺序的,而field1得名字是随机的。使用两个文件就可以,你可能需要一个文件caller.csv使用SEQUENTIAL作为第一行,还需要一个callee.csv使用RANDOM作为第一行。在场景文件中用file=xxx.csv来指定所使用的文件如:INVITE sip:field0 file=callee.csv SIP/2.0From: sipp user ;tag=pidSIPpTag00call_numberTo: sut user .这样就从callee中选取目标用户,而从caller中选取发送用户。5.2. 呼叫过程使用RTP流uac.xml: (不传rtp流就注释下面这段)其中g711u_30s.pcap保存在同目录下的pcap文件夹下,可以修改指定的rtp流文件。这个是一个30s时间的rtp流。 注:xml的注释方法 5.3. 呼叫保持时间修改Uac.xml: /单位为ms5.4. 并发呼叫的最大次数修改使用-l选项设定同时呼叫的最大次数,能够对sip中继产生脉冲式压力测试。在uac.bat文件中添加此选项如下:未添加:sipp %1:%2 -sf uac.xml -inf call.csv -p 5070 -r %3 -rp 1s -m %4 -trace_err -trace_screen添加后:sipp %1:%2 -sf uac.xml -inf call.csv -p 5070 -l 120 -r %3 -rp 1s -m %4 -trace_err -trace_screen (可以添加在任何合适的位置)限制同时呼叫最大次数为120,当呼叫次数达到120的时候,新的呼叫不会继续。只有当呼叫降下来后才会开始新的呼叫。因此如果需要产生强烈的脉冲信号,必须让呼叫保持时间足够,并且每秒呼叫次数要提高,这样才能“瞬间达到最大值”。6. 呼叫结果分析上图显示了sip呼叫过程中的各个流程最上面的为统计消息,call-reate是呼叫的速率。Port为使用的端口Total-time为使用的时间Total-calls为呼叫的总数Remote-host为远程主机ip地址112calls 表示当前保持呼叫数目为1120,最大允许并发呼叫数目为330Peak was 117 calls,after 81s 表示81s内的峰值为30Unexpected-msg为不正常消息,也就是呼损发生了我们看到 100- 那一行Unexpected-msg数值为20则说明有呼损 呼叫结束后,按q键退出。 出现统计信息如下图:可以观察到成功呼叫个数和失败个数7. 其他帮助7.1. RTP流文件修改制作在测试过程中常常需要携带RTP流,此时需要有相应的RTP流文件。RTP流文件存放在sipp根目录下的pcap目录下。实际使用中需要不同时长的RTP文件,此时就需要修改时长。这里提供一种方法比如我们需要5s时长的RTP文件操作如下:使用wireshark打开一个已经存在的rtp流文件可以看到如下界面第一列是No,表示序号第二列是Time是时间标签我们现在需要5s的RTP流找到时间标签为4.9.xxxx的时间标签对应的NO,要记住现在选择文件-save as 弹出如下对话框 选择左下角选项,range在里面输入0-250输入文件名,保存就可以使用了(注:rtp流文件在sipp中被执行(只执行一次,文件传输完毕,除非sipp呼叫截止),并不包含在sip流程中,也就是说对pause呼叫保持时间不会产生任何的影响。而且实际传输中这个时间并不能保证精确。请测试时候注意)8. Sipp参数列表Usage: sipp remote_host:remote_port options Available options: -v : Display version and copyright information. -aa : Enable automatic 200 OK answer for INFO, UPDATE and NOTIFY messages. -auth_uri : Force the value of the URI for authentication. By default, the URI is composed of remote_ip:remote_port. -base_cseq : Start value of cseq for each call. -bg : Launch SIPp in background mode. -bind_local : Bind socket to local IP address, i.e. the local IP address is used as the source IP address. If SIPp runs in server mode it will only listen on the local IP address instead of all IP addresses. -buff_size : Set the send and receive buffer size. -calldebug_file : Set the name of the call debug file. -calldebug_overwrite: Overwrite the call debug file (default true). -cid_str : Call ID string (default %u-%p%s). %u=call_number, %s=ip_address, %p=process_number, %=% (in any order). -ci : Set the local control IP address -cp : Set the local control port number. Default is 8888. -d : Controls the length of calls. More precisely, this controls the duration of pause instructions in the scenario, if they do not have a milliseconds section. Default value is 0 and default unit is milliseconds. -deadcall_wait : How long the Call-ID and final status of calls should be kept to improve message and error logs (default unit is ms). -default_behaviors: Set the default behaviors that SIPp will use. Possbile values are: - allUse all default behaviors - noneUse no default behaviors - byeSend byes for aborted calls - abortunexpAbort calls on unexpected messages - pingreplyReply to ping requests If a behavior is prefaced with a -, then it is turned off. Example: all,-bye -error_file : Set the name of the error log file. -error_overwrite : Overwrite the error log file (default true). -f : Set the statistics report frequency on screen. Default is 1 and default unit is seconds. -fd : Set the statistics dump log report frequency. Default is 60 and default unit is seconds. -i : Set the local IP address for Contact:,Via:, and From: headers. Default is primary host IP address. -inf : Inject values from an external CSV file during calls into the scenarios. First line of this file say whether the data is to be read in sequence (SEQUENTIAL), random (RANDOM), or user (USER) order. Each line corresponds to one call and has one or more ; delimited data fields. Those fields can be referred as field0, field1, . in the xml scenario file. Several CSV files can be used simultaneously (syntax: -inf f1.csv -inf f2.csv .) -infindex : file field Create an index of file using field. For example -inf users.csv -infindex users.csv 0 creates an index on the first key. -ip_field : Set which field from the injection file contains the IP address from which the client will send its messages. If this option is omitted and the -t ui option is present, then field 0 is assumed. Use this option together with -t ui -l : Set the maximum number of simultaneous calls. Once this limit is reached, traffic is decreased until the number of open calls goes down. Default: (3 * call_duration (s) * rate). -log_file : Set the name of the log actions log file. -log_overwrite : Overwrite the log actions log file (default true). -lost : Set the number of packets to lose by default (scenario specifications override this value). -rtcheck : Select the retransmisison detection method: full (default) or loose. -m : Stop the test and exit when calls calls are processed -mi : Set the local media IP address (default: local primary host IP address) -master : 3pcc extended mode: indicates the master number -max_recv_loops : Set the maximum number of messages received read per cycle. Increase this value for high traffic level. The default value is 1000. -max_sched_loops : Set the maximum number of calsl run per event loop. Increase this value for high traffic level. The default value is 1000. -max_reconnect : Set the the maximum number of reconnection. -max_retrans : Maximum number of UDP retransmissions before call ends on timeout. Default is 5 for INVITE transactions and 7 for others. -max_invite_retrans: Maximum number of UDP retransmissions for invite transactions before call ends on timeout. -max_non_invite_retrans: Maximum number of UDP retransmissions for non-invite transactions before call ends on timeout. -max_log_size : What is the limit for error and message log file sizes. -max_socket : Set the max number of sockets to open simultaneously. This option is significant if you use one socket per call. Once this limit is reached, traffic is distributed over the sockets already opened. Default value is 50000 -mb : Set the RTP echo buffer size (default: 2048). -message_file : Set the name of the message log file. -message_overwrite: Overwrite the message log file (default true). -mp : Set the local RTP echo port number. Default is 6000. -nd : No Default. Disable all default behavior of SIPp which are the following: - On UDP retransmission timeout, abort the call by sending a BYE or a CANCEL - On receive timeout with no ontimeout attribute, abort the call by sending a BYE or a CANCEL - On unexpected BYE send a 200 OK and close the call - On unexpected CANCEL send a 200 OK and close the call - On unexpected PING send a 200 OK and continue the call - On any other unexpected message, abort the call by sending a BYE or a CANCEL -nr : Disable retransmission in UDP mode. -nostdin : Disable stdin. -p : Set the local port number. Default is a random free port chosen by the system. -pause_msg_ign : Ignore the messages received during a pause defined in the scenario -periodic_rtd : Reset response time partition counters each logging interval. -r : Set the call rate (in calls per seconds). This value can bechanged during test by pressing +,_,* or /. Default is 10. pressing + key to increase call rate by 1 * rate_scale, pressing - key to decrease call rate by 1 * rate_scale, pressing * key to increase call rate by 10 * rate_scale, pressing / key to decrease call rate by 10 * rate_scale. If the -rp option is used, the call rate is calculated with the period in ms given by the user. -rp : Specify the rate period for the call rate. Default is 1 second and default unit is milliseconds. This allows you to have n calls every m milliseconds (by using -r n -rp m). Example: -r 7 -rp 2000 = 7 calls every 2 seconds. -r 10 -rp 5s = 10 calls every 5 seconds. -rate_scale : Control the units for the +, -, *, and / keys. -rate_increase : Specify the rate increase every -fd units (default is seconds). This allows you to increase the load for each independent logging period. Example: -rate_increase 10 -fd 10s = increase calls by 10 every 10 seconds. -rate_max : If -rate_increase is set, then quit after the rate reaches this value. Example: -rate_increase 10 -rate_max 100 = increase calls by 10 until 100 cps is hit. -no_rate_quit : If -rate_increase is set, do not quit after the rate reaches -rate_max. -recv_timeout : Global receive timeout. Default unit is milliseconds. If the expected message is not received, the call times out and is aborted. -send_timeout : Global send timeout. Default unit is milliseconds. If a message is not sent (due to congestion), the call times out and is aborted. -sleep : How long to sleep for at startup. Default unit is seconds. -reconnect_close : Should calls be closed on reconnect? -reconnect_sleep : How long (in milliseconds) to sleep between the close and reconnect? -ringbuffer_files: How many error/message files should be kept after rotation? -ringbuffer_size : How large should error/message files be before they get rotated? -rsa : Set the remote sending address to host:port for sending the messages. -rtp_echo : Enable RTP echo. RTP/UDP packets received on port defined by -mp are echoed to their sender. RTP/UDP packets coming on this port + 2 are also echoed to their sender (used for sound and video echo). -rtt_freq : freq is mandatory. Dump response times every freq calls in the log file defined by -trace_rtt. Default value is 200. -s : Set the username part of the resquest URI. Default is service. -sd : Dumps a default scenario (embeded in the sipp executable) -sf : Loads an alternate xml scenario file. To learn more about XML scenario syntax, use the -sd option to dump embedded scenarios. They contain all the necessary help. -shortmessage_file: Set the name of the short message log file. -shortmessage_overwrite:

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论