Skip to content
A powerful traffic generator that can model complex behaviors using an action-dependency graph
C Python CMake Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.


TGen is a C application that generates traffic flows between other Tgen instances. The characteristics of the traffic (e.g., size, timing, number of parallel flows, etc.) can be configured by the user.

TGen can generate complex traffic patterns. Users write relatively simple python scripts to generate graphml files that are then used as TGen configuration files that instruct TGen how to generate traffic.

TGen is used to simulate traffic flows in Shadow, and to monitor Tor performance in OnionPerf


Dependencies in Fedora/RedHat:

sudo yum install cmake glib2 glib2-devel igraph igraph-devel

Dependencies in Ubuntu/Debian:

sudo apt-get install cmake libglib2.0 libglib2.0-dev libigraph0v5 libigraph0-dev

Build with a custom install prefix:

mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/home/$USER/.local

Optionally install to the prefix:

make install


Run TGen with a single argument (the path to a config file). For example, first run a server:

tgen resource/tgen.server.graphml.xml > tgen.server.log

and then run a client that connects to the server:

tgen resource/tgen.webclient.graphml.xml > tgen.client.log

See the resource/ directory for example config files.

More documentation

See doc/ for setup instructions for the TGenTools toolkit that can be used to parse and plot tgen log output.

See doc/ for examples of how to generate TGen config files with embedded traffic models.

See doc/ for the format of the configuration file and the possible options that can be used when generating traffic models.

You can’t perform that action at this time.