From 4b8014e83855e1da674d3115237c2556742cbdad Mon Sep 17 00:00:00 2001 From: Dino Simeon Madarang Date: Fri, 29 Jan 2016 13:55:53 +0000 Subject: 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 Reviewed-by: Maryam Tahhan Reviewed-by: Martin Klozik Reviewed-by: Mark D. Gray Reviewed-by: Al Morton Reviewed-by: Brian Castelli --- conf/integration/03_traffic.conf | 30 ++++++++ docs/userguide/integration.rst | 69 +++++++++++++++++ .../ixnet/GeneveIxNetTemplate.xml_ClearText.xml | 49 ++++++++++++ tools/pkt_gen/ixnet/ixnetrfc2544v2.tcl | 87 +++++++++++++++++++++- 4 files changed, 233 insertions(+), 2 deletions(-) create mode 100755 tools/pkt_gen/ixnet/GeneveIxNetTemplate.xml_ClearText.xml 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': + '', + } + + 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 = '' + +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 @@ + + + + + + + + + + + + + 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 -- cgit 1.2.3-korg