1、SIPp是一个测试SIP协议性能的工具软件。这是一个GPL的开放源码软件。 它包含了一些基本的用户代理工作流程(UAC和UAS),并可使用INVITE和B YE建立和释放多个呼叫。它也可以读XML的场景文件,即描述任何性能测试的配置文件。它能动态显示测试运行的统计数据(呼叫速率、信号来回的延迟,以及消息统计)。周期性地把CSV统计数据转储,在多个套接字上的TCP和UDP,利用重新传输管理的多路复用。在场景定义文件中可以使用正规表达式,动态调整呼叫速率。SIPp可以用来测试许多真实的SIP设备,如SIP代理,B2BUAs,SIP媒体服务器,SIP/x网关,SIP PBX,等等,它也可以模仿上千个
2、SIP代理呼叫你的SIP系统。2 安装四种安装方法(本文使用第四种安装):1. 没有TLS支持与密码验证支持# tar -xvf sipp-xxx.tar.gz# cd sipp-xxx# makeMake出来的sipp文件就是一个可执行的文件,只需要搭配场景xml文件与csv文件即可进行SIP测试2. 拥有TLS支持与密码验证支持,但是不支PCAP语音播放# make ossl这样编译出来的文件就加入了TLS至于与密码验证支持功能sipp软件了。3. 支持PCAP Play,但是没有密码验证支持:(PCAP Play即为可以进行RTP语音,但是没有407 AUTH验证)# make pcap
3、play4. 支持PCAP 声音文件播放,而且支持密码验证支持:(支持407 auth验证支持)# tar -xvf sipp-xxx.tar# make pcapplay_ossl3 使用方法./sipp -sf reg.xml -inf reg.csv -p 6077 -i -m 4 :5060-sf 读取场景文件-inf 读取csv文件-p 本机采用端口-i 本机IP-m 要进行压力测试的次数Ip address of registrar 要进行压力测试的IP地址4 情景Uac(192.216.2.224) Asterisk(192.216.224.183) Uas4.1 注册模拟若干个
4、注册包到asterisk,asterisk回 100 tring和401 authentication,SIPp发送invite带auth验证消息到asterisk,asterisk回100 tring 和200 ok。4.1.1 测试./sipp -r 1 -l 1 -sf reg.xml -inf test.csv 192.216.224.1834.1.2 reg.xml!DOCTYPE scenario SYSTEM sipp.dtd- This program is free software; you can redistribute it and/or - modify it un
5、der the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty
6、of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the - Free Software Foundation, Inc., - 59 Temple Place, Suite 330, Boston,
7、 MA 02111-1307 USA - Sipp default branchc scenario. - 首先发送SIP注册消息,Register。里面的From与To是注册的号码 -scenario name=branch_client send retrans=500CDATA REGISTER sip:remote_ip SIP/2.0 Via: SIP/2.0/transport local_ip:local_port;branch=branch From: field0 ;tag=call_number To:field0remote_ip:remote_port Call-ID:
8、 call_id CSeq: 1 REGISTER Contact: sip:local_port Content-Length: 0 Expires: 300 /sendrecv response=100 optional=true/recv- SIPp会收到来自AST要求验证的401 消息体,Recv意思为Receive,接收到来自AST的401要求验证的消息,Next为如果收到401,那么转至Label为1的地方进行操作 -401 auth= next=1- send invite with authentication messages - 开始发送Register消息,里面将把验证的
9、密码消息发送给对方,在消息体里面是抓不到密码消息的,而且已经被md5方式加密过。-label id=/remote_port SIP/2.0 2 REGISTER field1 len 3600- 收到来自AST的200 ACK消息后,系统转至等待1000ms,或者可以直接去掉该设置 -2002pause milliseconds=1000- Keep the call open for a while in case the 200 is lost to be - able to retransmit it if we receive the BYE again. -4000- defini
10、tion of the response time repartition table (unit is ms) -ResponseTimeRepartition value=10, 20, 30, 40, 50, 100, 150, 200- definition of the call length repartition table (unit is ms) -CallLengthRepartition value=10, 50, 100, 500, 1000, 5000, 10000/scenario4.1.3 test.csvSEQUENTIAL6666609;authenticat
11、ion username=6666609 password=66666094.2 呼叫SIPp发送Invite消息到asterisk,AST回407要求密码验证,SIPp返回200 ok,并发送invite带密码消息到asterisk,asterisk返回200 OK,接着返回180,SIPp此时开始传输RTP到asterisk,延迟5000ms发送DTMF=1的号码,然后SIPp发送Bye消息到asterisk,asterisk返回200 ok给SIPp。4.2.1 测试./sipp -r 1 -i 192.216.2.224 -l 1 -sf uac-media.xml -inf test
12、.csv 192.216.224.1834.2.2 uac-media.xml- Sipp uac scenario with pcap (rtp) play -UAC with media- In client mode (sipp placing calls), the Call-ID MUST be - generated by sipp. To do so, use call_id keyword. - INVITE sip:field1remote_ip: field1 - are saved and used for following messages sent. Useful
13、to test - against stateful SIP proxies/B2BUAs. - Packet lost can be simulated in any send/recv message by - by adding the lost = 10. Value can be 1-100 percent. -send ACK sip:peer_tag_param 1 ACK 2 INVITE field2 c=IN IPmedia_ip_type media_ip m=audio auto_media_port RTP/AVP 00 PCMU/8000183180 rtd= 2
14、ACK- Play a pre-recorded PCAP file (RTP stream) -nopactionexec play_pcap_audio=pcap/g711a.pcap/action/nop- Pause 8 seconds, which is approximately the duration of the - PCAP file -5000- Play an out of band DTMF 1 -pcap/dtmf_2833_1.pcap- The crlf option inserts a blank line in the statistics report. - BYE sip: 2 BYE Conten
copyright@ 2008-2023 冰点文库 网站版权所有
经营许可证编号:鄂ICP备19020893号-2