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