Network traffic generator.

I’ve trying to test some Cisco IOS Quality of Service (QOS) configurations in the lab. Our exiting test technique has consisted of primitive measures like; start two ftps and a telnet session, test subjectively the responsiveness of the telnet. Obviously this is less than ideal, so I wanted to find a good traffic generator and some means of measuring jitter, loss, bps, pps, etc.

My first idea for a traffic generator was good old NetCat. NetCat is a hell of useful tool, but I quickly realized I really needed something that could generate more than one flow at a time, and that would allow me to control the speed of the flow.

I googled for traffic generators of course, but most of the ones I found could only do UDP. To properly test WRED and FRED configurations, I really needed something that’d be able to generate UDP or TCP traffic.

I think I’ve finally found the program I’ve been looking for. It’s called D-ITG (Distributed Internet Traffic Generator) and it seems pretty good so far. It consists of four programs, a traffic generator, a traffic receiver, a log server, and a log decoder.

For each traffic flow, you can specify destination address, destination port, protocol (tcp,udp, icmp), DS byte, pkts per second, pkt size, etc. The traffic generator can read in a script file. Each line of the script file defines the characteristics of a different traffic flow. Traffic is sent from the generator to one or more hosts running the receiver application. Both the generator and receiver can log information to local log files, or to the remote log server. Either way, the log files produced are in some kind of binary format. You have to use the decoder to read it.

The decoder produces a nice summary that looks like this:

---------------------------------------------------------------
Flow Id : 3
---------------------------------------------------------------
From      192.168.2.2:32769  ---> To       192.168.3.2:25

Total time          = 9.318654 sec
Total packet        = 478
Max delay           = 1305.456000 msec
Min delay           = 1.457000 msec
Average delay       = 1105.976447 msec
Average jitter      = 24.790557 msec
Delay variation     = 319.898237 msec
Byte received       = 61184
Average bitrate     = 52.526041 Kbps
Average packet rate = 51.294962 pkt/sec
packets dropped     = 559
---------------------------------------------------------------
---------------------------------------------------------------
Flow Id : 1
---------------------------------------------------------------
From      192.168.2.2:32879  ---> To       192.168.3.2:23

Total time          = 9.959863 sec
Total packet        = 200
Max delay           = 70.393000 msec
Min delay           = -0.419000 msec
Average delay       = 33.246315 msec
Average jitter      = 36.203322 msec
Delay variation     = 10.186839 msec
Byte received       = 25600
Average bitrate     = 20.562532 Kbps
Average packet rate = 20.080597 pkt/sec
packets dropped     = 0
---------------------------------------------------------------
---------------------------------------------------------------
Flow Id : 2
---------------------------------------------------------------
From      192.168.2.2:32880  ---> To       192.168.3.2:24

Total time          = 9.954186 sec
Total packet        = 200
Max delay           = 55.270000 msec
Min delay           = 8.130000 msec
Average delay       = 29.542540 msec
Average jitter      = 12.684859 msec
Delay variation     = 8.783441 msec
Byte received       = 25600
Average bitrate     = 20.574259 Kbps
Average packet rate = 20.092050 pkt/sec
packets dropped     = 0
---------------------------------------------------------------
Total results
---------------------------------------------------------------
Total number of flows  = 3
Max delay              = 1305.456000 msec
Min delay              = -0.419000 msec
Average delay          = 616.417440 msec
Average jitter         = 24.575127 msec
Delay variation        = 584.943696 msec
Byte received          = 112384
Total time             = 9.318654 sec
Average bitrate        = 96.480887 Kbit/sec
Average packets rate   = 94.219616 pkts/sec
Packets dropped        = 559
Packets wrong          = 0
Total packets received = 878
---------------------------------------------------------------

Unfortunately, the documentation for D-ITG is pretty spartan, and the source code is mostly in Italian, so I haven’t been able to figure out how all of its options work. For example, you’re supposed to be able to output delay, jitter, bitrate,and packet rate information on millisecond windows. But the output when you do that doesn’t have any kind of column numbers and I haven’t been able to make heads or tails of it.

Another weird problem.. To quit the log server you have to ctrl-c or kill it. But when I do, it apparently doesn’t close its socket correctly or something. When I try to restart it I frequently get errors that it’s unable to open a socket. The workaround I found is to leave the log server running all the time. The traffic generator can specify what file the log server should log to, so I just use a different log file for each test without restarting the log server. Took a while to figure that out… 🙂

Oh well, at least I can use it generate traffic. 🙂

Advertisements

5 thoughts on “Network traffic generator.

  1. Hi!!

    I am also working on the D-ITG and IPerr to generate UDP traffic. In case of D-ITG i get the stats correctly but it does net give the accurate measure of Delay and Jitter. Where, the values retrieved are negative, thus ambigiuos. I went through the documentation and FAQs which says there is a need to synchronize the flows.
    I understand the problem and used rttm as an input parameter but to no avail. Can u please guide me how to get the delay and jitter values correctly.

    Cheers
    l2k

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