VoIP Assesment

883 views
Skip to first unread message

J.vandenHeuvel

unread,
Apr 7, 2011, 7:41:36 AM4/7/11
to ostinato
Hello,

I'm playing arround with your great peace of software. Also looking in
the newsgroups for an example howto 'emulate' VoIP traffic.

The goal is to send a large load of RTP packets to a system running
wireshark, after a capture we can analyse the RTP stream and analyse
Delay, Packet loss & Jitter value's. This is for Large VoIP networks,
for testing Quality of Service and network throughput.

I kinda simulated an RTP VoIP stream by using UDP, add some payload
wich is copied out of a real RTP packet. After capturing in
Wiresharkbut it's not working good enough because al packet's have the
same sequence number 1 (wich normally is read out of the RTP header).

Is there a way (for me as Windows user) to emulate the RTP protocol?
It's a layer above UDP and add's numbers, and more VoIP info.

Many thanks,
Joep



Srivats P

unread,
Apr 7, 2011, 10:21:48 AM4/7/11
to J.vandenHeuvel, ostinato
Joep,

I'm assuming you are using a hexdump after UDP for RTP header and payload.

Instead of using a hexdump for both RTP header and payload, use a
"Userscript Protocol" for the 12-byte RTP Header - you can write the
script so that sequence numbers are incremented for each packet and a
hexdump for the actual RTP payload (which I assume you don't have to
vary across packets)

More info (and examples) on the userscript protocol is available at
http://code.google.com/p/ostinato/wiki/UserScriptHOWTO

btw the upcoming version 0.4 of Ostinato, due to be released later
this month, will have support to open Wireshark PCAP files - so you
don't have to do a copy-paste :-)

Regards,
Srivats


Hello,

Many thanks,
Joep

--
Get Ostinato News and Updates on Twitter - Follow @_ostinato
(http://twitter.com/_ostinato)
---------
You received this message because you are subscribed to the Google
Groups "ostinato" group.
To post to this group, send email to osti...@googlegroups.com
To unsubscribe from this group, send email to
ostinato+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/ostinato?hl=en

J.vandenHeuvel

unread,
Apr 7, 2011, 10:35:58 AM4/7/11
to ostinato
Hello Srivats,

Many thanks for your quick reply. The only thing is, that I already
looked at the examples but I have no knowledge about this kind of
scripting language. Both examples do not make it clear for me how te
create a 12-byte RTP Header ands also not on howto let the sequence
numbers increment automaticly.

I'll go and look on the internet for some more examples.
Great news btw for version 0.4. You are doing a great job!

Many thanks,
Joep


On Apr 7, 4:21 pm, Srivats P <pstav...@gmail.com> wrote:
> Joep,
>
> I'm assuming you are using a hexdump after UDP for RTP header and payload.
>
> Instead of using a hexdump for both RTP header and payload, use a
> "Userscript Protocol" for the 12-byte RTP Header - you can write the
> script so that sequence numbers are incremented for each packet and a
> hexdump for the actual RTP payload (which I assume you don't have to
> vary across packets)
>
> More info (and examples) on the userscript protocol is available athttp://code.google.com/p/ostinato/wiki/UserScriptHOWTO

Srivats P

unread,
Apr 7, 2011, 11:00:01 AM4/7/11
to J.vandenHeuvel, ostinato
Joep,

Send a wireshark packet capture of a RTP packet and I'll write a
sample script for you

Srivats

Srivats P

unread,
Apr 7, 2011, 11:48:14 AM4/7/11
to Joep van den Heuvel, ostinato
Here you are.

A quick explanation - I have defined and initialized a 12 element
array where each element represents a byte. The sequence number is of
2 bytes starting at offset 2, so I overwrite those 2 elements in the
array based on the input parameter 'index'. You can use the same logic
to extend it for timestamp also - if you need help, ask around - any
programmer worth his salt should be able to do that :-)

Srivats

protocol.protocolFrameSize = function() { return 12; }
protocol.protocolFrameValueVariable = true;
protocol.protocolFrameValue = function(index)
{
var pfv = [0x80, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00, 0xa0, 0x00,
0x01, 0xa9, 0x47];
var seq = (index+1) & 0xFFFF;

pfv[2] = seq >> 8;
pfv[3] = seq & 0xFF;

return pfv;
}

