aboutsummaryrefslogtreecommitdiffstats
path: root/tools/pkt_gen
diff options
context:
space:
mode:
authorDino Simeon Madarang <dino.simeonx.madarang@intel.com>2016-01-29 13:55:53 +0000
committerMaryam Tahhan <maryam.tahhan@intel.com>2016-02-03 10:17:51 +0000
commit4b8014e83855e1da674d3115237c2556742cbdad (patch)
treecd9e9246a066f942425ada847199f7318957b90e /tools/pkt_gen
parent5d5fc10455b2f57321e2933f61b909af2ec73407 (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>
Diffstat (limited to 'tools/pkt_gen')
-rwxr-xr-xtools/pkt_gen/ixnet/GeneveIxNetTemplate.xml_ClearText.xml49
-rwxr-xr-xtools/pkt_gen/ixnet/ixnetrfc2544v2.tcl87
2 files changed, 134 insertions, 2 deletions
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