| Path: | README |
| Last Update: | Tue May 03 14:12:18 CEST 2005 |
Packgen is a simple network packet generator handling diffserv markers, useful for testing network bandwidth and QoS.
It can generate several flows of data, each having its own properties such as:
For more information about DSCP please read RFC 2474, 2475 and 3260.
See the "Installation" section to know how to install it and the "Examples" section to see how to use it. If you encounter some troubles, take a look at the "Troubleshooting" section.
This is just a 0.1 release but it is already pretty stable and can probably be used. If you find some bugs or have any questions or suggestions, don’t hesitate to send me an email to gmary[at]lunacymaze[dot]org.
To install, it’s very easy. You just have to do the following having the required privileges:
ruby ./setup.rb
To run the unit tests you just have to do:
cd tests
ruby ./ts_all.rb
Packgen is to be used like that:
packgen -i <input_file> [-l log_file]
Here is the example file listen.yml which shows how to listen for flows on the UDP ports 5000 and 5001 and on the TCP ports 5002 and 5003:
LISTEN:
udp:
-
ports: !ruby/range 5000..5001
tcp:
-
ports: !ruby/range 5002..5003
You can see here that Ruby Ranges are used in order to specify that we want to listen on several consecutive ports. However, you can also simply use an Integer port number.
In the following example taken from the send.yml file, we describe the different flows by giving their names, their destination (host:port), the bandwidth they should use, the packet sizes, the time intervals and the DSCP values.
SEND:
udp:
-
name: Voice
host: 127.0.0.1:5000
bandwidth: 700Kb
packet_size: 252B
dscp: cs6
from..to: !ruby/range 0.0..60.0
-
name: Video
host: 127.0.0.1:5001
bandwidth: 2.8Mb
packet_size: 750B
dscp: cs4
from..to: !ruby/range 10.0..60.0
tcp:
-
name: Best Effort
host: 127.0.0.1:5002
bandwidth: 3.2Mb
packet_size: 1KB
from..to: !ruby/range 20.0..60.0
-
name: Background
host: 127.0.0.1:5003
bandwidth: 3.2Mb
packet_size: 1KB
dscp: cs1
from..to: !ruby/range 30.0..60.0
Here is the concatenation of the two previous examples (located in the listen_and_send.yml file). We add time intervals in the listening part in order to quit the program automatically when we’re finished. Note that you need to listen before sending anything!
LISTEN:
udp:
-
ports: !ruby/range 5000..5001
from..to: !ruby/range 0.0..62.0
tcp:
-
ports: !ruby/range 5002..5003
from..to: !ruby/range 0.0..62.0
SEND:
udp:
-
name: Voice
host: 127.0.0.1:5000
bandwidth: 700Kb
packet_size: 252B
dscp: cs6
from..to: !ruby/range 1.0..61.0
-
name: Video
host: 127.0.0.1:5001
bandwidth: 2.8Mb
packet_size: 750B
dscp: cs4
from..to: !ruby/range 11.0..61.0
tcp:
-
name: Best Effort
host: 127.0.0.1:5002
bandwidth: 3.2Mb
packet_size: 1KB
from..to: !ruby/range 21.0..61.0
-
name: Background
host: 127.0.0.1:5003
bandwidth: 3.2Mb
packet_size: 1KB
dscp: cs1
from..to: !ruby/range 31.0..61.0
© Copyright 2005 Ghislain Mary (gmary[at]lunacymaze[dot]org). All Rights Reserved.
Released under the same terms of license as Ruby. See COPYING file for more information.