Every Network engineer would have used Ixia or Spirent for traffic generation. These are generally expensive. For majority of use cases, we need a simple protocol packet generator which can generate packet streams of various protocol types. The recent trend is to move traffic generation application into a VM formfactor. This is more suitable for virtual appliance testing. I recently came across this tool called “Ostinato” from Google and I found it very useful. Even Ixia and Spirent have their traffic generators in VM form factor. I will cover my Ostinato experiences in this blog.
Installing Ostinato:
I installed Ostinato in my Ubuntu 14.04 and 12.04 VM. For Ubuntu 14.04, Ostinato can be installed by:
sudo apt-get install ostinato
The above installs 0.5.1 version. To install later versions(0.6) or to install Ostinato in older Linux versions, use the procedure here.
Starting Ostinato:
Ostinato has a client, server model where servers can be run on multiple hosts and the client can connect to multiple servers. This allows a single client to manage ports present in multiple servers.
To start both client and server:
sudo ostinato
To start only the server:
sudo drone
Following is a screenshot when I started Ostinato in my first host.
To control the second host, do the following steps:
- Start Ostinato in first host.
- Start drone server in second host.
- From Ostinato gui in first host, do File->New port group and enter IP address of second host. We need to make sure that the versions of Ostinato is the same, I was getting some crashes when the versions of Ostinato on both the hosts were different.
Following is a screenshot after adding the new port group. Below, we see the ports from both hosts.
Ostinato features:
Ostinato supports extensive feature set that includes different protocol types, stream and rate control, packet capture, exporting/importing traffic streams. Detailed list of features can be found from Ostanito documentation.
Ostinato scripting:
From version 0.6, Ostinato supports scripting where all features of the GUI can be invoked from a Python script. This makes it easier to do automation. Ostinato uses Google’s protobuf to define the data, we can think of protobuf as simplified form of XML for representing data. Following link covers the main proto file that has the format of major types like prococol, stream, ports, stats etc. Every protocol(like eth, ip, icmp, igmp) has its own “*.proto” file which can be found here. We can also write our own “*.proto” file to define a new protocol type. “*.py” files gets created from “*.proto” files and they are included in the “python-ostinato” package.
Installing python-ostinato:
sudo pip install python-ostinato export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python2.7/dist-packages/ostinato
The sample script “example.py” generates 5 IP/UDP packets, captures the incoming packets and also displays packet statistics. Server ip address, tx and rx ports are received as input from the user. The script gives a good overview of common use cases and how to call define Python Drone apis.
To run the script:
sudo drone & -> this starts server cd /usr/local/lib/python2.7/dist-packages/ostinato python example.py
I took the example script as an example and modified the script to generate icmp packets with varying packet length. I used the “icmp.proto” header format to generate icmp packet. It was very straightforward to write the new script. My sample script can be found here.
I also tried importing and exporting pcap files from Ostanito. Once we import pcap file, we can also edit in Ostinato and export back. This can serve as pcap editor as well.
Overall, I am very impressed with Ostinato. I have used packeth tool for packet generation before. I found Ostinato to be a lot better in terms of features, ease of use and scripting. Also, we cannot beat the “free” part.
For some systems like mine:
export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python2.7/site-packages/ostinato
http://stackoverflow.com/questions/9387928/whats-the-difference-between-dist-packages-and-site-packages
Thanks Claudio for this info.
hi Sreenivas,
Good software based tool. I’m really not sure how you can control rate without any hardware assistance. Discover the line rates compatibility of different frame sizes.
best regards
viswanath
I installed ostinato on Ubuntu 15.10 by using sudo apt-get command. when i start ostinato it does not show any other ports than bluetooth although i have other interface like eth0 and wlan0 up. And every time i had to start drone server separately. Can you help me about this weired behavior.
i have not seen this. pls see if the question in the faq(https://github.com/pstavirs/ostinato/wiki/FAQ) addresses ur issue.
Hi I am trying this when do sudo ostinato it just says cannot connect to server X ? am i doing something wrong ?
Actually, Ostinato is not from from Google (I also thought it was from Google initially) – it is the work of one single developer hacking on it in his free time – https://www.linkedin.com/in/srivatsp. Kudos to him for making such a good traffic generator and giving it for free
Is there a way to control the server reply ? Like suppose i send ICMP request but i want the server to reply with some error i.e take a case icmp type 11 (ttl expired in transit) ?