diff options
-rw-r--r-- | apps/hiperf/src/common.h | 14 | ||||
-rw-r--r-- | apps/hiperf/src/main.cc | 22 | ||||
-rw-r--r-- | apps/hiperf/src/server.cc | 5 | ||||
-rw-r--r-- | apps/ping/src/ping_client.cc | 2 | ||||
-rw-r--r-- | lib/includes/hicn/base.h | 4 | ||||
-rw-r--r-- | lib/src/base.c | 4 | ||||
-rw-r--r-- | libtransport/includes/hicn/transport/interfaces/socket_options_default_values.h | 7 | ||||
-rw-r--r-- | tests/.env | 1 | ||||
-rw-r--r-- | tests/2-nodes-hicn-light.yml | 1 | ||||
-rwxr-xr-x | tests/config.sh | 4 | ||||
-rw-r--r-- | tests/functional-tests/2-nodes-hicn-light.robot | 6 | ||||
-rw-r--r-- | tests/resources/libraries/robot/runtest.robot | 36 |
12 files changed, 74 insertions, 32 deletions
diff --git a/apps/hiperf/src/common.h b/apps/hiperf/src/common.h index 3a17e0c40..1565e63f7 100644 --- a/apps/hiperf/src/common.h +++ b/apps/hiperf/src/common.h @@ -174,20 +174,6 @@ class PayloadSize { transport_size - fec_size; } - static Packet::Format getFormatFromPrefix(const Prefix &prefix, - bool ah = false) { - switch (prefix.getAddressFamily()) { - case AF_INET: - return ah ? HICN_PACKET_FORMAT_IPV4_TCP_AH - : HICN_PACKET_FORMAT_IPV4_TCP; - case AF_INET6: - return ah ? HICN_PACKET_FORMAT_IPV6_TCP_AH - : HICN_PACKET_FORMAT_IPV6_TCP; - default: - return HICN_PACKET_FORMAT_NONE; - } - } - private: std::size_t mtu_; Packet::Format format_; diff --git a/apps/hiperf/src/main.cc b/apps/hiperf/src/main.cc index ac0f64d1d..d655b1fe3 100644 --- a/apps/hiperf/src/main.cc +++ b/apps/hiperf/src/main.cc @@ -19,6 +19,15 @@ namespace hiperf { +static std::unordered_map<std::string, hicn_packet_format_t> const + packet_format_map = {{"ipv4_tcp", HICN_PACKET_FORMAT_IPV4_TCP}, + {"ipv6_tcp", HICN_PACKET_FORMAT_IPV6_TCP}, + {"new", HICN_PACKET_FORMAT_NEW}}; + +#define TO_LOWER(s) \ + std::transform(s.begin(), s.end(), s.begin(), \ + [](unsigned char c) { return std::tolower(c); }); + void usage() { LoggerInfo() << "HIPERF - Instrumentation tool for performing active network" "measurements with hICN"; @@ -174,6 +183,8 @@ void usage() { << "Print the stats report <nb_iterations> times and exit.\n" << "\t\t\t\t\tThis option limits the duration of the run to " "<nb_iterations> * <stats_interval> milliseconds."; + LoggerInfo() << "-w <packet_format> Packet format (without signature, " + "defaults to IPV6_TCP)"; } int main(int argc, char *argv[]) { @@ -208,7 +219,7 @@ int main(int argc, char *argv[]) { while ( (opt = getopt(argc, argv, "A:B:CDE:F:G:HIJ:K:L:M:NP:RST:U:W:X:ab:c:d:e:f:g:hi:j:k:lm:" - "n:op:qrs:tu:vwxy:z:")) != -1) { + "n:op:qrs:tu:vw:xy:z:")) != -1) { switch (opt) { // Common case 'D': { @@ -270,8 +281,13 @@ int main(int argc, char *argv[]) { break; } case 'w': { - client_configuration.packet_format_ = HICN_PACKET_FORMAT_IPV6_UDP; - server_configuration.packet_format_ = HICN_PACKET_FORMAT_IPV6_UDP; + std::string packet_format_s = std::string(optarg); + TO_LOWER(packet_format_s); + auto it = packet_format_map.find(std::string(optarg)); + if (it == packet_format_map.end()) + throw std::runtime_error("Bad packet format"); + client_configuration.packet_format_ = it->second; + server_configuration.packet_format_ = it->second; break; } case 'k': { diff --git a/apps/hiperf/src/server.cc b/apps/hiperf/src/server.cc index ee236f358..b338c69df 100644 --- a/apps/hiperf/src/server.cc +++ b/apps/hiperf/src/server.cc @@ -143,8 +143,9 @@ class HIperfServer::Impl { signer); // Compute maximum payload size - Packet::Format format = PayloadSize::getFormatFromPrefix( - configuration_.name_, !configuration_.manifest_max_capacity_); + Packet::Format format = configuration_.packet_format_; + if (!configuration_.manifest_max_capacity_) + format = Packet::toAHFormat(format); payload_size_max_ = PayloadSize(format).getPayloadSizeMax( configuration_.rtc_ ? RTC_HEADER_SIZE : 0, configuration_.fec_type_.empty() ? 0 : FEC_HEADER_MAX_SIZE, diff --git a/apps/ping/src/ping_client.cc b/apps/ping/src/ping_client.cc index 116d228d4..b3495ed20 100644 --- a/apps/ping/src/ping_client.cc +++ b/apps/ping/src/ping_client.cc @@ -58,7 +58,7 @@ class Configuration { bool jump_ = false; uint32_t jump_freq_ = 0; uint32_t jump_size_ = 0; - hicn_packet_format_t packet_format_ = HICN_PACKET_FORMAT_IPV6_TCP; + hicn_packet_format_t packet_format_ = HICN_PACKET_FORMAT_DEFAULT; Configuration() = default; }; diff --git a/lib/includes/hicn/base.h b/lib/includes/hicn/base.h index 2c80d42e6..dcbe47877 100644 --- a/lib/includes/hicn/base.h +++ b/lib/includes/hicn/base.h @@ -137,6 +137,10 @@ int hicn_packet_format_snprintf (char *s, size_t size, #define HICN_PACKET_FORMAT_NONE \ HICN_PACKET_FORMAT (IPPROTO_NONE, IPPROTO_NONE, IPPROTO_NONE, IPPROTO_NONE) +/* Default packet format */ + +#define HICN_PACKET_FORMAT_DEFAULT HICN_PACKET_FORMAT_IPV6_TCP + /** * @brief Return the hICN format with an additional AH header * @param [in] format - hICN packet format diff --git a/lib/src/base.c b/lib/src/base.c index 8c689da50..1852666a6 100644 --- a/lib/src/base.c +++ b/lib/src/base.c @@ -34,9 +34,9 @@ hicn_packet_format_snprintf (char *s, size_t size, hicn_packet_format_t format) int rc; HICN_PACKET_FORMAT_ENUMERATE (format, i, protocol, { - if (i > 1) + if (i > 0) { - rc = snprintf (cur, size - (cur - s), " %s ", "/"); + rc = snprintf (cur, size - (cur - s), "%s", "/"); if (rc < 0 || rc >= size - (cur - s)) return rc; cur += rc; diff --git a/libtransport/includes/hicn/transport/interfaces/socket_options_default_values.h b/libtransport/includes/hicn/transport/interfaces/socket_options_default_values.h index 11edae193..5558197f8 100644 --- a/libtransport/includes/hicn/transport/interfaces/socket_options_default_values.h +++ b/libtransport/includes/hicn/transport/interfaces/socket_options_default_values.h @@ -34,13 +34,8 @@ namespace interface { namespace default_values { // Packet format -// #define NEW_PACKET_FORMAT static constexpr hicn_packet_format_t packet_format = -#ifdef NEW_PACKET_FORMAT - HICN_PACKET_FORMAT_NEW; -#else - HICN_PACKET_FORMAT_IPV6_TCP; -#endif + HICN_PACKET_FORMAT_DEFAULT; // Parameters static const uint32_t interest_lifetime = 1001; // milliseconds diff --git a/tests/.env b/tests/.env index f36c66785..bda915201 100644 --- a/tests/.env +++ b/tests/.env @@ -12,3 +12,4 @@ TEST_VPP_MEMIF_REPLICATION=vpp-memif-replication RTC_PRODUCER=b002:0:0:0:abcd::/80 RAAQM_PRODUCER=b002::2 PING_PRODUCER=b002::3 +RAAQM_PRODUCER_NEW=b002::4 diff --git a/tests/2-nodes-hicn-light.yml b/tests/2-nodes-hicn-light.yml index e86bbc7ee..5e97c1069 100644 --- a/tests/2-nodes-hicn-light.yml +++ b/tests/2-nodes-hicn-light.yml @@ -60,6 +60,7 @@ services: hiperf -q -z hicnlight_module -S -R -B 4000kbps ${RTC_PRODUCER} -P 2 & hiperf -q -z hicnlight_module -S ${RAAQM_PRODUCER}/128 & + hiperf -q -z hicnlight_module -S ${RAAQM_PRODUCER_NEW}/128 & hicn-ping-server -z hicnlight_module -s 0 -n ${PING_PRODUCER}/128 & tail -f /dev/null diff --git a/tests/config.sh b/tests/config.sh index 8d36382d9..bf3cd668c 100755 --- a/tests/config.sh +++ b/tests/config.sh @@ -34,7 +34,9 @@ POSTPROCESS_COMMAND_RAAQM_RTC='tail -n +3 | \ }"' HIPERF_CMD_RAAQM="ENABLE_LOG_PREFIX=OFF /usr/bin/hiperf -q -n 50 -i 200 -C -H ${RAAQM_PRODUCER}" +HIPERF_CMD_RAAQM_NEW="ENABLE_LOG_PREFIX=OFF /usr/bin/hiperf -q -n 50 -i 200 -C -H ${RAAQM_PRODUCER} -w new" HIPERF_CMD_CBR="${HIPERF_CMD_RAAQM} -W 350 -M 0" +HIPERF_CMD_CBR_NEW="${HIPERF_CMD_RAAQM_NEW} -W 350 -M 0" HIPERF_CMD_MEMIF_RAAQM="${HIPERF_CMD_RAAQM} -z memif_module" HIPERF_CMD_MEMIF_CBR="${HIPERF_CMD_CBR} -z memif_module" @@ -76,11 +78,13 @@ declare -A tests=( ["vpp-memif-replication-rtc"]="${HIPERF_CMD_MEMIF_RTC} 2>&1 | tee >(>&2 cat) | ${POSTPROCESS_COMMAND_RAAQM_RTC}" ["hicn-light-requin"]="${HIPERF_CMD_RAAQM} 2>&1 | tee >(>&2 cat) | ${POSTPROCESS_COMMAND_RAAQM_RTC}" + ["hicn-light-requin-new"]="${HIPERF_CMD_RAAQM_NEW} 2>&1 | tee >(>&2 cat) | ${POSTPROCESS_COMMAND_RAAQM_RTC}" ["vpp-bridge-requin"]="${HIPERF_CMD_MEMIF_RAAQM} 2>&1 | tee >(>&2 cat) | ${POSTPROCESS_COMMAND_RAAQM_RTC}" ["vpp-memif-requin"]="${HIPERF_CMD_MEMIF_RAAQM} 2>&1 | tee >(>&2 cat) | ${POSTPROCESS_COMMAND_RAAQM_RTC}" ["vpp-memif-replication-requin"]="${HIPERF_CMD_MEMIF_RAAQM} 2>&1 | tee >(>&2 cat) | ${POSTPROCESS_COMMAND_RAAQM_RTC}" ["hicn-light-cbr"]="${HIPERF_CMD_CBR} 2>&1 | tee >(>&2 cat) | ${POSTPROCESS_COMMAND_RAAQM_RTC}" + ["hicn-light-cbr-new"]="${HIPERF_CMD_CBR_NEW} 2>&1 | tee >(>&2 cat) | ${POSTPROCESS_COMMAND_RAAQM_RTC}" ["vpp-bridge-cbr"]="${HIPERF_CMD_MEMIF_CBR} 2>&1 | tee >(>&2 cat) | ${POSTPROCESS_COMMAND_RAAQM_RTC}" ["vpp-memif-cbr"]="${HIPERF_CMD_MEMIF_CBR} 2>&1 | tee >(>&2 cat) | ${POSTPROCESS_COMMAND_RAAQM_RTC}" ["vpp-memif-replication-cbr"]="${HIPERF_CMD_MEMIF_CBR} 2>&1 | tee >(>&2 cat) | ${POSTPROCESS_COMMAND_RAAQM_RTC}" diff --git a/tests/functional-tests/2-nodes-hicn-light.robot b/tests/functional-tests/2-nodes-hicn-light.robot index e23c35e6a..fedcc9797 100644 --- a/tests/functional-tests/2-nodes-hicn-light.robot +++ b/tests/functional-tests/2-nodes-hicn-light.robot @@ -13,9 +13,15 @@ Resource resources/libraries/robot/runtest.robot Throughput Testing Raaqm Mobile Run Throughput Test Raaqm hicn-light 200 500 400 +Throughput Testing Raaqm Mobile New + Run Throughput Test Raaqm New hicn-light 200 500 400 + Throughput Testing CBR Mobile Run Throughput Test CBR hicn-light 200 500 400 +Throughput Testing CBR Mobile New + Run Throughput Test CBR New hicn-light 200 500 400 + RTC Testing Mobile Run RTC Test hicn-light 4 4 4 diff --git a/tests/resources/libraries/robot/runtest.robot b/tests/resources/libraries/robot/runtest.robot index 379b4d307..9a3da8647 100644 --- a/tests/resources/libraries/robot/runtest.robot +++ b/tests/resources/libraries/robot/runtest.robot @@ -24,18 +24,26 @@ Run Test Should Be True ${min_max_avg}[0] >= ${EXPECTED_MIN} msg="Min does not match (${min_max_avg}[0] < ${EXPECTED_MIN})" Should Be True ${min_max_avg}[1] >= ${EXPECTED_MAX} msg="Max does not match (${min_max_avg}[1] < ${EXPECTED_MAX})" Should Be True ${min_max_avg}[2] >= ${EXPECTED_AVG} msg="Avg does not match (${min_max_avg}[2] < ${EXPECTED_AVG})" + ELSE IF '${TESTID}' == 'requin-new' + Should Be True ${min_max_avg}[0] >= ${EXPECTED_MIN} msg="Min does not match (${min_max_avg}[0] < ${EXPECTED_MIN})" + Should Be True ${min_max_avg}[1] >= ${EXPECTED_MAX} msg="Max does not match (${min_max_avg}[1] < ${EXPECTED_MAX})" + Should Be True ${min_max_avg}[2] >= ${EXPECTED_AVG} msg="Avg does not match (${min_max_avg}[2] < ${EXPECTED_AVG})" ELSE IF '${TESTID}' == 'latency' Should Be True ${min_max_avg}[0] <= ${EXPECTED_MIN} msg="Min does not match (${min_max_avg}[0] > ${EXPECTED_MIN})" Should Be True ${min_max_avg}[1] <= ${EXPECTED_MAX} msg="Max does not match (${min_max_avg}[1] > ${EXPECTED_MAX})" Should Be True ${min_max_avg}[2] <= ${EXPECTED_AVG} msg="Avg does not match (${min_max_avg}[2] > ${EXPECTED_AVG})" - ELSE IF '${TESTID}' == 'cbr' - Should Be True ${min_max_avg}[0] >= ${EXPECTED_MIN} msg="Min does not match (${min_max_avg}[0] < ${EXPECTED_MIN})" - Should Be True ${min_max_avg}[1] >= ${EXPECTED_MAX} msg="Max does not match (${min_max_avg}[1] < ${EXPECTED_MAX})" - Should Be True ${min_max_avg}[2] >= ${EXPECTED_AVG} msg="Avg does not match (${min_max_avg}[2] < ${EXPECTED_AVG})" ELSE IF '${TESTID}' == 'latency-new' Should Be True ${min_max_avg}[0] <= ${EXPECTED_MIN} msg="Min does not match (${min_max_avg}[0] > ${EXPECTED_MIN})" Should Be True ${min_max_avg}[1] <= ${EXPECTED_MAX} msg="Max does not match (${min_max_avg}[1] > ${EXPECTED_MAX})" Should Be True ${min_max_avg}[2] <= ${EXPECTED_AVG} msg="Avg does not match (${min_max_avg}[2] > ${EXPECTED_AVG})" + ELSE IF '${TESTID}' == 'cbr' + Should Be True ${min_max_avg}[0] >= ${EXPECTED_MIN} msg="Min does not match (${min_max_avg}[0] < ${EXPECTED_MIN})" + Should Be True ${min_max_avg}[1] >= ${EXPECTED_MAX} msg="Max does not match (${min_max_avg}[1] < ${EXPECTED_MAX})" + Should Be True ${min_max_avg}[2] >= ${EXPECTED_AVG} msg="Avg does not match (${min_max_avg}[2] < ${EXPECTED_AVG})" + ELSE IF '${TESTID}' == 'cbr-new' + Should Be True ${min_max_avg}[0] >= ${EXPECTED_MIN} msg="Min does not match (${min_max_avg}[0] < ${EXPECTED_MIN})" + Should Be True ${min_max_avg}[1] >= ${EXPECTED_MAX} msg="Max does not match (${min_max_avg}[1] < ${EXPECTED_MAX})" + Should Be True ${min_max_avg}[2] >= ${EXPECTED_AVG} msg="Avg does not match (${min_max_avg}[2] < ${EXPECTED_AVG})" ELSE Fail "Provided Test ID does not exist" END @@ -75,6 +83,16 @@ Run Throughput Test Raaqm [Arguments] ${TEST_SETUP}=${NONE} ${EXPECTED_MIN}=${NONE} ${EXPECTED_MAX}=${NONE} ${EXPECTED_AVG}=${NONE} Run Test ${TEST_SETUP} requin ${EXPECTED_MIN} ${EXPECTED_MAX} ${EXPECTED_AVG} +Run Throughput Test Raaqm New + [Documentation] Run hiperf on the ${TEST_SETUP} topology and measure throughput. + ... Arguments: + ... ${TEST_SETUP} The setup of the test. + ... ${EXPECTED_MIN} The expected min throughput + ... ${EXPECTED_MAX} The expected max throughput + ... ${EXPECTED_AVG} The expected avg throughput + [Arguments] ${TEST_SETUP}=${NONE} ${EXPECTED_MIN}=${NONE} ${EXPECTED_MAX}=${NONE} ${EXPECTED_AVG}=${NONE} + Run Test ${TEST_SETUP} requin ${EXPECTED_MIN} ${EXPECTED_MAX} ${EXPECTED_AVG} + Run Throughput Test CBR [Documentation] Run hiperf on the ${TEST_SETUP} topology and measure throughput. ... Arguments: @@ -85,6 +103,16 @@ Run Throughput Test CBR [Arguments] ${TEST_SETUP}=${NONE} ${EXPECTED_MIN}=${NONE} ${EXPECTED_MAX}=${NONE} ${EXPECTED_AVG}=${NONE} Run Test ${TEST_SETUP} cbr ${EXPECTED_MIN} ${EXPECTED_MAX} ${EXPECTED_AVG} +Run Throughput Test CBR New + [Documentation] Run hiperf on the ${TEST_SETUP} topology and measure throughput. + ... Arguments: + ... ${TEST_SETUP} The setup of the test. + ... ${EXPECTED_MIN} The expected min throughput + ... ${EXPECTED_MAX} The expected max throughput + ... ${EXPECTED_AVG} The expected avg throughput + [Arguments] ${TEST_SETUP}=${NONE} ${EXPECTED_MIN}=${NONE} ${EXPECTED_MAX}=${NONE} ${EXPECTED_AVG}=${NONE} + Run Test ${TEST_SETUP} cbr ${EXPECTED_MIN} ${EXPECTED_MAX} ${EXPECTED_AVG} + Run RTC Test [Documentation] Run hiperf RTC on the ${TEST_SETUP} topology and check consumer syncs to producer bitrate. ... Arguments: |