China Open source community
站内导航:
站内排行前50热点文章

精华文章  GDB调试精粹及使用实例
普通文章  STL中map用法详解
精华文章  负载均衡软件比较(Hapr...
普通文章  头文件的重复引用
普通文章  递归函数的调用过程
普通文章  TCP三次握手/四次挥手详解
普通文章  贪心策略的理论基础——...
普通文章  BMH算法原理与实现(模...
普通文章  排列组合与回溯算法
普通文章  DP动态规划
精华文章  Android线程模型
普通文章  Linux socket编程之套接字
普通文章  Linux内核中的红黑树
精华文章  linux下使用minicom的几...
普通文章  Java开源Html解析类库
精华文章  enum类型的本质
普通文章  memcached server LRU ...
普通文章  linux设置环境变量的方法
普通文章  android核心模块及相关...
普通文章  linux源代码包(.tar.g...
普通文章  L.A.M.P配置过程
普通文章  在ubuntu9.10下安装QT4...
普通文章  C/C++程序员常见面试题...
普通文章  gcc编译过程概述
普通文章  python的memcache和jso...
普通文章  应用程序二进制接口---ABI
普通文章  linux内核编译问题
普通文章  Java多线程实现简单实例
普通文章  Python程序员常用的IDE...
普通文章  brk和sbrk详述
普通文章  优化C语言代码(程序员必...
普通文章  python非贪婪,多行匹配...
普通文章  函数指针传递和全局指针...
普通文章  Unix操作系统的历史演变
普通文章  网络编程之C10K问题
普通文章  发行版发布:CentOS 5.4
普通文章  在windows中构建gtk开发...
普通文章  i++循环与i--循环的执行...
普通文章  关于Qvariant类--万能的...
普通文章  Debian sudo 设置
普通文章  busybox1.15.x 交叉编译
普通文章  关于僵死进程zombie
普通文章  递归思想的妙用
普通文章  判断链表是否存在环并找...
普通文章  Android Porting Exper...
普通文章  关于/etc/bashrc和$HOM...
普通文章  [翻译]Django初窥
普通文章  Python list的排序
普通文章  Django实现大数据量分页...
普通文章  Debug方式取代printf满...

 
 
 
当前位置: 首页 >> 应用软件 >> 网络相关 >> SIPp压力测试SIP Meeting场景分析
 
 

SIPp压力测试SIP Meeting场景分析

作者:      来源:zz     发表时间:2007-02-05     浏览次数:      字号:    

撰写了基于SIP的meeting压力测试脚本。可以实现同时50个人同时进入meeting,然后说话,12秒后同时退出聊天室,系统等待8秒,再次重复50个人进入会议室,可以实现对meeting的压力测试。

    压力测试流程图如下:
    invite--------------->meeting
    407<------------------meeting
    invite with auth----->meeting
    100<------------------meeting
    user PIN<-------------meeting RTP
    DTMF 1 and #---------->meeting RTP
    RTP------------------->meeting
    pause 18 sec
    Bye------------------->meeting
    200 ok<----------------meeting
    xml文档如下:
<?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 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 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, MA  02111-1307 USA             -->
<!--                                                                    -->
<!--                 Sipp 'uac' scenario with pcap (rtp) play           -->
<!--                                                                    -->
<scenario name="UAC with media">
  <!-- In client mode (sipp placing calls), the Call-ID MUST be         -->
  <!-- generated by sipp. To do so, use [call_id] keyword.                -->
  <send retrans="500">
    <![CDATA[
      INVITE sip:[field1]@[remote_ip]:[remote_port] 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: [field1] <sip:[field1]@[remote_ip]:[remote_port]>
      Call-ID: [call_id]
      CSeq: 1 INVITE
      Contact: sip:[field0]@[local_ip]:[local_port]
      Max-Forwards: 70
      Subject: Performance Test
      Content-Type: application/sdp
      Content-Length: [len]
      v=0
      o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
      s=-
      c=IN IP[local_ip_type] [local_ip]
      t=0 0
      m=audio [auto_media_port] RTP/AVP 8
      a=rtpmap:8 PCMA/8000
      a=rtpmap:101 telephone-event/8000
      a=fmtp:101 0-11,16
    ]]>
  </send>
 
  <recv response="407" auth="true">
  </recv>
  <!-- By adding rrs="true" (Record Route Sets), the route sets         -->
  <!-- are saved and used for following messages sent. Useful 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>
    <![CDATA[
      ACK sip:[field1]@[remote_ip]:[remote_port] 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: [field1] <sip:[field1]@[remote_ip]:[remote_port]>[peer_tag_param]
      Call-ID: [call_id]
      CSeq: 1 ACK
      Contact: sip:[field0]@[local_ip]:[local_port]
      Max-Forwards: 70
      Subject: Performance Test
      Content-Length: 0
    ]]>
  </send>
 
  <send retrans="500">
  <![CDATA[
      INVITE sip:[field1]@[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]
      To: [field1] <sip:[field1]@[remote_ip]:[remote_port]>
      Call-ID: [call_id]
      CSeq: 2 INVITE
      Contact: sip:[field0]@[local_ip]:[local_port]
      [field2]
      Max-Forwards: 70
      Subject: Performance Test
      Content-Type: application/sdp
      Content-Length: [len]
      v=0
      o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
      s=-
      t=0 0
      c=IN IP[media_ip_type] [media_ip]
      m=audio [auto_media_port] RTP/AVP 0
      a=rtpmap:0 PCMU/8000
    ]]>
 </send>
 <recv response="100" optional="true">
 </recv>
 <recv response="180" optional="true">
 </recv>
 
 <recv response="200" rtd="true" crlf="true">
 </recv>
 
  <!-- Play a pre-recorded PCAP file (RTP stream)                       -->
  <!-- Pause 8 seconds, which is approximately the duration of the      -->
  <!-- PCAP file                                                        -->
  <pause milliseconds="2000"/>
  <!-- Play an out of band DTMF '1'  '#'                               -->
  <nop>
    <action>
      <exec play_pcap_audio="pcap/dtmf_2833_1.pcap"/>
    </action>
  </nop>
  <pause milliseconds="950"/>
  <nop>
    <action>
      <exec play_pcap_audio="pcap/dtmf_2833_pound.pcap"/>
    </action>
  </nop>
  <pause milliseconds="1500"/>
  <nop>
    <action>
      <exec play_pcap_audio="pcap/g711a.pcap"/>
    </action>
  </nop>
  <pause milliseconds="12000"/>
  <!-- The 'crlf' option inserts a blank line in the statistics report. -->
  <send retrans="500">
    <![CDATA[
      BYE sip:[field1]@[remote_ip]:[remote_port] 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: [field1] <sip:[field1]@[remote_ip]:[remote_port]>[peer_tag_param]
      Call-ID: [call_id]
      CSeq: 2 BYE
      Contact: sip:[field0]@[local_ip]:[local_port]
      Max-Forwards: 70
      Subject: Performance Test
      Content-Length: 0
    ]]>
  </send>
  <recv response="200" crlf="true">
  </recv>
  <pause milliseconds="8000"/>
  <!-- definition 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"/>
</scenario>
 
测试csv批量文件如下:
3001;904;[authentication username=3001 password=3001]
3002;904;[authentication username=3002 password=3002]
3003;904;[authentication username=3003 password=3003]
3004;904;[authentication username=3004 password=3004]
3005;904;[authentication username=3005 password=3005]
3006;904;[authentication username=3006 password=3006]
3007;904;[authentication username=3007 password=3007]
3008;904;[authentication username=3008 password=3008]
3009;904;[authentication username=3009 password=3009]
3010;904;[authentication username=3010 password=3010]
3011;904;[authentication username=3011 password=3011]
3012;904;[authentication username=3012 password=3012]
3013;904;[authentication username=3013 password=3013]
3014;904;[authentication username=3014 password=3014]
3015;904;[authentication username=3015 password=3015]
3016;904;[authentication username=3016 password=3016]
3017;904;[authentication username=3017 password=3017]
3018;904;[authentication username=3018 password=3018]
3019;904;[authentication username=3019 password=3019]
3020;904;[authentication username=3020 password=3020]
注意:这里的904号码为meeting接入号。这里我只写了20个,当然您可以写50,100都没关系。
测试方法与步骤:
(1):首先采用eyebeam呼入904号码,进入后根据密码PIN输入1#,进入会议室,然后听背景音乐
(2):采用sipp压力呼入904号码
    ./sipp -sf meeting.cml -sf meeting.csv -p 6718 -i 192.168.0.254 -m 100000 192.168.0.254 -l 50
(3):此时会听到一批号码登入会议室,然后可以听到一人说话,因为meeting的会议声音是采用叠加技术的,所以会出现很大的回声,之后陆续用户exit,完全退出后会继续听到音乐,因为只有你一个人在会议室了,这说明人已经全部走光了。然后会重复之前的动作
(4):注意 192.168.0.254是发起者呼叫机;192.168.0.194是被测试机。SIpp必须安装在254服务器上才能发起呼叫,另外我这里所指的meeting是指asterisk的conference功能,所以如果有其他软交换要测试会议的话,只需要稍微修改xml文件即可。

编辑 webmaster

 
 
 
评论
 
 
发表
 
姓名: QQ:
性别: MSN:
E-mail: 主页:
评分: 1 2 3 4 5
评论内容:
验证码:
  
  • 请遵守《互联网电子公告服务管理规定》及中华人民共和国其他各项有关法律法规。
  • 严禁发表危害国家安全、损害国家利益、破坏民族团结、破坏国家宗教政策、破坏社会稳定、侮辱、诽谤、教唆、淫秽等内容的评论 。
  • 用户需对自己在使用本站服务过程中的行为承担法律责任(直接或间接导致的)。
  • 本站管理员有权保留或删除评论内容。
  • 评论内容只代表网友个人观点,与本网站立场无关。
  •  
    中国源码网 - www.YuanMa.org - 中国 开放源代码+编程 社区