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
Send a wireshark packet capture of a RTP packet and I'll write a
sample script for you
Srivats
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
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;
}
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
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
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
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
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