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