summaryrefslogtreecommitdiffstats
path: root/scripts/stl/hlt
diff options
context:
space:
mode:
authorYaroslav Brustinov <ybrustin@cisco.com>2016-02-24 14:07:11 -0500
committerYaroslav Brustinov <ybrustin@cisco.com>2016-02-24 14:07:11 -0500
commit42afa885616f4def18f5f1f1ca303efdf742356f (patch)
tree187412cbca140ee5763172330e88b386705b3454 /scripts/stl/hlt
parent547112ad112a2c3f8792a41e3f41b9d257a2fa7a (diff)
hltapi : add dst_mac vm; vlan mask variable now can be shared; add 2 more profiles; add consistent_random argument for same random sequence each time
Diffstat (limited to 'scripts/stl/hlt')
-rwxr-xr-xscripts/stl/hlt/hlt_david1.py4
-rwxr-xr-xscripts/stl/hlt/hlt_david2.py4
-rwxr-xr-xscripts/stl/hlt/hlt_david3.py4
-rwxr-xr-xscripts/stl/hlt/hlt_david4.py11
-rwxr-xr-xscripts/stl/hlt/hlt_imix_4rates.py4
-rwxr-xr-xscripts/stl/hlt/hlt_tcp_ranges.py3
-rwxr-xr-xscripts/stl/hlt/hlt_udp_inc_dec_len_9k.py10
-rwxr-xr-xscripts/stl/hlt/hlt_udp_ports.py33
-rwxr-xr-xscripts/stl/hlt/hlt_udp_random_ports.py28
9 files changed, 97 insertions, 4 deletions
diff --git a/scripts/stl/hlt/hlt_david1.py b/scripts/stl/hlt/hlt_david1.py
index 922bb632..73d258e3 100755
--- a/scripts/stl/hlt/hlt_david1.py
+++ b/scripts/stl/hlt/hlt_david1.py
@@ -2,6 +2,10 @@ from trex_stl_lib.trex_stl_hltapi import STLHltStream
class STLS1(object):
+ '''
+ Example number 1 of using HLTAPI from David
+ Creates 3 streams (imix) Eth/802.1Q/IP/TCP without VM
+ '''
def create_streams (self, direction = 0):
return STLHltStream(
diff --git a/scripts/stl/hlt/hlt_david2.py b/scripts/stl/hlt/hlt_david2.py
index be21c93d..d3e669a1 100755
--- a/scripts/stl/hlt/hlt_david2.py
+++ b/scripts/stl/hlt/hlt_david2.py
@@ -2,6 +2,10 @@ from trex_stl_lib.trex_stl_hltapi import STLHltStream
class STLS1(object):
+ '''
+ Example number 2 of using HLTAPI from David
+ Creates 3 streams (imix) Eth/802.1Q/IP/TCP without VM
+ '''
def create_streams (self, direction = 0):
return STLHltStream(
diff --git a/scripts/stl/hlt/hlt_david3.py b/scripts/stl/hlt/hlt_david3.py
index af41b3d4..21445700 100755
--- a/scripts/stl/hlt/hlt_david3.py
+++ b/scripts/stl/hlt/hlt_david3.py
@@ -2,6 +2,10 @@ from trex_stl_lib.trex_stl_hltapi import STLHltStream
class STLS1(object):
+ '''
+ Example number 3 of using HLTAPI from David
+ Creates Eth/802.1Q/802.1Q/IP/TCP stream
+ '''
def create_streams (self, direction = 0):
return STLHltStream(
diff --git a/scripts/stl/hlt/hlt_david4.py b/scripts/stl/hlt/hlt_david4.py
index 9624c0bb..1019a15e 100755
--- a/scripts/stl/hlt/hlt_david4.py
+++ b/scripts/stl/hlt/hlt_david4.py
@@ -2,6 +2,13 @@ from trex_stl_lib.trex_stl_hltapi import STLHltStream
class STLS1(object):
+ '''
+ Example number 3 of using HLTAPI from David
+ Creates Eth/802.1Q/802.1Q/IP/TCP stream with complex VM:
+ The first vlan_id will be incremented, second const.
+ MAC src, IP src, IP dst will have <mac_src_count> number of incremental values
+ MAC dst will have <mac_dst_count> number of incremental values
+ '''
def create_streams (self, direction = 0):
mac_dst_count = 10
@@ -11,7 +18,7 @@ class STLS1(object):
intf_traffic_src_ip = '16.0.0.1'
return STLHltStream(
- #enable_auto_detect_instrumentation = 1, # not supported
+ #enable_auto_detect_instrumentation = 1, # not supported yet
ip_dst_addr = intf_traffic_dst_ip,
ip_dst_count = mac_src_count,
ip_dst_mode = 'increment',
@@ -22,7 +29,7 @@ class STLS1(object):
ip_src_step = '0.0.1.0',
l3_protocol = 'ipv4',
mac_dst_count = mac_dst_count,
- #mac_dst_mode = 'discovery', # not supported
+ #mac_dst_mode = 'discovery', # not supported yet
mac_dst_mode = 'increment',
mac_dst_step = 1,
mac_src_count = mac_src_count,
diff --git a/scripts/stl/hlt/hlt_imix_4rates.py b/scripts/stl/hlt/hlt_imix_4rates.py
index 653c3876..f6bfdd30 100755
--- a/scripts/stl/hlt/hlt_imix_4rates.py
+++ b/scripts/stl/hlt/hlt_imix_4rates.py
@@ -2,6 +2,10 @@ from trex_stl_lib.trex_stl_hltapi import STLHltStream
class STLS1(object):
+ '''
+ Creating 4 streams Eth/IP/UDP with different size and rate (smallest with highest rate)
+ Each stream will get rate_pps * his ratio / sum of ratios
+ '''
def create_streams (self, direction = 0):
return STLHltStream(length_mode = 'imix', rate_pps = 2,
diff --git a/scripts/stl/hlt/hlt_tcp_ranges.py b/scripts/stl/hlt/hlt_tcp_ranges.py
index b720e1e2..28e66855 100755
--- a/scripts/stl/hlt/hlt_tcp_ranges.py
+++ b/scripts/stl/hlt/hlt_tcp_ranges.py
@@ -2,6 +2,9 @@ from trex_stl_lib.trex_stl_hltapi import STLHltStream
class STLS1(object):
+ '''
+ Eth/IP/TCP stream with VM to get 10 different TCP ports
+ '''
def create_streams (self, direction = 0):
return [STLHltStream(tcp_src_port_mode = 'decrement',
diff --git a/scripts/stl/hlt/hlt_udp_inc_dec_len_9k.py b/scripts/stl/hlt/hlt_udp_inc_dec_len_9k.py
index e8766da4..b3fec989 100755
--- a/scripts/stl/hlt/hlt_udp_inc_dec_len_9k.py
+++ b/scripts/stl/hlt/hlt_udp_inc_dec_len_9k.py
@@ -2,10 +2,16 @@ from trex_stl_lib.trex_stl_hltapi import STLHltStream
class STLS1(object):
+ '''
+ Create 2 Eth/IP/UDP steams with different packet size:
+ First stream will start from 64 bytes (default) and will increase until max_size (9,216)
+ Seconds stream will decrease the packet size in reverse way
+ '''
def create_streams (self):
+ max_size = 9*1024
return [STLHltStream(length_mode = 'increment',
- frame_size_max = 9*1024,
+ frame_size_max = max_size,
ip_src_addr = '16.0.0.1',
ip_dst_addr = '48.0.0.1',
l4_protocol = 'udp',
@@ -14,7 +20,7 @@ class STLS1(object):
rate_pps = 1,
),
STLHltStream(length_mode = 'decrement',
- frame_size_max = 9*1024,
+ frame_size_max = max_size,
ip_src_addr = '16.0.0.1',
ip_dst_addr = '48.0.0.1',
l4_protocol = 'udp',
diff --git a/scripts/stl/hlt/hlt_udp_ports.py b/scripts/stl/hlt/hlt_udp_ports.py
new file mode 100755
index 00000000..20862141
--- /dev/null
+++ b/scripts/stl/hlt/hlt_udp_ports.py
@@ -0,0 +1,33 @@
+from trex_stl_lib.trex_stl_hltapi import STLHltStream
+
+
+class STLS1(object):
+ '''
+ Eth/IP/UDP stream with VM for different UDP ports inc/dec
+ The ports overlap the max and min at very first packets
+ '''
+
+ def create_streams (self, direction = 0):
+ return [STLHltStream(l4_protocol = 'udp',
+ udp_src_port_mode = 'decrement',
+ udp_src_port_count = 45,
+ udp_src_port_step = 20,
+ udp_src_port = 123,
+ udp_dst_port_mode = 'increment',
+ udp_dst_port_count = 100,
+ udp_dst_port_step = 300,
+ udp_dst_port = 65000,
+ direction = direction,
+ rate_pps = 1000,
+ ),
+ ]
+
+ def get_streams (self, direction = 0):
+ return self.create_streams(direction)
+
+# dynamic load - used for trex console or simulator
+def register():
+ return STLS1()
+
+
+
diff --git a/scripts/stl/hlt/hlt_udp_random_ports.py b/scripts/stl/hlt/hlt_udp_random_ports.py
new file mode 100755
index 00000000..0f60958d
--- /dev/null
+++ b/scripts/stl/hlt/hlt_udp_random_ports.py
@@ -0,0 +1,28 @@
+from trex_stl_lib.trex_stl_hltapi import STLHltStream
+
+
+class STLS1(object):
+ '''
+ Eth/IP/UDP stream with VM for random UDP ports inc/dec.
+ Using "consistent_random = True" to have same random ports each test
+ '''
+
+ def create_streams (self, direction = 0):
+ return [STLHltStream(l4_protocol = 'udp',
+ udp_src_port_mode = 'random',
+ udp_dst_port_mode = 'random',
+ direction = direction,
+ rate_pps = 1000,
+ consistent_random = True,
+ ),
+ ]
+
+ def get_streams (self, direction = 0):
+ return self.create_streams(direction)
+
+# dynamic load - used for trex console or simulator
+def register():
+ return STLS1()
+
+
+