From 8c063c40140e7d63f2d2fe2eb95cb90ca42cae60 Mon Sep 17 00:00:00 2001 From: Jan Gelety Date: Sat, 8 Aug 2020 07:04:20 +0200 Subject: Framework: use 'stl' in trex stateless profile names Change-Id: I74641cc89d2f25d50b67d51bf2567082b420aabb Signed-off-by: Jan Gelety --- .../trex/trex-sl-2n-dot1qip4asym-ip4src254.py | 133 ---------- .../trex/trex-sl-2n-dot1qip6asym-ip6src253.py | 134 ---------- .../trex/trex-sl-2n-ethip4-ip4dst-rnd10000.py | 127 --------- .../trex/trex-sl-2n-ethip4-ip4dst-rnd100000.py | 126 --------- .../trex/trex-sl-2n-ethip4-ip4dst-rnd1000000.py | 126 --------- .../trex/trex-sl-2n-ethip4-ip4dst10000.py | 125 --------- .../trex/trex-sl-2n-ethip4-ip4dst100000.py | 126 --------- .../trex/trex-sl-2n-ethip4-ip4dst1000000.py | 126 --------- .../trex/trex-sl-2n-ethip4-ip4src253.py | 126 --------- .../trex/trex-sl-2n-ethip4-ip4src254.py | 126 --------- .../trex/trex-sl-2n-ethip4-macsrc500kdst500k.py | 215 --------------- .../trex/trex-sl-2n-ethip4-macsrc50kdst50k.py | 214 --------------- .../trex/trex-sl-2n-ethip4-macsrc5kdst5k.py | 215 --------------- .../trex/trex-sl-2n-ethip4udp-1000u15p.py | 146 ----------- .../trex/trex-sl-2n-ethip4udp-10u1000p-conc.py | 189 -------------- .../trex/trex-sl-2n-ethip4udp-1u1p.py | 104 -------- .../trex/trex-sl-2n-ethip4udp-lb.py | 150 ----------- .../trex/trex-sl-2n-ethip6-ip6dst10000.py | 129 --------- .../trex/trex-sl-2n-ethip6-ip6dst100000.py | 129 --------- .../trex/trex-sl-2n-ethip6-ip6dst1000000.py | 129 --------- .../trex/trex-sl-2n-ethip6-ip6src253.py | 129 --------- .../trex/trex-sl-2n3n-ethip4-ip4src254-10c1n.py | 163 ------------ .../trex/trex-sl-2n3n-ethip4-ip4src254-10c2n.py | 164 ------------ .../trex/trex-sl-2n3n-ethip4-ip4src254-1c10n.py | 164 ------------ .../trex/trex-sl-2n3n-ethip4-ip4src254-1c1n.py | 166 ------------ .../trex/trex-sl-2n3n-ethip4-ip4src254-1c2n.py | 164 ------------ .../trex/trex-sl-2n3n-ethip4-ip4src254-1c4n.py | 164 ------------ .../trex/trex-sl-2n3n-ethip4-ip4src254-1c6n.py | 164 ------------ .../trex/trex-sl-2n3n-ethip4-ip4src254-1c8n.py | 164 ------------ .../trex/trex-sl-2n3n-ethip4-ip4src254-2c10n.py | 164 ------------ .../trex/trex-sl-2n3n-ethip4-ip4src254-2c1n.py | 164 ------------ .../trex/trex-sl-2n3n-ethip4-ip4src254-2c2n.py | 164 ------------ .../trex/trex-sl-2n3n-ethip4-ip4src254-2c4n.py | 164 ------------ .../trex/trex-sl-2n3n-ethip4-ip4src254-2c6n.py | 164 ------------ .../trex/trex-sl-2n3n-ethip4-ip4src254-2c8n.py | 164 ------------ .../trex/trex-sl-2n3n-ethip4-ip4src254-4c1n.py | 164 ------------ .../trex/trex-sl-2n3n-ethip4-ip4src254-4c2n.py | 162 ------------ .../trex/trex-sl-2n3n-ethip4-ip4src254-4c4n.py | 164 ------------ .../trex/trex-sl-2n3n-ethip4-ip4src254-4c6n.py | 164 ------------ .../trex/trex-sl-2n3n-ethip4-ip4src254-6c1n.py | 164 ------------ .../trex/trex-sl-2n3n-ethip4-ip4src254-6c2n.py | 164 ------------ .../trex/trex-sl-2n3n-ethip4-ip4src254-6c4n.py | 164 ------------ .../trex/trex-sl-2n3n-ethip4-ip4src254-8c1n.py | 164 ------------ .../trex/trex-sl-2n3n-ethip4-ip4src254-8c2n.py | 164 ------------ ...rex-sl-3n-dot1qip4-vlan100ip4src254ip4dst254.py | 191 -------------- ...trex-sl-3n-dot1qip4-vlan10ip4src254ip4dst254.py | 191 -------------- .../trex-sl-3n-dot1qip4-vlan1ip4src254ip4dst254.py | 166 ------------ ...trex-sl-3n-dot1qip4-vlan1kip4src254ip4dst254.py | 191 -------------- .../trex/trex-sl-3n-ethip4-ip4dst1.py | 85 ------ .../trex/trex-sl-3n-ethip4-ip4dst100.py | 126 --------- .../trex/trex-sl-3n-ethip4-ip4dst1000-1cnf.py | 157 ----------- .../trex/trex-sl-3n-ethip4-ip4dst1000-2cnf.py | 156 ----------- .../trex/trex-sl-3n-ethip4-ip4dst1000-4cnf.py | 157 ----------- .../trex/trex-sl-3n-ethip4-ip4dst1000-8cnf.py | 157 ----------- .../trex/trex-sl-3n-ethip4-ip4dst1000.py | 126 --------- .../trex/trex-sl-3n-ethip4-ip4dst10000-1cnf.py | 157 ----------- .../trex/trex-sl-3n-ethip4-ip4dst10000-2cnf.py | 157 ----------- .../trex/trex-sl-3n-ethip4-ip4dst10000-4cnf.py | 157 ----------- .../trex/trex-sl-3n-ethip4-ip4dst10000-8cnf.py | 157 ----------- .../trex/trex-sl-3n-ethip4-ip4dst10000.py | 126 --------- .../trex/trex-sl-3n-ethip4-ip4dst100000.py | 126 --------- .../trex/trex-sl-3n-ethip4-ip4dst1000000.py | 126 --------- .../trex/trex-sl-3n-ethip4-ip4dst20000-1cnf.py | 157 ----------- .../trex/trex-sl-3n-ethip4-ip4dst20000-2cnf.py | 157 ----------- .../trex/trex-sl-3n-ethip4-ip4dst20000-4cnf.py | 157 ----------- .../trex/trex-sl-3n-ethip4-ip4dst20000-8cnf.py | 157 ----------- .../trex/trex-sl-3n-ethip4-ip4dst20000.py | 126 --------- .../trex/trex-sl-3n-ethip4-ip4dst253.py | 126 --------- .../trex/trex-sl-3n-ethip4-ip4dst253_l3fwd.py | 126 --------- .../trex/trex-sl-3n-ethip4-ip4dst4-1cnf.py | 157 ----------- .../trex/trex-sl-3n-ethip4-ip4dst4-2cnf.py | 157 ----------- .../trex/trex-sl-3n-ethip4-ip4dst4-4cnf.py | 157 ----------- .../trex/trex-sl-3n-ethip4-ip4dst4.py | 126 --------- .../trex/trex-sl-3n-ethip4-ip4dst40-1cnf.py | 157 ----------- .../trex/trex-sl-3n-ethip4-ip4dst40-2cnf.py | 157 ----------- .../trex/trex-sl-3n-ethip4-ip4dst40-4cnf.py | 157 ----------- .../trex/trex-sl-3n-ethip4-ip4dst40-8cnf.py | 157 ----------- .../trex/trex-sl-3n-ethip4-ip4dst40.py | 126 --------- .../trex/trex-sl-3n-ethip4-ip4dst400-1cnf.py | 157 ----------- .../trex/trex-sl-3n-ethip4-ip4dst400-2cnf.py | 157 ----------- .../trex/trex-sl-3n-ethip4-ip4dst400-4cnf.py | 157 ----------- .../trex/trex-sl-3n-ethip4-ip4dst400-8cnf.py | 157 ----------- .../trex/trex-sl-3n-ethip4-ip4dst400.py | 126 --------- .../trex/trex-sl-3n-ethip4-ip4dst40000-1cnf.py | 157 ----------- .../trex/trex-sl-3n-ethip4-ip4dst40000-2cnf.py | 157 ----------- .../trex/trex-sl-3n-ethip4-ip4dst40000-4cnf.py | 157 ----------- .../trex/trex-sl-3n-ethip4-ip4dst40000-8cnf.py | 157 ----------- .../trex/trex-sl-3n-ethip4-ip4dst40000.py | 126 --------- .../trex/trex-sl-3n-ethip4-ip4dst5000-1cnf.py | 157 ----------- .../trex/trex-sl-3n-ethip4-ip4dst5000-2cnf.py | 157 ----------- .../trex/trex-sl-3n-ethip4-ip4dst5000-4cnf.py | 157 ----------- .../trex/trex-sl-3n-ethip4-ip4dst5000-8cnf.py | 157 ----------- .../trex/trex-sl-3n-ethip4-ip4dst5000.py | 126 --------- .../trex/trex-sl-3n-ethip4-ip4dst60000-1cnf.py | 157 ----------- .../trex/trex-sl-3n-ethip4-ip4dst60000-2cnf.py | 157 ----------- .../trex/trex-sl-3n-ethip4-ip4dst60000-4cnf.py | 157 ----------- .../trex/trex-sl-3n-ethip4-ip4dst60000-8cnf.py | 157 ----------- .../trex/trex-sl-3n-ethip4-ip4dst60000.py | 126 --------- .../trex/trex-sl-3n-ethip4-ip4src253.py | 126 --------- .../trex/trex-sl-3n-ethip4-ip4src254.py | 126 --------- .../trex/trex-sl-3n-ethip4-macsrc100ip4src100.py | 161 ------------ .../trex/trex-sl-3n-ethip4-macsrc100kip4src100k.py | 161 ------------ .../trex/trex-sl-3n-ethip4-macsrc10kip4src10k.py | 161 ------------ .../trex/trex-sl-3n-ethip4-macsrc500kdst500k.py | 215 --------------- .../trex/trex-sl-3n-ethip4-macsrc50kdst50k.py | 215 --------------- .../trex/trex-sl-3n-ethip4-macsrc5kdst5k.py | 215 --------------- .../trex/trex-sl-3n-ethip4udp-1000u15p.py | 148 ----------- .../trex/trex-sl-3n-ethip4udp-100u1000p-conc.py | 189 -------------- .../trex/trex-sl-3n-ethip4udp-100u15p.py | 148 ----------- .../trex/trex-sl-3n-ethip4udp-10u1000p-conc.py | 189 -------------- .../trex/trex-sl-3n-ethip4udp-10u10p-conc.py | 189 -------------- .../trex/trex-sl-3n-ethip4udp-10u15p.py | 148 ----------- .../trex/trex-sl-3n-ethip4udp-1u15p.py | 141 ---------- .../trex/trex-sl-3n-ethip4udp-1u1p.py | 104 -------- .../trex/trex-sl-3n-ethip4udp-2000u15p.py | 148 ----------- .../trex/trex-sl-3n-ethip4udp-4000u15p.py | 148 ----------- .../trex/trex-sl-3n-ethip6-ip6dst10000.py | 129 --------- .../trex/trex-sl-3n-ethip6-ip6dst100000.py | 129 --------- .../trex/trex-sl-3n-ethip6-ip6dst1000000.py | 129 --------- .../trex/trex-sl-3n-ethip6-ip6src253.py | 129 --------- ...trex-sl-dot1qip4-vlan1ip4src254ip4dst254-bvi.py | 170 ------------ .../trex-sl-dot1qip4-vlan1ip4src254ip4dst254.py | 164 ------------ .../trex-sl-dot1qip4vxlan-ip4src10udpsrcrnd.py | 287 -------------------- .../trex/trex-sl-dot1qip4vxlan-ip4src1udpsrcrnd.py | 288 --------------------- .../trex/trex-sl-dot1qip4vxlan-ip4src2udpsrcrnd.py | 288 --------------------- .../trex/trex-sl-dot1qip4vxlan-ip4src4udpsrcrnd.py | 288 --------------------- .../trex/trex-sl-dot1qip4vxlan-ip4src6udpsrcrnd.py | 288 --------------------- .../trex/trex-sl-dot1qip4vxlan-ip4src8udpsrcrnd.py | 288 --------------------- .../trex/trex-sl-ethip4udp-1024u63p.py | 169 ------------ .../trex/trex-sl-ethip4udp-1048576u63p.py | 169 ------------ .../trex/trex-sl-ethip4udp-16384u63p.py | 169 ------------ .../trex/trex-sl-ethip4udp-1u63p.py | 169 ------------ .../trex/trex-sl-ethip4udp-238u63p.py | 169 ------------ .../trex/trex-sl-ethip4udp-262144u63p.py | 169 ------------ .../trex/trex-sl-ethip4udp-4096u63p.py | 169 ------------ .../trex/trex-sl-ethip4udp-65536u63p.py | 169 ------------ .../trex/trex-sl-ethip4vxlan-ip4src1udpsrcrnd.py | 261 ------------------- .../trex/trex-stl-2n-dot1qip4asym-ip4src254.py | 133 ++++++++++ .../trex/trex-stl-2n-dot1qip6asym-ip6src253.py | 134 ++++++++++ .../trex/trex-stl-2n-ethip4-ip4dst-rnd10000.py | 127 +++++++++ .../trex/trex-stl-2n-ethip4-ip4dst-rnd100000.py | 126 +++++++++ .../trex/trex-stl-2n-ethip4-ip4dst-rnd1000000.py | 126 +++++++++ .../trex/trex-stl-2n-ethip4-ip4dst10000.py | 125 +++++++++ .../trex/trex-stl-2n-ethip4-ip4dst100000.py | 126 +++++++++ .../trex/trex-stl-2n-ethip4-ip4dst1000000.py | 126 +++++++++ .../trex/trex-stl-2n-ethip4-ip4src253.py | 126 +++++++++ .../trex/trex-stl-2n-ethip4-ip4src254.py | 126 +++++++++ .../trex/trex-stl-2n-ethip4-macsrc500kdst500k.py | 215 +++++++++++++++ .../trex/trex-stl-2n-ethip4-macsrc50kdst50k.py | 214 +++++++++++++++ .../trex/trex-stl-2n-ethip4-macsrc5kdst5k.py | 215 +++++++++++++++ .../trex/trex-stl-2n-ethip4udp-1000u15p.py | 146 +++++++++++ .../trex/trex-stl-2n-ethip4udp-10u1000p-conc.py | 189 ++++++++++++++ .../trex/trex-stl-2n-ethip4udp-1u1p.py | 104 ++++++++ .../trex/trex-stl-2n-ethip4udp-lb.py | 150 +++++++++++ .../trex/trex-stl-2n-ethip6-ip6dst10000.py | 129 +++++++++ .../trex/trex-stl-2n-ethip6-ip6dst100000.py | 129 +++++++++ .../trex/trex-stl-2n-ethip6-ip6dst1000000.py | 129 +++++++++ .../trex/trex-stl-2n-ethip6-ip6src253.py | 129 +++++++++ .../trex/trex-stl-2n3n-ethip4-ip4src254-10c1n.py | 163 ++++++++++++ .../trex/trex-stl-2n3n-ethip4-ip4src254-10c2n.py | 164 ++++++++++++ .../trex/trex-stl-2n3n-ethip4-ip4src254-1c10n.py | 164 ++++++++++++ .../trex/trex-stl-2n3n-ethip4-ip4src254-1c1n.py | 166 ++++++++++++ .../trex/trex-stl-2n3n-ethip4-ip4src254-1c2n.py | 164 ++++++++++++ .../trex/trex-stl-2n3n-ethip4-ip4src254-1c4n.py | 164 ++++++++++++ .../trex/trex-stl-2n3n-ethip4-ip4src254-1c6n.py | 164 ++++++++++++ .../trex/trex-stl-2n3n-ethip4-ip4src254-1c8n.py | 164 ++++++++++++ .../trex/trex-stl-2n3n-ethip4-ip4src254-2c10n.py | 164 ++++++++++++ .../trex/trex-stl-2n3n-ethip4-ip4src254-2c1n.py | 164 ++++++++++++ .../trex/trex-stl-2n3n-ethip4-ip4src254-2c2n.py | 164 ++++++++++++ .../trex/trex-stl-2n3n-ethip4-ip4src254-2c4n.py | 164 ++++++++++++ .../trex/trex-stl-2n3n-ethip4-ip4src254-2c6n.py | 164 ++++++++++++ .../trex/trex-stl-2n3n-ethip4-ip4src254-2c8n.py | 164 ++++++++++++ .../trex/trex-stl-2n3n-ethip4-ip4src254-4c1n.py | 164 ++++++++++++ .../trex/trex-stl-2n3n-ethip4-ip4src254-4c2n.py | 162 ++++++++++++ .../trex/trex-stl-2n3n-ethip4-ip4src254-4c4n.py | 164 ++++++++++++ .../trex/trex-stl-2n3n-ethip4-ip4src254-4c6n.py | 164 ++++++++++++ .../trex/trex-stl-2n3n-ethip4-ip4src254-6c1n.py | 164 ++++++++++++ .../trex/trex-stl-2n3n-ethip4-ip4src254-6c2n.py | 164 ++++++++++++ .../trex/trex-stl-2n3n-ethip4-ip4src254-6c4n.py | 164 ++++++++++++ .../trex/trex-stl-2n3n-ethip4-ip4src254-8c1n.py | 164 ++++++++++++ .../trex/trex-stl-2n3n-ethip4-ip4src254-8c2n.py | 164 ++++++++++++ ...ex-stl-3n-dot1qip4-vlan100ip4src254ip4dst254.py | 191 ++++++++++++++ ...rex-stl-3n-dot1qip4-vlan10ip4src254ip4dst254.py | 191 ++++++++++++++ ...trex-stl-3n-dot1qip4-vlan1ip4src254ip4dst254.py | 166 ++++++++++++ ...rex-stl-3n-dot1qip4-vlan1kip4src254ip4dst254.py | 191 ++++++++++++++ .../trex/trex-stl-3n-ethip4-ip4dst1.py | 85 ++++++ .../trex/trex-stl-3n-ethip4-ip4dst100.py | 126 +++++++++ .../trex/trex-stl-3n-ethip4-ip4dst1000-1cnf.py | 157 +++++++++++ .../trex/trex-stl-3n-ethip4-ip4dst1000-2cnf.py | 156 +++++++++++ .../trex/trex-stl-3n-ethip4-ip4dst1000-4cnf.py | 157 +++++++++++ .../trex/trex-stl-3n-ethip4-ip4dst1000-8cnf.py | 157 +++++++++++ .../trex/trex-stl-3n-ethip4-ip4dst1000.py | 126 +++++++++ .../trex/trex-stl-3n-ethip4-ip4dst10000-1cnf.py | 157 +++++++++++ .../trex/trex-stl-3n-ethip4-ip4dst10000-2cnf.py | 157 +++++++++++ .../trex/trex-stl-3n-ethip4-ip4dst10000-4cnf.py | 157 +++++++++++ .../trex/trex-stl-3n-ethip4-ip4dst10000-8cnf.py | 157 +++++++++++ .../trex/trex-stl-3n-ethip4-ip4dst10000.py | 126 +++++++++ .../trex/trex-stl-3n-ethip4-ip4dst100000.py | 126 +++++++++ .../trex/trex-stl-3n-ethip4-ip4dst1000000.py | 126 +++++++++ .../trex/trex-stl-3n-ethip4-ip4dst20000-1cnf.py | 157 +++++++++++ .../trex/trex-stl-3n-ethip4-ip4dst20000-2cnf.py | 157 +++++++++++ .../trex/trex-stl-3n-ethip4-ip4dst20000-4cnf.py | 157 +++++++++++ .../trex/trex-stl-3n-ethip4-ip4dst20000-8cnf.py | 157 +++++++++++ .../trex/trex-stl-3n-ethip4-ip4dst20000.py | 126 +++++++++ .../trex/trex-stl-3n-ethip4-ip4dst253.py | 126 +++++++++ .../trex/trex-stl-3n-ethip4-ip4dst253_l3fwd.py | 126 +++++++++ .../trex/trex-stl-3n-ethip4-ip4dst4-1cnf.py | 157 +++++++++++ .../trex/trex-stl-3n-ethip4-ip4dst4-2cnf.py | 157 +++++++++++ .../trex/trex-stl-3n-ethip4-ip4dst4-4cnf.py | 157 +++++++++++ .../trex/trex-stl-3n-ethip4-ip4dst4.py | 126 +++++++++ .../trex/trex-stl-3n-ethip4-ip4dst40-1cnf.py | 157 +++++++++++ .../trex/trex-stl-3n-ethip4-ip4dst40-2cnf.py | 157 +++++++++++ .../trex/trex-stl-3n-ethip4-ip4dst40-4cnf.py | 157 +++++++++++ .../trex/trex-stl-3n-ethip4-ip4dst40-8cnf.py | 157 +++++++++++ .../trex/trex-stl-3n-ethip4-ip4dst40.py | 126 +++++++++ .../trex/trex-stl-3n-ethip4-ip4dst400-1cnf.py | 157 +++++++++++ .../trex/trex-stl-3n-ethip4-ip4dst400-2cnf.py | 157 +++++++++++ .../trex/trex-stl-3n-ethip4-ip4dst400-4cnf.py | 157 +++++++++++ .../trex/trex-stl-3n-ethip4-ip4dst400-8cnf.py | 157 +++++++++++ .../trex/trex-stl-3n-ethip4-ip4dst400.py | 126 +++++++++ .../trex/trex-stl-3n-ethip4-ip4dst40000-1cnf.py | 157 +++++++++++ .../trex/trex-stl-3n-ethip4-ip4dst40000-2cnf.py | 157 +++++++++++ .../trex/trex-stl-3n-ethip4-ip4dst40000-4cnf.py | 157 +++++++++++ .../trex/trex-stl-3n-ethip4-ip4dst40000-8cnf.py | 157 +++++++++++ .../trex/trex-stl-3n-ethip4-ip4dst40000.py | 126 +++++++++ .../trex/trex-stl-3n-ethip4-ip4dst5000-1cnf.py | 157 +++++++++++ .../trex/trex-stl-3n-ethip4-ip4dst5000-2cnf.py | 157 +++++++++++ .../trex/trex-stl-3n-ethip4-ip4dst5000-4cnf.py | 157 +++++++++++ .../trex/trex-stl-3n-ethip4-ip4dst5000-8cnf.py | 157 +++++++++++ .../trex/trex-stl-3n-ethip4-ip4dst5000.py | 126 +++++++++ .../trex/trex-stl-3n-ethip4-ip4dst60000-1cnf.py | 157 +++++++++++ .../trex/trex-stl-3n-ethip4-ip4dst60000-2cnf.py | 157 +++++++++++ .../trex/trex-stl-3n-ethip4-ip4dst60000-4cnf.py | 157 +++++++++++ .../trex/trex-stl-3n-ethip4-ip4dst60000-8cnf.py | 157 +++++++++++ .../trex/trex-stl-3n-ethip4-ip4dst60000.py | 126 +++++++++ .../trex/trex-stl-3n-ethip4-ip4src253.py | 126 +++++++++ .../trex/trex-stl-3n-ethip4-ip4src254.py | 126 +++++++++ .../trex/trex-stl-3n-ethip4-macsrc100ip4src100.py | 161 ++++++++++++ .../trex-stl-3n-ethip4-macsrc100kip4src100k.py | 161 ++++++++++++ .../trex/trex-stl-3n-ethip4-macsrc10kip4src10k.py | 161 ++++++++++++ .../trex/trex-stl-3n-ethip4-macsrc500kdst500k.py | 215 +++++++++++++++ .../trex/trex-stl-3n-ethip4-macsrc50kdst50k.py | 215 +++++++++++++++ .../trex/trex-stl-3n-ethip4-macsrc5kdst5k.py | 215 +++++++++++++++ .../trex/trex-stl-3n-ethip4udp-1000u15p.py | 148 +++++++++++ .../trex/trex-stl-3n-ethip4udp-100u1000p-conc.py | 189 ++++++++++++++ .../trex/trex-stl-3n-ethip4udp-100u15p.py | 148 +++++++++++ .../trex/trex-stl-3n-ethip4udp-10u1000p-conc.py | 189 ++++++++++++++ .../trex/trex-stl-3n-ethip4udp-10u10p-conc.py | 189 ++++++++++++++ .../trex/trex-stl-3n-ethip4udp-10u15p.py | 148 +++++++++++ .../trex/trex-stl-3n-ethip4udp-1u15p.py | 141 ++++++++++ .../trex/trex-stl-3n-ethip4udp-1u1p.py | 104 ++++++++ .../trex/trex-stl-3n-ethip4udp-2000u15p.py | 148 +++++++++++ .../trex/trex-stl-3n-ethip4udp-4000u15p.py | 148 +++++++++++ .../trex/trex-stl-3n-ethip6-ip6dst10000.py | 129 +++++++++ .../trex/trex-stl-3n-ethip6-ip6dst100000.py | 129 +++++++++ .../trex/trex-stl-3n-ethip6-ip6dst1000000.py | 129 +++++++++ .../trex/trex-stl-3n-ethip6-ip6src253.py | 129 +++++++++ ...rex-stl-dot1qip4-vlan1ip4src254ip4dst254-bvi.py | 170 ++++++++++++ .../trex-stl-dot1qip4-vlan1ip4src254ip4dst254.py | 164 ++++++++++++ .../trex-stl-dot1qip4vxlan-ip4src10udpsrcrnd.py | 287 ++++++++++++++++++++ .../trex-stl-dot1qip4vxlan-ip4src1udpsrcrnd.py | 288 +++++++++++++++++++++ .../trex-stl-dot1qip4vxlan-ip4src2udpsrcrnd.py | 288 +++++++++++++++++++++ .../trex-stl-dot1qip4vxlan-ip4src4udpsrcrnd.py | 288 +++++++++++++++++++++ .../trex-stl-dot1qip4vxlan-ip4src6udpsrcrnd.py | 288 +++++++++++++++++++++ .../trex-stl-dot1qip4vxlan-ip4src8udpsrcrnd.py | 288 +++++++++++++++++++++ .../trex/trex-stl-ethip4udp-1024u63p.py | 169 ++++++++++++ .../trex/trex-stl-ethip4udp-1048576u63p.py | 169 ++++++++++++ .../trex/trex-stl-ethip4udp-16384u63p.py | 169 ++++++++++++ .../trex/trex-stl-ethip4udp-1u63p.py | 169 ++++++++++++ .../trex/trex-stl-ethip4udp-238u63p.py | 169 ++++++++++++ .../trex/trex-stl-ethip4udp-262144u63p.py | 169 ++++++++++++ .../trex/trex-stl-ethip4udp-4096u63p.py | 169 ++++++++++++ .../trex/trex-stl-ethip4udp-65536u63p.py | 169 ++++++++++++ .../trex/trex-stl-ethip4vxlan-ip4src1udpsrcrnd.py | 261 +++++++++++++++++++ 274 files changed, 21999 insertions(+), 21999 deletions(-) delete mode 100644 GPL/traffic_profiles/trex/trex-sl-2n-dot1qip4asym-ip4src254.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-2n-dot1qip6asym-ip6src253.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-2n-ethip4-ip4dst-rnd10000.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-2n-ethip4-ip4dst-rnd100000.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-2n-ethip4-ip4dst-rnd1000000.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-2n-ethip4-ip4dst10000.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-2n-ethip4-ip4dst100000.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-2n-ethip4-ip4dst1000000.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-2n-ethip4-ip4src253.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-2n-ethip4-ip4src254.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-2n-ethip4-macsrc500kdst500k.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-2n-ethip4-macsrc50kdst50k.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-2n-ethip4-macsrc5kdst5k.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-2n-ethip4udp-1000u15p.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-2n-ethip4udp-10u1000p-conc.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-2n-ethip4udp-1u1p.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-2n-ethip4udp-lb.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-2n-ethip6-ip6dst10000.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-2n-ethip6-ip6dst100000.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-2n-ethip6-ip6dst1000000.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-2n-ethip6-ip6src253.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-10c1n.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-10c2n.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-1c10n.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-1c1n.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-1c2n.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-1c4n.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-1c6n.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-1c8n.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-2c10n.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-2c1n.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-2c2n.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-2c4n.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-2c6n.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-2c8n.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-4c1n.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-4c2n.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-4c4n.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-4c6n.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-6c1n.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-6c2n.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-6c4n.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-8c1n.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-8c2n.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-dot1qip4-vlan100ip4src254ip4dst254.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-dot1qip4-vlan10ip4src254ip4dst254.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-dot1qip4-vlan1ip4src254ip4dst254.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-dot1qip4-vlan1kip4src254ip4dst254.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst100.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1000-1cnf.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1000-2cnf.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1000-4cnf.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1000-8cnf.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1000.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst10000-1cnf.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst10000-2cnf.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst10000-4cnf.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst10000-8cnf.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst10000.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst100000.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1000000.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst20000-1cnf.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst20000-2cnf.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst20000-4cnf.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst20000-8cnf.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst20000.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst253.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst253_l3fwd.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst4-1cnf.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst4-2cnf.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst4-4cnf.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst4.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40-1cnf.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40-2cnf.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40-4cnf.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40-8cnf.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst400-1cnf.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst400-2cnf.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst400-4cnf.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst400-8cnf.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst400.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40000-1cnf.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40000-2cnf.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40000-4cnf.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40000-8cnf.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40000.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst5000-1cnf.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst5000-2cnf.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst5000-4cnf.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst5000-8cnf.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst5000.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst60000-1cnf.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst60000-2cnf.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst60000-4cnf.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst60000-8cnf.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst60000.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4src253.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4src254.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-macsrc100ip4src100.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-macsrc100kip4src100k.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-macsrc10kip4src10k.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-macsrc500kdst500k.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-macsrc50kdst50k.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4-macsrc5kdst5k.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-1000u15p.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-100u1000p-conc.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-100u15p.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-10u1000p-conc.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-10u10p-conc.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-10u15p.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-1u15p.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-1u1p.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-2000u15p.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-4000u15p.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip6-ip6dst10000.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip6-ip6dst100000.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip6-ip6dst1000000.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-3n-ethip6-ip6src253.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-dot1qip4-vlan1ip4src254ip4dst254-bvi.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-dot1qip4-vlan1ip4src254ip4dst254.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-dot1qip4vxlan-ip4src10udpsrcrnd.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-dot1qip4vxlan-ip4src1udpsrcrnd.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-dot1qip4vxlan-ip4src2udpsrcrnd.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-dot1qip4vxlan-ip4src4udpsrcrnd.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-dot1qip4vxlan-ip4src6udpsrcrnd.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-dot1qip4vxlan-ip4src8udpsrcrnd.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-ethip4udp-1024u63p.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-ethip4udp-1048576u63p.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-ethip4udp-16384u63p.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-ethip4udp-1u63p.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-ethip4udp-238u63p.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-ethip4udp-262144u63p.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-ethip4udp-4096u63p.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-ethip4udp-65536u63p.py delete mode 100644 GPL/traffic_profiles/trex/trex-sl-ethip4vxlan-ip4src1udpsrcrnd.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-2n-dot1qip4asym-ip4src254.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-2n-dot1qip6asym-ip6src253.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst-rnd10000.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst-rnd100000.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst-rnd1000000.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst10000.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst100000.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst1000000.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4src253.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4src254.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-2n-ethip4-macsrc500kdst500k.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-2n-ethip4-macsrc50kdst50k.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-2n-ethip4-macsrc5kdst5k.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-2n-ethip4udp-1000u15p.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-2n-ethip4udp-10u1000p-conc.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-2n-ethip4udp-1u1p.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-2n-ethip4udp-lb.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-2n-ethip6-ip6dst10000.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-2n-ethip6-ip6dst100000.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-2n-ethip6-ip6dst1000000.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-2n-ethip6-ip6src253.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-10c1n.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-10c2n.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-1c10n.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-1c1n.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-1c2n.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-1c4n.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-1c6n.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-1c8n.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-2c10n.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-2c1n.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-2c2n.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-2c4n.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-2c6n.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-2c8n.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-4c1n.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-4c2n.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-4c4n.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-4c6n.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-6c1n.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-6c2n.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-6c4n.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-8c1n.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-8c2n.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-dot1qip4-vlan100ip4src254ip4dst254.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-dot1qip4-vlan10ip4src254ip4dst254.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-dot1qip4-vlan1ip4src254ip4dst254.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-dot1qip4-vlan1kip4src254ip4dst254.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst1.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst100.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst1000-1cnf.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst1000-2cnf.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst1000-4cnf.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst1000-8cnf.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst1000.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst10000-1cnf.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst10000-2cnf.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst10000-4cnf.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst10000-8cnf.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst10000.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst100000.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst1000000.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst20000-1cnf.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst20000-2cnf.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst20000-4cnf.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst20000-8cnf.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst20000.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst253.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst253_l3fwd.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst4-1cnf.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst4-2cnf.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst4-4cnf.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst4.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40-1cnf.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40-2cnf.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40-4cnf.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40-8cnf.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst400-1cnf.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst400-2cnf.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst400-4cnf.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst400-8cnf.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst400.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40000-1cnf.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40000-2cnf.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40000-4cnf.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40000-8cnf.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40000.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst5000-1cnf.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst5000-2cnf.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst5000-4cnf.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst5000-8cnf.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst5000.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst60000-1cnf.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst60000-2cnf.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst60000-4cnf.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst60000-8cnf.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst60000.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4src253.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4src254.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-macsrc100ip4src100.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-macsrc100kip4src100k.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-macsrc10kip4src10k.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-macsrc500kdst500k.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-macsrc50kdst50k.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4-macsrc5kdst5k.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-1000u15p.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-100u1000p-conc.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-100u15p.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-10u1000p-conc.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-10u10p-conc.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-10u15p.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-1u15p.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-1u1p.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-2000u15p.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-4000u15p.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip6-ip6dst10000.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip6-ip6dst100000.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip6-ip6dst1000000.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-3n-ethip6-ip6src253.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-dot1qip4-vlan1ip4src254ip4dst254-bvi.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-dot1qip4-vlan1ip4src254ip4dst254.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src10udpsrcrnd.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src1udpsrcrnd.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src2udpsrcrnd.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src4udpsrcrnd.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src6udpsrcrnd.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src8udpsrcrnd.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-ethip4udp-1024u63p.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-ethip4udp-1048576u63p.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-ethip4udp-16384u63p.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-ethip4udp-1u63p.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-ethip4udp-238u63p.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-ethip4udp-262144u63p.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-ethip4udp-4096u63p.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-ethip4udp-65536u63p.py create mode 100644 GPL/traffic_profiles/trex/trex-stl-ethip4vxlan-ip4src1udpsrcrnd.py (limited to 'GPL') diff --git a/GPL/traffic_profiles/trex/trex-sl-2n-dot1qip4asym-ip4src254.py b/GPL/traffic_profiles/trex/trex-sl-2n-dot1qip4asym-ip4src254.py deleted file mode 100644 index ae411e233b..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-2n-dot1qip4asym-ip4src254.py +++ /dev/null @@ -1,133 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Direction 0 --> 1: - - Packet: ETH / IP / - - Source IP address range: 10.10.10.1 - 10.10.10.254 - - Destination IP address range: 20.20.20.1 - - Direction 1 --> 0: - - Packet: ETH / DOT1Q / IP / - - Source IP address range: 20.20.20.1 - 20.20.20.254 - - Destination IP address range: 10.10.10.1 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # VLAN ID - self.vlan_id = 10 - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.10.10.1" - self.p1_src_end_ip = u"10.10.10.254" - self.p1_dst_start_ip = u"20.20.20.1" - - self.p2_src_start_ip = u"20.20.20.1" - self.p2_src_end_ip = u"20.20.20.254" - self.p2_dst_start_ip = u"10.10.10.1" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - Dot1Q( - vlan=self.vlan_id - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-2n-dot1qip6asym-ip6src253.py b/GPL/traffic_profiles/trex/trex-sl-2n-dot1qip6asym-ip6src253.py deleted file mode 100644 index f2e9e81920..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-2n-dot1qip6asym-ip6src253.py +++ /dev/null @@ -1,134 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Direction 0 --> 1: - - Packet: ETH / IPv6 / - - Source IP address range: 2001:1::2 - 2001:1::FE - - Destination IP address range: 2001:2::2 - - Direction 1 --> 0: - - Packet: ETH / DOT1Q / IPv6 / - - Source IP address range: 2001:2::2 - 2001:2::FE - - Destination IP address range: 2001:1::2 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # VLAN ID - self.vlan_id = 10 - - # IPs used in packet headers. - self.p1_src_start_ip = u"2001:1::2" - self.p1_src_end_ip = u"2001:1::FE" - self.p1_dst_start_ip = u"2001:2::2" - - self.p2_src_start_ip = u"2001:2::2" - self.p2_src_end_ip = u"2001:2::FE" - self.p2_dst_start_ip = u"2001:1::2" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IPv6 | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - base_p1, count_p1 = self._get_start_end_ipv6( - self.p1_src_start_ip, - self.p1_src_end_ip - ) - base_p2, count_p2 = self._get_start_end_ipv6( - self.p2_src_start_ip, - self.p2_src_end_ip - ) - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IPv6( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - Dot1Q( - vlan=self.vlan_id - ) / - IPv6( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"ipv6_src", - min_value=base_p1, - max_value=base_p1 + count_p1, - size=8, op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ipv6_src", - pkt_offset=u"IPv6.src", - offset_fixup=8 - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"ipv6_src", - min_value=base_p2, - max_value=base_p2 + count_p2, - size=8, op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ipv6_src", - pkt_offset=u"IPv6.src", - offset_fixup=8 - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :returns: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-2n-ethip4-ip4dst-rnd10000.py b/GPL/traffic_profiles/trex/trex-sl-2n-ethip4-ip4dst-rnd10000.py deleted file mode 100644 index 16627f0884..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-2n-ethip4-ip4dst-rnd10000.py +++ /dev/null @@ -1,127 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.39.15 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.39.15 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams" parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.39.15" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.39.15" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - 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 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVarRepeatableRandom( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - limit=10000 - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVarRepeatableRandom( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - limit=10000 - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-2n-ethip4-ip4dst-rnd100000.py b/GPL/traffic_profiles/trex/trex-sl-2n-ethip4-ip4dst-rnd100000.py deleted file mode 100644 index 751528d10c..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-2n-ethip4-ip4dst-rnd100000.py +++ /dev/null @@ -1,126 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.1.134.159 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.1.134.159 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams" parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.1.134.159" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.1.134.159" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - 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 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVarRepeatableRandom( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - limit=100000 - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVarRepeatableRandom( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - limit=100000 - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-2n-ethip4-ip4dst-rnd1000000.py b/GPL/traffic_profiles/trex/trex-sl-2n-ethip4-ip4dst-rnd1000000.py deleted file mode 100644 index 58ab03516c..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-2n-ethip4-ip4dst-rnd1000000.py +++ /dev/null @@ -1,126 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.15.66.63 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.15.66.63 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams" parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.15.66.63" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.15.66.63" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - 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 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVarRepeatableRandom( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - limit=1000000 - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVarRepeatableRandom( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - limit=1000000 - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-2n-ethip4-ip4dst10000.py b/GPL/traffic_profiles/trex/trex-sl-2n-ethip4-ip4dst10000.py deleted file mode 100644 index e9d5fb15f6..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-2n-ethip4-ip4dst10000.py +++ /dev/null @@ -1,125 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.39.15 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.39.15 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.39.15" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.39.15" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - 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 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-2n-ethip4-ip4dst100000.py b/GPL/traffic_profiles/trex/trex-sl-2n-ethip4-ip4dst100000.py deleted file mode 100644 index 5977d36b5b..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-2n-ethip4-ip4dst100000.py +++ /dev/null @@ -1,126 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.1.134.159 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.1.134.159 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.1.134.159" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.1.134.159" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - 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 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-2n-ethip4-ip4dst1000000.py b/GPL/traffic_profiles/trex/trex-sl-2n-ethip4-ip4dst1000000.py deleted file mode 100644 index 8b63b82e4f..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-2n-ethip4-ip4dst1000000.py +++ /dev/null @@ -1,126 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.15.66.63 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.15.66.63 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.15.66.63" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.15.66.63" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - 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 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name="dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op="inc" - ), - STLVmWrFlowVar( - fv_name="dst", - pkt_offset="IP.dst" - ), - STLVmFixIpv4( - offset="IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name="dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op="inc" - ), - STLVmWrFlowVar( - fv_name="dst", - pkt_offset="IP.dst" - ), - STLVmFixIpv4( - offset="IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-2n-ethip4-ip4src253.py b/GPL/traffic_profiles/trex/trex-sl-2n-ethip4-ip4src253.py deleted file mode 100644 index 883883ad18..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-2n-ethip4-ip4src253.py +++ /dev/null @@ -1,126 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.10.10.2 - 10.10.10.254 - - Destination IP address range: 20.20.20.2 - - Direction 1 --> 0: - - Source IP address range: 20.20.20.2 - 20.20.20.254 - - Destination IP address range: 10.10.10.2 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.10.10.2" - self.p1_src_end_ip = u"10.10.10.254" - self.p1_dst_start_ip = u"20.20.20.2" - - self.p2_src_start_ip = u"20.20.20.2" - self.p2_src_end_ip = u"20.20.20.254" - self.p2_dst_start_ip = u"10.10.10.2" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - 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 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-2n-ethip4-ip4src254.py b/GPL/traffic_profiles/trex/trex-sl-2n-ethip4-ip4src254.py deleted file mode 100644 index fc6167d126..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-2n-ethip4-ip4src254.py +++ /dev/null @@ -1,126 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.10.10.1 - 10.10.10.254 - - Destination IP address range: 20.20.20.1 - - Direction 1 --> 0: - - Source IP address range: 20.20.20.1 - 20.20.20.254 - - Destination IP address range: 10.10.10.1 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.10.10.1" - self.p1_src_end_ip = u"10.10.10.254" - self.p1_dst_start_ip = u"20.20.20.1" - - self.p2_src_start_ip = u"20.20.20.1" - self.p2_src_end_ip = u"20.20.20.254" - self.p2_dst_start_ip = u"10.10.10.1" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - 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 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-2n-ethip4-macsrc500kdst500k.py b/GPL/traffic_profiles/trex/trex-sl-2n-ethip4-macsrc500kdst500k.py deleted file mode 100644 index 9c55482078..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-2n-ethip4-macsrc500kdst500k.py +++ /dev/null @@ -1,215 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source MAC address range: ca:fe:00:00:00:00 - ca:fe:00:07:a1:1f - - Destination MAC address range: fa:ce:00:00:00:00 - fa:ce:00:07:a1:1f - - Source IP address range: 10.0.0.0 - 10.7.161.31 - - Destination IP address range: 20.0.0.0 - 20.7.161.31 - - Direction 1 --> 0: - - Source MAC address range: fa:ce:00:00:00:00 - fa:ce:00:07:a1:1f - - Destination MAC address range: ca:fe:00:00:00:00 - ca:fe:00:07:a1:1f - - Source IP address range: 20.0.0.0 - 20.7.161.31 - - Destination IP address range: 10.0.0.0 - 10.7.161.31 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.clients = 500000 - - # MACs used in packet headers. - self.p1_src_start_mac = u"ca:fe:00:00:00:00" # mask: 00:00:FF:FF:FF:FF - self.p1_dst_start_mac = u"fa:ce:00:00:00:00" # mask: 00:00:FF:FF:FF:FF - - self.p2_src_start_mac = u"fa:ce:00:00:00:00" # mask: 00:00:FF:FF:FF:FF - self.p2_dst_start_mac = u"ca:fe:00:00:00:00" # mask: 00:00:FF:FF:FF:FF - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.0" - self.p1_src_end_ip = u"10.7.161.31" - - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.7.161.31" - - self.p2_src_start_ip = u"20.0.0.0" - self.p2_src_end_ip = u"20.7.161.31" - - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.7.161.31" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - src=self.p1_src_start_mac, - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - src=self.p2_src_start_mac, - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_src", - min_value=0, - max_value=self.clients-1, - size=4, - op=u"inc" - ), - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=self.clients-1, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_src", - pkt_offset= 8 - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset= 2 - ), - STLVmFlowVar( - name=u"ip_src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ip_src", - pkt_offset=u"IP.src" - ), - STLVmFlowVar( - name=u"ip_dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ip_dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_src", - min_value=0, - max_value=self.clients-1, - size=4, - op=u"inc" - ), - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=self.clients-1, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_src", - pkt_offset= 8 - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset= 2 - ), - STLVmFlowVar( - name=u"ip_src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ip_src", - pkt_offset=u"IP.src" - ), - STLVmFlowVar( - name=u"ip_dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ip_dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-2n-ethip4-macsrc50kdst50k.py b/GPL/traffic_profiles/trex/trex-sl-2n-ethip4-macsrc50kdst50k.py deleted file mode 100644 index 42e3db6a6f..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-2n-ethip4-macsrc50kdst50k.py +++ /dev/null @@ -1,214 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source MAC address range: ca:fe:00:00:00:00 - ca:fe:00:00:c3:4f - - Destination MAC address range: fa:ce:00:00:00:00 - fa:ce:00:00:c3:4f - - Source IP address range: 10.0.0.0 - 10.0.195.79 - - Destination IP address range: 20.0.0.0 - 20.0.195.79 - - Direction 1 --> 0: - - Source MAC address range: fa:ce:00:00:00:00 - fa:ce:00:00:c3:4f - - Destination MAC address range: ca:fe:00:00:00:00 - ca:fe:00:00:c3:4f - - Source IP address range: 20.0.0.0 - 20.0.195.79 - - Destination IP address range: 10.0.0.0 - 10.0.195.79 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.clients = 50000 - - # MACs used in packet headers. - self.p1_src_start_mac = u"ca:fe:00:00:00:00" # mask: 00:00:FF:FF:FF:FF - self.p1_dst_start_mac = u"fa:ce:00:00:00:00" # mask: 00:00:FF:FF:FF:FF - - self.p2_src_start_mac = u"fa:ce:00:00:00:00" # mask: 00:00:FF:FF:FF:FF - self.p2_dst_start_mac = u"ca:fe:00:00:00:00" # mask: 00:00:FF:FF:FF:FF - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.0" - self.p1_src_end_ip = u"10.0.195.79" - - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.195.79" - - self.p2_src_start_ip = u"20.0.0.0" - self.p2_src_end_ip = u"20.0.195.79" - - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.195.79" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - src=self.p1_src_start_mac, - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - src=self.p2_src_start_mac, - dst=self.p2_dst_start_mac) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_src", - min_value=0, - max_value=self.clients-1, - size=4, - op=u"inc" - ), - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=self.clients-1, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_src", - pkt_offset= 8 - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset= 2 - ), - STLVmFlowVar( - name=u"ip_src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ip_src", - pkt_offset=u"IP.src" - ), - STLVmFlowVar( - name=u"ip_dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ip_dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_src", - min_value=0, - max_value=self.clients-1, - size=4, - op=u"inc" - ), - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=self.clients-1, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_src", - pkt_offset= 8 - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset= 2 - ), - STLVmFlowVar( - name=u"ip_src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ip_src", - pkt_offset=u"IP.src" - ), - STLVmFlowVar( - name=u"ip_dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ip_dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-2n-ethip4-macsrc5kdst5k.py b/GPL/traffic_profiles/trex/trex-sl-2n-ethip4-macsrc5kdst5k.py deleted file mode 100644 index 29df3373d3..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-2n-ethip4-macsrc5kdst5k.py +++ /dev/null @@ -1,215 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source MAC address range: ca:fe:00:00:00:00 - ca:fe:00:00:13:87 - - Destination MAC address range: fa:ce:00:00:00:00 - fa:ce:00:00:13:87 - - Source IP address range: 10.0.0.0 - 10.0.19.135 - - Destination IP address range: 20.0.0.0 - 20.0.19.135 - - Direction 1 --> 0: - - Source MAC address range: fa:ce:00:00:00:00 - fa:ce:00:00:13:87 - - Destination MAC address range: ca:fe:00:00:00:00 - ca:fe:00:00:13:87 - - Source IP address range: 20.0.0.0 - 20.0.19.135 - - Destination IP address range: 10.0.0.0 - 10.0.19.135 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.clients = 5000 - - # MACs used in packet headers. - self.p1_src_start_mac = u"ca:fe:00:00:00:00" # mask: 00:00:FF:FF:FF:FF - self.p1_dst_start_mac = u"fa:ce:00:00:00:00" # mask: 00:00:FF:FF:FF:FF - - self.p2_src_start_mac = u"fa:ce:00:00:00:00" # mask: 00:00:FF:FF:FF:FF - self.p2_dst_start_mac = u"ca:fe:00:00:00:00" # mask: 00:00:FF:FF:FF:FF - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.0" - self.p1_src_end_ip = u"10.0.19.135" - - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.19.135" - - self.p2_src_start_ip = u"20.0.0.0" - self.p2_src_end_ip = u"20.0.19.135" - - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.19.135" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - src=self.p1_src_start_mac, - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - src=self.p2_src_start_mac, - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_src", - min_value=0, - max_value=self.clients-1, - size=4, - op=u"inc" - ), - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=self.clients-1, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_src", - pkt_offset= 8 - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset= 2 - ), - STLVmFlowVar( - name=u"ip_src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ip_src", - pkt_offset=u"IP.src" - ), - STLVmFlowVar( - name=u"ip_dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ip_dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_src", - min_value=0, - max_value=self.clients-1, - size=4, - op=u"inc" - ), - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=self.clients-1, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_src", - pkt_offset= 8 - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset= 2 - ), - STLVmFlowVar( - name=u"ip_src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ip_src", - pkt_offset=u"IP.src" - ), - STLVmFlowVar( - name=u"ip_dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ip_dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-2n-ethip4udp-1000u15p.py b/GPL/traffic_profiles/trex/trex-sl-2n-ethip4udp-1000u15p.py deleted file mode 100644 index 64fe1a705f..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-2n-ethip4udp-1000u15p.py +++ /dev/null @@ -1,146 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / UDP - - Direction 0 --> 1: - - Source IP address range: 20.0.0.0 - 20.0.3.231 - - Destination IP address range: 12.0.0.2 - - Source UDP port range: 1024 - 1038 - - Destination UDP port range: 1024 - - Direction 1 --> 0: - - Source IP address range: 12.0.0.2 - - Destination IP address range: 200.0.0.0 - - Source UDP port range: 1024 - - Destination UDP port range: 1024 - 16023 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"20.0.0.0" - self.p1_src_end_ip = u"20.0.3.231" - self.p1_dst_start_ip = u"12.0.0.2" - - self.p2_src_start_ip = u"12.0.0.2" - self.p2_src_end_ip = u"12.0.0.2" - self.p2_dst_start_ip = u"200.0.0.0" - - # UDP ports used in packet headers. - self.p1_src_start_udp_port = 1024 - self.p1_src_end_udp_port = 1038 - self.p1_dst_start_udp_port = 1024 - - self.p2_src_start_udp_port = 1024 - self.p2_dst_start_udp_port = 1024 - self.p2_dst_end_udp_port = 16023 - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | UDP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=17 - ) / - UDP( - sport=self.p1_src_start_udp_port, - dport=self.p1_dst_start_udp_port - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=17 - ) / - UDP( - sport=self.p2_src_start_udp_port, - dport=self.p2_dst_start_udp_port - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmTupleGen( - ip_min=self.p1_src_start_ip, - ip_max=self.p1_src_end_ip, - port_min=self.p1_src_start_udp_port, - port_max=self.p1_src_end_udp_port, - name=u"tuple" - ), - STLVmWrFlowVar( - fv_name=u"tuple.ip", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4(offset=u"IP"), - STLVmWrFlowVar( - fv_name=u"tuple.port", - pkt_offset=u"UDP.sport" - ) - ] - ) - # Direction 0 --> 1 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"dport", - min_value=self.p2_dst_start_udp_port, - max_value=self.p2_dst_end_udp_port, - size=2, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dport", - pkt_offset=u"UDP.dport" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-2n-ethip4udp-10u1000p-conc.py b/GPL/traffic_profiles/trex/trex-sl-2n-ethip4udp-10u1000p-conc.py deleted file mode 100644 index 77f05f8af3..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-2n-ethip4udp-10u1000p-conc.py +++ /dev/null @@ -1,189 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / UDP - - Direction 0 --> 1: - - Source IP address range: 10.10.10.2 - 10.10.10.11 - - Destination IP address range: 20.20.20.2 - 20.20.20.11 - - Source UDP port range: 1001 - 2000 - - Destination UDP port range: 2001 - 3000 - - Direction 1 --> 0: - - Source IP address range: 20.20.20.2 - 20.20.20.11 - - Destination IP address range: 10.10.10.2 - 10.10.10.11 - - Source UDP port range: 2001 - 3000 - - Destination UDP port range: 1001 - 2000 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.10.10.2" - self.p1_src_end_ip = u"10.10.10.11" - self.p1_dst_start_ip = u"20.20.20.2" - self.p1_dst_end_ip = u"20.20.20.11" - - self.p2_src_start_ip = u"20.20.20.2" - self.p2_src_end_ip = u"20.20.20.11" - self.p2_dst_start_ip = u"10.10.10.2" - self.p2_dst_end_ip = u"10.10.10.11" - - # UDP ports used in packet headers. - self.p1_src_start_udp_port = 1001 - self.p1_src_end_udp_port = 2000 - self.p1_dst_start_udp_port = 2001 - self.p1_dst_end_udp_port = 3000 - - self.p2_src_start_udp_port = 2001 - self.p2_src_end_udp_port = 3000 - self.p2_dst_start_udp_port = 1001 - self.p2_dst_end_udp_port = 2000 - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | UDP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=17 - ) / - UDP( - sport=self.p1_src_start_udp_port, - dport=self.p1_dst_start_udp_port - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=17 - ) / - UDP( - sport=self.p2_src_start_udp_port, - dport=self.p2_dst_start_udp_port - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmTupleGen( - ip_min=self.p1_src_start_ip, - ip_max=self.p1_src_end_ip, - port_min=self.p1_src_start_udp_port, - port_max=self.p1_src_end_udp_port, - name=u"tuple1_src" - ), - STLVmTupleGen( - ip_min=self.p1_dst_start_ip, - ip_max=self.p1_dst_end_ip, - port_min=self.p1_dst_start_udp_port, - port_max=self.p1_dst_end_udp_port, - name=u"tuple1_dst" - ), - STLVmWrFlowVar( - fv_name=u"tuple1_src.ip", - pkt_offset=u"IP.src" - ), - STLVmWrFlowVar( - fv_name=u"tuple1_dst.ip", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ), - STLVmWrFlowVar( - fv_name=u"tuple1_src.port", - pkt_offset=u"UDP.sport" - ), - STLVmWrFlowVar( - fv_name=u"tuple1_dst.port", - pkt_offset=u"UDP.dport" - ) - ] - ) - # Direction 0 --> 1 - vm2 = STLScVmRaw( - [ - STLVmTupleGen( - ip_min=self.p2_src_start_ip, - ip_max=self.p2_src_end_ip, - port_min=self.p2_src_start_udp_port, - port_max=self.p2_src_end_udp_port, - name=u"tuple2_src" - ), - STLVmTupleGen( - ip_min=self.p2_dst_start_ip, - ip_max=self.p2_dst_end_ip, - port_min=self.p2_dst_start_udp_port, - port_max=self.p2_dst_end_udp_port, - name=u"tuple2_dst" - ), - STLVmWrFlowVar( - fv_name=u"tuple2_src.ip", - pkt_offset=u"IP.src" - ), - STLVmWrFlowVar( - fv_name=u"tuple2_dst.ip", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ), - STLVmWrFlowVar( - fv_name=u"tuple2_src.port", - pkt_offset=u"UDP.sport" - ), - STLVmWrFlowVar( - fv_name=u"tuple2_dst.port", - pkt_offset=u"UDP.dport" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-2n-ethip4udp-1u1p.py b/GPL/traffic_profiles/trex/trex-sl-2n-ethip4udp-1u1p.py deleted file mode 100644 index 4f96ffe342..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-2n-ethip4udp-1u1p.py +++ /dev/null @@ -1,104 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / UDP - - Direction 0 --> 1: - - Source IP address range: 20.0.0.0 - - Destination IP address range: 30.0.0.0 - - Source UDP port range: 1024 - - Destination UDP port range: 1024 - - Direction 1 --> 0: - - Source IP address range: 30.0.0.0 - - Destination IP address range: 200.0.0.0 - - Source UDP port range: 1024 - - Destination UDP port range: 1028 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_ip = u"20.0.0.0" - self.p1_dst_ip = u"30.0.0.0" - - self.p2_src_ip = u"30.0.0.0" - self.p2_dst_ip = u"200.0.0.0" - - # UDP ports used in packet headers. - self.p1_src_udp_port = 1024 - self.p1_dst_udp_port = 1024 - - self.p2_src_udp_port = 1024 - self.p2_dst_udp_port = 2048 - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | UDP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IP( - src=self.p1_src_ip, - dst=self.p1_dst_ip, - proto=17 - ) / - UDP( - sport=self.p1_src_udp_port, - dport=self.p1_dst_udp_port - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - IP( - src=self.p2_src_ip, - dst=self.p2_dst_ip, - proto=17 - ) / - UDP( - sport=self.p2_src_udp_port, - dport=self.p2_dst_udp_port - ) - ) - - return base_pkt_a, base_pkt_b, None, None - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-2n-ethip4udp-lb.py b/GPL/traffic_profiles/trex/trex-sl-2n-ethip4udp-lb.py deleted file mode 100644 index df05cbff17..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-2n-ethip4udp-lb.py +++ /dev/null @@ -1,150 +0,0 @@ -# Copyright (c) 2020 Intel and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Packet: ETH / IP / UDP - - Direction 0 --> 1: - - Source IP address range: 192.168.50.74 - 192.168.50.79 - - Destination IP address range: 90.1.2.1 - - Direction 1 --> 0: - - Source IP address range: 192.168.60.74 - 192.168.60.79 - - Destination IP address range: 192.168.50.74 - 192.168.50.79 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"192.168.50.74" - self.p1_src_end_ip = u"192.168.50.79" - self.p1_dst_start_ip = u"90.1.2.1" - - self.p2_src_start_ip = u"192.168.60.74" - self.p2_src_end_ip = u"192.168.60.79" - self.p2_dst_start_ip = u"192.168.50.74" - self.p2_dst_end_ip = u"192.168.50.79" - - # UDP ports used in packet headers. - self.p1_src_udp_port = 63 - self.p1_dst_udp_port = 20000 - - self.p2_src_udp_port = 3307 - self.p2_dst_udp_port = 63 - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | UDP - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=17) / - UDP( - sport=self.p1_src_udp_port, - dport=self.p1_dst_udp_port - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=17 - ) / - UDP( - sport=self.p2_src_udp_port, - dport=self.p2_dst_udp_port - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-2n-ethip6-ip6dst10000.py b/GPL/traffic_profiles/trex/trex-sl-2n-ethip6-ip6dst10000.py deleted file mode 100644 index f1b90350fb..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-2n-ethip6-ip6dst10000.py +++ /dev/null @@ -1,129 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IPv6 / - - Direction 0 --> 1: - - Source IP address range: 2001:1::1 - - Destination IP address range: 2001:2::0 - 2001:2::270F - - Direction 1 --> 0: - - Source IP address range: 2001:2::1 - - Destination IP address range: 2001:1::0 - 2001:1::270F -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"2001:1::1" - self.p1_dst_start_ip = u"2001:2::0" - self.p1_dst_end_ip = u"2001:2::270F" - - self.p2_src_start_ip = u"2001:2::1" - self.p2_dst_start_ip = u"2001:1::0" - self.p2_dst_end_ip = u"2001:1::270F" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IPv6 | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - base_p1, count_p1 = self._get_start_end_ipv6( - self.p1_dst_start_ip, - self.p1_dst_end_ip - ) - base_p2, count_p2 = self._get_start_end_ipv6( - self.p2_dst_start_ip, - self.p2_dst_end_ip - ) - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IPv6( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - IPv6( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"ipv6_dst", - min_value=base_p1, - max_value=base_p1 + count_p1, - size=8, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ipv6_dst", - pkt_offset=u"IPv6.dst", - offset_fixup=8 - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"ipv6_dst", - min_value=base_p2, - max_value=base_p2 + count_p2, - size=8, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ipv6_dst", - pkt_offset=u"IPv6.dst", - offset_fixup=8 - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-2n-ethip6-ip6dst100000.py b/GPL/traffic_profiles/trex/trex-sl-2n-ethip6-ip6dst100000.py deleted file mode 100644 index 87e76726b2..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-2n-ethip6-ip6dst100000.py +++ /dev/null @@ -1,129 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IPv6 / - - Direction 0 --> 1: - - Source IP address range: 2001:1::1 - - Destination IP address range: 2001:2::0 - 2001:2::1:869F - - Direction 1 --> 0: - - Source IP address range: 2001:2::1 - - Destination IP address range: 2001:1::0 - 2001:1::1:869F -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"2001:1::1" - self.p1_dst_start_ip = u"2001:2::0" - self.p1_dst_end_ip = u"2001:2::1:869F" - - self.p2_src_start_ip = u"2001:2::1" - self.p2_dst_start_ip = u"2001:1::0" - self.p2_dst_end_ip = u"2001:1::1:869F" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IPv6 | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - base_p1, count_p1 = self._get_start_end_ipv6( - self.p1_dst_start_ip, - self.p1_dst_end_ip - ) - base_p2, count_p2 = self._get_start_end_ipv6( - self.p2_dst_start_ip, - self.p2_dst_end_ip - ) - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IPv6( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - IPv6( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"ipv6_dst", - min_value=base_p1, - max_value=base_p1 + count_p1, - size=8, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ipv6_dst", - pkt_offset=u"IPv6.dst", - offset_fixup=8 - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"ipv6_dst", - min_value=base_p2, - max_value=base_p2 + count_p2, - size=8, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ipv6_dst", - pkt_offset=u"IPv6.dst", - offset_fixup=8 - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-2n-ethip6-ip6dst1000000.py b/GPL/traffic_profiles/trex/trex-sl-2n-ethip6-ip6dst1000000.py deleted file mode 100644 index 9214b6239d..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-2n-ethip6-ip6dst1000000.py +++ /dev/null @@ -1,129 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IPv6 / - - Direction 0 --> 1: - - Source IP address range: 2001:1::1 - - Destination IP address range: 2001:2::0 - 2001:2::F:423F - - Direction 1 --> 0: - - Source IP address range: 2001:2::1 - - Destination IP address range: 2001:1::0 - 2001:1::F:423F -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"2001:1::1" - self.p1_dst_start_ip = u"2001:2::0" - self.p1_dst_end_ip = u"2001:2::F:423F" - - self.p2_src_start_ip = u"2001:2::1" - self.p2_dst_start_ip = u"2001:1::0" - self.p2_dst_end_ip = u"2001:1::F:423F" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IPv6 | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - base_p1, count_p1 = self._get_start_end_ipv6( - self.p1_dst_start_ip, - self.p1_dst_end_ip - ) - base_p2, count_p2 = self._get_start_end_ipv6( - self.p2_dst_start_ip, - self.p2_dst_end_ip - ) - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IPv6( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - IPv6( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"ipv6_dst", - min_value=base_p1, - max_value=base_p1 + count_p1, - size=8, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ipv6_dst", - pkt_offset=u"IPv6.dst", - offset_fixup=8 - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"ipv6_dst", - min_value=base_p2, - max_value=base_p2 + count_p2, - size=8, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ipv6_dst", - pkt_offset=u"IPv6.dst", - offset_fixup=8 - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-2n-ethip6-ip6src253.py b/GPL/traffic_profiles/trex/trex-sl-2n-ethip6-ip6src253.py deleted file mode 100644 index 7ac5f75bed..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-2n-ethip6-ip6src253.py +++ /dev/null @@ -1,129 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IPv6 / - - Direction 0 --> 1: - - Source IP address range: 2001:1::2 - 2001:1::FE - - Destination IP address range: 2001:2::2 - - Direction 1 --> 0: - - Source IP address range: 2001:2::2 - 2001:2::FE - - Destination IP address range: 2001:1::2 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"2001:1::2" - self.p1_src_end_ip = u"2001:1::FE" - self.p1_dst_start_ip = u"2001:2::2" - - self.p2_src_start_ip = u"2001:2::2" - self.p2_src_end_ip = u"2001:2::FE" - self.p2_dst_start_ip = u"2001:1::2" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IPv6 | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - base_p1, count_p1 = self._get_start_end_ipv6( - self.p1_src_start_ip, - self.p1_src_end_ip - ) - base_p2, count_p2 = self._get_start_end_ipv6( - self.p2_src_start_ip, - self.p2_src_end_ip - ) - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IPv6( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - IPv6( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"ipv6_src", - min_value=base_p1, - max_value=base_p1 + count_p1, - size=8, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ipv6_src", - pkt_offset=u"IPv6.src", - offset_fixup=8 - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"ipv6_src", - min_value=base_p2, - max_value=base_p2 + count_p2, - size=8, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ipv6_src", - pkt_offset=u"IPv6.src", - offset_fixup=8 - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-10c1n.py b/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-10c1n.py deleted file mode 100644 index 3707ec6b9a..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-10c1n.py +++ /dev/null @@ -1,163 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Destination MAC address: 52:54:00:00:nf_id:01 - - Source IP address range: 10.10.10.1 - 10.10.10.254 - - Destination IP address range: 20.20.20.1 - - Direction 1 --> 0: - - Destination MAC address: 52:54:00:00:nf_id:02 - - Source IP address range: 20.20.20.1 - 20.20.20.254 - - Destination IP address range: 10.10.10.1 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # Service density parameters. - self.nf_chains = 10 - self.nf_nodes = 1 - - # MACs used in packet headers. - self.p1_dst_start_mac = u"52:54:00:00:00:01" - self.p2_dst_start_mac = u"52:54:00:00:00:02" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.10.10.1" - self.p1_src_end_ip = u"10.10.10.254" - self.p1_dst_start_ip = u"20.20.20.1" - - self.p2_src_start_ip = u"20.20.20.1" - self.p2_src_end_ip = u"20.20.20.254" - self.p2_dst_start_ip = u"10.10.10.1" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=1, - max_value=self.nf_chains*self.nf_nodes, - size=1, - step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=self.nf_nodes, - max_value=self.nf_chains*self.nf_nodes, - size=1, - step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-10c2n.py b/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-10c2n.py deleted file mode 100644 index 52396c3723..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-10c2n.py +++ /dev/null @@ -1,164 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Destination MAC address: 52:54:00:00:nf_id:01 - - Source IP address range: 10.10.10.1 - 10.10.10.254 - - Destination IP address range: 20.20.20.1 - - Direction 1 --> 0: - - Destination MAC address: 52:54:00:00:nf_id:02 - - Source IP address range: 20.20.20.1 - 20.20.20.254 - - Destination IP address range: 10.10.10.1 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # Service density parameters. - self.nf_chains = 10 - self.nf_nodes = 2 - - # MACs used in packet headers. - self.p1_dst_start_mac = u'52:54:00:00:00:01' - self.p2_dst_start_mac = u'52:54:00:00:00:02' - - # IPs used in packet headers. - self.p1_src_start_ip = u'10.10.10.1' - self.p1_src_end_ip = u'10.10.10.254' - self.p1_dst_start_ip = u'20.20.20.1' - - self.p2_src_start_ip = u'20.20.20.1' - self.p2_src_end_ip = u'20.20.20.254' - self.p2_dst_start_ip = u'10.10.10.1' - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=1, - max_value=self.nf_chains*self.nf_nodes, - size=1, - step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=self.nf_nodes, - max_value=self.nf_chains*self.nf_nodes, - size=1, - step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-1c10n.py b/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-1c10n.py deleted file mode 100644 index 8d29f86b49..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-1c10n.py +++ /dev/null @@ -1,164 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Destination MAC address: 52:54:00:00:nf_id:01 - - Source IP address range: 10.10.10.1 - 10.10.10.254 - - Destination IP address range: 20.20.20.1 - - Direction 1 --> 0: - - Destination MAC address: 52:54:00:00:nf_id:02 - - Source IP address range: 20.20.20.1 - 20.20.20.254 - - Destination IP address range: 10.10.10.1 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # Service density parameters. - self.nf_chains = 1 - self.nf_nodes = 10 - - # MACs used in packet headers. - self.p1_dst_start_mac = u"52:54:00:00:00:01" - self.p2_dst_start_mac = u"52:54:00:00:00:02" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.10.10.1" - self.p1_src_end_ip = u"10.10.10.254" - self.p1_dst_start_ip = u"20.20.20.1" - - self.p2_src_start_ip = u"20.20.20.1" - self.p2_src_end_ip = u"20.20.20.254" - self.p2_dst_start_ip = u"10.10.10.1" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=1, - max_value=self.nf_chains*self.nf_nodes, - size=1, - step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=self.nf_nodes, - max_value=self.nf_chains*self.nf_nodes, - size=1, - step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-1c1n.py b/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-1c1n.py deleted file mode 100644 index f50e2e6c1d..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-1c1n.py +++ /dev/null @@ -1,166 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Destination MAC address: 52:54:00:00:nf_id:01 - - Source IP address range: 10.10.10.1 - 10.10.10.254 - - Destination IP address range: 20.20.20.1 - - Direction 1 --> 0: - - Destination MAC address: 52:54:00:00:nf_id:02 - - Source IP address range: 20.20.20.1 - 20.20.20.254 - - Destination IP address range: 10.10.10.1 -""" - -from re import finditer - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # Service density parameters. - self.nf_chains = 1 - self.nf_nodes = 1 - - # MACs used in packet headers. - self.p1_dst_start_mac = u"52:54:00:00:00:01" - self.p2_dst_start_mac = u"52:54:00:00:00:02" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.10.10.1" - self.p1_src_end_ip = u"10.10.10.254" - self.p1_dst_start_ip = u"20.20.20.1" - - self.p2_src_start_ip = u"20.20.20.1" - self.p2_src_end_ip = u"20.20.20.254" - self.p2_dst_start_ip = u"10.10.10.1" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=1, - max_value=self.nf_chains*self.nf_nodes, - size=1, - step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=self.nf_nodes, - max_value=self.nf_chains*self.nf_nodes, - size=1, - step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-1c2n.py b/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-1c2n.py deleted file mode 100644 index 1923f72504..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-1c2n.py +++ /dev/null @@ -1,164 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Destination MAC address: 52:54:00:00:nf_id:01 - - Source IP address range: 10.10.10.1 - 10.10.10.254 - - Destination IP address range: 20.20.20.1 - - Direction 1 --> 0: - - Destination MAC address: 52:54:00:00:nf_id:02 - - Source IP address range: 20.20.20.1 - 20.20.20.254 - - Destination IP address range: 10.10.10.1 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # Service density parameters. - self.nf_chains = 1 - self.nf_nodes = 2 - - # MACs used in packet headers. - self.p1_dst_start_mac = u"52:54:00:00:00:01" - self.p2_dst_start_mac = u"52:54:00:00:00:02" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.10.10.1" - self.p1_src_end_ip = u"10.10.10.254" - self.p1_dst_start_ip = u"20.20.20.1" - - self.p2_src_start_ip = u"20.20.20.1" - self.p2_src_end_ip = u"20.20.20.254" - self.p2_dst_start_ip = u"10.10.10.1" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=1, - max_value=self.nf_chains*self.nf_nodes, - size=1, - step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=self.nf_nodes, - max_value=self.nf_chains*self.nf_nodes, - size=1, - step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-1c4n.py b/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-1c4n.py deleted file mode 100644 index a1e55c5253..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-1c4n.py +++ /dev/null @@ -1,164 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Destination MAC address: 52:54:00:00:nf_id:01 - - Source IP address range: 10.10.10.1 - 10.10.10.254 - - Destination IP address range: 20.20.20.1 - - Direction 1 --> 0: - - Destination MAC address: 52:54:00:00:nf_id:02 - - Source IP address range: 20.20.20.1 - 20.20.20.254 - - Destination IP address range: 10.10.10.1 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # Service density parameters. - self.nf_chains = 1 - self.nf_nodes = 4 - - # MACs used in packet headers. - self.p1_dst_start_mac = u"52:54:00:00:00:01" - self.p2_dst_start_mac = u"52:54:00:00:00:02" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.10.10.1" - self.p1_src_end_ip = u"10.10.10.254" - self.p1_dst_start_ip = u"20.20.20.1" - - self.p2_src_start_ip = u"20.20.20.1" - self.p2_src_end_ip = u"20.20.20.254" - self.p2_dst_start_ip = u"10.10.10.1" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=1, - max_value=self.nf_chains*self.nf_nodes, - size=1, - step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=self.nf_nodes, - max_value=self.nf_chains*self.nf_nodes, - size=1, - step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-1c6n.py b/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-1c6n.py deleted file mode 100644 index ffc8b428ef..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-1c6n.py +++ /dev/null @@ -1,164 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Destination MAC address: 52:54:00:00:nf_id:01 - - Source IP address range: 10.10.10.1 - 10.10.10.254 - - Destination IP address range: 20.20.20.1 - - Direction 1 --> 0: - - Destination MAC address: 52:54:00:00:nf_id:02 - - Source IP address range: 20.20.20.1 - 20.20.20.254 - - Destination IP address range: 10.10.10.1 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # Service density parameters. - self.nf_chains = 1 - self.nf_nodes = 6 - - # MACs used in packet headers. - self.p1_dst_start_mac = u"52:54:00:00:00:01" - self.p2_dst_start_mac = u"52:54:00:00:00:02" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.10.10.1" - self.p1_src_end_ip = u"10.10.10.254" - self.p1_dst_start_ip = u"20.20.20.1" - - self.p2_src_start_ip = u"20.20.20.1" - self.p2_src_end_ip = u"20.20.20.254" - self.p2_dst_start_ip = u"10.10.10.1" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=1, - max_value=self.nf_chains*self.nf_nodes, - size=1, - step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=self.nf_nodes, - max_value=self.nf_chains*self.nf_nodes, - size=1, - step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-1c8n.py b/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-1c8n.py deleted file mode 100644 index 952859b31d..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-1c8n.py +++ /dev/null @@ -1,164 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Destination MAC address: 52:54:00:00:nf_id:01 - - Source IP address range: 10.10.10.1 - 10.10.10.254 - - Destination IP address range: 20.20.20.1 - - Direction 1 --> 0: - - Destination MAC address: 52:54:00:00:nf_id:02 - - Source IP address range: 20.20.20.1 - 20.20.20.254 - - Destination IP address range: 10.10.10.1 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # Service density parameters. - self.nf_chains = 1 - self.nf_nodes = 8 - - # MACs used in packet headers. - self.p1_dst_start_mac = u"52:54:00:00:00:01" - self.p2_dst_start_mac = u"52:54:00:00:00:02" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.10.10.1" - self.p1_src_end_ip = u"10.10.10.254" - self.p1_dst_start_ip = u"20.20.20.1" - - self.p2_src_start_ip = u"20.20.20.1" - self.p2_src_end_ip = u"20.20.20.254" - self.p2_dst_start_ip = u"10.10.10.1" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=1, - max_value=self.nf_chains*self.nf_nodes, - size=1, - step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=self.nf_nodes, - max_value=self.nf_chains*self.nf_nodes, - size=1, - step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-2c10n.py b/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-2c10n.py deleted file mode 100644 index 84440af422..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-2c10n.py +++ /dev/null @@ -1,164 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Destination MAC address: 52:54:00:00:nf_id:01 - - Source IP address range: 10.10.10.1 - 10.10.10.254 - - Destination IP address range: 20.20.20.1 - - Direction 1 --> 0: - - Destination MAC address: 52:54:00:00:nf_id:02 - - Source IP address range: 20.20.20.1 - 20.20.20.254 - - Destination IP address range: 10.10.10.1 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # Service density parameters. - self.nf_chains = 2 - self.nf_nodes = 10 - - # MACs used in packet headers. - self.p1_dst_start_mac = u"52:54:00:00:00:01" - self.p2_dst_start_mac = u"52:54:00:00:00:02" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.10.10.1" - self.p1_src_end_ip = u"10.10.10.254" - self.p1_dst_start_ip = u"20.20.20.1" - - self.p2_src_start_ip = u"20.20.20.1" - self.p2_src_end_ip = u"20.20.20.254" - self.p2_dst_start_ip = u"10.10.10.1" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=1, - max_value=self.nf_chains*self.nf_nodes, - size=1, - step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=self.nf_nodes, - max_value=self.nf_chains*self.nf_nodes, - size=1, - step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-2c1n.py b/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-2c1n.py deleted file mode 100644 index 91941769a3..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-2c1n.py +++ /dev/null @@ -1,164 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Destination MAC address: 52:54:00:00:nf_id:01 - - Source IP address range: 10.10.10.1 - 10.10.10.254 - - Destination IP address range: 20.20.20.1 - - Direction 1 --> 0: - - Destination MAC address: 52:54:00:00:nf_id:02 - - Source IP address range: 20.20.20.1 - 20.20.20.254 - - Destination IP address range: 10.10.10.1 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # Service density parameters. - self.nf_chains = 2 - self.nf_nodes = 1 - - # MACs used in packet headers. - self.p1_dst_start_mac = u"52:54:00:00:00:01" - self.p2_dst_start_mac = u"52:54:00:00:00:02" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.10.10.1" - self.p1_src_end_ip = u"10.10.10.254" - self.p1_dst_start_ip = u"20.20.20.1" - - self.p2_src_start_ip = u"20.20.20.1" - self.p2_src_end_ip = u"20.20.20.254" - self.p2_dst_start_ip = u"10.10.10.1" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=1, - max_value=self.nf_chains*self.nf_nodes, - size=1, - step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=self.nf_nodes, - max_value=self.nf_chains*self.nf_nodes, - size=1, - step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-2c2n.py b/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-2c2n.py deleted file mode 100644 index d66271f076..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-2c2n.py +++ /dev/null @@ -1,164 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Destination MAC address: 52:54:00:00:nf_id:01 - - Source IP address range: 10.10.10.1 - 10.10.10.254 - - Destination IP address range: 20.20.20.1 - - Direction 1 --> 0: - - Destination MAC address: 52:54:00:00:nf_id:02 - - Source IP address range: 20.20.20.1 - 20.20.20.254 - - Destination IP address range: 10.10.10.1 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # Service density parameters. - self.nf_chains = 2 - self.nf_nodes = 2 - - # MACs used in packet headers. - self.p1_dst_start_mac = u"52:54:00:00:00:01" - self.p2_dst_start_mac = u"52:54:00:00:00:02" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.10.10.1" - self.p1_src_end_ip = u"10.10.10.254" - self.p1_dst_start_ip = u"20.20.20.1" - - self.p2_src_start_ip = u"20.20.20.1" - self.p2_src_end_ip = u"20.20.20.254" - self.p2_dst_start_ip = u"10.10.10.1" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=1, - max_value=self.nf_chains*self.nf_nodes, - size=1, - step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=self.nf_nodes, - max_value=self.nf_chains*self.nf_nodes, - size=1, - step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-2c4n.py b/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-2c4n.py deleted file mode 100644 index 7eadae361b..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-2c4n.py +++ /dev/null @@ -1,164 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Destination MAC address: 52:54:00:00:nf_id:01 - - Source IP address range: 10.10.10.1 - 10.10.10.254 - - Destination IP address range: 20.20.20.1 - - Direction 1 --> 0: - - Destination MAC address: 52:54:00:00:nf_id:02 - - Source IP address range: 20.20.20.1 - 20.20.20.254 - - Destination IP address range: 10.10.10.1 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # Service density parameters. - self.nf_chains = 2 - self.nf_nodes = 4 - - # MACs used in packet headers. - self.p1_dst_start_mac = u"52:54:00:00:00:01" - self.p2_dst_start_mac = u"52:54:00:00:00:02" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.10.10.1" - self.p1_src_end_ip = u"10.10.10.254" - self.p1_dst_start_ip = u"20.20.20.1" - - self.p2_src_start_ip = u"20.20.20.1" - self.p2_src_end_ip = u"20.20.20.254" - self.p2_dst_start_ip = u"10.10.10.1" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=1, - max_value=self.nf_chains*self.nf_nodes, - size=1, - step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=self.nf_nodes, - max_value=self.nf_chains*self.nf_nodes, - size=1, - step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-2c6n.py b/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-2c6n.py deleted file mode 100644 index 3725f75b3e..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-2c6n.py +++ /dev/null @@ -1,164 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Destination MAC address: 52:54:00:00:nf_id:01 - - Source IP address range: 10.10.10.1 - 10.10.10.254 - - Destination IP address range: 20.20.20.1 - - Direction 1 --> 0: - - Destination MAC address: 52:54:00:00:nf_id:02 - - Source IP address range: 20.20.20.1 - 20.20.20.254 - - Destination IP address range: 10.10.10.1 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # Service density parameters. - self.nf_chains = 2 - self.nf_nodes = 6 - - # MACs used in packet headers. - self.p1_dst_start_mac = u"52:54:00:00:00:01" - self.p2_dst_start_mac = u"52:54:00:00:00:02" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.10.10.1" - self.p1_src_end_ip = u"10.10.10.254" - self.p1_dst_start_ip = u"20.20.20.1" - - self.p2_src_start_ip = u"20.20.20.1" - self.p2_src_end_ip = u"20.20.20.254" - self.p2_dst_start_ip = u"10.10.10.1" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=1, - max_value=self.nf_chains*self.nf_nodes, - size=1, - step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=self.nf_nodes, - max_value=self.nf_chains*self.nf_nodes, - size=1, - step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-2c8n.py b/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-2c8n.py deleted file mode 100644 index 024cbc34f3..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-2c8n.py +++ /dev/null @@ -1,164 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Destination MAC address: 52:54:00:00:nf_id:01 - - Source IP address range: 10.10.10.1 - 10.10.10.254 - - Destination IP address range: 20.20.20.1 - - Direction 1 --> 0: - - Destination MAC address: 52:54:00:00:nf_id:02 - - Source IP address range: 20.20.20.1 - 20.20.20.254 - - Destination IP address range: 10.10.10.1 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # Service density parameters. - self.nf_chains = 2 - self.nf_nodes = 8 - - # MACs used in packet headers. - self.p1_dst_start_mac = u"52:54:00:00:00:01" - self.p2_dst_start_mac = u"52:54:00:00:00:02" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.10.10.1" - self.p1_src_end_ip = u"10.10.10.254" - self.p1_dst_start_ip = u"20.20.20.1" - - self.p2_src_start_ip = u"20.20.20.1" - self.p2_src_end_ip = u"20.20.20.254" - self.p2_dst_start_ip = u"10.10.10.1" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=1, - max_value=self.nf_chains*self.nf_nodes, - size=1, - step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=self.nf_nodes, - max_value=self.nf_chains*self.nf_nodes, - size=1, - step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-4c1n.py b/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-4c1n.py deleted file mode 100644 index e8c62b9c41..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-4c1n.py +++ /dev/null @@ -1,164 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Destination MAC address: 52:54:00:00:nf_id:01 - - Source IP address range: 10.10.10.1 - 10.10.10.254 - - Destination IP address range: 20.20.20.1 - - Direction 1 --> 0: - - Destination MAC address: 52:54:00:00:nf_id:02 - - Source IP address range: 20.20.20.1 - 20.20.20.254 - - Destination IP address range: 10.10.10.1 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # Service density parameters. - self.nf_chains = 4 - self.nf_nodes = 1 - - # MACs used in packet headers. - self.p1_dst_start_mac = u"52:54:00:00:00:01" - self.p2_dst_start_mac = u"52:54:00:00:00:02" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.10.10.1" - self.p1_src_end_ip = u"10.10.10.254" - self.p1_dst_start_ip = u"20.20.20.1" - - self.p2_src_start_ip = u"20.20.20.1" - self.p2_src_end_ip = u"20.20.20.254" - self.p2_dst_start_ip = u"10.10.10.1" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=1, - max_value=self.nf_chains*self.nf_nodes, - size=1, - step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=self.nf_nodes, - max_value=self.nf_chains*self.nf_nodes, - size=1, - step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-4c2n.py b/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-4c2n.py deleted file mode 100644 index a6fbe9ea79..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-4c2n.py +++ /dev/null @@ -1,162 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Destination MAC address: 52:54:00:00:nf_id:01 - - Source IP address range: 10.10.10.1 - 10.10.10.254 - - Destination IP address range: 20.20.20.1 - - Direction 1 --> 0: - - Destination MAC address: 52:54:00:00:nf_id:02 - - Source IP address range: 20.20.20.1 - 20.20.20.254 - - Destination IP address range: 10.10.10.1 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # Service density parameters. - self.nf_chains = 4 - self.nf_nodes = 2 - - # MACs used in packet headers. - self.p1_dst_start_mac = u"52:54:00:00:00:01" - self.p2_dst_start_mac = u"52:54:00:00:00:02" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.10.10.1" - self.p1_src_end_ip = u"10.10.10.254" - self.p1_dst_start_ip = u"20.20.20.1" - - self.p2_src_start_ip = u"20.20.20.1" - self.p2_src_end_ip = u"20.20.20.254" - self.p2_dst_start_ip = u"10.10.10.1" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=1, - max_value=self.nf_chains*self.nf_nodes, - size=1, step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4), - STLVmFlowVar( - name=u"src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=self.nf_nodes, - max_value=self.nf_chains*self.nf_nodes, - size=1, - step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-4c4n.py b/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-4c4n.py deleted file mode 100644 index f1477419c3..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-4c4n.py +++ /dev/null @@ -1,164 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Destination MAC address: 52:54:00:00:nf_id:01 - - Source IP address range: 10.10.10.1 - 10.10.10.254 - - Destination IP address range: 20.20.20.1 - - Direction 1 --> 0: - - Destination MAC address: 52:54:00:00:nf_id:02 - - Source IP address range: 20.20.20.1 - 20.20.20.254 - - Destination IP address range: 10.10.10.1 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # Service density parameters. - self.nf_chains = 4 - self.nf_nodes = 4 - - # MACs used in packet headers. - self.p1_dst_start_mac = u"52:54:00:00:00:01" - self.p2_dst_start_mac = u"52:54:00:00:00:02" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.10.10.1" - self.p1_src_end_ip = u"10.10.10.254" - self.p1_dst_start_ip = u"20.20.20.1" - - self.p2_src_start_ip = u"20.20.20.1" - self.p2_src_end_ip = u"20.20.20.254" - self.p2_dst_start_ip = u"10.10.10.1" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=1, - max_value=self.nf_chains*self.nf_nodes, - size=1, - step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=self.nf_nodes, - max_value=self.nf_chains*self.nf_nodes, - size=1, - step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-4c6n.py b/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-4c6n.py deleted file mode 100644 index 7e2b79fdac..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-4c6n.py +++ /dev/null @@ -1,164 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Destination MAC address: 52:54:00:00:nf_id:01 - - Source IP address range: 10.10.10.1 - 10.10.10.254 - - Destination IP address range: 20.20.20.1 - - Direction 1 --> 0: - - Destination MAC address: 52:54:00:00:nf_id:02 - - Source IP address range: 20.20.20.1 - 20.20.20.254 - - Destination IP address range: 10.10.10.1 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # Service density parameters. - self.nf_chains = 4 - self.nf_nodes = 6 - - # MACs used in packet headers. - self.p1_dst_start_mac = u"52:54:00:00:00:01" - self.p2_dst_start_mac = u"52:54:00:00:00:02" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.10.10.1" - self.p1_src_end_ip = u"10.10.10.254" - self.p1_dst_start_ip = u"20.20.20.1" - - self.p2_src_start_ip = u"20.20.20.1" - self.p2_src_end_ip = u"20.20.20.254" - self.p2_dst_start_ip = u"10.10.10.1" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=1, - max_value=self.nf_chains*self.nf_nodes, - size=1, - step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=self.nf_nodes, - max_value=self.nf_chains*self.nf_nodes, - size=1, - step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-6c1n.py b/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-6c1n.py deleted file mode 100644 index dc8616c6fe..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-6c1n.py +++ /dev/null @@ -1,164 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Destination MAC address: 52:54:00:00:nf_id:01 - - Source IP address range: 10.10.10.1 - 10.10.10.254 - - Destination IP address range: 20.20.20.1 - - Direction 1 --> 0: - - Destination MAC address: 52:54:00:00:nf_id:02 - - Source IP address range: 20.20.20.1 - 20.20.20.254 - - Destination IP address range: 10.10.10.1 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # Service density parameters. - self.nf_chains = 6 - self.nf_nodes = 1 - - # MACs used in packet headers. - self.p1_dst_start_mac = u"52:54:00:00:00:01" - self.p2_dst_start_mac = u"52:54:00:00:00:02" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.10.10.1" - self.p1_src_end_ip = u"10.10.10.254" - self.p1_dst_start_ip = u"20.20.20.1" - - self.p2_src_start_ip = u"20.20.20.1" - self.p2_src_end_ip = u"20.20.20.254" - self.p2_dst_start_ip = u"10.10.10.1" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=1, - max_value=self.nf_chains*self.nf_nodes, - size=1, - step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=self.nf_nodes, - max_value=self.nf_chains*self.nf_nodes, - size=1, - step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-6c2n.py b/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-6c2n.py deleted file mode 100644 index 53a83db70b..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-6c2n.py +++ /dev/null @@ -1,164 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Destination MAC address: 52:54:00:00:nf_id:01 - - Source IP address range: 10.10.10.1 - 10.10.10.254 - - Destination IP address range: 20.20.20.1 - - Direction 1 --> 0: - - Destination MAC address: 52:54:00:00:nf_id:02 - - Source IP address range: 20.20.20.1 - 20.20.20.254 - - Destination IP address range: 10.10.10.1 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # Service density parameters. - self.nf_chains = 6 - self.nf_nodes = 2 - - # MACs used in packet headers. - self.p1_dst_start_mac = u"52:54:00:00:00:01" - self.p2_dst_start_mac = u"52:54:00:00:00:02" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.10.10.1" - self.p1_src_end_ip = u"10.10.10.254" - self.p1_dst_start_ip = u"20.20.20.1" - - self.p2_src_start_ip = u"20.20.20.1" - self.p2_src_end_ip = u"20.20.20.254" - self.p2_dst_start_ip = u"10.10.10.1" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=1, - max_value=self.nf_chains*self.nf_nodes, - size=1, - step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=self.nf_nodes, - max_value=self.nf_chains*self.nf_nodes, - size=1, - step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-6c4n.py b/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-6c4n.py deleted file mode 100644 index ac697e60ec..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-6c4n.py +++ /dev/null @@ -1,164 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Destination MAC address: 52:54:00:00:nf_id:01 - - Source IP address range: 10.10.10.1 - 10.10.10.254 - - Destination IP address range: 20.20.20.1 - - Direction 1 --> 0: - - Destination MAC address: 52:54:00:00:nf_id:02 - - Source IP address range: 20.20.20.1 - 20.20.20.254 - - Destination IP address range: 10.10.10.1 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # Service density parameters. - self.nf_chains = 6 - self.nf_nodes = 4 - - # MACs used in packet headers. - self.p1_dst_start_mac = u"52:54:00:00:00:01" - self.p2_dst_start_mac = u"52:54:00:00:00:02" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.10.10.1" - self.p1_src_end_ip = u"10.10.10.254" - self.p1_dst_start_ip = u"20.20.20.1" - - self.p2_src_start_ip = u"20.20.20.1" - self.p2_src_end_ip = u"20.20.20.254" - self.p2_dst_start_ip = u"10.10.10.1" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=1, - max_value=self.nf_chains*self.nf_nodes, - size=1, - step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=self.nf_nodes, - max_value=self.nf_chains*self.nf_nodes, - size=1, - step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-8c1n.py b/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-8c1n.py deleted file mode 100644 index 587dfc3406..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-8c1n.py +++ /dev/null @@ -1,164 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Destination MAC address: 52:54:00:00:nf_id:01 - - Source IP address range: 10.10.10.1 - 10.10.10.254 - - Destination IP address range: 20.20.20.1 - - Direction 1 --> 0: - - Destination MAC address: 52:54:00:00:nf_id:02 - - Source IP address range: 20.20.20.1 - 20.20.20.254 - - Destination IP address range: 10.10.10.1 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # Service density parameters. - self.nf_chains = 8 - self.nf_nodes = 1 - - # MACs used in packet headers. - self.p1_dst_start_mac = u"52:54:00:00:00:01" - self.p2_dst_start_mac = u"52:54:00:00:00:02" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.10.10.1" - self.p1_src_end_ip = u"10.10.10.254" - self.p1_dst_start_ip = u"20.20.20.1" - - self.p2_src_start_ip = u"20.20.20.1" - self.p2_src_end_ip = u"20.20.20.254" - self.p2_dst_start_ip = u"10.10.10.1" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=1, - max_value=self.nf_chains*self.nf_nodes, - size=1, - step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=self.nf_nodes, - max_value=self.nf_chains*self.nf_nodes, - size=1, - step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-8c2n.py b/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-8c2n.py deleted file mode 100644 index 9123a752b2..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-8c2n.py +++ /dev/null @@ -1,164 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Destination MAC address: 52:54:00:00:nf_id:01 - - Source IP address range: 10.10.10.1 - 10.10.10.254 - - Destination IP address range: 20.20.20.1 - - Direction 1 --> 0: - - Destination MAC address: 52:54:00:00:nf_id:02 - - Source IP address range: 20.20.20.1 - 20.20.20.254 - - Destination IP address range: 10.10.10.1 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # Service density parameters. - self.nf_chains = 8 - self.nf_nodes = 2 - - # MACs used in packet headers. - self.p1_dst_start_mac = u"52:54:00:00:00:01" - self.p2_dst_start_mac = u"52:54:00:00:00:02" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.10.10.1" - self.p1_src_end_ip = u"10.10.10.254" - self.p1_dst_start_ip = u"20.20.20.1" - - self.p2_src_start_ip = u"20.20.20.1" - self.p2_src_end_ip = u"20.20.20.254" - self.p2_dst_start_ip = u"10.10.10.1" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=1, - max_value=self.nf_chains*self.nf_nodes, - size=1, - step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=self.nf_nodes, - max_value=self.nf_chains*self.nf_nodes, - size=1, - step=self.nf_nodes, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=4 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-dot1qip4-vlan100ip4src254ip4dst254.py b/GPL/traffic_profiles/trex/trex-sl-3n-dot1qip4-vlan100ip4src254ip4dst254.py deleted file mode 100644 index b414bd1c7a..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-dot1qip4-vlan100ip4src254ip4dst254.py +++ /dev/null @@ -1,191 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / DOT1Q / IP / - - Direction 0 --> 1: - - VLAN range: 1 - 100 - - Source IP address range: 10.0.0.1 - 10.0.0.254 - - Destination IP address range: 20.0.0.1 - 20.0.0.254 - - Direction 1 --> 0: - - VLAN range: 1 - 100 - - Source IP address range: 20.0.0.1 - 20.0.0.254 - - Destination IP address range: 10.0.0.1 - 10.0.0.254 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # VLAN IDs - self.vlans = 100 - - self.p1_vlan_start = 1 - self.p1_vlan_end = self.p1_vlan_start + self.vlans - 1 - - self.p2_vlan_start = 1 - self.p2_vlan_end = self.p2_vlan_start + self.vlans - 1 - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_src_end_ip = u"10.0.0.254" - - self.p1_dst_start_ip = u"20.0.0.1" - self.p1_dst_end_ip = u"20.0.0.254" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_src_end_ip = u"20.0.0.254" - - self.p2_dst_start_ip = u"10.0.0.1" - self.p2_dst_end_ip = u"10.0.0.254" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | DOT1Q | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - Dot1Q( - vlan=self.p1_vlan_start - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - Dot1Q( - vlan=self.p2_vlan_start - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"vlan", - min_value=self.p1_vlan_start, - max_value=self.p1_vlan_end, - size=2, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"vlan", - pkt_offset=u"Dot1Q.vlan" - ), - STLVmFlowVar( - name=u"ip_src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"random" - ), - STLVmWrFlowVar( - fv_name=u"ip_src", - pkt_offset=u"IP.src" - ), - STLVmFlowVar( - name=u"ip_dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"random" - ), - STLVmWrFlowVar( - fv_name=u"ip_dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"vlan", - min_value=self.p2_vlan_start, - max_value=self.p2_vlan_end, - size=2, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"vlan", - pkt_offset=u"Dot1Q.vlan" - ), - STLVmFlowVar( - name=u"ip_src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"random" - ), - STLVmWrFlowVar( - fv_name=u"ip_src", - pkt_offset=u"IP.src" - ), - STLVmFlowVar( - name=u"ip_dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"random" - ), - STLVmWrFlowVar( - fv_name=u"ip_dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :returns: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-dot1qip4-vlan10ip4src254ip4dst254.py b/GPL/traffic_profiles/trex/trex-sl-3n-dot1qip4-vlan10ip4src254ip4dst254.py deleted file mode 100644 index d878e2d726..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-dot1qip4-vlan10ip4src254ip4dst254.py +++ /dev/null @@ -1,191 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / DOT1Q / IP / - - Direction 0 --> 1: - - VLAN range: 1 - 10 - - Source IP address range: 10.0.0.1 - 10.0.0.254 - - Destination IP address range: 20.0.0.1 - 20.0.0.254 - - Direction 1 --> 0: - - VLAN range: 1 - 10 - - Source IP address range: 20.0.0.1 - 20.0.0.254 - - Destination IP address range: 10.0.0.1 - 10.0.0.254 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # VLAN IDs - self.vlans = 10 - - self.p1_vlan_start = 1 - self.p1_vlan_end = self.p1_vlan_start + self.vlans - 1 - - self.p2_vlan_start = 1 - self.p2_vlan_end = self.p2_vlan_start + self.vlans - 1 - - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_src_end_ip = u"10.0.0.254" - - self.p1_dst_start_ip = u"20.0.0.1" - self.p1_dst_end_ip = u"20.0.0.254" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_src_end_ip = u"20.0.0.254" - - self.p2_dst_start_ip = u"10.0.0.1" - self.p2_dst_end_ip = u"10.0.0.254" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | DOT1Q | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - Dot1Q( - vlan=self.p1_vlan_start - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - Dot1Q( - vlan=self.p2_vlan_start - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"vlan", - min_value=self.p1_vlan_start, - max_value=self.p1_vlan_end, - size=2, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"vlan", - pkt_offset=u"Dot1Q.vlan" - ), - STLVmFlowVar( - name=u"ip_src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"random" - ), - STLVmWrFlowVar( - fv_name=u"ip_src", - pkt_offset=u"IP.src" - ), - STLVmFlowVar( - name=u"ip_dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"random" - ), - STLVmWrFlowVar( - fv_name=u"ip_dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"vlan", - min_value=self.p2_vlan_start, - max_value=self.p2_vlan_end, - size=2, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"vlan", - pkt_offset=u"Dot1Q.vlan" - ), - STLVmFlowVar( - name=u"ip_src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"random" - ), - STLVmWrFlowVar( - fv_name=u"ip_src", - pkt_offset=u"IP.src" - ), - STLVmFlowVar(name=u"ip_dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"random" - ), - STLVmWrFlowVar( - fv_name=u"ip_dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :returns: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-dot1qip4-vlan1ip4src254ip4dst254.py b/GPL/traffic_profiles/trex/trex-sl-3n-dot1qip4-vlan1ip4src254ip4dst254.py deleted file mode 100644 index c8f279bdb3..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-dot1qip4-vlan1ip4src254ip4dst254.py +++ /dev/null @@ -1,166 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / DOT1Q / IP / - - Direction 0 --> 1: - - VLAN range: 1 - - Source IP address range: 10.0.0.1 - 10.0.0.254 - - Destination IP address range: 20.0.0.1 - 20.0.0.254 - - Direction 1 --> 0: - - VLAN range: 1 - - Source IP address range: 20.0.0.1 - 20.0.0.254 - - Destination IP address range: 10.0.0.1 - 10.0.0.254 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # VLAN IDs - self.p1_vlan_start = 1 - - self.p2_vlan_start = 1 - - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_src_end_ip = u"10.0.0.254" - - self.p1_dst_start_ip = u"20.0.0.1" - self.p1_dst_end_ip = u"20.0.0.254" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_src_end_ip = u"20.0.0.254" - - self.p2_dst_start_ip = u"10.0.0.1" - self.p2_dst_end_ip = u"10.0.0.254" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | DOT1Q | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - Dot1Q( - vlan=self.p1_vlan_start - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - Dot1Q( - vlan=self.p2_vlan_start - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"ip_src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"random" - ), - STLVmWrFlowVar( - fv_name=u"ip_src", - pkt_offset=u"IP.src" - ), - STLVmFlowVar( - name=u"ip_dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"random" - ), - STLVmWrFlowVar( - fv_name=u"ip_dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"ip_src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"random" - ), - STLVmWrFlowVar( - fv_name=u"ip_src", - pkt_offset=u"IP.src" - ), - STLVmFlowVar( - name=u"ip_dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"random" - ), - STLVmWrFlowVar( - fv_name=u"ip_dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :returns: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-dot1qip4-vlan1kip4src254ip4dst254.py b/GPL/traffic_profiles/trex/trex-sl-3n-dot1qip4-vlan1kip4src254ip4dst254.py deleted file mode 100644 index 02decf4284..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-dot1qip4-vlan1kip4src254ip4dst254.py +++ /dev/null @@ -1,191 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / DOT1Q / IP / - - Direction 0 --> 1: - - VLAN range: 1 - 1000 - - Source IP address range: 10.0.0.1 - 10.0.0.254 - - Destination IP address range: 20.0.0.1 - 20.0.0.254 - - Direction 1 --> 0: - - VLAN range: 1 - 1000 - - Source IP address range: 20.0.0.1 - 20.0.0.254 - - Destination IP address range: 10.0.0.1 - 10.0.0.254 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # VLAN IDs - self.vlans = 1000 - - self.p1_vlan_start = 1 - self.p1_vlan_end = self.p1_vlan_start + self.vlans - 1 - - self.p2_vlan_start = 1 - self.p2_vlan_end = self.p2_vlan_start + self.vlans - 1 - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_src_end_ip = u"10.0.0.254" - - self.p1_dst_start_ip = u"20.0.0.1" - self.p1_dst_end_ip = u"20.0.0.254" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_src_end_ip = u"20.0.0.254" - - self.p2_dst_start_ip = u"10.0.0.1" - self.p2_dst_end_ip = u"10.0.0.254" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | DOT1Q | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - Dot1Q( - vlan=self.p1_vlan_start - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - Dot1Q( - vlan=self.p2_vlan_start - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"vlan", - min_value=self.p1_vlan_start, - max_value=self.p1_vlan_end, - size=2, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"vlan", - pkt_offset=u"Dot1Q.vlan" - ), - STLVmFlowVar( - name=u"ip_src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"random" - ), - STLVmWrFlowVar( - fv_name=u"ip_src", - pkt_offset=u"IP.src" - ), - STLVmFlowVar( - name=u"ip_dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"random" - ), - STLVmWrFlowVar( - fv_name=u"ip_dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"vlan", - min_value=self.p2_vlan_start, - max_value=self.p2_vlan_end, - size=2, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"vlan", - pkt_offset=u"Dot1Q.vlan" - ), - STLVmFlowVar( - name=u"ip_src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"random" - ), - STLVmWrFlowVar( - fv_name=u"ip_src", - pkt_offset=u"IP.src" - ), - STLVmFlowVar( - name=u"ip_dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"random" - ), - STLVmWrFlowVar( - fv_name=u"ip_dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :returns: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1.py deleted file mode 100644 index 0d36b7358f..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1.py +++ /dev/null @@ -1,85 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_ip = u"10.0.0.1" - self.p1_dst_ip = u"20.0.0.0" - - self.p2_src_ip = u"20.0.0.1" - self.p2_dst_ip = u"10.0.0.0" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IP( - src=self.p1_src_ip, - dst=self.p1_dst_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - IP( - src=self.p2_src_ip, - dst=self.p2_dst_ip, - proto=61 - ) - ) - - return base_pkt_a, base_pkt_b, None, None - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst100.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst100.py deleted file mode 100644 index 222b127914..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst100.py +++ /dev/null @@ -1,126 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.0.99 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.0.99 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.0.99" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.0.99" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - 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 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1000-1cnf.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1000-1cnf.py deleted file mode 100644 index 1397ae4828..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1000-1cnf.py +++ /dev/null @@ -1,157 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.3.231 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.3.231 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.p1_dst_start_mac = u"02:02:00:00:12:00" - - self.p2_dst_start_mac = u"02:02:00:00:02:00" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.3.231" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.3.231" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=0, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=0, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() - diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1000-2cnf.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1000-2cnf.py deleted file mode 100644 index b7f316092a..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1000-2cnf.py +++ /dev/null @@ -1,156 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.3.231 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.3.231 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.p1_dst_start_mac = u"02:02:00:00:12:00" - - self.p2_dst_start_mac = u"02:02:00:00:02:00" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.3.231" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.3.231" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=1, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=1, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() - diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1000-4cnf.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1000-4cnf.py deleted file mode 100644 index a64e4d5a5e..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1000-4cnf.py +++ /dev/null @@ -1,157 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.3.231 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.3.231 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.p1_dst_start_mac = u"02:02:00:00:12:00" - - self.p2_dst_start_mac = u"02:02:00:00:02:00" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.3.231" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.3.231" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=3, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=3, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() - diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1000-8cnf.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1000-8cnf.py deleted file mode 100644 index a58df6e87b..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1000-8cnf.py +++ /dev/null @@ -1,157 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.3.231 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.3.231 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.p1_dst_start_mac = u"02:02:00:00:12:00" - - self.p2_dst_start_mac = u"02:02:00:00:02:00" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.3.231" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.3.231" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=7, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=7, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() - diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1000.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1000.py deleted file mode 100644 index 8d9ec21a25..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1000.py +++ /dev/null @@ -1,126 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.3.231 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.3.231 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.3.231" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.3.231" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - 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 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst10000-1cnf.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst10000-1cnf.py deleted file mode 100644 index 53e68de2b9..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst10000-1cnf.py +++ /dev/null @@ -1,157 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.39.15 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.39.15 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.p1_dst_start_mac = u"02:02:00:00:12:00" - - self.p2_dst_start_mac = u"02:02:00:00:02:00" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.39.15" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.39.15" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=0, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=0, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() - diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst10000-2cnf.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst10000-2cnf.py deleted file mode 100644 index ca3f41a6fb..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst10000-2cnf.py +++ /dev/null @@ -1,157 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.39.15 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.39.15 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.p1_dst_start_mac = u"02:02:00:00:12:00" - - self.p2_dst_start_mac = u"02:02:00:00:02:00" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.39.15" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.39.15" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=1, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=1, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() - diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst10000-4cnf.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst10000-4cnf.py deleted file mode 100644 index df7572853f..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst10000-4cnf.py +++ /dev/null @@ -1,157 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.39.15 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.39.15 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.p1_dst_start_mac = u"02:02:00:00:12:00" - - self.p2_dst_start_mac = u"02:02:00:00:02:00" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.39.15" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.39.15" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=3, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=3, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() - diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst10000-8cnf.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst10000-8cnf.py deleted file mode 100644 index 1dbd3feb1a..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst10000-8cnf.py +++ /dev/null @@ -1,157 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.39.15 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.39.15 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.p1_dst_start_mac = u"02:02:00:00:12:00" - - self.p2_dst_start_mac = u"02:02:00:00:02:00" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.39.15" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.39.15" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=7, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=7, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() - diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst10000.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst10000.py deleted file mode 100644 index 9f55ff71de..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst10000.py +++ /dev/null @@ -1,126 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.39.15 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.39.15 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.39.15" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.39.15" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - 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 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst100000.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst100000.py deleted file mode 100644 index ae36cf9995..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst100000.py +++ /dev/null @@ -1,126 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.1.134.159 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.1.134.159 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.1.134.159" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.1.134.159" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - 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 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1000000.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1000000.py deleted file mode 100644 index 8f6e5a0836..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1000000.py +++ /dev/null @@ -1,126 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.15.66.63 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.15.66.63 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.15.66.63" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.15.66.63" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - 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 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst20000-1cnf.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst20000-1cnf.py deleted file mode 100644 index f6f6fada5a..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst20000-1cnf.py +++ /dev/null @@ -1,157 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.78.31 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.78.31 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.p1_dst_start_mac = u"02:02:00:00:12:00" - - self.p2_dst_start_mac = u"02:02:00:00:02:00" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.78.31" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.78.31" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=0, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=0, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() - diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst20000-2cnf.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst20000-2cnf.py deleted file mode 100644 index 15cb461624..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst20000-2cnf.py +++ /dev/null @@ -1,157 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.78.31 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.78.31 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.p1_dst_start_mac = u"02:02:00:00:12:00" - - self.p2_dst_start_mac = u"02:02:00:00:02:00" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.78.31" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.78.31" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=1, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=1, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() - diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst20000-4cnf.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst20000-4cnf.py deleted file mode 100644 index 62eb1bee78..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst20000-4cnf.py +++ /dev/null @@ -1,157 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.78.31 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.78.31 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.p1_dst_start_mac = u"02:02:00:00:12:00" - - self.p2_dst_start_mac = u"02:02:00:00:02:00" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.78.31" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.78.31" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=3, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=3, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() - diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst20000-8cnf.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst20000-8cnf.py deleted file mode 100644 index b6eef29366..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst20000-8cnf.py +++ /dev/null @@ -1,157 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.78.31 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.78.31 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.p1_dst_start_mac = u"02:02:00:00:12:00" - - self.p2_dst_start_mac = u"02:02:00:00:02:00" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.78.31" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.78.31" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=7, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=7, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() - diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst20000.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst20000.py deleted file mode 100644 index 877e6cdc66..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst20000.py +++ /dev/null @@ -1,126 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.78.31 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.78.31 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.78.31" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.78.31" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - 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 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst253.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst253.py deleted file mode 100644 index e1e6a89af7..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst253.py +++ /dev/null @@ -1,126 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 20.20.20.2 - - Destination IP address range: 2.1.1.2 - 2.1.1.254 - - Direction 1 --> 0: - - Source IP address range: 10.10.10.2 - - Destination IP address range: 1.1.1.2 - 1.1.1.254 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"20.20.20.2" - self.p1_dst_start_ip = u"2.1.1.2" - self.p1_dst_end_ip = u"2.1.1.254" - - self.p2_src_start_ip = u"10.10.10.2" - self.p2_dst_start_ip = u"1.1.1.2" - self.p2_dst_end_ip = u"1.1.1.254" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - 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 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst253_l3fwd.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst253_l3fwd.py deleted file mode 100644 index 31e69e07ba..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst253_l3fwd.py +++ /dev/null @@ -1,126 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 20.20.20.2 - - Destination IP address range: 198.18.0.2 - 198.18.0.254 - - Direction 1 --> 0: - - Source IP address range: 10.10.10.2 - - Destination IP address range: 198.18.1.2 - 198.18.1.254 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"20.20.20.2" - self.p1_dst_start_ip = u"198.18.0.2" - self.p1_dst_end_ip = u"198.18.0.254" - - self.p2_src_start_ip = u"10.10.10.2" - self.p2_dst_start_ip = u"198.18.1.2" - self.p2_dst_end_ip = u"198.18.1.254" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - 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 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst4-1cnf.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst4-1cnf.py deleted file mode 100644 index b937d02741..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst4-1cnf.py +++ /dev/null @@ -1,157 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.0.3 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.0.3 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.p1_dst_start_mac = u"02:02:00:00:12:00" - - self.p2_dst_start_mac = u"02:02:00:00:02:00" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.0.3" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.0.3" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=0, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=0, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() - diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst4-2cnf.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst4-2cnf.py deleted file mode 100644 index b95649a94d..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst4-2cnf.py +++ /dev/null @@ -1,157 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.0.3 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.0.3 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.p1_dst_start_mac = u"02:02:00:00:12:00" - - self.p2_dst_start_mac = u"02:02:00:00:02:00" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.0.3" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.0.3" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=1, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=1, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() - diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst4-4cnf.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst4-4cnf.py deleted file mode 100644 index fed0d7ef3c..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst4-4cnf.py +++ /dev/null @@ -1,157 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.0.3 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.0.3 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.p1_dst_start_mac = u"02:02:00:00:12:00" - - self.p2_dst_start_mac = u"02:02:00:00:02:00" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.0.3" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.0.3" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=3, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=3, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() - diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst4.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst4.py deleted file mode 100644 index 9f14d4c929..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst4.py +++ /dev/null @@ -1,126 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.0.3 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.0.3 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.0.3" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.0.3" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - 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 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40-1cnf.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40-1cnf.py deleted file mode 100644 index d321d0ffb2..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40-1cnf.py +++ /dev/null @@ -1,157 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.0.39 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.0.39 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.p1_dst_start_mac = u"02:02:00:00:12:00" - - self.p2_dst_start_mac = u"02:02:00:00:02:00" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.0.39" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.0.39" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=0, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=0, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() - diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40-2cnf.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40-2cnf.py deleted file mode 100644 index acc565e776..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40-2cnf.py +++ /dev/null @@ -1,157 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.0.39 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.0.39 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.p1_dst_start_mac = u"02:02:00:00:12:00" - - self.p2_dst_start_mac = u"02:02:00:00:02:00" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.0.39" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.0.39" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=1, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=1, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() - diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40-4cnf.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40-4cnf.py deleted file mode 100644 index 629100cb83..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40-4cnf.py +++ /dev/null @@ -1,157 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.0.39 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.0.39 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.p1_dst_start_mac = u"02:02:00:00:12:00" - - self.p2_dst_start_mac = u"02:02:00:00:02:00" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.0.39" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.0.39" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=3, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=3, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() - diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40-8cnf.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40-8cnf.py deleted file mode 100644 index b51c98d7aa..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40-8cnf.py +++ /dev/null @@ -1,157 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.0.39 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.0.39 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.p1_dst_start_mac = u"02:02:00:00:12:00" - - self.p2_dst_start_mac = u"02:02:00:00:02:00" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.0.39" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.0.39" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=7, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=7, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() - diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40.py deleted file mode 100644 index 5dbc5fc803..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40.py +++ /dev/null @@ -1,126 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.0.39 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.0.39 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.0.39" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.0.39" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - 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 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst400-1cnf.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst400-1cnf.py deleted file mode 100644 index 1a004b055f..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst400-1cnf.py +++ /dev/null @@ -1,157 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.1.143 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.1.143 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.p1_dst_start_mac = u"02:02:00:00:12:00" - - self.p2_dst_start_mac = u"02:02:00:00:02:00" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.1.143" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.1.143" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=0, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=0, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() - diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst400-2cnf.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst400-2cnf.py deleted file mode 100644 index b09e79d7dc..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst400-2cnf.py +++ /dev/null @@ -1,157 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.1.143 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.1.143 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.p1_dst_start_mac = u"02:02:00:00:12:00" - - self.p2_dst_start_mac = u"02:02:00:00:02:00" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.1.143" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.1.143" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=1, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=1, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() - diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst400-4cnf.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst400-4cnf.py deleted file mode 100644 index 7081525771..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst400-4cnf.py +++ /dev/null @@ -1,157 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.1.143 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.1.143 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.p1_dst_start_mac = u"02:02:00:00:12:00" - - self.p2_dst_start_mac = u"02:02:00:00:02:00" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.1.143" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.1.143" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=3, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=3, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() - diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst400-8cnf.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst400-8cnf.py deleted file mode 100644 index c5b1d52e04..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst400-8cnf.py +++ /dev/null @@ -1,157 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.1.143 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.1.143 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.p1_dst_start_mac = u"02:02:00:00:12:00" - - self.p2_dst_start_mac = u"02:02:00:00:02:00" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.1.143" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.1.143" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=7, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=7, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() - diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst400.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst400.py deleted file mode 100644 index 44db3ec81c..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst400.py +++ /dev/null @@ -1,126 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.1.143 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.1.143 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.1.143" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.1.143" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - 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 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40000-1cnf.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40000-1cnf.py deleted file mode 100644 index 038b986b65..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40000-1cnf.py +++ /dev/null @@ -1,157 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.156.63 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.156.63 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.p1_dst_start_mac = u"02:02:00:00:12:00" - - self.p2_dst_start_mac = u"02:02:00:00:02:00" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.156.63" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.156.63" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=0, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=0, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() - diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40000-2cnf.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40000-2cnf.py deleted file mode 100644 index 5933b33d20..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40000-2cnf.py +++ /dev/null @@ -1,157 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.156.63 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.156.63 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.p1_dst_start_mac = u"02:02:00:00:12:00" - - self.p2_dst_start_mac = u"02:02:00:00:02:00" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.156.63" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.156.63" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=1, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=1, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() - diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40000-4cnf.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40000-4cnf.py deleted file mode 100644 index 851cd7c870..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40000-4cnf.py +++ /dev/null @@ -1,157 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.156.63 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.156.63 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.p1_dst_start_mac = u"02:02:00:00:12:00" - - self.p2_dst_start_mac = u"02:02:00:00:02:00" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.156.63" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.156.63" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=3, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=3, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() - diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40000-8cnf.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40000-8cnf.py deleted file mode 100644 index 40d57f09dd..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40000-8cnf.py +++ /dev/null @@ -1,157 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.156.63 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.156.63 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.p1_dst_start_mac = u"02:02:00:00:12:00" - - self.p2_dst_start_mac = u"02:02:00:00:02:00" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.156.63" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.156.63" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=7, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=7, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() - diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40000.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40000.py deleted file mode 100644 index 570a236fd6..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40000.py +++ /dev/null @@ -1,126 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.156.63 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.156.63 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.156.63" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.156.63" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - 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 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() \ No newline at end of file diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst5000-1cnf.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst5000-1cnf.py deleted file mode 100644 index fb4c61b030..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst5000-1cnf.py +++ /dev/null @@ -1,157 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.19.135 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.19.135 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.p1_dst_start_mac = u"02:02:00:00:12:00" - - self.p2_dst_start_mac = u"02:02:00:00:02:00" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.19.135" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.19.135" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=0, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=0, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() - diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst5000-2cnf.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst5000-2cnf.py deleted file mode 100644 index ca13c337cb..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst5000-2cnf.py +++ /dev/null @@ -1,157 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.19.135 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.19.135 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.p1_dst_start_mac = u"02:02:00:00:12:00" - - self.p2_dst_start_mac = u"02:02:00:00:02:00" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.19.135" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.19.135" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=1, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=1, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() - diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst5000-4cnf.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst5000-4cnf.py deleted file mode 100644 index 1ffd8c8ba5..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst5000-4cnf.py +++ /dev/null @@ -1,157 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.19.135 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.19.135 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.p1_dst_start_mac = u"02:02:00:00:12:00" - - self.p2_dst_start_mac = u"02:02:00:00:02:00" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.19.135" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.19.135" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=3, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=3, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() - diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst5000-8cnf.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst5000-8cnf.py deleted file mode 100644 index 26efc1a438..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst5000-8cnf.py +++ /dev/null @@ -1,157 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.19.135 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.19.135 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.p1_dst_start_mac = u"02:02:00:00:12:00" - - self.p2_dst_start_mac = u"02:02:00:00:02:00" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.19.135" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.19.135" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=7, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=7, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() - diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst5000.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst5000.py deleted file mode 100644 index 95d8380a22..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst5000.py +++ /dev/null @@ -1,126 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.19.135 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.19.135 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.19.135" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.19.135" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - 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 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() \ No newline at end of file diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst60000-1cnf.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst60000-1cnf.py deleted file mode 100644 index 251758ddae..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst60000-1cnf.py +++ /dev/null @@ -1,157 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.234.95 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.234.95 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.p1_dst_start_mac = u"02:02:00:00:12:00" - - self.p2_dst_start_mac = u"02:02:00:00:02:00" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.234.95" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.234.95" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=0, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=0, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() - diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst60000-2cnf.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst60000-2cnf.py deleted file mode 100644 index acebf6d06d..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst60000-2cnf.py +++ /dev/null @@ -1,157 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.234.95 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.234.95 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.p1_dst_start_mac = u"02:02:00:00:12:00" - - self.p2_dst_start_mac = u"02:02:00:00:02:00" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.234.95" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.234.95" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=1, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=1, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() - diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst60000-4cnf.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst60000-4cnf.py deleted file mode 100644 index 3fe3caf128..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst60000-4cnf.py +++ /dev/null @@ -1,157 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.234.95 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.234.95 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.p1_dst_start_mac = u"02:02:00:00:12:00" - - self.p2_dst_start_mac = u"02:02:00:00:02:00" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.234.95" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.234.95" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=3, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=3, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() - diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst60000-8cnf.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst60000-8cnf.py deleted file mode 100644 index 84bfb89f0b..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst60000-8cnf.py +++ /dev/null @@ -1,157 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.234.95 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.234.95 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.p1_dst_start_mac = u"02:02:00:00:12:00" - - self.p2_dst_start_mac = u"02:02:00:00:02:00" - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.234.95" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.234.95" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=7, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=7, - size=1, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset=5 - ), - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() - diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst60000.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst60000.py deleted file mode 100644 index 126302d545..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst60000.py +++ /dev/null @@ -1,126 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.0.0.1 - - Destination IP address range: 20.0.0.0 - 20.0.234.95 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.1 - - Destination IP address range: 10.0.0.0 - 10.0.234.95 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.1" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.234.95" - - self.p2_src_start_ip = u"20.0.0.1" - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.234.95" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - 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 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4src253.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4src253.py deleted file mode 100644 index 883883ad18..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4src253.py +++ /dev/null @@ -1,126 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.10.10.2 - 10.10.10.254 - - Destination IP address range: 20.20.20.2 - - Direction 1 --> 0: - - Source IP address range: 20.20.20.2 - 20.20.20.254 - - Destination IP address range: 10.10.10.2 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.10.10.2" - self.p1_src_end_ip = u"10.10.10.254" - self.p1_dst_start_ip = u"20.20.20.2" - - self.p2_src_start_ip = u"20.20.20.2" - self.p2_src_end_ip = u"20.20.20.254" - self.p2_dst_start_ip = u"10.10.10.2" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - 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 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4src254.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4src254.py deleted file mode 100644 index fc6167d126..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4src254.py +++ /dev/null @@ -1,126 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source IP address range: 10.10.10.1 - 10.10.10.254 - - Destination IP address range: 20.20.20.1 - - Direction 1 --> 0: - - Source IP address range: 20.20.20.1 - 20.20.20.254 - - Destination IP address range: 10.10.10.1 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.10.10.1" - self.p1_src_end_ip = u"10.10.10.254" - self.p1_dst_start_ip = u"20.20.20.1" - - self.p2_src_start_ip = u"20.20.20.1" - self.p2_src_end_ip = u"20.20.20.254" - self.p2_dst_start_ip = u"10.10.10.1" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - 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 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-macsrc100ip4src100.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-macsrc100ip4src100.py deleted file mode 100644 index b94c56ad6c..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-macsrc100ip4src100.py +++ /dev/null @@ -1,161 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: | ETH | IP | - - Direction 0 --> 1: - - Source MAC address range: ca:fe:00:00:00:00 - ca:fe:00:00:00:63 - - Source IP address range: 10.0.0.2 - 10.0.0.101 - - Destination IP address range: 20.0.0.1 - - Direction 1 --> 0: - - Source MAC address range: fa:ce:00:00:00:00 - fa:ce:00:00:00:63 - - Source IP address range: 20.0.0.2 - 20.0.0.101 - - Destination IP address range: 10.0.0.1 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.clients = 100 - - # MACs used in packet headers. - self.p1_src_start_mac = u"ca:fe:00:00:00:00" # mask: 00:00:FF:FF:FF:FF - - self.p2_src_start_mac = u"fa:ce:00:00:00:00" # mask: 00:00:FF:FF:FF:FF - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.2" - self.p1_src_end_ip = u"10.0.0.101" - self.p1_dst_start_ip = u"20.0.0.1" - - self.p2_src_start_ip = u"20.0.0.2" - self.p2_src_end_ip = u"20.0.0.101" - self.p2_dst_start_ip = u"10.0.0.1" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - src=self.p1_src_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - src=self.p2_src_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_src", - min_value=0, - max_value=self.clients-1, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_src", - pkt_offset=8 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_src", - min_value=0, - max_value=self.clients-1, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_src", - pkt_offset=8 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :returns: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-macsrc100kip4src100k.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-macsrc100kip4src100k.py deleted file mode 100644 index 52eb841ab0..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-macsrc100kip4src100k.py +++ /dev/null @@ -1,161 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: | ETH | IP | - - Direction 0 --> 1: - - Source MAC address range: ca:fe:00:00:00:00 - ca:fe:00:01:86:9f - - Source IP address range: 10.0.0.2 - 10.1.134.161 - - Destination IP address range: 20.0.0.1 - - Direction 1 --> 0: - - Source MAC address range: fa:ce:00:00:00:00 - fa:ce:00:01:86:9f - - Source IP address range: 20.0.0.2 - 20.1.134.161 - - Destination IP address range: 10.0.0.1 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.clients = 100000 - - # MACs used in packet headers. - self.p1_src_start_mac = u"ca:fe:00:00:00:00" # mask: 00:00:FF:FF:FF:FF - - self.p2_src_start_mac = u"fa:ce:00:00:00:00" # mask: 00:00:FF:FF:FF:FF - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.2" - self.p1_src_end_ip = u"10.1.134.161" - self.p1_dst_start_ip = u"20.0.0.1" - - self.p2_src_start_ip = u"20.0.0.2" - self.p2_src_end_ip = u"20.1.134.161" - self.p2_dst_start_ip = u"10.0.0.1" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - src=self.p1_src_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - src=self.p2_src_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_src", - min_value=0, - max_value=self.clients-1, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_src", - pkt_offset=8 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_src", - min_value=0, - max_value=self.clients-1, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_src", - pkt_offset=8 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :returns: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-macsrc10kip4src10k.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-macsrc10kip4src10k.py deleted file mode 100644 index 8e959c829d..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-macsrc10kip4src10k.py +++ /dev/null @@ -1,161 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: | ETH | IP | - - Direction 0 --> 1: - - Source MAC address range: ca:fe:00:00:00:00 - ca:fe:00:00:27:0f - - Source IP address range: 10.0.0.2 - 10.0.39.17 - - Destination IP address range: 20.0.0.1 - - Direction 1 --> 0: - - Source MAC address range: fa:ce:00:00:00:00 - fa:ce:00:00:27:0f - - Source IP address range: 20.0.0.2 - 20.0.39.17 - - Destination IP address range: 10.0.0.1 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.clients = 10000 - - # MACs used in packet headers. - self.p1_src_start_mac = u"ca:fe:00:00:00:00" # mask: 00:00:FF:FF:FF:FF - - self.p2_src_start_mac = u"fa:ce:00:00:00:00" # mask: 00:00:FF:FF:FF:FF - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.2" - self.p1_src_end_ip = u"10.0.39.17" - self.p1_dst_start_ip = u"20.0.0.1" - - self.p2_src_start_ip = u"20.0.0.2" - self.p2_src_end_ip = u"20.0.39.17" - self.p2_dst_start_ip = u"10.0.0.1" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - src=self.p1_src_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - src=self.p2_src_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_src", - min_value=0, - max_value=self.clients-1, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_src", - pkt_offset=8 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_src", - min_value=0, - max_value=self.clients-1, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_src", - pkt_offset=8 - ), - STLVmFlowVar( - name=u"src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"src", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :returns: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-macsrc500kdst500k.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-macsrc500kdst500k.py deleted file mode 100644 index da4348f2a0..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-macsrc500kdst500k.py +++ /dev/null @@ -1,215 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source MAC address range: ca:fe:00:00:00:00 - ca:fe:00:07:a1:1f - - Destination MAC address range: fa:ce:00:00:00:00 - fa:ce:00:07:a1:1f - - Source IP address range: 10.0.0.0 - 10.7.161.31 - - Destination IP address range: 20.0.0.0 - 20.7.161.31 - - Direction 1 --> 0: - - Source MAC address range: fa:ce:00:00:00:00 - fa:ce:00:07:a1:1f - - Destination MAC address range: ca:fe:00:00:00:00 - ca:fe:00:07:a1:1f - - Source IP address range: 20.0.0.0 - 20.7.161.31 - - Destination IP address range: 10.0.0.0 - 10.7.161.31 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.clients = 500000 - - # MACs used in packet headers. - self.p1_src_start_mac = u"ca:fe:00:00:00:00" # mask: 00:00:FF:FF:FF:FF - self.p1_dst_start_mac = u"fa:ce:00:00:00:00" # mask: 00:00:FF:FF:FF:FF - - self.p2_src_start_mac = u"fa:ce:00:00:00:00" # mask: 00:00:FF:FF:FF:FF - self.p2_dst_start_mac = u"ca:fe:00:00:00:00" # mask: 00:00:FF:FF:FF:FF - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.0" - self.p1_src_end_ip = u"10.7.161.31" - - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.7.161.31" - - self.p2_src_start_ip = u"20.0.0.0" - self.p2_src_end_ip = u"20.7.161.31" - - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.7.161.31" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - src=self.p1_src_start_mac, - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - src=self.p2_src_start_mac, - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_src", - min_value=0, - max_value=self.clients-1, - size=4, - op=u"inc" - ), - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=self.clients-1, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_src", - pkt_offset= 8 - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset= 2 - ), - STLVmFlowVar( - name=u"ip_src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ip_src", - pkt_offset=u"IP.src" - ), - STLVmFlowVar( - name=u"ip_dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ip_dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_src", - min_value=0, - max_value=self.clients-1, - size=4, - op=u"inc" - ), - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=self.clients-1, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_src", - pkt_offset= 8 - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset= 2 - ), - STLVmFlowVar( - name=u"ip_src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ip_src", - pkt_offset=u"IP.src" - ), - STLVmFlowVar( - name=u"ip_dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ip_dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-macsrc50kdst50k.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-macsrc50kdst50k.py deleted file mode 100644 index 6cf066367b..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-macsrc50kdst50k.py +++ /dev/null @@ -1,215 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source MAC address range: ca:fe:00:00:00:00 - ca:fe:00:00:c3:4f - - Destination MAC address range: fa:ce:00:00:00:00 - fa:ce:00:00:c3:4f - - Source IP address range: 10.0.0.0 - 10.0.195.79 - - Destination IP address range: 20.0.0.0 - 20.0.195.79 - - Direction 1 --> 0: - - Source MAC address range: fa:ce:00:00:00:00 - fa:ce:00:00:c3:4f - - Destination MAC address range: ca:fe:00:00:00:00 - ca:fe:00:00:c3:4f - - Source IP address range: 20.0.0.0 - 20.0.195.79 - - Destination IP address range: 10.0.0.0 - 10.0.195.79 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.clients = 50000 - - # MACs used in packet headers. - self.p1_src_start_mac = u"ca:fe:00:00:00:00" # mask: 00:00:FF:FF:FF:FF - self.p1_dst_start_mac = u"fa:ce:00:00:00:00" # mask: 00:00:FF:FF:FF:FF - - self.p2_src_start_mac = u"fa:ce:00:00:00:00" # mask: 00:00:FF:FF:FF:FF - self.p2_dst_start_mac = u"ca:fe:00:00:00:00" # mask: 00:00:FF:FF:FF:FF - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.0" - self.p1_src_end_ip = u"10.0.195.79" - - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.195.79" - - self.p2_src_start_ip = u"20.0.0.0" - self.p2_src_end_ip = u"20.0.195.79" - - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.195.79" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - src=self.p1_src_start_mac, - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - src=self.p2_src_start_mac, - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_src", - min_value=0, - max_value=self.clients-1, - size=4, - op=u"inc" - ), - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=self.clients-1, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_src", - pkt_offset= 8 - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset= 2 - ), - STLVmFlowVar( - name=u"ip_src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ip_src", - pkt_offset=u"IP.src" - ), - STLVmFlowVar( - name=u"ip_dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ip_dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_src", - min_value=0, - max_value=self.clients-1, - size=4, - op=u"inc" - ), - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=self.clients-1, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_src", - pkt_offset= 8 - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset= 2 - ), - STLVmFlowVar( - name=u"ip_src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ip_src", - pkt_offset=u"IP.src" - ), - STLVmFlowVar( - name=u"ip_dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ip_dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-macsrc5kdst5k.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-macsrc5kdst5k.py deleted file mode 100644 index 29df3373d3..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-macsrc5kdst5k.py +++ /dev/null @@ -1,215 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / - - Direction 0 --> 1: - - Source MAC address range: ca:fe:00:00:00:00 - ca:fe:00:00:13:87 - - Destination MAC address range: fa:ce:00:00:00:00 - fa:ce:00:00:13:87 - - Source IP address range: 10.0.0.0 - 10.0.19.135 - - Destination IP address range: 20.0.0.0 - 20.0.19.135 - - Direction 1 --> 0: - - Source MAC address range: fa:ce:00:00:00:00 - fa:ce:00:00:13:87 - - Destination MAC address range: ca:fe:00:00:00:00 - ca:fe:00:00:13:87 - - Source IP address range: 20.0.0.0 - 20.0.19.135 - - Destination IP address range: 10.0.0.0 - 10.0.19.135 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.clients = 5000 - - # MACs used in packet headers. - self.p1_src_start_mac = u"ca:fe:00:00:00:00" # mask: 00:00:FF:FF:FF:FF - self.p1_dst_start_mac = u"fa:ce:00:00:00:00" # mask: 00:00:FF:FF:FF:FF - - self.p2_src_start_mac = u"fa:ce:00:00:00:00" # mask: 00:00:FF:FF:FF:FF - self.p2_dst_start_mac = u"ca:fe:00:00:00:00" # mask: 00:00:FF:FF:FF:FF - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.0.0.0" - self.p1_src_end_ip = u"10.0.19.135" - - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.19.135" - - self.p2_src_start_ip = u"20.0.0.0" - self.p2_src_end_ip = u"20.0.19.135" - - self.p2_dst_start_ip = u"10.0.0.0" - self.p2_dst_end_ip = u"10.0.19.135" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - src=self.p1_src_start_mac, - dst=self.p1_dst_start_mac - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - src=self.p2_src_start_mac, - dst=self.p2_dst_start_mac - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_src", - min_value=0, - max_value=self.clients-1, - size=4, - op=u"inc" - ), - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=self.clients-1, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_src", - pkt_offset= 8 - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset= 2 - ), - STLVmFlowVar( - name=u"ip_src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ip_src", - pkt_offset=u"IP.src" - ), - STLVmFlowVar( - name=u"ip_dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ip_dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"mac_src", - min_value=0, - max_value=self.clients-1, - size=4, - op=u"inc" - ), - STLVmFlowVar( - name=u"mac_dst", - min_value=0, - max_value=self.clients-1, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"mac_src", - pkt_offset= 8 - ), - STLVmWrFlowVar( - fv_name=u"mac_dst", - pkt_offset= 2 - ), - STLVmFlowVar( - name=u"ip_src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ip_src", - pkt_offset=u"IP.src" - ), - STLVmFlowVar( - name=u"ip_dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ip_dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-1000u15p.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-1000u15p.py deleted file mode 100644 index b7b364f195..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-1000u15p.py +++ /dev/null @@ -1,148 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / UDP - - Direction 0 --> 1: - - Source IP address range: 20.0.0.0 - 20.0.3.231 - - Destination IP address range: 12.0.0.2 - - Source UDP port range: 1024 - 1038 - - Destination UDP port range: 1024 - - Direction 1 --> 0: - - Source IP address range: 12.0.0.2 - - Destination IP address range: 200.0.0.0 - - Source UDP port range: 1024 - - Destination UDP port range: 1024 - 16023 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"20.0.0.0" - self.p1_src_end_ip = u"20.0.3.231" - self.p1_dst_start_ip = u"12.0.0.2" - - self.p2_src_start_ip = u"12.0.0.2" - self.p2_src_end_ip = u"12.0.0.2" - self.p2_dst_start_ip = u"200.0.0.0" - - # UDP ports used in packet headers. - self.p1_src_start_udp_port = 1024 - self.p1_src_end_udp_port = 1038 - self.p1_dst_start_udp_port = 1024 - - self.p2_src_start_udp_port = 1024 - self.p2_dst_start_udp_port = 1024 - self.p2_dst_end_udp_port = 16023 - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | UDP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=17 - ) / - UDP( - sport=self.p1_src_start_udp_port, - dport=self.p1_dst_start_udp_port - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=17 - ) / - UDP( - sport=self.p2_src_start_udp_port, - dport=self.p2_dst_start_udp_port - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmTupleGen( - ip_min=self.p1_src_start_ip, - ip_max=self.p1_src_end_ip, - port_min=self.p1_src_start_udp_port, - port_max=self.p1_src_end_udp_port, - name=u"tuple" - ), - STLVmWrFlowVar( - fv_name=u"tuple.ip", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ), - STLVmWrFlowVar( - fv_name=u"tuple.port", - pkt_offset=u"UDP.sport" - ) - ] - ) - # Direction 0 --> 1 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"dport", - min_value=self.p2_dst_start_udp_port, - max_value=self.p2_dst_end_udp_port, - size=2, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dport", - pkt_offset=u"UDP.dport" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-100u1000p-conc.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-100u1000p-conc.py deleted file mode 100644 index b93cd645ae..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-100u1000p-conc.py +++ /dev/null @@ -1,189 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / UDP - - Direction 0 --> 1: - - Source IP address range: 10.10.10.2 - 10.10.10.101 - - Destination IP address range: 20.20.20.2 - 20.20.20.101 - - Source UDP port range: 1001 - 2000 - - Destination UDP port range: 2001 - 3000 - - Direction 1 --> 0: - - Source IP address range: 20.20.20.2 - 20.20.20.101 - - Destination IP address range: 10.10.10.2 - 10.10.10.101 - - Source UDP port range: 2001 - 3000 - - Destination UDP port range: 1001 - 2000 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.10.10.2" - self.p1_src_end_ip = u"10.10.10.101" - self.p1_dst_start_ip = u"20.20.20.2" - self.p1_dst_end_ip = u"20.20.20.101" - - self.p2_src_start_ip = u"20.20.20.2" - self.p2_src_end_ip = u"20.20.20.101" - self.p2_dst_start_ip = u"10.10.10.2" - self.p2_dst_end_ip = u"10.10.10.101" - - # UDP ports used in packet headers. - self.p1_src_start_udp_port = 1001 - self.p1_src_end_udp_port = 2000 - self.p1_dst_start_udp_port = 2001 - self.p1_dst_end_udp_port = 3000 - - self.p2_src_start_udp_port = 2001 - self.p2_src_end_udp_port = 3000 - self.p2_dst_start_udp_port = 1001 - self.p2_dst_end_udp_port = 2000 - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | UDP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=17 - ) / - UDP( - sport=self.p1_src_start_udp_port, - dport=self.p1_dst_start_udp_port - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=17 - ) / - UDP( - sport=self.p2_src_start_udp_port, - dport=self.p2_dst_start_udp_port - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmTupleGen( - ip_min=self.p1_src_start_ip, - ip_max=self.p1_src_end_ip, - port_min=self.p1_src_start_udp_port, - port_max=self.p1_src_end_udp_port, - name=u"tuple1_src" - ), - STLVmTupleGen( - ip_min=self.p1_dst_start_ip, - ip_max=self.p1_dst_end_ip, - port_min=self.p1_dst_start_udp_port, - port_max=self.p1_dst_end_udp_port, - name=u"tuple1_dst" - ), - STLVmWrFlowVar( - fv_name=u"tuple1_src.ip", - pkt_offset=u"IP.src" - ), - STLVmWrFlowVar( - fv_name=u"tuple1_dst.ip", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ), - STLVmWrFlowVar( - fv_name=u"tuple1_src.port", - pkt_offset=u"UDP.sport" - ), - STLVmWrFlowVar( - fv_name=u"tuple1_dst.port", - pkt_offset=u"UDP.dport" - ) - ] - ) - # Direction 0 --> 1 - vm2 = STLScVmRaw( - [ - STLVmTupleGen( - ip_min=self.p2_src_start_ip, - ip_max=self.p2_src_end_ip, - port_min=self.p2_src_start_udp_port, - port_max=self.p2_src_end_udp_port, - name=u"tuple2_src" - ), - STLVmTupleGen( - ip_min=self.p2_dst_start_ip, - ip_max=self.p2_dst_end_ip, - port_min=self.p2_dst_start_udp_port, - port_max=self.p2_dst_end_udp_port, - name=u"tuple2_dst" - ), - STLVmWrFlowVar( - fv_name=u"tuple2_src.ip", - pkt_offset=u"IP.src" - ), - STLVmWrFlowVar( - fv_name=u"tuple2_dst.ip", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ), - STLVmWrFlowVar( - fv_name=u"tuple2_src.port", - pkt_offset=u"UDP.sport" - ), - STLVmWrFlowVar( - fv_name=u"tuple2_dst.port", - pkt_offset=u"UDP.dport" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-100u15p.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-100u15p.py deleted file mode 100644 index 31cdc5e628..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-100u15p.py +++ /dev/null @@ -1,148 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / UDP - - Direction 0 --> 1: - - Source IP address range: 20.0.0.0 - 20.0.0.99 - - Destination IP address range: 12.0.0.2 - - Source UDP port range: 1024 - 1038 - - Destination UDP port range: 1024 - - Direction 1 --> 0: - - Source IP address range: 12.0.0.2 - - Destination IP address range: 200.0.0.0 - - Source UDP port range: 1024 - - Destination UDP port range: 1024 - 2523 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"20.0.0.0" - self.p1_src_end_ip = u"20.0.0.99" - self.p1_dst_start_ip = u"12.0.0.2" - - self.p2_src_start_ip = u"12.0.0.2" - self.p2_src_end_ip = u"12.0.0.2" - self.p2_dst_start_ip = u"200.0.0.0" - - # UDP ports used in packet headers. - self.p1_src_start_udp_port = 1024 - self.p1_src_end_udp_port = 1038 - self.p1_dst_start_udp_port = 1024 - - self.p2_src_start_udp_port = 1024 - self.p2_dst_start_udp_port = 1024 - self.p2_dst_end_udp_port = 2523 - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | UDP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=17 - ) / - UDP( - sport=self.p1_src_start_udp_port, - dport=self.p1_dst_start_udp_port - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=17 - ) / - UDP( - sport=self.p2_src_start_udp_port, - dport=self.p2_dst_start_udp_port - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmTupleGen( - ip_min=self.p1_src_start_ip, - ip_max=self.p1_src_end_ip, - port_min=self.p1_src_start_udp_port, - port_max=self.p1_src_end_udp_port, - name=u"tuple" - ), - STLVmWrFlowVar( - fv_name=u"tuple.ip", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ), - STLVmWrFlowVar( - fv_name=u"tuple.port", - pkt_offset=u"UDP.sport" - ) - ] - ) - # Direction 0 --> 1 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"dport", - min_value=self.p2_dst_start_udp_port, - max_value=self.p2_dst_end_udp_port, - size=2, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dport", - pkt_offset=u"UDP.dport" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-10u1000p-conc.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-10u1000p-conc.py deleted file mode 100644 index 9032a8c2f5..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-10u1000p-conc.py +++ /dev/null @@ -1,189 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / UDP - - Direction 0 --> 1: - - Source IP address range: 10.10.10.2 - 10.10.10.11 - - Destination IP address range: 20.20.20.2 - 20.20.20.11 - - Source UDP port range: 1001 - 2000 - - Destination UDP port range: 2001 - 3000 - - Direction 1 --> 0: - - Source IP address range: 20.20.20.2 - 20.20.20.11 - - Destination IP address range: 10.10.10.2 - 10.10.10.11 - - Source UDP port range: 2001 - 3000 - - Destination UDP port range: 1001 - 2000 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.10.10.2" - self.p1_src_end_ip = u"10.10.10.11" - self.p1_dst_start_ip = u"20.20.20.2" - self.p1_dst_end_ip = u"20.20.20.11" - - self.p2_src_start_ip = u"20.20.20.2" - self.p2_src_end_ip = u"20.20.20.11" - self.p2_dst_start_ip = u"10.10.10.2" - self.p2_dst_end_ip = u"10.10.10.11" - - # UDP ports used in packet headers. - self.p1_src_start_udp_port = 1001 - self.p1_src_end_udp_port = 2000 - self.p1_dst_start_udp_port = 2001 - self.p1_dst_end_udp_port = 3000 - - self.p2_src_start_udp_port = 2001 - self.p2_src_end_udp_port = 3000 - self.p2_dst_start_udp_port = 1001 - self.p2_dst_end_udp_port = 2000 - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | UDP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=17 - ) / - UDP( - sport=self.p1_src_start_udp_port, - dport=self.p1_dst_start_udp_port - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=17 - ) / - UDP( - sport=self.p2_src_start_udp_port, - dport=self.p2_dst_start_udp_port - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmTupleGen( - ip_min=self.p1_src_start_ip, - ip_max=self.p1_src_end_ip, - port_min=self.p1_src_start_udp_port, - port_max=self.p1_src_end_udp_port, - name=u"tuple1_src" - ), - STLVmTupleGen( - ip_min=self.p1_dst_start_ip, - ip_max=self.p1_dst_end_ip, - port_min=self.p1_dst_start_udp_port, - port_max=self.p1_dst_end_udp_port, - name=u"tuple1_dst" - ), - STLVmWrFlowVar( - fv_name=u"tuple1_src.ip", - pkt_offset=u"IP.src" - ), - STLVmWrFlowVar( - fv_name=u"tuple1_dst.ip", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ), - STLVmWrFlowVar( - fv_name=u"tuple1_src.port", - pkt_offset=u"UDP.sport" - ), - STLVmWrFlowVar( - fv_name=u"tuple1_dst.port", - pkt_offset=u"UDP.dport" - ) - ] - ) - # Direction 0 --> 1 - vm2 = STLScVmRaw( - [ - STLVmTupleGen( - ip_min=self.p2_src_start_ip, - ip_max=self.p2_src_end_ip, - port_min=self.p2_src_start_udp_port, - port_max=self.p2_src_end_udp_port, - name=u"tuple2_src" - ), - STLVmTupleGen( - ip_min=self.p2_dst_start_ip, - ip_max=self.p2_dst_end_ip, - port_min=self.p2_dst_start_udp_port, - port_max=self.p2_dst_end_udp_port, - name=u"tuple2_dst" - ), - STLVmWrFlowVar( - fv_name=u"tuple2_src.ip", - pkt_offset=u"IP.src" - ), - STLVmWrFlowVar( - fv_name=u"tuple2_dst.ip", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ), - STLVmWrFlowVar( - fv_name=u"tuple2_src.port", - pkt_offset=u"UDP.sport" - ), - STLVmWrFlowVar( - fv_name=u"tuple2_dst.port", - pkt_offset=u"UDP.dport" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-10u10p-conc.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-10u10p-conc.py deleted file mode 100644 index 29433b3d27..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-10u10p-conc.py +++ /dev/null @@ -1,189 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / UDP - - Direction 0 --> 1: - - Source IP address range: 10.10.10.2 - 10.10.10.11 - - Destination IP address range: 20.20.20.2 - 20.20.2011 - - Source UDP port range: 1001 - 1010 - - Destination UDP port range: 2001 - 2010 - - Direction 1 --> 0: - - Source IP address range: 20.20.20.2 - 20.20.20.11 - - Destination IP address range: 10.10.10.2 - 10.10.10.11 - - Source UDP port range: 2001 - 2010 - - Destination UDP port range: 1001 - 1010 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.10.10.2" - self.p1_src_end_ip = u"10.10.10.11" - self.p1_dst_start_ip = u"20.20.20.2" - self.p1_dst_end_ip = u"20.20.20.11" - - self.p2_src_start_ip = u"20.20.20.2" - self.p2_src_end_ip = u"20.20.20.11" - self.p2_dst_start_ip = u"10.10.10.2" - self.p2_dst_end_ip = u"10.10.10.11" - - # UDP ports used in packet headers. - self.p1_src_start_udp_port = 1001 - self.p1_src_end_udp_port = 1010 - self.p1_dst_start_udp_port = 2001 - self.p1_dst_end_udp_port = 2010 - - self.p2_src_start_udp_port = 2001 - self.p2_src_end_udp_port = 2010 - self.p2_dst_start_udp_port = 1001 - self.p2_dst_end_udp_port = 1010 - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | UDP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=17 - ) / - UDP( - sport=self.p1_src_start_udp_port, - dport=self.p1_dst_start_udp_port - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=17 - ) / - UDP( - sport=self.p2_src_start_udp_port, - dport=self.p2_dst_start_udp_port - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmTupleGen( - ip_min=self.p1_src_start_ip, - ip_max=self.p1_src_end_ip, - port_min=self.p1_src_start_udp_port, - port_max=self.p1_src_end_udp_port, - name=u"tuple1_src" - ), - STLVmTupleGen( - ip_min=self.p1_dst_start_ip, - ip_max=self.p1_dst_end_ip, - port_min=self.p1_dst_start_udp_port, - port_max=self.p1_dst_end_udp_port, - name=u"tuple1_dst" - ), - STLVmWrFlowVar( - fv_name=u"tuple1_src.ip", - pkt_offset=u"IP.src" - ), - STLVmWrFlowVar( - fv_name=u"tuple1_dst.ip", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ), - STLVmWrFlowVar( - fv_name=u"tuple1_src.port", - pkt_offset=u"UDP.sport" - ), - STLVmWrFlowVar( - fv_name=u"tuple1_dst.port", - pkt_offset=u"UDP.dport" - ) - ] - ) - # Direction 0 --> 1 - vm2 = STLScVmRaw( - [ - STLVmTupleGen( - ip_min=self.p2_src_start_ip, - ip_max=self.p2_src_end_ip, - port_min=self.p2_src_start_udp_port, - port_max=self.p2_src_end_udp_port, - name=u"tuple2_src" - ), - STLVmTupleGen( - ip_min=self.p2_dst_start_ip, - ip_max=self.p2_dst_end_ip, - port_min=self.p2_dst_start_udp_port, - port_max=self.p2_dst_end_udp_port, - name=u"tuple2_dst" - ), - STLVmWrFlowVar( - fv_name=u"tuple2_src.ip", - pkt_offset=u"IP.src" - ), - STLVmWrFlowVar( - fv_name=u"tuple2_dst.ip", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ), - STLVmWrFlowVar( - fv_name=u"tuple2_src.port", - pkt_offset=u"UDP.sport" - ), - STLVmWrFlowVar( - fv_name=u"tuple2_dst.port", - pkt_offset=u"UDP.dport" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-10u15p.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-10u15p.py deleted file mode 100644 index 57c5b2dcbc..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-10u15p.py +++ /dev/null @@ -1,148 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / UDP - - Direction 0 --> 1: - - Source IP address range: 20.0.0.0 - 20.0.0.9 - - Destination IP address range: 12.0.0.2 - - Source UDP port range: 1024 - 1038 - - Destination UDP port range: 1024 - - Direction 1 --> 0: - - Source IP address range: 12.0.0.2 - - Destination IP address range: 200.0.0.0 - - Source UDP port range: 1024 - - Destination UDP port range: 1024 - 1173 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"20.0.0.0" - self.p1_src_end_ip = u"20.0.0.9" - self.p1_dst_start_ip = u"12.0.0.2" - - self.p2_src_start_ip = u"12.0.0.2" - #self.p2_src_end_ip = u"12.0.0.2" - self.p2_dst_start_ip = u"200.0.0.0" - - # UDP ports used in packet headers. - self.p1_src_start_udp_port = 1024 - self.p1_src_end_udp_port = 1038 - self.p1_dst_start_udp_port = 1024 - - self.p2_src_start_udp_port = 1024 - self.p2_dst_start_udp_port = 1024 - self.p2_dst_end_udp_port = 1173 - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | UDP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=17 - ) / - UDP( - sport=self.p1_src_start_udp_port, - dport=self.p1_dst_start_udp_port - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=17 - ) / - UDP( - sport=self.p2_src_start_udp_port, - dport=self.p2_dst_start_udp_port - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmTupleGen( - ip_min=self.p1_src_start_ip, - ip_max=self.p1_src_end_ip, - port_min=self.p1_src_start_udp_port, - port_max=self.p1_src_end_udp_port, - name=u"tuple" - ), - STLVmWrFlowVar( - fv_name=u"tuple.ip", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ), - STLVmWrFlowVar( - fv_name=u"tuple.port", - pkt_offset=u"UDP.sport" - ) - ] - ) - # Direction 0 --> 1 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"dport", - min_value=self.p2_dst_start_udp_port, - max_value=self.p2_dst_end_udp_port, - size=2, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dport", - pkt_offset=u"UDP.dport" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-1u15p.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-1u15p.py deleted file mode 100644 index df9a1642a9..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-1u15p.py +++ /dev/null @@ -1,141 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / UDP - - Direction 0 --> 1: - - Source IP address range: 20.0.0.0 - - Destination IP address range: 12.0.0.2 - - Source UDP port range: 1024 - 1038 - - Destination UDP port range: 1024 - - Direction 1 --> 0: - - Source IP address range: 12.0.0.2 - - Destination IP address range: 200.0.0.0 - - Source UDP port range: 1024 - - Destination UDP port range: 1024 - 1038 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"20.0.0.0" - self.p1_src_end_ip = u"20.0.0.0" - self.p1_dst_start_ip = u"12.0.0.2" - - self.p2_src_start_ip = u"12.0.0.2" - self.p2_src_end_ip = u"12.0.0.2" - self.p2_dst_start_ip = u"200.0.0.0" - - # UDP ports used in packet headers. - self.p1_src_start_udp_port = 1024 - self.p1_src_end_udp_port = 1038 - self.p1_dst_start_udp_port = 1024 - - self.p2_src_start_udp_port = 1024 - self.p2_dst_start_udp_port = 1024 - self.p2_dst_end_udp_port = 1038 - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | UDP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=17 - ) / - UDP( - sport=self.p1_src_start_udp_port, - dport=self.p1_dst_start_udp_port - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=17 - ) / - UDP( - sport=self.p2_src_start_udp_port, - dport=self.p2_dst_start_udp_port - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"sport", - min_value=self.p1_src_start_udp_port, - max_value=self.p1_src_end_udp_port, - size=2, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"sport", - pkt_offset=u"UDP.sport" - ) - ] - ) - # Direction 0 --> 1 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"dport", - min_value=self.p2_dst_start_udp_port, - max_value=self.p2_dst_end_udp_port, - size=2, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dport", - pkt_offset=u"UDP.dport" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-1u1p.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-1u1p.py deleted file mode 100644 index a892ec8822..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-1u1p.py +++ /dev/null @@ -1,104 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / UDP - - Direction 0 --> 1: - - Source IP address range: 20.0.0.0 - - Destination IP address range: 12.0.0.2 - - Source UDP port range: 1024 - - Destination UDP port range: 1024 - - Direction 1 --> 0: - - Source IP address range: 12.0.0.2 - - Destination IP address range: 200.0.0.0 - - Source UDP port range: 1024 - - Destination UDP port range: 1028 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_ip = u"20.0.0.0" - self.p1_dst_ip = u"12.0.0.2" - - self.p2_src_ip = u"12.0.0.2" - self.p2_dst_ip = u"200.0.0.0" - - # UDP ports used in packet headers. - self.p1_src_udp_port = 1024 - self.p1_dst_udp_port = 1024 - - self.p2_src_udp_port = 1024 - self.p2_dst_udp_port = 1028 - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | UDP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IP( - src=self.p1_src_ip, - dst=self.p1_dst_ip, - proto=17 - ) / - UDP( - sport=self.p1_src_udp_port, - dport=self.p1_dst_udp_port - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - IP( - src=self.p2_src_ip, - dst=self.p2_dst_ip, - proto=17 - ) / - UDP( - sport=self.p2_src_udp_port, - dport=self.p2_dst_udp_port - ) - ) - - return base_pkt_a, base_pkt_b, None, None - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-2000u15p.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-2000u15p.py deleted file mode 100644 index c96f76aaee..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-2000u15p.py +++ /dev/null @@ -1,148 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / UDP - - Direction 0 --> 1: - - Source IP address range: 20.0.0.0 - 20.0.7.207 - - Destination IP address range: 12.0.0.2 - - Source UDP port range: 1024 - 1038 - - Destination UDP port range: 1024 - - Direction 1 --> 0: - - Source IP address range: 12.0.0.2 - - Destination IP address range: 200.0.0.0 - - Source UDP port range: 1024 - - Destination UDP port range: 1024 - 31022 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"20.0.0.0" - self.p1_src_end_ip = u"20.0.7.207" - self.p1_dst_start_ip = u"12.0.0.2" - - self.p2_src_start_ip = u"12.0.0.2" - self.p2_src_end_ip = u"12.0.0.2" - self.p2_dst_start_ip = u"200.0.0.0" - - # UDP ports used in packet headers. - self.p1_src_start_udp_port = 1024 - self.p1_src_end_udp_port = 1038 - self.p1_dst_start_udp_port = 1024 - - self.p2_src_start_udp_port = 1024 - self.p2_dst_start_udp_port = 1024 - self.p2_dst_end_udp_port = 31022 - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | UDP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=17 - ) / - UDP( - sport=self.p1_src_start_udp_port, - dport=self.p1_dst_start_udp_port - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=17 - ) / - UDP( - sport=self.p2_src_start_udp_port, - dport=self.p2_dst_start_udp_port - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmTupleGen( - ip_min=self.p1_src_start_ip, - ip_max=self.p1_src_end_ip, - port_min=self.p1_src_start_udp_port, - port_max=self.p1_src_end_udp_port, - name=u"tuple" - ), - STLVmWrFlowVar( - fv_name=u"tuple.ip", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ), - STLVmWrFlowVar( - fv_name=u"tuple.port", - pkt_offset=u"UDP.sport" - ) - ] - ) - # Direction 0 --> 1 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"dport", - min_value=self.p2_dst_start_udp_port, - max_value=self.p2_dst_end_udp_port, - size=2, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dport", - pkt_offset=u"UDP.dport" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-4000u15p.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-4000u15p.py deleted file mode 100644 index c1b3d5ba59..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-4000u15p.py +++ /dev/null @@ -1,148 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / UDP - - Direction 0 --> 1: - - Source IP address range: 20.0.0.0 - 20.0.15.159 - - Destination IP address range: 12.0.0.2 - - Source UDP port range: 1024 - 1038 - - Destination UDP port range: 1024 - - Direction 1 --> 0: - - Source IP address range: 12.0.0.2 - - Destination IP address range: 200.0.0.0 - - Source UDP port range: 1024 - - Destination UDP port range: 1024 - 61022 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"20.0.0.0" - self.p1_src_end_ip = u"20.0.15.159" - self.p1_dst_start_ip = u"12.0.0.2" - - self.p2_src_start_ip = u"12.0.0.2" - self.p2_src_end_ip = u"12.0.0.2" - self.p2_dst_start_ip = u"200.0.0.0" - - # UDP ports used in packet headers. - self.p1_src_start_udp_port = 1024 - self.p1_src_end_udp_port = 1038 - self.p1_dst_start_udp_port = 1024 - - self.p2_src_start_udp_port = 1024 - self.p2_dst_start_udp_port = 1024 - self.p2_dst_end_udp_port = 61022 - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | UDP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=17 - ) / - UDP( - sport=self.p1_src_start_udp_port, - dport=self.p1_dst_start_udp_port - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=17 - ) / - UDP( - sport=self.p2_src_start_udp_port, - dport=self.p2_dst_start_udp_port - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmTupleGen( - ip_min=self.p1_src_start_ip, - ip_max=self.p1_src_end_ip, - port_min=self.p1_src_start_udp_port, - port_max=self.p1_src_end_udp_port, - name=u"tuple" - ), - STLVmWrFlowVar( - fv_name=u"tuple.ip", - pkt_offset=u"IP.src" - ), - STLVmFixIpv4( - offset=u"IP" - ), - STLVmWrFlowVar( - fv_name=u"tuple.port", - pkt_offset=u"UDP.sport" - ) - ] - ) - # Direction 0 --> 1 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"dport", - min_value=self.p2_dst_start_udp_port, - max_value=self.p2_dst_end_udp_port, - size=2, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"dport", - pkt_offset=u"UDP.dport" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip6-ip6dst10000.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip6-ip6dst10000.py deleted file mode 100644 index f1b90350fb..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip6-ip6dst10000.py +++ /dev/null @@ -1,129 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IPv6 / - - Direction 0 --> 1: - - Source IP address range: 2001:1::1 - - Destination IP address range: 2001:2::0 - 2001:2::270F - - Direction 1 --> 0: - - Source IP address range: 2001:2::1 - - Destination IP address range: 2001:1::0 - 2001:1::270F -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"2001:1::1" - self.p1_dst_start_ip = u"2001:2::0" - self.p1_dst_end_ip = u"2001:2::270F" - - self.p2_src_start_ip = u"2001:2::1" - self.p2_dst_start_ip = u"2001:1::0" - self.p2_dst_end_ip = u"2001:1::270F" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IPv6 | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - base_p1, count_p1 = self._get_start_end_ipv6( - self.p1_dst_start_ip, - self.p1_dst_end_ip - ) - base_p2, count_p2 = self._get_start_end_ipv6( - self.p2_dst_start_ip, - self.p2_dst_end_ip - ) - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IPv6( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - IPv6( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"ipv6_dst", - min_value=base_p1, - max_value=base_p1 + count_p1, - size=8, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ipv6_dst", - pkt_offset=u"IPv6.dst", - offset_fixup=8 - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"ipv6_dst", - min_value=base_p2, - max_value=base_p2 + count_p2, - size=8, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ipv6_dst", - pkt_offset=u"IPv6.dst", - offset_fixup=8 - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip6-ip6dst100000.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip6-ip6dst100000.py deleted file mode 100644 index 87e76726b2..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip6-ip6dst100000.py +++ /dev/null @@ -1,129 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IPv6 / - - Direction 0 --> 1: - - Source IP address range: 2001:1::1 - - Destination IP address range: 2001:2::0 - 2001:2::1:869F - - Direction 1 --> 0: - - Source IP address range: 2001:2::1 - - Destination IP address range: 2001:1::0 - 2001:1::1:869F -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"2001:1::1" - self.p1_dst_start_ip = u"2001:2::0" - self.p1_dst_end_ip = u"2001:2::1:869F" - - self.p2_src_start_ip = u"2001:2::1" - self.p2_dst_start_ip = u"2001:1::0" - self.p2_dst_end_ip = u"2001:1::1:869F" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IPv6 | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - base_p1, count_p1 = self._get_start_end_ipv6( - self.p1_dst_start_ip, - self.p1_dst_end_ip - ) - base_p2, count_p2 = self._get_start_end_ipv6( - self.p2_dst_start_ip, - self.p2_dst_end_ip - ) - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IPv6( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - IPv6( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"ipv6_dst", - min_value=base_p1, - max_value=base_p1 + count_p1, - size=8, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ipv6_dst", - pkt_offset=u"IPv6.dst", - offset_fixup=8 - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"ipv6_dst", - min_value=base_p2, - max_value=base_p2 + count_p2, - size=8, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ipv6_dst", - pkt_offset=u"IPv6.dst", - offset_fixup=8 - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip6-ip6dst1000000.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip6-ip6dst1000000.py deleted file mode 100644 index c6870d89fa..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip6-ip6dst1000000.py +++ /dev/null @@ -1,129 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IPv6 / - - Direction 0 --> 1: - - Source IP address range: 2001:1::1 - - Destination IP address range: 2001:2::0 - 2001:2::F:423F - - Direction 1 --> 0: - - Source IP address range: 2001:2::1 - - Destination IP address range: 2001:1::0 - 2001:1::F:423F -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"2001:1::1" - self.p1_dst_start_ip = u"2001:2::0" - self.p1_dst_end_ip = u"2001:2::F:423F" - - self.p2_src_start_ip = u"2001:2::1" - self.p2_dst_start_ip = u"2001:1::0" - self.p2_dst_end_ip = u"2001:1::F:423F" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IPv6 | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - base_p1, count_p1 = self._get_start_end_ipv6( - self.p1_dst_start_ip, - self.p1_dst_end_ip - ) - base_p2, count_p2 = self._get_start_end_ipv6( - self.p2_dst_start_ip, - self.p2_dst_end_ip - ) - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IPv6( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - IPv6( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"ipv6_dst", - min_value=base_p1, - max_value=base_p1 + count_p1, - size=8, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ipv6_dst", - pkt_offset=u"IPv6.dst", - offset_fixup=8 - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"ipv6_dst", - min_value=base_p2, - max_value=base_p2 + count_p2, - size=8, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ipv6_dst", - pkt_offset=u"IPv6.dst", - offset_fixup=8 - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-3n-ethip6-ip6src253.py b/GPL/traffic_profiles/trex/trex-sl-3n-ethip6-ip6src253.py deleted file mode 100644 index fbe8b94ab3..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-3n-ethip6-ip6src253.py +++ /dev/null @@ -1,129 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IPv6 / - - Direction 0 --> 1: - - Source IP address range: 2001:1::2 - 2001:1::FE - - Destination IP address range: 2001:2::2 - - Direction 1 --> 0: - - Source IP address range: 2001:2::2 - 2001:2::FE - - Destination IP address range: 2001:1::2 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"2001:1::2" - self.p1_src_end_ip = u"2001:1::FE" - self.p1_dst_start_ip = u"2001:2::2" - - self.p2_src_start_ip = u"2001:2::2" - self.p2_src_end_ip = u"2001:2::FE" - self.p2_dst_start_ip = u"2001:1::2" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IPv6 | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - base_p1, count_p1 = self._get_start_end_ipv6( - self.p1_src_start_ip, - self.p1_src_end_ip - ) - base_p2, count_p2 = self._get_start_end_ipv6( - self.p2_src_start_ip, - self.p2_src_end_ip - ) - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IPv6( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - IPv6( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"ipv6_src", - min_value=base_p1, - max_value=base_p1 + count_p1, - size=8, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ipv6_src", - pkt_offset=u"IPv6.src", - offset_fixup=8 - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"ipv6_src", - min_value=base_p2, - max_value=base_p2 + count_p2, - size=8, - op=u"inc" - ), - STLVmWrFlowVar( - fv_name=u"ipv6_src", - pkt_offset=u"IPv6.src", - offset_fixup=8 - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-dot1qip4-vlan1ip4src254ip4dst254-bvi.py b/GPL/traffic_profiles/trex/trex-sl-dot1qip4-vlan1ip4src254ip4dst254-bvi.py deleted file mode 100644 index 28ec10bf8b..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-dot1qip4-vlan1ip4src254ip4dst254-bvi.py +++ /dev/null @@ -1,170 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / DOT1Q / IP / - - Direction 0 --> 1: - - Destination MAC address: ba:dc:00:ff:ee:01 - - VLAN range: 100 - - Source IP address range: 10.10.10.1 - 10.10.10.254 - - Destination IP address range: 20.20.20.1 - 20.20.20.254 - - Direction 1 --> 0: - - Destination MAC address: ba:dc:00:ff:ee:01 - - VLAN range: 200 - - Source IP address range: 20.20.20.1 - 20.20.20.254 - - Destination IP address range: 10.10.10.1 - 10.10.10.254 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # VLAN IDs - self.p1_vlan_start = 100 - self.p2_vlan_start = 200 - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.10.10.1" - self.p1_src_end_ip = u"10.10.10.254" - - self.p1_dst_start_ip = u"20.20.20.1" - self.p1_dst_end_ip = u"20.20.20.254" - - self.p2_src_start_ip = u"20.20.20.1" - self.p2_src_end_ip = u"20.20.20.254" - - self.p2_dst_start_ip = u"10.10.10.1" - self.p2_dst_end_ip = u"10.10.10.254" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | DOT1Q | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether( - dst=u"ba:dc:00:ff:ee:01" - ) / - Dot1Q( - vlan=self.p1_vlan_start - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether( - dst=u"ba:dc:00:ff:ee:01" - ) / - Dot1Q( - vlan=self.p2_vlan_start - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"ip_src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"random" - ), - STLVmWrFlowVar( - fv_name=u"ip_src", - pkt_offset=u"IP.src" - ), - STLVmFlowVar( - name=u"ip_dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"random" - ), - STLVmWrFlowVar( - fv_name=u"ip_dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"ip_src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"random" - ), - STLVmWrFlowVar( - fv_name=u"ip_src", - pkt_offset=u"IP.src" - ), - STLVmFlowVar( - name=u"ip_dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"random" - ), - STLVmWrFlowVar( - fv_name=u"ip_dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :returns: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-dot1qip4-vlan1ip4src254ip4dst254.py b/GPL/traffic_profiles/trex/trex-sl-dot1qip4-vlan1ip4src254ip4dst254.py deleted file mode 100644 index 6ce351968c..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-dot1qip4-vlan1ip4src254ip4dst254.py +++ /dev/null @@ -1,164 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / DOT1Q / IP / - - Direction 0 --> 1: - - VLAN range: 100 - - Source IP address range: 10.10.10.1 - 10.10.10.254 - - Destination IP address range: 20.20.20.1 - 20.20.20.254 - - Direction 1 --> 0: - - VLAN range: 200 - - Source IP address range: 20.20.20.1 - 20.20.20.254 - - Destination IP address range: 10.10.10.1 - 10.10.10.254 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # VLAN IDs - self.p1_vlan_start = 100 - self.p2_vlan_start = 200 - - # IPs used in packet headers. - self.p1_src_start_ip = u"10.10.10.1" - self.p1_src_end_ip = u"10.10.10.254" - - self.p1_dst_start_ip = u"20.20.20.1" - self.p1_dst_end_ip = u"20.20.20.254" - - self.p2_src_start_ip = u"20.20.20.1" - self.p2_src_end_ip = u"20.20.20.254" - - self.p2_dst_start_ip = u"10.10.10.1" - self.p2_dst_end_ip = u"10.10.10.254" - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | DOT1Q | IP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - Dot1Q( - vlan=self.p1_vlan_start - ) / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=61 - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - Dot1Q( - vlan=self.p2_vlan_start - ) / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"ip_src", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op=u"random" - ), - STLVmWrFlowVar( - fv_name=u"ip_src", - pkt_offset=u"IP.src" - ), - STLVmFlowVar( - name=u"ip_dst", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op=u"random" - ), - STLVmWrFlowVar( - fv_name=u"ip_dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"ip_src", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op=u"random" - ), - STLVmWrFlowVar( - fv_name=u"ip_src", - pkt_offset=u"IP.src" - ), - STLVmFlowVar( - name=u"ip_dst", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op=u"random" - ), - STLVmWrFlowVar( - fv_name=u"ip_dst", - pkt_offset=u"IP.dst" - ), - STLVmFixIpv4( - offset=u"IP" - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :returns: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-dot1qip4vxlan-ip4src10udpsrcrnd.py b/GPL/traffic_profiles/trex/trex-sl-dot1qip4vxlan-ip4src10udpsrcrnd.py deleted file mode 100644 index 32ca072154..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-dot1qip4vxlan-ip4src10udpsrcrnd.py +++ /dev/null @@ -1,287 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / DOT1Q / IP / VXLAN / ETH / IP - - Direction 0 --> 1: - - VLAN range: 100 - - Source IP address: 172.17.[0..9].2 - - Destination IP address: 172.16.0.1 - - Source UDP port: random([1024..65535]) - - Destination UDP port: 4789 - - VXLAN VNI: [0..9] - - Payload source MAC address: 00:aa:aa:00:00:[00..ff] - - Payload source IP address: 10.0.[0..255].2 - - Payload destination MAC address: 00:bb:bb:00:00:[00..ff] - - Payload destination IP address: 10.0.[0..255].1 - - Direction 1 --> 0: - - VLAN range: 200 - - Source IP address: 172.27.[0..9].2 - - Destination IP address: 172.26.0.1 - - Source UDP port: random([1024..65535]) - - Destination UDP port: 4789 - - VXLAN VNI: [0..9] - - Payload source MAC address: 00:bb:bb:00:00:[00..ff] - - Payload source IP address: 10.0.[0..255].1 - - Payload destination MAC address: 00:aa:aa:00:00:[00..ff] - - Payload destination IP address: 10.0.[0..255].2 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - -# RFC 7348 - Virtual eXtensible Local Area Network (VXLAN): -# A Framework for Overlaying Virtualized Layer 2 Networks over Layer 3 Networks -# http://tools.ietf.org/html/rfc7348 -_VXLAN_FLAGS = list(u"R"*24 + u"RRRIRRRRR") - - -class VXLAN(Packet): - name=u"VXLAN" - fields_desc = [ - FlagsField(u"flags", 0x08000000, 32, _VXLAN_FLAGS), - ThreeBytesField(u"vni", 0), - XByteField(u"reserved", 0x00) - ] - - def mysummary(self): - return self.sprintf(u"VXLAN (vni=%VXLAN.vni%)") - - -bind_layers(UDP, VXLAN, dport=4789) -bind_layers(VXLAN, Ether) - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.nf_chains = 10 - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | DOT1Q | IP | VXLAN | ETH | IP - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether()/ - Dot1Q( - vlan=100 - ) / - IP( - src=u"172.17.0.2", - dst=u"172.16.0.1" - )/ - UDP( - sport=1024, - dport=4789 - )/ - VXLAN( - vni=0 - )/ - Ether( - src=u"00:aa:aa:00:00:00", - dst=u"00:bb:bb:00:00:00" - )/ - IP( - src=u"10.0.0.2", - dst=u"10.0.0.1", - proto=61 - ) - ) - - # Direction 1 --> 0 - base_pkt_b = ( - Ether()/ - Dot1Q( - vlan=200 - ) / - IP( - src=u"172.27.0.2", - dst=u"172.26.0.1" - )/ - UDP( - sport=1024, - dport=4789 - )/ - VXLAN( - vni=0 - )/ - Ether( - src=u"00:bb:bb:00:00:00", - dst=u"00:aa:aa:00:00:00" - )/ - IP( - src=u"10.0.0.1", - dst=u"10.0.0.2", - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"nf_id", - size=1, - op=u"inc", - min_value=0, - max_value=self.nf_chains - 1 - ), - STLVmFlowVar( - name=u"in_mac", - size=2, - op=u"inc", - min_value=0, - max_value=255 - ), - STLVmFlowVar( - name=u"in_ip", - size=1, - op=u"inc", - min_value=0, - max_value=255 - ), - STLVmFlowVar( - name=u"src_port", - size=2, - op=u"random", - min_value=1024, - max_value=65535 - ), - STLVmWrFlowVar( - fv_name=u"nf_id", - pkt_offset=32 - ), - STLVmWrFlowVar( - fv_name=u"src_port", - pkt_offset=u"UDP.sport" - ), - STLVmWrFlowVar( - fv_name=u"nf_id", - pkt_offset=52 - ), - STLVmWrFlowVar( - fv_name=u"in_mac", - pkt_offset=58 - ), - STLVmWrFlowVar( - fv_name=u"in_mac", - pkt_offset=64 - ), - STLVmWrFlowVar( - fv_name=u"in_ip", - pkt_offset=82 - ), - STLVmWrFlowVar( - fv_name=u"in_ip", - pkt_offset=86 - ), - STLVmFixChecksumHw( - l3_offset="IP:{}".format(0), - l4_offset="UDP:{}".format(0), - l4_type=CTRexVmInsFixHwCs.L4_TYPE_UDP - ) - ] - ) - - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"nf_id", - size=1, - op=u"inc", - min_value=0, - max_value=self.nf_chains - 1 - ), - STLVmFlowVar( - name=u"in_mac", - size=2, op=u"inc", - min_value=0, - max_value=255 - ), - STLVmFlowVar( - name=u"in_ip", - size=1, - op=u"inc", - min_value=0, - max_value=255 - ), - STLVmFlowVar( - name=u"src_port", - size=2, - op=u"random", - min_value=1024, - max_value=65535 - ), - STLVmWrFlowVar( - fv_name=u"nf_id", - pkt_offset=32 - ), - STLVmWrFlowVar( - fv_name=u"src_port", - pkt_offset=u"UDP.sport" - ), - STLVmWrFlowVar( - fv_name=u"nf_id", - pkt_offset=52 - ), - STLVmWrFlowVar( - fv_name=u"in_mac", - pkt_offset=58 - ), - STLVmWrFlowVar( - fv_name=u"in_mac", - pkt_offset=64 - ), - STLVmWrFlowVar( - fv_name=u"in_ip", - pkt_offset=82 - ), - STLVmWrFlowVar( - fv_name=u"in_ip", - pkt_offset=86 - ), - STLVmFixChecksumHw( - l3_offset="IP:{}".format(0), - l4_offset="UDP:{}".format(0), - l4_type=CTRexVmInsFixHwCs.L4_TYPE_UDP - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() - diff --git a/GPL/traffic_profiles/trex/trex-sl-dot1qip4vxlan-ip4src1udpsrcrnd.py b/GPL/traffic_profiles/trex/trex-sl-dot1qip4vxlan-ip4src1udpsrcrnd.py deleted file mode 100644 index 1e78cd3cae..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-dot1qip4vxlan-ip4src1udpsrcrnd.py +++ /dev/null @@ -1,288 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / DOT1Q / IP / VXLAN / ETH / IP - - Direction 0 --> 1: - - VLAN range: 100 - - Source IP address: 172.17.0.2 - - Destination IP address: 172.16.0.1 - - Source UDP port: random([1024..65535]) - - Destination UDP port: 4789 - - VXLAN VNI: 0 - - Payload source MAC address: 00:aa:aa:00:00:[00..ff] - - Payload source IP address: 10.0.[0..255].2 - - Payload destination MAC address: 00:bb:bb:00:00:[00..ff] - - Payload destination IP address: 10.0.[0..255].1 - - Direction 1 --> 0: - - VLAN range: 200 - - Source IP address: 172.27.0.2 - - Destination IP address: 172.26.0.1 - - Source UDP port: random([1024..65535]) - - Destination UDP port: 4789 - - VXLAN VNI: 0 - - Payload source MAC address: 00:bb:bb:00:00:[00..ff] - - Payload source IP address: 10.0.[0..255].1 - - Payload destination MAC address: 00:aa:aa:00:00:[00..ff] - - Payload destination IP address: 10.0.[0..255].2 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - -# RFC 7348 - Virtual eXtensible Local Area Network (VXLAN): -# A Framework for Overlaying Virtualized Layer 2 Networks over Layer 3 Networks. -# http://tools.ietf.org/html/rfc7348 -_VXLAN_FLAGS = list(u"R"*24 + u"RRRIRRRRR") - - -class VXLAN(Packet): - name=u"VXLAN" - fields_desc = [ - FlagsField(u"flags", 0x08000000, 32, _VXLAN_FLAGS), - ThreeBytesField(u"vni", 0), - XByteField(u"reserved", 0x00) - ] - - def mysummary(self): - return self.sprintf(u"VXLAN (vni=%VXLAN.vni%)") - - -bind_layers(UDP, VXLAN, dport=4789) -bind_layers(VXLAN, Ether) - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.nf_chains = 1 - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | DOT1Q | IP | VXLAN | ETH | IP - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether()/ - Dot1Q( - vlan=100 - ) / - IP( - src=u"172.17.0.2", - dst=u"172.16.0.1" - )/ - UDP( - sport=1024, - dport=4789 - )/ - VXLAN( - vni=0 - )/ - Ether( - src=u"00:aa:aa:00:00:00", - dst=u"00:bb:bb:00:00:00" - )/ - IP( - src=u"10.0.0.2", - dst=u"10.0.0.1", - proto=61 - ) - ) - - # Direction 1 --> 0 - base_pkt_b = ( - Ether()/ - Dot1Q( - vlan=200 - ) / - IP( - src=u"172.27.0.2", - dst=u"172.26.0.1" - )/ - UDP( - sport=1024, - dport=4789 - )/ - VXLAN( - vni=0 - )/ - Ether( - src=u"00:bb:bb:00:00:00", - dst=u"00:aa:aa:00:00:00" - )/ - IP( - src=u"10.0.0.1", - dst=u"10.0.0.2", - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"nf_id", - size=1, - op=u"inc", - min_value=0, - max_value=self.nf_chains - 1 - ), - STLVmFlowVar( - name=u"in_mac", - size=2, - op=u"inc", - min_value=0, - max_value=255 - ), - STLVmFlowVar( - name=u"in_ip", - size=1, - op=u"inc", - min_value=0, - max_value=255 - ), - STLVmFlowVar( - name=u"src_port", - size=2, - op=u"random", - min_value=1024, - max_value=65535 - ), - STLVmWrFlowVar( - fv_name=u"nf_id", - pkt_offset=32 - ), - STLVmWrFlowVar( - fv_name=u"src_port", - pkt_offset=u"UDP.sport" - ), - STLVmWrFlowVar( - fv_name=u"nf_id", - pkt_offset=52 - ), - STLVmWrFlowVar( - fv_name=u"in_mac", - pkt_offset=58 - ), - STLVmWrFlowVar( - fv_name=u"in_mac", - pkt_offset=64 - ), - STLVmWrFlowVar( - fv_name=u"in_ip", - pkt_offset=82 - ), - STLVmWrFlowVar( - fv_name=u"in_ip", - pkt_offset=86 - ), - STLVmFixChecksumHw( - l3_offset="IP:{}".format(0), - l4_offset="UDP:{}".format(0), - l4_type=CTRexVmInsFixHwCs.L4_TYPE_UDP - ) - ] - ) - - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"nf_id", - size=1, - op=u"inc", - min_value=0, - max_value=self.nf_chains - 1 - ), - STLVmFlowVar( - name=u"in_mac", - size=2, - op=u"inc", - min_value=0, - max_value=255 - ), - STLVmFlowVar( - name=u"in_ip", - size=1, - op=u"inc", - min_value=0, - max_value=255 - ), - STLVmFlowVar( - name=u"src_port", - size=2, - op=u"random", - min_value=1024, - max_value=65535 - ), - STLVmWrFlowVar( - fv_name=u"nf_id", - pkt_offset=32 - ), - STLVmWrFlowVar( - fv_name=u"src_port", - pkt_offset=u"UDP.sport" - ), - STLVmWrFlowVar( - fv_name=u"nf_id", - pkt_offset=52 - ), - STLVmWrFlowVar( - fv_name=u"in_mac", - pkt_offset=58 - ), - STLVmWrFlowVar( - fv_name=u"in_mac", - pkt_offset=64 - ), - STLVmWrFlowVar( - fv_name=u"in_ip", - pkt_offset=82 - ), - STLVmWrFlowVar( - fv_name=u"in_ip", - pkt_offset=86 - ), - STLVmFixChecksumHw( - l3_offset="IP:{}".format(0), - l4_offset="UDP:{}".format(0), - l4_type=CTRexVmInsFixHwCs.L4_TYPE_UDP - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() - diff --git a/GPL/traffic_profiles/trex/trex-sl-dot1qip4vxlan-ip4src2udpsrcrnd.py b/GPL/traffic_profiles/trex/trex-sl-dot1qip4vxlan-ip4src2udpsrcrnd.py deleted file mode 100644 index d195bc5b61..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-dot1qip4vxlan-ip4src2udpsrcrnd.py +++ /dev/null @@ -1,288 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / DOT1Q / IP / VXLAN / ETH / IP - - Direction 0 --> 1: - - VLAN range: 100 - - Source IP address: 172.17.[0..1].2 - - Destination IP address: 172.16.0.1 - - Source UDP port: random([1024..65535]) - - Destination UDP port: 4789 - - VXLAN VNI: [0..1] - - Payload source MAC address: 00:aa:aa:00:00:[00..ff] - - Payload source IP address: 10.0.[0..255].2 - - Payload destination MAC address: 00:bb:bb:00:00:[00..ff] - - Payload destination IP address: 10.0.[0..255].1 - - Direction 1 --> 0: - - VLAN range: 200 - - Source IP address: 172.27.[0..1].2 - - Destination IP address: 172.26.0.1 - - Source UDP port: random([1024..65535]) - - Destination UDP port: 4789 - - VXLAN VNI: [0..1] - - Payload source MAC address: 00:bb:bb:00:00:[00..ff] - - Payload source IP address: 10.0.[0..255].1 - - Payload destination MAC address: 00:aa:aa:00:00:[00..ff] - - Payload destination IP address: 10.0.[0..255].2 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - -# RFC 7348 - Virtual eXtensible Local Area Network (VXLAN): -# A Framework for Overlaying Virtualized Layer 2 Networks over Layer 3 Networks -# http://tools.ietf.org/html/rfc7348 -_VXLAN_FLAGS = list(u"R"*24 + u"RRRIRRRRR") - - -class VXLAN(Packet): - name=u"VXLAN" - fields_desc = [ - FlagsField(u"flags", 0x08000000, 32, _VXLAN_FLAGS), - ThreeBytesField(u"vni", 0), - XByteField(u"reserved", 0x00) - ] - - def mysummary(self): - return self.sprintf(u"VXLAN (vni=%VXLAN.vni%)") - - -bind_layers(UDP, VXLAN, dport=4789) -bind_layers(VXLAN, Ether) - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.nf_chains = 2 - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | DOT1Q | IP | VXLAN | ETH | IP - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether()/ - Dot1Q( - vlan=100 - ) / - IP( - src=u"172.17.0.2", - dst=u"172.16.0.1" - )/ - UDP( - sport=1024, - dport=4789 - )/ - VXLAN( - vni=0 - )/ - Ether( - src=u"00:aa:aa:00:00:00", - dst=u"00:bb:bb:00:00:00" - )/ - IP( - src=u"10.0.0.2", - dst=u"10.0.0.1", - proto=61 - ) - ) - - # Direction 1 --> 0 - base_pkt_b = ( - Ether()/ - Dot1Q( - vlan=200 - ) / - IP( - src=u"172.27.0.2", - dst=u"172.26.0.1" - )/ - UDP( - sport=1024, - dport=4789 - )/ - VXLAN( - vni=0 - )/ - Ether( - src=u"00:bb:bb:00:00:00", - dst=u"00:aa:aa:00:00:00" - )/ - IP( - src=u"10.0.0.1", - dst=u"10.0.0.2", - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"nf_id", - size=1, - op=u"inc", - min_value=0, - max_value=self.nf_chains - 1 - ), - STLVmFlowVar( - name=u"in_mac", - size=2, - op=u"inc", - min_value=0, - max_value=255 - ), - STLVmFlowVar( - name=u"in_ip", - size=1, - op=u"inc", - min_value=0, - max_value=255 - ), - STLVmFlowVar( - name=u"src_port", - size=2, - op=u"random", - min_value=1024, - max_value=65535 - ), - STLVmWrFlowVar( - fv_name=u"nf_id", - pkt_offset=32 - ), - STLVmWrFlowVar( - fv_name=u"src_port", - pkt_offset=u"UDP.sport" - ), - STLVmWrFlowVar( - fv_name=u"nf_id", - pkt_offset=52 - ), - STLVmWrFlowVar( - fv_name=u"in_mac", - pkt_offset=58 - ), - STLVmWrFlowVar( - fv_name=u"in_mac", - pkt_offset=64 - ), - STLVmWrFlowVar( - fv_name=u"in_ip", - pkt_offset=82 - ), - STLVmWrFlowVar( - fv_name=u"in_ip", - pkt_offset=86 - ), - STLVmFixChecksumHw( - l3_offset="IP:{}".format(0), - l4_offset="UDP:{}".format(0), - l4_type=CTRexVmInsFixHwCs.L4_TYPE_UDP - ) - ] - ) - - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"nf_id", - size=1, - op=u"inc", - min_value=0, - max_value=self.nf_chains - 1 - ), - STLVmFlowVar( - name=u"in_mac", - size=2, - op=u"inc", - min_value=0, - max_value=255 - ), - STLVmFlowVar( - name=u"in_ip", - size=1, - op=u"inc", - min_value=0, - max_value=255 - ), - STLVmFlowVar( - name=u"src_port", - size=2, - op=u"random", - min_value=1024, - max_value=65535 - ), - STLVmWrFlowVar( - fv_name=u"nf_id", - pkt_offset=32 - ), - STLVmWrFlowVar( - fv_name=u"src_port", - pkt_offset=u"UDP.sport" - ), - STLVmWrFlowVar( - fv_name=u"nf_id", - pkt_offset=52 - ), - STLVmWrFlowVar( - fv_name=u"in_mac", - pkt_offset=58 - ), - STLVmWrFlowVar( - fv_name=u"in_mac", - pkt_offset=64 - ), - STLVmWrFlowVar( - fv_name=u"in_ip", - pkt_offset=82 - ), - STLVmWrFlowVar( - fv_name=u"in_ip", - pkt_offset=86 - ), - STLVmFixChecksumHw( - l3_offset="IP:{}".format(0), - l4_offset="UDP:{}".format(0), - l4_type=CTRexVmInsFixHwCs.L4_TYPE_UDP - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() - diff --git a/GPL/traffic_profiles/trex/trex-sl-dot1qip4vxlan-ip4src4udpsrcrnd.py b/GPL/traffic_profiles/trex/trex-sl-dot1qip4vxlan-ip4src4udpsrcrnd.py deleted file mode 100644 index 8a7bc08b1b..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-dot1qip4vxlan-ip4src4udpsrcrnd.py +++ /dev/null @@ -1,288 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / DOT1Q / IP / VXLAN / ETH / IP - - Direction 0 --> 1: - - VLAN range: 100 - - Source IP address: 172.17.[0..3].2 - - Destination IP address: 172.16.0.1 - - Source UDP port: random([1024..65535]) - - Destination UDP port: 4789 - - VXLAN VNI: [0..3] - - Payload source MAC address: 00:aa:aa:00:00:[00..ff] - - Payload source IP address: 10.0.[0..255].2 - - Payload destination MAC address: 00:bb:bb:00:00:[00..ff] - - Payload destination IP address: 10.0.[0..255].1 - - Direction 1 --> 0: - - VLAN range: 200 - - Source IP address: 172.27.[0..3].2 - - Destination IP address: 172.26.0.1 - - Source UDP port: random([1024..65535]) - - Destination UDP port: 4789 - - VXLAN VNI: [0..3] - - Payload source MAC address: 00:bb:bb:00:00:[00..ff] - - Payload source IP address: 10.0.[0..255].1 - - Payload destination MAC address: 00:aa:aa:00:00:[00..ff] - - Payload destination IP address: 10.0.[0..255].2 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - -# RFC 7348 - Virtual eXtensible Local Area Network (VXLAN): -# A Framework for Overlaying Virtualized Layer 2 Networks over Layer 3 Networks -# http://tools.ietf.org/html/rfc7348 -_VXLAN_FLAGS = list(u"R"*24 + u"RRRIRRRRR") - - -class VXLAN(Packet): - name=u"VXLAN" - fields_desc = [ - FlagsField(u"flags", 0x08000000, 32, _VXLAN_FLAGS), - ThreeBytesField(u"vni", 0), - XByteField(u"reserved", 0x00) - ] - - def mysummary(self): - return self.sprintf(u"VXLAN (vni=%VXLAN.vni%)") - - -bind_layers(UDP, VXLAN, dport=4789) -bind_layers(VXLAN, Ether) - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.nf_chains = 4 - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | DOT1Q | IP | VXLAN | ETH | IP - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether()/ - Dot1Q( - vlan=100 - )/ - IP( - src=u"172.17.0.2", - dst=u"172.16.0.1" - )/ - UDP( - sport=1024, - dport=4789 - )/ - VXLAN( - vni=0 - )/ - Ether( - src=u"00:aa:aa:00:00:00", - dst=u"00:bb:bb:00:00:00" - )/ - IP( - src=u"10.0.0.2", - dst=u"10.0.0.1", - proto=61 - ) - ) - - # Direction 1 --> 0 - base_pkt_b = ( - Ether()/ - Dot1Q( - vlan=200 - ) / - IP( - src=u"172.27.0.2", - dst=u"172.26.0.1" - )/ - UDP( - sport=1024, - dport=4789 - )/ - VXLAN( - vni=0 - )/ - Ether( - src=u"00:bb:bb:00:00:00", - dst=u"00:aa:aa:00:00:00" - )/ - IP( - src=u"10.0.0.1", - dst=u"10.0.0.2", - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"nf_id", - size=1, - op=u"inc", - min_value=0, - max_value=self.nf_chains - 1 - ), - STLVmFlowVar( - name=u"in_mac", - size=2, - op=u"inc", - min_value=0, - max_value=255 - ), - STLVmFlowVar( - name=u"in_ip", - size=1, - op=u"inc", - min_value=0, - max_value=255 - ), - STLVmFlowVar( - name=u"src_port", - size=2, - op=u"random", - min_value=1024, - max_value=65535 - ), - STLVmWrFlowVar( - fv_name=u"nf_id", - pkt_offset=32 - ), - STLVmWrFlowVar( - fv_name=u"src_port", - pkt_offset=u"UDP.sport" - ), - STLVmWrFlowVar( - fv_name=u"nf_id", - pkt_offset=52 - ), - STLVmWrFlowVar( - fv_name=u"in_mac", - pkt_offset=58 - ), - STLVmWrFlowVar( - fv_name=u"in_mac", - pkt_offset=64 - ), - STLVmWrFlowVar( - fv_name=u"in_ip", - pkt_offset=82 - ), - STLVmWrFlowVar( - fv_name=u"in_ip", - pkt_offset=86 - ), - STLVmFixChecksumHw( - l3_offset="IP:{}".format(0), - l4_offset="UDP:{}".format(0), - l4_type=CTRexVmInsFixHwCs.L4_TYPE_UDP - ) - ] - ) - - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"nf_id", - size=1, - op=u"inc", - min_value=0, - max_value=self.nf_chains - 1 - ), - STLVmFlowVar( - name=u"in_mac", - size=2, - op=u"inc", - min_value=0, - max_value=255 - ), - STLVmFlowVar( - name=u"in_ip", - size=1, - op=u"inc", - min_value=0, - max_value=255 - ), - STLVmFlowVar( - name=u"src_port", - size=2, - op=u"random", - min_value=1024, - max_value=65535 - ), - STLVmWrFlowVar( - fv_name=u"nf_id", - pkt_offset=32 - ), - STLVmWrFlowVar( - fv_name=u"src_port", - pkt_offset=u"UDP.sport" - ), - STLVmWrFlowVar( - fv_name=u"nf_id", - pkt_offset=52 - ), - STLVmWrFlowVar( - fv_name=u"in_mac", - pkt_offset=58 - ), - STLVmWrFlowVar( - fv_name=u"in_mac", - pkt_offset=64 - ), - STLVmWrFlowVar( - fv_name=u"in_ip", - pkt_offset=82 - ), - STLVmWrFlowVar( - fv_name=u"in_ip", - pkt_offset=86 - ), - STLVmFixChecksumHw( - l3_offset="IP:{}".format(0), - l4_offset="UDP:{}".format(0), - l4_type=CTRexVmInsFixHwCs.L4_TYPE_UDP - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() - diff --git a/GPL/traffic_profiles/trex/trex-sl-dot1qip4vxlan-ip4src6udpsrcrnd.py b/GPL/traffic_profiles/trex/trex-sl-dot1qip4vxlan-ip4src6udpsrcrnd.py deleted file mode 100644 index fe46844571..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-dot1qip4vxlan-ip4src6udpsrcrnd.py +++ /dev/null @@ -1,288 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / DOT1Q / IP / VXLAN / ETH / IP - - Direction 0 --> 1: - - VLAN range: 100 - - Source IP address: 172.17.[0..5].2 - - Destination IP address: 172.16.0.1 - - Source UDP port: random([1024..65535]) - - Destination UDP port: 4789 - - VXLAN VNI: [0..5] - - Payload source MAC address: 00:aa:aa:00:00:[00..ff] - - Payload source IP address: 10.0.[0..255].2 - - Payload destination MAC address: 00:bb:bb:00:00:[00..ff] - - Payload destination IP address: 10.0.[0..255].1 - - Direction 1 --> 0: - - VLAN range: 200 - - Source IP address: 172.27.[0..5].2 - - Destination IP address: 172.26.0.1 - - Source UDP port: random([1024..65535]) - - Destination UDP port: 4789 - - VXLAN VNI: [0..5] - - Payload source MAC address: 00:bb:bb:00:00:[00..ff] - - Payload source IP address: 10.0.[0..255].1 - - Payload destination MAC address: 00:aa:aa:00:00:[00..ff] - - Payload destination IP address: 10.0.[0..255].2 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - -# RFC 7348 - Virtual eXtensible Local Area Network (VXLAN): -# A Framework for Overlaying Virtualized Layer 2 Networks over Layer 3 Networks -# http://tools.ietf.org/html/rfc7348 -_VXLAN_FLAGS = list(u"R"*24 + u"RRRIRRRRR") - - -class VXLAN(Packet): - name=u"VXLAN" - fields_desc = [ - FlagsField(u"flags", 0x08000000, 32, _VXLAN_FLAGS), - ThreeBytesField(u"vni", 0), - XByteField(u"reserved", 0x00) - ] - - def mysummary(self): - return self.sprintf(u"VXLAN (vni=%VXLAN.vni%)") - - -bind_layers(UDP, VXLAN, dport=4789) -bind_layers(VXLAN, Ether) - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.nf_chains = 6 - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | DOT1Q | IP | VXLAN | ETH | IP - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether()/ - Dot1Q( - vlan=100 - ) / - IP( - src=u"172.17.0.2", - dst=u"172.16.0.1" - )/ - UDP( - sport=1024, - dport=4789 - )/ - VXLAN( - vni=0 - )/ - Ether( - src=u"00:aa:aa:00:00:00", - dst=u"00:bb:bb:00:00:00" - )/ - IP( - src=u"10.0.0.2", - dst=u"10.0.0.1", - proto=61 - ) - ) - - # Direction 1 --> 0 - base_pkt_b = ( - Ether()/ - Dot1Q( - vlan=200 - ) / - IP( - src=u"172.27.0.2", - dst=u"172.26.0.1" - )/ - UDP( - sport=1024, - dport=4789 - )/ - VXLAN( - vni=0 - )/ - Ether( - src=u"00:bb:bb:00:00:00", - dst=u"00:aa:aa:00:00:00" - )/ - IP( - src=u"10.0.0.1", - dst=u"10.0.0.2", - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"nf_id", - size=1, - op=u"inc", - min_value=0, - max_value=self.nf_chains - 1 - ), - STLVmFlowVar( - name=u"in_mac", - size=2, - op=u"inc", - min_value=0, - max_value=255 - ), - STLVmFlowVar( - name=u"in_ip", - size=1, - op=u"inc", - min_value=0, - max_value=255 - ), - STLVmFlowVar( - name=u"src_port", - size=2, - op=u"random", - min_value=1024, - max_value=65535 - ), - STLVmWrFlowVar( - fv_name=u"nf_id", - pkt_offset=32 - ), - STLVmWrFlowVar( - fv_name=u"src_port", - pkt_offset=u"UDP.sport" - ), - STLVmWrFlowVar( - fv_name=u"nf_id", - pkt_offset=52 - ), - STLVmWrFlowVar( - fv_name=u"in_mac", - pkt_offset=58 - ), - STLVmWrFlowVar( - fv_name=u"in_mac", - pkt_offset=64 - ), - STLVmWrFlowVar( - fv_name=u"in_ip", - pkt_offset=82 - ), - STLVmWrFlowVar( - fv_name=u"in_ip", - pkt_offset=86 - ), - STLVmFixChecksumHw( - l3_offset="IP:{}".format(0), - l4_offset="UDP:{}".format(0), - l4_type=CTRexVmInsFixHwCs.L4_TYPE_UDP - ) - ] - ) - - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"nf_id", - size=1, - op=u"inc", - min_value=0, - max_value=self.nf_chains - 1 - ), - STLVmFlowVar( - name=u"in_mac", - size=2, - op=u"inc", - min_value=0, - max_value=255 - ), - STLVmFlowVar( - name=u"in_ip", - size=1, - op=u"inc", - min_value=0, - max_value=255 - ), - STLVmFlowVar( - name=u"src_port", - size=2, - op=u"random", - min_value=1024, - max_value=65535 - ), - STLVmWrFlowVar( - fv_name=u"nf_id", - pkt_offset=32 - ), - STLVmWrFlowVar( - fv_name=u"src_port", - pkt_offset=u"UDP.sport" - ), - STLVmWrFlowVar( - fv_name=u"nf_id", - pkt_offset=52 - ), - STLVmWrFlowVar( - fv_name=u"in_mac", - pkt_offset=58 - ), - STLVmWrFlowVar( - fv_name=u"in_mac", - pkt_offset=64 - ), - STLVmWrFlowVar( - fv_name=u"in_ip", - pkt_offset=82 - ), - STLVmWrFlowVar( - fv_name=u"in_ip", - pkt_offset=86 - ), - STLVmFixChecksumHw( - l3_offset="IP:{}".format(0), - l4_offset="UDP:{}".format(0), - l4_type=CTRexVmInsFixHwCs.L4_TYPE_UDP - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() - diff --git a/GPL/traffic_profiles/trex/trex-sl-dot1qip4vxlan-ip4src8udpsrcrnd.py b/GPL/traffic_profiles/trex/trex-sl-dot1qip4vxlan-ip4src8udpsrcrnd.py deleted file mode 100644 index cf34818781..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-dot1qip4vxlan-ip4src8udpsrcrnd.py +++ /dev/null @@ -1,288 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / DOT1Q / IP / VXLAN / ETH / IP - - Direction 0 --> 1: - - VLAN range: 100 - - Source IP address: 172.17.[0..7].2 - - Destination IP address: 172.16.0.1 - - Source UDP port: random([1024..65535]) - - Destination UDP port: 4789 - - VXLAN VNI: [0..7] - - Payload source MAC address: 00:aa:aa:00:00:[00..ff] - - Payload source IP address: 10.0.[0..255].2 - - Payload destination MAC address: 00:bb:bb:00:00:[00..ff] - - Payload destination IP address: 10.0.[0..255].1 - - Direction 1 --> 0: - - VLAN range: 200 - - Source IP address: 172.27.[0..7].2 - - Destination IP address: 172.26.0.1 - - Source UDP port: random([1024..65535]) - - Destination UDP port: 4789 - - VXLAN VNI: [0..7] - - Payload source MAC address: 00:bb:bb:00:00:[00..ff] - - Payload source IP address: 10.0.[0..255].1 - - Payload destination MAC address: 00:aa:aa:00:00:[00..ff] - - Payload destination IP address: 10.0.[0..255].2 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - -# RFC 7348 - Virtual eXtensible Local Area Network (VXLAN): -# A Framework for Overlaying Virtualized Layer 2 Networks over Layer 3 Networks -# http://tools.ietf.org/html/rfc7348 -_VXLAN_FLAGS = list(u"R"*24 + u"RRRIRRRRR") - - -class VXLAN(Packet): - name=u"VXLAN" - fields_desc = [ - FlagsField(u"flags", 0x08000000, 32, _VXLAN_FLAGS), - ThreeBytesField(u"vni", 0), - XByteField(u"reserved", 0x00) - ] - - def mysummary(self): - return self.sprintf(u"VXLAN (vni=%VXLAN.vni%)") - - -bind_layers(UDP, VXLAN, dport=4789) -bind_layers(VXLAN, Ether) - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.nf_chains = 8 - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | DOT1Q | IP | VXLAN | ETH | IP - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether()/ - Dot1Q( - vlan=100 - ) / - IP( - src=u"172.17.0.2", - dst=u"172.16.0.1" - )/ - UDP( - sport=1024, - dport=4789 - )/ - VXLAN( - vni=0 - )/ - Ether( - src=u"00:aa:aa:00:00:00", - dst=u"00:bb:bb:00:00:00" - )/ - IP( - src=u"10.0.0.2", - dst=u"10.0.0.1", - proto=61 - ) - ) - - # Direction 1 --> 0 - base_pkt_b = ( - Ether()/ - Dot1Q( - vlan=200 - ) / - IP( - src=u"172.27.0.2", - dst=u"172.26.0.1" - )/ - UDP( - sport=1024, - dport=4789 - )/ - VXLAN( - vni=0 - )/ - Ether( - src=u"00:bb:bb:00:00:00", - dst=u"00:aa:aa:00:00:00" - )/ - IP( - src=u"10.0.0.1", - dst=u"10.0.0.2", - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"nf_id", - size=1, - op=u"inc", - min_value=0, - max_value=self.nf_chains - 1 - ), - STLVmFlowVar( - name=u"in_mac", - size=2, - op=u"inc", - min_value=0, - max_value=255 - ), - STLVmFlowVar( - name=u"in_ip", - size=1, - op=u"inc", - min_value=0, - max_value=255 - ), - STLVmFlowVar( - name=u"src_port", - size=2, - op=u"random", - min_value=1024, - max_value=65535 - ), - STLVmWrFlowVar( - fv_name=u"nf_id", - pkt_offset=32 - ), - STLVmWrFlowVar( - fv_name=u"src_port", - pkt_offset=u"UDP.sport" - ), - STLVmWrFlowVar( - fv_name=u"nf_id", - pkt_offset=52 - ), - STLVmWrFlowVar( - fv_name=u"in_mac", - pkt_offset=58 - ), - STLVmWrFlowVar( - fv_name=u"in_mac", - pkt_offset=64 - ), - STLVmWrFlowVar( - fv_name=u"in_ip", - pkt_offset=82 - ), - STLVmWrFlowVar( - fv_name=u"in_ip", - pkt_offset=86 - ), - STLVmFixChecksumHw( - l3_offset="IP:{}".format(0), - l4_offset="UDP:{}".format(0), - l4_type=CTRexVmInsFixHwCs.L4_TYPE_UDP - ) - ] - ) - - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"nf_id", - size=1, - op=u"inc", - min_value=0, - max_value=self.nf_chains - 1 - ), - STLVmFlowVar( - name=u"in_mac", - size=2, - op=u"inc", - min_value=0, - max_value=255 - ), - STLVmFlowVar( - name=u"in_ip", - size=1, - op=u"inc", - min_value=0, - max_value=255 - ), - STLVmFlowVar( - name=u"src_port", - size=2, - op=u"random", - min_value=1024, - max_value=65535 - ), - STLVmWrFlowVar( - fv_name=u"nf_id", - pkt_offset=32 - ), - STLVmWrFlowVar( - fv_name=u"src_port", - pkt_offset=u"UDP.sport" - ), - STLVmWrFlowVar( - fv_name=u"nf_id", - pkt_offset=52 - ), - STLVmWrFlowVar( - fv_name=u"in_mac", - pkt_offset=58 - ), - STLVmWrFlowVar( - fv_name=u"in_mac", - pkt_offset=64 - ), - STLVmWrFlowVar( - fv_name=u"in_ip", - pkt_offset=82 - ), - STLVmWrFlowVar( - fv_name=u"in_ip", - pkt_offset=86 - ), - STLVmFixChecksumHw( - l3_offset="IP:{}".format(0), - l4_offset="UDP:{}".format(0), - l4_type=CTRexVmInsFixHwCs.L4_TYPE_UDP - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() - diff --git a/GPL/traffic_profiles/trex/trex-sl-ethip4udp-1024u63p.py b/GPL/traffic_profiles/trex/trex-sl-ethip4udp-1024u63p.py deleted file mode 100644 index 1b9f483b13..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-ethip4udp-1024u63p.py +++ /dev/null @@ -1,169 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / UDP - - Direction 0 --> 1: - - Source IP address range: 192.168.0.0 - 192.168.3.255 - - Destination IP address range: 20.0.0.0 - - Source UDP port range: 1024 - 1086 - - Destination UDP port range: 1024 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.0 - - Destination IP address range: 68.142.68.0 - - Source UDP port range: 1024 - - Destination UDP port range: 1024 - 65535 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"192.168.0.0" - self.p1_src_end_ip = u"192.168.3.255" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.0.0" - - self.p2_src_start_ip = u"20.0.0.0" - self.p2_src_end_ip = u"20.0.0.0" - self.p2_dst_start_ip = u"68.142.68.0" - self.p2_dst_end_ip = u"68.142.68.0" - - # UDP ports used in packet headers. - self.p1_src_start_udp_port = 1024 - self.p1_src_end_udp_port = 1086 - self.p1_dst_start_udp_port = 1024 - self.p1_dst_end_udp_port = 1024 - - self.p2_src_start_udp_port = 1024 - self.p2_src_end_udp_port = 1024 - self.p2_dst_start_udp_port = 1024 - self.p2_dst_end_udp_port = 65535 - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | UDP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=17 - ) / - UDP( - sport=self.p1_src_start_udp_port, - dport=self.p1_dst_start_udp_port - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=17 - ) / - UDP( - sport=self.p2_src_start_udp_port, - dport=self.p2_dst_start_udp_port - ) - ) - - # Direction 0 --> 1 - vm1 = STLVM() - vm1.var(name="sIP", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op="inc", - next_var="sport") - vm1.var(name="sport", - min_value=self.p1_src_start_udp_port, - max_value=self.p1_src_end_udp_port, - size=2, - op="inc") - vm1.var(name="dIP", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op="inc") - vm1.var(name="dport", - min_value=self.p1_dst_start_udp_port, - max_value=self.p1_dst_end_udp_port, - size=2, - op="inc") - vm1.write(fv_name="sIP", pkt_offset="IP.src") - vm1.write(fv_name="sport", pkt_offset="UDP.sport") - vm1.write(fv_name="dIP", pkt_offset="IP.dst") - vm1.write(fv_name="dport", pkt_offset="UDP.dport") - vm1.fix_chksum(offset='IP') - # Direction 0 --> 1 - vm2 = STLVM() - vm2.var(name="sIP", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op="inc", - next_var="sport") - vm2.var(name="sport", - min_value=self.p2_src_start_udp_port, - max_value=self.p2_src_end_udp_port, - size=2, - op="inc") - vm2.var(name="dIP", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op="inc", - next_var="dport") - vm2.var(name="dport", - min_value=self.p2_dst_start_udp_port, - max_value=self.p2_dst_end_udp_port, - size=2, - op="inc") - vm2.write(fv_name="sIP", pkt_offset="IP.src") - vm2.write(fv_name="sport", pkt_offset="UDP.sport") - vm2.write(fv_name="dIP", pkt_offset="IP.dst") - vm2.write(fv_name="dport", pkt_offset="UDP.dport") - vm2.fix_chksum(offset='IP') - - return base_pkt_a, base_pkt_b, vm1, vm2 - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-ethip4udp-1048576u63p.py b/GPL/traffic_profiles/trex/trex-sl-ethip4udp-1048576u63p.py deleted file mode 100644 index 5fbd3a3a4f..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-ethip4udp-1048576u63p.py +++ /dev/null @@ -1,169 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / UDP - - Direction 0 --> 1: - - Source IP address range: 172.16.0.0 - 172.31.255.255 - - Destination IP address range: 20.0.0.0 - - Source UDP port range: 1024 - 1086 - - Destination UDP port range: 1024 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.0 - - Destination IP address range: 68.142.68.0 - 68.142.71.255 - - Source UDP port range: 1024 - - Destination UDP port range: 1024 - 65535 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"172.16.0.0" - self.p1_src_end_ip = u"172.31.255.255" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.0.0" - - self.p2_src_start_ip = u"20.0.0.0" - self.p2_src_end_ip = u"20.0.0.0" - self.p2_dst_start_ip = u"68.142.68.0" - self.p2_dst_end_ip = u"68.142.71.255" - - # UDP ports used in packet headers. - self.p1_src_start_udp_port = 1024 - self.p1_src_end_udp_port = 1086 - self.p1_dst_start_udp_port = 1024 - self.p1_dst_end_udp_port = 1024 - - self.p2_src_start_udp_port = 1024 - self.p2_src_end_udp_port = 1024 - self.p2_dst_start_udp_port = 1024 - self.p2_dst_end_udp_port = 65535 - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | UDP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=17 - ) / - UDP( - sport=self.p1_src_start_udp_port, - dport=self.p1_dst_start_udp_port - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=17 - ) / - UDP( - sport=self.p2_src_start_udp_port, - dport=self.p2_dst_start_udp_port - ) - ) - - # Direction 0 --> 1 - vm1 = STLVM() - vm1.var(name="sIP", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op="inc", - next_var="sport") - vm1.var(name="sport", - min_value=self.p1_src_start_udp_port, - max_value=self.p1_src_end_udp_port, - size=2, - op="inc") - vm1.var(name="dIP", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op="inc") - vm1.var(name="dport", - min_value=self.p1_dst_start_udp_port, - max_value=self.p1_dst_end_udp_port, - size=2, - op="inc") - vm1.write(fv_name="sIP", pkt_offset="IP.src") - vm1.write(fv_name="sport", pkt_offset="UDP.sport") - vm1.write(fv_name="dIP", pkt_offset="IP.dst") - vm1.write(fv_name="dport", pkt_offset="UDP.dport") - vm1.fix_chksum(offset='IP') - # Direction 0 --> 1 - vm2 = STLVM() - vm2.var(name="sIP", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op="inc", - next_var="sport") - vm2.var(name="sport", - min_value=self.p2_src_start_udp_port, - max_value=self.p2_src_end_udp_port, - size=2, - op="inc") - vm2.var(name="dIP", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op="inc", - next_var="dport") - vm2.var(name="dport", - min_value=self.p2_dst_start_udp_port, - max_value=self.p2_dst_end_udp_port, - size=2, - op="inc") - vm2.write(fv_name="sIP", pkt_offset="IP.src") - vm2.write(fv_name="sport", pkt_offset="UDP.sport") - vm2.write(fv_name="dIP", pkt_offset="IP.dst") - vm2.write(fv_name="dport", pkt_offset="UDP.dport") - vm2.fix_chksum(offset='IP') - - return base_pkt_a, base_pkt_b, vm1, vm2 - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-ethip4udp-16384u63p.py b/GPL/traffic_profiles/trex/trex-sl-ethip4udp-16384u63p.py deleted file mode 100644 index 4a8e1a0b8d..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-ethip4udp-16384u63p.py +++ /dev/null @@ -1,169 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / UDP - - Direction 0 --> 1: - - Source IP address range: 192.168.0.0 - 192.168.63.255 - - Destination IP address range: 20.0.0.0 - - Source UDP port range: 1024 - 1086 - - Destination UDP port range: 1024 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.0 - - Destination IP address range: 68.142.68.0 - 68.142.68.15 - - Source UDP port range: 1024 - - Destination UDP port range: 1024 - 65535 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"192.168.0.0" - self.p1_src_end_ip = u"192.168.63.255" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.0.0" - - self.p2_src_start_ip = u"20.0.0.0" - self.p2_src_end_ip = u"20.0.0.0" - self.p2_dst_start_ip = u"68.142.68.0" - self.p2_dst_end_ip = u"68.142.68.15" - - # UDP ports used in packet headers. - self.p1_src_start_udp_port = 1024 - self.p1_src_end_udp_port = 1086 - self.p1_dst_start_udp_port = 1024 - self.p1_dst_end_udp_port = 1024 - - self.p2_src_start_udp_port = 1024 - self.p2_src_end_udp_port = 1024 - self.p2_dst_start_udp_port = 1024 - self.p2_dst_end_udp_port = 65535 - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | UDP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=17 - ) / - UDP( - sport=self.p1_src_start_udp_port, - dport=self.p1_dst_start_udp_port - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=17 - ) / - UDP( - sport=self.p2_src_start_udp_port, - dport=self.p2_dst_start_udp_port - ) - ) - - # Direction 0 --> 1 - vm1 = STLVM() - vm1.var(name="sIP", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op="inc", - next_var="sport") - vm1.var(name="sport", - min_value=self.p1_src_start_udp_port, - max_value=self.p1_src_end_udp_port, - size=2, - op="inc") - vm1.var(name="dIP", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op="inc") - vm1.var(name="dport", - min_value=self.p1_dst_start_udp_port, - max_value=self.p1_dst_end_udp_port, - size=2, - op="inc") - vm1.write(fv_name="sIP", pkt_offset="IP.src") - vm1.write(fv_name="sport", pkt_offset="UDP.sport") - vm1.write(fv_name="dIP", pkt_offset="IP.dst") - vm1.write(fv_name="dport", pkt_offset="UDP.dport") - vm1.fix_chksum(offset='IP') - # Direction 0 --> 1 - vm2 = STLVM() - vm2.var(name="sIP", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op="inc", - next_var="sport") - vm2.var(name="sport", - min_value=self.p2_src_start_udp_port, - max_value=self.p2_src_end_udp_port, - size=2, - op="inc") - vm2.var(name="dIP", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op="inc", - next_var="dport") - vm2.var(name="dport", - min_value=self.p2_dst_start_udp_port, - max_value=self.p2_dst_end_udp_port, - size=2, - op="inc") - vm2.write(fv_name="sIP", pkt_offset="IP.src") - vm2.write(fv_name="sport", pkt_offset="UDP.sport") - vm2.write(fv_name="dIP", pkt_offset="IP.dst") - vm2.write(fv_name="dport", pkt_offset="UDP.dport") - vm2.fix_chksum(offset='IP') - - return base_pkt_a, base_pkt_b, vm1, vm2 - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-ethip4udp-1u63p.py b/GPL/traffic_profiles/trex/trex-sl-ethip4udp-1u63p.py deleted file mode 100644 index ed28e915ca..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-ethip4udp-1u63p.py +++ /dev/null @@ -1,169 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / UDP - - Direction 0 --> 1: - - Source IP address range: 192.168.0.0 - - Destination IP address range: 20.0.0.0 - - Source UDP port range: 1024 - 1086 - - Destination UDP port range: 1024 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.0 - - Destination IP address range: 68.142.68.0 - - Source UDP port range: 1024 - - Destination UDP port range: 1024 - 16017 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"192.168.0.0" - self.p1_src_end_ip = u"192.168.0.0" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.0.0" - - self.p2_src_start_ip = u"20.0.0.0" - self.p2_src_end_ip = u"20.0.0.0" - self.p2_dst_start_ip = u"68.142.68.0" - self.p2_dst_end_ip = u"68.142.68.0" - - # UDP ports used in packet headers. - self.p1_src_start_udp_port = 1024 - self.p1_src_end_udp_port = 1086 - self.p1_dst_start_udp_port = 1024 - self.p1_dst_end_udp_port = 1024 - - self.p2_src_start_udp_port = 1024 - self.p2_src_end_udp_port = 1024 - self.p2_dst_start_udp_port = 1024 - self.p2_dst_end_udp_port = 16017 - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | UDP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=17 - ) / - UDP( - sport=self.p1_src_start_udp_port, - dport=self.p1_dst_start_udp_port - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=17 - ) / - UDP( - sport=self.p2_src_start_udp_port, - dport=self.p2_dst_start_udp_port - ) - ) - - # Direction 0 --> 1 - vm1 = STLVM() - vm1.var(name="sIP", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op="inc", - next_var="sport") - vm1.var(name="sport", - min_value=self.p1_src_start_udp_port, - max_value=self.p1_src_end_udp_port, - size=2, - op="inc") - vm1.var(name="dIP", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op="inc") - vm1.var(name="dport", - min_value=self.p1_dst_start_udp_port, - max_value=self.p1_dst_end_udp_port, - size=2, - op="inc") - vm1.write(fv_name="sIP", pkt_offset="IP.src") - vm1.write(fv_name="sport", pkt_offset="UDP.sport") - vm1.write(fv_name="dIP", pkt_offset="IP.dst") - vm1.write(fv_name="dport", pkt_offset="UDP.dport") - vm1.fix_chksum(offset='IP') - # Direction 0 --> 1 - vm2 = STLVM() - vm2.var(name="sIP", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op="inc", - next_var="sport") - vm2.var(name="sport", - min_value=self.p2_src_start_udp_port, - max_value=self.p2_src_end_udp_port, - size=2, - op="inc") - vm2.var(name="dIP", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op="inc", - next_var="dport") - vm2.var(name="dport", - min_value=self.p2_dst_start_udp_port, - max_value=self.p2_dst_end_udp_port, - size=2, - op="inc") - vm2.write(fv_name="sIP", pkt_offset="IP.src") - vm2.write(fv_name="sport", pkt_offset="UDP.sport") - vm2.write(fv_name="dIP", pkt_offset="IP.dst") - vm2.write(fv_name="dport", pkt_offset="UDP.dport") - vm2.fix_chksum(offset='IP') - - return base_pkt_a, base_pkt_b, vm1, vm2 - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-ethip4udp-238u63p.py b/GPL/traffic_profiles/trex/trex-sl-ethip4udp-238u63p.py deleted file mode 100644 index f6b2276351..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-ethip4udp-238u63p.py +++ /dev/null @@ -1,169 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / UDP - - Direction 0 --> 1: - - Source IP address range: 192.168.0.0 - 192.168.0.237 - - Destination IP address range: 20.0.0.0 - - Source UDP port range: 1024 - 1086 - - Destination UDP port range: 1024 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.0 - - Destination IP address range: 68.142.68.0 - - Source UDP port range: 1024 - - Destination UDP port range: 1024 - 16017 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"192.168.0.0" - self.p1_src_end_ip = u"192.168.0.237" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.0.0" - - self.p2_src_start_ip = u"20.0.0.0" - self.p2_src_end_ip = u"20.0.0.0" - self.p2_dst_start_ip = u"68.142.68.0" - self.p2_dst_end_ip = u"68.142.68.0" - - # UDP ports used in packet headers. - self.p1_src_start_udp_port = 1024 - self.p1_src_end_udp_port = 1086 - self.p1_dst_start_udp_port = 1024 - self.p1_dst_end_udp_port = 1024 - - self.p2_src_start_udp_port = 1024 - self.p2_src_end_udp_port = 1024 - self.p2_dst_start_udp_port = 1024 - self.p2_dst_end_udp_port = 16017 - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | UDP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=17 - ) / - UDP( - sport=self.p1_src_start_udp_port, - dport=self.p1_dst_start_udp_port - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=17 - ) / - UDP( - sport=self.p2_src_start_udp_port, - dport=self.p2_dst_start_udp_port - ) - ) - - # Direction 0 --> 1 - vm1 = STLVM() - vm1.var(name="sIP", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op="inc", - next_var="sport") - vm1.var(name="sport", - min_value=self.p1_src_start_udp_port, - max_value=self.p1_src_end_udp_port, - size=2, - op="inc") - vm1.var(name="dIP", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op="inc") - vm1.var(name="dport", - min_value=self.p1_dst_start_udp_port, - max_value=self.p1_dst_end_udp_port, - size=2, - op="inc") - vm1.write(fv_name="sIP", pkt_offset="IP.src") - vm1.write(fv_name="sport", pkt_offset="UDP.sport") - vm1.write(fv_name="dIP", pkt_offset="IP.dst") - vm1.write(fv_name="dport", pkt_offset="UDP.dport") - vm1.fix_chksum(offset='IP') - # Direction 0 --> 1 - vm2 = STLVM() - vm2.var(name="sIP", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op="inc", - next_var="sport") - vm2.var(name="sport", - min_value=self.p2_src_start_udp_port, - max_value=self.p2_src_end_udp_port, - size=2, - op="inc") - vm2.var(name="dIP", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op="inc", - next_var="dport") - vm2.var(name="dport", - min_value=self.p2_dst_start_udp_port, - max_value=self.p2_dst_end_udp_port, - size=2, - op="inc") - vm2.write(fv_name="sIP", pkt_offset="IP.src") - vm2.write(fv_name="sport", pkt_offset="UDP.sport") - vm2.write(fv_name="dIP", pkt_offset="IP.dst") - vm2.write(fv_name="dport", pkt_offset="UDP.dport") - vm2.fix_chksum(offset='IP') - - return base_pkt_a, base_pkt_b, vm1, vm2 - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-ethip4udp-262144u63p.py b/GPL/traffic_profiles/trex/trex-sl-ethip4udp-262144u63p.py deleted file mode 100644 index 9cd7443b07..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-ethip4udp-262144u63p.py +++ /dev/null @@ -1,169 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / UDP - - Direction 0 --> 1: - - Source IP address range: 172.16.0.0 - 172.19.255.255 - - Destination IP address range: 20.0.0.0 - - Source UDP port range: 1024 - 1086 - - Destination UDP port range: 1024 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.0 - - Destination IP address range: 68.142.68.0 - 68.142.68.255 - - Source UDP port range: 1024 - - Destination UDP port range: 1024 - 65535 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"172.16.0.0" - self.p1_src_end_ip = u"172.19.255.255" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.0.0" - - self.p2_src_start_ip = u"20.0.0.0" - self.p2_src_end_ip = u"20.0.0.0" - self.p2_dst_start_ip = u"68.142.68.0" - self.p2_dst_end_ip = u"68.142.68.255" - - # UDP ports used in packet headers. - self.p1_src_start_udp_port = 1024 - self.p1_src_end_udp_port = 1086 - self.p1_dst_start_udp_port = 1024 - self.p1_dst_end_udp_port = 1024 - - self.p2_src_start_udp_port = 1024 - self.p2_src_end_udp_port = 1024 - self.p2_dst_start_udp_port = 1024 - self.p2_dst_end_udp_port = 65535 - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | UDP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=17 - ) / - UDP( - sport=self.p1_src_start_udp_port, - dport=self.p1_dst_start_udp_port - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=17 - ) / - UDP( - sport=self.p2_src_start_udp_port, - dport=self.p2_dst_start_udp_port - ) - ) - - # Direction 0 --> 1 - vm1 = STLVM() - vm1.var(name="sIP", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op="inc", - next_var="sport") - vm1.var(name="sport", - min_value=self.p1_src_start_udp_port, - max_value=self.p1_src_end_udp_port, - size=2, - op="inc") - vm1.var(name="dIP", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op="inc") - vm1.var(name="dport", - min_value=self.p1_dst_start_udp_port, - max_value=self.p1_dst_end_udp_port, - size=2, - op="inc") - vm1.write(fv_name="sIP", pkt_offset="IP.src") - vm1.write(fv_name="sport", pkt_offset="UDP.sport") - vm1.write(fv_name="dIP", pkt_offset="IP.dst") - vm1.write(fv_name="dport", pkt_offset="UDP.dport") - vm1.fix_chksum(offset='IP') - # Direction 0 --> 1 - vm2 = STLVM() - vm2.var(name="sIP", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op="inc", - next_var="sport") - vm2.var(name="sport", - min_value=self.p2_src_start_udp_port, - max_value=self.p2_src_end_udp_port, - size=2, - op="inc") - vm2.var(name="dIP", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op="inc", - next_var="dport") - vm2.var(name="dport", - min_value=self.p2_dst_start_udp_port, - max_value=self.p2_dst_end_udp_port, - size=2, - op="inc") - vm2.write(fv_name="sIP", pkt_offset="IP.src") - vm2.write(fv_name="sport", pkt_offset="UDP.sport") - vm2.write(fv_name="dIP", pkt_offset="IP.dst") - vm2.write(fv_name="dport", pkt_offset="UDP.dport") - vm2.fix_chksum(offset='IP') - - return base_pkt_a, base_pkt_b, vm1, vm2 - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-ethip4udp-4096u63p.py b/GPL/traffic_profiles/trex/trex-sl-ethip4udp-4096u63p.py deleted file mode 100644 index a180c65902..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-ethip4udp-4096u63p.py +++ /dev/null @@ -1,169 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / UDP - - Direction 0 --> 1: - - Source IP address range: 192.168.0.0 - 192.168.15.255 - - Destination IP address range: 20.0.0.0 - - Source UDP port range: 1024 - 1086 - - Destination UDP port range: 1024 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.0 - - Destination IP address range: 68.142.68.0 - 68.142.68.3 - - Source UDP port range: 1024 - - Destination UDP port range: 1024 - 65535 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"192.168.0.0" - self.p1_src_end_ip = u"192.168.15.255" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.0.0" - - self.p2_src_start_ip = u"20.0.0.0" - self.p2_src_end_ip = u"20.0.0.0" - self.p2_dst_start_ip = u"68.142.68.0" - self.p2_dst_end_ip = u"68.142.68.3" - - # UDP ports used in packet headers. - self.p1_src_start_udp_port = 1024 - self.p1_src_end_udp_port = 1086 - self.p1_dst_start_udp_port = 1024 - self.p1_dst_end_udp_port = 1024 - - self.p2_src_start_udp_port = 1024 - self.p2_src_end_udp_port = 1024 - self.p2_dst_start_udp_port = 1024 - self.p2_dst_end_udp_port = 65535 - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | UDP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=17 - ) / - UDP( - sport=self.p1_src_start_udp_port, - dport=self.p1_dst_start_udp_port - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=17 - ) / - UDP( - sport=self.p2_src_start_udp_port, - dport=self.p2_dst_start_udp_port - ) - ) - - # Direction 0 --> 1 - vm1 = STLVM() - vm1.var(name="sIP", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op="inc", - next_var="sport") - vm1.var(name="sport", - min_value=self.p1_src_start_udp_port, - max_value=self.p1_src_end_udp_port, - size=2, - op="inc") - vm1.var(name="dIP", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op="inc") - vm1.var(name="dport", - min_value=self.p1_dst_start_udp_port, - max_value=self.p1_dst_end_udp_port, - size=2, - op="inc") - vm1.write(fv_name="sIP", pkt_offset="IP.src") - vm1.write(fv_name="sport", pkt_offset="UDP.sport") - vm1.write(fv_name="dIP", pkt_offset="IP.dst") - vm1.write(fv_name="dport", pkt_offset="UDP.dport") - vm1.fix_chksum(offset='IP') - # Direction 0 --> 1 - vm2 = STLVM() - vm2.var(name="sIP", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op="inc", - next_var="sport") - vm2.var(name="sport", - min_value=self.p2_src_start_udp_port, - max_value=self.p2_src_end_udp_port, - size=2, - op="inc") - vm2.var(name="dIP", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op="inc", - next_var="dport") - vm2.var(name="dport", - min_value=self.p2_dst_start_udp_port, - max_value=self.p2_dst_end_udp_port, - size=2, - op="inc") - vm2.write(fv_name="sIP", pkt_offset="IP.src") - vm2.write(fv_name="sport", pkt_offset="UDP.sport") - vm2.write(fv_name="dIP", pkt_offset="IP.dst") - vm2.write(fv_name="dport", pkt_offset="UDP.dport") - vm2.fix_chksum(offset='IP') - - return base_pkt_a, base_pkt_b, vm1, vm2 - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-ethip4udp-65536u63p.py b/GPL/traffic_profiles/trex/trex-sl-ethip4udp-65536u63p.py deleted file mode 100644 index 562b9ee314..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-ethip4udp-65536u63p.py +++ /dev/null @@ -1,169 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / UDP - - Direction 0 --> 1: - - Source IP address range: 192.168.0.0 - 192.168.255.255 - - Destination IP address range: 20.0.0.0 - - Source UDP port range: 1024 - 1086 - - Destination UDP port range: 1024 - - Direction 1 --> 0: - - Source IP address range: 20.0.0.0 - - Destination IP address range: 68.142.68.0 - 68.142.68.63 - - Source UDP port range: 1024 - - Destination UDP port range: 1024 - 65535 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - # IPs used in packet headers. - self.p1_src_start_ip = u"192.168.0.0" - self.p1_src_end_ip = u"192.168.255.255" - self.p1_dst_start_ip = u"20.0.0.0" - self.p1_dst_end_ip = u"20.0.0.0" - - self.p2_src_start_ip = u"20.0.0.0" - self.p2_src_end_ip = u"20.0.0.0" - self.p2_dst_start_ip = u"68.142.68.0" - self.p2_dst_end_ip = u"68.142.68.63" - - # UDP ports used in packet headers. - self.p1_src_start_udp_port = 1024 - self.p1_src_end_udp_port = 1086 - self.p1_dst_start_udp_port = 1024 - self.p1_dst_end_udp_port = 1024 - - self.p2_src_start_udp_port = 1024 - self.p2_src_end_udp_port = 1024 - self.p2_dst_start_udp_port = 1024 - self.p2_dst_end_udp_port = 65535 - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | UDP | - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether() / - IP( - src=self.p1_src_start_ip, - dst=self.p1_dst_start_ip, - proto=17 - ) / - UDP( - sport=self.p1_src_start_udp_port, - dport=self.p1_dst_start_udp_port - ) - ) - # Direction 1 --> 0 - base_pkt_b = ( - Ether() / - IP( - src=self.p2_src_start_ip, - dst=self.p2_dst_start_ip, - proto=17 - ) / - UDP( - sport=self.p2_src_start_udp_port, - dport=self.p2_dst_start_udp_port - ) - ) - - # Direction 0 --> 1 - vm1 = STLVM() - vm1.var(name="sIP", - min_value=self.p1_src_start_ip, - max_value=self.p1_src_end_ip, - size=4, - op="inc", - next_var="sport") - vm1.var(name="sport", - min_value=self.p1_src_start_udp_port, - max_value=self.p1_src_end_udp_port, - size=2, - op="inc") - vm1.var(name="dIP", - min_value=self.p1_dst_start_ip, - max_value=self.p1_dst_end_ip, - size=4, - op="inc") - vm1.var(name="dport", - min_value=self.p1_dst_start_udp_port, - max_value=self.p1_dst_end_udp_port, - size=2, - op="inc") - vm1.write(fv_name="sIP", pkt_offset="IP.src") - vm1.write(fv_name="sport", pkt_offset="UDP.sport") - vm1.write(fv_name="dIP", pkt_offset="IP.dst") - vm1.write(fv_name="dport", pkt_offset="UDP.dport") - vm1.fix_chksum(offset='IP') - # Direction 0 --> 1 - vm2 = STLVM() - vm2.var(name="sIP", - min_value=self.p2_src_start_ip, - max_value=self.p2_src_end_ip, - size=4, - op="inc", - next_var="sport") - vm2.var(name="sport", - min_value=self.p2_src_start_udp_port, - max_value=self.p2_src_end_udp_port, - size=2, - op="inc") - vm2.var(name="dIP", - min_value=self.p2_dst_start_ip, - max_value=self.p2_dst_end_ip, - size=4, - op="inc", - next_var="dport") - vm2.var(name="dport", - min_value=self.p2_dst_start_udp_port, - max_value=self.p2_dst_end_udp_port, - size=2, - op="inc") - vm2.write(fv_name="sIP", pkt_offset="IP.src") - vm2.write(fv_name="sport", pkt_offset="UDP.sport") - vm2.write(fv_name="dIP", pkt_offset="IP.dst") - vm2.write(fv_name="dport", pkt_offset="UDP.dport") - vm2.fix_chksum(offset='IP') - - return base_pkt_a, base_pkt_b, vm1, vm2 - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-sl-ethip4vxlan-ip4src1udpsrcrnd.py b/GPL/traffic_profiles/trex/trex-sl-ethip4vxlan-ip4src1udpsrcrnd.py deleted file mode 100644 index cd1a0a690c..0000000000 --- a/GPL/traffic_profiles/trex/trex-sl-ethip4vxlan-ip4src1udpsrcrnd.py +++ /dev/null @@ -1,261 +0,0 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Stream profile for T-rex traffic generator. - -Stream profile: - - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. - - Packet: ETH / IP / VXLAN / ETH / IP - - Direction 0 --> 1: - - Source IP address: 172.17.0.2 - - Destination IP address: 172.16.0.1 - - Source UDP port: random([1024-65535]) - - Destination UDP port: 4789 - - VXLAN VNI: 0 - - Payload source MAC address: 00:aa:aa:00:00:[00..ff] - - Payload source IP address: 10.0.0.2 - - Payload destination MAC address: 00:bb:bb:00:00:[00..ff] - - Payload destination IP address: 10.0.0.1 - - Direction 1 --> 0: - - Source IP address: 172.27.0.2 - - Destination IP address: 172.26.0.1 - - Source UDP port: random([1024-65535]) - - Destination UDP port: 4789 - - VXLAN VNI: 0 - - Payload source MAC address: 00:bb:bb:00:00:[00..ff] - - Payload source IP address: 10.0.0.1 - - Payload destination MAC address: 00:aa:aa:00:00:[00..ff] - - Payload destination IP address: 10.0.0.2 -""" - -from trex.stl.api import * -from profile_trex_stateless_base_class import TrafficStreamsBaseClass - -# RFC 7348 - Virtual eXtensible Local Area Network (VXLAN): -# A Framework for Overlaying Virtualized Layer 2 Networks over Layer 3 Networks -# http://tools.ietf.org/html/rfc7348 -_VXLAN_FLAGS = list(u"R"*24 + u"RRRIRRRRR") - - -class VXLAN(Packet): - name=u"VXLAN" - fields_desc = [ - FlagsField(u"flags", 0x08000000, 32, _VXLAN_FLAGS), - ThreeBytesField(u"vni", 0), - XByteField(u"reserved", 0x00) - ] - - def mysummary(self): - return self.sprintf(u"VXLAN (vni=%VXLAN.vni%)") - - -bind_layers(UDP, VXLAN, dport=4789) -bind_layers(VXLAN, Ether) - - -class TrafficStreams(TrafficStreamsBaseClass): - """Stream profile.""" - - def __init__(self): - """Initialization and setting of streams' parameters.""" - - super(TrafficStreamsBaseClass, self).__init__() - - self.nf_chains = 1 - - def define_packets(self): - """Defines the packets to be sent from the traffic generator. - - Packet definition: | ETH | IP | VXLAN | ETH | IP - - :returns: Packets to be sent from the traffic generator. - :rtype: tuple - """ - - # Direction 0 --> 1 - base_pkt_a = ( - Ether()/ - IP( - src=u"172.17.0.2", - dst=u"172.16.0.1" - )/ - UDP( - sport=1024, - dport=4789)/ - VXLAN( - vni=0 - )/ - Ether( - src=u"00:aa:aa:00:00:00", - dst=u"00:bb:bb:00:00:00" - )/ - IP( - src=u"10.0.0.2", - dst=u"10.0.0.1", - proto=61 - ) - ) - - # Direction 1 --> 0 - base_pkt_b = ( - Ether()/ - IP( - src=u"172.27.0.2", - dst=u"172.26.0.1" - )/ - UDP( - sport=1024, - dport=4789 - )/ - VXLAN( - vni=0 - )/ - Ether( - src=u"00:bb:bb:00:00:00", - dst=u"00:aa:aa:00:00:00" - )/ - IP( - src=u"10.0.0.1", - dst=u"10.0.0.2", - proto=61 - ) - ) - - # Direction 0 --> 1 - vm1 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"nf_id", - size=1, - op=u"inc", - min_value=0, - max_value=self.nf_chains - 1 - ), - STLVmFlowVar( - name=u"in_mac", - size=2, - op=u"inc", - min_value=0, - max_value=255 - ), - STLVmFlowVar( - name=u"in_ip", - size=1, - op=u"inc", - min_value=0, - max_value=255 - ), - STLVmFlowVar( - name=u"src_port", - size=2, - op=u"random", - min_value=1024, - max_value=65535 - ), - STLVmWrFlowVar( - fv_name=u"nf_id", - pkt_offset=28 - ), - STLVmWrFlowVar( - fv_name=u"src_port", - pkt_offset=u"UDP.sport" - ), - STLVmWrFlowVar( - fv_name=u"nf_id", - pkt_offset=48 - ), - STLVmWrFlowVar( - fv_name=u"in_mac", - pkt_offset=54 - ), - STLVmWrFlowVar( - fv_name=u"in_mac", - pkt_offset=60 - ), - STLVmFixChecksumHw( - l3_offset="IP:{}".format(0), - l4_offset="UDP:{}".format(0), - l4_type=CTRexVmInsFixHwCs.L4_TYPE_UDP - ) - ] - ) - - # Direction 1 --> 0 - vm2 = STLScVmRaw( - [ - STLVmFlowVar( - name=u"nf_id", - size=1, - op=u"inc", - min_value=0, - max_value=self.nf_chains - 1 - ), - STLVmFlowVar( - name=u"in_mac", - size=2, op=u"inc", - min_value=0, - max_value=255 - ), - STLVmFlowVar( - name=u"in_ip", - size=1, op=u"inc", - min_value=0, - max_value=255 - ), - STLVmFlowVar( - name=u"src_port", - size=2, - op=u"random", - min_value=1024, - max_value=65535 - ), - STLVmWrFlowVar( - fv_name=u"nf_id", - pkt_offset=28 - ), - STLVmWrFlowVar( - fv_name=u"src_port", - pkt_offset=u"UDP.sport" - ), - STLVmWrFlowVar( - fv_name=u"nf_id", - pkt_offset=48 - ), - STLVmWrFlowVar( - fv_name=u"in_mac", - pkt_offset=54 - ), - STLVmWrFlowVar( - fv_name=u"in_mac", - pkt_offset=60 - ), - STLVmFixChecksumHw( - l3_offset="IP:{}".format(0), - l4_offset="UDP:{}".format(0), - l4_type=CTRexVmInsFixHwCs.L4_TYPE_UDP - ) - ] - ) - - return base_pkt_a, base_pkt_b, vm1, vm2 - -def register(): - """Register this traffic profile to T-rex. - - Do not change this function. - - :return: Traffic streams. - :rtype: Object - """ - return TrafficStreams() - diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-dot1qip4asym-ip4src254.py b/GPL/traffic_profiles/trex/trex-stl-2n-dot1qip4asym-ip4src254.py new file mode 100644 index 0000000000..ae411e233b --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-2n-dot1qip4asym-ip4src254.py @@ -0,0 +1,133 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Direction 0 --> 1: + - Packet: ETH / IP / + - Source IP address range: 10.10.10.1 - 10.10.10.254 + - Destination IP address range: 20.20.20.1 + - Direction 1 --> 0: + - Packet: ETH / DOT1Q / IP / + - Source IP address range: 20.20.20.1 - 20.20.20.254 + - Destination IP address range: 10.10.10.1 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # VLAN ID + self.vlan_id = 10 + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.10.10.1" + self.p1_src_end_ip = u"10.10.10.254" + self.p1_dst_start_ip = u"20.20.20.1" + + self.p2_src_start_ip = u"20.20.20.1" + self.p2_src_end_ip = u"20.20.20.254" + self.p2_dst_start_ip = u"10.10.10.1" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether() / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether() / + Dot1Q( + vlan=self.vlan_id + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-dot1qip6asym-ip6src253.py b/GPL/traffic_profiles/trex/trex-stl-2n-dot1qip6asym-ip6src253.py new file mode 100644 index 0000000000..f2e9e81920 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-2n-dot1qip6asym-ip6src253.py @@ -0,0 +1,134 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Direction 0 --> 1: + - Packet: ETH / IPv6 / + - Source IP address range: 2001:1::2 - 2001:1::FE + - Destination IP address range: 2001:2::2 + - Direction 1 --> 0: + - Packet: ETH / DOT1Q / IPv6 / + - Source IP address range: 2001:2::2 - 2001:2::FE + - Destination IP address range: 2001:1::2 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # VLAN ID + self.vlan_id = 10 + + # IPs used in packet headers. + self.p1_src_start_ip = u"2001:1::2" + self.p1_src_end_ip = u"2001:1::FE" + self.p1_dst_start_ip = u"2001:2::2" + + self.p2_src_start_ip = u"2001:2::2" + self.p2_src_end_ip = u"2001:2::FE" + self.p2_dst_start_ip = u"2001:1::2" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IPv6 | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + base_p1, count_p1 = self._get_start_end_ipv6( + self.p1_src_start_ip, + self.p1_src_end_ip + ) + base_p2, count_p2 = self._get_start_end_ipv6( + self.p2_src_start_ip, + self.p2_src_end_ip + ) + + # Direction 0 --> 1 + base_pkt_a = ( + Ether() / + IPv6( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether() / + Dot1Q( + vlan=self.vlan_id + ) / + IPv6( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"ipv6_src", + min_value=base_p1, + max_value=base_p1 + count_p1, + size=8, op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ipv6_src", + pkt_offset=u"IPv6.src", + offset_fixup=8 + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"ipv6_src", + min_value=base_p2, + max_value=base_p2 + count_p2, + size=8, op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ipv6_src", + pkt_offset=u"IPv6.src", + offset_fixup=8 + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :returns: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst-rnd10000.py b/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst-rnd10000.py new file mode 100644 index 0000000000..16627f0884 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst-rnd10000.py @@ -0,0 +1,127 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.39.15 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.39.15 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams" parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.39.15" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.39.15" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + 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 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVarRepeatableRandom( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + limit=10000 + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVarRepeatableRandom( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + limit=10000 + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst-rnd100000.py b/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst-rnd100000.py new file mode 100644 index 0000000000..751528d10c --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst-rnd100000.py @@ -0,0 +1,126 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.1.134.159 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.1.134.159 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams" parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.1.134.159" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.1.134.159" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + 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 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVarRepeatableRandom( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + limit=100000 + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVarRepeatableRandom( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + limit=100000 + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst-rnd1000000.py b/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst-rnd1000000.py new file mode 100644 index 0000000000..58ab03516c --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst-rnd1000000.py @@ -0,0 +1,126 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.15.66.63 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.15.66.63 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams" parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.15.66.63" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.15.66.63" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + 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 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVarRepeatableRandom( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + limit=1000000 + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVarRepeatableRandom( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + limit=1000000 + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst10000.py b/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst10000.py new file mode 100644 index 0000000000..e9d5fb15f6 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst10000.py @@ -0,0 +1,125 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.39.15 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.39.15 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.39.15" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.39.15" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + 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 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst100000.py b/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst100000.py new file mode 100644 index 0000000000..5977d36b5b --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst100000.py @@ -0,0 +1,126 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.1.134.159 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.1.134.159 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.1.134.159" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.1.134.159" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + 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 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst1000000.py b/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst1000000.py new file mode 100644 index 0000000000..8b63b82e4f --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4dst1000000.py @@ -0,0 +1,126 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.15.66.63 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.15.66.63 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.15.66.63" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.15.66.63" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + 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 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name="dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op="inc" + ), + STLVmWrFlowVar( + fv_name="dst", + pkt_offset="IP.dst" + ), + STLVmFixIpv4( + offset="IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name="dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op="inc" + ), + STLVmWrFlowVar( + fv_name="dst", + pkt_offset="IP.dst" + ), + STLVmFixIpv4( + offset="IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4src253.py b/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4src253.py new file mode 100644 index 0000000000..883883ad18 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4src253.py @@ -0,0 +1,126 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.10.10.2 - 10.10.10.254 + - Destination IP address range: 20.20.20.2 + - Direction 1 --> 0: + - Source IP address range: 20.20.20.2 - 20.20.20.254 + - Destination IP address range: 10.10.10.2 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.10.10.2" + self.p1_src_end_ip = u"10.10.10.254" + self.p1_dst_start_ip = u"20.20.20.2" + + self.p2_src_start_ip = u"20.20.20.2" + self.p2_src_end_ip = u"20.20.20.254" + self.p2_dst_start_ip = u"10.10.10.2" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + 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 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4src254.py b/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4src254.py new file mode 100644 index 0000000000..fc6167d126 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-ip4src254.py @@ -0,0 +1,126 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.10.10.1 - 10.10.10.254 + - Destination IP address range: 20.20.20.1 + - Direction 1 --> 0: + - Source IP address range: 20.20.20.1 - 20.20.20.254 + - Destination IP address range: 10.10.10.1 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.10.10.1" + self.p1_src_end_ip = u"10.10.10.254" + self.p1_dst_start_ip = u"20.20.20.1" + + self.p2_src_start_ip = u"20.20.20.1" + self.p2_src_end_ip = u"20.20.20.254" + self.p2_dst_start_ip = u"10.10.10.1" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + 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 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-macsrc500kdst500k.py b/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-macsrc500kdst500k.py new file mode 100644 index 0000000000..9c55482078 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-macsrc500kdst500k.py @@ -0,0 +1,215 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source MAC address range: ca:fe:00:00:00:00 - ca:fe:00:07:a1:1f + - Destination MAC address range: fa:ce:00:00:00:00 - fa:ce:00:07:a1:1f + - Source IP address range: 10.0.0.0 - 10.7.161.31 + - Destination IP address range: 20.0.0.0 - 20.7.161.31 + - Direction 1 --> 0: + - Source MAC address range: fa:ce:00:00:00:00 - fa:ce:00:07:a1:1f + - Destination MAC address range: ca:fe:00:00:00:00 - ca:fe:00:07:a1:1f + - Source IP address range: 20.0.0.0 - 20.7.161.31 + - Destination IP address range: 10.0.0.0 - 10.7.161.31 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.clients = 500000 + + # MACs used in packet headers. + self.p1_src_start_mac = u"ca:fe:00:00:00:00" # mask: 00:00:FF:FF:FF:FF + self.p1_dst_start_mac = u"fa:ce:00:00:00:00" # mask: 00:00:FF:FF:FF:FF + + self.p2_src_start_mac = u"fa:ce:00:00:00:00" # mask: 00:00:FF:FF:FF:FF + self.p2_dst_start_mac = u"ca:fe:00:00:00:00" # mask: 00:00:FF:FF:FF:FF + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.0" + self.p1_src_end_ip = u"10.7.161.31" + + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.7.161.31" + + self.p2_src_start_ip = u"20.0.0.0" + self.p2_src_end_ip = u"20.7.161.31" + + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.7.161.31" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + src=self.p1_src_start_mac, + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + src=self.p2_src_start_mac, + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_src", + min_value=0, + max_value=self.clients-1, + size=4, + op=u"inc" + ), + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=self.clients-1, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_src", + pkt_offset= 8 + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset= 2 + ), + STLVmFlowVar( + name=u"ip_src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ip_src", + pkt_offset=u"IP.src" + ), + STLVmFlowVar( + name=u"ip_dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ip_dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_src", + min_value=0, + max_value=self.clients-1, + size=4, + op=u"inc" + ), + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=self.clients-1, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_src", + pkt_offset= 8 + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset= 2 + ), + STLVmFlowVar( + name=u"ip_src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ip_src", + pkt_offset=u"IP.src" + ), + STLVmFlowVar( + name=u"ip_dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ip_dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-macsrc50kdst50k.py b/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-macsrc50kdst50k.py new file mode 100644 index 0000000000..42e3db6a6f --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-macsrc50kdst50k.py @@ -0,0 +1,214 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source MAC address range: ca:fe:00:00:00:00 - ca:fe:00:00:c3:4f + - Destination MAC address range: fa:ce:00:00:00:00 - fa:ce:00:00:c3:4f + - Source IP address range: 10.0.0.0 - 10.0.195.79 + - Destination IP address range: 20.0.0.0 - 20.0.195.79 + - Direction 1 --> 0: + - Source MAC address range: fa:ce:00:00:00:00 - fa:ce:00:00:c3:4f + - Destination MAC address range: ca:fe:00:00:00:00 - ca:fe:00:00:c3:4f + - Source IP address range: 20.0.0.0 - 20.0.195.79 + - Destination IP address range: 10.0.0.0 - 10.0.195.79 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.clients = 50000 + + # MACs used in packet headers. + self.p1_src_start_mac = u"ca:fe:00:00:00:00" # mask: 00:00:FF:FF:FF:FF + self.p1_dst_start_mac = u"fa:ce:00:00:00:00" # mask: 00:00:FF:FF:FF:FF + + self.p2_src_start_mac = u"fa:ce:00:00:00:00" # mask: 00:00:FF:FF:FF:FF + self.p2_dst_start_mac = u"ca:fe:00:00:00:00" # mask: 00:00:FF:FF:FF:FF + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.0" + self.p1_src_end_ip = u"10.0.195.79" + + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.195.79" + + self.p2_src_start_ip = u"20.0.0.0" + self.p2_src_end_ip = u"20.0.195.79" + + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.195.79" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + src=self.p1_src_start_mac, + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + src=self.p2_src_start_mac, + dst=self.p2_dst_start_mac) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_src", + min_value=0, + max_value=self.clients-1, + size=4, + op=u"inc" + ), + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=self.clients-1, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_src", + pkt_offset= 8 + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset= 2 + ), + STLVmFlowVar( + name=u"ip_src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ip_src", + pkt_offset=u"IP.src" + ), + STLVmFlowVar( + name=u"ip_dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ip_dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_src", + min_value=0, + max_value=self.clients-1, + size=4, + op=u"inc" + ), + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=self.clients-1, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_src", + pkt_offset= 8 + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset= 2 + ), + STLVmFlowVar( + name=u"ip_src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ip_src", + pkt_offset=u"IP.src" + ), + STLVmFlowVar( + name=u"ip_dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ip_dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-macsrc5kdst5k.py b/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-macsrc5kdst5k.py new file mode 100644 index 0000000000..29df3373d3 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-2n-ethip4-macsrc5kdst5k.py @@ -0,0 +1,215 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source MAC address range: ca:fe:00:00:00:00 - ca:fe:00:00:13:87 + - Destination MAC address range: fa:ce:00:00:00:00 - fa:ce:00:00:13:87 + - Source IP address range: 10.0.0.0 - 10.0.19.135 + - Destination IP address range: 20.0.0.0 - 20.0.19.135 + - Direction 1 --> 0: + - Source MAC address range: fa:ce:00:00:00:00 - fa:ce:00:00:13:87 + - Destination MAC address range: ca:fe:00:00:00:00 - ca:fe:00:00:13:87 + - Source IP address range: 20.0.0.0 - 20.0.19.135 + - Destination IP address range: 10.0.0.0 - 10.0.19.135 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.clients = 5000 + + # MACs used in packet headers. + self.p1_src_start_mac = u"ca:fe:00:00:00:00" # mask: 00:00:FF:FF:FF:FF + self.p1_dst_start_mac = u"fa:ce:00:00:00:00" # mask: 00:00:FF:FF:FF:FF + + self.p2_src_start_mac = u"fa:ce:00:00:00:00" # mask: 00:00:FF:FF:FF:FF + self.p2_dst_start_mac = u"ca:fe:00:00:00:00" # mask: 00:00:FF:FF:FF:FF + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.0" + self.p1_src_end_ip = u"10.0.19.135" + + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.19.135" + + self.p2_src_start_ip = u"20.0.0.0" + self.p2_src_end_ip = u"20.0.19.135" + + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.19.135" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + src=self.p1_src_start_mac, + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + src=self.p2_src_start_mac, + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_src", + min_value=0, + max_value=self.clients-1, + size=4, + op=u"inc" + ), + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=self.clients-1, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_src", + pkt_offset= 8 + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset= 2 + ), + STLVmFlowVar( + name=u"ip_src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ip_src", + pkt_offset=u"IP.src" + ), + STLVmFlowVar( + name=u"ip_dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ip_dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_src", + min_value=0, + max_value=self.clients-1, + size=4, + op=u"inc" + ), + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=self.clients-1, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_src", + pkt_offset= 8 + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset= 2 + ), + STLVmFlowVar( + name=u"ip_src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ip_src", + pkt_offset=u"IP.src" + ), + STLVmFlowVar( + name=u"ip_dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ip_dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4udp-1000u15p.py b/GPL/traffic_profiles/trex/trex-stl-2n-ethip4udp-1000u15p.py new file mode 100644 index 0000000000..64fe1a705f --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-2n-ethip4udp-1000u15p.py @@ -0,0 +1,146 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / UDP + - Direction 0 --> 1: + - Source IP address range: 20.0.0.0 - 20.0.3.231 + - Destination IP address range: 12.0.0.2 + - Source UDP port range: 1024 - 1038 + - Destination UDP port range: 1024 + - Direction 1 --> 0: + - Source IP address range: 12.0.0.2 + - Destination IP address range: 200.0.0.0 + - Source UDP port range: 1024 + - Destination UDP port range: 1024 - 16023 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"20.0.0.0" + self.p1_src_end_ip = u"20.0.3.231" + self.p1_dst_start_ip = u"12.0.0.2" + + self.p2_src_start_ip = u"12.0.0.2" + self.p2_src_end_ip = u"12.0.0.2" + self.p2_dst_start_ip = u"200.0.0.0" + + # UDP ports used in packet headers. + self.p1_src_start_udp_port = 1024 + self.p1_src_end_udp_port = 1038 + self.p1_dst_start_udp_port = 1024 + + self.p2_src_start_udp_port = 1024 + self.p2_dst_start_udp_port = 1024 + self.p2_dst_end_udp_port = 16023 + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | UDP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether() / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=17 + ) / + UDP( + sport=self.p1_src_start_udp_port, + dport=self.p1_dst_start_udp_port + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether() / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=17 + ) / + UDP( + sport=self.p2_src_start_udp_port, + dport=self.p2_dst_start_udp_port + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmTupleGen( + ip_min=self.p1_src_start_ip, + ip_max=self.p1_src_end_ip, + port_min=self.p1_src_start_udp_port, + port_max=self.p1_src_end_udp_port, + name=u"tuple" + ), + STLVmWrFlowVar( + fv_name=u"tuple.ip", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4(offset=u"IP"), + STLVmWrFlowVar( + fv_name=u"tuple.port", + pkt_offset=u"UDP.sport" + ) + ] + ) + # Direction 0 --> 1 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"dport", + min_value=self.p2_dst_start_udp_port, + max_value=self.p2_dst_end_udp_port, + size=2, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dport", + pkt_offset=u"UDP.dport" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4udp-10u1000p-conc.py b/GPL/traffic_profiles/trex/trex-stl-2n-ethip4udp-10u1000p-conc.py new file mode 100644 index 0000000000..77f05f8af3 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-2n-ethip4udp-10u1000p-conc.py @@ -0,0 +1,189 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / UDP + - Direction 0 --> 1: + - Source IP address range: 10.10.10.2 - 10.10.10.11 + - Destination IP address range: 20.20.20.2 - 20.20.20.11 + - Source UDP port range: 1001 - 2000 + - Destination UDP port range: 2001 - 3000 + - Direction 1 --> 0: + - Source IP address range: 20.20.20.2 - 20.20.20.11 + - Destination IP address range: 10.10.10.2 - 10.10.10.11 + - Source UDP port range: 2001 - 3000 + - Destination UDP port range: 1001 - 2000 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.10.10.2" + self.p1_src_end_ip = u"10.10.10.11" + self.p1_dst_start_ip = u"20.20.20.2" + self.p1_dst_end_ip = u"20.20.20.11" + + self.p2_src_start_ip = u"20.20.20.2" + self.p2_src_end_ip = u"20.20.20.11" + self.p2_dst_start_ip = u"10.10.10.2" + self.p2_dst_end_ip = u"10.10.10.11" + + # UDP ports used in packet headers. + self.p1_src_start_udp_port = 1001 + self.p1_src_end_udp_port = 2000 + self.p1_dst_start_udp_port = 2001 + self.p1_dst_end_udp_port = 3000 + + self.p2_src_start_udp_port = 2001 + self.p2_src_end_udp_port = 3000 + self.p2_dst_start_udp_port = 1001 + self.p2_dst_end_udp_port = 2000 + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | UDP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether() / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=17 + ) / + UDP( + sport=self.p1_src_start_udp_port, + dport=self.p1_dst_start_udp_port + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether() / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=17 + ) / + UDP( + sport=self.p2_src_start_udp_port, + dport=self.p2_dst_start_udp_port + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmTupleGen( + ip_min=self.p1_src_start_ip, + ip_max=self.p1_src_end_ip, + port_min=self.p1_src_start_udp_port, + port_max=self.p1_src_end_udp_port, + name=u"tuple1_src" + ), + STLVmTupleGen( + ip_min=self.p1_dst_start_ip, + ip_max=self.p1_dst_end_ip, + port_min=self.p1_dst_start_udp_port, + port_max=self.p1_dst_end_udp_port, + name=u"tuple1_dst" + ), + STLVmWrFlowVar( + fv_name=u"tuple1_src.ip", + pkt_offset=u"IP.src" + ), + STLVmWrFlowVar( + fv_name=u"tuple1_dst.ip", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ), + STLVmWrFlowVar( + fv_name=u"tuple1_src.port", + pkt_offset=u"UDP.sport" + ), + STLVmWrFlowVar( + fv_name=u"tuple1_dst.port", + pkt_offset=u"UDP.dport" + ) + ] + ) + # Direction 0 --> 1 + vm2 = STLScVmRaw( + [ + STLVmTupleGen( + ip_min=self.p2_src_start_ip, + ip_max=self.p2_src_end_ip, + port_min=self.p2_src_start_udp_port, + port_max=self.p2_src_end_udp_port, + name=u"tuple2_src" + ), + STLVmTupleGen( + ip_min=self.p2_dst_start_ip, + ip_max=self.p2_dst_end_ip, + port_min=self.p2_dst_start_udp_port, + port_max=self.p2_dst_end_udp_port, + name=u"tuple2_dst" + ), + STLVmWrFlowVar( + fv_name=u"tuple2_src.ip", + pkt_offset=u"IP.src" + ), + STLVmWrFlowVar( + fv_name=u"tuple2_dst.ip", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ), + STLVmWrFlowVar( + fv_name=u"tuple2_src.port", + pkt_offset=u"UDP.sport" + ), + STLVmWrFlowVar( + fv_name=u"tuple2_dst.port", + pkt_offset=u"UDP.dport" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4udp-1u1p.py b/GPL/traffic_profiles/trex/trex-stl-2n-ethip4udp-1u1p.py new file mode 100644 index 0000000000..4f96ffe342 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-2n-ethip4udp-1u1p.py @@ -0,0 +1,104 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / UDP + - Direction 0 --> 1: + - Source IP address range: 20.0.0.0 + - Destination IP address range: 30.0.0.0 + - Source UDP port range: 1024 + - Destination UDP port range: 1024 + - Direction 1 --> 0: + - Source IP address range: 30.0.0.0 + - Destination IP address range: 200.0.0.0 + - Source UDP port range: 1024 + - Destination UDP port range: 1028 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_ip = u"20.0.0.0" + self.p1_dst_ip = u"30.0.0.0" + + self.p2_src_ip = u"30.0.0.0" + self.p2_dst_ip = u"200.0.0.0" + + # UDP ports used in packet headers. + self.p1_src_udp_port = 1024 + self.p1_dst_udp_port = 1024 + + self.p2_src_udp_port = 1024 + self.p2_dst_udp_port = 2048 + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | UDP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether() / + IP( + src=self.p1_src_ip, + dst=self.p1_dst_ip, + proto=17 + ) / + UDP( + sport=self.p1_src_udp_port, + dport=self.p1_dst_udp_port + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether() / + IP( + src=self.p2_src_ip, + dst=self.p2_dst_ip, + proto=17 + ) / + UDP( + sport=self.p2_src_udp_port, + dport=self.p2_dst_udp_port + ) + ) + + return base_pkt_a, base_pkt_b, None, None + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip4udp-lb.py b/GPL/traffic_profiles/trex/trex-stl-2n-ethip4udp-lb.py new file mode 100644 index 0000000000..df05cbff17 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-2n-ethip4udp-lb.py @@ -0,0 +1,150 @@ +# Copyright (c) 2020 Intel and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Packet: ETH / IP / UDP + - Direction 0 --> 1: + - Source IP address range: 192.168.50.74 - 192.168.50.79 + - Destination IP address range: 90.1.2.1 + - Direction 1 --> 0: + - Source IP address range: 192.168.60.74 - 192.168.60.79 + - Destination IP address range: 192.168.50.74 - 192.168.50.79 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"192.168.50.74" + self.p1_src_end_ip = u"192.168.50.79" + self.p1_dst_start_ip = u"90.1.2.1" + + self.p2_src_start_ip = u"192.168.60.74" + self.p2_src_end_ip = u"192.168.60.79" + self.p2_dst_start_ip = u"192.168.50.74" + self.p2_dst_end_ip = u"192.168.50.79" + + # UDP ports used in packet headers. + self.p1_src_udp_port = 63 + self.p1_dst_udp_port = 20000 + + self.p2_src_udp_port = 3307 + self.p2_dst_udp_port = 63 + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | UDP + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether() / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=17) / + UDP( + sport=self.p1_src_udp_port, + dport=self.p1_dst_udp_port + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether() / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=17 + ) / + UDP( + sport=self.p2_src_udp_port, + dport=self.p2_dst_udp_port + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip6-ip6dst10000.py b/GPL/traffic_profiles/trex/trex-stl-2n-ethip6-ip6dst10000.py new file mode 100644 index 0000000000..f1b90350fb --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-2n-ethip6-ip6dst10000.py @@ -0,0 +1,129 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IPv6 / + - Direction 0 --> 1: + - Source IP address range: 2001:1::1 + - Destination IP address range: 2001:2::0 - 2001:2::270F + - Direction 1 --> 0: + - Source IP address range: 2001:2::1 + - Destination IP address range: 2001:1::0 - 2001:1::270F +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"2001:1::1" + self.p1_dst_start_ip = u"2001:2::0" + self.p1_dst_end_ip = u"2001:2::270F" + + self.p2_src_start_ip = u"2001:2::1" + self.p2_dst_start_ip = u"2001:1::0" + self.p2_dst_end_ip = u"2001:1::270F" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IPv6 | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + base_p1, count_p1 = self._get_start_end_ipv6( + self.p1_dst_start_ip, + self.p1_dst_end_ip + ) + base_p2, count_p2 = self._get_start_end_ipv6( + self.p2_dst_start_ip, + self.p2_dst_end_ip + ) + + # Direction 0 --> 1 + base_pkt_a = ( + Ether() / + IPv6( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether() / + IPv6( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"ipv6_dst", + min_value=base_p1, + max_value=base_p1 + count_p1, + size=8, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ipv6_dst", + pkt_offset=u"IPv6.dst", + offset_fixup=8 + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"ipv6_dst", + min_value=base_p2, + max_value=base_p2 + count_p2, + size=8, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ipv6_dst", + pkt_offset=u"IPv6.dst", + offset_fixup=8 + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip6-ip6dst100000.py b/GPL/traffic_profiles/trex/trex-stl-2n-ethip6-ip6dst100000.py new file mode 100644 index 0000000000..87e76726b2 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-2n-ethip6-ip6dst100000.py @@ -0,0 +1,129 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IPv6 / + - Direction 0 --> 1: + - Source IP address range: 2001:1::1 + - Destination IP address range: 2001:2::0 - 2001:2::1:869F + - Direction 1 --> 0: + - Source IP address range: 2001:2::1 + - Destination IP address range: 2001:1::0 - 2001:1::1:869F +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"2001:1::1" + self.p1_dst_start_ip = u"2001:2::0" + self.p1_dst_end_ip = u"2001:2::1:869F" + + self.p2_src_start_ip = u"2001:2::1" + self.p2_dst_start_ip = u"2001:1::0" + self.p2_dst_end_ip = u"2001:1::1:869F" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IPv6 | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + base_p1, count_p1 = self._get_start_end_ipv6( + self.p1_dst_start_ip, + self.p1_dst_end_ip + ) + base_p2, count_p2 = self._get_start_end_ipv6( + self.p2_dst_start_ip, + self.p2_dst_end_ip + ) + + # Direction 0 --> 1 + base_pkt_a = ( + Ether() / + IPv6( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether() / + IPv6( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"ipv6_dst", + min_value=base_p1, + max_value=base_p1 + count_p1, + size=8, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ipv6_dst", + pkt_offset=u"IPv6.dst", + offset_fixup=8 + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"ipv6_dst", + min_value=base_p2, + max_value=base_p2 + count_p2, + size=8, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ipv6_dst", + pkt_offset=u"IPv6.dst", + offset_fixup=8 + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip6-ip6dst1000000.py b/GPL/traffic_profiles/trex/trex-stl-2n-ethip6-ip6dst1000000.py new file mode 100644 index 0000000000..9214b6239d --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-2n-ethip6-ip6dst1000000.py @@ -0,0 +1,129 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IPv6 / + - Direction 0 --> 1: + - Source IP address range: 2001:1::1 + - Destination IP address range: 2001:2::0 - 2001:2::F:423F + - Direction 1 --> 0: + - Source IP address range: 2001:2::1 + - Destination IP address range: 2001:1::0 - 2001:1::F:423F +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"2001:1::1" + self.p1_dst_start_ip = u"2001:2::0" + self.p1_dst_end_ip = u"2001:2::F:423F" + + self.p2_src_start_ip = u"2001:2::1" + self.p2_dst_start_ip = u"2001:1::0" + self.p2_dst_end_ip = u"2001:1::F:423F" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IPv6 | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + base_p1, count_p1 = self._get_start_end_ipv6( + self.p1_dst_start_ip, + self.p1_dst_end_ip + ) + base_p2, count_p2 = self._get_start_end_ipv6( + self.p2_dst_start_ip, + self.p2_dst_end_ip + ) + + # Direction 0 --> 1 + base_pkt_a = ( + Ether() / + IPv6( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether() / + IPv6( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"ipv6_dst", + min_value=base_p1, + max_value=base_p1 + count_p1, + size=8, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ipv6_dst", + pkt_offset=u"IPv6.dst", + offset_fixup=8 + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"ipv6_dst", + min_value=base_p2, + max_value=base_p2 + count_p2, + size=8, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ipv6_dst", + pkt_offset=u"IPv6.dst", + offset_fixup=8 + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n-ethip6-ip6src253.py b/GPL/traffic_profiles/trex/trex-stl-2n-ethip6-ip6src253.py new file mode 100644 index 0000000000..7ac5f75bed --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-2n-ethip6-ip6src253.py @@ -0,0 +1,129 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IPv6 / + - Direction 0 --> 1: + - Source IP address range: 2001:1::2 - 2001:1::FE + - Destination IP address range: 2001:2::2 + - Direction 1 --> 0: + - Source IP address range: 2001:2::2 - 2001:2::FE + - Destination IP address range: 2001:1::2 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"2001:1::2" + self.p1_src_end_ip = u"2001:1::FE" + self.p1_dst_start_ip = u"2001:2::2" + + self.p2_src_start_ip = u"2001:2::2" + self.p2_src_end_ip = u"2001:2::FE" + self.p2_dst_start_ip = u"2001:1::2" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IPv6 | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + base_p1, count_p1 = self._get_start_end_ipv6( + self.p1_src_start_ip, + self.p1_src_end_ip + ) + base_p2, count_p2 = self._get_start_end_ipv6( + self.p2_src_start_ip, + self.p2_src_end_ip + ) + + # Direction 0 --> 1 + base_pkt_a = ( + Ether() / + IPv6( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether() / + IPv6( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"ipv6_src", + min_value=base_p1, + max_value=base_p1 + count_p1, + size=8, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ipv6_src", + pkt_offset=u"IPv6.src", + offset_fixup=8 + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"ipv6_src", + min_value=base_p2, + max_value=base_p2 + count_p2, + size=8, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ipv6_src", + pkt_offset=u"IPv6.src", + offset_fixup=8 + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-10c1n.py b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-10c1n.py new file mode 100644 index 0000000000..3707ec6b9a --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-10c1n.py @@ -0,0 +1,163 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Destination MAC address: 52:54:00:00:nf_id:01 + - Source IP address range: 10.10.10.1 - 10.10.10.254 + - Destination IP address range: 20.20.20.1 + - Direction 1 --> 0: + - Destination MAC address: 52:54:00:00:nf_id:02 + - Source IP address range: 20.20.20.1 - 20.20.20.254 + - Destination IP address range: 10.10.10.1 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # Service density parameters. + self.nf_chains = 10 + self.nf_nodes = 1 + + # MACs used in packet headers. + self.p1_dst_start_mac = u"52:54:00:00:00:01" + self.p2_dst_start_mac = u"52:54:00:00:00:02" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.10.10.1" + self.p1_src_end_ip = u"10.10.10.254" + self.p1_dst_start_ip = u"20.20.20.1" + + self.p2_src_start_ip = u"20.20.20.1" + self.p2_src_end_ip = u"20.20.20.254" + self.p2_dst_start_ip = u"10.10.10.1" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=1, + max_value=self.nf_chains*self.nf_nodes, + size=1, + step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=self.nf_nodes, + max_value=self.nf_chains*self.nf_nodes, + size=1, + step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-10c2n.py b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-10c2n.py new file mode 100644 index 0000000000..52396c3723 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-10c2n.py @@ -0,0 +1,164 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Destination MAC address: 52:54:00:00:nf_id:01 + - Source IP address range: 10.10.10.1 - 10.10.10.254 + - Destination IP address range: 20.20.20.1 + - Direction 1 --> 0: + - Destination MAC address: 52:54:00:00:nf_id:02 + - Source IP address range: 20.20.20.1 - 20.20.20.254 + - Destination IP address range: 10.10.10.1 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # Service density parameters. + self.nf_chains = 10 + self.nf_nodes = 2 + + # MACs used in packet headers. + self.p1_dst_start_mac = u'52:54:00:00:00:01' + self.p2_dst_start_mac = u'52:54:00:00:00:02' + + # IPs used in packet headers. + self.p1_src_start_ip = u'10.10.10.1' + self.p1_src_end_ip = u'10.10.10.254' + self.p1_dst_start_ip = u'20.20.20.1' + + self.p2_src_start_ip = u'20.20.20.1' + self.p2_src_end_ip = u'20.20.20.254' + self.p2_dst_start_ip = u'10.10.10.1' + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=1, + max_value=self.nf_chains*self.nf_nodes, + size=1, + step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=self.nf_nodes, + max_value=self.nf_chains*self.nf_nodes, + size=1, + step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-1c10n.py b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-1c10n.py new file mode 100644 index 0000000000..8d29f86b49 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-1c10n.py @@ -0,0 +1,164 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Destination MAC address: 52:54:00:00:nf_id:01 + - Source IP address range: 10.10.10.1 - 10.10.10.254 + - Destination IP address range: 20.20.20.1 + - Direction 1 --> 0: + - Destination MAC address: 52:54:00:00:nf_id:02 + - Source IP address range: 20.20.20.1 - 20.20.20.254 + - Destination IP address range: 10.10.10.1 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # Service density parameters. + self.nf_chains = 1 + self.nf_nodes = 10 + + # MACs used in packet headers. + self.p1_dst_start_mac = u"52:54:00:00:00:01" + self.p2_dst_start_mac = u"52:54:00:00:00:02" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.10.10.1" + self.p1_src_end_ip = u"10.10.10.254" + self.p1_dst_start_ip = u"20.20.20.1" + + self.p2_src_start_ip = u"20.20.20.1" + self.p2_src_end_ip = u"20.20.20.254" + self.p2_dst_start_ip = u"10.10.10.1" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=1, + max_value=self.nf_chains*self.nf_nodes, + size=1, + step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=self.nf_nodes, + max_value=self.nf_chains*self.nf_nodes, + size=1, + step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-1c1n.py b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-1c1n.py new file mode 100644 index 0000000000..f50e2e6c1d --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-1c1n.py @@ -0,0 +1,166 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Destination MAC address: 52:54:00:00:nf_id:01 + - Source IP address range: 10.10.10.1 - 10.10.10.254 + - Destination IP address range: 20.20.20.1 + - Direction 1 --> 0: + - Destination MAC address: 52:54:00:00:nf_id:02 + - Source IP address range: 20.20.20.1 - 20.20.20.254 + - Destination IP address range: 10.10.10.1 +""" + +from re import finditer + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # Service density parameters. + self.nf_chains = 1 + self.nf_nodes = 1 + + # MACs used in packet headers. + self.p1_dst_start_mac = u"52:54:00:00:00:01" + self.p2_dst_start_mac = u"52:54:00:00:00:02" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.10.10.1" + self.p1_src_end_ip = u"10.10.10.254" + self.p1_dst_start_ip = u"20.20.20.1" + + self.p2_src_start_ip = u"20.20.20.1" + self.p2_src_end_ip = u"20.20.20.254" + self.p2_dst_start_ip = u"10.10.10.1" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=1, + max_value=self.nf_chains*self.nf_nodes, + size=1, + step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=self.nf_nodes, + max_value=self.nf_chains*self.nf_nodes, + size=1, + step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-1c2n.py b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-1c2n.py new file mode 100644 index 0000000000..1923f72504 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-1c2n.py @@ -0,0 +1,164 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Destination MAC address: 52:54:00:00:nf_id:01 + - Source IP address range: 10.10.10.1 - 10.10.10.254 + - Destination IP address range: 20.20.20.1 + - Direction 1 --> 0: + - Destination MAC address: 52:54:00:00:nf_id:02 + - Source IP address range: 20.20.20.1 - 20.20.20.254 + - Destination IP address range: 10.10.10.1 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # Service density parameters. + self.nf_chains = 1 + self.nf_nodes = 2 + + # MACs used in packet headers. + self.p1_dst_start_mac = u"52:54:00:00:00:01" + self.p2_dst_start_mac = u"52:54:00:00:00:02" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.10.10.1" + self.p1_src_end_ip = u"10.10.10.254" + self.p1_dst_start_ip = u"20.20.20.1" + + self.p2_src_start_ip = u"20.20.20.1" + self.p2_src_end_ip = u"20.20.20.254" + self.p2_dst_start_ip = u"10.10.10.1" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=1, + max_value=self.nf_chains*self.nf_nodes, + size=1, + step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=self.nf_nodes, + max_value=self.nf_chains*self.nf_nodes, + size=1, + step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-1c4n.py b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-1c4n.py new file mode 100644 index 0000000000..a1e55c5253 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-1c4n.py @@ -0,0 +1,164 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Destination MAC address: 52:54:00:00:nf_id:01 + - Source IP address range: 10.10.10.1 - 10.10.10.254 + - Destination IP address range: 20.20.20.1 + - Direction 1 --> 0: + - Destination MAC address: 52:54:00:00:nf_id:02 + - Source IP address range: 20.20.20.1 - 20.20.20.254 + - Destination IP address range: 10.10.10.1 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # Service density parameters. + self.nf_chains = 1 + self.nf_nodes = 4 + + # MACs used in packet headers. + self.p1_dst_start_mac = u"52:54:00:00:00:01" + self.p2_dst_start_mac = u"52:54:00:00:00:02" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.10.10.1" + self.p1_src_end_ip = u"10.10.10.254" + self.p1_dst_start_ip = u"20.20.20.1" + + self.p2_src_start_ip = u"20.20.20.1" + self.p2_src_end_ip = u"20.20.20.254" + self.p2_dst_start_ip = u"10.10.10.1" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=1, + max_value=self.nf_chains*self.nf_nodes, + size=1, + step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=self.nf_nodes, + max_value=self.nf_chains*self.nf_nodes, + size=1, + step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-1c6n.py b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-1c6n.py new file mode 100644 index 0000000000..ffc8b428ef --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-1c6n.py @@ -0,0 +1,164 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Destination MAC address: 52:54:00:00:nf_id:01 + - Source IP address range: 10.10.10.1 - 10.10.10.254 + - Destination IP address range: 20.20.20.1 + - Direction 1 --> 0: + - Destination MAC address: 52:54:00:00:nf_id:02 + - Source IP address range: 20.20.20.1 - 20.20.20.254 + - Destination IP address range: 10.10.10.1 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # Service density parameters. + self.nf_chains = 1 + self.nf_nodes = 6 + + # MACs used in packet headers. + self.p1_dst_start_mac = u"52:54:00:00:00:01" + self.p2_dst_start_mac = u"52:54:00:00:00:02" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.10.10.1" + self.p1_src_end_ip = u"10.10.10.254" + self.p1_dst_start_ip = u"20.20.20.1" + + self.p2_src_start_ip = u"20.20.20.1" + self.p2_src_end_ip = u"20.20.20.254" + self.p2_dst_start_ip = u"10.10.10.1" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=1, + max_value=self.nf_chains*self.nf_nodes, + size=1, + step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=self.nf_nodes, + max_value=self.nf_chains*self.nf_nodes, + size=1, + step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-1c8n.py b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-1c8n.py new file mode 100644 index 0000000000..952859b31d --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-1c8n.py @@ -0,0 +1,164 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Destination MAC address: 52:54:00:00:nf_id:01 + - Source IP address range: 10.10.10.1 - 10.10.10.254 + - Destination IP address range: 20.20.20.1 + - Direction 1 --> 0: + - Destination MAC address: 52:54:00:00:nf_id:02 + - Source IP address range: 20.20.20.1 - 20.20.20.254 + - Destination IP address range: 10.10.10.1 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # Service density parameters. + self.nf_chains = 1 + self.nf_nodes = 8 + + # MACs used in packet headers. + self.p1_dst_start_mac = u"52:54:00:00:00:01" + self.p2_dst_start_mac = u"52:54:00:00:00:02" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.10.10.1" + self.p1_src_end_ip = u"10.10.10.254" + self.p1_dst_start_ip = u"20.20.20.1" + + self.p2_src_start_ip = u"20.20.20.1" + self.p2_src_end_ip = u"20.20.20.254" + self.p2_dst_start_ip = u"10.10.10.1" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=1, + max_value=self.nf_chains*self.nf_nodes, + size=1, + step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=self.nf_nodes, + max_value=self.nf_chains*self.nf_nodes, + size=1, + step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-2c10n.py b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-2c10n.py new file mode 100644 index 0000000000..84440af422 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-2c10n.py @@ -0,0 +1,164 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Destination MAC address: 52:54:00:00:nf_id:01 + - Source IP address range: 10.10.10.1 - 10.10.10.254 + - Destination IP address range: 20.20.20.1 + - Direction 1 --> 0: + - Destination MAC address: 52:54:00:00:nf_id:02 + - Source IP address range: 20.20.20.1 - 20.20.20.254 + - Destination IP address range: 10.10.10.1 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # Service density parameters. + self.nf_chains = 2 + self.nf_nodes = 10 + + # MACs used in packet headers. + self.p1_dst_start_mac = u"52:54:00:00:00:01" + self.p2_dst_start_mac = u"52:54:00:00:00:02" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.10.10.1" + self.p1_src_end_ip = u"10.10.10.254" + self.p1_dst_start_ip = u"20.20.20.1" + + self.p2_src_start_ip = u"20.20.20.1" + self.p2_src_end_ip = u"20.20.20.254" + self.p2_dst_start_ip = u"10.10.10.1" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=1, + max_value=self.nf_chains*self.nf_nodes, + size=1, + step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=self.nf_nodes, + max_value=self.nf_chains*self.nf_nodes, + size=1, + step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-2c1n.py b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-2c1n.py new file mode 100644 index 0000000000..91941769a3 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-2c1n.py @@ -0,0 +1,164 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Destination MAC address: 52:54:00:00:nf_id:01 + - Source IP address range: 10.10.10.1 - 10.10.10.254 + - Destination IP address range: 20.20.20.1 + - Direction 1 --> 0: + - Destination MAC address: 52:54:00:00:nf_id:02 + - Source IP address range: 20.20.20.1 - 20.20.20.254 + - Destination IP address range: 10.10.10.1 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # Service density parameters. + self.nf_chains = 2 + self.nf_nodes = 1 + + # MACs used in packet headers. + self.p1_dst_start_mac = u"52:54:00:00:00:01" + self.p2_dst_start_mac = u"52:54:00:00:00:02" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.10.10.1" + self.p1_src_end_ip = u"10.10.10.254" + self.p1_dst_start_ip = u"20.20.20.1" + + self.p2_src_start_ip = u"20.20.20.1" + self.p2_src_end_ip = u"20.20.20.254" + self.p2_dst_start_ip = u"10.10.10.1" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=1, + max_value=self.nf_chains*self.nf_nodes, + size=1, + step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=self.nf_nodes, + max_value=self.nf_chains*self.nf_nodes, + size=1, + step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-2c2n.py b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-2c2n.py new file mode 100644 index 0000000000..d66271f076 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-2c2n.py @@ -0,0 +1,164 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Destination MAC address: 52:54:00:00:nf_id:01 + - Source IP address range: 10.10.10.1 - 10.10.10.254 + - Destination IP address range: 20.20.20.1 + - Direction 1 --> 0: + - Destination MAC address: 52:54:00:00:nf_id:02 + - Source IP address range: 20.20.20.1 - 20.20.20.254 + - Destination IP address range: 10.10.10.1 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # Service density parameters. + self.nf_chains = 2 + self.nf_nodes = 2 + + # MACs used in packet headers. + self.p1_dst_start_mac = u"52:54:00:00:00:01" + self.p2_dst_start_mac = u"52:54:00:00:00:02" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.10.10.1" + self.p1_src_end_ip = u"10.10.10.254" + self.p1_dst_start_ip = u"20.20.20.1" + + self.p2_src_start_ip = u"20.20.20.1" + self.p2_src_end_ip = u"20.20.20.254" + self.p2_dst_start_ip = u"10.10.10.1" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=1, + max_value=self.nf_chains*self.nf_nodes, + size=1, + step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=self.nf_nodes, + max_value=self.nf_chains*self.nf_nodes, + size=1, + step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-2c4n.py b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-2c4n.py new file mode 100644 index 0000000000..7eadae361b --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-2c4n.py @@ -0,0 +1,164 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Destination MAC address: 52:54:00:00:nf_id:01 + - Source IP address range: 10.10.10.1 - 10.10.10.254 + - Destination IP address range: 20.20.20.1 + - Direction 1 --> 0: + - Destination MAC address: 52:54:00:00:nf_id:02 + - Source IP address range: 20.20.20.1 - 20.20.20.254 + - Destination IP address range: 10.10.10.1 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # Service density parameters. + self.nf_chains = 2 + self.nf_nodes = 4 + + # MACs used in packet headers. + self.p1_dst_start_mac = u"52:54:00:00:00:01" + self.p2_dst_start_mac = u"52:54:00:00:00:02" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.10.10.1" + self.p1_src_end_ip = u"10.10.10.254" + self.p1_dst_start_ip = u"20.20.20.1" + + self.p2_src_start_ip = u"20.20.20.1" + self.p2_src_end_ip = u"20.20.20.254" + self.p2_dst_start_ip = u"10.10.10.1" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=1, + max_value=self.nf_chains*self.nf_nodes, + size=1, + step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=self.nf_nodes, + max_value=self.nf_chains*self.nf_nodes, + size=1, + step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-2c6n.py b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-2c6n.py new file mode 100644 index 0000000000..3725f75b3e --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-2c6n.py @@ -0,0 +1,164 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Destination MAC address: 52:54:00:00:nf_id:01 + - Source IP address range: 10.10.10.1 - 10.10.10.254 + - Destination IP address range: 20.20.20.1 + - Direction 1 --> 0: + - Destination MAC address: 52:54:00:00:nf_id:02 + - Source IP address range: 20.20.20.1 - 20.20.20.254 + - Destination IP address range: 10.10.10.1 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # Service density parameters. + self.nf_chains = 2 + self.nf_nodes = 6 + + # MACs used in packet headers. + self.p1_dst_start_mac = u"52:54:00:00:00:01" + self.p2_dst_start_mac = u"52:54:00:00:00:02" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.10.10.1" + self.p1_src_end_ip = u"10.10.10.254" + self.p1_dst_start_ip = u"20.20.20.1" + + self.p2_src_start_ip = u"20.20.20.1" + self.p2_src_end_ip = u"20.20.20.254" + self.p2_dst_start_ip = u"10.10.10.1" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=1, + max_value=self.nf_chains*self.nf_nodes, + size=1, + step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=self.nf_nodes, + max_value=self.nf_chains*self.nf_nodes, + size=1, + step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-2c8n.py b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-2c8n.py new file mode 100644 index 0000000000..024cbc34f3 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-2c8n.py @@ -0,0 +1,164 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Destination MAC address: 52:54:00:00:nf_id:01 + - Source IP address range: 10.10.10.1 - 10.10.10.254 + - Destination IP address range: 20.20.20.1 + - Direction 1 --> 0: + - Destination MAC address: 52:54:00:00:nf_id:02 + - Source IP address range: 20.20.20.1 - 20.20.20.254 + - Destination IP address range: 10.10.10.1 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # Service density parameters. + self.nf_chains = 2 + self.nf_nodes = 8 + + # MACs used in packet headers. + self.p1_dst_start_mac = u"52:54:00:00:00:01" + self.p2_dst_start_mac = u"52:54:00:00:00:02" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.10.10.1" + self.p1_src_end_ip = u"10.10.10.254" + self.p1_dst_start_ip = u"20.20.20.1" + + self.p2_src_start_ip = u"20.20.20.1" + self.p2_src_end_ip = u"20.20.20.254" + self.p2_dst_start_ip = u"10.10.10.1" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=1, + max_value=self.nf_chains*self.nf_nodes, + size=1, + step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=self.nf_nodes, + max_value=self.nf_chains*self.nf_nodes, + size=1, + step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-4c1n.py b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-4c1n.py new file mode 100644 index 0000000000..e8c62b9c41 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-4c1n.py @@ -0,0 +1,164 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Destination MAC address: 52:54:00:00:nf_id:01 + - Source IP address range: 10.10.10.1 - 10.10.10.254 + - Destination IP address range: 20.20.20.1 + - Direction 1 --> 0: + - Destination MAC address: 52:54:00:00:nf_id:02 + - Source IP address range: 20.20.20.1 - 20.20.20.254 + - Destination IP address range: 10.10.10.1 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # Service density parameters. + self.nf_chains = 4 + self.nf_nodes = 1 + + # MACs used in packet headers. + self.p1_dst_start_mac = u"52:54:00:00:00:01" + self.p2_dst_start_mac = u"52:54:00:00:00:02" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.10.10.1" + self.p1_src_end_ip = u"10.10.10.254" + self.p1_dst_start_ip = u"20.20.20.1" + + self.p2_src_start_ip = u"20.20.20.1" + self.p2_src_end_ip = u"20.20.20.254" + self.p2_dst_start_ip = u"10.10.10.1" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=1, + max_value=self.nf_chains*self.nf_nodes, + size=1, + step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=self.nf_nodes, + max_value=self.nf_chains*self.nf_nodes, + size=1, + step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-4c2n.py b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-4c2n.py new file mode 100644 index 0000000000..a6fbe9ea79 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-4c2n.py @@ -0,0 +1,162 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Destination MAC address: 52:54:00:00:nf_id:01 + - Source IP address range: 10.10.10.1 - 10.10.10.254 + - Destination IP address range: 20.20.20.1 + - Direction 1 --> 0: + - Destination MAC address: 52:54:00:00:nf_id:02 + - Source IP address range: 20.20.20.1 - 20.20.20.254 + - Destination IP address range: 10.10.10.1 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # Service density parameters. + self.nf_chains = 4 + self.nf_nodes = 2 + + # MACs used in packet headers. + self.p1_dst_start_mac = u"52:54:00:00:00:01" + self.p2_dst_start_mac = u"52:54:00:00:00:02" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.10.10.1" + self.p1_src_end_ip = u"10.10.10.254" + self.p1_dst_start_ip = u"20.20.20.1" + + self.p2_src_start_ip = u"20.20.20.1" + self.p2_src_end_ip = u"20.20.20.254" + self.p2_dst_start_ip = u"10.10.10.1" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=1, + max_value=self.nf_chains*self.nf_nodes, + size=1, step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4), + STLVmFlowVar( + name=u"src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=self.nf_nodes, + max_value=self.nf_chains*self.nf_nodes, + size=1, + step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-4c4n.py b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-4c4n.py new file mode 100644 index 0000000000..f1477419c3 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-4c4n.py @@ -0,0 +1,164 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Destination MAC address: 52:54:00:00:nf_id:01 + - Source IP address range: 10.10.10.1 - 10.10.10.254 + - Destination IP address range: 20.20.20.1 + - Direction 1 --> 0: + - Destination MAC address: 52:54:00:00:nf_id:02 + - Source IP address range: 20.20.20.1 - 20.20.20.254 + - Destination IP address range: 10.10.10.1 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # Service density parameters. + self.nf_chains = 4 + self.nf_nodes = 4 + + # MACs used in packet headers. + self.p1_dst_start_mac = u"52:54:00:00:00:01" + self.p2_dst_start_mac = u"52:54:00:00:00:02" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.10.10.1" + self.p1_src_end_ip = u"10.10.10.254" + self.p1_dst_start_ip = u"20.20.20.1" + + self.p2_src_start_ip = u"20.20.20.1" + self.p2_src_end_ip = u"20.20.20.254" + self.p2_dst_start_ip = u"10.10.10.1" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=1, + max_value=self.nf_chains*self.nf_nodes, + size=1, + step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=self.nf_nodes, + max_value=self.nf_chains*self.nf_nodes, + size=1, + step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-4c6n.py b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-4c6n.py new file mode 100644 index 0000000000..7e2b79fdac --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-4c6n.py @@ -0,0 +1,164 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Destination MAC address: 52:54:00:00:nf_id:01 + - Source IP address range: 10.10.10.1 - 10.10.10.254 + - Destination IP address range: 20.20.20.1 + - Direction 1 --> 0: + - Destination MAC address: 52:54:00:00:nf_id:02 + - Source IP address range: 20.20.20.1 - 20.20.20.254 + - Destination IP address range: 10.10.10.1 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # Service density parameters. + self.nf_chains = 4 + self.nf_nodes = 6 + + # MACs used in packet headers. + self.p1_dst_start_mac = u"52:54:00:00:00:01" + self.p2_dst_start_mac = u"52:54:00:00:00:02" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.10.10.1" + self.p1_src_end_ip = u"10.10.10.254" + self.p1_dst_start_ip = u"20.20.20.1" + + self.p2_src_start_ip = u"20.20.20.1" + self.p2_src_end_ip = u"20.20.20.254" + self.p2_dst_start_ip = u"10.10.10.1" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=1, + max_value=self.nf_chains*self.nf_nodes, + size=1, + step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=self.nf_nodes, + max_value=self.nf_chains*self.nf_nodes, + size=1, + step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-6c1n.py b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-6c1n.py new file mode 100644 index 0000000000..dc8616c6fe --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-6c1n.py @@ -0,0 +1,164 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Destination MAC address: 52:54:00:00:nf_id:01 + - Source IP address range: 10.10.10.1 - 10.10.10.254 + - Destination IP address range: 20.20.20.1 + - Direction 1 --> 0: + - Destination MAC address: 52:54:00:00:nf_id:02 + - Source IP address range: 20.20.20.1 - 20.20.20.254 + - Destination IP address range: 10.10.10.1 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # Service density parameters. + self.nf_chains = 6 + self.nf_nodes = 1 + + # MACs used in packet headers. + self.p1_dst_start_mac = u"52:54:00:00:00:01" + self.p2_dst_start_mac = u"52:54:00:00:00:02" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.10.10.1" + self.p1_src_end_ip = u"10.10.10.254" + self.p1_dst_start_ip = u"20.20.20.1" + + self.p2_src_start_ip = u"20.20.20.1" + self.p2_src_end_ip = u"20.20.20.254" + self.p2_dst_start_ip = u"10.10.10.1" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=1, + max_value=self.nf_chains*self.nf_nodes, + size=1, + step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=self.nf_nodes, + max_value=self.nf_chains*self.nf_nodes, + size=1, + step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-6c2n.py b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-6c2n.py new file mode 100644 index 0000000000..53a83db70b --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-6c2n.py @@ -0,0 +1,164 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Destination MAC address: 52:54:00:00:nf_id:01 + - Source IP address range: 10.10.10.1 - 10.10.10.254 + - Destination IP address range: 20.20.20.1 + - Direction 1 --> 0: + - Destination MAC address: 52:54:00:00:nf_id:02 + - Source IP address range: 20.20.20.1 - 20.20.20.254 + - Destination IP address range: 10.10.10.1 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # Service density parameters. + self.nf_chains = 6 + self.nf_nodes = 2 + + # MACs used in packet headers. + self.p1_dst_start_mac = u"52:54:00:00:00:01" + self.p2_dst_start_mac = u"52:54:00:00:00:02" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.10.10.1" + self.p1_src_end_ip = u"10.10.10.254" + self.p1_dst_start_ip = u"20.20.20.1" + + self.p2_src_start_ip = u"20.20.20.1" + self.p2_src_end_ip = u"20.20.20.254" + self.p2_dst_start_ip = u"10.10.10.1" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=1, + max_value=self.nf_chains*self.nf_nodes, + size=1, + step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=self.nf_nodes, + max_value=self.nf_chains*self.nf_nodes, + size=1, + step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-6c4n.py b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-6c4n.py new file mode 100644 index 0000000000..ac697e60ec --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-6c4n.py @@ -0,0 +1,164 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Destination MAC address: 52:54:00:00:nf_id:01 + - Source IP address range: 10.10.10.1 - 10.10.10.254 + - Destination IP address range: 20.20.20.1 + - Direction 1 --> 0: + - Destination MAC address: 52:54:00:00:nf_id:02 + - Source IP address range: 20.20.20.1 - 20.20.20.254 + - Destination IP address range: 10.10.10.1 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # Service density parameters. + self.nf_chains = 6 + self.nf_nodes = 4 + + # MACs used in packet headers. + self.p1_dst_start_mac = u"52:54:00:00:00:01" + self.p2_dst_start_mac = u"52:54:00:00:00:02" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.10.10.1" + self.p1_src_end_ip = u"10.10.10.254" + self.p1_dst_start_ip = u"20.20.20.1" + + self.p2_src_start_ip = u"20.20.20.1" + self.p2_src_end_ip = u"20.20.20.254" + self.p2_dst_start_ip = u"10.10.10.1" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=1, + max_value=self.nf_chains*self.nf_nodes, + size=1, + step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=self.nf_nodes, + max_value=self.nf_chains*self.nf_nodes, + size=1, + step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-8c1n.py b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-8c1n.py new file mode 100644 index 0000000000..587dfc3406 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-8c1n.py @@ -0,0 +1,164 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Destination MAC address: 52:54:00:00:nf_id:01 + - Source IP address range: 10.10.10.1 - 10.10.10.254 + - Destination IP address range: 20.20.20.1 + - Direction 1 --> 0: + - Destination MAC address: 52:54:00:00:nf_id:02 + - Source IP address range: 20.20.20.1 - 20.20.20.254 + - Destination IP address range: 10.10.10.1 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # Service density parameters. + self.nf_chains = 8 + self.nf_nodes = 1 + + # MACs used in packet headers. + self.p1_dst_start_mac = u"52:54:00:00:00:01" + self.p2_dst_start_mac = u"52:54:00:00:00:02" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.10.10.1" + self.p1_src_end_ip = u"10.10.10.254" + self.p1_dst_start_ip = u"20.20.20.1" + + self.p2_src_start_ip = u"20.20.20.1" + self.p2_src_end_ip = u"20.20.20.254" + self.p2_dst_start_ip = u"10.10.10.1" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=1, + max_value=self.nf_chains*self.nf_nodes, + size=1, + step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=self.nf_nodes, + max_value=self.nf_chains*self.nf_nodes, + size=1, + step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-8c2n.py b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-8c2n.py new file mode 100644 index 0000000000..9123a752b2 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-2n3n-ethip4-ip4src254-8c2n.py @@ -0,0 +1,164 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Destination MAC address: 52:54:00:00:nf_id:01 + - Source IP address range: 10.10.10.1 - 10.10.10.254 + - Destination IP address range: 20.20.20.1 + - Direction 1 --> 0: + - Destination MAC address: 52:54:00:00:nf_id:02 + - Source IP address range: 20.20.20.1 - 20.20.20.254 + - Destination IP address range: 10.10.10.1 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # Service density parameters. + self.nf_chains = 8 + self.nf_nodes = 2 + + # MACs used in packet headers. + self.p1_dst_start_mac = u"52:54:00:00:00:01" + self.p2_dst_start_mac = u"52:54:00:00:00:02" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.10.10.1" + self.p1_src_end_ip = u"10.10.10.254" + self.p1_dst_start_ip = u"20.20.20.1" + + self.p2_src_start_ip = u"20.20.20.1" + self.p2_src_end_ip = u"20.20.20.254" + self.p2_dst_start_ip = u"10.10.10.1" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=1, + max_value=self.nf_chains*self.nf_nodes, + size=1, + step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=self.nf_nodes, + max_value=self.nf_chains*self.nf_nodes, + size=1, + step=self.nf_nodes, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=4 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-dot1qip4-vlan100ip4src254ip4dst254.py b/GPL/traffic_profiles/trex/trex-stl-3n-dot1qip4-vlan100ip4src254ip4dst254.py new file mode 100644 index 0000000000..b414bd1c7a --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-dot1qip4-vlan100ip4src254ip4dst254.py @@ -0,0 +1,191 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / DOT1Q / IP / + - Direction 0 --> 1: + - VLAN range: 1 - 100 + - Source IP address range: 10.0.0.1 - 10.0.0.254 + - Destination IP address range: 20.0.0.1 - 20.0.0.254 + - Direction 1 --> 0: + - VLAN range: 1 - 100 + - Source IP address range: 20.0.0.1 - 20.0.0.254 + - Destination IP address range: 10.0.0.1 - 10.0.0.254 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # VLAN IDs + self.vlans = 100 + + self.p1_vlan_start = 1 + self.p1_vlan_end = self.p1_vlan_start + self.vlans - 1 + + self.p2_vlan_start = 1 + self.p2_vlan_end = self.p2_vlan_start + self.vlans - 1 + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_src_end_ip = u"10.0.0.254" + + self.p1_dst_start_ip = u"20.0.0.1" + self.p1_dst_end_ip = u"20.0.0.254" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_src_end_ip = u"20.0.0.254" + + self.p2_dst_start_ip = u"10.0.0.1" + self.p2_dst_end_ip = u"10.0.0.254" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | DOT1Q | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether() / + Dot1Q( + vlan=self.p1_vlan_start + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether() / + Dot1Q( + vlan=self.p2_vlan_start + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"vlan", + min_value=self.p1_vlan_start, + max_value=self.p1_vlan_end, + size=2, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"vlan", + pkt_offset=u"Dot1Q.vlan" + ), + STLVmFlowVar( + name=u"ip_src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op=u"random" + ), + STLVmWrFlowVar( + fv_name=u"ip_src", + pkt_offset=u"IP.src" + ), + STLVmFlowVar( + name=u"ip_dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"random" + ), + STLVmWrFlowVar( + fv_name=u"ip_dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"vlan", + min_value=self.p2_vlan_start, + max_value=self.p2_vlan_end, + size=2, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"vlan", + pkt_offset=u"Dot1Q.vlan" + ), + STLVmFlowVar( + name=u"ip_src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op=u"random" + ), + STLVmWrFlowVar( + fv_name=u"ip_src", + pkt_offset=u"IP.src" + ), + STLVmFlowVar( + name=u"ip_dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"random" + ), + STLVmWrFlowVar( + fv_name=u"ip_dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :returns: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-dot1qip4-vlan10ip4src254ip4dst254.py b/GPL/traffic_profiles/trex/trex-stl-3n-dot1qip4-vlan10ip4src254ip4dst254.py new file mode 100644 index 0000000000..d878e2d726 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-dot1qip4-vlan10ip4src254ip4dst254.py @@ -0,0 +1,191 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / DOT1Q / IP / + - Direction 0 --> 1: + - VLAN range: 1 - 10 + - Source IP address range: 10.0.0.1 - 10.0.0.254 + - Destination IP address range: 20.0.0.1 - 20.0.0.254 + - Direction 1 --> 0: + - VLAN range: 1 - 10 + - Source IP address range: 20.0.0.1 - 20.0.0.254 + - Destination IP address range: 10.0.0.1 - 10.0.0.254 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # VLAN IDs + self.vlans = 10 + + self.p1_vlan_start = 1 + self.p1_vlan_end = self.p1_vlan_start + self.vlans - 1 + + self.p2_vlan_start = 1 + self.p2_vlan_end = self.p2_vlan_start + self.vlans - 1 + + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_src_end_ip = u"10.0.0.254" + + self.p1_dst_start_ip = u"20.0.0.1" + self.p1_dst_end_ip = u"20.0.0.254" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_src_end_ip = u"20.0.0.254" + + self.p2_dst_start_ip = u"10.0.0.1" + self.p2_dst_end_ip = u"10.0.0.254" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | DOT1Q | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether() / + Dot1Q( + vlan=self.p1_vlan_start + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether() / + Dot1Q( + vlan=self.p2_vlan_start + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"vlan", + min_value=self.p1_vlan_start, + max_value=self.p1_vlan_end, + size=2, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"vlan", + pkt_offset=u"Dot1Q.vlan" + ), + STLVmFlowVar( + name=u"ip_src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op=u"random" + ), + STLVmWrFlowVar( + fv_name=u"ip_src", + pkt_offset=u"IP.src" + ), + STLVmFlowVar( + name=u"ip_dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"random" + ), + STLVmWrFlowVar( + fv_name=u"ip_dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"vlan", + min_value=self.p2_vlan_start, + max_value=self.p2_vlan_end, + size=2, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"vlan", + pkt_offset=u"Dot1Q.vlan" + ), + STLVmFlowVar( + name=u"ip_src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op=u"random" + ), + STLVmWrFlowVar( + fv_name=u"ip_src", + pkt_offset=u"IP.src" + ), + STLVmFlowVar(name=u"ip_dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"random" + ), + STLVmWrFlowVar( + fv_name=u"ip_dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :returns: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-dot1qip4-vlan1ip4src254ip4dst254.py b/GPL/traffic_profiles/trex/trex-stl-3n-dot1qip4-vlan1ip4src254ip4dst254.py new file mode 100644 index 0000000000..c8f279bdb3 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-dot1qip4-vlan1ip4src254ip4dst254.py @@ -0,0 +1,166 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / DOT1Q / IP / + - Direction 0 --> 1: + - VLAN range: 1 + - Source IP address range: 10.0.0.1 - 10.0.0.254 + - Destination IP address range: 20.0.0.1 - 20.0.0.254 + - Direction 1 --> 0: + - VLAN range: 1 + - Source IP address range: 20.0.0.1 - 20.0.0.254 + - Destination IP address range: 10.0.0.1 - 10.0.0.254 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # VLAN IDs + self.p1_vlan_start = 1 + + self.p2_vlan_start = 1 + + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_src_end_ip = u"10.0.0.254" + + self.p1_dst_start_ip = u"20.0.0.1" + self.p1_dst_end_ip = u"20.0.0.254" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_src_end_ip = u"20.0.0.254" + + self.p2_dst_start_ip = u"10.0.0.1" + self.p2_dst_end_ip = u"10.0.0.254" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | DOT1Q | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether() / + Dot1Q( + vlan=self.p1_vlan_start + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether() / + Dot1Q( + vlan=self.p2_vlan_start + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"ip_src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op=u"random" + ), + STLVmWrFlowVar( + fv_name=u"ip_src", + pkt_offset=u"IP.src" + ), + STLVmFlowVar( + name=u"ip_dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"random" + ), + STLVmWrFlowVar( + fv_name=u"ip_dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"ip_src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op=u"random" + ), + STLVmWrFlowVar( + fv_name=u"ip_src", + pkt_offset=u"IP.src" + ), + STLVmFlowVar( + name=u"ip_dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"random" + ), + STLVmWrFlowVar( + fv_name=u"ip_dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :returns: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-dot1qip4-vlan1kip4src254ip4dst254.py b/GPL/traffic_profiles/trex/trex-stl-3n-dot1qip4-vlan1kip4src254ip4dst254.py new file mode 100644 index 0000000000..02decf4284 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-dot1qip4-vlan1kip4src254ip4dst254.py @@ -0,0 +1,191 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / DOT1Q / IP / + - Direction 0 --> 1: + - VLAN range: 1 - 1000 + - Source IP address range: 10.0.0.1 - 10.0.0.254 + - Destination IP address range: 20.0.0.1 - 20.0.0.254 + - Direction 1 --> 0: + - VLAN range: 1 - 1000 + - Source IP address range: 20.0.0.1 - 20.0.0.254 + - Destination IP address range: 10.0.0.1 - 10.0.0.254 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # VLAN IDs + self.vlans = 1000 + + self.p1_vlan_start = 1 + self.p1_vlan_end = self.p1_vlan_start + self.vlans - 1 + + self.p2_vlan_start = 1 + self.p2_vlan_end = self.p2_vlan_start + self.vlans - 1 + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_src_end_ip = u"10.0.0.254" + + self.p1_dst_start_ip = u"20.0.0.1" + self.p1_dst_end_ip = u"20.0.0.254" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_src_end_ip = u"20.0.0.254" + + self.p2_dst_start_ip = u"10.0.0.1" + self.p2_dst_end_ip = u"10.0.0.254" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | DOT1Q | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether() / + Dot1Q( + vlan=self.p1_vlan_start + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether() / + Dot1Q( + vlan=self.p2_vlan_start + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"vlan", + min_value=self.p1_vlan_start, + max_value=self.p1_vlan_end, + size=2, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"vlan", + pkt_offset=u"Dot1Q.vlan" + ), + STLVmFlowVar( + name=u"ip_src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op=u"random" + ), + STLVmWrFlowVar( + fv_name=u"ip_src", + pkt_offset=u"IP.src" + ), + STLVmFlowVar( + name=u"ip_dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"random" + ), + STLVmWrFlowVar( + fv_name=u"ip_dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"vlan", + min_value=self.p2_vlan_start, + max_value=self.p2_vlan_end, + size=2, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"vlan", + pkt_offset=u"Dot1Q.vlan" + ), + STLVmFlowVar( + name=u"ip_src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op=u"random" + ), + STLVmWrFlowVar( + fv_name=u"ip_src", + pkt_offset=u"IP.src" + ), + STLVmFlowVar( + name=u"ip_dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"random" + ), + STLVmWrFlowVar( + fv_name=u"ip_dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :returns: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst1.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst1.py new file mode 100644 index 0000000000..0d36b7358f --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst1.py @@ -0,0 +1,85 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_ip = u"10.0.0.1" + self.p1_dst_ip = u"20.0.0.0" + + self.p2_src_ip = u"20.0.0.1" + self.p2_dst_ip = u"10.0.0.0" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether() / + IP( + src=self.p1_src_ip, + dst=self.p1_dst_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether() / + IP( + src=self.p2_src_ip, + dst=self.p2_dst_ip, + proto=61 + ) + ) + + return base_pkt_a, base_pkt_b, None, None + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst100.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst100.py new file mode 100644 index 0000000000..222b127914 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst100.py @@ -0,0 +1,126 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.0.99 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.0.99 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.0.99" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.0.99" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + 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 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst1000-1cnf.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst1000-1cnf.py new file mode 100644 index 0000000000..1397ae4828 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst1000-1cnf.py @@ -0,0 +1,157 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.3.231 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.3.231 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.p1_dst_start_mac = u"02:02:00:00:12:00" + + self.p2_dst_start_mac = u"02:02:00:00:02:00" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.3.231" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.3.231" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=0, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=0, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() + diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst1000-2cnf.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst1000-2cnf.py new file mode 100644 index 0000000000..b7f316092a --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst1000-2cnf.py @@ -0,0 +1,156 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.3.231 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.3.231 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.p1_dst_start_mac = u"02:02:00:00:12:00" + + self.p2_dst_start_mac = u"02:02:00:00:02:00" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.3.231" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.3.231" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=1, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=1, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() + diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst1000-4cnf.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst1000-4cnf.py new file mode 100644 index 0000000000..a64e4d5a5e --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst1000-4cnf.py @@ -0,0 +1,157 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.3.231 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.3.231 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.p1_dst_start_mac = u"02:02:00:00:12:00" + + self.p2_dst_start_mac = u"02:02:00:00:02:00" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.3.231" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.3.231" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=3, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=3, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() + diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst1000-8cnf.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst1000-8cnf.py new file mode 100644 index 0000000000..a58df6e87b --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst1000-8cnf.py @@ -0,0 +1,157 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.3.231 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.3.231 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.p1_dst_start_mac = u"02:02:00:00:12:00" + + self.p2_dst_start_mac = u"02:02:00:00:02:00" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.3.231" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.3.231" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=7, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=7, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() + diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst1000.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst1000.py new file mode 100644 index 0000000000..8d9ec21a25 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst1000.py @@ -0,0 +1,126 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.3.231 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.3.231 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.3.231" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.3.231" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + 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 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst10000-1cnf.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst10000-1cnf.py new file mode 100644 index 0000000000..53e68de2b9 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst10000-1cnf.py @@ -0,0 +1,157 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.39.15 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.39.15 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.p1_dst_start_mac = u"02:02:00:00:12:00" + + self.p2_dst_start_mac = u"02:02:00:00:02:00" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.39.15" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.39.15" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=0, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=0, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() + diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst10000-2cnf.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst10000-2cnf.py new file mode 100644 index 0000000000..ca3f41a6fb --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst10000-2cnf.py @@ -0,0 +1,157 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.39.15 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.39.15 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.p1_dst_start_mac = u"02:02:00:00:12:00" + + self.p2_dst_start_mac = u"02:02:00:00:02:00" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.39.15" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.39.15" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=1, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=1, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() + diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst10000-4cnf.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst10000-4cnf.py new file mode 100644 index 0000000000..df7572853f --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst10000-4cnf.py @@ -0,0 +1,157 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.39.15 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.39.15 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.p1_dst_start_mac = u"02:02:00:00:12:00" + + self.p2_dst_start_mac = u"02:02:00:00:02:00" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.39.15" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.39.15" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=3, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=3, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() + diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst10000-8cnf.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst10000-8cnf.py new file mode 100644 index 0000000000..1dbd3feb1a --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst10000-8cnf.py @@ -0,0 +1,157 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.39.15 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.39.15 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.p1_dst_start_mac = u"02:02:00:00:12:00" + + self.p2_dst_start_mac = u"02:02:00:00:02:00" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.39.15" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.39.15" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=7, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=7, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() + diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst10000.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst10000.py new file mode 100644 index 0000000000..9f55ff71de --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst10000.py @@ -0,0 +1,126 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.39.15 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.39.15 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.39.15" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.39.15" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + 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 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst100000.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst100000.py new file mode 100644 index 0000000000..ae36cf9995 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst100000.py @@ -0,0 +1,126 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.1.134.159 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.1.134.159 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.1.134.159" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.1.134.159" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + 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 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst1000000.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst1000000.py new file mode 100644 index 0000000000..8f6e5a0836 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst1000000.py @@ -0,0 +1,126 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.15.66.63 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.15.66.63 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.15.66.63" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.15.66.63" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + 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 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst20000-1cnf.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst20000-1cnf.py new file mode 100644 index 0000000000..f6f6fada5a --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst20000-1cnf.py @@ -0,0 +1,157 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.78.31 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.78.31 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.p1_dst_start_mac = u"02:02:00:00:12:00" + + self.p2_dst_start_mac = u"02:02:00:00:02:00" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.78.31" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.78.31" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=0, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=0, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() + diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst20000-2cnf.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst20000-2cnf.py new file mode 100644 index 0000000000..15cb461624 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst20000-2cnf.py @@ -0,0 +1,157 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.78.31 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.78.31 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.p1_dst_start_mac = u"02:02:00:00:12:00" + + self.p2_dst_start_mac = u"02:02:00:00:02:00" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.78.31" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.78.31" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=1, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=1, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() + diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst20000-4cnf.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst20000-4cnf.py new file mode 100644 index 0000000000..62eb1bee78 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst20000-4cnf.py @@ -0,0 +1,157 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.78.31 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.78.31 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.p1_dst_start_mac = u"02:02:00:00:12:00" + + self.p2_dst_start_mac = u"02:02:00:00:02:00" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.78.31" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.78.31" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=3, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=3, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() + diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst20000-8cnf.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst20000-8cnf.py new file mode 100644 index 0000000000..b6eef29366 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst20000-8cnf.py @@ -0,0 +1,157 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.78.31 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.78.31 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.p1_dst_start_mac = u"02:02:00:00:12:00" + + self.p2_dst_start_mac = u"02:02:00:00:02:00" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.78.31" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.78.31" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=7, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=7, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() + diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst20000.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst20000.py new file mode 100644 index 0000000000..877e6cdc66 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst20000.py @@ -0,0 +1,126 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.78.31 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.78.31 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.78.31" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.78.31" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + 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 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst253.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst253.py new file mode 100644 index 0000000000..e1e6a89af7 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst253.py @@ -0,0 +1,126 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 20.20.20.2 + - Destination IP address range: 2.1.1.2 - 2.1.1.254 + - Direction 1 --> 0: + - Source IP address range: 10.10.10.2 + - Destination IP address range: 1.1.1.2 - 1.1.1.254 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"20.20.20.2" + self.p1_dst_start_ip = u"2.1.1.2" + self.p1_dst_end_ip = u"2.1.1.254" + + self.p2_src_start_ip = u"10.10.10.2" + self.p2_dst_start_ip = u"1.1.1.2" + self.p2_dst_end_ip = u"1.1.1.254" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + 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 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst253_l3fwd.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst253_l3fwd.py new file mode 100644 index 0000000000..31e69e07ba --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst253_l3fwd.py @@ -0,0 +1,126 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 20.20.20.2 + - Destination IP address range: 198.18.0.2 - 198.18.0.254 + - Direction 1 --> 0: + - Source IP address range: 10.10.10.2 + - Destination IP address range: 198.18.1.2 - 198.18.1.254 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"20.20.20.2" + self.p1_dst_start_ip = u"198.18.0.2" + self.p1_dst_end_ip = u"198.18.0.254" + + self.p2_src_start_ip = u"10.10.10.2" + self.p2_dst_start_ip = u"198.18.1.2" + self.p2_dst_end_ip = u"198.18.1.254" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + 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 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst4-1cnf.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst4-1cnf.py new file mode 100644 index 0000000000..b937d02741 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst4-1cnf.py @@ -0,0 +1,157 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.0.3 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.0.3 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.p1_dst_start_mac = u"02:02:00:00:12:00" + + self.p2_dst_start_mac = u"02:02:00:00:02:00" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.0.3" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.0.3" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=0, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=0, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() + diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst4-2cnf.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst4-2cnf.py new file mode 100644 index 0000000000..b95649a94d --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst4-2cnf.py @@ -0,0 +1,157 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.0.3 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.0.3 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.p1_dst_start_mac = u"02:02:00:00:12:00" + + self.p2_dst_start_mac = u"02:02:00:00:02:00" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.0.3" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.0.3" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=1, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=1, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() + diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst4-4cnf.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst4-4cnf.py new file mode 100644 index 0000000000..fed0d7ef3c --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst4-4cnf.py @@ -0,0 +1,157 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.0.3 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.0.3 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.p1_dst_start_mac = u"02:02:00:00:12:00" + + self.p2_dst_start_mac = u"02:02:00:00:02:00" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.0.3" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.0.3" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=3, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=3, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() + diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst4.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst4.py new file mode 100644 index 0000000000..9f14d4c929 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst4.py @@ -0,0 +1,126 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.0.3 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.0.3 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.0.3" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.0.3" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + 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 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40-1cnf.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40-1cnf.py new file mode 100644 index 0000000000..d321d0ffb2 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40-1cnf.py @@ -0,0 +1,157 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.0.39 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.0.39 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.p1_dst_start_mac = u"02:02:00:00:12:00" + + self.p2_dst_start_mac = u"02:02:00:00:02:00" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.0.39" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.0.39" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=0, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=0, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() + diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40-2cnf.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40-2cnf.py new file mode 100644 index 0000000000..acc565e776 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40-2cnf.py @@ -0,0 +1,157 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.0.39 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.0.39 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.p1_dst_start_mac = u"02:02:00:00:12:00" + + self.p2_dst_start_mac = u"02:02:00:00:02:00" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.0.39" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.0.39" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=1, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=1, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() + diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40-4cnf.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40-4cnf.py new file mode 100644 index 0000000000..629100cb83 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40-4cnf.py @@ -0,0 +1,157 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.0.39 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.0.39 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.p1_dst_start_mac = u"02:02:00:00:12:00" + + self.p2_dst_start_mac = u"02:02:00:00:02:00" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.0.39" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.0.39" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=3, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=3, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() + diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40-8cnf.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40-8cnf.py new file mode 100644 index 0000000000..b51c98d7aa --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40-8cnf.py @@ -0,0 +1,157 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.0.39 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.0.39 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.p1_dst_start_mac = u"02:02:00:00:12:00" + + self.p2_dst_start_mac = u"02:02:00:00:02:00" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.0.39" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.0.39" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=7, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=7, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() + diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40.py new file mode 100644 index 0000000000..5dbc5fc803 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40.py @@ -0,0 +1,126 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.0.39 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.0.39 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.0.39" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.0.39" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + 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 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst400-1cnf.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst400-1cnf.py new file mode 100644 index 0000000000..1a004b055f --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst400-1cnf.py @@ -0,0 +1,157 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.1.143 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.1.143 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.p1_dst_start_mac = u"02:02:00:00:12:00" + + self.p2_dst_start_mac = u"02:02:00:00:02:00" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.1.143" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.1.143" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=0, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=0, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() + diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst400-2cnf.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst400-2cnf.py new file mode 100644 index 0000000000..b09e79d7dc --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst400-2cnf.py @@ -0,0 +1,157 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.1.143 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.1.143 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.p1_dst_start_mac = u"02:02:00:00:12:00" + + self.p2_dst_start_mac = u"02:02:00:00:02:00" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.1.143" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.1.143" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=1, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=1, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() + diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst400-4cnf.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst400-4cnf.py new file mode 100644 index 0000000000..7081525771 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst400-4cnf.py @@ -0,0 +1,157 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.1.143 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.1.143 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.p1_dst_start_mac = u"02:02:00:00:12:00" + + self.p2_dst_start_mac = u"02:02:00:00:02:00" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.1.143" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.1.143" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=3, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=3, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() + diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst400-8cnf.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst400-8cnf.py new file mode 100644 index 0000000000..c5b1d52e04 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst400-8cnf.py @@ -0,0 +1,157 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.1.143 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.1.143 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.p1_dst_start_mac = u"02:02:00:00:12:00" + + self.p2_dst_start_mac = u"02:02:00:00:02:00" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.1.143" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.1.143" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=7, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=7, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() + diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst400.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst400.py new file mode 100644 index 0000000000..44db3ec81c --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst400.py @@ -0,0 +1,126 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.1.143 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.1.143 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.1.143" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.1.143" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + 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 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40000-1cnf.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40000-1cnf.py new file mode 100644 index 0000000000..038b986b65 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40000-1cnf.py @@ -0,0 +1,157 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.156.63 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.156.63 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.p1_dst_start_mac = u"02:02:00:00:12:00" + + self.p2_dst_start_mac = u"02:02:00:00:02:00" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.156.63" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.156.63" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=0, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=0, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() + diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40000-2cnf.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40000-2cnf.py new file mode 100644 index 0000000000..5933b33d20 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40000-2cnf.py @@ -0,0 +1,157 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.156.63 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.156.63 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.p1_dst_start_mac = u"02:02:00:00:12:00" + + self.p2_dst_start_mac = u"02:02:00:00:02:00" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.156.63" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.156.63" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=1, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=1, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() + diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40000-4cnf.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40000-4cnf.py new file mode 100644 index 0000000000..851cd7c870 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40000-4cnf.py @@ -0,0 +1,157 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.156.63 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.156.63 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.p1_dst_start_mac = u"02:02:00:00:12:00" + + self.p2_dst_start_mac = u"02:02:00:00:02:00" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.156.63" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.156.63" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=3, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=3, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() + diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40000-8cnf.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40000-8cnf.py new file mode 100644 index 0000000000..40d57f09dd --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40000-8cnf.py @@ -0,0 +1,157 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.156.63 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.156.63 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.p1_dst_start_mac = u"02:02:00:00:12:00" + + self.p2_dst_start_mac = u"02:02:00:00:02:00" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.156.63" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.156.63" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=7, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=7, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() + diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40000.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40000.py new file mode 100644 index 0000000000..570a236fd6 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst40000.py @@ -0,0 +1,126 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.156.63 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.156.63 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.156.63" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.156.63" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + 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 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() \ No newline at end of file diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst5000-1cnf.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst5000-1cnf.py new file mode 100644 index 0000000000..fb4c61b030 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst5000-1cnf.py @@ -0,0 +1,157 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.19.135 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.19.135 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.p1_dst_start_mac = u"02:02:00:00:12:00" + + self.p2_dst_start_mac = u"02:02:00:00:02:00" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.19.135" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.19.135" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=0, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=0, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() + diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst5000-2cnf.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst5000-2cnf.py new file mode 100644 index 0000000000..ca13c337cb --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst5000-2cnf.py @@ -0,0 +1,157 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.19.135 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.19.135 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.p1_dst_start_mac = u"02:02:00:00:12:00" + + self.p2_dst_start_mac = u"02:02:00:00:02:00" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.19.135" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.19.135" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=1, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=1, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() + diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst5000-4cnf.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst5000-4cnf.py new file mode 100644 index 0000000000..1ffd8c8ba5 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst5000-4cnf.py @@ -0,0 +1,157 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.19.135 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.19.135 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.p1_dst_start_mac = u"02:02:00:00:12:00" + + self.p2_dst_start_mac = u"02:02:00:00:02:00" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.19.135" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.19.135" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=3, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=3, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() + diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst5000-8cnf.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst5000-8cnf.py new file mode 100644 index 0000000000..26efc1a438 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst5000-8cnf.py @@ -0,0 +1,157 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.19.135 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.19.135 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.p1_dst_start_mac = u"02:02:00:00:12:00" + + self.p2_dst_start_mac = u"02:02:00:00:02:00" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.19.135" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.19.135" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=7, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=7, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() + diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst5000.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst5000.py new file mode 100644 index 0000000000..95d8380a22 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst5000.py @@ -0,0 +1,126 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.19.135 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.19.135 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.19.135" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.19.135" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + 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 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() \ No newline at end of file diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst60000-1cnf.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst60000-1cnf.py new file mode 100644 index 0000000000..251758ddae --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst60000-1cnf.py @@ -0,0 +1,157 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.234.95 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.234.95 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.p1_dst_start_mac = u"02:02:00:00:12:00" + + self.p2_dst_start_mac = u"02:02:00:00:02:00" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.234.95" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.234.95" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=0, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=0, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() + diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst60000-2cnf.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst60000-2cnf.py new file mode 100644 index 0000000000..acebf6d06d --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst60000-2cnf.py @@ -0,0 +1,157 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.234.95 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.234.95 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.p1_dst_start_mac = u"02:02:00:00:12:00" + + self.p2_dst_start_mac = u"02:02:00:00:02:00" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.234.95" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.234.95" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=1, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=1, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() + diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst60000-4cnf.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst60000-4cnf.py new file mode 100644 index 0000000000..3fe3caf128 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst60000-4cnf.py @@ -0,0 +1,157 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.234.95 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.234.95 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.p1_dst_start_mac = u"02:02:00:00:12:00" + + self.p2_dst_start_mac = u"02:02:00:00:02:00" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.234.95" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.234.95" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=3, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=3, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() + diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst60000-8cnf.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst60000-8cnf.py new file mode 100644 index 0000000000..84bfb89f0b --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst60000-8cnf.py @@ -0,0 +1,157 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.234.95 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.234.95 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.p1_dst_start_mac = u"02:02:00:00:12:00" + + self.p2_dst_start_mac = u"02:02:00:00:02:00" + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.234.95" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.234.95" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=7, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=7, + size=1, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset=5 + ), + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() + diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst60000.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst60000.py new file mode 100644 index 0000000000..126302d545 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4dst60000.py @@ -0,0 +1,126 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.0.0.1 + - Destination IP address range: 20.0.0.0 - 20.0.234.95 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.1 + - Destination IP address range: 10.0.0.0 - 10.0.234.95 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.1" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.234.95" + + self.p2_src_start_ip = u"20.0.0.1" + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.234.95" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + 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 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4src253.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4src253.py new file mode 100644 index 0000000000..883883ad18 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4src253.py @@ -0,0 +1,126 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.10.10.2 - 10.10.10.254 + - Destination IP address range: 20.20.20.2 + - Direction 1 --> 0: + - Source IP address range: 20.20.20.2 - 20.20.20.254 + - Destination IP address range: 10.10.10.2 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.10.10.2" + self.p1_src_end_ip = u"10.10.10.254" + self.p1_dst_start_ip = u"20.20.20.2" + + self.p2_src_start_ip = u"20.20.20.2" + self.p2_src_end_ip = u"20.20.20.254" + self.p2_dst_start_ip = u"10.10.10.2" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + 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 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4src254.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4src254.py new file mode 100644 index 0000000000..fc6167d126 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-ip4src254.py @@ -0,0 +1,126 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source IP address range: 10.10.10.1 - 10.10.10.254 + - Destination IP address range: 20.20.20.1 + - Direction 1 --> 0: + - Source IP address range: 20.20.20.1 - 20.20.20.254 + - Destination IP address range: 10.10.10.1 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.10.10.1" + self.p1_src_end_ip = u"10.10.10.254" + self.p1_dst_start_ip = u"20.20.20.1" + + self.p2_src_start_ip = u"20.20.20.1" + self.p2_src_end_ip = u"20.20.20.254" + self.p2_dst_start_ip = u"10.10.10.1" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + 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 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-macsrc100ip4src100.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-macsrc100ip4src100.py new file mode 100644 index 0000000000..b94c56ad6c --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-macsrc100ip4src100.py @@ -0,0 +1,161 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: | ETH | IP | + - Direction 0 --> 1: + - Source MAC address range: ca:fe:00:00:00:00 - ca:fe:00:00:00:63 + - Source IP address range: 10.0.0.2 - 10.0.0.101 + - Destination IP address range: 20.0.0.1 + - Direction 1 --> 0: + - Source MAC address range: fa:ce:00:00:00:00 - fa:ce:00:00:00:63 + - Source IP address range: 20.0.0.2 - 20.0.0.101 + - Destination IP address range: 10.0.0.1 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.clients = 100 + + # MACs used in packet headers. + self.p1_src_start_mac = u"ca:fe:00:00:00:00" # mask: 00:00:FF:FF:FF:FF + + self.p2_src_start_mac = u"fa:ce:00:00:00:00" # mask: 00:00:FF:FF:FF:FF + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.2" + self.p1_src_end_ip = u"10.0.0.101" + self.p1_dst_start_ip = u"20.0.0.1" + + self.p2_src_start_ip = u"20.0.0.2" + self.p2_src_end_ip = u"20.0.0.101" + self.p2_dst_start_ip = u"10.0.0.1" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + src=self.p1_src_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + src=self.p2_src_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_src", + min_value=0, + max_value=self.clients-1, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_src", + pkt_offset=8 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_src", + min_value=0, + max_value=self.clients-1, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_src", + pkt_offset=8 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :returns: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-macsrc100kip4src100k.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-macsrc100kip4src100k.py new file mode 100644 index 0000000000..52eb841ab0 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-macsrc100kip4src100k.py @@ -0,0 +1,161 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: | ETH | IP | + - Direction 0 --> 1: + - Source MAC address range: ca:fe:00:00:00:00 - ca:fe:00:01:86:9f + - Source IP address range: 10.0.0.2 - 10.1.134.161 + - Destination IP address range: 20.0.0.1 + - Direction 1 --> 0: + - Source MAC address range: fa:ce:00:00:00:00 - fa:ce:00:01:86:9f + - Source IP address range: 20.0.0.2 - 20.1.134.161 + - Destination IP address range: 10.0.0.1 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.clients = 100000 + + # MACs used in packet headers. + self.p1_src_start_mac = u"ca:fe:00:00:00:00" # mask: 00:00:FF:FF:FF:FF + + self.p2_src_start_mac = u"fa:ce:00:00:00:00" # mask: 00:00:FF:FF:FF:FF + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.2" + self.p1_src_end_ip = u"10.1.134.161" + self.p1_dst_start_ip = u"20.0.0.1" + + self.p2_src_start_ip = u"20.0.0.2" + self.p2_src_end_ip = u"20.1.134.161" + self.p2_dst_start_ip = u"10.0.0.1" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + src=self.p1_src_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + src=self.p2_src_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_src", + min_value=0, + max_value=self.clients-1, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_src", + pkt_offset=8 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_src", + min_value=0, + max_value=self.clients-1, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_src", + pkt_offset=8 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :returns: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-macsrc10kip4src10k.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-macsrc10kip4src10k.py new file mode 100644 index 0000000000..8e959c829d --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-macsrc10kip4src10k.py @@ -0,0 +1,161 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: | ETH | IP | + - Direction 0 --> 1: + - Source MAC address range: ca:fe:00:00:00:00 - ca:fe:00:00:27:0f + - Source IP address range: 10.0.0.2 - 10.0.39.17 + - Destination IP address range: 20.0.0.1 + - Direction 1 --> 0: + - Source MAC address range: fa:ce:00:00:00:00 - fa:ce:00:00:27:0f + - Source IP address range: 20.0.0.2 - 20.0.39.17 + - Destination IP address range: 10.0.0.1 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.clients = 10000 + + # MACs used in packet headers. + self.p1_src_start_mac = u"ca:fe:00:00:00:00" # mask: 00:00:FF:FF:FF:FF + + self.p2_src_start_mac = u"fa:ce:00:00:00:00" # mask: 00:00:FF:FF:FF:FF + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.2" + self.p1_src_end_ip = u"10.0.39.17" + self.p1_dst_start_ip = u"20.0.0.1" + + self.p2_src_start_ip = u"20.0.0.2" + self.p2_src_end_ip = u"20.0.39.17" + self.p2_dst_start_ip = u"10.0.0.1" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + src=self.p1_src_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + src=self.p2_src_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_src", + min_value=0, + max_value=self.clients-1, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_src", + pkt_offset=8 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_src", + min_value=0, + max_value=self.clients-1, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_src", + pkt_offset=8 + ), + STLVmFlowVar( + name=u"src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"src", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :returns: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-macsrc500kdst500k.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-macsrc500kdst500k.py new file mode 100644 index 0000000000..da4348f2a0 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-macsrc500kdst500k.py @@ -0,0 +1,215 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source MAC address range: ca:fe:00:00:00:00 - ca:fe:00:07:a1:1f + - Destination MAC address range: fa:ce:00:00:00:00 - fa:ce:00:07:a1:1f + - Source IP address range: 10.0.0.0 - 10.7.161.31 + - Destination IP address range: 20.0.0.0 - 20.7.161.31 + - Direction 1 --> 0: + - Source MAC address range: fa:ce:00:00:00:00 - fa:ce:00:07:a1:1f + - Destination MAC address range: ca:fe:00:00:00:00 - ca:fe:00:07:a1:1f + - Source IP address range: 20.0.0.0 - 20.7.161.31 + - Destination IP address range: 10.0.0.0 - 10.7.161.31 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.clients = 500000 + + # MACs used in packet headers. + self.p1_src_start_mac = u"ca:fe:00:00:00:00" # mask: 00:00:FF:FF:FF:FF + self.p1_dst_start_mac = u"fa:ce:00:00:00:00" # mask: 00:00:FF:FF:FF:FF + + self.p2_src_start_mac = u"fa:ce:00:00:00:00" # mask: 00:00:FF:FF:FF:FF + self.p2_dst_start_mac = u"ca:fe:00:00:00:00" # mask: 00:00:FF:FF:FF:FF + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.0" + self.p1_src_end_ip = u"10.7.161.31" + + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.7.161.31" + + self.p2_src_start_ip = u"20.0.0.0" + self.p2_src_end_ip = u"20.7.161.31" + + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.7.161.31" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + src=self.p1_src_start_mac, + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + src=self.p2_src_start_mac, + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_src", + min_value=0, + max_value=self.clients-1, + size=4, + op=u"inc" + ), + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=self.clients-1, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_src", + pkt_offset= 8 + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset= 2 + ), + STLVmFlowVar( + name=u"ip_src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ip_src", + pkt_offset=u"IP.src" + ), + STLVmFlowVar( + name=u"ip_dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ip_dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_src", + min_value=0, + max_value=self.clients-1, + size=4, + op=u"inc" + ), + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=self.clients-1, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_src", + pkt_offset= 8 + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset= 2 + ), + STLVmFlowVar( + name=u"ip_src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ip_src", + pkt_offset=u"IP.src" + ), + STLVmFlowVar( + name=u"ip_dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ip_dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-macsrc50kdst50k.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-macsrc50kdst50k.py new file mode 100644 index 0000000000..6cf066367b --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-macsrc50kdst50k.py @@ -0,0 +1,215 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source MAC address range: ca:fe:00:00:00:00 - ca:fe:00:00:c3:4f + - Destination MAC address range: fa:ce:00:00:00:00 - fa:ce:00:00:c3:4f + - Source IP address range: 10.0.0.0 - 10.0.195.79 + - Destination IP address range: 20.0.0.0 - 20.0.195.79 + - Direction 1 --> 0: + - Source MAC address range: fa:ce:00:00:00:00 - fa:ce:00:00:c3:4f + - Destination MAC address range: ca:fe:00:00:00:00 - ca:fe:00:00:c3:4f + - Source IP address range: 20.0.0.0 - 20.0.195.79 + - Destination IP address range: 10.0.0.0 - 10.0.195.79 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.clients = 50000 + + # MACs used in packet headers. + self.p1_src_start_mac = u"ca:fe:00:00:00:00" # mask: 00:00:FF:FF:FF:FF + self.p1_dst_start_mac = u"fa:ce:00:00:00:00" # mask: 00:00:FF:FF:FF:FF + + self.p2_src_start_mac = u"fa:ce:00:00:00:00" # mask: 00:00:FF:FF:FF:FF + self.p2_dst_start_mac = u"ca:fe:00:00:00:00" # mask: 00:00:FF:FF:FF:FF + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.0" + self.p1_src_end_ip = u"10.0.195.79" + + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.195.79" + + self.p2_src_start_ip = u"20.0.0.0" + self.p2_src_end_ip = u"20.0.195.79" + + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.195.79" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + src=self.p1_src_start_mac, + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + src=self.p2_src_start_mac, + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_src", + min_value=0, + max_value=self.clients-1, + size=4, + op=u"inc" + ), + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=self.clients-1, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_src", + pkt_offset= 8 + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset= 2 + ), + STLVmFlowVar( + name=u"ip_src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ip_src", + pkt_offset=u"IP.src" + ), + STLVmFlowVar( + name=u"ip_dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ip_dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_src", + min_value=0, + max_value=self.clients-1, + size=4, + op=u"inc" + ), + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=self.clients-1, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_src", + pkt_offset= 8 + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset= 2 + ), + STLVmFlowVar( + name=u"ip_src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ip_src", + pkt_offset=u"IP.src" + ), + STLVmFlowVar( + name=u"ip_dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ip_dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-macsrc5kdst5k.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-macsrc5kdst5k.py new file mode 100644 index 0000000000..29df3373d3 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4-macsrc5kdst5k.py @@ -0,0 +1,215 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / + - Direction 0 --> 1: + - Source MAC address range: ca:fe:00:00:00:00 - ca:fe:00:00:13:87 + - Destination MAC address range: fa:ce:00:00:00:00 - fa:ce:00:00:13:87 + - Source IP address range: 10.0.0.0 - 10.0.19.135 + - Destination IP address range: 20.0.0.0 - 20.0.19.135 + - Direction 1 --> 0: + - Source MAC address range: fa:ce:00:00:00:00 - fa:ce:00:00:13:87 + - Destination MAC address range: ca:fe:00:00:00:00 - ca:fe:00:00:13:87 + - Source IP address range: 20.0.0.0 - 20.0.19.135 + - Destination IP address range: 10.0.0.0 - 10.0.19.135 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.clients = 5000 + + # MACs used in packet headers. + self.p1_src_start_mac = u"ca:fe:00:00:00:00" # mask: 00:00:FF:FF:FF:FF + self.p1_dst_start_mac = u"fa:ce:00:00:00:00" # mask: 00:00:FF:FF:FF:FF + + self.p2_src_start_mac = u"fa:ce:00:00:00:00" # mask: 00:00:FF:FF:FF:FF + self.p2_dst_start_mac = u"ca:fe:00:00:00:00" # mask: 00:00:FF:FF:FF:FF + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.0.0.0" + self.p1_src_end_ip = u"10.0.19.135" + + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.19.135" + + self.p2_src_start_ip = u"20.0.0.0" + self.p2_src_end_ip = u"20.0.19.135" + + self.p2_dst_start_ip = u"10.0.0.0" + self.p2_dst_end_ip = u"10.0.19.135" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + src=self.p1_src_start_mac, + dst=self.p1_dst_start_mac + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + src=self.p2_src_start_mac, + dst=self.p2_dst_start_mac + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_src", + min_value=0, + max_value=self.clients-1, + size=4, + op=u"inc" + ), + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=self.clients-1, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_src", + pkt_offset= 8 + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset= 2 + ), + STLVmFlowVar( + name=u"ip_src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ip_src", + pkt_offset=u"IP.src" + ), + STLVmFlowVar( + name=u"ip_dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ip_dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"mac_src", + min_value=0, + max_value=self.clients-1, + size=4, + op=u"inc" + ), + STLVmFlowVar( + name=u"mac_dst", + min_value=0, + max_value=self.clients-1, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"mac_src", + pkt_offset= 8 + ), + STLVmWrFlowVar( + fv_name=u"mac_dst", + pkt_offset= 2 + ), + STLVmFlowVar( + name=u"ip_src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ip_src", + pkt_offset=u"IP.src" + ), + STLVmFlowVar( + name=u"ip_dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ip_dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-1000u15p.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-1000u15p.py new file mode 100644 index 0000000000..b7b364f195 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-1000u15p.py @@ -0,0 +1,148 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / UDP + - Direction 0 --> 1: + - Source IP address range: 20.0.0.0 - 20.0.3.231 + - Destination IP address range: 12.0.0.2 + - Source UDP port range: 1024 - 1038 + - Destination UDP port range: 1024 + - Direction 1 --> 0: + - Source IP address range: 12.0.0.2 + - Destination IP address range: 200.0.0.0 + - Source UDP port range: 1024 + - Destination UDP port range: 1024 - 16023 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"20.0.0.0" + self.p1_src_end_ip = u"20.0.3.231" + self.p1_dst_start_ip = u"12.0.0.2" + + self.p2_src_start_ip = u"12.0.0.2" + self.p2_src_end_ip = u"12.0.0.2" + self.p2_dst_start_ip = u"200.0.0.0" + + # UDP ports used in packet headers. + self.p1_src_start_udp_port = 1024 + self.p1_src_end_udp_port = 1038 + self.p1_dst_start_udp_port = 1024 + + self.p2_src_start_udp_port = 1024 + self.p2_dst_start_udp_port = 1024 + self.p2_dst_end_udp_port = 16023 + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | UDP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether() / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=17 + ) / + UDP( + sport=self.p1_src_start_udp_port, + dport=self.p1_dst_start_udp_port + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether() / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=17 + ) / + UDP( + sport=self.p2_src_start_udp_port, + dport=self.p2_dst_start_udp_port + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmTupleGen( + ip_min=self.p1_src_start_ip, + ip_max=self.p1_src_end_ip, + port_min=self.p1_src_start_udp_port, + port_max=self.p1_src_end_udp_port, + name=u"tuple" + ), + STLVmWrFlowVar( + fv_name=u"tuple.ip", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ), + STLVmWrFlowVar( + fv_name=u"tuple.port", + pkt_offset=u"UDP.sport" + ) + ] + ) + # Direction 0 --> 1 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"dport", + min_value=self.p2_dst_start_udp_port, + max_value=self.p2_dst_end_udp_port, + size=2, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dport", + pkt_offset=u"UDP.dport" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-100u1000p-conc.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-100u1000p-conc.py new file mode 100644 index 0000000000..b93cd645ae --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-100u1000p-conc.py @@ -0,0 +1,189 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / UDP + - Direction 0 --> 1: + - Source IP address range: 10.10.10.2 - 10.10.10.101 + - Destination IP address range: 20.20.20.2 - 20.20.20.101 + - Source UDP port range: 1001 - 2000 + - Destination UDP port range: 2001 - 3000 + - Direction 1 --> 0: + - Source IP address range: 20.20.20.2 - 20.20.20.101 + - Destination IP address range: 10.10.10.2 - 10.10.10.101 + - Source UDP port range: 2001 - 3000 + - Destination UDP port range: 1001 - 2000 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.10.10.2" + self.p1_src_end_ip = u"10.10.10.101" + self.p1_dst_start_ip = u"20.20.20.2" + self.p1_dst_end_ip = u"20.20.20.101" + + self.p2_src_start_ip = u"20.20.20.2" + self.p2_src_end_ip = u"20.20.20.101" + self.p2_dst_start_ip = u"10.10.10.2" + self.p2_dst_end_ip = u"10.10.10.101" + + # UDP ports used in packet headers. + self.p1_src_start_udp_port = 1001 + self.p1_src_end_udp_port = 2000 + self.p1_dst_start_udp_port = 2001 + self.p1_dst_end_udp_port = 3000 + + self.p2_src_start_udp_port = 2001 + self.p2_src_end_udp_port = 3000 + self.p2_dst_start_udp_port = 1001 + self.p2_dst_end_udp_port = 2000 + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | UDP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether() / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=17 + ) / + UDP( + sport=self.p1_src_start_udp_port, + dport=self.p1_dst_start_udp_port + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether() / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=17 + ) / + UDP( + sport=self.p2_src_start_udp_port, + dport=self.p2_dst_start_udp_port + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmTupleGen( + ip_min=self.p1_src_start_ip, + ip_max=self.p1_src_end_ip, + port_min=self.p1_src_start_udp_port, + port_max=self.p1_src_end_udp_port, + name=u"tuple1_src" + ), + STLVmTupleGen( + ip_min=self.p1_dst_start_ip, + ip_max=self.p1_dst_end_ip, + port_min=self.p1_dst_start_udp_port, + port_max=self.p1_dst_end_udp_port, + name=u"tuple1_dst" + ), + STLVmWrFlowVar( + fv_name=u"tuple1_src.ip", + pkt_offset=u"IP.src" + ), + STLVmWrFlowVar( + fv_name=u"tuple1_dst.ip", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ), + STLVmWrFlowVar( + fv_name=u"tuple1_src.port", + pkt_offset=u"UDP.sport" + ), + STLVmWrFlowVar( + fv_name=u"tuple1_dst.port", + pkt_offset=u"UDP.dport" + ) + ] + ) + # Direction 0 --> 1 + vm2 = STLScVmRaw( + [ + STLVmTupleGen( + ip_min=self.p2_src_start_ip, + ip_max=self.p2_src_end_ip, + port_min=self.p2_src_start_udp_port, + port_max=self.p2_src_end_udp_port, + name=u"tuple2_src" + ), + STLVmTupleGen( + ip_min=self.p2_dst_start_ip, + ip_max=self.p2_dst_end_ip, + port_min=self.p2_dst_start_udp_port, + port_max=self.p2_dst_end_udp_port, + name=u"tuple2_dst" + ), + STLVmWrFlowVar( + fv_name=u"tuple2_src.ip", + pkt_offset=u"IP.src" + ), + STLVmWrFlowVar( + fv_name=u"tuple2_dst.ip", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ), + STLVmWrFlowVar( + fv_name=u"tuple2_src.port", + pkt_offset=u"UDP.sport" + ), + STLVmWrFlowVar( + fv_name=u"tuple2_dst.port", + pkt_offset=u"UDP.dport" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-100u15p.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-100u15p.py new file mode 100644 index 0000000000..31cdc5e628 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-100u15p.py @@ -0,0 +1,148 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / UDP + - Direction 0 --> 1: + - Source IP address range: 20.0.0.0 - 20.0.0.99 + - Destination IP address range: 12.0.0.2 + - Source UDP port range: 1024 - 1038 + - Destination UDP port range: 1024 + - Direction 1 --> 0: + - Source IP address range: 12.0.0.2 + - Destination IP address range: 200.0.0.0 + - Source UDP port range: 1024 + - Destination UDP port range: 1024 - 2523 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"20.0.0.0" + self.p1_src_end_ip = u"20.0.0.99" + self.p1_dst_start_ip = u"12.0.0.2" + + self.p2_src_start_ip = u"12.0.0.2" + self.p2_src_end_ip = u"12.0.0.2" + self.p2_dst_start_ip = u"200.0.0.0" + + # UDP ports used in packet headers. + self.p1_src_start_udp_port = 1024 + self.p1_src_end_udp_port = 1038 + self.p1_dst_start_udp_port = 1024 + + self.p2_src_start_udp_port = 1024 + self.p2_dst_start_udp_port = 1024 + self.p2_dst_end_udp_port = 2523 + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | UDP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether() / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=17 + ) / + UDP( + sport=self.p1_src_start_udp_port, + dport=self.p1_dst_start_udp_port + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether() / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=17 + ) / + UDP( + sport=self.p2_src_start_udp_port, + dport=self.p2_dst_start_udp_port + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmTupleGen( + ip_min=self.p1_src_start_ip, + ip_max=self.p1_src_end_ip, + port_min=self.p1_src_start_udp_port, + port_max=self.p1_src_end_udp_port, + name=u"tuple" + ), + STLVmWrFlowVar( + fv_name=u"tuple.ip", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ), + STLVmWrFlowVar( + fv_name=u"tuple.port", + pkt_offset=u"UDP.sport" + ) + ] + ) + # Direction 0 --> 1 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"dport", + min_value=self.p2_dst_start_udp_port, + max_value=self.p2_dst_end_udp_port, + size=2, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dport", + pkt_offset=u"UDP.dport" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-10u1000p-conc.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-10u1000p-conc.py new file mode 100644 index 0000000000..9032a8c2f5 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-10u1000p-conc.py @@ -0,0 +1,189 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / UDP + - Direction 0 --> 1: + - Source IP address range: 10.10.10.2 - 10.10.10.11 + - Destination IP address range: 20.20.20.2 - 20.20.20.11 + - Source UDP port range: 1001 - 2000 + - Destination UDP port range: 2001 - 3000 + - Direction 1 --> 0: + - Source IP address range: 20.20.20.2 - 20.20.20.11 + - Destination IP address range: 10.10.10.2 - 10.10.10.11 + - Source UDP port range: 2001 - 3000 + - Destination UDP port range: 1001 - 2000 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.10.10.2" + self.p1_src_end_ip = u"10.10.10.11" + self.p1_dst_start_ip = u"20.20.20.2" + self.p1_dst_end_ip = u"20.20.20.11" + + self.p2_src_start_ip = u"20.20.20.2" + self.p2_src_end_ip = u"20.20.20.11" + self.p2_dst_start_ip = u"10.10.10.2" + self.p2_dst_end_ip = u"10.10.10.11" + + # UDP ports used in packet headers. + self.p1_src_start_udp_port = 1001 + self.p1_src_end_udp_port = 2000 + self.p1_dst_start_udp_port = 2001 + self.p1_dst_end_udp_port = 3000 + + self.p2_src_start_udp_port = 2001 + self.p2_src_end_udp_port = 3000 + self.p2_dst_start_udp_port = 1001 + self.p2_dst_end_udp_port = 2000 + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | UDP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether() / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=17 + ) / + UDP( + sport=self.p1_src_start_udp_port, + dport=self.p1_dst_start_udp_port + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether() / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=17 + ) / + UDP( + sport=self.p2_src_start_udp_port, + dport=self.p2_dst_start_udp_port + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmTupleGen( + ip_min=self.p1_src_start_ip, + ip_max=self.p1_src_end_ip, + port_min=self.p1_src_start_udp_port, + port_max=self.p1_src_end_udp_port, + name=u"tuple1_src" + ), + STLVmTupleGen( + ip_min=self.p1_dst_start_ip, + ip_max=self.p1_dst_end_ip, + port_min=self.p1_dst_start_udp_port, + port_max=self.p1_dst_end_udp_port, + name=u"tuple1_dst" + ), + STLVmWrFlowVar( + fv_name=u"tuple1_src.ip", + pkt_offset=u"IP.src" + ), + STLVmWrFlowVar( + fv_name=u"tuple1_dst.ip", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ), + STLVmWrFlowVar( + fv_name=u"tuple1_src.port", + pkt_offset=u"UDP.sport" + ), + STLVmWrFlowVar( + fv_name=u"tuple1_dst.port", + pkt_offset=u"UDP.dport" + ) + ] + ) + # Direction 0 --> 1 + vm2 = STLScVmRaw( + [ + STLVmTupleGen( + ip_min=self.p2_src_start_ip, + ip_max=self.p2_src_end_ip, + port_min=self.p2_src_start_udp_port, + port_max=self.p2_src_end_udp_port, + name=u"tuple2_src" + ), + STLVmTupleGen( + ip_min=self.p2_dst_start_ip, + ip_max=self.p2_dst_end_ip, + port_min=self.p2_dst_start_udp_port, + port_max=self.p2_dst_end_udp_port, + name=u"tuple2_dst" + ), + STLVmWrFlowVar( + fv_name=u"tuple2_src.ip", + pkt_offset=u"IP.src" + ), + STLVmWrFlowVar( + fv_name=u"tuple2_dst.ip", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ), + STLVmWrFlowVar( + fv_name=u"tuple2_src.port", + pkt_offset=u"UDP.sport" + ), + STLVmWrFlowVar( + fv_name=u"tuple2_dst.port", + pkt_offset=u"UDP.dport" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-10u10p-conc.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-10u10p-conc.py new file mode 100644 index 0000000000..29433b3d27 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-10u10p-conc.py @@ -0,0 +1,189 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / UDP + - Direction 0 --> 1: + - Source IP address range: 10.10.10.2 - 10.10.10.11 + - Destination IP address range: 20.20.20.2 - 20.20.2011 + - Source UDP port range: 1001 - 1010 + - Destination UDP port range: 2001 - 2010 + - Direction 1 --> 0: + - Source IP address range: 20.20.20.2 - 20.20.20.11 + - Destination IP address range: 10.10.10.2 - 10.10.10.11 + - Source UDP port range: 2001 - 2010 + - Destination UDP port range: 1001 - 1010 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.10.10.2" + self.p1_src_end_ip = u"10.10.10.11" + self.p1_dst_start_ip = u"20.20.20.2" + self.p1_dst_end_ip = u"20.20.20.11" + + self.p2_src_start_ip = u"20.20.20.2" + self.p2_src_end_ip = u"20.20.20.11" + self.p2_dst_start_ip = u"10.10.10.2" + self.p2_dst_end_ip = u"10.10.10.11" + + # UDP ports used in packet headers. + self.p1_src_start_udp_port = 1001 + self.p1_src_end_udp_port = 1010 + self.p1_dst_start_udp_port = 2001 + self.p1_dst_end_udp_port = 2010 + + self.p2_src_start_udp_port = 2001 + self.p2_src_end_udp_port = 2010 + self.p2_dst_start_udp_port = 1001 + self.p2_dst_end_udp_port = 1010 + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | UDP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether() / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=17 + ) / + UDP( + sport=self.p1_src_start_udp_port, + dport=self.p1_dst_start_udp_port + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether() / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=17 + ) / + UDP( + sport=self.p2_src_start_udp_port, + dport=self.p2_dst_start_udp_port + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmTupleGen( + ip_min=self.p1_src_start_ip, + ip_max=self.p1_src_end_ip, + port_min=self.p1_src_start_udp_port, + port_max=self.p1_src_end_udp_port, + name=u"tuple1_src" + ), + STLVmTupleGen( + ip_min=self.p1_dst_start_ip, + ip_max=self.p1_dst_end_ip, + port_min=self.p1_dst_start_udp_port, + port_max=self.p1_dst_end_udp_port, + name=u"tuple1_dst" + ), + STLVmWrFlowVar( + fv_name=u"tuple1_src.ip", + pkt_offset=u"IP.src" + ), + STLVmWrFlowVar( + fv_name=u"tuple1_dst.ip", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ), + STLVmWrFlowVar( + fv_name=u"tuple1_src.port", + pkt_offset=u"UDP.sport" + ), + STLVmWrFlowVar( + fv_name=u"tuple1_dst.port", + pkt_offset=u"UDP.dport" + ) + ] + ) + # Direction 0 --> 1 + vm2 = STLScVmRaw( + [ + STLVmTupleGen( + ip_min=self.p2_src_start_ip, + ip_max=self.p2_src_end_ip, + port_min=self.p2_src_start_udp_port, + port_max=self.p2_src_end_udp_port, + name=u"tuple2_src" + ), + STLVmTupleGen( + ip_min=self.p2_dst_start_ip, + ip_max=self.p2_dst_end_ip, + port_min=self.p2_dst_start_udp_port, + port_max=self.p2_dst_end_udp_port, + name=u"tuple2_dst" + ), + STLVmWrFlowVar( + fv_name=u"tuple2_src.ip", + pkt_offset=u"IP.src" + ), + STLVmWrFlowVar( + fv_name=u"tuple2_dst.ip", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ), + STLVmWrFlowVar( + fv_name=u"tuple2_src.port", + pkt_offset=u"UDP.sport" + ), + STLVmWrFlowVar( + fv_name=u"tuple2_dst.port", + pkt_offset=u"UDP.dport" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-10u15p.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-10u15p.py new file mode 100644 index 0000000000..57c5b2dcbc --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-10u15p.py @@ -0,0 +1,148 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / UDP + - Direction 0 --> 1: + - Source IP address range: 20.0.0.0 - 20.0.0.9 + - Destination IP address range: 12.0.0.2 + - Source UDP port range: 1024 - 1038 + - Destination UDP port range: 1024 + - Direction 1 --> 0: + - Source IP address range: 12.0.0.2 + - Destination IP address range: 200.0.0.0 + - Source UDP port range: 1024 + - Destination UDP port range: 1024 - 1173 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"20.0.0.0" + self.p1_src_end_ip = u"20.0.0.9" + self.p1_dst_start_ip = u"12.0.0.2" + + self.p2_src_start_ip = u"12.0.0.2" + #self.p2_src_end_ip = u"12.0.0.2" + self.p2_dst_start_ip = u"200.0.0.0" + + # UDP ports used in packet headers. + self.p1_src_start_udp_port = 1024 + self.p1_src_end_udp_port = 1038 + self.p1_dst_start_udp_port = 1024 + + self.p2_src_start_udp_port = 1024 + self.p2_dst_start_udp_port = 1024 + self.p2_dst_end_udp_port = 1173 + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | UDP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether() / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=17 + ) / + UDP( + sport=self.p1_src_start_udp_port, + dport=self.p1_dst_start_udp_port + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether() / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=17 + ) / + UDP( + sport=self.p2_src_start_udp_port, + dport=self.p2_dst_start_udp_port + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmTupleGen( + ip_min=self.p1_src_start_ip, + ip_max=self.p1_src_end_ip, + port_min=self.p1_src_start_udp_port, + port_max=self.p1_src_end_udp_port, + name=u"tuple" + ), + STLVmWrFlowVar( + fv_name=u"tuple.ip", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ), + STLVmWrFlowVar( + fv_name=u"tuple.port", + pkt_offset=u"UDP.sport" + ) + ] + ) + # Direction 0 --> 1 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"dport", + min_value=self.p2_dst_start_udp_port, + max_value=self.p2_dst_end_udp_port, + size=2, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dport", + pkt_offset=u"UDP.dport" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-1u15p.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-1u15p.py new file mode 100644 index 0000000000..df9a1642a9 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-1u15p.py @@ -0,0 +1,141 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / UDP + - Direction 0 --> 1: + - Source IP address range: 20.0.0.0 + - Destination IP address range: 12.0.0.2 + - Source UDP port range: 1024 - 1038 + - Destination UDP port range: 1024 + - Direction 1 --> 0: + - Source IP address range: 12.0.0.2 + - Destination IP address range: 200.0.0.0 + - Source UDP port range: 1024 + - Destination UDP port range: 1024 - 1038 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"20.0.0.0" + self.p1_src_end_ip = u"20.0.0.0" + self.p1_dst_start_ip = u"12.0.0.2" + + self.p2_src_start_ip = u"12.0.0.2" + self.p2_src_end_ip = u"12.0.0.2" + self.p2_dst_start_ip = u"200.0.0.0" + + # UDP ports used in packet headers. + self.p1_src_start_udp_port = 1024 + self.p1_src_end_udp_port = 1038 + self.p1_dst_start_udp_port = 1024 + + self.p2_src_start_udp_port = 1024 + self.p2_dst_start_udp_port = 1024 + self.p2_dst_end_udp_port = 1038 + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | UDP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether() / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=17 + ) / + UDP( + sport=self.p1_src_start_udp_port, + dport=self.p1_dst_start_udp_port + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether() / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=17 + ) / + UDP( + sport=self.p2_src_start_udp_port, + dport=self.p2_dst_start_udp_port + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"sport", + min_value=self.p1_src_start_udp_port, + max_value=self.p1_src_end_udp_port, + size=2, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"sport", + pkt_offset=u"UDP.sport" + ) + ] + ) + # Direction 0 --> 1 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"dport", + min_value=self.p2_dst_start_udp_port, + max_value=self.p2_dst_end_udp_port, + size=2, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dport", + pkt_offset=u"UDP.dport" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-1u1p.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-1u1p.py new file mode 100644 index 0000000000..a892ec8822 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-1u1p.py @@ -0,0 +1,104 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / UDP + - Direction 0 --> 1: + - Source IP address range: 20.0.0.0 + - Destination IP address range: 12.0.0.2 + - Source UDP port range: 1024 + - Destination UDP port range: 1024 + - Direction 1 --> 0: + - Source IP address range: 12.0.0.2 + - Destination IP address range: 200.0.0.0 + - Source UDP port range: 1024 + - Destination UDP port range: 1028 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_ip = u"20.0.0.0" + self.p1_dst_ip = u"12.0.0.2" + + self.p2_src_ip = u"12.0.0.2" + self.p2_dst_ip = u"200.0.0.0" + + # UDP ports used in packet headers. + self.p1_src_udp_port = 1024 + self.p1_dst_udp_port = 1024 + + self.p2_src_udp_port = 1024 + self.p2_dst_udp_port = 1028 + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | UDP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether() / + IP( + src=self.p1_src_ip, + dst=self.p1_dst_ip, + proto=17 + ) / + UDP( + sport=self.p1_src_udp_port, + dport=self.p1_dst_udp_port + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether() / + IP( + src=self.p2_src_ip, + dst=self.p2_dst_ip, + proto=17 + ) / + UDP( + sport=self.p2_src_udp_port, + dport=self.p2_dst_udp_port + ) + ) + + return base_pkt_a, base_pkt_b, None, None + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-2000u15p.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-2000u15p.py new file mode 100644 index 0000000000..c96f76aaee --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-2000u15p.py @@ -0,0 +1,148 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / UDP + - Direction 0 --> 1: + - Source IP address range: 20.0.0.0 - 20.0.7.207 + - Destination IP address range: 12.0.0.2 + - Source UDP port range: 1024 - 1038 + - Destination UDP port range: 1024 + - Direction 1 --> 0: + - Source IP address range: 12.0.0.2 + - Destination IP address range: 200.0.0.0 + - Source UDP port range: 1024 + - Destination UDP port range: 1024 - 31022 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"20.0.0.0" + self.p1_src_end_ip = u"20.0.7.207" + self.p1_dst_start_ip = u"12.0.0.2" + + self.p2_src_start_ip = u"12.0.0.2" + self.p2_src_end_ip = u"12.0.0.2" + self.p2_dst_start_ip = u"200.0.0.0" + + # UDP ports used in packet headers. + self.p1_src_start_udp_port = 1024 + self.p1_src_end_udp_port = 1038 + self.p1_dst_start_udp_port = 1024 + + self.p2_src_start_udp_port = 1024 + self.p2_dst_start_udp_port = 1024 + self.p2_dst_end_udp_port = 31022 + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | UDP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether() / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=17 + ) / + UDP( + sport=self.p1_src_start_udp_port, + dport=self.p1_dst_start_udp_port + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether() / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=17 + ) / + UDP( + sport=self.p2_src_start_udp_port, + dport=self.p2_dst_start_udp_port + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmTupleGen( + ip_min=self.p1_src_start_ip, + ip_max=self.p1_src_end_ip, + port_min=self.p1_src_start_udp_port, + port_max=self.p1_src_end_udp_port, + name=u"tuple" + ), + STLVmWrFlowVar( + fv_name=u"tuple.ip", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ), + STLVmWrFlowVar( + fv_name=u"tuple.port", + pkt_offset=u"UDP.sport" + ) + ] + ) + # Direction 0 --> 1 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"dport", + min_value=self.p2_dst_start_udp_port, + max_value=self.p2_dst_end_udp_port, + size=2, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dport", + pkt_offset=u"UDP.dport" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-4000u15p.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-4000u15p.py new file mode 100644 index 0000000000..c1b3d5ba59 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip4udp-4000u15p.py @@ -0,0 +1,148 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / UDP + - Direction 0 --> 1: + - Source IP address range: 20.0.0.0 - 20.0.15.159 + - Destination IP address range: 12.0.0.2 + - Source UDP port range: 1024 - 1038 + - Destination UDP port range: 1024 + - Direction 1 --> 0: + - Source IP address range: 12.0.0.2 + - Destination IP address range: 200.0.0.0 + - Source UDP port range: 1024 + - Destination UDP port range: 1024 - 61022 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"20.0.0.0" + self.p1_src_end_ip = u"20.0.15.159" + self.p1_dst_start_ip = u"12.0.0.2" + + self.p2_src_start_ip = u"12.0.0.2" + self.p2_src_end_ip = u"12.0.0.2" + self.p2_dst_start_ip = u"200.0.0.0" + + # UDP ports used in packet headers. + self.p1_src_start_udp_port = 1024 + self.p1_src_end_udp_port = 1038 + self.p1_dst_start_udp_port = 1024 + + self.p2_src_start_udp_port = 1024 + self.p2_dst_start_udp_port = 1024 + self.p2_dst_end_udp_port = 61022 + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | UDP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether() / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=17 + ) / + UDP( + sport=self.p1_src_start_udp_port, + dport=self.p1_dst_start_udp_port + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether() / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=17 + ) / + UDP( + sport=self.p2_src_start_udp_port, + dport=self.p2_dst_start_udp_port + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmTupleGen( + ip_min=self.p1_src_start_ip, + ip_max=self.p1_src_end_ip, + port_min=self.p1_src_start_udp_port, + port_max=self.p1_src_end_udp_port, + name=u"tuple" + ), + STLVmWrFlowVar( + fv_name=u"tuple.ip", + pkt_offset=u"IP.src" + ), + STLVmFixIpv4( + offset=u"IP" + ), + STLVmWrFlowVar( + fv_name=u"tuple.port", + pkt_offset=u"UDP.sport" + ) + ] + ) + # Direction 0 --> 1 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"dport", + min_value=self.p2_dst_start_udp_port, + max_value=self.p2_dst_end_udp_port, + size=2, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"dport", + pkt_offset=u"UDP.dport" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip6-ip6dst10000.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip6-ip6dst10000.py new file mode 100644 index 0000000000..f1b90350fb --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip6-ip6dst10000.py @@ -0,0 +1,129 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IPv6 / + - Direction 0 --> 1: + - Source IP address range: 2001:1::1 + - Destination IP address range: 2001:2::0 - 2001:2::270F + - Direction 1 --> 0: + - Source IP address range: 2001:2::1 + - Destination IP address range: 2001:1::0 - 2001:1::270F +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"2001:1::1" + self.p1_dst_start_ip = u"2001:2::0" + self.p1_dst_end_ip = u"2001:2::270F" + + self.p2_src_start_ip = u"2001:2::1" + self.p2_dst_start_ip = u"2001:1::0" + self.p2_dst_end_ip = u"2001:1::270F" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IPv6 | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + base_p1, count_p1 = self._get_start_end_ipv6( + self.p1_dst_start_ip, + self.p1_dst_end_ip + ) + base_p2, count_p2 = self._get_start_end_ipv6( + self.p2_dst_start_ip, + self.p2_dst_end_ip + ) + + # Direction 0 --> 1 + base_pkt_a = ( + Ether() / + IPv6( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether() / + IPv6( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"ipv6_dst", + min_value=base_p1, + max_value=base_p1 + count_p1, + size=8, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ipv6_dst", + pkt_offset=u"IPv6.dst", + offset_fixup=8 + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"ipv6_dst", + min_value=base_p2, + max_value=base_p2 + count_p2, + size=8, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ipv6_dst", + pkt_offset=u"IPv6.dst", + offset_fixup=8 + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip6-ip6dst100000.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip6-ip6dst100000.py new file mode 100644 index 0000000000..87e76726b2 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip6-ip6dst100000.py @@ -0,0 +1,129 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IPv6 / + - Direction 0 --> 1: + - Source IP address range: 2001:1::1 + - Destination IP address range: 2001:2::0 - 2001:2::1:869F + - Direction 1 --> 0: + - Source IP address range: 2001:2::1 + - Destination IP address range: 2001:1::0 - 2001:1::1:869F +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"2001:1::1" + self.p1_dst_start_ip = u"2001:2::0" + self.p1_dst_end_ip = u"2001:2::1:869F" + + self.p2_src_start_ip = u"2001:2::1" + self.p2_dst_start_ip = u"2001:1::0" + self.p2_dst_end_ip = u"2001:1::1:869F" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IPv6 | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + base_p1, count_p1 = self._get_start_end_ipv6( + self.p1_dst_start_ip, + self.p1_dst_end_ip + ) + base_p2, count_p2 = self._get_start_end_ipv6( + self.p2_dst_start_ip, + self.p2_dst_end_ip + ) + + # Direction 0 --> 1 + base_pkt_a = ( + Ether() / + IPv6( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether() / + IPv6( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"ipv6_dst", + min_value=base_p1, + max_value=base_p1 + count_p1, + size=8, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ipv6_dst", + pkt_offset=u"IPv6.dst", + offset_fixup=8 + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"ipv6_dst", + min_value=base_p2, + max_value=base_p2 + count_p2, + size=8, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ipv6_dst", + pkt_offset=u"IPv6.dst", + offset_fixup=8 + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip6-ip6dst1000000.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip6-ip6dst1000000.py new file mode 100644 index 0000000000..c6870d89fa --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip6-ip6dst1000000.py @@ -0,0 +1,129 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IPv6 / + - Direction 0 --> 1: + - Source IP address range: 2001:1::1 + - Destination IP address range: 2001:2::0 - 2001:2::F:423F + - Direction 1 --> 0: + - Source IP address range: 2001:2::1 + - Destination IP address range: 2001:1::0 - 2001:1::F:423F +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"2001:1::1" + self.p1_dst_start_ip = u"2001:2::0" + self.p1_dst_end_ip = u"2001:2::F:423F" + + self.p2_src_start_ip = u"2001:2::1" + self.p2_dst_start_ip = u"2001:1::0" + self.p2_dst_end_ip = u"2001:1::F:423F" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IPv6 | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + base_p1, count_p1 = self._get_start_end_ipv6( + self.p1_dst_start_ip, + self.p1_dst_end_ip + ) + base_p2, count_p2 = self._get_start_end_ipv6( + self.p2_dst_start_ip, + self.p2_dst_end_ip + ) + + # Direction 0 --> 1 + base_pkt_a = ( + Ether() / + IPv6( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether() / + IPv6( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"ipv6_dst", + min_value=base_p1, + max_value=base_p1 + count_p1, + size=8, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ipv6_dst", + pkt_offset=u"IPv6.dst", + offset_fixup=8 + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"ipv6_dst", + min_value=base_p2, + max_value=base_p2 + count_p2, + size=8, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ipv6_dst", + pkt_offset=u"IPv6.dst", + offset_fixup=8 + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-3n-ethip6-ip6src253.py b/GPL/traffic_profiles/trex/trex-stl-3n-ethip6-ip6src253.py new file mode 100644 index 0000000000..fbe8b94ab3 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-3n-ethip6-ip6src253.py @@ -0,0 +1,129 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IPv6 / + - Direction 0 --> 1: + - Source IP address range: 2001:1::2 - 2001:1::FE + - Destination IP address range: 2001:2::2 + - Direction 1 --> 0: + - Source IP address range: 2001:2::2 - 2001:2::FE + - Destination IP address range: 2001:1::2 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"2001:1::2" + self.p1_src_end_ip = u"2001:1::FE" + self.p1_dst_start_ip = u"2001:2::2" + + self.p2_src_start_ip = u"2001:2::2" + self.p2_src_end_ip = u"2001:2::FE" + self.p2_dst_start_ip = u"2001:1::2" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IPv6 | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + base_p1, count_p1 = self._get_start_end_ipv6( + self.p1_src_start_ip, + self.p1_src_end_ip + ) + base_p2, count_p2 = self._get_start_end_ipv6( + self.p2_src_start_ip, + self.p2_src_end_ip + ) + + # Direction 0 --> 1 + base_pkt_a = ( + Ether() / + IPv6( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether() / + IPv6( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"ipv6_src", + min_value=base_p1, + max_value=base_p1 + count_p1, + size=8, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ipv6_src", + pkt_offset=u"IPv6.src", + offset_fixup=8 + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"ipv6_src", + min_value=base_p2, + max_value=base_p2 + count_p2, + size=8, + op=u"inc" + ), + STLVmWrFlowVar( + fv_name=u"ipv6_src", + pkt_offset=u"IPv6.src", + offset_fixup=8 + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-dot1qip4-vlan1ip4src254ip4dst254-bvi.py b/GPL/traffic_profiles/trex/trex-stl-dot1qip4-vlan1ip4src254ip4dst254-bvi.py new file mode 100644 index 0000000000..28ec10bf8b --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-dot1qip4-vlan1ip4src254ip4dst254-bvi.py @@ -0,0 +1,170 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / DOT1Q / IP / + - Direction 0 --> 1: + - Destination MAC address: ba:dc:00:ff:ee:01 + - VLAN range: 100 + - Source IP address range: 10.10.10.1 - 10.10.10.254 + - Destination IP address range: 20.20.20.1 - 20.20.20.254 + - Direction 1 --> 0: + - Destination MAC address: ba:dc:00:ff:ee:01 + - VLAN range: 200 + - Source IP address range: 20.20.20.1 - 20.20.20.254 + - Destination IP address range: 10.10.10.1 - 10.10.10.254 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # VLAN IDs + self.p1_vlan_start = 100 + self.p2_vlan_start = 200 + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.10.10.1" + self.p1_src_end_ip = u"10.10.10.254" + + self.p1_dst_start_ip = u"20.20.20.1" + self.p1_dst_end_ip = u"20.20.20.254" + + self.p2_src_start_ip = u"20.20.20.1" + self.p2_src_end_ip = u"20.20.20.254" + + self.p2_dst_start_ip = u"10.10.10.1" + self.p2_dst_end_ip = u"10.10.10.254" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | DOT1Q | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether( + dst=u"ba:dc:00:ff:ee:01" + ) / + Dot1Q( + vlan=self.p1_vlan_start + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether( + dst=u"ba:dc:00:ff:ee:01" + ) / + Dot1Q( + vlan=self.p2_vlan_start + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"ip_src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op=u"random" + ), + STLVmWrFlowVar( + fv_name=u"ip_src", + pkt_offset=u"IP.src" + ), + STLVmFlowVar( + name=u"ip_dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"random" + ), + STLVmWrFlowVar( + fv_name=u"ip_dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"ip_src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op=u"random" + ), + STLVmWrFlowVar( + fv_name=u"ip_src", + pkt_offset=u"IP.src" + ), + STLVmFlowVar( + name=u"ip_dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"random" + ), + STLVmWrFlowVar( + fv_name=u"ip_dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :returns: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-dot1qip4-vlan1ip4src254ip4dst254.py b/GPL/traffic_profiles/trex/trex-stl-dot1qip4-vlan1ip4src254ip4dst254.py new file mode 100644 index 0000000000..6ce351968c --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-dot1qip4-vlan1ip4src254ip4dst254.py @@ -0,0 +1,164 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / DOT1Q / IP / + - Direction 0 --> 1: + - VLAN range: 100 + - Source IP address range: 10.10.10.1 - 10.10.10.254 + - Destination IP address range: 20.20.20.1 - 20.20.20.254 + - Direction 1 --> 0: + - VLAN range: 200 + - Source IP address range: 20.20.20.1 - 20.20.20.254 + - Destination IP address range: 10.10.10.1 - 10.10.10.254 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # VLAN IDs + self.p1_vlan_start = 100 + self.p2_vlan_start = 200 + + # IPs used in packet headers. + self.p1_src_start_ip = u"10.10.10.1" + self.p1_src_end_ip = u"10.10.10.254" + + self.p1_dst_start_ip = u"20.20.20.1" + self.p1_dst_end_ip = u"20.20.20.254" + + self.p2_src_start_ip = u"20.20.20.1" + self.p2_src_end_ip = u"20.20.20.254" + + self.p2_dst_start_ip = u"10.10.10.1" + self.p2_dst_end_ip = u"10.10.10.254" + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | DOT1Q | IP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether() / + Dot1Q( + vlan=self.p1_vlan_start + ) / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=61 + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether() / + Dot1Q( + vlan=self.p2_vlan_start + ) / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"ip_src", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op=u"random" + ), + STLVmWrFlowVar( + fv_name=u"ip_src", + pkt_offset=u"IP.src" + ), + STLVmFlowVar( + name=u"ip_dst", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op=u"random" + ), + STLVmWrFlowVar( + fv_name=u"ip_dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"ip_src", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op=u"random" + ), + STLVmWrFlowVar( + fv_name=u"ip_src", + pkt_offset=u"IP.src" + ), + STLVmFlowVar( + name=u"ip_dst", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op=u"random" + ), + STLVmWrFlowVar( + fv_name=u"ip_dst", + pkt_offset=u"IP.dst" + ), + STLVmFixIpv4( + offset=u"IP" + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :returns: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src10udpsrcrnd.py b/GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src10udpsrcrnd.py new file mode 100644 index 0000000000..32ca072154 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src10udpsrcrnd.py @@ -0,0 +1,287 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / DOT1Q / IP / VXLAN / ETH / IP + - Direction 0 --> 1: + - VLAN range: 100 + - Source IP address: 172.17.[0..9].2 + - Destination IP address: 172.16.0.1 + - Source UDP port: random([1024..65535]) + - Destination UDP port: 4789 + - VXLAN VNI: [0..9] + - Payload source MAC address: 00:aa:aa:00:00:[00..ff] + - Payload source IP address: 10.0.[0..255].2 + - Payload destination MAC address: 00:bb:bb:00:00:[00..ff] + - Payload destination IP address: 10.0.[0..255].1 + - Direction 1 --> 0: + - VLAN range: 200 + - Source IP address: 172.27.[0..9].2 + - Destination IP address: 172.26.0.1 + - Source UDP port: random([1024..65535]) + - Destination UDP port: 4789 + - VXLAN VNI: [0..9] + - Payload source MAC address: 00:bb:bb:00:00:[00..ff] + - Payload source IP address: 10.0.[0..255].1 + - Payload destination MAC address: 00:aa:aa:00:00:[00..ff] + - Payload destination IP address: 10.0.[0..255].2 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + +# RFC 7348 - Virtual eXtensible Local Area Network (VXLAN): +# A Framework for Overlaying Virtualized Layer 2 Networks over Layer 3 Networks +# http://tools.ietf.org/html/rfc7348 +_VXLAN_FLAGS = list(u"R"*24 + u"RRRIRRRRR") + + +class VXLAN(Packet): + name=u"VXLAN" + fields_desc = [ + FlagsField(u"flags", 0x08000000, 32, _VXLAN_FLAGS), + ThreeBytesField(u"vni", 0), + XByteField(u"reserved", 0x00) + ] + + def mysummary(self): + return self.sprintf(u"VXLAN (vni=%VXLAN.vni%)") + + +bind_layers(UDP, VXLAN, dport=4789) +bind_layers(VXLAN, Ether) + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.nf_chains = 10 + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | DOT1Q | IP | VXLAN | ETH | IP + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether()/ + Dot1Q( + vlan=100 + ) / + IP( + src=u"172.17.0.2", + dst=u"172.16.0.1" + )/ + UDP( + sport=1024, + dport=4789 + )/ + VXLAN( + vni=0 + )/ + Ether( + src=u"00:aa:aa:00:00:00", + dst=u"00:bb:bb:00:00:00" + )/ + IP( + src=u"10.0.0.2", + dst=u"10.0.0.1", + proto=61 + ) + ) + + # Direction 1 --> 0 + base_pkt_b = ( + Ether()/ + Dot1Q( + vlan=200 + ) / + IP( + src=u"172.27.0.2", + dst=u"172.26.0.1" + )/ + UDP( + sport=1024, + dport=4789 + )/ + VXLAN( + vni=0 + )/ + Ether( + src=u"00:bb:bb:00:00:00", + dst=u"00:aa:aa:00:00:00" + )/ + IP( + src=u"10.0.0.1", + dst=u"10.0.0.2", + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"nf_id", + size=1, + op=u"inc", + min_value=0, + max_value=self.nf_chains - 1 + ), + STLVmFlowVar( + name=u"in_mac", + size=2, + op=u"inc", + min_value=0, + max_value=255 + ), + STLVmFlowVar( + name=u"in_ip", + size=1, + op=u"inc", + min_value=0, + max_value=255 + ), + STLVmFlowVar( + name=u"src_port", + size=2, + op=u"random", + min_value=1024, + max_value=65535 + ), + STLVmWrFlowVar( + fv_name=u"nf_id", + pkt_offset=32 + ), + STLVmWrFlowVar( + fv_name=u"src_port", + pkt_offset=u"UDP.sport" + ), + STLVmWrFlowVar( + fv_name=u"nf_id", + pkt_offset=52 + ), + STLVmWrFlowVar( + fv_name=u"in_mac", + pkt_offset=58 + ), + STLVmWrFlowVar( + fv_name=u"in_mac", + pkt_offset=64 + ), + STLVmWrFlowVar( + fv_name=u"in_ip", + pkt_offset=82 + ), + STLVmWrFlowVar( + fv_name=u"in_ip", + pkt_offset=86 + ), + STLVmFixChecksumHw( + l3_offset="IP:{}".format(0), + l4_offset="UDP:{}".format(0), + l4_type=CTRexVmInsFixHwCs.L4_TYPE_UDP + ) + ] + ) + + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"nf_id", + size=1, + op=u"inc", + min_value=0, + max_value=self.nf_chains - 1 + ), + STLVmFlowVar( + name=u"in_mac", + size=2, op=u"inc", + min_value=0, + max_value=255 + ), + STLVmFlowVar( + name=u"in_ip", + size=1, + op=u"inc", + min_value=0, + max_value=255 + ), + STLVmFlowVar( + name=u"src_port", + size=2, + op=u"random", + min_value=1024, + max_value=65535 + ), + STLVmWrFlowVar( + fv_name=u"nf_id", + pkt_offset=32 + ), + STLVmWrFlowVar( + fv_name=u"src_port", + pkt_offset=u"UDP.sport" + ), + STLVmWrFlowVar( + fv_name=u"nf_id", + pkt_offset=52 + ), + STLVmWrFlowVar( + fv_name=u"in_mac", + pkt_offset=58 + ), + STLVmWrFlowVar( + fv_name=u"in_mac", + pkt_offset=64 + ), + STLVmWrFlowVar( + fv_name=u"in_ip", + pkt_offset=82 + ), + STLVmWrFlowVar( + fv_name=u"in_ip", + pkt_offset=86 + ), + STLVmFixChecksumHw( + l3_offset="IP:{}".format(0), + l4_offset="UDP:{}".format(0), + l4_type=CTRexVmInsFixHwCs.L4_TYPE_UDP + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() + diff --git a/GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src1udpsrcrnd.py b/GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src1udpsrcrnd.py new file mode 100644 index 0000000000..1e78cd3cae --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src1udpsrcrnd.py @@ -0,0 +1,288 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / DOT1Q / IP / VXLAN / ETH / IP + - Direction 0 --> 1: + - VLAN range: 100 + - Source IP address: 172.17.0.2 + - Destination IP address: 172.16.0.1 + - Source UDP port: random([1024..65535]) + - Destination UDP port: 4789 + - VXLAN VNI: 0 + - Payload source MAC address: 00:aa:aa:00:00:[00..ff] + - Payload source IP address: 10.0.[0..255].2 + - Payload destination MAC address: 00:bb:bb:00:00:[00..ff] + - Payload destination IP address: 10.0.[0..255].1 + - Direction 1 --> 0: + - VLAN range: 200 + - Source IP address: 172.27.0.2 + - Destination IP address: 172.26.0.1 + - Source UDP port: random([1024..65535]) + - Destination UDP port: 4789 + - VXLAN VNI: 0 + - Payload source MAC address: 00:bb:bb:00:00:[00..ff] + - Payload source IP address: 10.0.[0..255].1 + - Payload destination MAC address: 00:aa:aa:00:00:[00..ff] + - Payload destination IP address: 10.0.[0..255].2 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + +# RFC 7348 - Virtual eXtensible Local Area Network (VXLAN): +# A Framework for Overlaying Virtualized Layer 2 Networks over Layer 3 Networks. +# http://tools.ietf.org/html/rfc7348 +_VXLAN_FLAGS = list(u"R"*24 + u"RRRIRRRRR") + + +class VXLAN(Packet): + name=u"VXLAN" + fields_desc = [ + FlagsField(u"flags", 0x08000000, 32, _VXLAN_FLAGS), + ThreeBytesField(u"vni", 0), + XByteField(u"reserved", 0x00) + ] + + def mysummary(self): + return self.sprintf(u"VXLAN (vni=%VXLAN.vni%)") + + +bind_layers(UDP, VXLAN, dport=4789) +bind_layers(VXLAN, Ether) + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.nf_chains = 1 + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | DOT1Q | IP | VXLAN | ETH | IP + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether()/ + Dot1Q( + vlan=100 + ) / + IP( + src=u"172.17.0.2", + dst=u"172.16.0.1" + )/ + UDP( + sport=1024, + dport=4789 + )/ + VXLAN( + vni=0 + )/ + Ether( + src=u"00:aa:aa:00:00:00", + dst=u"00:bb:bb:00:00:00" + )/ + IP( + src=u"10.0.0.2", + dst=u"10.0.0.1", + proto=61 + ) + ) + + # Direction 1 --> 0 + base_pkt_b = ( + Ether()/ + Dot1Q( + vlan=200 + ) / + IP( + src=u"172.27.0.2", + dst=u"172.26.0.1" + )/ + UDP( + sport=1024, + dport=4789 + )/ + VXLAN( + vni=0 + )/ + Ether( + src=u"00:bb:bb:00:00:00", + dst=u"00:aa:aa:00:00:00" + )/ + IP( + src=u"10.0.0.1", + dst=u"10.0.0.2", + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"nf_id", + size=1, + op=u"inc", + min_value=0, + max_value=self.nf_chains - 1 + ), + STLVmFlowVar( + name=u"in_mac", + size=2, + op=u"inc", + min_value=0, + max_value=255 + ), + STLVmFlowVar( + name=u"in_ip", + size=1, + op=u"inc", + min_value=0, + max_value=255 + ), + STLVmFlowVar( + name=u"src_port", + size=2, + op=u"random", + min_value=1024, + max_value=65535 + ), + STLVmWrFlowVar( + fv_name=u"nf_id", + pkt_offset=32 + ), + STLVmWrFlowVar( + fv_name=u"src_port", + pkt_offset=u"UDP.sport" + ), + STLVmWrFlowVar( + fv_name=u"nf_id", + pkt_offset=52 + ), + STLVmWrFlowVar( + fv_name=u"in_mac", + pkt_offset=58 + ), + STLVmWrFlowVar( + fv_name=u"in_mac", + pkt_offset=64 + ), + STLVmWrFlowVar( + fv_name=u"in_ip", + pkt_offset=82 + ), + STLVmWrFlowVar( + fv_name=u"in_ip", + pkt_offset=86 + ), + STLVmFixChecksumHw( + l3_offset="IP:{}".format(0), + l4_offset="UDP:{}".format(0), + l4_type=CTRexVmInsFixHwCs.L4_TYPE_UDP + ) + ] + ) + + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"nf_id", + size=1, + op=u"inc", + min_value=0, + max_value=self.nf_chains - 1 + ), + STLVmFlowVar( + name=u"in_mac", + size=2, + op=u"inc", + min_value=0, + max_value=255 + ), + STLVmFlowVar( + name=u"in_ip", + size=1, + op=u"inc", + min_value=0, + max_value=255 + ), + STLVmFlowVar( + name=u"src_port", + size=2, + op=u"random", + min_value=1024, + max_value=65535 + ), + STLVmWrFlowVar( + fv_name=u"nf_id", + pkt_offset=32 + ), + STLVmWrFlowVar( + fv_name=u"src_port", + pkt_offset=u"UDP.sport" + ), + STLVmWrFlowVar( + fv_name=u"nf_id", + pkt_offset=52 + ), + STLVmWrFlowVar( + fv_name=u"in_mac", + pkt_offset=58 + ), + STLVmWrFlowVar( + fv_name=u"in_mac", + pkt_offset=64 + ), + STLVmWrFlowVar( + fv_name=u"in_ip", + pkt_offset=82 + ), + STLVmWrFlowVar( + fv_name=u"in_ip", + pkt_offset=86 + ), + STLVmFixChecksumHw( + l3_offset="IP:{}".format(0), + l4_offset="UDP:{}".format(0), + l4_type=CTRexVmInsFixHwCs.L4_TYPE_UDP + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() + diff --git a/GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src2udpsrcrnd.py b/GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src2udpsrcrnd.py new file mode 100644 index 0000000000..d195bc5b61 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src2udpsrcrnd.py @@ -0,0 +1,288 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / DOT1Q / IP / VXLAN / ETH / IP + - Direction 0 --> 1: + - VLAN range: 100 + - Source IP address: 172.17.[0..1].2 + - Destination IP address: 172.16.0.1 + - Source UDP port: random([1024..65535]) + - Destination UDP port: 4789 + - VXLAN VNI: [0..1] + - Payload source MAC address: 00:aa:aa:00:00:[00..ff] + - Payload source IP address: 10.0.[0..255].2 + - Payload destination MAC address: 00:bb:bb:00:00:[00..ff] + - Payload destination IP address: 10.0.[0..255].1 + - Direction 1 --> 0: + - VLAN range: 200 + - Source IP address: 172.27.[0..1].2 + - Destination IP address: 172.26.0.1 + - Source UDP port: random([1024..65535]) + - Destination UDP port: 4789 + - VXLAN VNI: [0..1] + - Payload source MAC address: 00:bb:bb:00:00:[00..ff] + - Payload source IP address: 10.0.[0..255].1 + - Payload destination MAC address: 00:aa:aa:00:00:[00..ff] + - Payload destination IP address: 10.0.[0..255].2 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + +# RFC 7348 - Virtual eXtensible Local Area Network (VXLAN): +# A Framework for Overlaying Virtualized Layer 2 Networks over Layer 3 Networks +# http://tools.ietf.org/html/rfc7348 +_VXLAN_FLAGS = list(u"R"*24 + u"RRRIRRRRR") + + +class VXLAN(Packet): + name=u"VXLAN" + fields_desc = [ + FlagsField(u"flags", 0x08000000, 32, _VXLAN_FLAGS), + ThreeBytesField(u"vni", 0), + XByteField(u"reserved", 0x00) + ] + + def mysummary(self): + return self.sprintf(u"VXLAN (vni=%VXLAN.vni%)") + + +bind_layers(UDP, VXLAN, dport=4789) +bind_layers(VXLAN, Ether) + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.nf_chains = 2 + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | DOT1Q | IP | VXLAN | ETH | IP + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether()/ + Dot1Q( + vlan=100 + ) / + IP( + src=u"172.17.0.2", + dst=u"172.16.0.1" + )/ + UDP( + sport=1024, + dport=4789 + )/ + VXLAN( + vni=0 + )/ + Ether( + src=u"00:aa:aa:00:00:00", + dst=u"00:bb:bb:00:00:00" + )/ + IP( + src=u"10.0.0.2", + dst=u"10.0.0.1", + proto=61 + ) + ) + + # Direction 1 --> 0 + base_pkt_b = ( + Ether()/ + Dot1Q( + vlan=200 + ) / + IP( + src=u"172.27.0.2", + dst=u"172.26.0.1" + )/ + UDP( + sport=1024, + dport=4789 + )/ + VXLAN( + vni=0 + )/ + Ether( + src=u"00:bb:bb:00:00:00", + dst=u"00:aa:aa:00:00:00" + )/ + IP( + src=u"10.0.0.1", + dst=u"10.0.0.2", + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"nf_id", + size=1, + op=u"inc", + min_value=0, + max_value=self.nf_chains - 1 + ), + STLVmFlowVar( + name=u"in_mac", + size=2, + op=u"inc", + min_value=0, + max_value=255 + ), + STLVmFlowVar( + name=u"in_ip", + size=1, + op=u"inc", + min_value=0, + max_value=255 + ), + STLVmFlowVar( + name=u"src_port", + size=2, + op=u"random", + min_value=1024, + max_value=65535 + ), + STLVmWrFlowVar( + fv_name=u"nf_id", + pkt_offset=32 + ), + STLVmWrFlowVar( + fv_name=u"src_port", + pkt_offset=u"UDP.sport" + ), + STLVmWrFlowVar( + fv_name=u"nf_id", + pkt_offset=52 + ), + STLVmWrFlowVar( + fv_name=u"in_mac", + pkt_offset=58 + ), + STLVmWrFlowVar( + fv_name=u"in_mac", + pkt_offset=64 + ), + STLVmWrFlowVar( + fv_name=u"in_ip", + pkt_offset=82 + ), + STLVmWrFlowVar( + fv_name=u"in_ip", + pkt_offset=86 + ), + STLVmFixChecksumHw( + l3_offset="IP:{}".format(0), + l4_offset="UDP:{}".format(0), + l4_type=CTRexVmInsFixHwCs.L4_TYPE_UDP + ) + ] + ) + + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"nf_id", + size=1, + op=u"inc", + min_value=0, + max_value=self.nf_chains - 1 + ), + STLVmFlowVar( + name=u"in_mac", + size=2, + op=u"inc", + min_value=0, + max_value=255 + ), + STLVmFlowVar( + name=u"in_ip", + size=1, + op=u"inc", + min_value=0, + max_value=255 + ), + STLVmFlowVar( + name=u"src_port", + size=2, + op=u"random", + min_value=1024, + max_value=65535 + ), + STLVmWrFlowVar( + fv_name=u"nf_id", + pkt_offset=32 + ), + STLVmWrFlowVar( + fv_name=u"src_port", + pkt_offset=u"UDP.sport" + ), + STLVmWrFlowVar( + fv_name=u"nf_id", + pkt_offset=52 + ), + STLVmWrFlowVar( + fv_name=u"in_mac", + pkt_offset=58 + ), + STLVmWrFlowVar( + fv_name=u"in_mac", + pkt_offset=64 + ), + STLVmWrFlowVar( + fv_name=u"in_ip", + pkt_offset=82 + ), + STLVmWrFlowVar( + fv_name=u"in_ip", + pkt_offset=86 + ), + STLVmFixChecksumHw( + l3_offset="IP:{}".format(0), + l4_offset="UDP:{}".format(0), + l4_type=CTRexVmInsFixHwCs.L4_TYPE_UDP + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() + diff --git a/GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src4udpsrcrnd.py b/GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src4udpsrcrnd.py new file mode 100644 index 0000000000..8a7bc08b1b --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src4udpsrcrnd.py @@ -0,0 +1,288 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / DOT1Q / IP / VXLAN / ETH / IP + - Direction 0 --> 1: + - VLAN range: 100 + - Source IP address: 172.17.[0..3].2 + - Destination IP address: 172.16.0.1 + - Source UDP port: random([1024..65535]) + - Destination UDP port: 4789 + - VXLAN VNI: [0..3] + - Payload source MAC address: 00:aa:aa:00:00:[00..ff] + - Payload source IP address: 10.0.[0..255].2 + - Payload destination MAC address: 00:bb:bb:00:00:[00..ff] + - Payload destination IP address: 10.0.[0..255].1 + - Direction 1 --> 0: + - VLAN range: 200 + - Source IP address: 172.27.[0..3].2 + - Destination IP address: 172.26.0.1 + - Source UDP port: random([1024..65535]) + - Destination UDP port: 4789 + - VXLAN VNI: [0..3] + - Payload source MAC address: 00:bb:bb:00:00:[00..ff] + - Payload source IP address: 10.0.[0..255].1 + - Payload destination MAC address: 00:aa:aa:00:00:[00..ff] + - Payload destination IP address: 10.0.[0..255].2 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + +# RFC 7348 - Virtual eXtensible Local Area Network (VXLAN): +# A Framework for Overlaying Virtualized Layer 2 Networks over Layer 3 Networks +# http://tools.ietf.org/html/rfc7348 +_VXLAN_FLAGS = list(u"R"*24 + u"RRRIRRRRR") + + +class VXLAN(Packet): + name=u"VXLAN" + fields_desc = [ + FlagsField(u"flags", 0x08000000, 32, _VXLAN_FLAGS), + ThreeBytesField(u"vni", 0), + XByteField(u"reserved", 0x00) + ] + + def mysummary(self): + return self.sprintf(u"VXLAN (vni=%VXLAN.vni%)") + + +bind_layers(UDP, VXLAN, dport=4789) +bind_layers(VXLAN, Ether) + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.nf_chains = 4 + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | DOT1Q | IP | VXLAN | ETH | IP + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether()/ + Dot1Q( + vlan=100 + )/ + IP( + src=u"172.17.0.2", + dst=u"172.16.0.1" + )/ + UDP( + sport=1024, + dport=4789 + )/ + VXLAN( + vni=0 + )/ + Ether( + src=u"00:aa:aa:00:00:00", + dst=u"00:bb:bb:00:00:00" + )/ + IP( + src=u"10.0.0.2", + dst=u"10.0.0.1", + proto=61 + ) + ) + + # Direction 1 --> 0 + base_pkt_b = ( + Ether()/ + Dot1Q( + vlan=200 + ) / + IP( + src=u"172.27.0.2", + dst=u"172.26.0.1" + )/ + UDP( + sport=1024, + dport=4789 + )/ + VXLAN( + vni=0 + )/ + Ether( + src=u"00:bb:bb:00:00:00", + dst=u"00:aa:aa:00:00:00" + )/ + IP( + src=u"10.0.0.1", + dst=u"10.0.0.2", + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"nf_id", + size=1, + op=u"inc", + min_value=0, + max_value=self.nf_chains - 1 + ), + STLVmFlowVar( + name=u"in_mac", + size=2, + op=u"inc", + min_value=0, + max_value=255 + ), + STLVmFlowVar( + name=u"in_ip", + size=1, + op=u"inc", + min_value=0, + max_value=255 + ), + STLVmFlowVar( + name=u"src_port", + size=2, + op=u"random", + min_value=1024, + max_value=65535 + ), + STLVmWrFlowVar( + fv_name=u"nf_id", + pkt_offset=32 + ), + STLVmWrFlowVar( + fv_name=u"src_port", + pkt_offset=u"UDP.sport" + ), + STLVmWrFlowVar( + fv_name=u"nf_id", + pkt_offset=52 + ), + STLVmWrFlowVar( + fv_name=u"in_mac", + pkt_offset=58 + ), + STLVmWrFlowVar( + fv_name=u"in_mac", + pkt_offset=64 + ), + STLVmWrFlowVar( + fv_name=u"in_ip", + pkt_offset=82 + ), + STLVmWrFlowVar( + fv_name=u"in_ip", + pkt_offset=86 + ), + STLVmFixChecksumHw( + l3_offset="IP:{}".format(0), + l4_offset="UDP:{}".format(0), + l4_type=CTRexVmInsFixHwCs.L4_TYPE_UDP + ) + ] + ) + + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"nf_id", + size=1, + op=u"inc", + min_value=0, + max_value=self.nf_chains - 1 + ), + STLVmFlowVar( + name=u"in_mac", + size=2, + op=u"inc", + min_value=0, + max_value=255 + ), + STLVmFlowVar( + name=u"in_ip", + size=1, + op=u"inc", + min_value=0, + max_value=255 + ), + STLVmFlowVar( + name=u"src_port", + size=2, + op=u"random", + min_value=1024, + max_value=65535 + ), + STLVmWrFlowVar( + fv_name=u"nf_id", + pkt_offset=32 + ), + STLVmWrFlowVar( + fv_name=u"src_port", + pkt_offset=u"UDP.sport" + ), + STLVmWrFlowVar( + fv_name=u"nf_id", + pkt_offset=52 + ), + STLVmWrFlowVar( + fv_name=u"in_mac", + pkt_offset=58 + ), + STLVmWrFlowVar( + fv_name=u"in_mac", + pkt_offset=64 + ), + STLVmWrFlowVar( + fv_name=u"in_ip", + pkt_offset=82 + ), + STLVmWrFlowVar( + fv_name=u"in_ip", + pkt_offset=86 + ), + STLVmFixChecksumHw( + l3_offset="IP:{}".format(0), + l4_offset="UDP:{}".format(0), + l4_type=CTRexVmInsFixHwCs.L4_TYPE_UDP + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() + diff --git a/GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src6udpsrcrnd.py b/GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src6udpsrcrnd.py new file mode 100644 index 0000000000..fe46844571 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src6udpsrcrnd.py @@ -0,0 +1,288 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / DOT1Q / IP / VXLAN / ETH / IP + - Direction 0 --> 1: + - VLAN range: 100 + - Source IP address: 172.17.[0..5].2 + - Destination IP address: 172.16.0.1 + - Source UDP port: random([1024..65535]) + - Destination UDP port: 4789 + - VXLAN VNI: [0..5] + - Payload source MAC address: 00:aa:aa:00:00:[00..ff] + - Payload source IP address: 10.0.[0..255].2 + - Payload destination MAC address: 00:bb:bb:00:00:[00..ff] + - Payload destination IP address: 10.0.[0..255].1 + - Direction 1 --> 0: + - VLAN range: 200 + - Source IP address: 172.27.[0..5].2 + - Destination IP address: 172.26.0.1 + - Source UDP port: random([1024..65535]) + - Destination UDP port: 4789 + - VXLAN VNI: [0..5] + - Payload source MAC address: 00:bb:bb:00:00:[00..ff] + - Payload source IP address: 10.0.[0..255].1 + - Payload destination MAC address: 00:aa:aa:00:00:[00..ff] + - Payload destination IP address: 10.0.[0..255].2 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + +# RFC 7348 - Virtual eXtensible Local Area Network (VXLAN): +# A Framework for Overlaying Virtualized Layer 2 Networks over Layer 3 Networks +# http://tools.ietf.org/html/rfc7348 +_VXLAN_FLAGS = list(u"R"*24 + u"RRRIRRRRR") + + +class VXLAN(Packet): + name=u"VXLAN" + fields_desc = [ + FlagsField(u"flags", 0x08000000, 32, _VXLAN_FLAGS), + ThreeBytesField(u"vni", 0), + XByteField(u"reserved", 0x00) + ] + + def mysummary(self): + return self.sprintf(u"VXLAN (vni=%VXLAN.vni%)") + + +bind_layers(UDP, VXLAN, dport=4789) +bind_layers(VXLAN, Ether) + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.nf_chains = 6 + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | DOT1Q | IP | VXLAN | ETH | IP + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether()/ + Dot1Q( + vlan=100 + ) / + IP( + src=u"172.17.0.2", + dst=u"172.16.0.1" + )/ + UDP( + sport=1024, + dport=4789 + )/ + VXLAN( + vni=0 + )/ + Ether( + src=u"00:aa:aa:00:00:00", + dst=u"00:bb:bb:00:00:00" + )/ + IP( + src=u"10.0.0.2", + dst=u"10.0.0.1", + proto=61 + ) + ) + + # Direction 1 --> 0 + base_pkt_b = ( + Ether()/ + Dot1Q( + vlan=200 + ) / + IP( + src=u"172.27.0.2", + dst=u"172.26.0.1" + )/ + UDP( + sport=1024, + dport=4789 + )/ + VXLAN( + vni=0 + )/ + Ether( + src=u"00:bb:bb:00:00:00", + dst=u"00:aa:aa:00:00:00" + )/ + IP( + src=u"10.0.0.1", + dst=u"10.0.0.2", + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"nf_id", + size=1, + op=u"inc", + min_value=0, + max_value=self.nf_chains - 1 + ), + STLVmFlowVar( + name=u"in_mac", + size=2, + op=u"inc", + min_value=0, + max_value=255 + ), + STLVmFlowVar( + name=u"in_ip", + size=1, + op=u"inc", + min_value=0, + max_value=255 + ), + STLVmFlowVar( + name=u"src_port", + size=2, + op=u"random", + min_value=1024, + max_value=65535 + ), + STLVmWrFlowVar( + fv_name=u"nf_id", + pkt_offset=32 + ), + STLVmWrFlowVar( + fv_name=u"src_port", + pkt_offset=u"UDP.sport" + ), + STLVmWrFlowVar( + fv_name=u"nf_id", + pkt_offset=52 + ), + STLVmWrFlowVar( + fv_name=u"in_mac", + pkt_offset=58 + ), + STLVmWrFlowVar( + fv_name=u"in_mac", + pkt_offset=64 + ), + STLVmWrFlowVar( + fv_name=u"in_ip", + pkt_offset=82 + ), + STLVmWrFlowVar( + fv_name=u"in_ip", + pkt_offset=86 + ), + STLVmFixChecksumHw( + l3_offset="IP:{}".format(0), + l4_offset="UDP:{}".format(0), + l4_type=CTRexVmInsFixHwCs.L4_TYPE_UDP + ) + ] + ) + + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"nf_id", + size=1, + op=u"inc", + min_value=0, + max_value=self.nf_chains - 1 + ), + STLVmFlowVar( + name=u"in_mac", + size=2, + op=u"inc", + min_value=0, + max_value=255 + ), + STLVmFlowVar( + name=u"in_ip", + size=1, + op=u"inc", + min_value=0, + max_value=255 + ), + STLVmFlowVar( + name=u"src_port", + size=2, + op=u"random", + min_value=1024, + max_value=65535 + ), + STLVmWrFlowVar( + fv_name=u"nf_id", + pkt_offset=32 + ), + STLVmWrFlowVar( + fv_name=u"src_port", + pkt_offset=u"UDP.sport" + ), + STLVmWrFlowVar( + fv_name=u"nf_id", + pkt_offset=52 + ), + STLVmWrFlowVar( + fv_name=u"in_mac", + pkt_offset=58 + ), + STLVmWrFlowVar( + fv_name=u"in_mac", + pkt_offset=64 + ), + STLVmWrFlowVar( + fv_name=u"in_ip", + pkt_offset=82 + ), + STLVmWrFlowVar( + fv_name=u"in_ip", + pkt_offset=86 + ), + STLVmFixChecksumHw( + l3_offset="IP:{}".format(0), + l4_offset="UDP:{}".format(0), + l4_type=CTRexVmInsFixHwCs.L4_TYPE_UDP + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() + diff --git a/GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src8udpsrcrnd.py b/GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src8udpsrcrnd.py new file mode 100644 index 0000000000..cf34818781 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-dot1qip4vxlan-ip4src8udpsrcrnd.py @@ -0,0 +1,288 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / DOT1Q / IP / VXLAN / ETH / IP + - Direction 0 --> 1: + - VLAN range: 100 + - Source IP address: 172.17.[0..7].2 + - Destination IP address: 172.16.0.1 + - Source UDP port: random([1024..65535]) + - Destination UDP port: 4789 + - VXLAN VNI: [0..7] + - Payload source MAC address: 00:aa:aa:00:00:[00..ff] + - Payload source IP address: 10.0.[0..255].2 + - Payload destination MAC address: 00:bb:bb:00:00:[00..ff] + - Payload destination IP address: 10.0.[0..255].1 + - Direction 1 --> 0: + - VLAN range: 200 + - Source IP address: 172.27.[0..7].2 + - Destination IP address: 172.26.0.1 + - Source UDP port: random([1024..65535]) + - Destination UDP port: 4789 + - VXLAN VNI: [0..7] + - Payload source MAC address: 00:bb:bb:00:00:[00..ff] + - Payload source IP address: 10.0.[0..255].1 + - Payload destination MAC address: 00:aa:aa:00:00:[00..ff] + - Payload destination IP address: 10.0.[0..255].2 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + +# RFC 7348 - Virtual eXtensible Local Area Network (VXLAN): +# A Framework for Overlaying Virtualized Layer 2 Networks over Layer 3 Networks +# http://tools.ietf.org/html/rfc7348 +_VXLAN_FLAGS = list(u"R"*24 + u"RRRIRRRRR") + + +class VXLAN(Packet): + name=u"VXLAN" + fields_desc = [ + FlagsField(u"flags", 0x08000000, 32, _VXLAN_FLAGS), + ThreeBytesField(u"vni", 0), + XByteField(u"reserved", 0x00) + ] + + def mysummary(self): + return self.sprintf(u"VXLAN (vni=%VXLAN.vni%)") + + +bind_layers(UDP, VXLAN, dport=4789) +bind_layers(VXLAN, Ether) + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.nf_chains = 8 + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | DOT1Q | IP | VXLAN | ETH | IP + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether()/ + Dot1Q( + vlan=100 + ) / + IP( + src=u"172.17.0.2", + dst=u"172.16.0.1" + )/ + UDP( + sport=1024, + dport=4789 + )/ + VXLAN( + vni=0 + )/ + Ether( + src=u"00:aa:aa:00:00:00", + dst=u"00:bb:bb:00:00:00" + )/ + IP( + src=u"10.0.0.2", + dst=u"10.0.0.1", + proto=61 + ) + ) + + # Direction 1 --> 0 + base_pkt_b = ( + Ether()/ + Dot1Q( + vlan=200 + ) / + IP( + src=u"172.27.0.2", + dst=u"172.26.0.1" + )/ + UDP( + sport=1024, + dport=4789 + )/ + VXLAN( + vni=0 + )/ + Ether( + src=u"00:bb:bb:00:00:00", + dst=u"00:aa:aa:00:00:00" + )/ + IP( + src=u"10.0.0.1", + dst=u"10.0.0.2", + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"nf_id", + size=1, + op=u"inc", + min_value=0, + max_value=self.nf_chains - 1 + ), + STLVmFlowVar( + name=u"in_mac", + size=2, + op=u"inc", + min_value=0, + max_value=255 + ), + STLVmFlowVar( + name=u"in_ip", + size=1, + op=u"inc", + min_value=0, + max_value=255 + ), + STLVmFlowVar( + name=u"src_port", + size=2, + op=u"random", + min_value=1024, + max_value=65535 + ), + STLVmWrFlowVar( + fv_name=u"nf_id", + pkt_offset=32 + ), + STLVmWrFlowVar( + fv_name=u"src_port", + pkt_offset=u"UDP.sport" + ), + STLVmWrFlowVar( + fv_name=u"nf_id", + pkt_offset=52 + ), + STLVmWrFlowVar( + fv_name=u"in_mac", + pkt_offset=58 + ), + STLVmWrFlowVar( + fv_name=u"in_mac", + pkt_offset=64 + ), + STLVmWrFlowVar( + fv_name=u"in_ip", + pkt_offset=82 + ), + STLVmWrFlowVar( + fv_name=u"in_ip", + pkt_offset=86 + ), + STLVmFixChecksumHw( + l3_offset="IP:{}".format(0), + l4_offset="UDP:{}".format(0), + l4_type=CTRexVmInsFixHwCs.L4_TYPE_UDP + ) + ] + ) + + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"nf_id", + size=1, + op=u"inc", + min_value=0, + max_value=self.nf_chains - 1 + ), + STLVmFlowVar( + name=u"in_mac", + size=2, + op=u"inc", + min_value=0, + max_value=255 + ), + STLVmFlowVar( + name=u"in_ip", + size=1, + op=u"inc", + min_value=0, + max_value=255 + ), + STLVmFlowVar( + name=u"src_port", + size=2, + op=u"random", + min_value=1024, + max_value=65535 + ), + STLVmWrFlowVar( + fv_name=u"nf_id", + pkt_offset=32 + ), + STLVmWrFlowVar( + fv_name=u"src_port", + pkt_offset=u"UDP.sport" + ), + STLVmWrFlowVar( + fv_name=u"nf_id", + pkt_offset=52 + ), + STLVmWrFlowVar( + fv_name=u"in_mac", + pkt_offset=58 + ), + STLVmWrFlowVar( + fv_name=u"in_mac", + pkt_offset=64 + ), + STLVmWrFlowVar( + fv_name=u"in_ip", + pkt_offset=82 + ), + STLVmWrFlowVar( + fv_name=u"in_ip", + pkt_offset=86 + ), + STLVmFixChecksumHw( + l3_offset="IP:{}".format(0), + l4_offset="UDP:{}".format(0), + l4_type=CTRexVmInsFixHwCs.L4_TYPE_UDP + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() + diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip4udp-1024u63p.py b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-1024u63p.py new file mode 100644 index 0000000000..1b9f483b13 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-1024u63p.py @@ -0,0 +1,169 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / UDP + - Direction 0 --> 1: + - Source IP address range: 192.168.0.0 - 192.168.3.255 + - Destination IP address range: 20.0.0.0 + - Source UDP port range: 1024 - 1086 + - Destination UDP port range: 1024 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.0 + - Destination IP address range: 68.142.68.0 + - Source UDP port range: 1024 + - Destination UDP port range: 1024 - 65535 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"192.168.0.0" + self.p1_src_end_ip = u"192.168.3.255" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.0.0" + + self.p2_src_start_ip = u"20.0.0.0" + self.p2_src_end_ip = u"20.0.0.0" + self.p2_dst_start_ip = u"68.142.68.0" + self.p2_dst_end_ip = u"68.142.68.0" + + # UDP ports used in packet headers. + self.p1_src_start_udp_port = 1024 + self.p1_src_end_udp_port = 1086 + self.p1_dst_start_udp_port = 1024 + self.p1_dst_end_udp_port = 1024 + + self.p2_src_start_udp_port = 1024 + self.p2_src_end_udp_port = 1024 + self.p2_dst_start_udp_port = 1024 + self.p2_dst_end_udp_port = 65535 + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | UDP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether() / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=17 + ) / + UDP( + sport=self.p1_src_start_udp_port, + dport=self.p1_dst_start_udp_port + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether() / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=17 + ) / + UDP( + sport=self.p2_src_start_udp_port, + dport=self.p2_dst_start_udp_port + ) + ) + + # Direction 0 --> 1 + vm1 = STLVM() + vm1.var(name="sIP", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op="inc", + next_var="sport") + vm1.var(name="sport", + min_value=self.p1_src_start_udp_port, + max_value=self.p1_src_end_udp_port, + size=2, + op="inc") + vm1.var(name="dIP", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op="inc") + vm1.var(name="dport", + min_value=self.p1_dst_start_udp_port, + max_value=self.p1_dst_end_udp_port, + size=2, + op="inc") + vm1.write(fv_name="sIP", pkt_offset="IP.src") + vm1.write(fv_name="sport", pkt_offset="UDP.sport") + vm1.write(fv_name="dIP", pkt_offset="IP.dst") + vm1.write(fv_name="dport", pkt_offset="UDP.dport") + vm1.fix_chksum(offset='IP') + # Direction 0 --> 1 + vm2 = STLVM() + vm2.var(name="sIP", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op="inc", + next_var="sport") + vm2.var(name="sport", + min_value=self.p2_src_start_udp_port, + max_value=self.p2_src_end_udp_port, + size=2, + op="inc") + vm2.var(name="dIP", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op="inc", + next_var="dport") + vm2.var(name="dport", + min_value=self.p2_dst_start_udp_port, + max_value=self.p2_dst_end_udp_port, + size=2, + op="inc") + vm2.write(fv_name="sIP", pkt_offset="IP.src") + vm2.write(fv_name="sport", pkt_offset="UDP.sport") + vm2.write(fv_name="dIP", pkt_offset="IP.dst") + vm2.write(fv_name="dport", pkt_offset="UDP.dport") + vm2.fix_chksum(offset='IP') + + return base_pkt_a, base_pkt_b, vm1, vm2 + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip4udp-1048576u63p.py b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-1048576u63p.py new file mode 100644 index 0000000000..5fbd3a3a4f --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-1048576u63p.py @@ -0,0 +1,169 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / UDP + - Direction 0 --> 1: + - Source IP address range: 172.16.0.0 - 172.31.255.255 + - Destination IP address range: 20.0.0.0 + - Source UDP port range: 1024 - 1086 + - Destination UDP port range: 1024 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.0 + - Destination IP address range: 68.142.68.0 - 68.142.71.255 + - Source UDP port range: 1024 + - Destination UDP port range: 1024 - 65535 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"172.16.0.0" + self.p1_src_end_ip = u"172.31.255.255" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.0.0" + + self.p2_src_start_ip = u"20.0.0.0" + self.p2_src_end_ip = u"20.0.0.0" + self.p2_dst_start_ip = u"68.142.68.0" + self.p2_dst_end_ip = u"68.142.71.255" + + # UDP ports used in packet headers. + self.p1_src_start_udp_port = 1024 + self.p1_src_end_udp_port = 1086 + self.p1_dst_start_udp_port = 1024 + self.p1_dst_end_udp_port = 1024 + + self.p2_src_start_udp_port = 1024 + self.p2_src_end_udp_port = 1024 + self.p2_dst_start_udp_port = 1024 + self.p2_dst_end_udp_port = 65535 + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | UDP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether() / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=17 + ) / + UDP( + sport=self.p1_src_start_udp_port, + dport=self.p1_dst_start_udp_port + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether() / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=17 + ) / + UDP( + sport=self.p2_src_start_udp_port, + dport=self.p2_dst_start_udp_port + ) + ) + + # Direction 0 --> 1 + vm1 = STLVM() + vm1.var(name="sIP", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op="inc", + next_var="sport") + vm1.var(name="sport", + min_value=self.p1_src_start_udp_port, + max_value=self.p1_src_end_udp_port, + size=2, + op="inc") + vm1.var(name="dIP", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op="inc") + vm1.var(name="dport", + min_value=self.p1_dst_start_udp_port, + max_value=self.p1_dst_end_udp_port, + size=2, + op="inc") + vm1.write(fv_name="sIP", pkt_offset="IP.src") + vm1.write(fv_name="sport", pkt_offset="UDP.sport") + vm1.write(fv_name="dIP", pkt_offset="IP.dst") + vm1.write(fv_name="dport", pkt_offset="UDP.dport") + vm1.fix_chksum(offset='IP') + # Direction 0 --> 1 + vm2 = STLVM() + vm2.var(name="sIP", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op="inc", + next_var="sport") + vm2.var(name="sport", + min_value=self.p2_src_start_udp_port, + max_value=self.p2_src_end_udp_port, + size=2, + op="inc") + vm2.var(name="dIP", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op="inc", + next_var="dport") + vm2.var(name="dport", + min_value=self.p2_dst_start_udp_port, + max_value=self.p2_dst_end_udp_port, + size=2, + op="inc") + vm2.write(fv_name="sIP", pkt_offset="IP.src") + vm2.write(fv_name="sport", pkt_offset="UDP.sport") + vm2.write(fv_name="dIP", pkt_offset="IP.dst") + vm2.write(fv_name="dport", pkt_offset="UDP.dport") + vm2.fix_chksum(offset='IP') + + return base_pkt_a, base_pkt_b, vm1, vm2 + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip4udp-16384u63p.py b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-16384u63p.py new file mode 100644 index 0000000000..4a8e1a0b8d --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-16384u63p.py @@ -0,0 +1,169 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / UDP + - Direction 0 --> 1: + - Source IP address range: 192.168.0.0 - 192.168.63.255 + - Destination IP address range: 20.0.0.0 + - Source UDP port range: 1024 - 1086 + - Destination UDP port range: 1024 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.0 + - Destination IP address range: 68.142.68.0 - 68.142.68.15 + - Source UDP port range: 1024 + - Destination UDP port range: 1024 - 65535 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"192.168.0.0" + self.p1_src_end_ip = u"192.168.63.255" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.0.0" + + self.p2_src_start_ip = u"20.0.0.0" + self.p2_src_end_ip = u"20.0.0.0" + self.p2_dst_start_ip = u"68.142.68.0" + self.p2_dst_end_ip = u"68.142.68.15" + + # UDP ports used in packet headers. + self.p1_src_start_udp_port = 1024 + self.p1_src_end_udp_port = 1086 + self.p1_dst_start_udp_port = 1024 + self.p1_dst_end_udp_port = 1024 + + self.p2_src_start_udp_port = 1024 + self.p2_src_end_udp_port = 1024 + self.p2_dst_start_udp_port = 1024 + self.p2_dst_end_udp_port = 65535 + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | UDP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether() / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=17 + ) / + UDP( + sport=self.p1_src_start_udp_port, + dport=self.p1_dst_start_udp_port + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether() / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=17 + ) / + UDP( + sport=self.p2_src_start_udp_port, + dport=self.p2_dst_start_udp_port + ) + ) + + # Direction 0 --> 1 + vm1 = STLVM() + vm1.var(name="sIP", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op="inc", + next_var="sport") + vm1.var(name="sport", + min_value=self.p1_src_start_udp_port, + max_value=self.p1_src_end_udp_port, + size=2, + op="inc") + vm1.var(name="dIP", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op="inc") + vm1.var(name="dport", + min_value=self.p1_dst_start_udp_port, + max_value=self.p1_dst_end_udp_port, + size=2, + op="inc") + vm1.write(fv_name="sIP", pkt_offset="IP.src") + vm1.write(fv_name="sport", pkt_offset="UDP.sport") + vm1.write(fv_name="dIP", pkt_offset="IP.dst") + vm1.write(fv_name="dport", pkt_offset="UDP.dport") + vm1.fix_chksum(offset='IP') + # Direction 0 --> 1 + vm2 = STLVM() + vm2.var(name="sIP", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op="inc", + next_var="sport") + vm2.var(name="sport", + min_value=self.p2_src_start_udp_port, + max_value=self.p2_src_end_udp_port, + size=2, + op="inc") + vm2.var(name="dIP", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op="inc", + next_var="dport") + vm2.var(name="dport", + min_value=self.p2_dst_start_udp_port, + max_value=self.p2_dst_end_udp_port, + size=2, + op="inc") + vm2.write(fv_name="sIP", pkt_offset="IP.src") + vm2.write(fv_name="sport", pkt_offset="UDP.sport") + vm2.write(fv_name="dIP", pkt_offset="IP.dst") + vm2.write(fv_name="dport", pkt_offset="UDP.dport") + vm2.fix_chksum(offset='IP') + + return base_pkt_a, base_pkt_b, vm1, vm2 + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip4udp-1u63p.py b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-1u63p.py new file mode 100644 index 0000000000..ed28e915ca --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-1u63p.py @@ -0,0 +1,169 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / UDP + - Direction 0 --> 1: + - Source IP address range: 192.168.0.0 + - Destination IP address range: 20.0.0.0 + - Source UDP port range: 1024 - 1086 + - Destination UDP port range: 1024 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.0 + - Destination IP address range: 68.142.68.0 + - Source UDP port range: 1024 + - Destination UDP port range: 1024 - 16017 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"192.168.0.0" + self.p1_src_end_ip = u"192.168.0.0" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.0.0" + + self.p2_src_start_ip = u"20.0.0.0" + self.p2_src_end_ip = u"20.0.0.0" + self.p2_dst_start_ip = u"68.142.68.0" + self.p2_dst_end_ip = u"68.142.68.0" + + # UDP ports used in packet headers. + self.p1_src_start_udp_port = 1024 + self.p1_src_end_udp_port = 1086 + self.p1_dst_start_udp_port = 1024 + self.p1_dst_end_udp_port = 1024 + + self.p2_src_start_udp_port = 1024 + self.p2_src_end_udp_port = 1024 + self.p2_dst_start_udp_port = 1024 + self.p2_dst_end_udp_port = 16017 + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | UDP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether() / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=17 + ) / + UDP( + sport=self.p1_src_start_udp_port, + dport=self.p1_dst_start_udp_port + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether() / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=17 + ) / + UDP( + sport=self.p2_src_start_udp_port, + dport=self.p2_dst_start_udp_port + ) + ) + + # Direction 0 --> 1 + vm1 = STLVM() + vm1.var(name="sIP", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op="inc", + next_var="sport") + vm1.var(name="sport", + min_value=self.p1_src_start_udp_port, + max_value=self.p1_src_end_udp_port, + size=2, + op="inc") + vm1.var(name="dIP", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op="inc") + vm1.var(name="dport", + min_value=self.p1_dst_start_udp_port, + max_value=self.p1_dst_end_udp_port, + size=2, + op="inc") + vm1.write(fv_name="sIP", pkt_offset="IP.src") + vm1.write(fv_name="sport", pkt_offset="UDP.sport") + vm1.write(fv_name="dIP", pkt_offset="IP.dst") + vm1.write(fv_name="dport", pkt_offset="UDP.dport") + vm1.fix_chksum(offset='IP') + # Direction 0 --> 1 + vm2 = STLVM() + vm2.var(name="sIP", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op="inc", + next_var="sport") + vm2.var(name="sport", + min_value=self.p2_src_start_udp_port, + max_value=self.p2_src_end_udp_port, + size=2, + op="inc") + vm2.var(name="dIP", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op="inc", + next_var="dport") + vm2.var(name="dport", + min_value=self.p2_dst_start_udp_port, + max_value=self.p2_dst_end_udp_port, + size=2, + op="inc") + vm2.write(fv_name="sIP", pkt_offset="IP.src") + vm2.write(fv_name="sport", pkt_offset="UDP.sport") + vm2.write(fv_name="dIP", pkt_offset="IP.dst") + vm2.write(fv_name="dport", pkt_offset="UDP.dport") + vm2.fix_chksum(offset='IP') + + return base_pkt_a, base_pkt_b, vm1, vm2 + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip4udp-238u63p.py b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-238u63p.py new file mode 100644 index 0000000000..f6b2276351 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-238u63p.py @@ -0,0 +1,169 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / UDP + - Direction 0 --> 1: + - Source IP address range: 192.168.0.0 - 192.168.0.237 + - Destination IP address range: 20.0.0.0 + - Source UDP port range: 1024 - 1086 + - Destination UDP port range: 1024 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.0 + - Destination IP address range: 68.142.68.0 + - Source UDP port range: 1024 + - Destination UDP port range: 1024 - 16017 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"192.168.0.0" + self.p1_src_end_ip = u"192.168.0.237" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.0.0" + + self.p2_src_start_ip = u"20.0.0.0" + self.p2_src_end_ip = u"20.0.0.0" + self.p2_dst_start_ip = u"68.142.68.0" + self.p2_dst_end_ip = u"68.142.68.0" + + # UDP ports used in packet headers. + self.p1_src_start_udp_port = 1024 + self.p1_src_end_udp_port = 1086 + self.p1_dst_start_udp_port = 1024 + self.p1_dst_end_udp_port = 1024 + + self.p2_src_start_udp_port = 1024 + self.p2_src_end_udp_port = 1024 + self.p2_dst_start_udp_port = 1024 + self.p2_dst_end_udp_port = 16017 + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | UDP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether() / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=17 + ) / + UDP( + sport=self.p1_src_start_udp_port, + dport=self.p1_dst_start_udp_port + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether() / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=17 + ) / + UDP( + sport=self.p2_src_start_udp_port, + dport=self.p2_dst_start_udp_port + ) + ) + + # Direction 0 --> 1 + vm1 = STLVM() + vm1.var(name="sIP", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op="inc", + next_var="sport") + vm1.var(name="sport", + min_value=self.p1_src_start_udp_port, + max_value=self.p1_src_end_udp_port, + size=2, + op="inc") + vm1.var(name="dIP", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op="inc") + vm1.var(name="dport", + min_value=self.p1_dst_start_udp_port, + max_value=self.p1_dst_end_udp_port, + size=2, + op="inc") + vm1.write(fv_name="sIP", pkt_offset="IP.src") + vm1.write(fv_name="sport", pkt_offset="UDP.sport") + vm1.write(fv_name="dIP", pkt_offset="IP.dst") + vm1.write(fv_name="dport", pkt_offset="UDP.dport") + vm1.fix_chksum(offset='IP') + # Direction 0 --> 1 + vm2 = STLVM() + vm2.var(name="sIP", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op="inc", + next_var="sport") + vm2.var(name="sport", + min_value=self.p2_src_start_udp_port, + max_value=self.p2_src_end_udp_port, + size=2, + op="inc") + vm2.var(name="dIP", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op="inc", + next_var="dport") + vm2.var(name="dport", + min_value=self.p2_dst_start_udp_port, + max_value=self.p2_dst_end_udp_port, + size=2, + op="inc") + vm2.write(fv_name="sIP", pkt_offset="IP.src") + vm2.write(fv_name="sport", pkt_offset="UDP.sport") + vm2.write(fv_name="dIP", pkt_offset="IP.dst") + vm2.write(fv_name="dport", pkt_offset="UDP.dport") + vm2.fix_chksum(offset='IP') + + return base_pkt_a, base_pkt_b, vm1, vm2 + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip4udp-262144u63p.py b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-262144u63p.py new file mode 100644 index 0000000000..9cd7443b07 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-262144u63p.py @@ -0,0 +1,169 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / UDP + - Direction 0 --> 1: + - Source IP address range: 172.16.0.0 - 172.19.255.255 + - Destination IP address range: 20.0.0.0 + - Source UDP port range: 1024 - 1086 + - Destination UDP port range: 1024 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.0 + - Destination IP address range: 68.142.68.0 - 68.142.68.255 + - Source UDP port range: 1024 + - Destination UDP port range: 1024 - 65535 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"172.16.0.0" + self.p1_src_end_ip = u"172.19.255.255" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.0.0" + + self.p2_src_start_ip = u"20.0.0.0" + self.p2_src_end_ip = u"20.0.0.0" + self.p2_dst_start_ip = u"68.142.68.0" + self.p2_dst_end_ip = u"68.142.68.255" + + # UDP ports used in packet headers. + self.p1_src_start_udp_port = 1024 + self.p1_src_end_udp_port = 1086 + self.p1_dst_start_udp_port = 1024 + self.p1_dst_end_udp_port = 1024 + + self.p2_src_start_udp_port = 1024 + self.p2_src_end_udp_port = 1024 + self.p2_dst_start_udp_port = 1024 + self.p2_dst_end_udp_port = 65535 + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | UDP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether() / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=17 + ) / + UDP( + sport=self.p1_src_start_udp_port, + dport=self.p1_dst_start_udp_port + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether() / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=17 + ) / + UDP( + sport=self.p2_src_start_udp_port, + dport=self.p2_dst_start_udp_port + ) + ) + + # Direction 0 --> 1 + vm1 = STLVM() + vm1.var(name="sIP", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op="inc", + next_var="sport") + vm1.var(name="sport", + min_value=self.p1_src_start_udp_port, + max_value=self.p1_src_end_udp_port, + size=2, + op="inc") + vm1.var(name="dIP", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op="inc") + vm1.var(name="dport", + min_value=self.p1_dst_start_udp_port, + max_value=self.p1_dst_end_udp_port, + size=2, + op="inc") + vm1.write(fv_name="sIP", pkt_offset="IP.src") + vm1.write(fv_name="sport", pkt_offset="UDP.sport") + vm1.write(fv_name="dIP", pkt_offset="IP.dst") + vm1.write(fv_name="dport", pkt_offset="UDP.dport") + vm1.fix_chksum(offset='IP') + # Direction 0 --> 1 + vm2 = STLVM() + vm2.var(name="sIP", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op="inc", + next_var="sport") + vm2.var(name="sport", + min_value=self.p2_src_start_udp_port, + max_value=self.p2_src_end_udp_port, + size=2, + op="inc") + vm2.var(name="dIP", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op="inc", + next_var="dport") + vm2.var(name="dport", + min_value=self.p2_dst_start_udp_port, + max_value=self.p2_dst_end_udp_port, + size=2, + op="inc") + vm2.write(fv_name="sIP", pkt_offset="IP.src") + vm2.write(fv_name="sport", pkt_offset="UDP.sport") + vm2.write(fv_name="dIP", pkt_offset="IP.dst") + vm2.write(fv_name="dport", pkt_offset="UDP.dport") + vm2.fix_chksum(offset='IP') + + return base_pkt_a, base_pkt_b, vm1, vm2 + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip4udp-4096u63p.py b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-4096u63p.py new file mode 100644 index 0000000000..a180c65902 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-4096u63p.py @@ -0,0 +1,169 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / UDP + - Direction 0 --> 1: + - Source IP address range: 192.168.0.0 - 192.168.15.255 + - Destination IP address range: 20.0.0.0 + - Source UDP port range: 1024 - 1086 + - Destination UDP port range: 1024 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.0 + - Destination IP address range: 68.142.68.0 - 68.142.68.3 + - Source UDP port range: 1024 + - Destination UDP port range: 1024 - 65535 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"192.168.0.0" + self.p1_src_end_ip = u"192.168.15.255" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.0.0" + + self.p2_src_start_ip = u"20.0.0.0" + self.p2_src_end_ip = u"20.0.0.0" + self.p2_dst_start_ip = u"68.142.68.0" + self.p2_dst_end_ip = u"68.142.68.3" + + # UDP ports used in packet headers. + self.p1_src_start_udp_port = 1024 + self.p1_src_end_udp_port = 1086 + self.p1_dst_start_udp_port = 1024 + self.p1_dst_end_udp_port = 1024 + + self.p2_src_start_udp_port = 1024 + self.p2_src_end_udp_port = 1024 + self.p2_dst_start_udp_port = 1024 + self.p2_dst_end_udp_port = 65535 + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | UDP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether() / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=17 + ) / + UDP( + sport=self.p1_src_start_udp_port, + dport=self.p1_dst_start_udp_port + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether() / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=17 + ) / + UDP( + sport=self.p2_src_start_udp_port, + dport=self.p2_dst_start_udp_port + ) + ) + + # Direction 0 --> 1 + vm1 = STLVM() + vm1.var(name="sIP", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op="inc", + next_var="sport") + vm1.var(name="sport", + min_value=self.p1_src_start_udp_port, + max_value=self.p1_src_end_udp_port, + size=2, + op="inc") + vm1.var(name="dIP", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op="inc") + vm1.var(name="dport", + min_value=self.p1_dst_start_udp_port, + max_value=self.p1_dst_end_udp_port, + size=2, + op="inc") + vm1.write(fv_name="sIP", pkt_offset="IP.src") + vm1.write(fv_name="sport", pkt_offset="UDP.sport") + vm1.write(fv_name="dIP", pkt_offset="IP.dst") + vm1.write(fv_name="dport", pkt_offset="UDP.dport") + vm1.fix_chksum(offset='IP') + # Direction 0 --> 1 + vm2 = STLVM() + vm2.var(name="sIP", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op="inc", + next_var="sport") + vm2.var(name="sport", + min_value=self.p2_src_start_udp_port, + max_value=self.p2_src_end_udp_port, + size=2, + op="inc") + vm2.var(name="dIP", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op="inc", + next_var="dport") + vm2.var(name="dport", + min_value=self.p2_dst_start_udp_port, + max_value=self.p2_dst_end_udp_port, + size=2, + op="inc") + vm2.write(fv_name="sIP", pkt_offset="IP.src") + vm2.write(fv_name="sport", pkt_offset="UDP.sport") + vm2.write(fv_name="dIP", pkt_offset="IP.dst") + vm2.write(fv_name="dport", pkt_offset="UDP.dport") + vm2.fix_chksum(offset='IP') + + return base_pkt_a, base_pkt_b, vm1, vm2 + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip4udp-65536u63p.py b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-65536u63p.py new file mode 100644 index 0000000000..562b9ee314 --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4udp-65536u63p.py @@ -0,0 +1,169 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / UDP + - Direction 0 --> 1: + - Source IP address range: 192.168.0.0 - 192.168.255.255 + - Destination IP address range: 20.0.0.0 + - Source UDP port range: 1024 - 1086 + - Destination UDP port range: 1024 + - Direction 1 --> 0: + - Source IP address range: 20.0.0.0 + - Destination IP address range: 68.142.68.0 - 68.142.68.63 + - Source UDP port range: 1024 + - Destination UDP port range: 1024 - 65535 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + # IPs used in packet headers. + self.p1_src_start_ip = u"192.168.0.0" + self.p1_src_end_ip = u"192.168.255.255" + self.p1_dst_start_ip = u"20.0.0.0" + self.p1_dst_end_ip = u"20.0.0.0" + + self.p2_src_start_ip = u"20.0.0.0" + self.p2_src_end_ip = u"20.0.0.0" + self.p2_dst_start_ip = u"68.142.68.0" + self.p2_dst_end_ip = u"68.142.68.63" + + # UDP ports used in packet headers. + self.p1_src_start_udp_port = 1024 + self.p1_src_end_udp_port = 1086 + self.p1_dst_start_udp_port = 1024 + self.p1_dst_end_udp_port = 1024 + + self.p2_src_start_udp_port = 1024 + self.p2_src_end_udp_port = 1024 + self.p2_dst_start_udp_port = 1024 + self.p2_dst_end_udp_port = 65535 + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | UDP | + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether() / + IP( + src=self.p1_src_start_ip, + dst=self.p1_dst_start_ip, + proto=17 + ) / + UDP( + sport=self.p1_src_start_udp_port, + dport=self.p1_dst_start_udp_port + ) + ) + # Direction 1 --> 0 + base_pkt_b = ( + Ether() / + IP( + src=self.p2_src_start_ip, + dst=self.p2_dst_start_ip, + proto=17 + ) / + UDP( + sport=self.p2_src_start_udp_port, + dport=self.p2_dst_start_udp_port + ) + ) + + # Direction 0 --> 1 + vm1 = STLVM() + vm1.var(name="sIP", + min_value=self.p1_src_start_ip, + max_value=self.p1_src_end_ip, + size=4, + op="inc", + next_var="sport") + vm1.var(name="sport", + min_value=self.p1_src_start_udp_port, + max_value=self.p1_src_end_udp_port, + size=2, + op="inc") + vm1.var(name="dIP", + min_value=self.p1_dst_start_ip, + max_value=self.p1_dst_end_ip, + size=4, + op="inc") + vm1.var(name="dport", + min_value=self.p1_dst_start_udp_port, + max_value=self.p1_dst_end_udp_port, + size=2, + op="inc") + vm1.write(fv_name="sIP", pkt_offset="IP.src") + vm1.write(fv_name="sport", pkt_offset="UDP.sport") + vm1.write(fv_name="dIP", pkt_offset="IP.dst") + vm1.write(fv_name="dport", pkt_offset="UDP.dport") + vm1.fix_chksum(offset='IP') + # Direction 0 --> 1 + vm2 = STLVM() + vm2.var(name="sIP", + min_value=self.p2_src_start_ip, + max_value=self.p2_src_end_ip, + size=4, + op="inc", + next_var="sport") + vm2.var(name="sport", + min_value=self.p2_src_start_udp_port, + max_value=self.p2_src_end_udp_port, + size=2, + op="inc") + vm2.var(name="dIP", + min_value=self.p2_dst_start_ip, + max_value=self.p2_dst_end_ip, + size=4, + op="inc", + next_var="dport") + vm2.var(name="dport", + min_value=self.p2_dst_start_udp_port, + max_value=self.p2_dst_end_udp_port, + size=2, + op="inc") + vm2.write(fv_name="sIP", pkt_offset="IP.src") + vm2.write(fv_name="sport", pkt_offset="UDP.sport") + vm2.write(fv_name="dIP", pkt_offset="IP.dst") + vm2.write(fv_name="dport", pkt_offset="UDP.dport") + vm2.fix_chksum(offset='IP') + + return base_pkt_a, base_pkt_b, vm1, vm2 + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() diff --git a/GPL/traffic_profiles/trex/trex-stl-ethip4vxlan-ip4src1udpsrcrnd.py b/GPL/traffic_profiles/trex/trex-stl-ethip4vxlan-ip4src1udpsrcrnd.py new file mode 100644 index 0000000000..cd1a0a690c --- /dev/null +++ b/GPL/traffic_profiles/trex/trex-stl-ethip4vxlan-ip4src1udpsrcrnd.py @@ -0,0 +1,261 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Stream profile for T-rex traffic generator. + +Stream profile: + - Two streams sent in directions 0 --> 1 and 1 --> 0 at the same time. + - Packet: ETH / IP / VXLAN / ETH / IP + - Direction 0 --> 1: + - Source IP address: 172.17.0.2 + - Destination IP address: 172.16.0.1 + - Source UDP port: random([1024-65535]) + - Destination UDP port: 4789 + - VXLAN VNI: 0 + - Payload source MAC address: 00:aa:aa:00:00:[00..ff] + - Payload source IP address: 10.0.0.2 + - Payload destination MAC address: 00:bb:bb:00:00:[00..ff] + - Payload destination IP address: 10.0.0.1 + - Direction 1 --> 0: + - Source IP address: 172.27.0.2 + - Destination IP address: 172.26.0.1 + - Source UDP port: random([1024-65535]) + - Destination UDP port: 4789 + - VXLAN VNI: 0 + - Payload source MAC address: 00:bb:bb:00:00:[00..ff] + - Payload source IP address: 10.0.0.1 + - Payload destination MAC address: 00:aa:aa:00:00:[00..ff] + - Payload destination IP address: 10.0.0.2 +""" + +from trex.stl.api import * +from profile_trex_stateless_base_class import TrafficStreamsBaseClass + +# RFC 7348 - Virtual eXtensible Local Area Network (VXLAN): +# A Framework for Overlaying Virtualized Layer 2 Networks over Layer 3 Networks +# http://tools.ietf.org/html/rfc7348 +_VXLAN_FLAGS = list(u"R"*24 + u"RRRIRRRRR") + + +class VXLAN(Packet): + name=u"VXLAN" + fields_desc = [ + FlagsField(u"flags", 0x08000000, 32, _VXLAN_FLAGS), + ThreeBytesField(u"vni", 0), + XByteField(u"reserved", 0x00) + ] + + def mysummary(self): + return self.sprintf(u"VXLAN (vni=%VXLAN.vni%)") + + +bind_layers(UDP, VXLAN, dport=4789) +bind_layers(VXLAN, Ether) + + +class TrafficStreams(TrafficStreamsBaseClass): + """Stream profile.""" + + def __init__(self): + """Initialization and setting of streams' parameters.""" + + super(TrafficStreamsBaseClass, self).__init__() + + self.nf_chains = 1 + + def define_packets(self): + """Defines the packets to be sent from the traffic generator. + + Packet definition: | ETH | IP | VXLAN | ETH | IP + + :returns: Packets to be sent from the traffic generator. + :rtype: tuple + """ + + # Direction 0 --> 1 + base_pkt_a = ( + Ether()/ + IP( + src=u"172.17.0.2", + dst=u"172.16.0.1" + )/ + UDP( + sport=1024, + dport=4789)/ + VXLAN( + vni=0 + )/ + Ether( + src=u"00:aa:aa:00:00:00", + dst=u"00:bb:bb:00:00:00" + )/ + IP( + src=u"10.0.0.2", + dst=u"10.0.0.1", + proto=61 + ) + ) + + # Direction 1 --> 0 + base_pkt_b = ( + Ether()/ + IP( + src=u"172.27.0.2", + dst=u"172.26.0.1" + )/ + UDP( + sport=1024, + dport=4789 + )/ + VXLAN( + vni=0 + )/ + Ether( + src=u"00:bb:bb:00:00:00", + dst=u"00:aa:aa:00:00:00" + )/ + IP( + src=u"10.0.0.1", + dst=u"10.0.0.2", + proto=61 + ) + ) + + # Direction 0 --> 1 + vm1 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"nf_id", + size=1, + op=u"inc", + min_value=0, + max_value=self.nf_chains - 1 + ), + STLVmFlowVar( + name=u"in_mac", + size=2, + op=u"inc", + min_value=0, + max_value=255 + ), + STLVmFlowVar( + name=u"in_ip", + size=1, + op=u"inc", + min_value=0, + max_value=255 + ), + STLVmFlowVar( + name=u"src_port", + size=2, + op=u"random", + min_value=1024, + max_value=65535 + ), + STLVmWrFlowVar( + fv_name=u"nf_id", + pkt_offset=28 + ), + STLVmWrFlowVar( + fv_name=u"src_port", + pkt_offset=u"UDP.sport" + ), + STLVmWrFlowVar( + fv_name=u"nf_id", + pkt_offset=48 + ), + STLVmWrFlowVar( + fv_name=u"in_mac", + pkt_offset=54 + ), + STLVmWrFlowVar( + fv_name=u"in_mac", + pkt_offset=60 + ), + STLVmFixChecksumHw( + l3_offset="IP:{}".format(0), + l4_offset="UDP:{}".format(0), + l4_type=CTRexVmInsFixHwCs.L4_TYPE_UDP + ) + ] + ) + + # Direction 1 --> 0 + vm2 = STLScVmRaw( + [ + STLVmFlowVar( + name=u"nf_id", + size=1, + op=u"inc", + min_value=0, + max_value=self.nf_chains - 1 + ), + STLVmFlowVar( + name=u"in_mac", + size=2, op=u"inc", + min_value=0, + max_value=255 + ), + STLVmFlowVar( + name=u"in_ip", + size=1, op=u"inc", + min_value=0, + max_value=255 + ), + STLVmFlowVar( + name=u"src_port", + size=2, + op=u"random", + min_value=1024, + max_value=65535 + ), + STLVmWrFlowVar( + fv_name=u"nf_id", + pkt_offset=28 + ), + STLVmWrFlowVar( + fv_name=u"src_port", + pkt_offset=u"UDP.sport" + ), + STLVmWrFlowVar( + fv_name=u"nf_id", + pkt_offset=48 + ), + STLVmWrFlowVar( + fv_name=u"in_mac", + pkt_offset=54 + ), + STLVmWrFlowVar( + fv_name=u"in_mac", + pkt_offset=60 + ), + STLVmFixChecksumHw( + l3_offset="IP:{}".format(0), + l4_offset="UDP:{}".format(0), + l4_type=CTRexVmInsFixHwCs.L4_TYPE_UDP + ) + ] + ) + + return base_pkt_a, base_pkt_b, vm1, vm2 + +def register(): + """Register this traffic profile to T-rex. + + Do not change this function. + + :return: Traffic streams. + :rtype: Object + """ + return TrafficStreams() + -- cgit 1.2.3-korg