summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorHanoh Haim <hhaim@cisco.com>2016-01-05 20:51:47 +0200
committerHanoh Haim <hhaim@cisco.com>2016-01-05 20:51:47 +0200
commit5f07d1062309eea31e47a6d9ab23bb1c94de5c83 (patch)
tree667326ce482b79d9626badb80d8562a9ecf7551b /scripts
parentc905d6b0845e79dbc5d5d37eee560d1dbc58b6ff (diff)
parentd6be4b0e8a2cd92b5e6c455532431897f76331fe (diff)
Merge branch 'random_pkt'
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/automation/trex_control_plane/common/trex_streams.py13
-rw-r--r--scripts/cap2/imix_9k.yaml70
-rw-r--r--scripts/exp/stl_vm_inc_size_64_128-ex.pcapbin0 -> 3074 bytes
-rw-r--r--scripts/exp/stl_vm_rand_size_512B_64_128-ex.pcapbin0 -> 3954 bytes
-rw-r--r--scripts/exp/stl_vm_rand_size_64_128-ex.pcapbin0 -> 4215 bytes
-rw-r--r--scripts/exp/stl_vm_rand_size_64_128.pcap-ex.pcapbin0 -> 4215 bytes
-rw-r--r--scripts/stl/ipv4_udp_9000.pcapbin0 -> 9082 bytes
-rw-r--r--scripts/stl/ipv4_udp_9k.pcapbin0 -> 9270 bytes
-rw-r--r--scripts/stl/syn_attack_sample.yaml2
-rw-r--r--scripts/stl/syn_packet.pcapbin104 -> 100 bytes
-rw-r--r--scripts/stl/udp_rand_size.yaml42
-rw-r--r--scripts/stl/udp_rand_size_9k.yaml42
12 files changed, 160 insertions, 9 deletions
diff --git a/scripts/automation/trex_control_plane/common/trex_streams.py b/scripts/automation/trex_control_plane/common/trex_streams.py
index 86eee1f4..007e2464 100755
--- a/scripts/automation/trex_control_plane/common/trex_streams.py
+++ b/scripts/automation/trex_control_plane/common/trex_streams.py
@@ -271,15 +271,12 @@ class CStreamsDB(object):
stream_list = CStreamList()
loaded_obj = stream_list.load_yaml(filename)
- try:
- compiled_streams = stream_list.compile_streams()
- rc = self.load_streams(stream_pack_name,
- LoadedStreamList(loaded_obj,
- [StreamPack(v.stream_id, v.stream.dump())
- for k, v in compiled_streams.items()]))
+ compiled_streams = stream_list.compile_streams()
+ rc = self.load_streams(stream_pack_name,
+ LoadedStreamList(loaded_obj,
+ [StreamPack(v.stream_id, v.stream.dump())
+ for k, v in compiled_streams.items()]))
- except Exception as e:
- return None
return self.get_stream_pack(stream_pack_name)
diff --git a/scripts/cap2/imix_9k.yaml b/scripts/cap2/imix_9k.yaml
new file mode 100644
index 00000000..0f194e67
--- /dev/null
+++ b/scripts/cap2/imix_9k.yaml
@@ -0,0 +1,70 @@
+#
+# Simple IMIX test 64B
+#
+- duration : 3
+ generator :
+ distribution : "seq"
+ clients_start : "16.0.0.1"
+ clients_end : "16.0.0.255"
+ servers_start : "48.0.0.1"
+ servers_end : "48.0.255.255"
+ clients_per_gb : 201
+ min_clients : 101
+ dual_port_mask : "1.0.0.0"
+ tcp_aging : 0
+ udp_aging : 0
+ mac : [0x0,0x0,0x0,0x1,0x0,0x00]
+#
+# the templates are duplicated in purpose , to utilized all DRAM BW and get better performance, we should do it automaticly
+# but for now it like this , you should have at least 8
+#
+ cap_info :
+ - name: stl/ipv4_udp_9k.pcap
+ cps : 1000.0
+ ipg : 10000
+ rtt : 10000
+ w : 1
+ limit : 200
+ - name: stl/ipv4_udp_9k.pcap
+ cps : 1000.0
+ ipg : 10000
+ rtt : 10000
+ w : 1
+ limit : 200
+ - name: stl/ipv4_udp_9k.pcap
+ cps : 1000.0
+ ipg : 10000
+ rtt : 10000
+ w : 1
+ limit : 200
+ - name: stl/ipv4_udp_9k.pcap
+ cps : 1000.0
+ ipg : 10000
+ rtt : 10000
+ w : 1
+ limit : 200
+ - name: stl/ipv4_udp_9k.pcap
+ cps : 1000.0
+ ipg : 10000
+ rtt : 10000
+ w : 1
+ limit : 200
+ - name: stl/ipv4_udp_9k.pcap
+ cps : 1000.0
+ ipg : 10000
+ rtt : 10000
+ w : 1
+ limit : 200
+ - name: stl/ipv4_udp_9k.pcap
+ cps : 1000.0
+ ipg : 10000
+ rtt : 10000
+ w : 1
+ limit : 200
+ - name: stl/ipv4_udp_9k.pcap
+ cps : 1000.0
+ ipg : 10000
+ rtt : 10000
+ w : 1
+ limit : 200
+
diff --git a/scripts/exp/stl_vm_inc_size_64_128-ex.pcap b/scripts/exp/stl_vm_inc_size_64_128-ex.pcap
new file mode 100644
index 00000000..1e44c30f
--- /dev/null
+++ b/scripts/exp/stl_vm_inc_size_64_128-ex.pcap
Binary files differ
diff --git a/scripts/exp/stl_vm_rand_size_512B_64_128-ex.pcap b/scripts/exp/stl_vm_rand_size_512B_64_128-ex.pcap
new file mode 100644
index 00000000..324ffb1c
--- /dev/null
+++ b/scripts/exp/stl_vm_rand_size_512B_64_128-ex.pcap
Binary files differ
diff --git a/scripts/exp/stl_vm_rand_size_64_128-ex.pcap b/scripts/exp/stl_vm_rand_size_64_128-ex.pcap
new file mode 100644
index 00000000..b0b01def
--- /dev/null
+++ b/scripts/exp/stl_vm_rand_size_64_128-ex.pcap
Binary files differ
diff --git a/scripts/exp/stl_vm_rand_size_64_128.pcap-ex.pcap b/scripts/exp/stl_vm_rand_size_64_128.pcap-ex.pcap
new file mode 100644
index 00000000..b0b01def
--- /dev/null
+++ b/scripts/exp/stl_vm_rand_size_64_128.pcap-ex.pcap
Binary files differ
diff --git a/scripts/stl/ipv4_udp_9000.pcap b/scripts/stl/ipv4_udp_9000.pcap
new file mode 100644
index 00000000..86385997
--- /dev/null
+++ b/scripts/stl/ipv4_udp_9000.pcap
Binary files differ
diff --git a/scripts/stl/ipv4_udp_9k.pcap b/scripts/stl/ipv4_udp_9k.pcap
new file mode 100644
index 00000000..c5466f78
--- /dev/null
+++ b/scripts/stl/ipv4_udp_9k.pcap
Binary files differ
diff --git a/scripts/stl/syn_attack_sample.yaml b/scripts/stl/syn_attack_sample.yaml
index 298638f1..c5734e43 100644
--- a/scripts/stl/syn_attack_sample.yaml
+++ b/scripts/stl/syn_attack_sample.yaml
@@ -69,7 +69,7 @@
"name" : "ip_dst", # varible to write
"add_value" : 0x40000000, # 16.0.0.0 is src base
"is_big_endian" : true, # write as big edian
- "pkt_offset" : 32, # write tuple_gen.port into udp.src_port
+ "pkt_offset" : 30, # write tuple_gen.port into udp.src_port
},
{
diff --git a/scripts/stl/syn_packet.pcap b/scripts/stl/syn_packet.pcap
index 6740e911..93325547 100644
--- a/scripts/stl/syn_packet.pcap
+++ b/scripts/stl/syn_packet.pcap
Binary files differ
diff --git a/scripts/stl/udp_rand_size.yaml b/scripts/stl/udp_rand_size.yaml
new file mode 100644
index 00000000..2bbad4a0
--- /dev/null
+++ b/scripts/stl/udp_rand_size.yaml
@@ -0,0 +1,42 @@
+### UDP 1500 random pkt size ###
+#####################################
+- name: "random"
+ stream:
+ self_start: True
+ packet:
+ binary: stl/udp_1518B_no_crc.pcap
+ mode:
+ type: continuous
+ pps: 100
+ rx_stats: []
+
+ # random packet size 60-1500 update ip.len/checksum/udp.len
+ vm:
+ instructions:
+ - type : "flow_var" # define random varible 60-1500
+ name : "var_rand_pkt_size"
+ op : "random"
+ init_value : 0
+ min_value : 60
+ max_value : 1500 # range must be smaller than pkt size
+ size : 2
+
+ - type : "trim_pkt_size" # trim packet size
+ name : "var_rand_pkt_size"
+
+ - type : "write_flow_var" # update ip.len
+ name : "var_rand_pkt_size"
+ add_value : -14
+ is_big_endian: true
+ pkt_offset : 16
+
+ - type : "fix_checksum_ipv4" # update ip.checksum
+ pkt_offset : 14
+
+ - type : "write_flow_var" # update udp.len
+ name : "var_rand_pkt_size"
+ add_value : -34
+ is_big_endian : true
+ pkt_offset : 38
+
+
diff --git a/scripts/stl/udp_rand_size_9k.yaml b/scripts/stl/udp_rand_size_9k.yaml
new file mode 100644
index 00000000..ecdd7ae0
--- /dev/null
+++ b/scripts/stl/udp_rand_size_9k.yaml
@@ -0,0 +1,42 @@
+### UDP 9K+14(MAC) random pkt size ###
+#####################################
+- name: "random"
+ stream:
+ self_start: True
+ packet:
+ binary: stl/ipv4_udp_9k.pcap # should not include CRC 9K ip+14 = 9230 +FCS(by NIC)=9234
+ mode:
+ type: continuous
+ pps: 100
+ rx_stats: []
+
+ # random packet size 60-max packet size update ip.len/checksum/udp.len
+ vm:
+ instructions:
+ - type : "flow_var" # define random varible 60-9230
+ name : "var_rand_pkt_size"
+ op : "random"
+ init_value : 0
+ min_value : 60
+ max_value : 9230 # range must be smaller than pkt size
+ size : 2
+
+ - type : "trim_pkt_size" # trim packet size
+ name : "var_rand_pkt_size"
+
+ - type : "write_flow_var" # update ip.len
+ name : "var_rand_pkt_size"
+ add_value : -14
+ is_big_endian: true
+ pkt_offset : 16
+
+ - type : "fix_checksum_ipv4" # update ip.checksum
+ pkt_offset : 14
+
+ - type : "write_flow_var" # update udp.len
+ name : "var_rand_pkt_size"
+ add_value : -34
+ is_big_endian : true
+ pkt_offset : 38
+
+