d9e7df57d3b881883954acfd68a0dd096cd889ca
[csit.git] / docs / report / introduction / methodology_trex_traffic_generator.rst
1 TRex Traffic Generator
2 ----------------------
3
4 Usage
5 ~~~~~
6
7 `TRex traffic generator <https://trex-tgn.cisco.com>`_ is used for all
8 CSIT performance tests. TRex stateless mode is used to measure NDR and
9 PDR throughputs using MLRsearch and to measure maximum transer rate
10 in MRR tests.
11
12 TRex is installed and run on the TG compute node. The typical procedure is:
13
14 - If the TRex is not already installed on TG, it is installed in the
15   suite setup phase - see `TRex installation`_.
16 - TRex configuration is set in its configuration file
17   ::
18
19   /etc/trex_cfg.yaml
20
21 - TRex is started in the background mode
22   ::
23
24   $ sh -c 'cd <t-rex-install-dir>/scripts/ && sudo nohup ./t-rex-64 -i --prefix $(hostname) --hdrh --no-scapy-server > /tmp/trex.log 2>&1 &' > /dev/null
25
26 - There are traffic streams dynamically prepared for each test, based on traffic
27   profiles. The traffic is sent and the statistics obtained using
28   :command:`trex.stl.api.STLClient`.
29
30 Measuring Packet Loss
31 ~~~~~~~~~~~~~~~~~~~~~
32
33 Following sequence is followed to measure packet loss:
34
35 - Create an instance of STLClient.
36 - Connect to the client.
37 - Add all streams.
38 - Clear statistics.
39 - Send the traffic for defined time.
40 - Get the statistics.
41
42 If there is a warm-up phase required, the traffic is sent also before
43 test and the statistics are ignored.
44
45 Measuring Latency
46 ~~~~~~~~~~~~~~~~~
47
48 If measurement of latency is requested, two more packet streams are
49 created (one for each direction) with TRex flow_stats parameter set to
50 STLFlowLatencyStats. In that case, returned statistics will also include
51 min/avg/max latency values and encoded HDRHstogram data.