A script to conduct a TRex trial using a JSON file to define the stream properties.
The JSON file contains an object with a single property, "streams". The "streams" property is an array of traffic streams that are defined by the following parameters:
-
flows - required, number of active flows
-
frame_size - required, frame size in bytes
-
flow_mods - required, flow mod object ie. "function:create_flow_mod_object()"
-
rate - required, frame rate in pps
-
frame_type - optional, type of frames to send, defaults to 'generic', options are: ['generic', 'icmp', 'garp']
-
stream_types - optional, array of stream types, defaults to ['measurement'], options are: ['measurement', 'teaching_warmup', 'teaching_measurement', 'ddos' ]
-
latency - optional, should latency frames be sent for this stream (latency frames only apply to measurement streams), defaults to True, options are: [True, False]
-
latency_only - optional, should this stream only be latency frames, defaults to False, options are: [True, False]
-
protocol - optional, what protocol is used for this stream, defaults to 'UDP', options are: ['UDP', 'TCP']
-
traffic_direction - optional, what direction is the traffic flowing, defaults to 'bidirectional', options are: ['bidirectional', 'unidirectional', 'revunidirectional']
-
stream_id - optional, an identifier that can be used to identify the stream, if two streams share an identifier they will use the same flow properties (MACs, IPs, etc.), defaults to nothing, is a user defined string
-
offset - optional, a number of seconds to wait before starting the stream, defaults to 0
-
duration - optional, a number of seconds for the stream to run, defaults to the entire measurement period
-
repeat - optional, whether or not the stream should repeat after it finishes, defaults to False, options are: [True, False]
-
repeat_delay - optional, if the stream repeats how long should it wait to start over again, defaults to the offset value
-
repeat_flows - optional, if the stream repeats should it use the same flows, defaults to True, options are [True, False]
-
the_packet - optional, a packet definition to use as the base packet for this stream, ie. "scapy:Ether()/IP()/TCP()/'payload'", when this option is used it overrides 'frame_type', 'protocol', and 'stream_id'.
-
enabled - optional, determines whether the defined stream is actually used to define traffic, can be used to easily turn a stream on or off while testing, defaults to True, options are [True, False]