On Thu, Apr 7, 2011 at 9:06 PM, Joep van den Heuvel <vdhe...@gmail.com> wrote:
> Ohw and I see it also includes a timestamp... don't know if that's also
> something which could be added?
> Joep

J.vandenHeuvel

unread,
Apr 7, 2011, 4:38:22 PM4/7/11
to ostinato
Hello Srivats,

Thank you very much for the example code, it works, tomorrow I'll
complete te RTP package so the payload wil also be included. And
packet sizes are correct.

I now undertand a little bit more of the scripting. Thanks for your
time!

Best reragds,
Joep

On Apr 7, 5:48 pm, Srivats P <pstav...@gmail.com> wrote:
> Here you are.
>
> A quick explanation - I have defined and initialized a 12 element
> array where each element represents a byte. The sequence number is of
> 2 bytes starting at offset 2, so I overwrite those 2 elements in the
> array based on the input parameter 'index'. You can use the same logic
> to extend it for timestamp also - if you need help, ask around - any
> programmer worth his salt should be able to do that :-)
>
> Srivats
>
> protocol.protocolFrameSize = function() { return 12; }
> protocol.protocolFrameValueVariable = true;
> protocol.protocolFrameValue = function(index)
> {
>     var pfv = [0x80, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00, 0xa0, 0x00,
> 0x01, 0xa9, 0x47];
>     var seq = (index+1) & 0xFFFF;
>
>     pfv[2] = seq >> 8;
>     pfv[3] = seq & 0xFF;
>
>     return pfv;
>
> }
>
> On Thu, Apr 7, 2011 at 9:06 PM, Joep van den Heuvel <vdheu...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Ohw and I see it also includes a timestamp... don't know if that's also
> > something which could be added?
> > Joep
>
> > On Thu, Apr 7, 2011 at 5:00 PM, Srivats P <pstav...@gmail.com> wrote:
>
> >> Joep,
>
> >> Send a wireshark packet capture of a RTP packet and I'll write a
> >> sample script for you
>
> >> Srivats
>

J.vandenHeuvel

unread,
Apr 7, 2011, 6:31:21 PM4/7/11
to ostinato
Ok.. so I couldn't sleep...

I have a small question, which would complete my RTP protocol.
I almost have the timestamp working well. The timestamp is an
increment of 160 and contains of 4bytes.... (00 00 00 00) starting
from pfv[4]
I only can change the first (or last ) 2 so my counter ends at (00 00
FF FF) and than starts counting from (00 00 00 00).
It's hard for my to explain because I don't know the exact terms for
it but look at my code below:

Goal is that when the counter reaches ( 00 00 FF FF) It continues with
( 00 01 00 00) etc....

----------------------------------
BEGIN-------------------------------------------------------------
protocol.protocolFrameSize = function() { return 12; }
protocol.protocolFrameValueVariable = true;
protocol.protocolFrameValue = function(index)
{
var pfv = [0x80, 0x08, 0x00, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x36,
0x20, 0xfb, 0x90];
var seq = (index+1) & 0xFFFF;
var timesync = (index * 160) & 0xFFFFFFFF;

pfv[2] = seq >> 8;
pfv[3] = seq & 0xFF;
pfv[6] = timesync >> 8;
pfv[7] = timesync & 0xFF;
return pfv;
}

-------------------------END------------------------------------------

I tried:
pfv[4] = timesync >>16;
pfv[5] = timesync & 0xFFFFFFFF


etc.. but obviously I just don't know what I'm doing.... Goal is that
when the counter reaches ( 00 00 FF FF) It continues with ( 00 01 00
00) etc....

Hope you can give me the simple trick that does it....

Many thanks,
Joep



