aboutsummaryrefslogtreecommitdiffstats
path: root/conf/integration/01a_testcases_l34_vxlan.conf
blob: b42a14d15b39c8984c079fd611d937699fb92384 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
#!/usr/bin/env python
#
# jose.lausuch@ericsson.com
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
#

import logging
import unittest
import os

import mock

from functest.cli.commands import cli_os
from functest.utils.constants import CONST


class CliOpenStackTesting(unittest.TestCase):
    logging.disable(logging.CRITICAL)

    def setUp(self):
        self.endpoint_ip = 'test_ip'
        self.os_auth_url = 'http://test_ip:test_port/v2.0'
        self.installer_type = 'test_installer_type'
        self.installer_ip = 'test_installer_ip'
        self.openstack_creds = 'test_openstack_creds'
        self.dir_repo_functest = 'test_dir_repo_functest'
        self.snapshot_file = 'test_snapshot_file'
        self.cli_os = cli_os.CliOpenStack()

    def test_ping_endpoint_default(self):
        self.cli_os.os_auth_url = self.os_auth_url
        self.cli_os.endpoint_ip = self.endpoint_ip
        with mock.patch('functest.cli.commands.cli_os.os.system',
                        return_value=0):
            self.assertEqual(self.cli_os.ping_endpoint(), 0)

    @mock.patch('functest.cli.commands.cli_os.exit', side_effect=Exception)
    @mock.patch('functest.cli.commands.cli_os.click.echo')
    def test_ping_endpoint_missing_auth_url(self, mock_click_echo,
                                            mock_exit):
        with self.assertRaises(Exception):
            self.cli_os.os_auth_url = None
            self.cli_os.ping_endpoint()
            mock_click_echo.assert_called_once_with("Source the OpenStack "
                                                    "credentials first '. "
                                                    "$creds'")

    @mock.patch('functest.cli.commands.cli_os.exit')
    @mock.patch('functest.cli.commands.cli_os.click.echo')
    def test_ping_endpoint_os_system_fails(self, mock_click_echo,
                                           mock_exit):
        self.cli_os.os_auth_url = self.os_auth_url
        self.cli_os.endpoint_ip = self.endpoint_ip
        with mock.patch('functest.cli.commands.cli_os.os.system',
                        return_value=1):
            self.cli_os.ping_endpoint()
            mock_click_echo.assert_called_once_with("Cannot talk to the "
                                                    "endpoint %s\n" %
                                                    self.endpoint_ip)
            mock_exit.assert_called_once_with(0)

    @mock.patch('functest.cli.commands.cli_os.ft_utils.execute_command')
    @mock.patch('functest.cli.commands.cli_os.os.path.isfile',
                return_value=False)
    @mock.patch('functest.cli.commands.cli_os.click.echo')
    def test_fetch_credentials_default(self, mock_click_echo,
                                       mock_os_path,
                                       mock_ftutils_execute):
        CONST.__setattr__('INSTALLER_TYPE', self.installer_type)
        CONST.__setattr__('INSTALLER_IP', self.installer_ip)
        cmd = ("%s/releng/utils/fetch_os_creds.sh -d %s -i %s -a %s"
               % (CONST.__getattribute__('dir_repos'),
                  self.openstack_creds,
                  self.installer_type,
                  self.installer_ip))
        self.cli_os.openstack_creds = self.openstack_creds
        self.cli_os.fetch_credentials()
        mock_click_echo.assert_called_once_with("Fetching credentials from "
                                                "installer node '%s' with "
                                                "IP=%s.." %
                                                (self.installer_type,
                                                 self.installer_ip))
        mock_ftutils_execute.assert_called_once_with(cmd, verbose=False)

    @mock.patch('functest.cli.commands.cli_os.ft_utils.execute_command')
    @mock.patch('functest.cli.commands.cli_os.os.path.isfile',
                return_value=False)
    @mock.patch('functest.cli.commands.cli_os.click.echo')
    def test_fetch_credentials_missing_installer_type(self, mock_click_echo,
                                                      mock_os_path,
                                                      mock_ftutils_execute):
        CONST.__setattr__('INSTALLER_TYPE', None)
        CONST.__setattr__('INSTALLER_IP', self.installer_ip)
        cmd = ("%s/releng/utils/fetch_os_creds.sh -d %s -i %s -a %s"
               % (CONST.__getattribute__('dir_repos'),
                  self.openstack_creds,
                  None,
                  self.installer_ip))
        self.cli_os.openstack_creds = self.openstack_creds
        self.cli_os.fetch_credentials()
        mock_click_echo.assert_any_call("The environment variable "
                                        "'INSTALLER_TYPE' is not"
                                        "defined. Please export it")
        mock_click_echo.assert_any_call("Fetching credentials from "
                                        "installer node '%s' with "
                                        "IP=%s.." %
                                        (None,
                                         self.installer_ip))
        mock_ftutils_execute.assert_called_once_with(cmd, verbose=False)

    @mock.patch('functest.cli.commands.cli_os.ft_utils.execute_command')
    @mock.patch('functest.cli.commands.cli_os.os.path.isfile',
                return_value=False)
    @mock.patch('functest.cli.commands.cli_os.click.echo')
    def test_fetch_credentials_missing_installer_ip(self, mock_click_echo,
                                                    mock_os_path,
                                                    mock_ftutils_execute):
        installer_type = self.installer_type
        installer_ip = None
        CONST.__setattr__('INSTALLER_TYPE', installer_type)
        CONST.__setattr__('INSTALLER_IP', installer_ip)
        cmd = ("%s/releng/utils/fetch_os_creds.sh -d %s -i %s -a %s"
               % (CONST.__getattribute__('dir_repos'),
                  self.openstack_creds,
                  installer_type,
                  installer_ip))
        self.cli_os.openstack_creds = self.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #333333 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #666666 } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #008800 } /* Keyword.Pseudo */
