Walk Through Example - Creating Network Traffic Models With trafficmodelmakerΒΆ

In this example, we create a network traffic model from an input dataset that was created with the trafficdatasetmaker application. In creating the traffic model, we use the modeltype4 modeling method.

  1. Follow the steps in Installing trafficmodelmaker to download trafficmodelmaker source file and install.

  2. After installing, change directory to the test folder within trafficmodelmaker root:

    cd test
    
  3. In the test directory you will find a sample packets csv dataset file (test1.csv) for which we will be creating a traffic model in the test1_out folder. Run the command below to obtain the traffic model file.:

    trafficmodelmaker -v -i ./test1.csv -o ./test1_out -t packets-csv -m Type4
    

This will create a traffic model file (app_model.json), a user sessions file (netxtics.json), a dataset of PDUs, and an updated metadata file, saving all into the test1_out directory. Please take a look at the files in test1_out directory to examine the output. Full descriptions for the files can be found in Usage - Creating models for realistic network traffic generation with trafficmodelmaker.


Alternatively: the example above can be executed with the commands:

./test1

Or with:

python3 test1.py

Or within a python3 shell environment

from trafficmodelmaker.trafficmodelmaker import Trafficmodelmaker
modelmaker = Trafficmodelmaker('test1.csv', 'test1_out', 'packets-csv')
modelmaker.make_models()