diff options
author | 2016-02-10 15:19:51 +0200 | |
---|---|---|
committer | 2016-02-10 15:19:51 +0200 | |
commit | f2a86412d7b160619a92d0942e27f608608bf3a6 (patch) | |
tree | b3b143263ec5d8d175812eae80ee3cad6b679c52 /scripts/stl | |
parent | 0c2b005a017a8574a3580e45118069079e9ea7ff (diff) |
burst example
Diffstat (limited to 'scripts/stl')
-rw-r--r-- | scripts/stl/burst_3st_600pkt.py | 51 | ||||
-rw-r--r-- | scripts/stl/udp_1pkt_1mac.pyc | bin | 1531 -> 0 bytes | |||
-rw-r--r-- | scripts/stl/udp_1pkt_1mac_override.pyc | bin | 1776 -> 0 bytes | |||
-rw-r--r-- | scripts/stl/udp_1pkt_mac.pyc | bin | 1525 -> 0 bytes |
4 files changed, 51 insertions, 0 deletions
diff --git a/scripts/stl/burst_3st_600pkt.py b/scripts/stl/burst_3st_600pkt.py new file mode 100644 index 00000000..817b6777 --- /dev/null +++ b/scripts/stl/burst_3st_600pkt.py @@ -0,0 +1,51 @@ +from trex_stl_lib.api import * + +# 1 clients MAC override the LSB of destination +class STLS1(object): + + def __init__ (self): + self.fsize =64; # the size of the packet + + + def create_stream (self): + + # create a base packet and pad it to size + size = self.fsize - 4; # no FCS + base_pkt = Ether()/IP(src="16.0.0.1",dst="48.0.0.1")/UDP(dport=12,sport=1025) + base_pkt1 = Ether()/IP(src="16.0.0.2",dst="48.0.0.1")/UDP(dport=12,sport=1025) + base_pkt2 = Ether()/IP(src="16.0.0.3",dst="48.0.0.1")/UDP(dport=12,sport=1025) + pad = max(0, size - len(base_pkt)) * 'x' + + + return STLProfile( [ STLStream( isg = 10.0, # star in delay + name ='S0', + packet = STLPktBuilder(pkt = base_pkt/pad), + mode = STLTXSingleBurst( pps = 10, total_pkts = 10), + next = 'S1'), # point to next stream + + STLStream( self_start = False, # stream is disabled enable trow S0 + name ='S1', + packet = STLPktBuilder(pkt = base_pkt1/pad), + mode = STLTXSingleBurst( pps = 10, total_pkts = 20), + next = 'S2' ), + + STLStream( self_start = False, # stream is disabled enable trow S0 + name ='S2', + packet = STLPktBuilder(pkt = base_pkt2/pad), + mode = STLTXSingleBurst( pps = 10, total_pkts = 30 ) + ) + ]).get_streams() + + + def get_streams (self, direction = 0): + # create 1 stream + return self.create_stream() + + +# dynamic load - used for trex console or simulator +def register(): + return STLS1() + + + + diff --git a/scripts/stl/udp_1pkt_1mac.pyc b/scripts/stl/udp_1pkt_1mac.pyc Binary files differdeleted file mode 100644 index 9fd5442f..00000000 --- a/scripts/stl/udp_1pkt_1mac.pyc +++ /dev/null diff --git a/scripts/stl/udp_1pkt_1mac_override.pyc b/scripts/stl/udp_1pkt_1mac_override.pyc Binary files differdeleted file mode 100644 index 6656968d..00000000 --- a/scripts/stl/udp_1pkt_1mac_override.pyc +++ /dev/null diff --git a/scripts/stl/udp_1pkt_mac.pyc b/scripts/stl/udp_1pkt_mac.pyc Binary files differdeleted file mode 100644 index 61ae6914..00000000 --- a/scripts/stl/udp_1pkt_mac.pyc +++ /dev/null |