All packet size in the *.test files have been replaces with imix sizes.
imix is now a list of packet sizes. If you want to run with only a
pakcet size of 64, you need to specify a list containing only 1 size:
[64].
You can also specify multiple imix values by specifying a list of list
of sizes. The keyworkds in the test files are now imix & imixs.
Change-Id: Iea47c0266b022133b7bbfc9a6811e3199ae41521
Signed-off-by: Luc Provoost <luc.provoost@intel.com>
[test1]
test=warmuptest
flowsize=512
-packetsize=64
+imix=[64]
warmupspeed=1
warmuptime=2
# all combinations must be meeting the same threshold
# The threshold is expressed in Mpps
pass_threshold=0.1
-packetsizes=[64,128]
+imixs=[[64],[128]]
# the number of flows in the list need to be powers of 2, max 2^20
# Select from following numbers: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576
flows=[8,1024]
[test1]
test=warmuptest
flowsize=512
-packetsize=64
+imix=[64]
warmupspeed=10
warmuptime=2
[test2]
test=flowsizetest
-packetsizes=[64,128]
+imixs=[[64],[128]]
# the number of flows in the list need to be powers of 2, max 2^20
# Select from following numbers: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576
flows=[512,1]
[test1]
test=warmuptest
flowsize=512
-packetsize=64
+imix=[64]
warmupspeed=1
warmuptime=2
# all combinations must be meeting the same threshold
# The threshold is expressed in Mpps
pass_threshold=0.1
-packetsizes=[64,128]
+imixs=[[64], [64,800],[128]]
# the number of flows in the list need to be powers of 2, max 2^30
# If not a power of 2, we will use the lowest power of 2 that is larger than
# the requested number of flows. e.g. 9 will result in 16 flows
stack_name = rapid
heat_template = openstack-rapid.yaml
heat_param = params_rapid.yaml
-keypair_name = prox_key
+keypair_name = rapid_key
user = centos
push_gateway = None
PROX_COMMIT="b71a4cfd"
PROX_CHECKOUT="git checkout ${PROX_COMMIT}"
## Next line is overruling the PROX_COMMIT and will replace the version with a very specific patch. Should be commented out
-## if you want to use a committed version of PROX
+## if you want to use a committed version of PROX with the COMMIT ID specified above
##PROX_CHECKOUT="git fetch \"https://gerrit.opnfv.org/gerrit/samplevnf\" refs/changes/75/69475/2 && git checkout FETCH_HEAD"
+##Following line has the commit for testing IMIX
+#PROX_CHECKOUT="git fetch \"https://gerrit.opnfv.org/gerrit/samplevnf\" refs/changes/88/69488/3 && git checkout FETCH_HEAD"
+##Following line has the commit for testing IMIX, IPV6, ... It is the merge of all PROX commits on May 12th
+PROX_CHECKOUT="git fetch \"https://gerrit.opnfv.org/gerrit/samplevnf\" refs/changes/59/69859/7 && git checkout FETCH_HEAD"
MULTI_BUFFER_LIB_VER="0.52"
export RTE_SDK="${BUILD_DIR}/dpdk-${DPDK_VERSION}"
export RTE_TARGET="x86_64-native-linuxapp-gcc"
# the testing. Once the script connects with ssh, it starts downloading
# config files and then start prox, etc... The problem is that when the VM
# boots, check_prox_system_setup.sh will check for some things and
- # potentially reboot, resulting in loosing the ssh connection again.
+ # potentially reboot, resulting in losing the ssh connection again.
# To fix this issue, the following lines are disabling ssh access for the
# centos user. The script will not be able to connect to the VM till ssh
# access is restored after a reboot. Restoring ssh is now done by
[test1]
test=warmuptest
flowsize=1024
-packetsize=64
+imix=[64]
warmupspeed=10
warmuptime=2
[test2]
test=impairtest
-packetsize=64
+imix=[64]
flowsize=64
drop_rate_threshold = 0.1
lat_avg_threshold = 500
# The threshold is expressed in Mpps
pass_threshold=0.1
startspeed = 10
-packetsizes=[256]
+imixs=[[256]]
flows=[64]
[test1]
test=warmuptest
flowsize=512
-packetsize=64
+imix=[64]
warmupspeed=1
warmuptime=2
[test2]
test=flowsizetest
-packetsizes=[64]
+imixs=[[64]]
# the number of flows in the list need to be powers of 2, max 2^20
# Select from following numbers: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576
flows=[512,1]
[test1]
test=warmuptest
flowsize=64
-packetsize=64
+imix=[64]
warmupspeed=1
warmuptime=2
[test2]
test=fixed_rate
-packetsizes=[64,128]
+imixs=[[64],[128]]
# the number of flows in the list need to be powers of 2, max 2^20
# Select from following numbers: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576
flows=[1,64]
def set_size(self, cores, task, pkt_size):
self._send('pkt_size %s %s %s' % (','.join(map(str, cores)), task, pkt_size))
+ def set_imix(self, cores, task, imix):
+ self._send('imix %s %s %s' % (','.join(map(str, cores)), task, ','.join(map(str,imix))))
+
def set_value(self, cores, task, offset, value, length):
self._send('set value %s %s %s %s %s' % (','.join(map(str, cores)), task, offset, value, length))
import sys
import time
from math import ceil
+from statistics import mean
from past.utils import old_div
from rapid_log import RapidLog
from rapid_log import bcolors
# writer.writeheader()
self.gen_machine.start_latency_cores()
TestPassed = True
- for size in self.test['packetsizes']:
- self.gen_machine.set_udp_packet_size(size)
+ for imix in self.test['imixs']:
+ size = mean(imix)
+ self.gen_machine.set_udp_packet_size(imix)
if self.background_machines:
backgroundinfo = '{}Running {} x background traffic not represented in the table{}'.format(bcolors.FLASH,len(self.background_machines),bcolors.ENDC)
else:
backgroundinfo = '{}{}'.format(bcolors.FLASH,bcolors.ENDC)
- self.set_background_size(self.background_machines, size)
+ self.set_background_size(self.background_machines, imix)
RapidLog.info("+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+")
RapidLog.info('| UDP, {:>5} bytes, different number of flows by randomizing SRC & DST UDP port. {:116.116}|'.format(size, backgroundinfo))
RapidLog.info("+--------+------------------+-------------+-------------+-------------+------------------------+----------+----------+----------+-----------+-----------+-----------+-----------+-------+----+")
speed_per_gen_core = speed / len(self.machine_params['gencores'])
self.socket.speed(speed_per_gen_core, self.machine_params['gencores'])
- def set_udp_packet_size(self, frame_size):
+ def set_udp_packet_size(self, imix_frame_sizes):
# We should check the gen.cfg to make sure we only send UDP packets
- # Frame size = PROX pkt size + 4 bytes CRC
- # The set_size function takes the PROX packet size as a parameter
- self.socket.set_size(self.machine_params['gencores'], 0, frame_size - 4)
- # 18 is the difference between the frame size and IP size = size of (MAC addresses, ethertype and FCS)
- self.socket.set_value(self.machine_params['gencores'], 0, 16, frame_size-18, 2)
- # 38 is the difference between the frame size and UDP size = 18 + size of IP header (=20)
- self.socket.set_value(self.machine_params['gencores'], 0, 38, frame_size-38, 2)
+ # If only 1 packet size, still using the 'old' way of setting the
+ # packet sizes in PROX. Otherwise, using the 'new' way which
+ # automatically sets IP and UDP sizes. We should switch to the new way
+ # eventually for all cases.
+ if len(imix_frame_sizes) == 1:
+ # Frame size = PROX pkt size + 4 bytes CRC
+ # The set_size function takes the PROX packet size as a parameter
+ self.socket.set_size(self.machine_params['gencores'], 0,
+ imix_frame_sizes[0] - 4)
+ # 18 is the difference between the frame size and IP size =
+ # size of (MAC addresses, ethertype and FCS)
+ self.socket.set_value(self.machine_params['gencores'], 0, 16,
+ imix_frame_sizes[0] - 18, 2)
+ # 38 is the difference between the frame size and UDP size =
+ # 18 + size of IP header (=20)
+ self.socket.set_value(self.machine_params['gencores'], 0, 38,
+ imix_frame_sizes[0] - 38, 2)
+ else:
+ prox_sizes = [frame_size - 4 for frame_size in imix_frame_sizes]
+ self.socket.set_imix(self.machine_params['gencores'], 0,
+ prox_sizes)
def set_flows(self, number_of_flows):
- source_port,destination_port = RandomPortBits.get_bitmap(number_of_flows)
- self.socket.set_random(self.machine_params['gencores'],0,34,source_port,2)
- self.socket.set_random(self.machine_params['gencores'],0,36,destination_port,2)
+ source_port,destination_port = RandomPortBits.get_bitmap(
+ number_of_flows)
+ self.socket.set_random(self.machine_params['gencores'],0,34,
+ source_port,2)
+ self.socket.set_random(self.machine_params['gencores'],0,36,
+ destination_port,2)
def start_gen_cores(self):
self.socket.start(self.machine_params['gencores'])
# fieldnames = ['Flows','PacketSize','RequestedPPS','GeneratedPPS','SentPPS','ForwardedPPS','ReceivedPPS','AvgLatencyUSEC','MaxLatencyUSEC','Dropped','DropRate']
# writer = csv.DictWriter(data_csv_file, fieldnames=fieldnames)
# writer.writeheader()
- size = self.test['packetsize']
+ imix = self.test['imix']
+ size = mean (imix)
flow_number = self.test['flowsize']
RapidLog.info("+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+")
RapidLog.info("| Generator is sending UDP ("+'{:>5}'.format(flow_number)+" flow) packets ("+ '{:>5}'.format(size) +" bytes) to SUT via GW dropping and delaying packets. SUT sends packets back. Use ctrl-c to stop the test |")
RapidLog.info("| Test | Speed requested | Sent to NIC | Sent by Gen | Forward by SUT | Rec. by Gen | Avg. Latency | Max. Latency | Packets Lost | Loss Ratio |")
RapidLog.info("+--------+--------------------+----------------+----------------+----------------+----------------+----------------+----------------+----------------+------------+")
attempts = 0
- self.gen_machine.set_udp_packet_size(size)
+ self.gen_machine.set_udp_packet_size(imix)
self.gen_machine.set_flows(flow_number)
self.gen_machine.start_latency_cores()
speed = self.test['startspeed']
section = 'test%d'%test_index
options = testconfig.options(section)
for option in options:
- if option in ['packetsizes','flows']:
+ if option in ['imix','imixs','flows']:
test[option] = ast.literal_eval(testconfig.get(section, option))
- test[option] = [int(i) for i in test[option]]
+# test[option] = [int(i) for i in test[option]]
elif option in ['maxframespersecondallingress','stepsize']:
test[option] = int(testconfig.get(section, option))
elif option in ['startspeed','drop_rate_threshold','lat_avg_threshold','lat_perc_threshold','lat_max_threshold','accuracy','maxr','maxz','pass_threshold']:
machine.set_generator_speed(speed)
@staticmethod
- def set_background_size(background_machines, size):
+ def set_background_size(background_machines, imix):
+ # imixs is a list of packet sizes
for machine in background_machines:
- machine.set_udp_packet_size(size)
+ machine.set_udp_packet_size(imix)
@staticmethod
def start_background_traffic(background_machines):
# If not doing this, the ARP message could be dropped by a switch in overload and then the test will not give proper results
# Note hoever that if we would run the test steps during a very long time, the ARP would expire in the switch.
# PROX will send a new ARP request every seconds so chances are very low that they will all fail to get through
- size = int(self.test['packetsize'])
+ imix = self.test['imix']
FLOWSIZE = int(self.test['flowsize'])
WARMUPSPEED = int(self.test['warmupspeed'])
WARMUPTIME = int(self.test['warmuptime'])
self.gen_machine.set_generator_speed(WARMUPSPEED)
- self.gen_machine.set_udp_packet_size(size)
+ self.gen_machine.set_udp_packet_size(imix)
# gen_machine['socket'].set_value(gencores,0,56,1,1)
self.gen_machine.set_flows(FLOWSIZE)
self.gen_machine.start()
-#!/usr/bin/python
+#!/usr/bin/python3
##
## Copyright (c) 2010-2020 Intel Corporation
[test1]
test=warmuptest
flowsize=512
-packetsize=64
+imix=[64]
warmupspeed=1
warmuptime=2
[test2]
test=flowsizetest
-packetsizes=[64]
+imixs=[[64]]
# the number of flows in the list need to be powers of 2, max 2^20
# Select from following numbers: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576
flows=[512]