diff options
author | Dino Simeon Madarang <dino.simeonx.madarang@intel.com> | 2016-01-29 13:55:53 +0000 |
---|---|---|
committer | Maryam Tahhan <maryam.tahhan@intel.com> | 2016-02-03 10:17:51 +0000 |
commit | 4b8014e83855e1da674d3115237c2556742cbdad (patch) | |
tree | cd9e9246a066f942425ada847199f7318957b90e | |
parent | 5d5fc10455b2f57321e2933f61b909af2ec73407 (diff) |
pkt_gen: Add support for generating GENEVE frames
Add option to generate GENEVE frames for decapsulation
tests.
IxNet 7.3X does not have a native support of GENEVE protocol. The
template, GeneveIxNetTemplate.xml_ClearText.xml, should be imported
into IxNET for this testcase to work.
Recent changes:
* Updated dependency
* Updated userguide
* Move inner frame variables & srcport/dstport to L4
Change-Id: I90f5fb256b51ae44bc1bc7983c599c9dbbffea08
JIRA: VSPERF-192
Signed-off-by: Dino Simeon Madarang <dino.simeonx.madarang@intel.com>
Reviewed-by: Maryam Tahhan <maryam.tahhan@intel.com>
Reviewed-by: Martin Klozik <martinx.klozik@intel.com>
Reviewed-by: Mark D. Gray <mark.d.gray@intel.com>
Reviewed-by: Al Morton <acmorton@att.com>
Reviewed-by: Brian Castelli <brian.castelli@spirent.com>
-rw-r--r-- | conf/integration/03_traffic.conf | 30 | ||||
-rwxr-xr-x | docs/userguide/integration.rst | 69 | ||||
-rwxr-xr-x | tools/pkt_gen/ixnet/GeneveIxNetTemplate.xml_ClearText.xml | 49 | ||||
-rwxr-xr-x | tools/pkt_gen/ixnet/ixnetrfc2544v2.tcl | 87 |
4 files changed, 233 insertions, 2 deletions
diff --git a/conf/integration/03_traffic.conf b/conf/integration/03_traffic.conf index 7a890ad3..501a3ea8 100644 --- a/conf/integration/03_traffic.conf +++ b/conf/integration/03_traffic.conf @@ -71,6 +71,8 @@ VXLAN_FRAME_l4 = {'srcport': 4789, 'protocolpadbytes': '', } +# TEST frame +# dstmac should be set to the MAC address of the DUT's receiving port GRE_FRAME_L2 = {'srcmac': '', 'dstmac': '', } @@ -93,3 +95,31 @@ GRE_FRAME_l4 = {'srcport': 0, 'protocolpad': '', 'protocolpadbytes': '', } + + +# TEST frame +# dstmac should be set to the MAC address of the DUT's receiving port +GENEVE_FRAME_L2 = {'srcmac': '', + 'dstmac': '', + } + +GENEVE_FRAME_L3 = {'proto': 'udp', + 'packetsize': 64, + 'srcip': TRAFFICGEN_PORT1_IP, + 'dstip': '', + } + +# UDP source/destination port (OUTER FRAME) +# Variables with prefix inner_ are for the +# INNER_FRAME +GENEVE_FRAME_l4 = {'srcport': 6081, + 'dstport': 6081, + 'geneve_vni': 0, + 'inner_srcmac': '', + 'inner_dstmac': '', + 'inner_srcip': '', + 'inner_dstip': '', + 'inner_proto': 'tcp', + 'inner_srcport': 3000, + 'inner_dstport': 3001, + } diff --git a/docs/userguide/integration.rst b/docs/userguide/integration.rst index bca8eaaf..c13ea142 100755 --- a/docs/userguide/integration.rst +++ b/docs/userguide/integration.rst @@ -185,3 +185,72 @@ To run GRE decapsulation tests: .. code-block:: console ./vsperf --conf-file user_settings.py --test-param 'tunnel_type=gre' --run-integration overlay_p2p_decap_cont + + +Executing GENEVE decapsulation tests +------------------------------------ + +IxNet 7.3X does not have native support of GENEVE protocol. The +template, GeneveIxNetTemplate.xml_ClearText.xml, should be imported +into IxNET for this testcase to work. + +To import the template do: +1. Run the IxNetwork TCL Server +2. Click on the Traffic menu +3. Click on the Traffic actions and click Edit Packet Templates +4. On the Template editor window, click Import. + Select the template tools/pkt_gen/ixnet/GeneveIxNetTemplate.xml_ClearText.xml + and click import. + + +To run GENEVE decapsulation tests: + +1. Set the variables used in "Executing Tunnel encapsulation tests" + +2. Set IXNET_TCL_SCRIPT, GENEVE_FRAME_L2, GENEVE_FRAME_L3 and DUT_NIC1_MAC of your settings file to: + + .. code-block:: console + + IXNET_TCL_SCRIPT='ixnetrfc2544v2.tcl' + + GENEVE_FRAME_L2 = {'srcmac': + '01:02:03:04:05:06', + 'dstmac': + '<DUT's NIC2 MAC>', + } + + GENEVE_FRAME_L3 = {'proto': 'udp', + 'packetsize': 64, + 'srcip': '1.1.1.1', + 'dstip': '192.168.240.1', + 'geneve_vni': 0, + 'inner_srcmac': '01:02:03:04:05:06', + 'inner_dstmac': '06:05:04:03:02:01', + 'inner_srcip': '192.168.0.10', + 'inner_dstip': '192.168.240.9', + 'inner_proto': 'udp', + 'inner_srcport': 3000, + 'inner_dstport': 3001, + } + GENEVE_FRAME_L4 = {'srcport': 6081, + 'dstport': 6081, + 'geneve_vni': 0, + 'inner_srcmac': '01:02:03:04:05:06', + 'inner_dstmac': '06:05:04:03:02:01', + 'inner_srcip': '192.168.0.10', + 'inner_dstip': '192.168.240.9', + 'inner_proto': 'udp', + 'inner_srcport': 3000, + 'inner_dstport': 3001, + } + + + # The receiving NIC of GENEVE traffic + DUT_NIC1_MAC = '<mac address>' + +3. Run test: + + .. code-block:: console + + ./vsperf --conf-file user_settings.py --test-param 'tunnel_type=geneve' --run-integration overlay_p2p_decap_cont + diff --git a/tools/pkt_gen/ixnet/GeneveIxNetTemplate.xml_ClearText.xml b/tools/pkt_gen/ixnet/GeneveIxNetTemplate.xml_ClearText.xml new file mode 100755 index 00000000..56539d31 --- /dev/null +++ b/tools/pkt_gen/ixnet/GeneveIxNetTemplate.xml_ClearText.xml @@ -0,0 +1,49 @@ +<!-- +# Copyright (c) 2016, Ixia +# Copyright (c) 2016, Intel Corporation +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. + +# This file is a modified version of a packet template generated by Ixia +# IxNetwork. + +--> +<ProtocolItems ver="1.0"> + <item layer="Layer3" name="CustomGeneve-template.xml" ProtocolDisplayName="Geneve" ProtocolName="Geneve"><protocol name="Geneve" displayName="Geneve" tclName="geneve"> + <lookup lookupName="udpsrcprt" value="6081" /> + <lookup lookupName="portNum" value="6081" /> + <field name="version" displayName="Version" length="2" value="0x0" format="hex" defaultValue="0x0" tclName="version" /> + <field name="options_length" displayName="Options Length" length="6" value="0x00" format="hex" defaultValue="0x00" tclName="optionsLength" /> + <field displayName="Flags" name="flags" length="8" format="hex" defaultValue="0x00" tclName="flags" /> + <field displayName="Protocol Type" name="protocol_type" length="16" format="hex" griddable="true" rateVariable="true" trackable="true" defaultValue="0x6558" tclName="protocolType" /> + <field displayName="VNI" name="VNI" length="24" format="integer" griddable="true" rateVariable="true" trackable="true" defaultValue="0" tclName="vni" /> + <payload displayName="Payload0" name="Payload0" /> +</protocol></item> +</ProtocolItems> diff --git a/tools/pkt_gen/ixnet/ixnetrfc2544v2.tcl b/tools/pkt_gen/ixnet/ixnetrfc2544v2.tcl index c94e85a3..83aa3afc 100755 --- a/tools/pkt_gen/ixnet/ixnetrfc2544v2.tcl +++ b/tools/pkt_gen/ixnet/ixnetrfc2544v2.tcl @@ -152,7 +152,9 @@ proc startRfc2544Test { testSpec trafficSpec } { } # VXLAN - set vxlan_enabled [dict exists $trafficSpec_l4 vni] + set vxlan_enabled [dict exists $trafficSpec_l4 vni] + set geneve_enabled [dict exists $trafficSpec_l4 geneve_vni] + if { $vxlan_enabled } { puts "VXLAN is enabled. Setting VXLAN variables" set vni [dict get $trafficSpec_l4 vni] @@ -164,6 +166,17 @@ proc startRfc2544Test { testSpec trafficSpec } { set inner_proto [string tolower $inner_proto] set inner_srcport [dict get $trafficSpec_l4 inner_srcport] set inner_dstport [dict get $trafficSpec_l4 inner_dstport] + } elseif { $geneve_enabled } { + puts "GENEVE is enabled. Setting GENEVE variables" + set geneve_vni [dict get $trafficSpec_l4 geneve_vni] + set inner_srcmac [dict get $trafficSpec_l4 inner_srcmac] + set inner_dstmac [dict get $trafficSpec_l4 inner_dstmac] + set inner_srcip [dict get $trafficSpec_l4 inner_srcip] + set inner_dstip [dict get $trafficSpec_l4 inner_dstip] + set inner_proto [dict get $trafficSpec_l4 inner_proto] + set inner_proto [string tolower $inner_proto] + set inner_srcport [dict get $trafficSpec_l4 inner_srcport] + set inner_dstport [dict get $trafficSpec_l4 inner_dstport] } set gre_enabled False @@ -2024,7 +2037,7 @@ proc startRfc2544Test { testSpec trafficSpec } { set gre_enabled True } - if { $vxlan_enabled || $gre_enabled } { + if { $vxlan_enabled || $gre_enabled || $geneve_enabled } { # VXLAN and GRE have similar inner frame data so we set unique fields # for each protocol then set the common fields. @@ -2100,6 +2113,76 @@ proc startRfc2544Test { testSpec trafficSpec } { -randomMask 0 \ -startValue 0 + } elseif { $geneve_enabled } { + # GENEVE START + # + set sg_stack $ixNetSG_Stack(2)/stack:"geneve-$stack_number" + sg_commit + set sg_stack [lindex [ixNet remapIds $sg_stack] 0] + set ixNetSG_Stack(3) $sg_stack + incr stack_number + + set sg_field $ixNetSG_Stack(3)/field:"geneve.header.version-1" + ixNet setMultiAttrs $sg_field \ + -singleValue 0 \ + -seed 1 \ + -optionalEnabled true \ + -valueList [list 0x00] \ + -stepValue 0x00 \ + -fixedBits 0x00 \ + -fieldValue 0 \ + -randomMask 0x00 \ + -startValue 0x00 + + set sg_field $ixNetSG_Stack(3)/field:"geneve.header.optionsLength-2" + ixNet setMultiAttrs $sg_field \ + -singleValue 0 \ + -seed 1 \ + -optionalEnabled true \ + -valueList [list 0x00] \ + -stepValue 0x00 \ + -fixedBits 0x00 \ + -fieldValue 0 \ + -randomMask 0x00 \ + -startValue 0x00 + + + set sg_field $ixNetSG_Stack(3)/field:"geneve.header.flags-3" + ixNet setMultiAttrs $sg_field \ + -singleValue 0 \ + -seed 1 \ + -optionalEnabled true \ + -valueList [list 0x00] \ + -stepValue 0x00 \ + -fixedBits 0x00 \ + -fieldValue 0 \ + -randomMask 0x00 \ + -startValue 0x00 + + set sg_field $ixNetSG_Stack(3)/field:"geneve.header.protocolType-4" + ixNet setMultiAttrs $sg_field \ + -singleValue 6558 \ + -seed 1 \ + -optionalEnabled true \ + -valueList [list 0x6558] \ + -stepValue 0x6558 \ + -fixedBits 0x6558 \ + -fieldValue 6558 \ + -randomMask 0x6558 \ + -startValue 0x6558 + + set sg_field $ixNetSG_Stack(3)/field:"geneve.header.vni-5" + ixNet setMultiAttrs $sg_field \ + -singleValue 0 \ + -seed 1 \ + -optionalEnabled true \ + -valueList [list 0] \ + -stepValue 0 \ + -fixedBits 0 \ + -fieldValue 0 \ + -randomMask 0 \ + -startValue 0 + } elseif { $gre_enabled } { puts "Setting GRE attributes" # GRE START |