.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */
.highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */
.highlight .na { color: #336699 } /* Name.Attribute */
.highlight .nb { color: #003388 } /* Name.Builtin */
.highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */
.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
.highlight .nd { color: #555555 } /* Name.Decorator */
.highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */
.highlight .nl { color: #336699; font-style: italic } /* Name.Label */
.highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */
.highlight .py { color: #336699; font-weight: bold } /* Name.Property */
.highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #336699 } /* Name.Variable */
.highlight .ow { color: #008800 } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */
.highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */
.highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */
.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
.highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */
.highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */
.highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */
.highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */
.highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */
.highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */
.highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */
.highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */
.highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */
.highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */
.highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */
.highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */
.highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */
.highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */
.highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */
.highlight .vc { color: #336699 } /* Name.Variable.Class */
.highlight .vg { color: #dd7700 } /* Name.Variable.Global */
.highlight .vi { color: #3333bb } /* Name.Variable.Instance */
.highlight .vm { color: #336699 } /* Name.Variable.Magic */
.highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
# Copyright 2017-2018 Intel Corporation and Tieto.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

#
# This file introduces a series of scalability testcases prepared for OVS
# and VPP. Tests are unidirectional and they are focused on L3, L4 and VxLAN
# switching performance.
# Following test types are available:
#   1) unique rule for each IP stream (OVS only)
#   2) one rule for /8 netmask covering all streams
#   3) unique ARP entry for each IP stream (VPP only)
#   4) unique IP route for each IP stream (VPP only)
#

INTEGRATION_TESTS = INTEGRATION_TESTS + [
    #
    # L3 & L4 tests to compare OVS and VPP performance
    #
    # Example of execution:
    #   ./vsperf --test-params "TRAFFIC={'multistream':2000,'traffic_type':'rfc2544_continuous'}" \
    #       p2p_l3_multi_IP_ovs_mask p2p_l4_multi_PORT_ovs_mask
    #
    #   ./vsperf --test-params "TRAFFIC={'multistream':8000,'traffic_type':'rfc2544_throughput'}" \
    #       p2p_l3_multi_IP_vpp p2p_l4_multi_PORT_vpp
    {
        "Name": "p2p_l3_multi_IP_ovs",
        "Deployment": "clean",
        "Description": "OVS: P2P L3 multistream with unique flow for each IP stream",
        "vSwitch" : "OvsDpdkVhost",
        "Parameters" : {
            "TRAFFIC" : {
                'bidir' : 'False',
                "stream_type" : "L3",
                'l3': {
                    'enabled': True,
                    'proto': 'udp',
                    'dstip': '6.0.0.1',
                },
            },
        },
        "TestSteps":
            STEP_VSWITCH_P2P_INIT +
            [
                ['vswitch', 'del_flow', 'int_br0'],
                ['tools', 'exec_python',
                 'import netaddr;'
                 'cmds=open("/tmp/ovsofctl_cmds.txt","w");'
                 '[print("add nw_dst={} idle_timeout=0,dl_type=0x800,'
                 'in_port=1,action=output:2".format('
                 'netaddr.IPAddress(netaddr.IPAddress("$TRAFFIC["l3"]["dstip"]").value+i)),file=cmds) '
                 'for i in range($TRAFFIC["multistream"])];'
                 'cmds.close()'],
                ['tools', 'exec_shell', "sudo $TOOLS['ovs-ofctl'] -O OpenFlow13 --bundle add-flows int_br0 /tmp/ovsofctl_cmds.txt"],
                ['trafficgen', 'send_traffic', {}],
            ] +
            STEP_VSWITCH_P2P_FINIT
    },
    {
        "Name": "p2p_l3_multi_IP_mask_ovs",
        "Deployment": "clean",
        "Description": "OVS: P2P L3 multistream with 1 flow for /8 net mask",
        "vSwitch" : "OvsDpdkVhost",
        "Parameters" : {
            "TRAFFIC" : {
                'bidir' : 'False',
                "stream_type" : "L3",
                'l3': {
                    'enabled': True,
                    'proto': 'udp',
                    'dstip': '6.0.0.1',
                },
            },
        },
        "TestSteps":
            STEP_VSWITCH_P2P_INIT +
            [
                ['vswitch', 'del_flow', 'int_br0'],
                ['vswitch', 'add_flow', 'int_br0',
                 {'in_port': '#STEP[1][1]', 'dl_type': '0x800',
                  'nw_dst': '$TRAFFIC["l3"]["dstip"]/8',
                  'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0' }],
                ['trafficgen', 'send_traffic', {}],
                ['vswitch', 'dump_flows', 'int_br0'],
            ] +
            STEP_VSWITCH_P2P_FINIT
    },
    {
        "Name": "pvp_l3_multi_IP_mask_ovs",
        "Deployment": "clean",
        "Description": "OVS: PVP L3 multistream with 1 flow for /8 net mask",
        "vSwitch" : "OvsDpdkVhost",
        "Parameters" : {
            "GUEST_TESTPMD_FWD_MODE" : ['io'],
            "TRAFFIC" : {
                'bidir' : 'False',
                "stream_type" : "L3",
                'l3': {
                    'enabled': True,
                    'proto': 'udp',
                    'dstip': '6.0.0.1',
                },
            },
        },
        "TestSteps":
            STEP_VSWITCH_PVP_INIT +
            [
                ['vswitch', 'del_flow', 'int_br0'],
                ['vswitch', 'add_flow', 'int_br0',
                 {'in_port': '#STEP[1][1]', 'dl_type': '0x800',
                  'nw_dst': '$TRAFFIC["l3"]["dstip"]/8',
                  'actions': ['output:#STEP[3][1]'], 'idle_timeout': '0'}],
                ['vswitch', 'add_flow', 'int_br0',
                 {'in_port': '#STEP[4][1]', 'dl_type': '0x800',
                  'nw_dst': '$TRAFFIC["l3"]["dstip"]/8',
                  'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
                ['vnf', 'start'],
                ['trafficgen', 'send_traffic', {}],
                ['vswitch', 'dump_flows', 'int_br0'],
                ['vnf', 'stop'],
            ] +                                                                                                                          STEP_VSWITCH_PVP_FINIT
    },
    {
        "Name": "pvvp_l3_multi_IP_mask_ovs",
        "Deployment": "clean",
        "Description": "OVS: PVVP L3 multistream with 1 flow for /8 net mask",
        "vSwitch" : "OvsDpdkVhost",
        "Parameters" : {
            "GUEST_TESTPMD_FWD_MODE" : ['io', 'io'],
            "TRAFFIC" : {
                'bidir' : 'False',
                "stream_type" : "L3",
                'l3': {
                    'enabled': True,
                    'proto': 'udp',
                    'dstip': '6.0.0.1',
                },
            },
        },
        "TestSteps":
            STEP_VSWITCH_PVVP_INIT +
            [
                ['vswitch', 'del_flow', 'int_br0'],
                ['vswitch', 'add_flow', 'int_br0',
                 {'in_port': '#STEP[1][1]', 'dl_type': '0x800',
                  'nw_dst': '$TRAFFIC["l3"]["dstip"]/8',
                  'actions': ['output:#STEP[3][1]'], 'idle_timeout': '0'}],
                ['vswitch', 'add_flow', 'int_br0',
                 {'in_port': '#STEP[4][1]', 'dl_type': '0x800',
                  'nw_dst': '$TRAFFIC["l3"]["dstip"]/8',
                  'actions': ['output:#STEP[5][1]'], 'idle_timeout': '0'}],
                ['vswitch', 'add_flow', 'int_br0',
                 {'in_port': '#STEP[6][1]', 'dl_type': '0x800',
                  'nw_dst': '$TRAFFIC["l3"]["dstip"]/8',
                  'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
                ['vnf1', 'start'],
                ['vnf2', 'start'],
                ['trafficgen', 'send_traffic', {}],
                ['vswitch', 'dump_flows', 'int_br0'],
                ['vnf2', 'stop'],
                ['vnf1', 'stop'],
            ] +
            STEP_VSWITCH_PVVP_FINIT
    },
    {
        "Name": "p2p_l4_multi_PORT_ovs",
        "Deployment": "clean",
        "Description": "OVS: P2P L4 multistream with unique flow for each IP stream",
        "vSwitch" : "OvsDpdkVhost",
        "Parameters" : {
            "TRAFFIC" : {
                'bidir' : 'False',
                "stream_type" : "L3",
                'l3': {
                    'enabled': True,
                    'proto': 'udp',
                    'dstip': '6.0.0.1',
                },
                'l4': {
                    'enabled': True,
                    'srcport': 7,
                    'dstport': 8,
                },
            },
        },
        "TestSteps":
            STEP_VSWITCH_P2P_INIT +
            [
                ['vswitch', 'del_flow', 'int_br0'],
                ['tools', 'exec_python',
                 'import netaddr;'
                 'cmds=open("/tmp/ovsofctl_cmds.txt","w");'
                 '[print("add nw_dst={} idle_timeout=0,dl_type=0x800,nw_proto=17,tp_src={},'
                 'in_port=1,action=output:2".format('
                 'netaddr.IPAddress(netaddr.IPAddress("$TRAFFIC["l3"]["dstip"]").value+i),'
                 '$TRAFFIC["l4"]["srcport"]),file=cmds) '
                 'for i in range($TRAFFIC["multistream"])];'
                 'cmds.close()'],
                ['tools', 'exec_shell', "sudo $TOOLS['ovs-ofctl'] -O OpenFlow13 --bundle "
                                        "add-flows int_br0 /tmp/ovsofctl_cmds.txt"],
                ['trafficgen', 'send_traffic', {}],
            ] +
            STEP_VSWITCH_P2P_FINIT
    },
    {
        "Name": "p2p_l4_multi_PORT_mask_ovs",
        "Deployment": "clean",
        "Description": "OVS: P2P L4 multistream with 1 flow for /8 net and port mask",
        "vSwitch" : "OvsDpdkVhost",
        "Parameters" : {
            "TRAFFIC" : {
                'bidir' : 'False',
                "stream_type" : "L3",
                'l3': {
                    'enabled': True,
                    'proto': 'udp',
                    'dstip': '6.0.0.1',
                },
                'l4': {
                    'enabled': True,
                    'srcport': 7,
                    'dstport': 8,
                },
            },
        },
        "TestSteps":
            STEP_VSWITCH_P2P_INIT +
            [
                ['vswitch', 'del_flow', 'int_br0'],
                ['vswitch', 'add_flow', 'int_br0',
                 {'in_port': '#STEP[1][1]', 'dl_type': '0x800',
                 'nw_proto': '17', 'nw_dst': '$TRAFFIC["l3"]["dstip"]/8',
                 'tp_src': '$TRAFFIC["l4"]["srcport"]',
                 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
                ['trafficgen', 'send_traffic', {}],
                ['vswitch', 'dump_flows', 'int_br0'],
            ] +
            STEP_VSWITCH_P2P_FINIT
    },
    {
        "Name": "pvp_l4_multi_PORT_mask_ovs",
        "Deployment": "clean",
        "Description": "OVS: PVP L4 multistream flows for /8 net and port mask",
        "vSwitch" : "OvsDpdkVhost",
        "Parameters" : {
            "GUEST_TESTPMD_FWD_MODE" : ['io'],
            "TRAFFIC" : {
                'bidir' : 'False',
                "stream_type" : "L3",
                'l3': {
                    'enabled': True,
                    'proto': 'udp',
                    'dstip': '6.0.0.1',
                },
                'l4': {
                    'enabled': True,
                    'srcport': 7,
                    'dstport': 8,
                },
            },
        },
        "TestSteps":
            STEP_VSWITCH_PVP_INIT +
            [
                ['vswitch', 'del_flow', 'int_br0'],
                ['vswitch', 'add_flow', 'int_br0',
                 {'in_port': '#STEP[1][1]', 'dl_type': '0x800', 'nw_proto': '17',
                  'nw_dst': '$TRAFFIC["l3"]["dstip"]/8',
                  'tp_src': '$TRAFFIC["l4"]["srcport"]',
                  'actions': ['output:#STEP[3][1]'], 'idle_timeout': '0'}],
                ['vswitch', 'add_flow', 'int_br0',
                 {'in_port': '#STEP[4][1]', 'dl_type': '0x800', 'nw_proto': '17',
                  'nw_dst': '$TRAFFIC["l3"]["dstip"]/8',
                  'tp_src': '$TRAFFIC["l4"]["srcport"]',
                  'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
                ['vnf', 'start'],
                ['trafficgen', 'send_traffic', {}],
                ['vswitch', 'dump_flows', 'int_br0'],
                ['vnf', 'stop'],
            ] +
            STEP_VSWITCH_PVP_FINIT
    },
    {
        "Name": "pvvp_l4_multi_PORT_mask_ovs",
        "Deployment": "clean",
        "Description": "OVS: PVVP L4 multistream with flows for /8 net and port mask",
        "vSwitch" : "OvsDpdkVhost",
        "Parameters" : {
            "GUEST_TESTPMD_FWD_MODE" : ['io', 'io'],
            "TRAFFIC" : {
                'bidir' : 'False',
                "stream_type" : "L3",
                'l3': {
                    'enabled': True,
                    'proto': 'udp',
                    'dstip': '6.0.0.1',
                },
                'l4': {
                    'enabled': True,
                    'srcport': 7,
                    'dstport': 8,
                },
            },
        },
        "TestSteps":
            STEP_VSWITCH_PVVP_INIT +
            [
                ['vswitch', 'del_flow', 'int_br0'],
                ['vswitch', 'add_flow', 'int_br0',
                 {'in_port': '#STEP[1][1]', 'dl_type': '0x800',
                  'nw_proto': '17', 'nw_dst': '$TRAFFIC["l3"]["dstip"]/8',
                  'tp_src': '$TRAFFIC["l4"]["srcport"]',
                  'actions': ['output:#STEP[3][1]'], 'idle_timeout': '0'}],
                ['vswitch', 'add_flow', 'int_br0',
                 {'in_port': '#STEP[4][1]', 'dl_type': '0x800', 'nw_proto': '17',
                  'nw_dst': '$TRAFFIC["l3"]["dstip"]/8',
                  'tp_src': '$TRAFFIC["l4"]["srcport"]',
                  'actions': ['output:#STEP[5][1]'], 'idle_timeout': '0'}],
                ['vswitch', 'add_flow', 'int_br0',
                 {'in_port': '#STEP[6][1]', 'dl_type': '0x800',
                  'nw_proto': '17', 'nw_dst': '$TRAFFIC["l3"]["dstip"]/8',
                  'tp_src': '$TRAFFIC["l4"]["srcport"]',
                  'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
                ['vnf1', 'start'],
                ['vnf2', 'start'],
                ['trafficgen', 'send_traffic', {}],
                ['vswitch', 'dump_flows', 'int_br0'],
                ['vnf2', 'stop'],
                ['vnf1', 'stop'],
            ] +
            STEP_VSWITCH_PVVP_FINIT
    },
    {
        "Name": "p2p_l3_multi_IP_arp_vpp",
        "Deployment": "clean",
        "Description": "VPP: P2P L3 multistream with unique ARP entry for each IP stream",
        "vSwitch" : "VppDpdkVhost",
        "Parameters" : {
            "TRAFFIC" : {
                'bidir' : 'False',
                "stream_type" : "L3",
                'l2': {
                    'dstmac' : '#PARAM(NICS[0]["mac"])',
                },
                'l3': {
                    'enabled': True,
                    'proto': 'udp',
                    'dstip': '6.0.0.2',
                },
            },
        },
        "TestSteps":
            STEP_VSWITCH_P2P_INIT +
            [
                ['vswitch', 'run_vppctl', ['set int ip address #STEP[1][0] 5.0.2.1/24']],
                ['vswitch', 'run_vppctl', ['set int ip address #STEP[2][0] 6.0.0.1/8']],
                # count option of "set ip arp" command doesn't work reliably for huge
                # count numbers, e.g. 100K
                # it is both more reliale and faster to load batches of sigle
                # ARP commands, although it also fails time to time
                # NOTE: batch load of "set ip arp count" commands with lower
                # count values (e.g. 1000) was also less reliable than using
                # batches of signle arp entries
                ['tools', 'exec_python',
                 'import netaddr;'
                 'dst_mac_value = netaddr.EUI("00:00:00:00:00:0A").value;'
                 'cmds=open("/tmp/vppctl_cmds.txt","w");'
                 '[print("set ip arp #STEP[2][0] {} {}".format('
                 'netaddr.IPAddress(netaddr.IPAddress("$TRAFFIC["l3"]["dstip"]").value+i),'
                 'netaddr.EUI(dst_mac_value+i,dialect=netaddr.mac_unix_expanded)),file=cmds) '
                 'for i in range($TRAFFIC["multistream"])];'
                 'cmds.close()'],
                ['tools', 'exec_shell', "rm -rf /tmp/vppctl_cmds_split*; split -l 1000 "
                                        "/tmp/vppctl_cmds.txt /tmp/vppctl_cmds_split"],
                ['tools', 'exec_shell', "for a in /tmp/vppctl_cmds_split* ; do echo $a ; "
                                        "sudo $TOOLS['vppctl'] exec $a ; sleep 2 ; done"],
                ['vswitch', 'run_vppctl', ['show ip fib summary']],
                ['trafficgen', 'send_traffic', {}],
                ['vswitch', 'run_vppctl', ['show interfaces']],
            ] +
            STEP_VSWITCH_P2P_FINIT
    },
    {
        "Name": "p2p_l3_multi_IP_mask_vpp",
        "Deployment": "clean",
        "Description": "VPP: P2P L3 multistream with 1 route for /8 net mask",
        "vSwitch" : "VppDpdkVhost",
        "Parameters" : {
            "TRAFFIC" : {
                'bidir' : 'False',
                "stream_type" : "L3",
                'l2': {
                    'dstmac' : '#PARAM(NICS[0]["mac"])',
                },
                'l3': {
                    'enabled': True,
                    'proto': 'udp',
                    'dstip': '5.0.0.1',
                },
            },
        },
        "TestSteps":
            STEP_VSWITCH_P2P_INIT +
            [
                ['vswitch', 'run_vppctl', ['set int ip address #STEP[1][0] 6.0.2.1/24']],
                ['vswitch', 'run_vppctl', ['set int ip address #STEP[2][0] 6.0.3.1/24']],
                ['vswitch', 'run_vppctl', ['set ip arp #STEP[2][0] 6.0.3.2 00:00:00:00:00:0A']],
                ['vswitch', 'run_vppctl', ['ip route add $TRAFFIC["l3"]["dstip"]/8 via 6.0.3.2']],
                ['vswitch', 'run_vppctl', ['show ip fib']],
                ['trafficgen', 'send_traffic', {}],
                ['vswitch', 'run_vppctl', ['show interfaces']],
            ] +
            STEP_VSWITCH_P2P_FINIT
    },
    {
        "Name": "p2p_l3_multi_IP_routes_vpp",
        "Deployment": "clean",
        "Description": "VPP: P2P L3 multistream with unique route for each IP stream",
        "vSwitch" : "VppDpdkVhost",
        "Parameters" : {
            "TRAFFIC" : {
                'bidir' : 'False',
                "stream_type" : "L3",
                'l2': {
                    'dstmac' : '#PARAM(NICS[0]["mac"])',
                },
                'l3': {
                    'enabled': True,
                    'proto': 'udp',
                    'dstip': '5.0.0.1',
                },
            },
        },
        "TestSteps":
            STEP_VSWITCH_P2P_INIT +
            [
                ['vswitch', 'run_vppctl', ['set int ip address #STEP[1][0] 6.0.2.1/24']],
                ['vswitch', 'run_vppctl', ['set int ip address #STEP[2][0] 6.0.3.1/24']],
                ['vswitch', 'run_vppctl', ['set ip arp #STEP[2][0] 6.0.3.2 00:00:00:00:00:0A']],
                # insertion of huge number of IP routes doesn't cause issues
                # seen with ARP entries at p2p_l3_multi_IP_vpp testcase
                ['vswitch', 'run_vppctl', ['ip route add count $TRAFFIC["multistream"] '
                                           '$TRAFFIC["l3"]["dstip"]/32 via 6.0.3.2']],
                ['vswitch', 'run_vppctl', ['show ip fib summary']],
                ['trafficgen', 'send_traffic', {}],
                ['vswitch', 'run_vppctl', ['show interfaces']],
            ] +
            STEP_VSWITCH_P2P_FINIT
    },
    {
        "Name": "pvp_l3_multi_IP_mask_vpp",
        "Deployment": "clean",
        "Description": "VPP: PVP L3 multistream with route for /8 netmask",
        "vSwitch" : "VppDpdkVhost",
        "Parameters" : {
            "GUEST_TESTPMD_FWD_MODE" : ['io'],
            "TRAFFIC" : {
                'bidir' : 'False',
                "stream_type" : "L3",
                'l2': {
                    'dstmac' : '#PARAM(NICS[0]["mac"])',
                },
                'l3': {
                    'enabled': True,
                    'proto': 'udp',
                    'dstip': '5.0.0.1',
                },
            },
        },
        "TestSteps":
            STEP_VSWITCH_PVP_INIT +
            [
                ['vswitch', 'run_vppctl', ['set interface mac address #STEP[4][0] 00:00:00:00:00:11']],
                # two separate tables are used, so the same IP network can be routed
                # via different DST IPs to reach VM and trafficgen via 2nd phy NIC
                ['vswitch', 'run_vppctl', ['set int ip table #STEP[1][0] 6']],
                ['vswitch', 'run_vppctl', ['set int ip table #STEP[3][0] 6']],
                ['vswitch', 'run_vppctl', ['set int ip address #STEP[1][0] 6.0.1.1/24']],
                ['vswitch', 'run_vppctl', ['set int ip address #STEP[3][0] 6.0.3.1/24']],
                # route traffic to VM; Set DST MAC to MAC of 2nd (output) vhost user interface
                # of VM, so traffic is accepted by VPP in next table
                ['vswitch', 'run_vppctl', ['set ip arp #STEP[3][0] 6.0.3.2 00:00:00:00:00:11 fib-id 6']],
                ['vswitch', 'run_vppctl', ['ip route add $TRAFFIC["l3"]["dstip"]/8 table 6 via 6.0.3.2']],

                ['vswitch', 'run_vppctl', ['set int ip table #STEP[2][0] 7']],
                ['vswitch', 'run_vppctl', ['set int ip table #STEP[4][0] 7']],
                ['vswitch', 'run_vppctl', ['set int ip address #STEP[2][0] 6.0.2.1/24']],
                ['vswitch', 'run_vppctl', ['set int ip address #STEP[4][0] 6.0.4.1/24']],
                # route traffic via 2nd phy NIC to reach trafficgen
                ['vswitch', 'run_vppctl', ['set ip arp #STEP[2][0] 6.0.2.2 00:00:00:00:00:0A fib-id 7']],
                ['vswitch', 'run_vppctl', ['ip route add $TRAFFIC["l3"]["dstip"]/8 table 7 via 6.0.2.2']],

                ['vswitch', 'run_vppctl', ['show ip fib']],
                ['vnf', 'start'],
                ['trafficgen', 'send_traffic', {}],
                ['vswitch', 'run_vppctl', ['show interfaces']],
                ['vnf', 'stop'],
            ] +
            STEP_VSWITCH_PVP_FINIT
    },
    {
        "Name": "pvvp_l3_multi_IP_mask_vpp",
        "Deployment": "clean",
        "Description": "VPP: PVVP L3 multistream with route for /8 netmask",
        "vSwitch" : "VppDpdkVhost",
        "Parameters" : {
            "GUEST_TESTPMD_FWD_MODE" : ['io', 'io'],
            "TRAFFIC" : {
                'bidir' : 'False',
                "stream_type" : "L3",
                'l2': {
                    'dstmac' : '#PARAM(NICS[0]["mac"])',
                },
                'l3': {
                    'enabled': True,
                    'proto': 'udp',
                    'dstip': '5.0.0.1',
                },
            },
        },
        "TestSteps":
            STEP_VSWITCH_PVVP_INIT +
            [
                ['vswitch', 'run_vppctl', ['set interface mac address #STEP[4][0] 00:00:00:00:00:11']],
                ['vswitch', 'run_vppctl', ['set interface mac address #STEP[6][0] 00:00:00:00:00:12']],
                # three separate tables are used, so the same IP network can be routed
                # via different DST IPs to reach both VMs and trafficgen via 2nd phy NIC
                # 1st table
                ['vswitch', 'run_vppctl', ['set int ip table #STEP[1][0] 6']],
                ['vswitch', 'run_vppctl', ['set int ip table #STEP[3][0] 6']],
                ['vswitch', 'run_vppctl', ['set int ip address #STEP[1][0] 6.0.1.1/24']],
                ['vswitch', 'run_vppctl', ['set int ip address #STEP[3][0] 6.0.3.1/24']],
                # route traffic to 1st VM; Set DST MAC to MAC of 2nd (output) vhost user interface
                # of VM1, so traffic is accepted by VPP in next table
                ['vswitch', 'run_vppctl', ['set ip arp #STEP[3][0] 6.0.3.2 00:00:00:00:00:11 fib-id 6']],
                ['vswitch', 'run_vppctl', ['ip route add $TRAFFIC["l3"]["dstip"]/8 table 6 via 6.0.3.2']],
                # 2nd table
                ['vswitch', 'run_vppctl', ['set int ip table #STEP[4][0] 7']],
                ['vswitch', 'run_vppctl', ['set int ip table #STEP[5][0] 7']],
                ['vswitch', 'run_vppctl', ['set int ip address #STEP[4][0] 6.0.4.1/24']],
                ['vswitch', 'run_vppctl', ['set int ip address #STEP[5][0] 6.0.5.1/24']],
                # route traffic to 2nd VM; Set DST MAC to MAC of 2nd (output) vhost user interfacei
                # of VM2, so traffic is accepted by VPP in next table
                ['vswitch', 'run_vppctl', ['set ip arp #STEP[5][0] 6.0.5.2 00:00:00:00:00:12 fib-id 7']],
                ['vswitch', 'run_vppctl', ['ip route add $TRAFFIC["l3"]["dstip"]/8 table 7 via 6.0.5.2']],
                # 3rd table
                ['vswitch', 'run_vppctl', ['set int ip table #STEP[2][0] 8']],
                ['vswitch', 'run_vppctl', ['set int ip table #STEP[6][0] 8']],
                ['vswitch', 'run_vppctl', ['set int ip address #STEP[2][0] 6.0.2.1/24']],
                ['vswitch', 'run_vppctl', ['set int ip address #STEP[6][0] 6.0.6.1/24']],
                # route traffic via 2nd phy NIC to reach trafficgen
                ['vswitch', 'run_vppctl', ['set ip arp #STEP[2][0] 6.0.2.2 00:00:00:00:00:0A fib-id 8']],
                ['vswitch', 'run_vppctl', ['ip route add $TRAFFIC["l3"]["dstip"]/8 table 8 via 6.0.2.2']],
                ['vswitch', 'run_vppctl', ['show ip fib']],
                ['vnf1', 'start'],
                ['vnf2', 'start'],
                ['trafficgen', 'send_traffic', {}],
                ['vswitch', 'run_vppctl', ['show interfaces']],
                ['vnf1', 'stop'],
                ['vnf2', 'stop'],
            ] +
            STEP_VSWITCH_PVVP_FINIT
    },
    {
        "Name": "p2p_l4_multi_PORT_arp_vpp",
        "Deployment": "clean",
        "Description": "VPP: P2P L4 multistream with unique ARP entry for each IP stream and port check",
        "vSwitch" : "VppDpdkVhost",
        "Parameters" : {
            "TRAFFIC" : {
                'bidir' : 'False',
                "stream_type" : "L3",
                'l2': {
                    'dstmac' : '#PARAM(NICS[0]["mac"])',
                },
                'l3': {
                    'enabled': True,
                    'proto': 'udp',
                    'srcip': '6.0.2.2',
                    'dstip': '5.0.0.2',
                },
                'l4': {
                    'enabled': True,
                    'srcport': 7,
                    'dstport': 8,
                },
            },
        },
        "TestSteps":
            STEP_VSWITCH_P2P_INIT +
            [
                ['vswitch', 'run_vppctl', ['set int ip address #STEP[1][0] 6.0.2.1/24']],
                ['vswitch', 'run_vppctl', ['set int ip address #STEP[2][0] 5.0.0.1/8']],
                ['tools', 'exec_python',
                 'import netaddr;'
                 'dst_mac_value = netaddr.EUI("00:00:00:00:00:0A").value;'
                 'cmds=open("/tmp/vppctl_cmds.txt","w");'
                 '[print("set ip arp #STEP[2][0] {} {}".format('
                 'netaddr.IPAddress(netaddr.IPAddress("$TRAFFIC["l3"]["dstip"]").value+i),'
                 'netaddr.EUI(dst_mac_value+i,dialect=netaddr.mac_unix_expanded)),file=cmds) '
                 'for i in range($TRAFFIC["multistream"])];'
                 'cmds.close()'],
                ['vswitch', 'run_vppctl',
                 ['set ip source-and-port-range-check vrf 7 $TRAFFIC["l3"]["srcip"]/24 '
                  'port $TRAFFIC["l4"]["dstport"]']],
                ['vswitch', 'run_vppctl',
                 ['set interface ip source-and-port-range-check #STEP[1][0] udp-out-vrf 7']],
                ['tools', 'exec_shell', "rm -rf /tmp/vppctl_cmds_split*; split -l 1000 "
                                        "/tmp/vppctl_cmds.txt /tmp/vppctl_cmds_split"],
                ['tools', 'exec_shell', "for a in /tmp/vppctl_cmds_split* ; do echo $a ; "
                                        "sudo $TOOLS['vppctl'] exec $a ; sleep 2 ; done"],
                ['vswitch', 'run_vppctl', ['show ip fib summary']],
                ['trafficgen', 'send_traffic', {}],
                ['vswitch', 'run_vppctl', ['show interfaces']],
            ] +
            STEP_VSWITCH_P2P_FINIT
    },
    {
        "Name": "p2p_l4_multi_PORT_mask_vpp",
        "Deployment": "clean",
        "Description": "VPP: P2P L4 multistream with 1 route for /8 net mask and port check",
        "vSwitch" : "VppDpdkVhost",
        "Parameters" : {
            "TRAFFIC" : {
                'bidir' : 'False',
                "stream_type" : "L3",
                'l2': {
                    'dstmac' : '#PARAM(NICS[0]["mac"])',
                },
                'l3': {
                    'enabled': True,
                    'proto': 'udp',
                    'srcip': '6.0.2.2',
                    'dstip': '5.0.0.1',
                },
                'l4': {
                    'enabled': True,
                    'srcport': 7,
                    'dstport': 8,
                },
            },
        },
        "TestSteps":
            STEP_VSWITCH_P2P_INIT +
            [
                ['vswitch', 'run_vppctl', ['set int ip address #STEP[1][0] 6.0.2.1/24']], # STEP 3
                ['vswitch', 'run_vppctl', ['set int ip address #STEP[2][0] 6.0.3.1/24']], # STEP 4
                ['vswitch', 'run_vppctl', ['set ip arp #STEP[2][0] 6.0.3.2 00:00:00:00:00:0A']], # STEP 5
                ['vswitch', 'run_vppctl', ['ip route add $TRAFFIC["l3"]["dstip"]/8 via 6.0.3.2']],
                ['vswitch', 'run_vppctl', ['show ip fib']],
                ['vswitch', 'run_vppctl',
                 ['set ip source-and-port-range-check vrf 7 $TRAFFIC["l3"]["srcip"]/24 '
                  'port $TRAFFIC["l4"]["dstport"]']],
                ['vswitch', 'run_vppctl',
                 ['set interface ip source-and-port-range-check #STEP[1][0] udp-out-vrf 7']],
                ['vswitch', 'run_vppctl', ['show ip fib']],
                ['trafficgen', 'send_traffic', {}],
                ['vswitch', 'run_vppctl', ['show interfaces']],
            ] +
            STEP_VSWITCH_P2P_FINIT
    },
    {
        "Name": "p2p_l4_multi_PORT_routes_vpp",
        "Deployment": "clean",
        "Description": "VPP: P2P L4 multistream with unique route for each IP stream and port check",
        "vSwitch" : "VppDpdkVhost",
        "Parameters" : {
            "TRAFFIC" : {
                'bidir' : 'False',
                "stream_type" : "L3",
                'l2': {
                    'dstmac' : '#PARAM(NICS[0]["mac"])',
                },
                'l3': {
                    'enabled': True,
                    'proto': 'udp',
                    'srcip': '6.0.2.2',
                    'dstip': '5.0.0.1',
                },
                'l4': {
                    'enabled': True,
                    'srcport': 7,
                    'dstport': 8,
                },
            },
        },
        "TestSteps":
            STEP_VSWITCH_P2P_INIT +
            [
                ['vswitch', 'run_vppctl', ['set int ip address #STEP[1][0] 6.0.2.1/24']],
                ['vswitch', 'run_vppctl', ['set int ip address #STEP[2][0] 6.0.3.1/24']],
                ['vswitch', 'run_vppctl', ['set ip arp #STEP[2][0] 6.0.3.2 00:00:00:00:00:0A']],
                # insertion of huge number of IP routes doesn't cause issues
                # seen with ARP entries at p2p_l3_multi_IP_vpp testcase
                ['vswitch', 'run_vppctl',
                 ['ip route add count $TRAFFIC["multistream"] $TRAFFIC["l3"]["dstip"]/32 via 6.0.3.2']],
                ['vswitch', 'run_vppctl',
                 ['set ip source-and-port-range-check vrf 7 $TRAFFIC["l3"]["srcip"]/24 '
                  'port $TRAFFIC["l4"]["dstport"]']],
                ['vswitch', 'run_vppctl',
                 ['set interface ip source-and-port-range-check #STEP[1][0] udp-out-vrf 7']],
                ['vswitch', 'run_vppctl', ['show ip fib summary']],
                ['trafficgen', 'send_traffic', {}],
                ['vswitch', 'run_vppctl', ['show interfaces']],
            ] +
            STEP_VSWITCH_P2P_FINIT
    },
    {
        "Name": "pvp_l4_multi_PORT_mask_vpp",
        "Deployment": "clean",
        "Description": "VPP: PVP L4 multistream with route for /8 net and port mask",
        "vSwitch" : "VppDpdkVhost",
        "Parameters" : {
            "GUEST_TESTPMD_FWD_MODE" : ['io'],
            "TRAFFIC" : {
                'bidir' : 'False',
                "stream_type" : "L3",
                'l2': {
                    'dstmac' : '#PARAM(NICS[0]["mac"])',
                },
                'l3': {
                    'enabled': True,
                    'proto': 'udp',
                    'srcip': '4.0.0.1',
                    'dstip': '5.0.0.1',
                },
                'l4': {
                    'enabled': True,
                    'srcport': 7,
                    'dstport': 8,
                },
            },
        },
        "TestSteps":
            STEP_VSWITCH_PVP_INIT +
            [
                ['vswitch', 'run_vppctl', ['set int mac address #STEP[4][0] 00:00:00:00:00:11']],
                # create table for port check
                ['vswitch', 'run_vppctl', ['set ip source-and-port-range-check vrf 5 '
                                           '$TRAFFIC["l3"]["srcip"]/24 '
                  'port $TRAFFIC["l4"]["dstport"]']],
                # two separate tables are used, so the same IP network can be routed
                # via different DST IPs to reach VM and trafficgen via 2nd phy NIC
                ['vswitch', 'run_vppctl', ['set int ip table #STEP[1][0] 6']],
                ['vswitch', 'run_vppctl', ['set int ip table #STEP[3][0] 6']],
                ['vswitch', 'run_vppctl', ['set int ip address #STEP[1][0] 6.0.1.1/24']],
                ['vswitch', 'run_vppctl', ['set int ip address #STEP[3][0] 6.0.3.1/24']],
                # enforce port check
                ['vswitch', 'run_vppctl', ['set int ip source-and-port-range-check #STEP[1][0] '
                                           'udp-out-vrf 5']],
                # route traffic to VM; Set DST MAC to MAC of 2nd (output) vhost user interface
                # of VM, so traffic is accepted by VPP in next table
                ['vswitch', 'run_vppctl', ['set ip arp #STEP[3][0] 6.0.3.2 00:00:00:00:00:11 fib-id 6']],
                ['vswitch', 'run_vppctl', ['ip route add $TRAFFIC["l3"]["dstip"]/8 table 6 via 6.0.3.2']],

                ['vswitch', 'run_vppctl', ['set int ip table #STEP[2][0] 7']],
                ['vswitch', 'run_vppctl', ['set int ip table #STEP[4][0] 7']],
                ['vswitch', 'run_vppctl', ['set int ip address #STEP[2][0] 6.0.2.1/24']],
                ['vswitch', 'run_vppctl', ['set int ip address #STEP[4][0] 6.0.4.1/24']],
                # route traffic via 2nd phy NIC to reach trafficgen
                ['vswitch', 'run_vppctl', ['set ip arp #STEP[2][0] 6.0.2.2 00:00:00:00:00:0A fib-id 7']],
                ['vswitch', 'run_vppctl', ['ip route add $TRAFFIC["l3"]["dstip"]/8 table 7 via 6.0.2.2']],

                ['vswitch', 'run_vppctl', ['show ip fib']],
                ['vnf', 'start'],
                ['trafficgen', 'send_traffic', {}],
                ['vswitch', 'run_vppctl', ['show interfaces']],
                ['vnf', 'stop'],
            ] +
            STEP_VSWITCH_PVP_FINIT
    },
    {
        "Name": "pvvp_l4_multi_PORT_mask_vpp",
        "Deployment": "clean",
        "Description": "VPP: PVVP L4 multistream with route for /8 net and port mask",
        "vSwitch" : "VppDpdkVhost",
        "Parameters" : {
            "GUEST_TESTPMD_FWD_MODE" : ['io', 'io'],
            "TRAFFIC" : {
                'bidir' : 'False',
                "stream_type" : "L3",
                'l2': {
                    'dstmac' : '#PARAM(NICS[0]["mac"])',
                },
                'l3': {
                    'enabled': True,
                    'proto': 'udp',
                    'srcip': '4.0.0.1',
                    'dstip': '5.0.0.1',
                },
                'l4': {
                    'enabled': True,
                    'srcport': 7,
                    'dstport': 8,
                },
            },
        },
        "TestSteps":
            STEP_VSWITCH_PVVP_INIT +
            [
                ['vswitch', 'run_vppctl', ['set int mac address #STEP[4][0] 00:00:00:00:00:11']],
                ['vswitch', 'run_vppctl', ['set int mac address #STEP[6][0] 00:00:00:00:00:12']],
                # create table for port check
                ['vswitch', 'run_vppctl', ['set ip source-and-port-range-check vrf 5 '
                                           '$TRAFFIC["l3"]["srcip"]/24 port $TRAFFIC["l4"]["dstport"]']],
                # three separate tables are used, so the same IP network can be routed
                # via different DST IPs to reach both VMs and trafficgen via 2nd phy NIC
                # 1st table
                ['vswitch', 'run_vppctl', ['set int ip table #STEP[1][0] 6']],
                ['vswitch', 'run_vppctl', ['set int ip table #STEP[3][0] 6']],
                ['vswitch', 'run_vppctl', ['set int ip address #STEP[1][0] 6.0.1.1/24']],
                ['vswitch', 'run_vppctl', ['set int ip address #STEP[3][0] 6.0.3.1/24']],
                # enforce port check
                ['vswitch', 'run_vppctl', ['set int ip source-and-port-range-check #STEP[1][0] udp-out-vrf 5']],
                # route traffic to 1st VM; Set DST MAC to MAC of 2nd (output) vhost user interface
                # of VM1, so traffic is accepted by VPP in next table
                ['vswitch', 'run_vppctl', ['set ip arp #STEP[3][0] 6.0.3.2 00:00:00:00:00:11 fib-id 6']],
                ['vswitch', 'run_vppctl', ['ip route add $TRAFFIC["l3"]["dstip"]/8 table 6 via 6.0.3.2']],
                # 2nd table
                ['vswitch', 'run_vppctl', ['set int ip table #STEP[4][0] 7']],
                ['vswitch', 'run_vppctl', ['set int ip table #STEP[5][0] 7']],
                ['vswitch', 'run_vppctl', ['set int ip address #STEP[4][0] 6.0.4.1/24']],
                ['vswitch', 'run_vppctl', ['set int ip address #STEP[5][0] 6.0.5.1/24']],
                # route traffic to 2nd VM; Set DST MAC to MAC of 2nd (output) vhost user interfacei
                # of VM2, so traffic is accepted by VPP in next table
                ['vswitch', 'run_vppctl', ['set ip arp #STEP[5][0] 6.0.5.2 00:00:00:00:00:12 fib-id 7']],
                ['vswitch', 'run_vppctl', ['ip route add $TRAFFIC["l3"]["dstip"]/8 table 7 via 6.0.5.2']],
                # 3rd table
                ['vswitch', 'run_vppctl', ['set int ip table #STEP[2][0] 8']],
                ['vswitch', 'run_vppctl', ['set int ip table #STEP[6][0] 8']],
                ['vswitch', 'run_vppctl', ['set int ip address #STEP[2][0] 6.0.2.1/24']],
                ['vswitch', 'run_vppctl', ['set int ip address #STEP[6][0] 6.0.6.1/24']],
                # route traffic via 2nd phy NIC to reach trafficgen
                ['vswitch', 'run_vppctl', ['set ip arp #STEP[2][0] 6.0.2.2 00:00:00:00:00:0A fib-id 8']],
                ['vswitch', 'run_vppctl', ['ip route add $TRAFFIC["l3"]["dstip"]/8 table 8 via 6.0.2.2']],
                ['vswitch', 'run_vppctl', ['show ip fib']],
                ['vnf1', 'start'],
                ['vnf2', 'start'],
                ['trafficgen', 'send_traffic', {}],
                ['vswitch', 'run_vppctl', ['show interfaces']],
                ['vnf1', 'stop'],
                ['vnf2', 'stop'],
            ] +
            STEP_VSWITCH_PVVP_FINIT
    },
    #
    # End of L3 & L4 tests to compare OVS and VPP performance
    #
    #
    # VxLAN tests to compare OVS and VPP performance
    #
    # Example of execution:
    #   ./vsperf --test-params "TRAFFIC={'multistream':2000,'traffic_type':'rfc2544_continuous'}" \
    #       vxlan_multi_IP_vpp
    {
        "Name": "vxlan_multi_IP_mask_ovs",
        "Deployment": "op2p",
        "Tunnel Type": "vxlan",
        "Tunnel Operation": "encapsulation",
        "Description": "OVS: VxLAN L3 multistream",
        "Parameters": {
            "TRAFFICGEN_IXNET_TCL_SCRIPT" : "ixnetrfc2544v2.tcl",
            "TRAFFICGEN_PORT1_MAC" : '00:00:00:00:00:01',
            "TRAFFICGEN_PORT2_MAC" : '#PARAM(NICS[0]["mac"])',
            "TRAFFICGEN_PORT1_IP"  : '9.0.0.2',
            "TRAFFICGEN_PORT2_IP"  : '10.0.0.2',
            "TRAFFIC" : {
                'bidir' : 'False',
                "stream_type" : "L3",
            },
        },
        "TestSteps": [
            ['vswitch', 'del_flow', '$TUNNEL_INTEGRATION_BRIDGE', {'in_port': '1'}],
            ['vswitch', 'add_flow', '$TUNNEL_INTEGRATION_BRIDGE',
             {'in_port': '1', 'dl_type': '0x800', 'nw_proto': '17',
              'nw_dst': '$TRAFFICGEN_PORT2_IP/8', 'actions': ['output:2'],
              'idle_timeout': '0'}],
            ['vswitch', 'dump_flows', '$TUNNEL_INTEGRATION_BRIDGE'],
            ['vswitch', 'dump_flows', '$TUNNEL_EXTERNAL_BRIDGE'],
        ],
    },
    {
        "Name": "vxlan_multi_IP_arp_vpp",
        "Deployment": "clean",
        "Description": "VPP: VxLAN L3 multistream with unique ARP entry for each IP stream",
        "vSwitch" : "VppDpdkVhost",
        "Parameters" : {
            "TRAFFIC" : {
                'bidir' : 'False',
                "stream_type" : "L3",
                'l2': {
                    'dstmac' : '#PARAM(NICS[0]["mac"])',
                },
                'l3': {
                    'enabled': True,
                    'proto': 'udp',
                    'dstip': '10.0.0.2',
                },
                'l4': {
                    'enabled': True,
                },
            },
        },
        "TestSteps":
            STEP_VSWITCH_P2P_INIT +
            [
                ['vswitch', 'run_vppctl',
                 ['set int ip address #STEP[1][0] 9.0.0.1/16']],
                ['vswitch', 'run_vppctl',
                 ['set int ip address #STEP[2][0] 11.0.0.1/16']],
                ['vswitch', 'run_vppctl',
                 ['create vxlan tunnel src 11.0.0.1 dst 11.0.0.2 vni 1']],
                ['vswitch', 'run_vppctl',
                 ['set int state vxlan_tunnel0 up']],
                ['vswitch', 'run_vppctl',
                 ['set int ip address vxlan_tunnel0 10.0.0.1/8']],
                ['vswitch', 'run_vppctl',
                 ['set ip arp #STEP[2][0] 11.0.0.2 00:00:00:00:00:00']],
                ['tools', 'exec_python',
                 'import netaddr;'
                 'dst_mac_value = netaddr.EUI("00:00:00:00:00:0A").value;'
                 'cmds=open("/tmp/vppctl_cmds.txt","w");'
                 '[print("set ip arp vxlan_tunnel0 {} {}".format('
                 'netaddr.IPAddress(netaddr.IPAddress("$TRAFFIC["l3"]["dstip"]").value+i),'
                 'netaddr.EUI(dst_mac_value+i,dialect=netaddr.mac_unix_expanded)),file=cmds) '
                 'for i in range($TRAFFIC["multistream"])];'
                 'cmds.close()'],
                ['tools', 'exec_shell',
                 "rm -rf /tmp/vppctl_cmds_split*;"
                 "split -l 1000 /tmp/vppctl_cmds.txt /tmp/vppctl_cmds_split"],
                ['tools', 'exec_shell',
                 "for a in /tmp/vppctl_cmds_split* ; do "
                 "echo $a ; sudo $TOOLS['vppctl'] exec $a ; sleep 2 ; done"],
                ['vswitch', 'run_vppctl', ['show ip fib summary']],
                ['trafficgen', 'send_traffic', {}],
                ['vswitch', 'run_vppctl', ['show interfaces']],
            ] +
            STEP_VSWITCH_P2P_FINIT
    },
    {
        "Name": "vxlan_multi_IP_mask_vpp",
        "Deployment": "clean",
        "Description": "VPP: VxLAN L3 multistream with 1 route for /8 netmask",
        "vSwitch" : "VppDpdkVhost",
        "Parameters" : {
            "TRAFFIC" : {
                'bidir' : 'False',
                "stream_type" : "L3",
                'l2': {
                    'dstmac' : '#PARAM(NICS[0]["mac"])',
                },
                'l3': {
                    'enabled': True,
                    'proto': 'udp',
                    'dstip': '8.0.0.1',
                },
                'l4': {
                    'enabled': True,
                },
            },
        },
        "TestSteps":
            STEP_VSWITCH_P2P_INIT +
            [
                ['vswitch', 'run_vppctl',
                 ['set int ip address #STEP[1][0] 9.0.0.1/16']],
                ['vswitch', 'run_vppctl',
                 ['set int ip address #STEP[2][0] 11.0.0.1/16']],
                ['vswitch', 'run_vppctl',
                 ['create vxlan tunnel src 11.0.0.1 dst 11.0.0.2 vni 1']],
                ['vswitch', 'run_vppctl',
                 ['set int state vxlan_tunnel0 up']],
                ['vswitch', 'run_vppctl',
                 ['set int ip address vxlan_tunnel0 10.0.0.1/24']],
                ['vswitch', 'run_vppctl',
                 ['set ip arp #STEP[2][0] 11.0.0.2 00:00:00:00:00:00']],
                ['vswitch', 'run_vppctl',
                 ['set ip arp vxlan_tunnel0 10.0.0.2 00:00:00:00:00:0A']],
                ['vswitch', 'run_vppctl', ['ip route add $TRAFFIC["l3"]["dstip"]/8 via 10.0.0.2']],
                ['vswitch', 'run_vppctl', ['show ip fib']],
                ['trafficgen', 'send_traffic', {}],
                ['vswitch', 'run_vppctl', ['show interfaces']],
            ] +
            STEP_VSWITCH_P2P_FINIT
    },
    #
    # End of VxLAN tests to compare OVS and VPP performance
    #
]