Building a 10 Gbit Traffic Generator using PF_RING and Ostinato

Posted · Add Comment

Whoever has developed network applications, soon or later had to buy or rent a traffic generator. Years ago I have purchased my 1 Gbit IXIA 400T on ebay for 2500$, and I wanted to buy a 10 Gbit traffic generator when I started to develop DNA. Unfortunately I could not afford the price of those useful yet costly devices, and I have spent over 10K $ for a 10 Gbit FPGA-based NIC (manufactured by one of the leading companies, guess who, that on my PC can’t now keep up with the 10g PF_RING DNA) able to generate synthetic packets after coding an application. I missed so much my IXIA traffic generator that after developing DNA I have said to myself: it’s time to create one.

PF_RING (and in particular DNA) users know that PF_RING comes with an utility named pfsend that is able to reproduce a pcap file at wire rate (e.g. 14.88 Mpps) using DNA. The tool is great but you need a pcap file to reproduce, so I needed a flexible traffic generator. I recently came across the Ostinato project aimed at creating an open-source traffic generator “inspired” to the IXIA user interface. The nice thing about ostinato is that is a client/server application, so you can run the server (named drone) onto your Linux box running PF_RING DNA, and the GUI on your Mac or Windows box. In order to make things simple, I have enhanced the PF_RING-libpcap and the DNA driver so that in order to use ostinato with DNA you just have to link the drone application with the PF_RING-libpcap. In order to do that you just have to download ostinato from source and edit the file ostinato/server/drone.pro changing the line “LIBS += -lpcap” into “LIBS += ~/PF_RING/userland/libpcap/libpcap.a -lpfring #-lpcap” and then compile ostinato from source.

Below you can see how ostinato looks when running on top of PF_RING.


Like I have said, I limited the changes to libpcap, thus no patches to ostinato are necessary beside pointing it to the PF_RING-libpcap library. The drawback is that on this configuration, ostinato can’t generate more than (on my PC) 6.6 Mpps, that is less than half of what pfsend on the same host can do. In order to increase the performance we need to put ostinato directly on top of PF_RING creating a native PF_RING port. This is something left to future activities. For those who need wire speed, can use ostinato to generate a pcap file with the traffic pattern they like, and transmit it using pfcount.

You now have a powerful yet inexpensive 10 Gbit traffic generator. No excuse now for not testing your apps at 10 Gbit!

Credits: many thanks to Francesco Cocchia for having told me of Ostinato a couple of months ago.