On Apr 7, 5:48 pm, Srivats P <pstav...@gmail.com> wrote:
> Here you are.
>
> A quick explanation - I have defined and initialized a 12 element
> array where each element represents a byte. The sequence number is of
> 2 bytes starting at offset 2, so I overwrite those 2 elements in the
> array based on the input parameter 'index'. You can use the same logic
> to extend it for timestamp also - if you need help, ask around - any
> programmer worth his salt should be able to do that :-)
>
> Srivats
>
> protocol.protocolFrameSize = function() { return 12; }
> protocol.protocolFrameValueVariable = true;
> protocol.protocolFrameValue = function(index)
> {
>     var pfv = [0x80, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00, 0xa0, 0x00,
> 0x01, 0xa9, 0x47];
>     var seq = (index+1) & 0xFFFF;
>
>     pfv[2] = seq >> 8;
>     pfv[3] = seq & 0xFF;
>
>     return pfv;
>
> }
>
> On Thu, Apr 7, 2011 at 9:06 PM, Joep van den Heuvel <vdheu...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Ohw and I see it also includes a timestamp... don't know if that's also
> > something which could be added?
> > Joep
>
> > On Thu, Apr 7, 2011 at 5:00 PM, Srivats P <pstav...@gmail.com> wrote:
>
> >> Joep,
>
> >> Send a wireshark packet capture of a RTP packet and I'll write a
> >> sample script for you
>
> >> Srivats
>

Srivats P

unread,
Apr 8, 2011, 10:12:49 AM4/8/11
to J.vandenHeuvel, ostinato
Here you are -

protocol.protocolFrameSize = function() { return 12; }
protocol.protocolFrameValueVariable = true;
protocol.protocolFrameValue = function(index)
{
var pfv = [0x80, 0x08, 0x00, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x36,
0x20, 0xfb, 0x90];
var seq = (index+1) & 0xFFFF;

var timesync = (index*160) & 0xFFFFFFFF;

pfv[2] = seq >> 8;
pfv[3] = seq & 0xFF;

pfv[4] = (timesync >> 24) & 0xFF;
pfv[5] = (timesync >> 16) & 0xFF;
pfv[6] = (timesync >> 8) & 0xFF;


pfv[7] = timesync & 0xFF;
return pfv;
}

vdhe...@gmail.com

unread,
Apr 8, 2011, 11:17:59 AM4/8/11
to osti...@googlegroups.com, J.vandenHeuvel
Super this does the job.
Many thanks for your good support and willing to help!


For others interested in the RTP look-a-like script:

Here is the script:
protocol.protocolFrameSize = function() { return 12; }

protocol.protocolFrameValueVariable = true;

protocol.protocolFrameValue = function(index)

{

var pfv = [0x80, 0x08, 0x00, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x36, 0x20, 0xfb, 0x90];

var seq = (index+1) & 0xFFFF;

var timesync = (index * 160) & 0xFFFFFFFF;

pfv[2] = seq >> 8;

pfv[3] = seq & 0xFF;

pfv[4] = (timesync >> 24) & 0xFF;

pfv[5] = (timesync >> 16) & 0xFF;

pfv[6] = (timesync >> 8) & 0xFF;

pfv[7] = timesync & 0xFF;

return pfv;

}



Where the variable 'seq' is the RTP Sequence number,

variable 'timsync' is a clock identifier which just is a multiplier of 160 (simulating G.711 20ms RTP packets)


The complete protocol build in Ostinato is:

Protocol Selection Advanced

L1: MAC

L2: Ethernet II

L3: IPv4

L4: UDP

L5: Script

VLAN: untagged

Payload Hex dump (stands on other since selected in advanced)


Protocol Data

Enter the addresses you want to send at MAc and IPv4 level


IPv4:

TOS/DSCP --> B8 (this is Expedited forwarding for Voice traffic)

overide lengt: 200

Identification: 00 00

Fragment Offset: 0

choose don't Fragment


UDP:

Override sourceport: 50076 (it's just an RTP port)

Override Dest. Port: 17016 (it's just an RTP port)

Override Length: 176

Override checksum: 00 00


{enter userscript as above}


HexDump:

I just entered a Hexidecimal pattern (which is the Payload of the RTP packet) and it has a lengt of: 155 (9B hex)

And looks like this:

0000   5d 5d 5d 5d 5d 5d 5d 5d 5d 5d 5d 5d 5d 5d 5d 5d  ]]]]]]]]]]]]]]]]

