si pp introduction_2
TRANSCRIPT
SIPp Introduction
Load and Performance Testing
Simon Flannery
Ericsson Australia
Agenda
SIPp Basics Running SIPp
– Statistics and Screens– Command Line Options
Creating Scenarios Authentication Examples
Getting Started
Low-level knowledge of the SIP protocol and SIP signalling inside IMS
Scenarios files are written using XML Download from http://sipp.sourceforge.net/ "SIPp is a free Open Source test tool and traffic
generator for the SIP protocol "- sipp.sourceforge.net
Used for performance testing and traffic generation for IMT (and can be used for mIMS, but not PoC) Integration & Verification
SIPp Features
Support for both IPv4 and IPv6 RTP media support (PCAP) Call rate distributions
– Fixed– Uniform– Exponential
Support Authentication High Performance and Reliable Allows Complex Sceneries Can be controlled remotely (or externally) Reports Statistics
Running SIPp
SIPp has an interactive and real-time command line interface
Quite safe and stable to be left alone, or run in the background (try to always use latest build)
Various statistics and reporting screens are available
Exit codes:– 0 (zero) indicate that all calls were successful – 1 indicates that at least one call failed – 97 indicates an abnormal exit on internal command– 99 indicating a normal exit without processing calls – -1 used to indicate a fatal error
The Scenario Screen
Default screen (accessed by pressing 1)
The Statistics Screen
Accessed by pressing 2
Useful Command Line Options
-sf,loads an alternate scenario file -inf, loads an external CSV file to inject values from -r, sets the call rate (calls per second) -rp, specify the rate period (ms) for the call rate (above)
– Example: -r 15 -rp 1000, 15 calls every second -l, maximum number of simultaneous calls -m, stop and exit when set number of calls are
processed
-i, sets the local IP address -p, sets the local port number
Useful Command Line Options
-auth_uri,forces the domain value of the URI for authentication (for example, 401)
-trace_screen,logs the final screens to file (<scenario>_<pid>_screen.log)
-trace_err, logs unexpected messages to file (<scenario>_<pid>_errors.log)
-trace_stat, logs statistics to file (<scenario>_<pid>.csv)
-fd, logs statistics at set interval (seconds) -nd, disable SIPp’s default behaviors Finally, we end all SIPp commands with the remote host
(and port), for example the P-CSCF
SIPp Supports Authentication
Two authentication algorithms are supported:– Digest / MD5 ("algorithm="MD5"")– Digest / AKA
When receiving:– 401 (Unauthorized)– 407 (Proxy Authentication Required)
Simply add auth="true" in the <recv> command to take the challenge into account
The authorization header will then be re-injected in the next message using [authentication] keyword
Creating your own Scenarios Authored using XML notation Unfortunately has spaghetti flow
– Using labels and jumps (next attributes)
Useful elements:– <send>– <recv>– <pause>, speech time– <nop>, no operation– <label>
Registration scenario walk through with authentication
Always put optional responses first
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE scenario SYSTEM "sipp.dtd">
<scenario name="UAC Basic Registration">
<label id="0" />
<send retrans="500" start_rtd="true">
<![CDATA[
REGISTER sip:[field1] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: [field0] <sip:[field0]@[field1]>;tag=[call_number]
To: [field0] <sip:[field0]@[field1]>
Call-ID: [call_id]
CSeq: [cseq] REGISTER
Contact: [field0] <sip:[field0]@[local_ip]:[local_port]>;expires=691200
Max-Forwards: 70
Content-Length: 0
]]>
</send>
...to be continued
Creating your own Scenarios <recv response="200" rtd="true" next="3"
optional="true" /> <recv response="403" rtd="true" next="2"
optional="true" /> <recv response="404" rtd="true" next="2"
optional="true" /> <recv response="401" rtd="true" next="1"
auth="true" crlf="true" />
<label id="1" /> <send retrans="500" start_rtd="true"> <![CDATA[ REGISTER sip:[field1] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:
[local_port];branch=[branch] From: [field0] <sip:
[field0]@[field1]>;tag=[call_number] To: [field0] <sip:[field0]@[field1]> Call-ID: [call_id] CSeq: [cseq] REGISTER Contact: [field0] <sip:
[field0]@[local_ip]:[local_port]>;expires=691200
[field2] Max-Forwards: 70 Content-Length: 0 ]]> </send>
<recv response="400" rtd="true" next="2" optional="true" />
<recv response="403" rtd="true" next="2" optional="true" />
<recv response="404" rtd="true" next="2" optional="true" />
<recv response="200" rtd="true" next="3" crlf="true" />
<label id="2" /> <nop> <action> <exec int_cmd="stop_call" /> </action> </nop>
<label id="3" /> <!-- Definition of the response time
repartition table (unit is ms). --> <ResponseTimeRepartition value="30, 50, 80,
100, 150, 200, 300, 400, 500, 600, 700, 1000, 1200, 1400, 1500" />
<!-- Definition of the call length repartition table (unit is ms). -->
<CallLengthRepartition value="30, 50, 80, 100, 150, 200, 300, 400, 500, 600, 700, 1000, 1200, 1400, 1500" />
</scenario>
Call fails and scenario ends here
Call successful and scenario ends
here
Creating your own Scenarios
sipp -sf register.xml -inf subscribers_00000_01249.csv -m 1250 -r 200 -rp 1 -l 50000 \ -t u1 -nd -trace_screen -trace_err -i 192.168.22.81 -p 6041 -auth_uri tcm.imt.se \ 192.168.22.58:5060
Keywords from the Command Line
<scenario name="UAC Basic Registration"> <send retrans="500" start_rtd="true"> <![CDATA[
REGISTER sip:[field1] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: [field0] <sip:[field0]@[field1]>;tag=[call_number] To: [field0] <sip:[field0]@[field1]> Call-ID: [call_id] CSeq: [cseq] REGISTER Contact: [field0] <sip:[field0]@[local_ip]:[local_port]>;expires=691200 Max-Forwards: 70 Content-Length: 0
]]> </send>
Creating your own Scenarios
<scenario name="UAC Basic Registration"> <send retrans="500" start_rtd="true"> <![CDATA[
REGISTER sip:[field1] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: [field0] <sip:[field0]@[field1]>;tag=[call_number] To: [field0] <sip:[field0]@[field1]> Call-ID: [call_id] CSeq: [cseq] REGISTER Contact: [field0] <sip:[field0]@[local_ip]:[local_port]>;expires=691200 Max-Forwards: 70 Content-Length: 0
]]> </send>
"UDP" or "TCP" Magic cookie (z9hG4bK) +call number +message index
Starts from "1" andincremented by 1 for each call
Identifies a call and is generated bySIPp for each new call (mandatory)
Keywords from SIPp
Automatically generates the CSeq number starting at 1
Useful SIPp Keywords
[len], Computed length of the SIP body used in "Content-Length" header
[call_number], index of the call starting at 1 and is incremented by 1 for each call
[authentication], is used to include the authentication header
[msg_index], provides the message number in the scenario
[cseq], provides (or generates) the CSeq value of the last (or next) request received
Injecting External ValuesKeywords and values from an external file
<scenario name="UAC Basic Registration"> <send retrans="500" start_rtd="true"> <![CDATA[
REGISTER sip:[field1] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: [field0] <sip:[field0]@[field1]>;tag=[call_number] To: [field0] <sip:[field0]@[field1]> Call-ID: [call_id] CSeq: [cseq] REGISTER Contact: [field0] <sip:[field0]@[local_ip]:[local_port]>;expires=691200 Max-Forwards: 70 Content-Length: 0
]]> </send>
Regular Expression Scenario<scenario name="UAC Basic Registration"> <label id="0" /> <send retrans="500" start_rtd="true"> <![CDATA[
REGISTER sip:[field1] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:
[local_port];branch=[branch] From: [field0] <sip:
[field0]@[field1]>;tag=[call_number] To: [field0] <sip:[field0]@[field1]> Call-ID: [call_id] CSeq: [cseq] REGISTER Contact: [field0] <sip:[field0]@[local_ip]:
[local_port]>;expires=60 Max-Forwards: 70 Content-Length: 0
]]> </send>
<recv response="200" rtd="true" next="3" optional="true" />
<!-- Interval Too Brief --> <recv response="423" rtd="true" next="1"
crlf="true"> <action> <ereg regexp="[0-9]+" search_in="hdr"
header="Min-Expires:" check_it="true" assign_to="1" />
</action> </recv>
<label id="1" /> <send retrans="500" start_rtd="true"> <![CDATA[
REGISTER sip:[field1] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:
[local_port];branch=[branch] From: [field0] <sip:
[field0]@[field1]>;tag=[call_number] To: [field0] <sip:[field0]@[field1]> Call-ID: [call_id] CSeq: [cseq] REGISTER Contact: [field0] <sip:[field0]@[local_ip]:
[local_port]>;expires=[$1] Max-Forwards: 70 Content-Length: 0
]]> </send>
<recv response="200" rtd="true" next="3" crlf="true" />
<label id="3" /> <ResponseTimeRepartition value="30, 50, 80, 100,
150, 200, 300, 400, 500, 600, 700, 1000, 1200, 1400, 1500" />
<CallLengthRepartition value="30, 50, 80, 100, 150, 200, 300, 400, 500, 600, 700, 1000, 1200, 1400, 1500" />
</scenario>
Definition of a call
Successful call:– Navigates a scenario file from start to finish– Does not encounter a “stop_call” (or other)
command
Unsuccessful (failed) call:– Encounters a “stop_call”, “stop_now”,
“stop_gracefully” or other?
Example Time
The scenario:– User 46706560000000 calls user 46706560003000,– User 46706560000001 calls user 46706560003001,– User 46706560000002 calls user 46706560003002 and so on…
Again we will use CSV files to inject who should call who We assume everyone is provisioned and successfully
registered We will use two scenario files:
– A Caller scenario file (to send INVITEs, pauses and BYEs)– A Callee scenario file (to answer the INVITEs and BYEs)
The Caller
CSV Injection File
The Caller The Callee[field0] [field1] [field2] [field3]
The Caller<?xml version="1.0" encoding="ISO-8859-1" ?><!DOCTYPE scenario SYSTEM "sipp.dtd"><scenario name="UAC Basic Invite"> <label id="0" /> <send retrans="500" start_rtd="true"> <![CDATA[
INVITE sip:[field3]@[field1] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:
[local_port];branch=[branch] From: [field0] <sip:
[field0]@[field1]>;tag=[call_number]-INV-UAC To: [field3] <sip:[field3]@[field1]> Call-ID: [call_id] CSeq: [cseq] INVITE Contact: [field0] <sip:[field0]@[local_ip]:
[local_port]> Max-Forwards: 70 Content-Type: application/sdp Content-Length: [len]
v=0 o=user1 53655765 2353687637 IN
IP[local_ip_type] [local_ip] s=SIPp-UAC c=IN IP[media_ip_type] [media_ip] t=0 0 m=audio [media_port] RTP/AVP 0 a=rtpmap:0 PCMU/8000
]]> </send>
<recv response="100" rtd="true" optional="true" /> <recv response="180" rtd="true" optional="true" /> <recv response="400" rtd="true" rrs="true"
next="3" optional="true" /> <recv response="401" rtd="true" rrs="true"
next="3" optional="true" /> <recv response="403" rtd="true" rrs="true"
next="3" optional="true" /> <recv response="404" rtd="true" rrs="true"
next="3" optional="true" /> <recv response="200" rtd="true" rrs="true"
next="1" /> <label id="1" /> <send> <![CDATA[
ACK [next_url] SIP/2.0 [last_Via:] [last_From:] [last_To:] [last_Call-ID:] CSeq: [cseq] ACK Max-Forwards: 70 Subject: Performance Test Content-Length: 0 [routes]
]]> </send>
<pause milliseconds="60000" next="2" />
The Caller <label id="2" /> <send retrans="500" start_rtd="true"> <![CDATA[ BYE [next_url] SIP/2.0 [last_Via:] [last_From:] [last_To:] [last_Call-ID:] CSeq: [cseq] BYE Max-Forwards: 70 Subject: Performance Test Content-Length: 0 [routes] ]]> </send>
<recv response="400" rtd="true" next="3" optional="true" />
<recv response="401" rtd="true" next="3" optional="true" />
<recv response="403" rtd="true" next="3" optional="true" />
<recv response="404" rtd="true" next="3" optional="true" />
<recv response="408" rtd="true" next="3" optional="true" />
<recv response="200" rtd="true" next="4" crlf="true" />
<label id="3" /> <nop> <action> <exec int_cmd="stop_call" /> </action> </nop>
<label id="4" /> <!-- 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>
4xx error
Hang up
The Caller
Call rate
Message Counter
Actual speechtime
The Scenario
P-CSCF or ACMELocal port of the UE
The Callee
CSV Injection File
The Callee
[field0] [field1] [field2] No field 3
The Callee<?xml version="1.0" encoding="ISO-8859-1" ?><!DOCTYPE scenario SYSTEM "sipp.dtd">
<scenario name="UAS Basic responder">
<recv request="INVITE" rrs="true" crlf="true" />
<send> <![CDATA[
SIP/2.0 180 Ringing [last_Via:] [last_From:] [last_To:];tag=[call_number]-INV-UAS [last_Call-ID:] [last_CSeq:] Contact: [field0] <sip:[field0]@[local_ip]:
[local_port]> [last_Record-Route:] Content-Length: 0
]]> </send>
<pause milliseconds="2000" />
<send retrans="500"> <![CDATA[
SIP/2.0 200 OK [last_Via:] [last_From:] [last_To:];tag=[call_number]-INV-UAS [last_Call-ID:] [last_CSeq:] [last_Record-Route:] Contact: [field0] <sip:[field0]@[local_ip]:
[local_port]> Content-Type: application/sdp Content-Length: [len]
v=0 o=user1 53655765 2353687637 IN
IP[local_ip_type] [local_ip] s=SIPp-UAS c=IN IP[media_ip_type] [media_ip] t=0 0 m=audio [media_port] RTP/AVP 0 a=rtpmap:0 PCMU/8000
]]> </send>
<recv request="ACK" optional="true" crlf="true" />
The Callee <recv request="BYE" />
<send> <![CDATA[
SIP/2.0 200 OK [last_Via:] [last_From:] [last_To:] [last_Call-ID:] [last_CSeq:] Contact: [field0] <sip:[field0]@[local_ip]:
[local_port]> Content-Length: 0
]]> </send>
<!-- Keep call open in case the 200 is lost to be
able to retransmit it if we receive the BYE again. -->
<pause milliseconds="4000" />
<ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200" />
<CallLengthRepartition value="10, 50, 100, 500,
1000, 5000, 10000" />
</scenario>
The Callee only needs to reply to SIP messges from the Caller
The Callee has no logic flow
The Caller has all the logic flow– Remember all the labels and
jumps (next)?
The Callee If running both the caller and callee on the same computer ensure that they use different ports
The Scenario
References
SIPp documentation http://sipp.sourceforge.net/doc/reference.html
SIPp in action http://sipp.sourceforge.net/doc/images/sipp-01.wmv
Using the Statistics output with Excel http://sipp.sourceforge.net/doc/images/sipp-02.wmv