Network Traffic Generator
Network Traffic Generator — User Manual
How to Use
Our NTG support path complete and syntax complete. Thus, you can use tab and arrow keys to type the command.

If your’e configuration file and command are correct, NTG will start generate flows as below:
However, If you have syntax error or configuration file error, it will show some error words as below:

Notice
- Our NTG do not support experiment interrupt. Thus, if you want to interrupt one running experiment, it will immediately shut down the NTG as below:

How to use NTG in Mininet
Pre-request
- You must have installed
Mininet,Ryu, andNDTwin. - You must have downloaded
NTGand move those files and directories into folders with Mininet topology file written inpython. - You must modify the
NTG.yaml’shost_fileinto./setting/Mininet.yamland parameters in./setting/Mininet.yaml.
Demonstrating Mininet topology
from mininet.topo import Topo
from mininet.net import Mininet
from mininet.cli import CLI
from mininet.node import RemoteController
class MyTopo(Topo):
def build(self):
s1 = self.addSwitch("s1")
h1 = self.addHost("h1")
h2 = self.addHost("h2")
self.addLink(h1,s1)
self.addLink(h2,s1)
if __name__ == "__main__":
topo = MyTopo()
net = Mininet(
topo=topo,
controller=RemoteController)
net.start()
CLI(net)
Start Up Process
- Modify the topology
pythoncode to importinteractive_commands.pyand replace Mininet’s CLI to our NTG’s CLI.
from mininet.topo import Topo
from mininet.net import Mininet
#from mininet.cli import CLI
from mininet.node import RemoteController
from interactive_commands import interactive_command_mode
class MyTopo(Topo):
def build(self):
s1 = self.addSwitch("s1")
h1 = self.addHost("h1")
h2 = self.addHost("h2")
self.addLink(h1,s1)
self.addLink(h2,s1)
if __name__ == "__main__":
topo = MyTopo()
net = Mininet(
topo=topo,
controller=RemoteController)
net.start()
#CLI(net)
interactive_command_mode(net)
- Start the Ryu Controller.
ryu-manager intelligent_router.py ryu.app.rest_topology ryu.app.ofctl_rest --ofp-tcp-listen-port 6633 --observe-link

- Start the topology.
sudo python ./topo.py

- Since NTG need some topology information from NDTwin, you need to wait for the Ryu Controller to install all flow rules into switches.

- Start the NDTwin.
sudo bin/ndt_main

- Now, you can start using NTG

How to use NTG in Hardware
Pre-request
- You must have installed
Ryu, andNDTwin. - You must have downloaded
NTG. - You must modify the
NTG.yaml’shost_fileinto./setting/Hardware.yamland parameters in./setting/Hardware.yaml. - For hardware testbed, we use master and worker architecture to generate flows. Thus, you need to prepare some machines running in Linux and install python libraries as below and move
worker_node.pyinto those machines:
- fastapi
- uvicorn (used to start the API server)
- pydantic
- loguru
- orjson (required by ORJSONResponse)
bash pip install --upgrade pip pip install fastapi "uvicorn[standard]" pydantic loguru orjson
Also, you need to make sure NTG can connect to those worker nodes.
Start Up Process
- Start the Ryu Controller
ryu-manager intelligent_router.py ryu.app.rest_topology ryu.app.ofctl_rest --ofp-tcp-listen-port 6633 --observe-link
- Start the NDTwin
sudo bin/ndt_main
- Start the NTG
python interactive_commands.py
- Manually Start worker node API servers on machines if the worker nodes do not start up correctly.
uvicorn worker_node:app --host 0.0.0.0 --port 8000
- Now, you can use
NTGto generate flows.
Tips
- Ensure all
data.worker_node_serverURLs inHardware.yamlare reachable and the servers are running. - Keep
flow_distance_probabilityandflow_type_probabilityvalues normalized (sum to 1.0) for each section. - Validate parameter names and formats in
flow_parametersto match the selected types. - For multiple consecutive experiments, the tool resets internal state after completion.
- For one experiment, it will be ended only when all of flows, exclude flows with unlimited duration, are fininshed.
Troubleshooting
- If flows do not start:
- Confirm API servers are up, ports opened, and the
interactive_commands.pyprocess can reach them. - It may due to the CPU resources are not enough for you’re flow configurations. Please lower theflow numbersor parameters to fix the question. - If Nornir inventory errors occur: double-check that
groupsis a YAML list and host keys/fields are correctly indented. - If
uvicornfails to start: verify your virtualenv and ensureuvicornis installed (pip install uvicorn fastapi).