Great tool for testing QoS implementation

After my last post, some readers were asking what tool did I used for testing the QoS and how satisfied I’m with it.

The name of the tool is Packgen. According to its developer developers, “Packgen is a simple network packet generator handling diffserv markers, useful for testing network bandwidth and QoS.” It support features like:
– Network packet flows generation with given bandwidth (packets sent at each time interval depending on the bandwidth to produce and the size of the packets to generate);
– UDP and TCP flows;
– DSCP marking;
– Log generation which gives the possibility to compute statistics on the flows (to come later).

The main difference between IPerf (which is also a great testing tool, especially for bandwidth, jitter, packet loss tests…) and Packgen, is that the last one support diffserv marking natively. Of course you can achieve the same results with IPerf, with and ACL and inbound marking of the packets matched in the access-list, but with Packgen this is straight forward.

I had a little issue when downloading this tool, as the first result in Google search engine directed me to a page with no download link: http://packgen.rubyforge.org. This contains all the needed information about features, installation and how to use it (actually one of the best README that I ever saw for such tools), but no suggestion where to download the package. I search a little bit and you can download it from this official link.

To install this tool, you need to have Ruby on your system and then just run from inside the unpacked Packgen folder:

ruby ./setup.rb

Now some words about how to use it. From my post about AutoQoS, you can see that you need at least one client and one server. This 2 devices, use different files with Packgen (Don’t worry as the files come in the source package and if not, it’s very easy to create them).
First the server file, called listen.yml (if you create it, you can give whatever name you want) looks like this:

LISTEN:

udp:

ports: !ruby/range 17000..17002
tcp:

ports: !ruby/range 5002..5004

As you can see, there are 2 sections defined for UDP and TCP traffic. Then with “!ruby/range” you define a range where the server will listen. However, you can also simply use an Integer port number.

Then on the  client side, there is file called sent.yml:

SEND:

udp:

name: Voice
host: 10.10.10.100:17000
bandwidth: 700Kb
packet_size: 252B
dscp: ef
from..to: !ruby/range 0.0..60.0

name: Video
host: 10.10.10.100:5002
bandwidth: 2.8Mb
packet_size: 750B
dscp: cs4
from..to: !ruby/range 10.0..60.0
tcp:

name: Best Effort
host: 10.10.10.100:5002
bandwidth: 3.2Mb
packet_size: 1KB
from..to: !ruby/range 20.0..60.0

name: Background
host: 10.10.10.100:5002
bandwidth: 3.2Mb
packet_size: 1KB
dscp: cs1
from..to: !ruby/range 30.0..60.0

Here it’s a little bit more complex, but still human readable. This file also have 2 sections for UDP and TCP traffic, with the following paramters being defined:

-name: I believe it say everything
-host: ServerIP:port
-bandwidth: bandwidth to simulate
-packet size: packet in size in B, KB
-dscp: value
-from..to: !ruby/range: time intervals

After everything is defined, you just have to run Packgen to test.
On Server side first:

packgen -i listen.yml

Then on Client side:

packgen -i sent.yml

Optional you can add the -l file option, which will log the traffic send:

1258663872.6248 SEND dest=10.10.10.100:16385
1258663882.62591 SEND dest=10.10.10.100:5001
1258663895.65219 SEND dest=10.10.10.100:5002
1258663905.66876 SEND dest=10.10.10.100:5003
1258663933.72797 STOP dest=10.10.10.100:16385

or received:

1258663869.80496 LISTEN port=16384 proto=udp
1258663869.81079 LISTEN port=16385 proto=udp
1258663869.81441 LISTEN port=5002 proto=tcp
1258663869.81506 LISTEN port=5003 proto=tcp
1258663872.5886 RECV sent_at=1258663872.64102 flow=0 size=252 id=6
1258663872.58893 RECV sent_at=1258663872.64613 flow=0 size=252 id=7
1258663872.58903 RECV sent_at=1258663872.64719 flow=0 size=252 id=8
1258663872.58915 RECV sent_at=1258663872.65052 flow=0 size=252 id=9
1258663872.58924 RECV sent_at=1258663872.6742 flow=0 size=252 id=10

The configuration files and logs excerpt were from my AutoQos test. If you have any issues with using it, please contact me, or just check in details the documentation from developers site.

Published by

Calin

Calin is a network engineer, with more than 20 years of experience in designing, installing, troubleshooting, and maintaining large enterprise WAN and LAN networks.

