blob: e1ff98f1dc83594880fec9b7334d416eca50ac6d [file] [log] [blame]
jdeniscoad4426e2018-11-26 15:15:09 -05001.. _trex2:
2
3TRex Stateless Mode
4===================
5
6TRex can also be run in a stateless mode. For a detailed description of TRex stateless support
7please refer to `TRex Stateless Support <https://trex-tgn.cisco.com/trex/doc/trex_stateless.html>`_.
8
9In this section we show some simple examples using TRex stateless mode. These examples use
10the configuration as shown in the section :ref:`trex`. These examples we will be using VMWare VMs.
11
12To use TRex stateless mode we use 2 terminals on the TRex traffic generator node. One terminal will
13be used for the TRex console and one to monitor the traffic.
14
15In one of terminals start TRex in stateless mode. Use *Ctrl-C* to stop.
16
17.. code-block:: console
18
19 # cd v2.46/
20 # ./trex -i
Nathan Skrzypczak9ad39c02021-08-19 11:38:06 +020021 -Per port stats table
22 ports | 0 | 1 | 2 | 3
jdeniscoad4426e2018-11-26 15:15:09 -050023 -----------------------------------------------------------------------------------------
Nathan Skrzypczak9ad39c02021-08-19 11:38:06 +020024 opackets | 0 | 0 | 0 | 0
25 obytes | 0 | 0 | 0 | 0
26 ipackets | 6 | 6 | 5 | 5
27 ibytes | 384 | 384 | 320 | 320
28 ierrors | 0 | 0 | 0 | 0
29 oerrors | 0 | 0 | 0 | 0
30 Tx Bw | 0.00 bps | 0.00 bps | 0.00 bps | 0.00 bps
31
32 -Global stats enabled
jdeniscoad4426e2018-11-26 15:15:09 -050033 Cpu Utilization : 0.0 %
Nathan Skrzypczak9ad39c02021-08-19 11:38:06 +020034 Platform_factor : 1.0
35 Total-Tx : 0.00 bps
36 Total-Rx : 238.30 bps
37 Total-PPS : 0.00 pps
38 Total-CPS : 0.00 cps
39
40 Expected-PPS : 0.00 pps
41 Expected-CPS : 0.00 cps
42 Expected-BPS : 0.00 bps
43
44 Active-flows : 0 Clients : 0 Socket-util : 0.0000 %
45 Open-flows : 0 Servers : 0 Socket : 0 Socket/Clients : -nan
46 drop-rate : 0.00 bps
47 current time : 21.4 sec
48 test duration : 0.0 sec
jdeniscoad4426e2018-11-26 15:15:09 -050049 *** TRex is shutting down - cause: 'CTRL + C detected'
Nathan Skrzypczak9ad39c02021-08-19 11:38:06 +020050 All cores stopped !!
jdeniscoad4426e2018-11-26 15:15:09 -050051
52In the other terminal start the TRex console. With this console we will execute the TRex commands.
53
54.. code-block:: console
55
56 # cd v2.46/
57 # ./trex -console
Nathan Skrzypczak9ad39c02021-08-19 11:38:06 +020058
Paul Vinciguerra7fa3dd22019-10-27 17:28:10 -040059 Using 'python' as Python interpreter
Nathan Skrzypczak9ad39c02021-08-19 11:38:06 +020060
61
jdeniscoad4426e2018-11-26 15:15:09 -050062 Connecting to RPC server on localhost:4501 [SUCCESS]
Nathan Skrzypczak9ad39c02021-08-19 11:38:06 +020063
64
jdeniscoad4426e2018-11-26 15:15:09 -050065 Connecting to publisher server on localhost:4500 [SUCCESS]
Nathan Skrzypczak9ad39c02021-08-19 11:38:06 +020066
67
jdeniscoad4426e2018-11-26 15:15:09 -050068 Acquiring ports [0, 1, 2, 3]: [SUCCESS]
Nathan Skrzypczak9ad39c02021-08-19 11:38:06 +020069
70
jdeniscoad4426e2018-11-26 15:15:09 -050071 Server Info:
Nathan Skrzypczak9ad39c02021-08-19 11:38:06 +020072
jdeniscoad4426e2018-11-26 15:15:09 -050073 Server version: v2.46 @ STL
74 Server mode: Stateless
75 Server CPU: 2 x Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz
Nathan Skrzypczak9ad39c02021-08-19 11:38:06 +020076 Ports count: 4 x 10Gbps @ VMXNET3 Ethernet Controller
77
jdeniscoad4426e2018-11-26 15:15:09 -050078 -=TRex Console v3.0=-
Nathan Skrzypczak9ad39c02021-08-19 11:38:06 +020079
jdeniscoad4426e2018-11-26 15:15:09 -050080 Type 'help' or '?' for supported actions
81 trex>
82
83Start some traffic using the **stl/imix.py** traffic profile.
84
85.. code-block:: console
86
87 trex>start -f ./stl/imix.py -p 0 1 2 3 -m 9475mbps
Nathan Skrzypczak9ad39c02021-08-19 11:38:06 +020088
jdeniscoad4426e2018-11-26 15:15:09 -050089 Removing all streams from port(s) [0, 1, 2, 3]: [SUCCESS]
Nathan Skrzypczak9ad39c02021-08-19 11:38:06 +020090
91
jdeniscoad4426e2018-11-26 15:15:09 -050092 Attaching 3 streams to port(s) [0]: [SUCCESS]
Nathan Skrzypczak9ad39c02021-08-19 11:38:06 +020093
94
jdeniscoad4426e2018-11-26 15:15:09 -050095 Attaching 3 streams to port(s) [1]: [SUCCESS]
Nathan Skrzypczak9ad39c02021-08-19 11:38:06 +020096
97
jdeniscoad4426e2018-11-26 15:15:09 -050098 Attaching 3 streams to port(s) [2]: [SUCCESS]
Nathan Skrzypczak9ad39c02021-08-19 11:38:06 +020099
100
jdeniscoad4426e2018-11-26 15:15:09 -0500101 Attaching 3 streams to port(s) [3]: [SUCCESS]
Nathan Skrzypczak9ad39c02021-08-19 11:38:06 +0200102
103
jdeniscoad4426e2018-11-26 15:15:09 -0500104 Starting traffic on port(s) [0, 1, 2, 3]: [SUCCESS]
Nathan Skrzypczak9ad39c02021-08-19 11:38:06 +0200105
jdeniscoad4426e2018-11-26 15:15:09 -0500106 80.94 [ms]
Nathan Skrzypczak9ad39c02021-08-19 11:38:06 +0200107
jdeniscoad4426e2018-11-26 15:15:09 -0500108 trex>
109
110The **-f ./stl/imix.py** argument specifies the file that is used to create the
111traffic profile. The argument **-p 0 1 2 3** specifies the ports to be used.
112The argument **-m 9475mbps** the number of packets/sec to be used.
113All the arguments can be displayed with the **-h** argument.
114
115In the other terminal the display shows the statistics related the traffic flows.
116
117.. code-block:: console
118
Nathan Skrzypczak9ad39c02021-08-19 11:38:06 +0200119 -Per port stats table
jdeniscoad4426e2018-11-26 15:15:09 -0500120 ports | 0 | 1 | 2 | 3
121 -----------------------------------------------------------------------------------------
Nathan Skrzypczak9ad39c02021-08-19 11:38:06 +0200122 opackets | 789907304 | 789894738 | 790017701 | 790017132
123 obytes | 285397726750 | 285392406754 | 285406864578 | 285405883070
124 ipackets | 1563501970 | 45 | 1563504693 | 44
125 ibytes | 564870783050 | 2880 | 564873491682 | 2816
126 ierrors | 15728759 | 0 | 15732451 | 0
127 oerrors | 0 | 0 | 0 | 0
128 Tx Bw | 606.55 Mbps | 606.19 Mbps | 606.25 Mbps | 606.51 Mbps
jdeniscoad4426e2018-11-26 15:15:09 -0500129
Nathan Skrzypczak9ad39c02021-08-19 11:38:06 +0200130 -Global stats enabled
131 Cpu Utilization : 100.0 % 2.4 Gb/core
132 Platform_factor : 1.0
133 Total-Tx : 2.43 Gbps
134 Total-Rx : 2.40 Gbps
135 Total-PPS : 841.44 Kpps
136 Total-CPS : 0.00 cps
137
138 Expected-PPS : 0.00 pps
139 Expected-CPS : 0.00 cps
140 Expected-BPS : 0.00 bps
141
142 Active-flows : 0 Clients : 0 Socket-util : 0.0000 %
143 Open-flows : 0 Servers : 0 Socket : 0 Socket/Clients : -nan
144 Total_queue_full : 6529970196
145 drop-rate : 0.00 bps
146 current time : 4016.8 sec
147 test duration : 0.0 sec
148
jdeniscoad4426e2018-11-26 15:15:09 -0500149More statistics can be displayed on the TRex console using the **tui** command.
150
151.. code-block:: console
152
153 trex>tui
Nathan Skrzypczak9ad39c02021-08-19 11:38:06 +0200154
Paul Vinciguerra7fa3dd22019-10-27 17:28:10 -0400155 Global Statistics
Nathan Skrzypczak9ad39c02021-08-19 11:38:06 +0200156
157 connection : localhost, Port 4501 total_tx_L2 : 2.45 Gb/sec
158 version : STL @ v2.46 total_tx_L1 : 2.59 Gb/sec
159 cpu_util. : 99.89% @ 2 cores (1 per port) total_rx : 2.42 Gb/sec
160 rx_cpu_util. : 4.03% / 837.39 Kpkt/sec total_pps : 846.96 Kpkt/sec
161 async_util. : 0.05% / 1.76 KB/sec drop_rate : 0 b/sec
162 queue_full : 42,750,771 pkts
163
jdeniscoad4426e2018-11-26 15:15:09 -0500164 Port Statistics
Nathan Skrzypczak9ad39c02021-08-19 11:38:06 +0200165
166 port | 0 | 1 | 2 | 3 | total
jdeniscoad4426e2018-11-26 15:15:09 -0500167 -----------+-------------------+-------------------+-------------------+-------------------+------------------
Nathan Skrzypczak9ad39c02021-08-19 11:38:06 +0200168 owner | root | root | root | root |
169 link | UP | UP | UP | UP |
170 state | TRANSMITTING | TRANSMITTING | TRANSMITTING | TRANSMITTING |
171 speed | 10 Gb/s | 10 Gb/s | 10 Gb/s | 10 Gb/s |
172 CPU util. | 99.89% | 99.89% | 99.89% | 99.89% |
173 -- | | | | |
174 Tx bps L2 | 612.76 Mbps | 613.07 Mbps | 612.52 Mbps | 612.77 Mbps | 2.45 Gbps
175 Tx bps L1 | 646.64 Mbps | 646.96 Mbps | 646.4 Mbps | 646.64 Mbps | 2.59 Gbps
176 Tx pps | 211.72 Kpps | 211.8 Kpps | 211.73 Kpps | 211.71 Kpps | 846.96 Kpps
177 Line Util. | 6.47 % | 6.47 % | 6.46 % | 6.47 % |
178 --- | | | | |
179 Rx bps | 1.21 Gbps | \u25bc\u25bc\u25bc 23.03 bps | 1.21 Gbps | 5.94 bps | 2.42 G bps
180 Rx pps | 418.59 Kpps | 0.04 pps | 418.77 Kpps | 0.01 pps | 837.36 Kpps
181 ---- | | | | |
182 opackets | 5227126 | 5227271 | 5432528 | 5432354 | 21319279
183 ipackets | 10526000 | 5 | 10527054 | 4 | 21053063
184 obytes | 1890829910 | 1891039152 | 1965259162 | 1965124338 | 7712252562
185 ibytes | 3807894454 | 320 | 3808149896 | 256 | 7616044926
186 tx-pkts | 5.23 Mpkts | 5.23 Mpkts | 5.43 Mpkts | 5.43 Mpkts | 21.32 Mpkts
187 rx-pkts | 10.53 Mpkts | 5 pkts | 10.53 Mpkts | 4 pkts | 21.05 Mpkts
188 tx-bytes | 1.89 GB | 1.89 GB | 1.97 GB | 1.97 GB | 7.71 GB
189 rx-bytes | 3.81 GB | 320 B | 3.81 GB | 256 B | 7.62 GB
190 ----- | | | | |
191 oerrors | 0 | 0 | 0 | 0 | 0
192 ierrors | 133,370 | 0 | 132,529 | 0 | 265,899