From db64c7fb198996d985e8c8ecfa797fc31d0a62f5 Mon Sep 17 00:00:00 2001 From: Vratko Polak Date: Wed, 13 Jan 2021 19:38:50 +0100 Subject: Random flows: Use seeds again and increase limit. TRex does mix seeds when distributing over workers, but it is multiplicative [0], so zero is the only bad value. Limit restricts the cycle length of PRNG (by resetting [1] the seed). We want the cycle as long as possible. [0] https://github.com/cisco-system-traffic-generator/trex-core/blob/v2.73/src/stx/stl/trex_stl_stream_vm.h#L1616 [1] https://github.com/cisco-system-traffic-generator/trex-core/blob/v2.73/src/stx/stl/trex_stl_stream_vm.h#L313-L314 Change-Id: I33a29496f0853ef60d592c988f81a9d1109b5878 Signed-off-by: Vratko Polak (cherry picked from commit eedb7dff222d2590ac2cb5a5e67dc7d90317f05c) --- .../trex/trex-stl-ethip4-ip4dst-rnd10000.py | 35 ++++++++++++---------- .../trex/trex-stl-ethip4-ip4dst-rnd100000.py | 32 ++++++++++---------- .../trex/trex-stl-ethip4-ip4dst-rnd1000000.py | 32 ++++++++++---------- 3 files changed, 54 insertions(+), 45 deletions(-) diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst-rnd10000.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst-rnd10000.py index 3ecf1a47d8..ef2dcde696 100644 --- a/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst-rnd10000.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst-rnd10000.py @@ -42,7 +42,7 @@ class TrafficStreams(TrafficStreamsBaseClass): """Stream profile.""" def __init__(self): - """Initialization and setting of streams" parameters.""" + """Initialization and setting of streams' parameters.""" super(TrafficStreamsBaseClass, self).__init__() @@ -66,21 +66,21 @@ class TrafficStreams(TrafficStreamsBaseClass): # Direction 0 --> 1 base_pkt_a = ( - Ether() / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) + Ether() / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) ) # Direction 1 --> 0 base_pkt_b = ( - Ether() / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) + Ether() / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) ) # Direction 0 --> 1 @@ -91,7 +91,9 @@ class TrafficStreams(TrafficStreamsBaseClass): min_value=self.p1_dst_start_ip, max_value=self.p1_dst_end_ip, size=4, - limit=10000 + seed=1, + # Cycle length. TRex does not allow any higher value. + limit=(2**24 - 1) ), STLVmWrFlowVar( fv_name=u"dst", @@ -111,7 +113,10 @@ class TrafficStreams(TrafficStreamsBaseClass): min_value=self.p2_dst_start_ip, max_value=self.p2_dst_end_ip, size=4, - limit=10000 + # Using a different seed to be extra sure + # nothing useful gets cached. + seed=2, + limit=(2**24 - 1) ), STLVmWrFlowVar( fv_name=u"dst", diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst-rnd100000.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst-rnd100000.py index bfd6099aa5..ff9077192f 100644 --- a/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst-rnd100000.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst-rnd100000.py @@ -42,7 +42,7 @@ class TrafficStreams(TrafficStreamsBaseClass): """Stream profile.""" def __init__(self): - """Initialization and setting of streams" parameters.""" + """Initialization and setting of streams' parameters.""" super(TrafficStreamsBaseClass, self).__init__() @@ -66,21 +66,21 @@ class TrafficStreams(TrafficStreamsBaseClass): # Direction 0 --> 1 base_pkt_a = ( - Ether() / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) + Ether() / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) ) # Direction 1 --> 0 base_pkt_b = ( - Ether() / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) + Ether() / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) ) # Direction 0 --> 1 @@ -91,7 +91,8 @@ class TrafficStreams(TrafficStreamsBaseClass): min_value=self.p1_dst_start_ip, max_value=self.p1_dst_end_ip, size=4, - limit=100000 + seed=1, + limit=(2**24 - 1) ), STLVmWrFlowVar( fv_name=u"dst", @@ -110,7 +111,8 @@ class TrafficStreams(TrafficStreamsBaseClass): min_value=self.p2_dst_start_ip, max_value=self.p2_dst_end_ip, size=4, - limit=100000 + seed=2, + limit=(2**24 - 1) ), STLVmWrFlowVar( fv_name=u"dst", diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst-rnd1000000.py b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst-rnd1000000.py index 98d0c17ed7..4a315c72ed 100644 --- a/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst-rnd1000000.py +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4-ip4dst-rnd1000000.py @@ -42,7 +42,7 @@ class TrafficStreams(TrafficStreamsBaseClass): """Stream profile.""" def __init__(self): - """Initialization and setting of streams" parameters.""" + """Initialization and setting of streams' parameters.""" super(TrafficStreamsBaseClass, self).__init__() @@ -66,21 +66,21 @@ class TrafficStreams(TrafficStreamsBaseClass): # Direction 0 --> 1 base_pkt_a = ( - Ether() / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) + Ether() / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) ) # Direction 1 --> 0 base_pkt_b = ( - Ether() / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) + Ether() / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) ) # Direction 0 --> 1 @@ -91,7 +91,8 @@ class TrafficStreams(TrafficStreamsBaseClass): min_value=self.p1_dst_start_ip, max_value=self.p1_dst_end_ip, size=4, - limit=1000000 + seed=1, + limit=(2**24 - 1) ), STLVmWrFlowVar( fv_name=u"dst", @@ -110,7 +111,8 @@ class TrafficStreams(TrafficStreamsBaseClass): min_value=self.p2_dst_start_ip, max_value=self.p2_dst_end_ip, size=4, - limit=1000000 + seed=2, + limit=(2**24 - 1) ), STLVmWrFlowVar( fv_name=u"dst", -- cgit 1.2.3-korg