From ee91690697d026c168de223f0b6b61c2e59e76ad Mon Sep 17 00:00:00 2001 From: Yaroslav Brustinov Date: Tue, 23 Feb 2016 08:34:35 -0500 Subject: hltapi: optimization to utilize similar variables for several fields, fix incorrect size from l3_length, add profiles --- scripts/stl/hlt/hlt_david1.py | 43 +++++++++++++++++++++++++++++++++ scripts/stl/hlt/hlt_david2.py | 42 ++++++++++++++++++++++++++++++++ scripts/stl/hlt/hlt_david3.py | 47 ++++++++++++++++++++++++++++++++++++ scripts/stl/hlt/hlt_david4.py | 49 ++++++++++++++++++++++++++++++++++++++ scripts/stl/hlt/hlt_imix_4rates.py | 23 ++++++++++++++++++ scripts/stl/hlt/hlt_tcp_ranges.py | 26 ++++++++++++++++++++ 6 files changed, 230 insertions(+) create mode 100755 scripts/stl/hlt/hlt_david1.py create mode 100755 scripts/stl/hlt/hlt_david2.py create mode 100755 scripts/stl/hlt/hlt_david3.py create mode 100755 scripts/stl/hlt/hlt_david4.py create mode 100755 scripts/stl/hlt/hlt_imix_4rates.py create mode 100755 scripts/stl/hlt/hlt_tcp_ranges.py (limited to 'scripts/stl') diff --git a/scripts/stl/hlt/hlt_david1.py b/scripts/stl/hlt/hlt_david1.py new file mode 100755 index 00000000..879ea527 --- /dev/null +++ b/scripts/stl/hlt/hlt_david1.py @@ -0,0 +1,43 @@ +from trex_stl_lib.trex_stl_hltapi import STLHltStream + + +class STLS1(object): + + def create_streams (self, direction = 0): + return STLHltStream( + #enable_auto_detect_instrumentation = '1', # not supported yet + ip_dst_addr = '192.168.1.3', + ip_dst_count = '1', + ip_dst_mode = 'increment', + ip_dst_step = '0.0.0.1', + ip_src_addr = '192.168.0.3', + ip_src_count = '1', + ip_src_mode = 'increment', + ip_src_step = '0.0.0.1', + l3_imix1_ratio = 7, + l3_imix1_size = 70, + l3_imix2_ratio = 4, + l3_imix2_size = 570, + l3_imix3_ratio = 1, + l3_imix3_size = 1518, + l3_protocol = 'ipv4', + length_mode = 'imix', + #mac_dst_mode = 'discovery', # not supported yet + mac_src = '00.00.c0.a8.00.03', + mac_src2 = '00.00.c0.a8.01.03', + pkts_per_burst = '200000', + #rate_percent = '0.4', # not supported yet + transmit_mode = 'continuous', + vlan_id = '1', + direction = direction, + ) + + 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_david2.py b/scripts/stl/hlt/hlt_david2.py new file mode 100755 index 00000000..be21c93d --- /dev/null +++ b/scripts/stl/hlt/hlt_david2.py @@ -0,0 +1,42 @@ +from trex_stl_lib.trex_stl_hltapi import STLHltStream + + +class STLS1(object): + + def create_streams (self, direction = 0): + return STLHltStream( + #enable_auto_detect_instrumentation = '1', # not supported yet + ip_dst_addr = '192.168.3.3', + ip_dst_count = '1', + ip_dst_mode = 'increment', + ip_dst_step = '0.0.0.1', + ip_src_addr = '192.168.2.3', + ip_src_count = '1', + ip_src_step = '0.0.0.1', + l3_imix1_ratio = 7, + l3_imix1_size = 68, + l3_imix2_ratio = 4, + l3_imix2_size = 570, + l3_imix3_ratio = 1, + l3_imix3_size = 1518, + l3_protocol = 'ipv4', + length_mode = 'imix', + #mac_dst_mode = 'discovery', # not supported yet + mac_src = '00.00.c0.a8.02.03', + mac_src2 = '00.00.c0.a8.03.03', + pkts_per_burst = '200000', + rate_percent = '0.75', + transmit_mode = 'continuous', + vlan_id = '2', + direction = direction, + ) + + 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_david3.py b/scripts/stl/hlt/hlt_david3.py new file mode 100755 index 00000000..01bf2431 --- /dev/null +++ b/scripts/stl/hlt/hlt_david3.py @@ -0,0 +1,47 @@ +from trex_stl_lib.trex_stl_hltapi import STLHltStream + + +class STLS1(object): + + def create_streams (self, direction = 0): + return STLHltStream( + l3_protocol = 'ipv4', + ip_src_addr = '100.1.1.1', + ip_src_mode = 'fixed', + ip_src_count = 1, + ip_src_step = '0.0.0.1', + ip_dst_addr = '200.1.1.1', + ip_dst_mode = 'fixed', + ip_dst_step = '0.1.0.0', + ip_dst_count = 1, + l3_length = 474, + ip_dscp = 10, + #rate_bps = 256000000, # not supported yet + mac_src_mode = 'fixed', + mac_src_step = 1, + mac_src_count = 1, + #mac_dst_mode = discovery # not supported yet, + mac_dst_step = 1, + mac_dst_count = 1, + #mac_src = [ip_to_mac 200.1.1.1] # not supported yet, + #mac_src2 = [ip_to_mac = 100.1.1.1] # not supported yet, + #mac_dst = [ip_to_mac 100.1.1.1] # not supported yet, + #mac_dst2 = [ip_to_mac = 200.1.1.1] # not supported yet, + vlan_id_mode = 'fixed fixed', + vlan_id = '200 100', + vlan_id_count = '1 1', + vlan_id_step = '1 1', + vlan_user_priority = '3 0', + vlan_cfi = '1 1', + direction = direction, + ) + + 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_david4.py b/scripts/stl/hlt/hlt_david4.py new file mode 100755 index 00000000..9624c0bb --- /dev/null +++ b/scripts/stl/hlt/hlt_david4.py @@ -0,0 +1,49 @@ +from trex_stl_lib.trex_stl_hltapi import STLHltStream + + +class STLS1(object): + + def create_streams (self, direction = 0): + mac_dst_count = 10 + mac_src_count = 10 + pkts_per_burst = 10 + intf_traffic_dst_ip = '48.0.0.1' + intf_traffic_src_ip = '16.0.0.1' + + return STLHltStream( + #enable_auto_detect_instrumentation = 1, # not supported + ip_dst_addr = intf_traffic_dst_ip, + ip_dst_count = mac_src_count, + ip_dst_mode = 'increment', + ip_dst_step = '0.0.1.0', + ip_src_addr = intf_traffic_src_ip, + ip_src_count = mac_src_count, + ip_src_mode = 'increment', + 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 = 'increment', + mac_dst_step = 1, + mac_src_count = mac_src_count, + mac_src_mode = 'increment', + mac_src_step = 1, + pkts_per_burst = pkts_per_burst, + transmit_mode = 'continuous', + vlan_id = '50 50', + vlan_id_count = '2 2', + vlan_id_mode = 'increment fixed', + vlan_id_step = '1 1', + vlan_protocol_tag_ids = '{8100 8100}', + direction = direction, + ) + + 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_imix_4rates.py b/scripts/stl/hlt/hlt_imix_4rates.py new file mode 100755 index 00000000..653c3876 --- /dev/null +++ b/scripts/stl/hlt/hlt_imix_4rates.py @@ -0,0 +1,23 @@ +from trex_stl_lib.trex_stl_hltapi import STLHltStream + + +class STLS1(object): + + def create_streams (self, direction = 0): + return STLHltStream(length_mode = 'imix', rate_pps = 2, + l3_imix1_size = 60, l3_imix1_ratio = 4, + l3_imix2_size = 400, l3_imix2_ratio = 3, + l3_imix3_size = 2000, l3_imix3_ratio = 2, + l3_imix4_size = 8000, l3_imix4_ratio = 1, + l4_protocol = 'udp', direction = direction, + ) + + 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_tcp_ranges.py b/scripts/stl/hlt/hlt_tcp_ranges.py new file mode 100755 index 00000000..31edc61a --- /dev/null +++ b/scripts/stl/hlt/hlt_tcp_ranges.py @@ -0,0 +1,26 @@ +from trex_stl_lib.trex_stl_hltapi import STLHltStream + + +class STLS1(object): + + def create_streams (self, direction = 0): + return [STLHltStream(tcp_src_port_mode = 'decrement', + tcp_src_port_count = 10, + tcp_src_port = 1234, + tcp_dst_port_mode = 'increment', + tcp_dst_port_count = 10, + tcp_dst_port = 1234, + name = 'test_tcp_ranges', + direction = direction, + ), + ] + + def get_streams (self, direction = 0): + return self.create_streams(direction) + +# dynamic load - used for trex console or simulator +def register(): + return STLS1() + + + -- cgit 1.2.3-korg