Merge "paths: Support binary packages"
[vswitchperf.git] / docs / userguide / integration.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 Integration tests
6 =================
7
8 VSPERF includes a set of integration tests defined in conf/integration.
9 These tests can be run by specifying --integration as a parameter to vsperf.
10 Current tests in conf/integration include switch functionality and Overlay
11 tests.
12
13 Tests in the conf/integration can be used to test scaling of different switch
14 configurations by adding steps into the test case.
15
16 For the overlay tests VSPERF supports VXLAN, GRE and GENEVE tunneling protocols.
17 Testing of these protocols is limited to unidirectional traffic and
18 P2P (Physical to Physical scenarios).
19
20 NOTE: The configuration for overlay tests provided in this guide is for
21 unidirectional traffic only.
22
23 Executing Integration Tests
24 ---------------------------
25
26 To execute integration tests VSPERF is run with the integration parameter. To
27 view the current test list simply execute the following command:
28
29 .. code-block:: console
30
31     ./vsperf --integration --list
32
33 The standard tests included are defined inside the
34 ``conf/integration/01_testcases.conf`` file.
35
36 Test Steps
37 ----------
38
39 Execution of integration tests are done on a step by step work flow starting
40 with step 0 as defined inside the test case. Each step of the test increments
41 the step number by one which is indicated in the log.
42
43 .. code-block:: console
44
45     (testcases.integration) - Step 1 - 'vswitch add_switch ['int_br1']' ... OK
46
47 Each step in the test case is validated. If a step does not pass validation the
48 test will fail and terminate. The test will continue until a failure is detected
49 or all steps pass. A csv report file is generated after a test completes with an
50 OK or FAIL result.
51
52 Test Macros
53 -----------
54
55 Test profiles can include macros as part of the test step. Each step in the
56 profile may return a value such as a port name. Recall macros use #STEP to
57 indicate the recalled value inside the return structure. If the method the
58 test step calls returns a value it can be later recalled, for example:
59
60 .. code-block:: python
61
62     {
63         "Name": "vswitch_add_del_vport",
64         "Deployment": "clean",
65         "Description": "vSwitch - add and delete virtual port",
66         "TestSteps": [
67                 ['vswitch', 'add_switch', 'int_br0'],               # STEP 0
68                 ['vswitch', 'add_vport', 'int_br0'],                # STEP 1
69                 ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],  # STEP 2
70                 ['vswitch', 'del_switch', 'int_br0'],               # STEP 3
71              ]
72     }
73
74 This test profile uses the vswitch add_vport method which returns a string
75 value of the port added. This is later called by the del_port method using the
76 name from step 1.
77
78 Also commonly used steps can be created as a separate profile.
79
80 .. code-block:: python
81
82     STEP_VSWITCH_PVP_INIT = [
83         ['vswitch', 'add_switch', 'int_br0'],           # STEP 0
84         ['vswitch', 'add_phy_port', 'int_br0'],         # STEP 1
85         ['vswitch', 'add_phy_port', 'int_br0'],         # STEP 2
86         ['vswitch', 'add_vport', 'int_br0'],            # STEP 3
87         ['vswitch', 'add_vport', 'int_br0'],            # STEP 4
88     ]
89
90 This profile can then be used inside other testcases
91
92 .. code-block:: python
93
94     {
95         "Name": "vswitch_pvp",
96         "Deployment": "clean",
97         "Description": "vSwitch - configure switch and one vnf",
98         "TestSteps": STEP_VSWITCH_PVP_INIT +
99                      [
100                         ['vnf', 'start'],
101                         ['vnf', 'stop'],
102                      ] +
103                      STEP_VSWITCH_PVP_FINIT
104     }
105
106 HelloWorld and other basic Testcases
107 ------------------------------------
108
109 The following examples are for demonstration purposes.
110 You can run them by copying and pasting into the
111 conf/integration/01_testcases.conf file.
112 A command-line instruction is shown at the end of each
113 example.
114
115 HelloWorld
116 ^^^^^^^^^^
117
118 The first example is a HelloWorld testcase.
119 It simply creates a bridge with 2 physical ports, then sets up a flow to drop
120 incoming packets from the port that was instantiated at the STEP #1.
121 There's no interaction with the traffic generator.
122 Then the flow, the 2 ports and the bridge are deleted.
123 'add_phy_port' method creates a 'dpdk' type interface that will manage the
124 physical port. The string value returned is the port name that will be referred
125 by 'del_port' later on.
126
127 .. code-block:: python
128
129     {
130         "Name": "HelloWorld",
131         "Description": "My first testcase",
132         "Deployment": "clean",
133         "TestSteps": [
134             ['vswitch', 'add_switch', 'int_br0'],   # STEP 0
135             ['vswitch', 'add_phy_port', 'int_br0'], # STEP 1
136             ['vswitch', 'add_phy_port', 'int_br0'], # STEP 2
137             ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
138                 'actions': ['drop'], 'idle_timeout': '0'}],
139             ['vswitch', 'del_flow', 'int_br0'],
140             ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
141             ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
142             ['vswitch', 'del_switch', 'int_br0'],
143         ]
144
145     }
146
147 To run HelloWorld test:
148
149   .. code-block:: console
150
151     ./vsperf --conf-file user_settings.py --integration HelloWorld
152
153 Specify a Flow by the IP address
154 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
155
156 The next example shows how to explicitly set up a flow by specifying a
157 destination IP address.
158 All packets received from the port created at STEP #1 that have a destination
159 IP address = 90.90.90.90 will be forwarded to the port created at the STEP #2.
160
161 .. code-block:: python
162
163     {
164         "Name": "p2p_rule_l3da",
165         "Description": "Phy2Phy with rule on L3 Dest Addr",
166         "Deployment": "clean",
167         "biDirectional": "False",
168         "TestSteps": [
169             ['vswitch', 'add_switch', 'int_br0'],   # STEP 0
170             ['vswitch', 'add_phy_port', 'int_br0'], # STEP 1
171             ['vswitch', 'add_phy_port', 'int_br0'], # STEP 2
172             ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
173                 'dl_type': '0x0800', 'nw_dst': '90.90.90.90', \
174                 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
175             ['trafficgen', 'send_traffic', {'traffic_type' : 'continuous'}],
176             ['vswitch', 'dump_flows', 'int_br0'],   # STEP 5
177             ['vswitch', 'del_flow', 'int_br0'],     # STEP 7 == del-flows
178             ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
179             ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
180             ['vswitch', 'del_switch', 'int_br0'],
181         ]
182     },
183
184 To run the test:
185
186   .. code-block:: console
187
188     ./vsperf --conf-file user_settings.py --integration p2p_rule_l3da
189
190 Multistream feature
191 ^^^^^^^^^^^^^^^^^^^
192
193 The next testcase uses the multistream feature.
194 The traffic generator will send packets with different UDP ports.
195 That is accomplished by using "Stream Type" and "MultiStream" keywords.
196 4 different flows are set to forward all incoming packets.
197
198 .. code-block:: python
199
200     {
201         "Name": "multistream_l4",
202         "Description": "Multistream on UDP ports",
203         "Deployment": "clean",
204         "Stream Type": "L4",
205         "MultiStream": 4,
206         "TestSteps": [
207             ['vswitch', 'add_switch', 'int_br0'],   # STEP 0
208             ['vswitch', 'add_phy_port', 'int_br0'], # STEP 1
209             ['vswitch', 'add_phy_port', 'int_br0'], # STEP 2
210             # Setup Flows
211             ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
212                 'dl_type': '0x0800', 'nw_proto': '17', 'udp_dst': '0', \
213                 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
214             ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
215                 'dl_type': '0x0800', 'nw_proto': '17', 'udp_dst': '1', \
216                 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
217             ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
218                 'dl_type': '0x0800', 'nw_proto': '17', 'udp_dst': '2', \
219                 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
220             ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
221                 'dl_type': '0x0800', 'nw_proto': '17', 'udp_dst': '3', \
222                 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
223             # Send mono-dir traffic
224             ['trafficgen', 'send_traffic', {'traffic_type' : 'continuous', \
225                 'bidir' : 'False'}],
226             # Clean up
227             ['vswitch', 'del_flow', 'int_br0'],
228             ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
229             ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
230             ['vswitch', 'del_switch', 'int_br0'],
231          ]
232     },
233
234 To run the test:
235
236   .. code-block:: console
237
238     ./vsperf --conf-file user_settings.py --integration multistream_l4
239
240 PVP with a VM Replacement
241 ^^^^^^^^^^^^^^^^^^^^^^^^^
242
243 This example launches a 1st VM in a PVP topology, then the VM is replaced
244 by another VM.
245 When VNF setup parameter in ./conf/04_vnf.conf is "QemuDpdkVhostUser"
246 'add_vport' method creates a 'dpdkvhostuser' type port to connect a VM.
247
248 .. code-block:: python
249
250     {
251         "Name": "ex_replace_vm",
252         "Description": "PVP with VM replacement",
253         "Deployment": "clean",
254         "TestSteps": [
255             ['vswitch', 'add_switch', 'int_br0'],       # STEP 0
256             ['vswitch', 'add_phy_port', 'int_br0'],     # STEP 1
257             ['vswitch', 'add_phy_port', 'int_br0'],     # STEP 2
258             ['vswitch', 'add_vport', 'int_br0'],        # STEP 3    vm1
259             ['vswitch', 'add_vport', 'int_br0'],        # STEP 4
260
261             # Setup Flows
262             ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
263                 'actions': ['output:#STEP[3][1]'], 'idle_timeout': '0'}],
264             ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[4][1]', \
265                 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
266             ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[2][1]', \
267                 'actions': ['output:#STEP[4][1]'], 'idle_timeout': '0'}],
268             ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[3][1]', \
269                 'actions': ['output:#STEP[1][1]'], 'idle_timeout': '0'}],
270
271             # Start VM 1
272             ['vnf1', 'start'],
273             # Now we want to replace VM 1 with another VM
274             ['vnf1', 'stop'],
275
276             ['vswitch', 'add_vport', 'int_br0'],        # STEP 11    vm2
277             ['vswitch', 'add_vport', 'int_br0'],        # STEP 12
278             ['vswitch', 'del_flow', 'int_br0'],
279             ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
280                 'actions': ['output:#STEP[11][1]'], 'idle_timeout': '0'}],
281             ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[12][1]', \
282                 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
283
284             # Start VM 2
285             ['vnf2', 'start'],
286             ['vnf2', 'stop'],
287             ['vswitch', 'dump_flows', 'int_br0'],
288
289             # Clean up
290             ['vswitch', 'del_flow', 'int_br0'],
291             ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
292             ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
293             ['vswitch', 'del_port', 'int_br0', '#STEP[3][0]'],    # vm1
294             ['vswitch', 'del_port', 'int_br0', '#STEP[4][0]'],
295             ['vswitch', 'del_port', 'int_br0', '#STEP[11][0]'],   # vm2
296             ['vswitch', 'del_port', 'int_br0', '#STEP[12][0]'],
297             ['vswitch', 'del_switch', 'int_br0'],
298         ]
299     },
300
301 To run the test:
302
303   .. code-block:: console
304
305      ./vsperf --conf-file user_settings.py --integration ex_replace_vm
306
307 VM with a Linux bridge
308 ^^^^^^^^^^^^^^^^^^^^^^
309
310 In this example a command-line parameter allows to set up a Linux bridge into
311 the guest VM.
312 That's one of the available ways to specify the guest application.
313 Packets matching the flow will be forwarded to the VM.
314
315 .. code-block:: python
316
317     {
318         "Name": "ex_pvp_rule_l3da",
319         "Description": "PVP with flow on L3 Dest Addr",
320         "Deployment": "clean",
321         "TestSteps": [
322             ['vswitch', 'add_switch', 'int_br0'],       # STEP 0
323             ['vswitch', 'add_phy_port', 'int_br0'],     # STEP 1
324             ['vswitch', 'add_phy_port', 'int_br0'],     # STEP 2
325             ['vswitch', 'add_vport', 'int_br0'],        # STEP 3    vm1
326             ['vswitch', 'add_vport', 'int_br0'],        # STEP 4
327             # Setup Flows
328             ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
329                 'dl_type': '0x0800', 'nw_dst': '90.90.90.90', \
330                 'actions': ['output:#STEP[3][1]'], 'idle_timeout': '0'}],
331             # Each pkt from the VM is forwarded to the 2nd dpdk port
332             ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[4][1]', \
333                 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
334             # Start VMs
335             ['vnf1', 'start'],
336             ['trafficgen', 'send_traffic', {'traffic_type' : 'continuous', \
337                 'bidir' : 'False'}],
338             ['vnf1', 'stop'],
339             # Clean up
340             ['vswitch', 'dump_flows', 'int_br0'],       # STEP 10
341             ['vswitch', 'del_flow', 'int_br0'],         # STEP 11
342             ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
343             ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
344             ['vswitch', 'del_port', 'int_br0', '#STEP[3][0]'],  # vm1 ports
345             ['vswitch', 'del_port', 'int_br0', '#STEP[4][0]'],
346             ['vswitch', 'del_switch', 'int_br0'],
347         ]
348     },
349
350 To run the test:
351
352   .. code-block:: console
353
354     ./vsperf --conf-file user_settings.py --test-params
355             "guest_loopback=linux_bridge" --integration ex_pvp_rule_l3da
356
357 Forward packets based on UDP port
358 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
359
360 This examples launches 2 VMs connected in parallel.
361 Incoming packets will be forwarded to one specific VM depending on the
362 destination UDP port.
363
364 .. code-block:: python
365
366     {
367         "Name": "ex_2pvp_rule_l4dp",
368         "Description": "2 PVP with flows on L4 Dest Port",
369         "Deployment": "clean",
370         "Stream Type": "L4",    # loop UDP ports
371         "MultiStream": 2,
372         "TestSteps": [
373             ['vswitch', 'add_switch', 'int_br0'],       # STEP 0
374             ['vswitch', 'add_phy_port', 'int_br0'],     # STEP 1
375             ['vswitch', 'add_phy_port', 'int_br0'],     # STEP 2
376             ['vswitch', 'add_vport', 'int_br0'],        # STEP 3    vm1
377             ['vswitch', 'add_vport', 'int_br0'],        # STEP 4
378             ['vswitch', 'add_vport', 'int_br0'],        # STEP 5    vm2
379             ['vswitch', 'add_vport', 'int_br0'],        # STEP 6
380             # Setup Flows to reply ICMPv6 and similar packets, so to
381             # avoid flooding internal port with their re-transmissions
382             ['vswitch', 'add_flow', 'int_br0', \
383                 {'priority': '1', 'dl_src': '00:00:00:00:00:01', \
384                 'actions': ['output:#STEP[3][1]'], 'idle_timeout': '0'}],
385             ['vswitch', 'add_flow', 'int_br0', \
386                 {'priority': '1', 'dl_src': '00:00:00:00:00:02', \
387                 'actions': ['output:#STEP[4][1]'], 'idle_timeout': '0'}],
388             ['vswitch', 'add_flow', 'int_br0', \
389                 {'priority': '1', 'dl_src': '00:00:00:00:00:03', \
390                 'actions': ['output:#STEP[5][1]'], 'idle_timeout': '0'}],
391             ['vswitch', 'add_flow', 'int_br0', \
392                 {'priority': '1', 'dl_src': '00:00:00:00:00:04', \
393                 'actions': ['output:#STEP[6][1]'], 'idle_timeout': '0'}],
394             # Forward UDP packets depending on dest port
395             ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
396                 'dl_type': '0x0800', 'nw_proto': '17', 'udp_dst': '0', \
397                 'actions': ['output:#STEP[3][1]'], 'idle_timeout': '0'}],
398             ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
399                 'dl_type': '0x0800', 'nw_proto': '17', 'udp_dst': '1', \
400                 'actions': ['output:#STEP[5][1]'], 'idle_timeout': '0'}],
401             # Send VM output to phy port #2
402             ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[4][1]', \
403                 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
404             ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[6][1]', \
405                 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
406             # Start VMs
407             ['vnf1', 'start'],                          # STEP 16
408             ['vnf2', 'start'],                          # STEP 17
409             ['trafficgen', 'send_traffic', {'traffic_type' : 'continuous', \
410                 'bidir' : 'False'}],
411             ['vnf1', 'stop'],
412             ['vnf2', 'stop'],
413             ['vswitch', 'dump_flows', 'int_br0'],
414             # Clean up
415             ['vswitch', 'del_flow', 'int_br0'],
416             ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
417             ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
418             ['vswitch', 'del_port', 'int_br0', '#STEP[3][0]'],  # vm1 ports
419             ['vswitch', 'del_port', 'int_br0', '#STEP[4][0]'],
420             ['vswitch', 'del_port', 'int_br0', '#STEP[5][0]'],  # vm2 ports
421             ['vswitch', 'del_port', 'int_br0', '#STEP[6][0]'],
422             ['vswitch', 'del_switch', 'int_br0'],
423         ]
424     },
425
426 To run the test:
427
428   .. code-block:: console
429
430     ./vsperf --conf-file user_settings.py --integration ex_2pvp_rule_l4dp
431
432 Executing Tunnel encapsulation tests
433 ------------------------------------
434
435 The VXLAN OVS DPDK encapsulation tests requires IPs, MAC addresses,
436 bridge names and WHITELIST_NICS for DPDK.
437
438 NOTE: Only Ixia traffic generators currently support the execution of the tunnel
439 encapsulation tests. Support for other traffic generators may come in a future
440 release.
441
442 Default values are already provided. To customize for your environment, override
443 the following variables in you user_settings.py file:
444
445   .. code-block:: python
446
447     # Variables defined in conf/integration/02_vswitch.conf
448     # Tunnel endpoint for Overlay P2P deployment scenario
449     # used for br0
450     VTEP_IP1 = '192.168.0.1/24'
451
452     # Used as remote_ip in adding OVS tunnel port and
453     # to set ARP entry in OVS (e.g. tnl/arp/set br-ext 192.168.240.10 02:00:00:00:00:02
454     VTEP_IP2 = '192.168.240.10'
455
456     # Network to use when adding a route for inner frame data
457     VTEP_IP2_SUBNET = '192.168.240.0/24'
458
459     # Bridge names
460     TUNNEL_INTEGRATION_BRIDGE = 'br0'
461     TUNNEL_EXTERNAL_BRIDGE = 'br-ext'
462
463     # IP of br-ext
464     TUNNEL_EXTERNAL_BRIDGE_IP = '192.168.240.1/24'
465
466     # vxlan|gre|geneve
467     TUNNEL_TYPE = 'vxlan'
468
469     # Variables defined conf/integration/03_traffic.conf
470     # For OP2P deployment scenario
471     TRAFFICGEN_PORT1_MAC = '02:00:00:00:00:01'
472     TRAFFICGEN_PORT2_MAC = '02:00:00:00:00:02'
473     TRAFFICGEN_PORT1_IP = '1.1.1.1'
474     TRAFFICGEN_PORT2_IP = '192.168.240.10'
475
476 To run VXLAN encapsulation tests:
477
478   .. code-block:: console
479
480     ./vsperf --conf-file user_settings.py --integration
481              --test-params 'tunnel_type=vxlan' overlay_p2p_tput
482
483 To run GRE encapsulation tests:
484
485   .. code-block:: console
486
487     ./vsperf --conf-file user_settings.py --integration
488              --test-params 'tunnel_type=gre' overlay_p2p_tput
489
490 To run GENEVE encapsulation tests:
491
492   .. code-block:: console
493
494     ./vsperf --conf-file user_settings.py --integration
495              --test-params 'tunnel_type=geneve' overlay_p2p_tput
496
497 To run OVS NATIVE tunnel tests (VXLAN/GRE/GENEVE):
498
499 1. Install the OVS kernel modules
500
501   .. code:: console
502
503     cd src/ovs/ovs
504     sudo -E make modules_install
505
506 2. Set the following variables:
507
508   .. code-block:: python
509
510     VSWITCH = 'OvsVanilla'
511     # Specify vport_* kernel module to test.
512     PATHS['vswitch']['OvsVanilla']['src']['modules'] = [
513         'vport_vxlan',
514         'vport_gre',
515         'vport_geneve',
516         'datapath/linux/openvswitch.ko',
517     ]
518
519   **NOTE:** In case, that Vanilla OVS is installed from binary package, then
520   please set ``PATHS['vswitch']['OvsVanilla']['bin']['modules']`` instead.
521
522 3. Run tests:
523
524   .. code-block:: console
525
526     ./vsperf --conf-file user_settings.py --integration
527              --test-params 'tunnel_type=vxlan' overlay_p2p_tput
528
529
530 Executing VXLAN decapsulation tests
531 ------------------------------------
532
533 To run VXLAN decapsulation tests:
534
535 1. Set the variables used in "Executing Tunnel encapsulation tests"
536
537 2. Set dstmac of DUT_NIC2_MAC to the MAC adddress of the 2nd NIC of your DUT
538
539   .. code-block:: python
540
541     DUT_NIC2_MAC = '<DUT NIC2 MAC>'
542
543 3. Run test:
544
545   .. code-block:: console
546
547     ./vsperf --conf-file user_settings.py --integration overlay_p2p_decap_cont
548
549 If you want to use different values for your VXLAN frame, you may set:
550
551   .. code-block:: python
552
553     VXLAN_FRAME_L3 = {'proto': 'udp',
554                       'packetsize': 64,
555                       'srcip': TRAFFICGEN_PORT1_IP,
556                       'dstip': '192.168.240.1',
557                      }
558     VXLAN_FRAME_L4 = {'srcport': 4789,
559                       'dstport': 4789,
560                       'vni': VXLAN_VNI,
561                       'inner_srcmac': '01:02:03:04:05:06',
562                       'inner_dstmac': '06:05:04:03:02:01',
563                       'inner_srcip': '192.168.0.10',
564                       'inner_dstip': '192.168.240.9',
565                       'inner_proto': 'udp',
566                       'inner_srcport': 3000,
567                       'inner_dstport': 3001,
568                      }
569
570
571 Executing GRE decapsulation tests
572 ---------------------------------
573
574 To run GRE decapsulation tests:
575
576 1. Set the variables used in "Executing Tunnel encapsulation tests"
577
578 2. Set dstmac of DUT_NIC2_MAC to the MAC adddress of the 2nd NIC of your DUT
579
580   .. code-block:: python
581
582     DUT_NIC2_MAC = '<DUT NIC2 MAC>'
583
584 3. Run test:
585
586   .. code-block:: console
587
588     ./vsperf --conf-file user_settings.py --test-params 'tunnel_type=gre'
589              --integration overlay_p2p_decap_cont
590
591
592 If you want to use different values for your GRE frame, you may set:
593
594   .. code-block:: python
595
596     GRE_FRAME_L3 = {'proto': 'gre',
597                     'packetsize': 64,
598                     'srcip': TRAFFICGEN_PORT1_IP,
599                     'dstip': '192.168.240.1',
600                    }
601
602     GRE_FRAME_L4 = {'srcport': 0,
603                     'dstport': 0
604                     'inner_srcmac': '01:02:03:04:05:06',
605                     'inner_dstmac': '06:05:04:03:02:01',
606                     'inner_srcip': '192.168.0.10',
607                     'inner_dstip': '192.168.240.9',
608                     'inner_proto': 'udp',
609                     'inner_srcport': 3000,
610                     'inner_dstport': 3001,
611                    }
612
613
614 Executing GENEVE decapsulation tests
615 ------------------------------------
616
617 IxNet 7.3X does not have native support of GENEVE protocol. The
618 template, GeneveIxNetTemplate.xml_ClearText.xml, should be imported
619 into IxNET for this testcase to work.
620
621 To import the template do:
622
623 1. Run the IxNetwork TCL Server
624 2. Click on the Traffic menu
625 3. Click on the Traffic actions and click Edit Packet Templates
626 4. On the Template editor window, click Import. Select the template
627    tools/pkt_gen/ixnet/GeneveIxNetTemplate.xml_ClearText.xml
628    and click import.
629 5. Restart the TCL Server.
630
631 To run GENEVE decapsulation tests:
632
633 1. Set the variables used in "Executing Tunnel encapsulation tests"
634
635 2. Set dstmac of DUT_NIC2_MAC to the MAC adddress of the 2nd NIC of your DUT
636
637   .. code-block:: python
638
639     DUT_NIC2_MAC = '<DUT NIC2 MAC>'
640
641 3. Run test:
642
643   .. code-block:: console
644
645     ./vsperf --conf-file user_settings.py --test-params 'tunnel_type=geneve'
646              --integration overlay_p2p_decap_cont
647
648
649 If you want to use different values for your GENEVE frame, you may set:
650
651   .. code-block:: python
652
653     GENEVE_FRAME_L3 = {'proto': 'udp',
654                        'packetsize': 64,
655                        'srcip': TRAFFICGEN_PORT1_IP,
656                        'dstip': '192.168.240.1',
657                       }
658
659     GENEVE_FRAME_L4 = {'srcport': 6081,
660                        'dstport': 6081,
661                        'geneve_vni': 0,
662                        'inner_srcmac': '01:02:03:04:05:06',
663                        'inner_dstmac': '06:05:04:03:02:01',
664                        'inner_srcip': '192.168.0.10',
665                        'inner_dstip': '192.168.240.9',
666                        'inner_proto': 'udp',
667                        'inner_srcport': 3000,
668                        'inner_dstport': 3001,
669                       }
670
671
672 Executing Native/Vanilla OVS VXLAN decapsulation tests
673 ------------------------------------------------------
674
675 To run VXLAN decapsulation tests:
676
677 1. Set the following variables in your user_settings.py file:
678
679   .. code-block:: python
680
681     PATHS['vswitch']['OvsVanilla']['src']['modules'] = [
682         'vport_vxlan',
683         'datapath/linux/openvswitch.ko',
684     ]
685
686     DUT_NIC1_MAC = '<DUT NIC1 MAC ADDRESS>'
687
688     TRAFFICGEN_PORT1_IP = '172.16.1.2'
689     TRAFFICGEN_PORT2_IP = '192.168.1.11'
690
691     VTEP_IP1 = '172.16.1.2/24'
692     VTEP_IP2 = '192.168.1.1'
693     VTEP_IP2_SUBNET = '192.168.1.0/24'
694     TUNNEL_EXTERNAL_BRIDGE_IP = '172.16.1.1/24'
695     TUNNEL_INT_BRIDGE_IP = '192.168.1.1'
696
697     VXLAN_FRAME_L2 = {'srcmac':
698                       '01:02:03:04:05:06',
699                       'dstmac': DUT_NIC1_MAC
700                      }
701
702     VXLAN_FRAME_L3 = {'proto': 'udp',
703                       'packetsize': 64,
704                       'srcip': TRAFFICGEN_PORT1_IP,
705                       'dstip': '172.16.1.1',
706                      }
707
708     VXLAN_FRAME_L4 = {
709                       'srcport': 4789,
710                       'dstport': 4789,
711                       'protocolpad': 'true',
712                       'vni': 99,
713                       'inner_srcmac': '01:02:03:04:05:06',
714                       'inner_dstmac': '06:05:04:03:02:01',
715                       'inner_srcip': '192.168.1.2',
716                       'inner_dstip': TRAFFICGEN_PORT2_IP,
717                       'inner_proto': 'udp',
718                       'inner_srcport': 3000,
719                       'inner_dstport': 3001,
720                      }
721
722   **NOTE:** In case, that Vanilla OVS is installed from binary package, then
723   please set ``PATHS['vswitch']['OvsVanilla']['bin']['modules']`` instead.
724
725 2. Run test:
726
727   .. code-block:: console
728
729     ./vsperf --conf-file user_settings.py --integration
730              --test-params 'tunnel_type=vxlan' overlay_p2p_decap_cont
731
732 Executing Native/Vanilla OVS GRE decapsulation tests
733 ----------------------------------------------------
734
735 To run GRE decapsulation tests:
736
737 1. Set the following variables in your user_settings.py file:
738
739   .. code-block:: python
740
741     PATHS['vswitch']['OvsVanilla']['src']['modules'] = [
742         'vport_gre',
743         'datapath/linux/openvswitch.ko',
744     ]
745
746     DUT_NIC1_MAC = '<DUT NIC1 MAC ADDRESS>'
747
748     TRAFFICGEN_PORT1_IP = '172.16.1.2'
749     TRAFFICGEN_PORT2_IP = '192.168.1.11'
750
751     VTEP_IP1 = '172.16.1.2/24'
752     VTEP_IP2 = '192.168.1.1'
753     VTEP_IP2_SUBNET = '192.168.1.0/24'
754     TUNNEL_EXTERNAL_BRIDGE_IP = '172.16.1.1/24'
755     TUNNEL_INT_BRIDGE_IP = '192.168.1.1'
756
757     GRE_FRAME_L2 = {'srcmac':
758                     '01:02:03:04:05:06',
759                     'dstmac': DUT_NIC1_MAC
760                    }
761
762     GRE_FRAME_L3 = {'proto': 'udp',
763                     'packetsize': 64,
764                     'srcip': TRAFFICGEN_PORT1_IP,
765                     'dstip': '172.16.1.1',
766                    }
767
768     GRE_FRAME_L4 = {
769                     'srcport': 4789,
770                     'dstport': 4789,
771                     'protocolpad': 'true',
772                     'inner_srcmac': '01:02:03:04:05:06',
773                     'inner_dstmac': '06:05:04:03:02:01',
774                     'inner_srcip': '192.168.1.2',
775                     'inner_dstip': TRAFFICGEN_PORT2_IP,
776                     'inner_proto': 'udp',
777                     'inner_srcport': 3000,
778                     'inner_dstport': 3001,
779                    }
780
781   **NOTE:** In case, that Vanilla OVS is installed from binary package, then
782   please set ``PATHS['vswitch']['OvsVanilla']['bin']['modules']`` instead.
783
784 2. Run test:
785
786   .. code-block:: console
787
788     ./vsperf --conf-file user_settings.py --integration
789              --test-params 'tunnel_type=gre' overlay_p2p_decap_cont
790
791 Executing Native/Vanilla OVS GENEVE decapsulation tests
792 -------------------------------------------------------
793
794 To run GENEVE decapsulation tests:
795
796 1. Set the following variables in your user_settings.py file:
797
798   .. code-block:: python
799
800     PATHS['vswitch']['OvsVanilla']['src']['modules'] = [
801         'vport_geneve',
802         'datapath/linux/openvswitch.ko',
803     ]
804
805     DUT_NIC1_MAC = '<DUT NIC1 MAC ADDRESS>'
806
807     TRAFFICGEN_PORT1_IP = '172.16.1.2'
808     TRAFFICGEN_PORT2_IP = '192.168.1.11'
809
810     VTEP_IP1 = '172.16.1.2/24'
811     VTEP_IP2 = '192.168.1.1'
812     VTEP_IP2_SUBNET = '192.168.1.0/24'
813     TUNNEL_EXTERNAL_BRIDGE_IP = '172.16.1.1/24'
814     TUNNEL_INT_BRIDGE_IP = '192.168.1.1'
815
816     GENEVE_FRAME_L2 = {'srcmac':
817                        '01:02:03:04:05:06',
818                        'dstmac': DUT_NIC1_MAC
819                       }
820
821     GENEVE_FRAME_L3 = {'proto': 'udp',
822                        'packetsize': 64,
823                        'srcip': TRAFFICGEN_PORT1_IP,
824                        'dstip': '172.16.1.1',
825                       }
826
827     GENEVE_FRAME_L4 = {'srcport': 6081,
828                        'dstport': 6081,
829                        'protocolpad': 'true',
830                        'geneve_vni': 0,
831                        'inner_srcmac': '01:02:03:04:05:06',
832                        'inner_dstmac': '06:05:04:03:02:01',
833                        'inner_srcip': '192.168.1.2',
834                        'inner_dstip': TRAFFICGEN_PORT2_IP,
835                        'inner_proto': 'udp',
836                        'inner_srcport': 3000,
837                        'inner_dstport': 3001,
838                       }
839
840   **NOTE:** In case, that Vanilla OVS is installed from binary package, then
841   please set ``PATHS['vswitch']['OvsVanilla']['bin']['modules']`` instead.
842
843 2. Run test:
844
845   .. code-block:: console
846
847     ./vsperf --conf-file user_settings.py --integration
848              --test-params 'tunnel_type=geneve' overlay_p2p_decap_cont
849
850
851 Executing Tunnel encapsulation+decapsulation tests
852 --------------------------------------------------
853
854 The OVS DPDK encapsulation_decapsulation tests requires IPs, MAC addresses,
855 bridge names and WHITELIST_NICS for DPDK.
856
857 The test cases can test the tunneling encap and decap without using any ingress
858 overlay traffic as compared to above test cases. To achieve this the OVS is
859 configured to perform encap and decap in a series on the same traffic stream as
860 given below.
861
862 TRAFFIC-IN --> [ENCAP] --> [MOD-PKT] --> [DECAP] --> TRAFFIC-OUT
863
864
865 Default values are already provided. To customize for your environment, override
866 the following variables in you user_settings.py file:
867
868   .. code-block:: python
869
870     # Variables defined in conf/integration/02_vswitch.conf
871
872     # Bridge names
873     TUNNEL_EXTERNAL_BRIDGE1 = 'br-phy1'
874     TUNNEL_EXTERNAL_BRIDGE2 = 'br-phy2'
875     TUNNEL_MODIFY_BRIDGE1 = 'br-mod1'
876     TUNNEL_MODIFY_BRIDGE2 = 'br-mod2'
877
878     # IP of br-mod1
879     TUNNEL_MODIFY_BRIDGE_IP1 = '10.0.0.1/24'
880
881     # Mac of br-mod1
882     TUNNEL_MODIFY_BRIDGE_MAC1 = '00:00:10:00:00:01'
883
884     # IP of br-mod2
885     TUNNEL_MODIFY_BRIDGE_IP2 = '20.0.0.1/24'
886
887     #Mac of br-mod2
888     TUNNEL_MODIFY_BRIDGE_MAC2 = '00:00:20:00:00:01'
889
890     # vxlan|gre|geneve, Only VXLAN is supported for now.
891     TUNNEL_TYPE = 'vxlan'
892
893 To run VXLAN encapsulation+decapsulation tests:
894
895   .. code-block:: console
896
897     ./vsperf --conf-file user_settings.py --integration
898              overlay_p2p_mod_tput