Merge "test_spec: LTD: MatchAction Performance testing"
[vswitchperf.git] / tools / pkt_gen / ixnet / ixnetrfc2544.tcl
old mode 100755 (executable)
new mode 100644 (file)
index 2a156d3..e70ca87
@@ -1,7 +1,7 @@
 #!/usr/bin/env tclsh
 
 # Copyright (c) 2014, Ixia
-# Copyright (c) 2015, Intel Corporation
+# Copyright (c) 2015-2016, Intel Corporation
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -81,15 +81,18 @@ proc startRfc2544Test { testSpec trafficSpec } {
 
     set binary                  [dict get $testSpec binary]
 
+    set duration                [dict get $testSpec duration]
+
+    # RFC2544 to IXIA terminology mapping (it affects Ixia configuration inside this script):
+    # Test    => Trial
+    # Trial   => Iteration
     if {$binary} {
-        set numTrials           [dict get $testSpec trials]
-        set duration            [dict get $testSpec duration]
+        set numTests            [dict get $testSpec tests]
         set frameRate           100
         set tolerance           [dict get $testSpec lossrate]
         set loadType            binary
     } else {
-        set numTrials           1
-        set duration            [dict get $testSpec time]
+        set numTests            1
         set frameRate           [dict get $testSpec framerate]
         set tolerance           0.0
         set loadType            custom
@@ -97,6 +100,13 @@ proc startRfc2544Test { testSpec trafficSpec } {
 
     set learningFrames          True
 
+    set L2CountValue            1
+    set L2Increment             False
+    set L3ValueType             singleValue
+    set L3CountValue            1
+    set L4ValueType             singleValue
+    set L4CountValue            1
+
     if {$learningFrames} {
         set learningFrequency   oncePerTest
         set fastPathEnable      True
@@ -106,20 +116,25 @@ proc startRfc2544Test { testSpec trafficSpec } {
     }
 
     set multipleStreams         [dict get $testSpec multipleStreams]
+    set streamType              [dict get $testSpec streamType]
+
     if {($multipleStreams < 0)} {
-        set multipleStreams    0
+        set multipleStreams     0
+    } elseif {($multipleStreams > 65535)} {
+        set multipleStreams     65535
     }
-    set numflows               64000
 
     if {$multipleStreams} {
-        if {($multipleStreams > 65535)} {
-            set numflows       65535
+        if {($streamType == "L2")} {
+            set L2CountValue    $multipleStreams
+            set L2Increment     True
+        } elseif {($streamType == "L3")} {
+            set L3ValueType     increment
+            set L3CountValue    $multipleStreams
         } else {
-            set numflows       $multipleStreams
+            set L4ValueType     increment
+            set L4CountValue    $multipleStreams
         }
-        set multipleStreams     increment
-    } else {
-        set multipleStreams     singleValue
     }
 
     set fastConvergence         True
@@ -130,13 +145,14 @@ proc startRfc2544Test { testSpec trafficSpec } {
     # extract nested dictionaries
     set trafficSpec_l2          [dict get $trafficSpec l2]
     set trafficSpec_l3          [dict get $trafficSpec l3]
+    set trafficSpec_l4          [dict get $trafficSpec l4]
     set trafficSpec_vlan        [dict get $trafficSpec vlan]
 
     set frameSize               [dict get $trafficSpec_l2 framesize]
     set srcMac                  [dict get $trafficSpec_l2 srcmac]
     set dstMac                  [dict get $trafficSpec_l2 dstmac]
-    set srcPort                 [dict get $trafficSpec_l2 srcport]
-    set dstPort                 [dict get $trafficSpec_l2 dstport]
+    set srcPort                 [dict get $trafficSpec_l4 srcport]
+    set dstPort                 [dict get $trafficSpec_l4 dstport]
 
     set proto                   [dict get $trafficSpec_l3 proto]
     set srcIp                   [dict get $trafficSpec_l3 srcip]
@@ -145,7 +161,7 @@ proc startRfc2544Test { testSpec trafficSpec } {
 
     if {$frameSize < 68 } {
         if {$rfc2544TestType == "back2back"} {
-            puts "WARNING: Packet size too small, packet size will be \
+            puts "INFO: Packet size too small, packet size will be \
                   increased to 68 for this test"
         }
     }
@@ -252,14 +268,14 @@ proc startRfc2544Test { testSpec trafficSpec } {
      -destMacRetryCount 1 \
      -maxTrafficGenerationQueries 500 \
      -enableStaggeredTransmit False \
-     -learningFrameSize 64 \
+     -learningFrameSize $frameSize \
      -useTxRxSync True \
      -enableDestMacRetry True \
      -enableMulticastScalingFactor False \
      -destMacRetryDelay 5 \
      -largeErrorThreshhold 2 \
      -refreshLearnedInfoBeforeApply False \
-     -enableMinFrameSize False \
+     -enableMinFrameSize True \
      -macChangeOnFly False \
      -waitTime 1 \
      -enableInstantaneousStatsSupport False \
@@ -692,9 +708,9 @@ proc startRfc2544Test { testSpec trafficSpec } {
     set sg_lan [ixNet add $ixNetSG_Stack(1)/protocols/static lan]
     ixNet setMultiAttrs $sg_lan \
      -atmEncapsulation ::ixNet::OBJ-null \
-     -count 1 \
+     -count $L2CountValue \
      -countPerVc 1 \
-     -enableIncrementMac False \
+     -enableIncrementMac $L2Increment \
      -enableIncrementVlan False \
      -enableSiteId False \
      -enableVlan False \
@@ -702,7 +718,7 @@ proc startRfc2544Test { testSpec trafficSpec } {
      -frEncapsulation ::ixNet::OBJ-null \
      -incrementPerVcVlanMode noIncrement \
      -incrementVlanMode noIncrement \
-     -mac "00:00:00:00:00:01" \
+     -mac $srcMac \
      -macRangeMode normal \
      -numberOfVcs 1 \
      -siteId 0 \
@@ -1072,9 +1088,9 @@ proc startRfc2544Test { testSpec trafficSpec } {
     set sg_lan [ixNet add $ixNetSG_Stack(1)/protocols/static lan]
     ixNet setMultiAttrs $sg_lan \
      -atmEncapsulation ::ixNet::OBJ-null \
-     -count 1 \
+     -count $L2CountValue \
      -countPerVc 1 \
-     -enableIncrementMac False \
+     -enableIncrementMac $L2Increment \
      -enableIncrementVlan False \
      -enableSiteId False \
      -enableVlan False \
@@ -1082,7 +1098,7 @@ proc startRfc2544Test { testSpec trafficSpec } {
      -frEncapsulation ::ixNet::OBJ-null \
      -incrementPerVcVlanMode noIncrement \
      -incrementVlanMode noIncrement \
-     -mac "00:01:00:05:08:00" \
+     -mac $dstMac \
      -macRangeMode normal \
      -numberOfVcs 1 \
      -siteId 0 \
@@ -1348,20 +1364,20 @@ proc startRfc2544Test { testSpec trafficSpec } {
     #
     set sg_field $ixNetSG_Stack(3)/field:"ethernet.header.destinationAddress-1"
     ixNet setMultiAttrs $sg_field \
-     -singleValue {00:00:00:00:00:00} \
+     -singleValue $dstMac \
      -seed {1} \
      -optionalEnabled True \
      -fullMesh False \
      -valueList {{00:00:00:00:00:00}} \
-     -stepValue {00:00:00:00:00:00} \
+     -stepValue {00:00:00:00:00:01} \
      -fixedBits {00:00:00:00:00:00} \
-     -fieldValue {00:00:00:00:00:00} \
+     -fieldValue $dstMac \
      -auto False \
      -randomMask {00:00:00:00:00:00} \
      -trackingEnabled False \
      -valueType singleValue \
      -activeFieldChoice False \
-     -startValue {00:00:00:00:00:00} \
+     -startValue $dstMac \
      -countValue {1}
     sg_commit
     set sg_field [lindex [ixNet remapIds $sg_field] 0]
@@ -2046,14 +2062,14 @@ proc startRfc2544Test { testSpec trafficSpec } {
     #
     set sg_field $ixNetSG_Stack(3)/field:"ipv4.header.srcIp-27"
     ixNet setMultiAttrs $sg_field \
-     -singleValue {1.1.1.1} \
+     -singleValue $srcIp \
      -seed {1} \
      -optionalEnabled True \
      -fullMesh False \
      -valueList {{0.0.0.0}} \
      -stepValue {0.0.0.0} \
      -fixedBits {0.0.0.0} \
-     -fieldValue {1.1.1.1} \
+     -fieldValue $srcIp \
      -auto False \
      -randomMask {0.0.0.0} \
      -trackingEnabled False \
@@ -2069,21 +2085,21 @@ proc startRfc2544Test { testSpec trafficSpec } {
     #
     set sg_field $ixNetSG_Stack(3)/field:"ipv4.header.dstIp-28"
     ixNet setMultiAttrs $sg_field \
-     -singleValue {90.90.90.90} \
+     -singleValue $dstIp \
      -seed {1} \
      -optionalEnabled True \
      -fullMesh False \
      -valueList {{0.0.0.0}} \
-     -stepValue {0.0.0.0} \
+     -stepValue {0.0.0.1} \
      -fixedBits {0.0.0.0} \
-     -fieldValue {90.90.90.90} \
+     -fieldValue $dstIp \
      -auto False \
      -randomMask {0.0.0.0} \
      -trackingEnabled False \
-     -valueType singleValue \
+     -valueType $L3ValueType \
      -activeFieldChoice False \
-     -startValue {0.0.0.0} \
-     -countValue {1}
+     -startValue $dstIp \
+     -countValue $L3CountValue
     sg_commit
     set sg_field [lindex [ixNet remapIds $sg_field] 0]
 
@@ -2824,10 +2840,10 @@ proc startRfc2544Test { testSpec trafficSpec } {
      -auto False \
      -randomMask {63} \
      -trackingEnabled False \
-     -valueType $multipleStreams \
+     -valueType $L4ValueType \
      -activeFieldChoice False \
      -startValue {0} \
-     -countValue $numflows
+     -countValue $L4CountValue
     sg_commit
     set sg_field [lindex [ixNet remapIds $sg_field] 0]
 
@@ -2983,20 +2999,20 @@ proc startRfc2544Test { testSpec trafficSpec } {
     #
     set sg_field $ixNetSG_Stack(3)/field:"ethernet.header.destinationAddress-1"
     ixNet setMultiAttrs $sg_field \
-     -singleValue {00:01:00:05:08:00} \
+     -singleValue $dstMac \
      -seed {1} \
      -optionalEnabled True \
      -fullMesh False \
-     -valueList {{LearntInfo}} \
-     -stepValue {00:00:00:00:00:00} \
+     -valueList {{00:00:00:00:00:00}} \
+     -stepValue {00:00:00:00:00:01} \
      -fixedBits {00:00:00:00:00:00} \
-     -fieldValue {00:01:00:05:08:00} \
+     -fieldValue $dstMac \
      -auto False \
      -randomMask {00:00:00:00:00:00} \
      -trackingEnabled False \
      -valueType singleValue \
      -activeFieldChoice False \
-     -startValue {00:00:00:00:00:00} \
+     -startValue $dstMac \
      -countValue {1}
     sg_commit
     set sg_field [lindex [ixNet remapIds $sg_field] 0]
@@ -3010,7 +3026,7 @@ proc startRfc2544Test { testSpec trafficSpec } {
      -seed {1} \
      -optionalEnabled True \
      -fullMesh False \
-     -valueList {{LearntInfo}} \
+     -valueList {{00:00:00:00:00:00}} \
      -stepValue {00:00:00:00:00:00} \
      -fixedBits {00:00:00:00:00:00} \
      -fieldValue {00:00:00:00:00:01} \
@@ -3681,7 +3697,7 @@ proc startRfc2544Test { testSpec trafficSpec } {
     #
     set sg_field $ixNetSG_Stack(3)/field:"ipv4.header.srcIp-27"
     ixNet setMultiAttrs $sg_field \
-     -singleValue {1.1.1.1} \
+     -singleValue $srcIp \
      -seed {1} \
      -optionalEnabled True \
      -fullMesh False \
@@ -3704,21 +3720,21 @@ proc startRfc2544Test { testSpec trafficSpec } {
     #
     set sg_field $ixNetSG_Stack(3)/field:"ipv4.header.dstIp-28"
     ixNet setMultiAttrs $sg_field \
-     -singleValue {90.90.90.90} \
+     -singleValue $dstIp \
      -seed {1} \
      -optionalEnabled True \
      -fullMesh False \
      -valueList {{0.0.0.0}} \
-     -stepValue {0.0.0.0} \
+     -stepValue {0.0.0.1} \
      -fixedBits {0.0.0.0} \
-     -fieldValue {90.90.90.90} \
+     -fieldValue $dstIp \
      -auto False \
      -randomMask {0.0.0.0} \
      -trackingEnabled False \
-     -valueType singleValue \
+     -valueType $L3ValueType \
      -activeFieldChoice False \
-     -startValue {0.0.0.0} \
-     -countValue {1}
+     -startValue $dstIp \
+     -countValue $L3CountValue
     sg_commit
     set sg_field [lindex [ixNet remapIds $sg_field] 0]
 
@@ -4459,10 +4475,10 @@ proc startRfc2544Test { testSpec trafficSpec } {
      -auto False \
      -randomMask {63} \
      -trackingEnabled False \
-     -valueType $multipleStreams \
+     -valueType $L4ValueType \
      -activeFieldChoice False \
      -startValue {0} \
-     -countValue $numflows
+     -countValue $L4CountValue
     sg_commit
     set sg_field [lindex [ixNet remapIds $sg_field] 0]
 
@@ -7761,18 +7777,18 @@ proc startRfc2544Test { testSpec trafficSpec } {
          -inputParameters {{}}
         ixNet setMultiAttrs $sg_rfc2544throughput/testConfig \
          -protocolItem {} \
-         -enableMinFrameSize False \
+         -enableMinFrameSize True \
          -framesize $frameSize \
          -reportTputRateUnit mbps \
          -duration $duration \
-         -numtrials $numTrials \
+         -numtrials $numTests \
          -trafficType constantLoading \
          -burstSize 1 \
          -framesPerBurstGap 1 \
          -tolerance 0 \
          -frameLossUnit {0} \
          -staggeredStart False \
-         -framesizeList {64} \
+         -framesizeList $frameSize \
          -frameSizeMode custom \
          -rateSelect percentMaxRate \
          -percentMaxRate 100 \
@@ -7843,7 +7859,7 @@ proc startRfc2544Test { testSpec trafficSpec } {
          -enableFastConvergence $fastConvergence \
          -fastConvergenceDuration $convergenceDuration \
          -fastConvergenceThreshold 10 \
-         -framesizeFixedValue 128 \
+         -framesizeFixedValue $frameSize \
          -gap 3 \
          -unchangedInitial False \
          -generateTrackingOptionAggregationFiles False \
@@ -7856,7 +7872,7 @@ proc startRfc2544Test { testSpec trafficSpec } {
          -imixData {{{{64}{{TOS S:0 S:0 S:0 S:0 S:0} S:0}{1 40}}{{128}{{TOS S:0 S:0 S:0 S:0 S:0} S:0}{1 30}}{{256}{{TOS S:0 S:0 S:0 S:0 S:0} S:0}{1 30}}}} \
          -imixEnabled False \
          -imixTemplates none \
-         -framesizeImixList {64} \
+         -framesizeImixList $frameSize \
          -imixTrafficType {UNCHNAGED} \
          -mapType {oneToOne} \
          -supportedTrafficTypes {mac,ipv4,ipv6,ipmix}
@@ -7865,8 +7881,8 @@ proc startRfc2544Test { testSpec trafficSpec } {
          -learnNumFrames 10 \
          -learnRate 100 \
          -learnWaitTime 1000 \
-         -learnFrameSize 64 \
-         -fastPathLearnFrameSize 64 \
+         -learnFrameSize $frameSize \
+         -fastPathLearnFrameSize $frameSize \
          -learnWaitTimeBeforeTransmit 0 \
          -learnSendMacOnly False \
          -learnSendRouterSolicitation False \
@@ -7938,14 +7954,14 @@ proc startRfc2544Test { testSpec trafficSpec } {
          -rfc2889ordering noOrdering \
          -floodedFramesEnabled False \
          -duration $duration \
-         -numtrials $numTrials \
+         -numtrials $numTests \
          -trafficType constantLoading \
          -burstSize 1 \
          -framesPerBurstGap 1 \
          -tolerance 0 \
          -frameLossUnit {0} \
          -staggeredStart False \
-         -framesizeList {64} \
+         -framesizeList $frameSize \
          -frameSizeMode custom \
          -rateSelect percentMaxRate \
          -percentMaxRate 100 \
@@ -7976,7 +7992,7 @@ proc startRfc2544Test { testSpec trafficSpec } {
          -customLoadUnit percentMaxRate \
          -randomLoadUnit percentMaxRate \
          -incrementLoadUnit percentMaxRate \
-         -binaryResolution 100 \
+         -binaryResolution 1000 \
          -binaryBackoff 50 \
          -binaryTolerance $tolerance \
          -initialIncrementLoadRate 100 \
@@ -7987,7 +8003,7 @@ proc startRfc2544Test { testSpec trafficSpec } {
          -countRandomLoadRate 1 \
          -numFrames {100000} \
          -loadRate 100 \
-         -enableMinFrameSize False \
+         -enableMinFrameSize True \
          -gap 3 \
          -generateTrackingOptionAggregationFiles False \
          -sendFullyMeshed False \
@@ -7997,7 +8013,7 @@ proc startRfc2544Test { testSpec trafficSpec } {
          -imixData {{{{64}{{TOS S:0 S:0 S:0 S:0 S:0} S:0}{1 40}}{{128}{{TOS S:0 S:0 S:0 S:0 S:0} S:0}{1 30}}{{256}{{TOS S:0 S:0 S:0 S:0 S:0} S:0}{1 30}}}} \
          -imixEnabled False \
          -imixTemplates none \
-         -framesizeImixList {64} \
+         -framesizeImixList $frameSize \
          -imixTrafficType {UNCHNAGED} \
          -ipRatioMode fixed \
          -ipv4RatioList {10,25,50,75,90} \