pkt_gen: MoonGen start rates not correct
[vswitchperf.git] / docs / configguide / trafficgen.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3 .. (c) OPNFV, Intel Corporation, AT&T and others.
4
5 ===========================
6 'vsperf' Traffic Gen Guide
7 ===========================
8
9 Overview
10 ---------------------
11 VSPERF supports the following traffic generators:
12
13   * Dummy (DEFAULT): Allows you to use your own external
14     traffic generator.
15   * IXIA (IxNet and IxOS)
16   * Spirent TestCenter
17   * Xena Networks
18   * MoonGen
19
20 To see the list of traffic gens from the cli:
21
22 .. code-block:: console
23
24     $ ./vsperf --list-trafficgens
25
26 This guide provides the details of how to install
27 and configure the various traffic generators.
28
29 Background Information
30 ----------------------
31 The traffic default configuration can be found in
32 tools/pkt_gen/trafficgen/trafficgenhelper.py, and is configured as
33 follows:
34
35 .. code-block:: console
36
37     TRAFFIC_DEFAULTS = {
38         'l2': {
39             'framesize': 64,
40             'srcmac': '00:00:00:00:00:00',
41             'dstmac': '00:00:00:00:00:00',
42         },
43         'l3': {
44             'proto': 'tcp',
45             'srcip': '1.1.1.1',
46             'dstip': '90.90.90.90',
47         },
48         'l4': {
49             'srcport': 3000,
50             'dstport': 3001,
51         },
52         'vlan': {
53             'enabled': False,
54             'id': 0,
55             'priority': 0,
56             'cfi': 0,
57         },
58     }
59
60 The framesize paramter can be overridden from the configuration
61 files by adding the following to your custom configuration file
62 ``10_custom.conf``:
63
64 .. code-block:: console
65
66     TRAFFICGEN_PKT_SIZES = (64, 128,)
67
68 OR from the commandline:
69
70 .. code-block:: console
71
72     $ ./vsperf --test-params "pkt_sizes=x,y" $TESTNAME
73
74 You can also modify the traffic transmission duration and the number
75 of trials run by the traffic generator by extending the example
76 commandline above to:
77
78 .. code-block:: console
79
80     $ ./vsperf --test-params "pkt_sizes=x,y;duration=10;rfc2455_trials=3" $TESTNAME
81
82 Dummy Setup
83 ------------
84 To select the Dummy generator please add the following to your
85 custom configuration file ``10_custom.conf``.
86
87
88 .. code-block:: console
89
90      TRAFFICGEN = 'Dummy'
91
92 OR run ``vsperf`` with the ``--trafficgen`` argument
93
94 .. code-block:: console
95
96     $ ./vsperf --trafficgen Dummy $TESTNAME
97
98 Where $TESTNAME is the name of the vsperf test you would like to run.
99 This will setup the vSwitch and the VNF (if one is part of your test)
100 print the traffic configuration and prompt you to transmit traffic
101 when the setup is complete.
102
103 .. code-block:: console
104
105     Please send 'continuous' traffic with the following stream config:
106     30mS, 90mpps, multistream False
107     and the following flow config:
108     {
109         "flow_type": "port",
110         "l3": {
111             "srcip": "1.1.1.1",
112             "proto": "tcp",
113             "dstip": "90.90.90.90"
114         },
115         "traffic_type": "continuous",
116         "multistream": 0,
117         "bidir": "True",
118         "vlan": {
119             "cfi": 0,
120             "priority": 0,
121             "id": 0,
122             "enabled": false
123         },
124         "frame_rate": 90,
125         "l2": {
126             "dstport": 3001,
127             "srcport": 3000,
128             "dstmac": "00:00:00:00:00:00",
129             "srcmac": "00:00:00:00:00:00",
130             "framesize": 64
131         }
132     }
133     What was the result for 'frames tx'?
134
135 When your traffic gen has completed traffic transmission and provided
136 the results please input these at the vsperf prompt. vsperf will try
137 to verify the input:
138
139 .. code-block:: console
140
141     Is '$input_value' correct?
142
143 Please answer with y OR n.
144
145 VPSERF will ask you for:
146   * Result for 'frames tx'
147   * Result for 'frames rx'
148   * Result for 'min latency'
149   * Result for 'max latency'
150   * Result for 'avg latency'
151
152 Finally vsperf will print out the results for your test and generate the
153 appropriate logs and csv files.
154
155
156 IXIA Setup
157 ----------
158
159 On the CentOS 7 system
160 ~~~~~~~~~~~~~~~~~~~~~~
161
162 You need to install IxNetworkTclClient$(VER\_NUM)Linux.bin.tgz.
163
164 On the IXIA client software system
165 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
166
167 Find the IxNetwork TCL server app (start -> All Programs -> IXIA ->
168 IxNetwork -> IxNetwork\_$(VER\_NUM) -> IxNetwork TCL Server)
169
170 Right click on IxNetwork TCL Server, select properties - Under shortcut tab in
171 the Target dialogue box make sure there is the argument "-tclport xxxx"
172 where xxxx is your port number (take note of this port number you will
173 need it for the 10\_custom.conf file).
174
175 .. image:: TCLServerProperties.png
176
177 Hit Ok and start the TCL server application
178
179 Spirent Setup
180 -------------
181
182 Spirent installation files and instructions are available on the
183 Spirent support website at:
184
185 http://support.spirent.com
186
187 Select a version of Spirent TestCenter software to utilize. This example
188 will use Spirent TestCenter v4.57 as an example. Substitute the appropriate
189 version in place of 'v4.57' in the examples, below.
190
191 On the CentOS 7 System
192 ~~~~~~~~~~~~~~~~~~~~~~
193
194 Download and install the following:
195
196 Spirent TestCenter Application, v4.57 for 64-bit Linux Client
197
198 Spirent Virtual Deployment Service (VDS)
199 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
200
201 Spirent VDS is required for both TestCenter hardware and virtual
202 chassis in the vsperf environment. For installation, select the version
203 that matches the Spirent TestCenter Application version. For v4.57,
204 the matching VDS version is 1.0.55. Download either the ova (VMware)
205 or qcow2 (QEMU) image and create a VM with it. Initialize the VM
206 according to Spirent installation instructions.
207
208 Using Spirent TestCenter Virtual (STCv)
209 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
210
211 STCv is available in both ova (VMware) and qcow2 (QEMU) formats. For
212 VMware, download:
213
214 Spirent TestCenter Virtual Machine for VMware, v4.57 for Hypervisor - VMware ESX.ESXi
215
216 Virtual test port performance is affected by the hypervisor configuration. For
217 best practice results in deploying STCv, the following is suggested:
218
219 - Create a single VM with two test ports rather than two VMs with one port each
220 - Set STCv in DPDK mode
221 - Give STCv 2*n + 1 cores, where n = the number of ports. For vsperf, cores = 5.
222 - Turning off hyperthreading and pinning these cores will improve performance
223 - Give STCv 2 GB of RAM
224
225 To get the highest performance and accuracy, Spirent TestCenter hardware is
226 recommended. vsperf can run with either stype test ports.
227
228 Using STC REST Client
229 ~~~~~~~~~~~~~~~~~~~~~
230 The stcrestclient package provides the stchttp.py ReST API wrapper module.
231 This allows simple function calls, nearly identical to those provided by
232 StcPython.py, to be used to access TestCenter server sessions via the
233 STC ReST API. Basic ReST functionality is provided by the resthttp module,
234 and may be used for writing ReST clients independent of STC.
235
236 - Project page: <https://github.com/Spirent/py-stcrestclient>
237 - Package download: <http://pypi.python.org/pypi/stcrestclient>
238
239 To use REST interface, follow the instructions in the Project page to
240 install the package. Once installed, the scripts named with 'rest' keyword
241 can be used. For example: testcenter-rfc2544-rest.py can be used to run
242 RFC 2544 tests using the REST interface.
243
244 Xena Networks
245 -------------
246
247 Installation
248 ~~~~~~~~~~~~
249
250 Xena Networks traffic generator requires certain files and packages to be
251 installed. It is assumed the user has access to the Xena2544.exe file which
252 must be placed in VSPerf installation location under the tools/pkt_gen/xena
253 folder. Contact Xena Networks for the latest version of this file. The user
254 can also visit www.xenanetworks/downloads to obtain the file with a valid
255 support contract.
256
257 **Note** VSPerf has been fully tested with version v2.43 of Xena2544.exe
258
259 To execute the Xena2544.exe file under Linux distributions the mono-complete
260 package must be installed. To install this package follow the instructions
261 below. Further information can be obtained from
262 http://www.mono-project.com/docs/getting-started/install/linux/
263
264 .. code-block:: console
265
266     rpm --import "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"
267     yum-config-manager --add-repo http://download.mono-project.com/repo/centos/
268     yum -y install mono-complete
269
270 To prevent gpg errors on future yum installation of packages the mono-project
271 repo should be disabled once installed.
272
273 .. code-block:: console
274
275     yum-config-manager --disable download.mono-project.com_repo_centos_
276
277 Configuration
278 ~~~~~~~~~~~~~
279
280 Connection information for your Xena Chassis must be supplied inside the
281 ``10_custom.conf`` or ``03_custom.conf`` file. The following parameters must be
282 set to allow for proper connections to the chassis.
283
284 .. code-block:: console
285
286     TRAFFICGEN_XENA_IP = ''
287     TRAFFICGEN_XENA_PORT1 = ''
288     TRAFFICGEN_XENA_PORT2 = ''
289     TRAFFICGEN_XENA_USER = ''
290     TRAFFICGEN_XENA_PASSWORD = ''
291     TRAFFICGEN_XENA_MODULE1 = ''
292     TRAFFICGEN_XENA_MODULE2 = ''
293
294
295 MoonGen
296 -------
297
298 Installation
299 ~~~~~~~~~~~~
300
301 MoonGen architecture overview and general installation instructions
302 can be found here:
303
304 https://github.com/emmericp/MoonGen
305
306 * Note:  Today, MoonGen with VSPERF only supports 10Gbps line speeds.
307
308 For VSPerf use, MoonGen should be cloned from here (as opposed to the afore
309 mentioned GitHub):
310
311 git clone https://github.com/atheurer/MoonGen
312
313 and use the opnfv-stable branch:
314
315 git checkout opnfv-stable
316
317 VSPerf uses a particular example script under the examples directory within
318 the MoonGen project:
319
320 MoonGen/examples/opnfv-vsperf.lua
321
322 Follow MoonGen set up instructions here:
323
324 https://github.com/atheurer/MoonGen/blob/opnfv-stable/MoonGenSetUp.html
325
326 Note one will need to set up ssh login to not use passwords between the server
327 running MoonGen and the device under test (running the VSPERF test
328 infrastructure).  This is because VSPERF on one server uses 'ssh' to
329 configure and run MoonGen upon the other server.
330
331 One can set up this ssh access by doing the following on both servers:
332
333 .. code-block:: console
334
335     ssh-keygen -b 2048 -t rsa
336     ssh-copy-id <other server>