From e4d12836515765a6f7c6a2f67dbacbdef2975024 Mon Sep 17 00:00:00 2001 From: Matus Fabian Date: Wed, 27 Sep 2017 04:44:08 -0700 Subject: NAT: Add performance testing TRex scripts and config (VPP-832) Change-Id: I149a20f183b836db4c32fb4e4a8438b3a14c1c26 Signed-off-by: Matus Fabian --- src/plugins/nat/extras/nat_out2in_1Ms.py | 35 ++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/plugins/nat/extras/nat_out2in_1Ms.py (limited to 'src/plugins/nat/extras/nat_out2in_1Ms.py') diff --git a/src/plugins/nat/extras/nat_out2in_1Ms.py b/src/plugins/nat/extras/nat_out2in_1Ms.py new file mode 100644 index 00000000000..54ca5d5bd11 --- /dev/null +++ b/src/plugins/nat/extras/nat_out2in_1Ms.py @@ -0,0 +1,35 @@ +from trex_stl_lib.api import * + +class STLS1(object): + + def create_stream (self): + base_pkt = Ether()/IP(src="2.2.0.1")/UDP(sport=12) + + pad = Padding() + if len(base_pkt) < 64: + pad_len = 64 - len(base_pkt) + pad.load = '\x00' * pad_len + + vm = STLVM() + + vm.tuple_var(name="tuple", ip_min="173.16.1.3", ip_max="173.16.40.18", port_min=1025, port_max=1124, limit_flows = 1000000) + + vm.write(fv_name="tuple.ip", pkt_offset="IP.dst") + vm.fix_chksum() + + vm.write(fv_name="tuple.port", pkt_offset="UDP.dport") + + pkt = STLPktBuilder(pkt=base_pkt/pad, vm=vm) + + return STLStream(packet=pkt, mode=STLTXCont()) + + def get_streams (self, direction = 0, **kwargs): + return [self.create_stream()] + + +# dynamic load - used for trex console or simulator +def register(): + return STLS1() + + + -- cgit 1.2.3-korg