summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYaroslav Brustinov <ybrustin@cisco.com>2016-03-10 10:51:26 +0200
committerYaroslav Brustinov <ybrustin@cisco.com>2016-03-10 10:51:26 +0200
commit7991c5190ce31ae99533938eccad541181d49370 (patch)
treecc34aa2dada10f9a775d1d88f87ddeca52253af7
parent240dbb67fa16d8d55c64d7658d284e07ae59cdaf (diff)
stl map: send initial streams to calm down switches, send x3 traffic to filter noises
-rw-r--r--scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_std.py19
1 files changed, 14 insertions, 5 deletions
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_std.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_std.py
index c4cb5d01..d582b499 100644
--- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_std.py
+++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_std.py
@@ -13,21 +13,30 @@ def stl_map_ports (client, ports = None):
# generate streams
base_pkt = CScapyTRexPktBuilder(pkt = Ether()/IP())
-
+
+ # send something initial to calm down switches with arps etc.
+ stream = STLStream(packet = base_pkt,
+ mode = STLTXSingleBurst(pps = 100000, total_pkts = 1))
+ client.add_streams(stream, ports)
+
+ client.start(ports, mult = "50%")
+ client.wait_on_traffic(ports)
+ client.reset(ports)
+
tx_pkts = {}
pkts = 1
for port in ports:
tx_pkts[pkts] = port
stream = STLStream(packet = base_pkt,
- mode = STLTXSingleBurst(pps = 100000, total_pkts = pkts))
+ mode = STLTXSingleBurst(pps = 100000, total_pkts = pkts * 3))
client.add_streams(stream, [port])
- pkts = pkts * 2
+ pkts *= 2
# inject
client.clear_stats()
- client.start(ports, mult = "1mpps")
+ client.start(ports, mult = "50%")
client.wait_on_traffic(ports)
stats = client.get_stats()
@@ -40,7 +49,7 @@ def stl_map_ports (client, ports = None):
# actual mapping
for port in ports:
- ipackets = stats[port]["ipackets"]
+ ipackets = int(round(stats[port]["ipackets"] / 3.0)) # majority out of 3 to clean random noises
table['map'][port] = None
for pkts in tx_pkts.keys():