From ea2c5d5168e56bb45a8839ee2cab890cbdbd873a Mon Sep 17 00:00:00 2001 From: Luc Provoost Date: Thu, 6 Aug 2020 14:11:05 +0200 Subject: fix: IPV6 packet generation, packet loss reporting UDP and IP packet length and source UDP port and destination UDP port were wrongly set for IPv6 packets. In the *.test files, there is now an optional boolean field (ipv6) in the [TestParameters] section. When set to true, the generator will use the IPv6 packet layout to place the right values at the proper offset in the packet. If not present or set to false, the IPv4 layout will be used. Note also that packet size needs to be at least 84 bytes for IPV6 traffic since we need space for latency and other information in each packet. Packet loss ratio is now printed as a percentage of the total packets sent. Change-Id: I2136e87f3032348ae95b69052be7da8461c6303c Signed-off-by: Luc Provoost --- .../rapid/rapid_generator_machine.py | 63 +++++++++++++++------- 1 file changed, 45 insertions(+), 18 deletions(-) (limited to 'VNFs/DPPD-PROX/helper-scripts/rapid/rapid_generator_machine.py') diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_generator_machine.py b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_generator_machine.py index 8d7b4e33..1cd1fa33 100644 --- a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_generator_machine.py +++ b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_generator_machine.py @@ -35,7 +35,7 @@ class RandomPortBits(object): # throw exeption since we need the first bit to be 1 # Otherwise, the randomization could results in all 0's # and that might be an invalid UDP port and result in - # packets begin discarded + # packets being discarded src_number_of_random_bits = number_of_random_bits // 2 dst_number_of_random_bits = (number_of_random_bits - src_number_of_random_bits) @@ -43,12 +43,38 @@ class RandomPortBits(object): src_number_of_random_bits) dst_port_bitmap = '1000000000000000'.replace ('0','X', dst_number_of_random_bits) - return [src_port_bitmap, dst_port_bitmap, 1<