CSIT-1430 Update release notes
[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://wiki.fd.io/view/TRex>`_ is used for all
8 CSIT performance tests. TRex stateless mode is used to measure NDR and
9 PDR throughputs using binary search (NDR and PDR discovery tests) and
10 for quick checks of DUT performance against the reference NDRs (NDR
11 check tests) for specific configuration.
12
13 TRex is installed and run on the TG compute node. The typical procedure
14 is:
15
16 - If the TRex is not already installed on TG, it is installed in the
17   suite setup phase - see `TRex intallation`_.
18 - TRex configuration is set in its configuration file
19   ::
20
21   /etc/trex_cfg.yaml
22
23 - TRex is started in the background mode
24   ::
25
26   $ sh -c 'cd <t-rex-install-dir>/scripts/ && sudo nohup ./t-rex-64 -i -c 7 --iom 0 > /tmp/trex.log 2>&1 &' > /dev/null
27
28 - There are traffic streams dynamically prepared for each test, based on traffic
29   profiles. The traffic is sent and the statistics obtained using
30   :command:`trex_stl_lib.api.STLClient`.
31
32 Measuring Packet Loss
33 ~~~~~~~~~~~~~~~~~~~~~
34
35 Following sequence is followed to measure packet loss:
36
37 - Create an instance of STLClient.
38 - Connect to the client.
39 - Add all streams.
40 - Clear statistics.
41 - Send the traffic for defined time.
42 - Get the statistics.
43
44 If there is a warm-up phase required, the traffic is sent also before
45 test and the statistics are ignored.
46
47 Measuring Latency
48 ~~~~~~~~~~~~~~~~~
49
50 If measurement of latency is requested, two more packet streams are
51 created (one for each direction) with TRex flow_stats parameter set to
52 STLFlowLatencyStats. In that case, returned statistics will also include
53 min/avg/max latency values.