...
In order for authentication to work it seems that the standard UAC scenario XML file needs to be extended as follows (copied from the example in the manual):
Panelcode |
---|
Code Block |
<recv response="407" auth="true"> </recv> |
<send>
<send> <![CDATA[ ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port] From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param] Call-ID: [call_id] CSeq: 1 ACK Contact: sip:sipp@[local_ip]:[local_port] Max-Forwards: 70 Subject: Performance Test Content-Length: 0 ]]> </send> |
...
Panel |
---|
<send <send retrans="500"> <![CDATA[ |
...
Panel |
---|
INVITE sip:service@INVITE sip:[oldxx:service]@[oldxx:remote_ip]:[oldxx:remote_port] SIP/2.0 Via: SIP/2.0/[oldxx:transport] [oldxx:local_ip]:[oldxx:local_port |
...
] From: sipp <sip:sipp@[oldxx:local_ip]:[oldxx:local_port]>;tag=[oldxx:call_number |
...
] To: sut <sip:[oldxx:service]@[oldxx:remote_ip]:[oldxx:remote_port |
...
]> Call-ID: [oldxx:call_id |
...
] CSeq: 2 |
...
INVITE Contact: sip:sipp@[oldxx:local_ip]:[oldxx:local_port |
...
] [oldxx:authentication username=foouser |
...
] Max-Forwards: |
...
70 Subject: Performance |
...
Test Content-Type: application/sdp |
...
Content-Length |
...
Panel |
---|
: [oldxx:len] v=0 o=user1 53655765 2353687637 IN IP4 127.0.0.1 |
...
s=- |
...
t=0 |
...
0 c=IN IP4 [oldxx:media_ip |
...
] m=audio [oldxx:media_port] RTP/AVP |
...
0 a=rtpmap:0 PCMU/8000 |
...
Panel |
---|
]]> </send> |
Panel |
Built in scenarios are part of the executable code. In order to dump an existing scenario into a file use the following command:
Panel |
---|
./sipp -sd uac >uac.xml |
...
External scenarios can be loaded using the -sf option
Panel |
---|
./sipp -sf file.xml ..... |
Panel |
Example SER test scenario: taken from here
- SIPp UAS & UAC run on a laptop (PentiumM 1.8Ghz)
- ser runs on an Athlon64 3800+
- The 2 machines are connected by gigabit ethernet.
Panel |
---|
SIPp cmd lines: |
Panel |
Receiver:
Panel |
---|
-sn uas default SipStone scenario |
Panel |
Transmitter:
Panel |
---|
-r 200 call rate in calls per second (200 cps) |
...
Note: the option -l laptop_ip for both receiver and transmitter seems to be an error. The option -i laptop_ip could be meant, however, the default value already provides the correct value.
SIPp Version:
I am using sipp.1.1rc2. download here
Reference: http://sipp.sourceforge.net/doc1.1/reference.html#installing
Panel |
---|
Compiling: |
...
make clean (use this command if you built sipp without OpenSSL first)
Panel |
---|
make ossl (compile with the authentication option enabled, requires OpenSSL) |
Panel |
Open Ports:
Panel |
---|
nmap -sT -O host |
...
Scenario Definition:
Invite as per the default SipStone UAC scenario:
Panel |
---|
INVITE sip:service@remote_ip:remote_port SIP/2.0 |
Panel |
v=0
Panel |
---|
o=user1 53655765 2353687637 IN IP4 127.0.0.1 |
...
Note: The identifier service can be passed on the command line as -s service_name.
I assume that the user with the User ID service_name has to exist in sipX.
Authentication:
Reference: http://sipp.sourceforge.net/doc1.1/reference.html#authentication
Example Registration (w/Auth) test scenario:
Here's an example test scenario that can be used to test the sipx proxy and registrar. The scenario file register_client.xml simulates an authenticated registration and the external CSV file register_client.csv is used to substitute values for username, domain, and authentication credentials. The following command can be used to run this scenario:
Panel |
---|
sipp -sf register_client.xml -inf register_client.csv -r 10 -trace_err -trace_stat -nd -fd 1 -i sender_ip sipx_ip |
Panel |
{{Box File| SIPp register scenario register_client.xml|
Code Block |
---|
<?xml version="1.0" encoding="ISO-8859-1" ?>
<scenario name="register_client">
<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: 1 REGISTER
Contact: sip:[field0]@[local_ip]:[local_port]
Max-Forwards: 5
Expires: 1800
User-Agent: SIPp/Linux
Content-Length: 0
]]>
</send>
<recv response="401" auth="true">
</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: 2 REGISTER
Contact: sip:[field0]@[local_ip]:[local_port]
[field2]
Max-Forwards: 5
Expires: 1800
User-Agent: SIPp/Linux
Content-Length: 0
]]>
</send>
<recv response="200">
</recv>
</scenario>
|
}}
{{Box File| SIPp register scenario external value injection CSV register_client.csv|
Code Block |
---|
SEQUENTIAL
user0;example.com;[authentication username=user0 password=123];
user1;example.com;[authentication username=user1 password=456];
|
}}
sipX Log Viewer
Panel |
---|
sip log files in sipX: |
...
syslogviewer is a filter that removes the escaping for newlines and otherwise makes the log files more readable. Use it in a pipe:
Panel |
---|
grep <call-id> /var/log/sipxpbx/sipproxy.log | syslogviewer | less |
...
syslog2siptrace is a translator that is used to convert log files into a the xml format used by sipviewer, which displays calls in a very readable ladder diagram.
Panel |
---|
grep <call-id> /var/log/sipxpbx/sipproxy.log | syslog2siptrace > log.xml |
...
syslogviewer reformats sip logs a bit better, replacing '\r\n' with real carriage returns
Panel |
---|
USAGE: |
Panel |
syslog2siptrace turns sip log into XML. Only consumers today of XML is sipviewer
Panel |
---|
USAGE: |
Panel |
sipviewer is a graphical SIP message viewer
Panel |
---|
USAGE: |
...
SIPp Usage
Panel |
---|
sipp remote_host.remote_port options |
Panel |
Available options:
Panel |
---|
-v : Display version and copyright information. |
Panel |
-bg : Launch SIPp in background mode.
Panel |
---|
-p local_port : Set the local port number. Default is a |
Panel |
-i local_ip : Set the local IP address for 'Contact:',
Panel |
---|
'Via:', and 'From:' headers. Default is |
...
-inf file_name : Inject values from an external CSV file during calls
Panel |
---|
into the scenarios. |
...
-d duration : Controls the length (in milliseconds) of
Panel |
---|
calls. More precisely, this controls |
...
-r rate (cps) : Set the call rate (in calls per seconds).
Panel |
---|
This value can be changed during test by |
Panel |
-rp period (ms) : Specify the rate period in milliseconds for the call
Panel |
---|
rate. |
...
-max_socket max : Set the max number of sockets to open simultaneously.
Panel |
---|
This option is significant if you use one socket |
Panel |
-base_cseq n : Start value of cseq for each call.
Panel |
---|
-sf filename : Loads an alternate xml scenario file. |
Panel |
-sn name : Use a default scenario (embedded in
Panel |
---|
the sipp executable). If this option is omitted, |
Panel |
'uac' : Standard SipStone UAC (default).
Panel |
---|
'uas' : Simple UAS responder. |
Panel |
Default 3pcc scanerios (see -3pcc option):
Panel |
---|
'3pcc-C-A' : Controller A side (must be started |
Panel |
-sd name : Dumps a default scenario (embeded in
Panel |
---|
the sipp executable) |
...
-t u1 : Set the transport mode:
Panel |
---|
u1: UDP with one socket (default), |
...
It appears that you installed the
Panel |
---|
sippcomp.so plugin. 2 additionnal |
Panel |
c1: u1 + compression,
Panel |
---|
cn: un + compression. |
...
-trace_msg : Displays sent and received SIP messages in
Panel |
---|
<scenario file name>_<ppid>_messages.log |
Panel |
-trace_screen : Dump statistic screens in the
Panel |
---|
<scenario_name>_<ppid>_screens.log file when |
...
-trace_timeout : Displays call ids for calls with timeouts in
Panel |
---|
<scenario file name>_<ppid>_timeout.log |
Panel |
-trace_stat : Dumps all statistics in <scenario_name>_<ppid>.csv
Panel |
---|
file. Use the '-h stat' option for a detailed |
Panel |
-stf file_name : Set the file name to use to dump statistics
Panel |
---|
-trace_err : Trace all unexpected messages in |
Panel |
-trace_logs : Allow tracing of <log> actions in
Panel |
---|
<scenario file name>_<ppid>_logs.log. |
...
-trace_rtt : Allow tracing of all response times in
Panel |
---|
<scenario file name>_<ppid>_rtt.csv. |
...
-rtt_freq freq : freq is mandatory. Dump response times
Panel |
---|
every freq calls in the log file defined |
Panel |
-s service_name : Set the username part of the resquest URI.
Panel |
---|
Default is 'service'. |
...
-ap password : Set the password for authentication challenges.
Panel |
---|
Default is 'password' |
Panel |
-tls_cert name : Set the name for TLS Certificate file.
Panel |
---|
Default is 'cacert.pem' |
...
-tls_key name : Set the name for TLS Private Key file.
Panel |
---|
Default is 'cakey.pem' |
Panel |
-f frequency : Set the statistics report frequency on screen
Panel |
---|
(in seconds). Default is 1. |
...
-fd frequency : Set the statistics dump log report frequency
Panel |
---|
(in seconds). Default is 60. |
...
-l calls_limit : Set the maximum number of simultaneous
Panel |
---|
calls. Once this limit is reached, traffic |
...
-m calls : Stop the test and exit when 'calls' calls are
Panel |
---|
processed. |
Panel |
-mp local_port : Set the local RTP echo port number. Default
Panel |
---|
is none. RTP/UDP packets received on that |
Panel |
-mi local_rtp_ip : Set the local IP address for RTP echo.
Panel |
---|
-3pcc ip:port : Launch the tool in 3pcc mode ("Third Party
|
...
-nr : Disable retransmission in UDP mode.
Panel |
---|
-nd : No Default. Disable all default behavior of SIPp
|
...
-rsa host:port : Set the remote sending address to host:port.
Panel |
---|
for sending the messages. |
...
Signal handling:
Panel |
---|
SIPp can be controlled using posix signals. The following signals |
...
Exit code:
Panel |
---|
Upon exit (on fatal error or when the number of asked calls (-m |
...
Example:
Panel |
---|
Run sipp with embedded server (uas) scenario: |
...
Ethereal needs to be started with root priviledges in order to get access to the network interface. This only works if the DISPLAY variable is set correctly.
Panel |
---|
export DISPLAY=:0.0 |
...
</html>