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