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