Ostinato Traffic generator

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.


6 thoughts on “Ostinato Traffic generator

  1. 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

  2. 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.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s