13 thoughts on “Great tool for testing QoS implementation”

  1. First of all. Thanks very much for your useful post.
     
    I just came across your blog and wanted to drop you a note telling you how impressed I was with the information you have posted here.
     
    Please let me introduce you some info related to this post and I hope that it is useful for software testing community.
     
    There is a good Software Testing resource site, Have alook
     
    http://SoftwareTestingNet.com
     
    simi

  2. hello ,
    I used this tool to send UDP packets with dscp marking.
    However when I capture the packets on the server side.
    The TOS is field is set 0 (default ) .can you help me regarding this.
    I tried to give all the options in dscp. Please help me.

  3. Mithun, do you have any device in the path that is setting the TOS value to zero for all packets? How did you design your topology? I need some more details to help you. You can write to me is here in comments is too much to write.

  4. I would like to thank you for the efforts you have created in writing this article. I’m hoping the same best work from you also in the future as well. In fact your creative composing abilities have motivated me to start my own BlogEngine weblog now.

  5. Hi
    I have installed Ruby 1.9.3, and then installed packgen-0.2 with ruby ./setup.rb command.
    After that I used packgen -i listen.yml (or packgen -i send.yml) command and it showed this error:
    C:packgen-0.2lib>packgen -i listen.yml
    C:/packgen-0.2/lib/packgen.rb:165: syntax error, unexpected ‘:’, expecting keywo
    rd_then or ‘,’ or ‘;’ or ‘n’
    when “Range” : new_options[:ports] = options[‘ports’]
    ^
    C:/packgen-0.2/lib/packgen.rb:166: syntax error, unexpected keyword_when, expect
    ing keyword_end
    when “Fixnum” : new_options[:ports] = [options[‘ports’]]
    ^
    C:/packgen-0.2/lib/packgen.rb:166: syntax error, unexpected ‘:’, expecting keywo
    rd_end
    when “Fixnum” : new_options[:ports] = [options[‘ports’]]
    ^
    C:/packgen-0.2/lib/packgen.rb:168: warning: else without rescue is useless
    C:/packgen-0.2/lib/packgen.rb:267: syntax error, unexpected keyword_end, expecti
    ng $end
    What is wrong or what to do?
    Thanks

  6. Hi
    I have installed Ruby 1.9.3, and then installed packgen-0.2 with ruby ./setup.rb command.
    After that I used packgen -i listen.yml (or packgen -i send.yml) command and it showed this error:
    C:packgen-0.2lib>packgen -i listen.yml
    C:/packgen-0.2/lib/packgen.rb:165: syntax error, unexpected ‘:’, expecting keywo
    rd_then or ‘,’ or ‘;’ or ‘n’
    when “Range” : new_options[:ports] = options[‘ports’]
    ^
    C:/packgen-0.2/lib/packgen.rb:166: syntax error, unexpected keyword_when, expect
    ing keyword_end
    when “Fixnum” : new_options[:ports] = [options[‘ports’]]
    ^
    C:/packgen-0.2/lib/packgen.rb:166: syntax error, unexpected ‘:’, expecting keywo
    rd_end
    when “Fixnum” : new_options[:ports] = [options[‘ports’]]
    ^
    C:/packgen-0.2/lib/packgen.rb:168: warning: else without rescue is useless
    C:/packgen-0.2/lib/packgen.rb:267: syntax error, unexpected keyword_end, expecti
    ng $end
    What is wrong or what to do?
    Thanks

  7. Hi
    I have installed Ruby 1.9.3, and then installed packgen-0.2 with ruby ./setup.rb command.
    After that I used packgen -i listen.yml (or packgen -i send.yml) command and it showed this error:
    C:packgen-0.2lib>packgen -i listen.yml
    C:/packgen-0.2/lib/packgen.rb:165: syntax error, unexpected ‘:’, expecting keywo
    rd_then or ‘,’ or ‘;’ or ‘n’
    when “Range” : new_options[:ports] = options[‘ports’]
    ^
    C:/packgen-0.2/lib/packgen.rb:166: syntax error, unexpected keyword_when, expect
    ing keyword_end
    when “Fixnum” : new_options[:ports] = [options[‘ports’]]
    ^
    C:/packgen-0.2/lib/packgen.rb:166: syntax error, unexpected ‘:’, expecting keywo
    rd_end
    when “Fixnum” : new_options[:ports] = [options[‘ports’]]
    ^
    C:/packgen-0.2/lib/packgen.rb:168: warning: else without rescue is useless
    C:/packgen-0.2/lib/packgen.rb:267: syntax error, unexpected keyword_end, expecti
    ng $end
    What is wrong or what to do?
    Thanks

    1. Hello Harut,
      That looks like a problem in the code of packgen. Did you modify anything in the packet or do something else in the source code?
      I´ll try to help you, but this never happened to me.

    2. Hi Yotis, I have tried with old version of Ruby 1.8.4 and that error didn’t appear.
      After running “ruby ./setup.rb” command on both sides (showedOK) I run “packgen -i listen.yml” on server side and “packgen -i sent.yml” on client side. In “listen.yml” file I changed host IP 127.0.0.1 to Server IP.
      However, I didn’t see anything. What I did wrong? Thanks for reply

  8. Mr. Yotis, thanks for your forum :)
    i would like to know what linux (Debian or Ubuntu or Centos)
    i need to install packgen without bugs like Harunt .. ??
    to make a perfect replica of your work and test some VoIP
    devices that am using in my university :B

Leave a Reply to men’s slimming undershirtsCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.