使用SIPp进行SIP压力测试
*****************
neitherof
2008-03-26
1简介
SIPp是一个测试SIP协议性能的工具软件。这是一个GPL的开放源码软件。
它包含了一些基本的用户代理工作流程(UAC和UAS),并可使用INVITE和B YE建立和释放多个呼叫。它也可以读XML的场景文件,即描述任何性能测试的配置文件。它能动态显示测试运行的统计数据(呼叫速率、信号来回的延迟,以及消息统计)。周期性地把CSV统计数据转储,在多个套接字上的TCP和UDP,利用重新传输管理的多路复用。在场景定义文件中可以使用正规表达式,动态调整呼叫速率。
SIPp可以用来测试许多真实的SIP设备,如SIP代理,B2BUAs,SIP媒体服务器,SIP/x网关,
SIP PBX,等等,它也可以模仿上千个SIP代理呼叫你的SIP系统。
when you believe歌词2安装
四种安装方法(本文使用第四种安装):
1.没有TLS支持与密码验证支持
# tar -xvf
# cd sipp-xxx
# make
Make出来的sipp文件就是一个可执行的文件,只需要搭配场景xml文件与csv文件即可进行SIP测试
2.拥有TLS支持与密码验证支持,但是不支PCAP语音播放
# tar -xvf
# cd sipp-xxx
# make ossl
这样编译出来的文件就加入了TLS至于与密码验证支持功能sipp软件了。
月经期长痘
3.支持PCAP Play,但是没有密码验证支持:(PCAP Play即为可以进行RTP语音,但是没有407 AUTH验证)
# tar -xvf
# cd sipp-xxx
# make pcapplay
4.支持PCAP 声音文件播放,而且支持密码验证支持:(支持407 auth验证支持)
# tar -xvf sipp-xxx.tar
# cd sipp-xxx
# make pcapplay_ossl
3使用方法
./sipp -l -inf reg.csv -p 6077 -i <local-ip> -m 4 <ip address of registrar>:5060
-sf 读取场景文件
-inf 读取csv文件
-p 本机采用端口
-i 本机IP
-m 要进行压力测试的次数
Ip address of registrar 要进行压力测试的IP地址
4情景
Uac(192.216.2.224) Asterisk(192.216.224.183) Uas
reminding
4.1注册
模拟若干个注册包到asterisk,asterisk回 100 tring和401 authentication,SIPp发送invite带auth验证消息到asterisk,asterisk回100 tring 和200 ok。
4.1.1 测试
./sipp -r 1 -l 1 -l -inf test.csv 192.216.224.183
4.1.2 l
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE scenario SYSTEM "厦门补习班sipp.dtd">
<!-- This program is free software; you can redistribute it and/or -->
<!-- modify it under the terms of the GNU General Public Licen as -->
<!-- published by the Free Software Foundation; either version 2 of the -->
<!-- Licen, or (at your option) any later version. -->
<!-- -->
<!-- This program is distributed in the hope that it will be uful, -->
<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -->
<!-- GNU General Public Licen for more details. -->
<!-- -->
<!-- You should have received a copy of the GNU General Public Licen -->
<!-- along with this program; if not, write to the -->
<!-- Free Software Foundation, Inc., -->
<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -->
<!-- -->
<!-- Sipp default 'branchc' scenario. -->
<!-- nobleman-->
<!-- 首先发送SIP注册消息,Register。里面的From与To是注册的号码 -->
<scenario name="branch_client">
<nd retrans="500">
<![CDATA[
REGISTER sip:[remote_ip] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: [field0] <sip:[field0]@[local_ip]:[local_port]>;tag=[call_number]
To: [field0] <sip:[field0]@[remote_ip]:[remote_port]>
Call-ID: [call_id]
CSeq: 1 REGISTER
Contact: sip:[field0]@[local_ip]:[local_port]
Content-Length: 0
Expires: 300
]]>
</nd>
<recv respon="100" optional="true">
</recv>
<!-- SIPp会收到来自AST要求验证的401 消息体,Recv意思为Receive,接收到来自AST的401要求验证的消息,Next为如果收到401,那么转至Label为1的地方进行操作 -->
<recv respon="401" auth="true" next="1人力资源管理学习网">
</recv>
<!-- nd invite with authentication messages 四级翻译-->
<!-- 开始发送Register消息,里面将把验证的密码消息发送给对方,在消息体里面是抓不到密码消息的,而且已经被md5方式加密过。-->
单词查询>split
<label id="1"/>
<nd retrans="500">
<![CDATA[
REGISTER sip:[field0]@[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port]
From: [field0] <sip:[field0]@[local_ip]:[local_port]>;tag=[call_number]