Search This Blog........

Friday, 17 June 2016

Info about SIPP automation load testing tool..

How to install sipp in linux?


1. Download the stable linux verison from the sipp source web.


Example: I downloaded "sipp-3.3.tar.gz" file and copied it to the ROOT folder of my linux machine.
2. Execute command "gunzip sipp-XXX.tar.gz" command, here i used command 'gunzip sipp-3.3.tar.gz'
3. Then execute command 'tar -xvf sipp-xxx.tar' command, here i used command 'tar -xvf sipp.3.3.tar' to extrac the sipp tar file.
4. The folder sipp.xxx contains all th extracted  files and available in the same location.  Go to the folder 'cd sipp-xxx'
5. Now execute the command 'make'  - Just executig 'make' command without any extensions means we are using SIPP without TLS and Authentication support.
a) Execute command 'make ossl' for TLS & Authentication support.
  b) Execute command 'make pcapplay' for PCAP Play & No authentication support.
  c) Execute command 'make pcapplay_ossl' for PCAP Play & Authentication support.
 I had executed the command 'yum install ncurses-dlevel ncurses' to install ncurses package (Note:- Linux machine should be connected with internet for yum update )
7. I've executed the 'make' command again to complete the sipp installation.

yum install ncursers-dlevel ncursers

                                            Starting SIPP


Run sipp with embedded server (uas) scenario:
# ./sipp -sn uas
On the same host, run sipp with embedded client (uac) scenario
# ./sipp -sn uac 127.0.0.1

Creating REGISTER request scenario:

Step:1 Create XML file.., below is the code

<?xml version="1.0" encoding="ISO-8859-2" ?>

<!--  Use with CSV file struct like: 3000;192.168.1.106;[authentication username=3000 password=3000];
      (user part of uri, server address, auth tag in each line)
-->

<scenario name="register_client">
  <send retrans="500">
retrans=500 means the TI timer set to 500 ms
    <![CDATA[

      REGISTER sip:[remote_ip] SIP/2.0
      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
      From: <sip:[field0]@[field1]>;tag=[call_number]
      To: <sip:[field0]@[field1]>
      Call-ID: [call_id]
      CSeq: [cseq] REGISTER
      Contact: sip:[field0]@[local_ip]:[local_port]
      Max-Forwards: 10
      Expires: 120
      User-Agent: SIPp/Win32
      Content-Length: 0

    ]]>
  </send>

  <!-- asterisk -->
  <recv response="200" >
  </recv>


  <send retrans="500">
    <![CDATA[

      REGISTER sip:[remote_ip] SIP/2.0
      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
      From: <sip:[field0]@[field1]>;tag=[call_number]
      To: <sip:[field0]@[field1]>
      Call-ID: [call_id]
      CSeq: [cseq] REGISTER
      Contact: sip:[field0]@[local_ip]:[local_port]
      [field2]
      Max-Forwards: 10
      Expires: 120
      User-Agent: SIPp/Win32
      Content-Length: 0

    ]]>
  </send>

"<recv" should contains the expecting receive response message. If it doesn't match with the actual received message, then the REGISTRATION will not be successful.

  <!-- asterisk -->
  <recv response="100" optional="true">
  </recv>

  <recv response="200">
  </recv>

  <!-- response time repartition table (ms)   -->
  <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>

  <!-- call length repartition table (ms)     -->
  <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>

</scenario>

--------------------------------------END OF XML---------------------------------------------

Step 2: Create CSV file..., below is the code

SEQUENTIAL
18222;10.20.20.29;[authentication username=18222 password=abcdef];

NOTE: Save as CSV formate :)

Command: ./sipp 10.20.20.29 -sf REGISTER_client.xml -inf REGISTER_IN.csv -m 1

Now INVITE:


<?xml version="1.0" encoding="iso-8859-2" ?>
<!DOCTYPE scenario SYSTEM "sipp.dtd">

<scenario name="UAC REGISTER + INVITE + call">

<!--  Use with CSV file struct like: 32;192.168.1.211;[authentication username=32 password=32];21;
      (user part of uri, server address, auth tag, call target)
-->

     <send retrans="500">
    

  

  <send>
    <![CDATA[

      ACK sip:[field3]@[remote_ip]:[remote_port] SIP/2.0
      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
      From: <sip:[field0]@[field1]>;tag=[call_number]
      [last_To:]
      Call-ID: [call_id]
      CSeq: [cseq] ACK
      Contact: sip:[field0]@[local_ip]:[local_port]
      Max-Forwards: 10
      Content-Length: 0

    ]]>
  </send>

  <pause milliseconds="30000" />           - Pause for 30 secs (Here session is established and pause for 30 seconds)

  <send retrans="500">
    <![CDATA[

      BYE sip:[field3]@[remote_ip]:[remote_port] SIP/2.0
      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
      From: <sip:[field0]@[field1]>;tag=[call_number]
      [last_To:]
      Call-ID: [call_id]
      CSeq: [cseq] BYE
      Contact: sip:sipp@[local_ip]:[local_port]
      Max-Forwards: 10
      Content-Length: 0

    ]]>
  </send>

  <!-- The 'crlf' option inserts a blank line in the statistics report. -->
  <recv response="200" crlf="true">
  </recv>





  <!-- 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>

How to send RTP:


How to send RTP in sipp?

1. Create a RTP pcap file (Use wireshark to create it) and put in the sipp installation folder.
     i.e pcap/<file name>

2. Now refer the pcap file name in the xml file of your scenario (INVITE.xml)

<nop>
<action>
<exec play_pcap_audio="pcap/File name.pcap"/>
</action>
</nop>



Add this in between the ACK and BYE of the xml file.

3. Run the sipp, you can hear the RTP Voice in the call.


No comments:

Post a Comment