0010   5d 5d 5d 5d 5d 5d 5d 5d 5d 5d 5d 5d 5d 5d 5d 5d  ]]]]]]]]]]]]]]]]

0020   5d 5d 5d 5d 11 5d 5d 5d 5d 5d 5d 11 5d 5d 5d 5d  ]]]].]]]]]].]]]]

0030   5d 5d 5d 5d 5d 5d 5d 5d 5d 5d 5d 5d 5d 5d 5d 5d  ]]]]]]]]]]]]]]]]

0040   5d 5d 5d 5d 5d 5d 5d 11 5d 5d 5d 5d 5d 5d 5d 5d  ]]]]]]].]]]]]]]]

0050   5d 5d 5d 5d 5d 5d 5d 5d 5d 5d 5d 5d 5d 5d 5d 5d  ]]]]]]]]]]]]]]]]

0060   5d 5d 5d 11 5d 5d 5d 5d 5d 5d 5d 11 5d 5d 5d 5d  ]]].]]]]]]].]]]]

0070   5d 5d 5d 5d 11 11 11 11 11 11 11 5d 5d 5d 5d 5d  ]]]].......]]]]]

0080   5d 5d 5d 5d 5d 5d 5d 5d 5d 5d 5d 5d 5d 5d 5d 5d  ]]]]]]]]]]]]]]]]

0090   5d 5d 5d 5d 5d 5d 5d 5d 5d 5d 5d 5d                      ]]]]]]]]]]]]


Streaming control:

to simulate a single voice stream of G.711 codec, you have to send 50pps wich corresponds with 20ms payload per packet. 

To simulate more concurrent RTP streams, just multiply the pps by 50.

To send a 30 seconds RTP stream simulating 20 VoIP Call's just set packet rate: 20*50=1000pps and for total amount of packets (to get 30seconds) calculate pps*seconds = 30000.


(maybe this can be done more efficient by using burst, but I'm not sure)



Two-way Voice

If you want to simulate a real call, you need two way voice. So just install another copy of Ostinato on a second device, configure the client/server based role of this great piece of software, swap MAC and IP adresses and there you go... 2-way RTP packets.



Wireshark

Now when you send out the packets, run Wireshark on the receiving device(s) and capture the stream of packets. When done, richtclick one of the UDP packets, choose DECODE AS, select Both and choose RTP as protocol. Now you see in Whireshark the RTP stream.

Under the menu Telephony you can analyse the packet stream (and thus: Jitter, Delay, Packet loss) which are important value's for a Voice over IP network.


To Do:

This is more like a question for Srivats:

When using bursts, can I use the burst number also in the scripting? If this is possible I can also change the SSID(Synchronisation Source Identifier) value in the RTP protocol per burst so that if I send 5 simultanious burst, al 5 have a unique SSID and thus look like 5 diffrent VoIP call's.



Many thanks

Again many thanks to Srivats for developing this great software and giving good support.



Joep






Srivats P

unread,
Apr 8, 2011, 11:55:14 AM4/8/11
to osti...@googlegroups.com, vdhe...@gmail.com
Joep,

Thanks for taking the effort to spell out in detail how to configure a
VoIP stream using Ostinato! I'm sure it will come useful for people
looking for the same.

I recommend saving your stream and attaching it here - so that anyone
wanting to use it can just open the stream file in Ostinato and use
it!

For 2 way voice - you can run "drone" the server component on the 2
machines and run Ostinato on any one of those (or even a third
machine) and connect to both the "drones" from Ostinato. This way you
can control everything from one place!

Regarding the "bursts" question - as of now, you can' t have
"simultaneous" bursts. Bursts are nothing but a set of "packets per
burst" (burst size) number of packets sent back to back without any
delay between them. As an example, if you have a burst size of 10,
send 5 bursts/sec and send 20 bursts - that's a total of 20*10=200
packets, these are sent like this - 10 packets (burst size) back to
back without any delay between them followed by a delay of (1 second /
5 burst per sec) = 0.2 sec and then again 10 packets back to back and
so on till 200 packets are sent.

If you run into any issues or have any suggestions, do post on the
mailing list or raise an issue on the Ostinato website. And don't
forget to tweet/blog/email your friends and colleagues about Ostinato!
:-)

