API Documentation

class trafficdatasetmaker.trafficdatasetmaker.TrafficDatasetMaker(inputfile, outdir, inputfiletype='packets-csv', metadatafile=None, datasets=['packets'], pdu_dtcn_method='heuristic', app_class_method='port_numbers', conn_cluster_method='dbscan', skip_extra_calculations=False)[source]

class to make csv dataset from input pcap or csv file

__init__(inputfile, outdir, inputfiletype='packets-csv', metadatafile=None, datasets=['packets'], pdu_dtcn_method='heuristic', app_class_method='port_numbers', conn_cluster_method='dbscan', skip_extra_calculations=False)[source]
Parameters
  • inputfile (str) – pcap file or csv file containing packets to create dataset for.

  • outdir (str) – output directory to save csv files.

  • inputfiletype (str) – input file type. Has value of either ‘packets-csv’ or ‘pcap’.

  • metadatafile (str, optional) – metadata json file with experiment description.

  • datasets (str, optional) – type of dataset to generate. Has value selected from the set (‘packets’, ‘pdus’, ‘all’).

  • pdu_dtcn_method (str, optional) – method to use to classify packets into pdus. The currently supported methods are: (heuristic,).

  • app_class_method (str, optional) – Method to use to classify packets into apps. The currently supported methods are: (port_numbers,). ndpi and others to be implemented

  • conn_cluster_method (str, optional) – method to use to cluster connections to classes

  • skip-extra-calculations (bool, optional) – Flag to not do calculations for user-sessions, connection-clusters, connection-pools and request bursts

makecsvs()[source]

driver method - calls the classes for extracting dataset from input file

class trafficdatasetmaker.trafficdatasetmakerutils.Trafficdatasetmakerutils[source]

class to modify already created dataset, and also supply utility functions that are be useful by users of trafficdatasetmaker

__init__()[source]
modifydataset(inputdir, outdir, metadatafile)[source]
Parameters
  • inputdir (str) – pcap file to convert

  • outdir (str) – output directory to save modified csv files

  • metadatafile (str) – adjusted metadata json file containing details of changes that should be made to be made to dataset’