Revert "fix(IPsecUtil): Delete keywords no longer used"
[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 majority of
8 CSIT performance tests. TRex stateless mode is used to measure NDR and PDR
9 throughputs using MLRsearch and to measure maximum transfer rate in MRR tests.
10
11 TRex is installed and run on the TG compute node. The typical procedure is:
12
13 - TRex configuration is set in its configuration file
14
15   ::
16
17       $ sudo -E -S sh -c 'cat << EOF > /etc/trex_cfg.yaml
18       - version: 2
19         c: 15
20         limit_memory: 8192
21         interfaces: ["${pci1}","${pci2}"]
22         port_info:
23           - dest_mac: [${dest_mac1}]
24             src_mac: [${src_mac1}]
25           - dest_mac: [${dest_mac2}]
26             src_mac: [${src_mac2}]
27         platform :
28           master_thread_id: 0
29           latency_thread_id: 16
30           dual_if:
31               - socket: 0
32                 threads: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
33       EOF'
34
35 - TRex is started in the interactive mode as a background service
36
37   ::
38
39       $ sh -c 'cd <t-rex-install-dir>/scripts/ && \
40         sudo nohup ./t-rex-64 -i --prefix $(hostname) --hdrh --no-scapy-server \
41         > /tmp/trex.log 2>&1 &' > /dev/null
42
43 - There are traffic streams dynamically prepared for each test, based on traffic
44   profiles. The traffic is sent and the statistics obtained using API
45   :command:`trex.stl.api.STLClient`.
46
47 Measuring Packet Loss
48 ~~~~~~~~~~~~~~~~~~~~~
49
50 Following sequence is followed to measure packet loss:
51
52 - Create an instance of STLClient.
53 - Connect to the client.
54 - Add all streams.
55 - Clear statistics.
56 - Send the traffic for defined time.
57 - Get the statistics.
58
59 If there is a warm-up phase required, the traffic is sent also before
60 test and the statistics are ignored.
61
62 Measuring Latency
63 ~~~~~~~~~~~~~~~~~
64
65 If measurement of latency is requested, two more packet streams are
66 created (one for each direction) with TRex flow_stats parameter set to
67 STLFlowLatencyStats. In that case, returned statistics will also include
68 min/avg/max latency values and encoded HDRHistogram data.