A lot of engineers working in the Telco industry, and particularly those with an affinity towards open source, know about sipp, the performance testing tool for the SIP protocol.

Many of those engineers know the default key mappings of the console based interface by heart. Increase the call rate by one with + or by ten with *, quit with q etc.

What many people don’t know though is that you can also remote control a sipp instance via UDP sockets.

Remote-Control via UDP

If you start sipp with the option -cp 8888 (default, or any other port that suits you), you can send commands which you’d usually type in the console based interface, over the network.

In the following examples, we’re going to use netcat aka nc as a network client to send the commands. Depending on the OS you’re running, there might be other alternatives.

To check how and if it generally works, we’re running a quick experiment:

$ sipp -sn uas -cp 8888 -bg
Background mode - PID=[136]
$ ps -ef | grep sipp | grep -v grep
root       136     1  2 23:34 pts/0    00:00:00 sipp -sn uas -cp 8888 -bg
$ echo q | nc -q 1 -u localhost 8888
$ ps -ef | grep sipp | grep -v grep
$

To recap here, we start sipp with the built-in UAS scenario waiting for inbound calls (-sn uas), let it listen on port 8888/udp for control commands, and launch it in background (-bg). Next we double-check if it’s running fine, then use nc to send the q command which we’d normally type into the console to gracefully shutdown sipp. Finally we double-check if sipp did indeed terminate.

Short commands

You can control sipp remotely via the same commands you’d normally type into the console.

A full list of commands is available here.

Interactive commands

There is one more thing about controlling sipp, which is not very well known.

When running sipp in the console UI, you can type c followed by an interactive command like trace messages on. Of course, this mode can be used remotely as well, e.g. to set the cps rate to 5 calls per second:

$ sipp -sn uac -cp 8888 -bg sip.example.org
Background mode - PID=[180]
$ echo 'cset rate 5' | nc -q 1 -u localhost 8888
$

The full list of available interactive commands is here.

If that was news to you, play with those remote commands to improve your local sipp-based testing infrastructure.

comments powered by Disqus