Regards,
Srivats

Srivats P

unread,
Mar 8, 2012, 11:57:22 AM3/8/12
to Rafa, ostinato
Do you have "number of packets" configured in your stream as 1? If so,
make it > 1

Otherwise attach the stream here and I'll take a look.

Srivats

On Mon, Mar 5, 2012 at 12:36 AM, Rafa <raf...@arrakis.es> wrote:
> Hello
>
> I have tried to use your script but it doesn't work for me, packets
> are sent always with the same sequence number, 1.
>
> Version used is 0.5 on windows 7
>
> What am I doing wrong?
>
> Thanks

--
http://ostinato.org/
@ostinato

rafavg

unread,
Mar 14, 2012, 2:25:57 PM3/14/12
to Srivats P, Rafa, ostinato
Hi

Yes, number of packets is bigger than one.

I attach two files, the stream as I have it configured and the capture
when I send it, if you decode this as RTP, you can chek that sequence
number is always 1

Thanks

Rafa

stream
rtp_sequence_ko.pcap

Srivats P

unread,
Mar 15, 2012, 11:24:09 AM3/15/12
to rafavg, ostinato
Rafa,

Please add the following line to the script -

protocol.protocolFrameVariableCount = 250;

This was not required before version 0.5 and the original script was
for an earlier version. After this change doing an "apply" will take
more time because Ostinato will prebuild all 250 packets (earlier it
was prebuilding only 1).

Please note that your stream has "override checksum" configured for IP
- so IP checksums for all packets will be incorrect. Unless it is
intentional, you might want to remove that and let Ostinato calculate
the IP checksums

Srivats

--
http://ostinato.org/
@ostinato

cschmi...@gmail.com

unread,
Jul 3, 2013, 7:26:55 AM7/3/13
to osti...@googlegroups.com, rafavg
Hi,

first, thanks for the great job man.

I noticed another problem with the script and I would appreciate your support with it.

The problem is, that the rtp sequence number repeats. 
If I set the average pps to 500 it counts till 500 and then starts again with 1 (so every second the value is reset).

Thanks in advance.
Chris

Srivats P

unread,
Jul 10, 2013, 11:43:36 AM7/10/13
to cschmi...@gmail.com, ostinato, rafavg
Chris,

Please save and attach your stream here.

Also let me know what is your requirement

Srivats
> Get Ostinato News and Updates on Twitter - Follow @ostinato
> (http://twitter.com/ostinato)
>
> ---------
> You received this message because you are subscribed to the Google Groups
> "ostinato" group.
> To post to this group, send email to osti...@googlegroups.com
> To unsubscribe from this group, send email to
> ostinato+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/ostinato?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "ostinato" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ostinato+u...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



--
http://ostinato.org/
@ostinato

cschmi...@gmail.com

unread,
Jul 11, 2013, 6:34:28 AM7/11/13
to osti...@googlegroups.com, cschmi...@gmail.com, rafavg
Hi Srivats,

thanks for your reply!
I attached my stream for Voip Testing (RTP, G.711.2). The problem is, that the RTP sequence number gets reset to 1 every second. 
e.g.: When I set pps to 50 it counts till 50 and then starts with 1 again, and so on...

-Chris
voip_rtp.zip

Srivats P

unread,
Jul 12, 2013, 11:47:45 AM7/12/13
to Christian Schmitt, ostinato, rafavg
Chris,

Ostinato pre-calculates all the packets before starting to transmit.
To prevent large buffers containing same packet contents, Ostinato
uses a smaller buffer of packets and loops multiple times through this
smaller buffer.

Please modify the following line in the script to increase the max
sequence number after which it can be repeated - e.g. for seq nos.
upto 3000 after which it will start repeating, use

protocol.protocolFrameVariableCount = 3000;

Please note that as you increase this number the time taken to "apply"
the stream will increase - this is the time ostinato calculates and
pre-forms all the packets that are to be transmitted.

Srivats
Reply all
Reply to author
Forward
0 new messages