summaryrefslogtreecommitdiffstats
path: root/scripts/stl
diff options
context:
space:
mode:
authorYaroslav Brustinov <ybrustin@cisco.com>2016-02-25 17:18:41 -0500
committerYaroslav Brustinov <ybrustin@cisco.com>2016-02-25 17:18:41 -0500
commit58b8669c32c7a3f44b329edbf2246b2f0ac6b229 (patch)
treeb3ac19e207805e04fd098ea6aff061fa6df71a88 /scripts/stl
parent032480933eaa065761ac1d5d27b96bced93d5343 (diff)
hltapi: fix MAC given with aabb.ccdd.eeff format, fix add_value is more than half of variable size, add 2 Wentong's profiles
Diffstat (limited to 'scripts/stl')
-rwxr-xr-xscripts/stl/hlt/hlt_david4.py4
-rwxr-xr-xscripts/stl/hlt/hlt_wentong1.py46
-rwxr-xr-xscripts/stl/hlt/hlt_wentong2.py47
3 files changed, 95 insertions, 2 deletions
diff --git a/scripts/stl/hlt/hlt_david4.py b/scripts/stl/hlt/hlt_david4.py
index 1019a15e..10b5e866 100755
--- a/scripts/stl/hlt/hlt_david4.py
+++ b/scripts/stl/hlt/hlt_david4.py
@@ -3,7 +3,7 @@ from trex_stl_lib.trex_stl_hltapi import STLHltStream
class STLS1(object):
'''
- Example number 3 of using HLTAPI from David
+ Example number 4 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
@@ -41,7 +41,7 @@ class STLS1(object):
vlan_id_count = '2 2',
vlan_id_mode = 'increment fixed',
vlan_id_step = '1 1',
- vlan_protocol_tag_ids = '{8100 8100}',
+ #vlan_protocol_tag_id = '{8100 8100}',
direction = direction,
)
diff --git a/scripts/stl/hlt/hlt_wentong1.py b/scripts/stl/hlt/hlt_wentong1.py
new file mode 100755
index 00000000..92af64e0
--- /dev/null
+++ b/scripts/stl/hlt/hlt_wentong1.py
@@ -0,0 +1,46 @@
+from trex_stl_lib.trex_stl_hltapi import STLHltStream
+
+
+class STLS1(object):
+ '''
+ Example number 1 of using HLTAPI from Wentong
+ Creates Eth/802.1Q/IP/UDP stream with VM on src IP
+ '''
+
+ def create_streams (self, direction = 0):
+ ipv4_address_step = '0.0.1.0'
+ num_of_sessions_per_spoke = 1000
+ ip_tgen_hub = '190.1.0.1'
+ pkt_size = 128
+ normaltrafficrate = 0.9
+ vlan_id = 2
+ tgen_dst_mac = '588d.090d.7310'
+
+ return STLHltStream(
+ l3_protocol = 'ipv4',
+ l4_protocol = 'udp',
+ transmit_mode = 'continuous',
+ ip_src_addr = '200.10.0.1',
+ ip_src_mode = 'increment',
+ ip_src_step = ipv4_address_step,
+ ip_src_count = num_of_sessions_per_spoke,
+ ip_dst_addr = ip_tgen_hub,
+ ip_dst_mode = 'fixed',
+ frame_size = pkt_size,
+ rate_percent = normaltrafficrate,
+ vlan_id = vlan_id,
+ vlan_id_mode = 'increment',
+ vlan_id_step = 1,
+ mac_src = '0c00.1110.3101',
+ mac_dst = tgen_dst_mac,
+ )
+
+ 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_wentong2.py b/scripts/stl/hlt/hlt_wentong2.py
new file mode 100755
index 00000000..9bcfcb54
--- /dev/null
+++ b/scripts/stl/hlt/hlt_wentong2.py
@@ -0,0 +1,47 @@
+from trex_stl_lib.trex_stl_hltapi import STLHltStream
+
+
+class STLS1(object):
+ '''
+ Example number 2 of using HLTAPI from Wentong
+ Creates Eth/802.1Q/IPv6/UDP stream without VM (if num_of_sessions_per_spoke is 1)
+ '''
+
+ def create_streams (self, direction = 0):
+ ipv6_tgen_rtr = '2005:0:1::1'
+ num_of_sessions_per_spoke = 1 # in given example is not passed forward, taking default
+ ipv6_address_step = '0:0:0:1:0:0:0:0'
+ ipv6_tgen_hub = '2005:10:1::1'
+ normaltrafficrate = 0.9
+ vlan_id = 0 # in given example is not passed forward, taking default
+ tgen_dst_mac_rtr = '0026.cb0c.6040'
+
+ return STLHltStream(
+ l3_protocol = 'ipv6',
+ l4_protocol = 'udp',
+ ipv6_next_header = 17,
+ l3_length = 200,
+ transmit_mode= 'continuous',
+ ipv6_src_addr = ipv6_tgen_rtr,
+ ipv6_src_mode = 'increment',
+ ipv6_src_count = num_of_sessions_per_spoke,
+ ipv6_dst_step = ipv6_address_step,
+ ipv6_dst_addr = ipv6_tgen_hub,
+ ipv6_dst_mode = 'fixed',
+ rate_percent = normaltrafficrate,
+ vlan_id = vlan_id,
+ vlan_id_mode = 'increment',
+ vlan_id_step = 1,
+ mac_src = '0c00.1110.3101',
+ mac_dst = tgen_dst_mac_rtr,
+ )
+
+ def get_streams (self, direction = 0):
+ return self.create_streams(direction)
+
+# dynamic load used for trex console or simulator
+def register():
+ return STLS1()
+
+
+