Skip to contentSkip to conversation

selftests/mptcp: Better delay & reordering configuration

PATCH In review Christoph Paasch 2 participants 3 messages Aug 7, 2020

Subsystems (3)
lore
Share & tools
lore

Christoph Paasch

author
#0 lore raw

PATCH v2 1/1 selftests/mptcp: Better delay & reordering configuration

The delay was intended to be configured to "simulate" a high(er) BDP link. As such, it needs to be set as part of the loss-configuration and not as part of the netem reordering configuration.

The reordering-config also requires a delay but that delay is the reordering-extend. So, a good approach is to set the reordering-extend as a function of the configured latency. E.g., 25% of the overall latency.

To speed up the selftests, we limit the delay to 50ms maximum to avoid having the selftests run for too long.

Finally, the intention of tc_reorder was that when it is unset, the test picks a random configuration. However, currently it is always initialized and thus the random config won't be picked up.

Reported-by Matthieu Baerts <matthieu.baerts(a)tessares.net>
Signed-off-by Christoph Paasch <cpaasch(a)apple.com>

---

Notes:

    v2: Use "Closes" tag, properly use $(( ... )), limit delay to 50ms (feedback from Matthieu B.)
 .../selftests/net/mptcp/mptcp_connect.sh        | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
tools/testing/selftests/net/mptcp/mptcp_connect.sh +9 -8
index 57d75b7f6220..e4df9ba64824 100755
@@ -14,9 +14,8 @@ capture=false
 timeout=30
 ipv6=true
 ethtool_random_on=true
-tc_delay="$((RANDOM%400))"
+tc_delay="$((RANDOM%50))"
 tc_loss=$((RANDOM%101))
-tc_reorder=""
 testmode=""
 sndbuf=0
 rcvbuf=0
@@ -628,30 +627,32 @@ for sender in "$ns1" "$ns2" "$ns3" "$ns4";do
 	do_ping "$ns4" $sender dead:beef:3::1
 done
 
-[ -n "$tc_loss" ] && tc -net "$ns2" qdisc add dev ns2eth3 root netem loss random $tc_loss
+[ -n "$tc_loss" ] && tc -net "$ns2" qdisc add dev ns2eth3 root netem loss random $tc_loss delay ${tc_delay}ms
 echo -n "INFO: Using loss of $tc_loss "
 test "$tc_delay" -gt 0 && echo -n "delay $tc_delay ms "
 
+reorder_delay=$(($tc_delay / 4))
+
 if [ -z "${tc_reorder}" ]; then
 	reorder1=$((RANDOM%10))
 	reorder1=$((100 - reorder1))
 	reorder2=$((RANDOM%100))
 
-	if [ $tc_delay -gt 0 ] && [ $reorder1 -lt 100 ] && [ $reorder2 -gt 0 ]; then
+	if [ $reorder_delay -gt 0 ] && [ $reorder1 -lt 100 ] && [ $reorder2 -gt 0 ]; then
 		tc_reorder="reorder ${reorder1}% ${reorder2}%"
-		echo -n "$tc_reorder "
+		echo -n "$tc_reorder with delay ${reorder_delay}ms "
 	fi
 elif [ "$tc_reorder" = "0" ];then
 	tc_reorder=""
-elif [ "$tc_delay" -gt 0 ];then
+elif [ "$reorder_delay" -gt 0 ];then
 	# reordering requires some delay
 	tc_reorder="reorder $tc_reorder"
-	echo -n "$tc_reorder "
+	echo -n "$tc_reorder with delay ${reorder_delay}ms "
 fi
 
 echo "on ns3eth4"
 
-tc -net "$ns3" qdisc add dev ns3eth4 root netem delay ${tc_delay}ms $tc_reorder
+tc -net "$ns3" qdisc add dev ns3eth4 root netem delay ${reorder_delay}ms $tc_reorder
 
 for sender in $ns1 $ns2 $ns3 $ns4;do
 	run_tests_lo "$ns1" "$sender" 10.0.1.1 1
Signature · 1 line
2.23.0
Reviewed-by on v2 1/1
#1 lore raw

Hi Christoph,

Quoted 16 lines · Christoph Paasch

The delay was intended to be configured to "simulate" a high(er) BDP link. As such, it needs to be set as part of the loss-configuration and not as part of the netem reordering configuration.

The reordering-config also requires a delay but that delay is the reordering-extend. So, a good approach is to set the reordering-extend as a function of the configured latency. E.g., 25% of the overall latency.

To speed up the selftests, we limit the delay to 50ms maximum to avoid having the selftests run for too long.

Finally, the intention of tc_reorder was that when it is unset, the test picks a random configuration. However, currently it is always initialized and thus the random config won't be picked up.

Quoted 8 lines
Reported-by Matthieu Baerts <matthieu.baerts(a)tessares.net>
Signed-off-by Christoph Paasch <cpaasch(a)apple.com>

---

Notes:

     v2: Use "Closes" tag, properly use $(( ... )), limit delay to 50ms (feedback from Matthieu B.)

Thank you for this v2, it looks good to me!

Reviewed-by Matthieu Baerts <matthieu.baerts(a)tessares.net>

I can apply it in the export branch and let the CI validating this!

Cheers,
Matt

Signature · 2 lines
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net
author
#2 lore raw
Quoted 25 lines · Matthieu Baerts

Hi Christoph,

Quoted 22 lines · Christoph Paasch

The delay was intended to be configured to "simulate" a high(er) BDP link. As such, it needs to be set as part of the loss-configuration and not as part of the netem reordering configuration.

The reordering-config also requires a delay but that delay is the reordering-extend. So, a good approach is to set the reordering-extend as a function of the configured latency. E.g., 25% of the overall latency.

To speed up the selftests, we limit the delay to 50ms maximum to avoid having the selftests run for too long.

Finally, the intention of tc_reorder was that when it is unset, the test picks a random configuration. However, currently it is always initialized and thus the random config won't be picked up.

Reported-by Matthieu Baerts <matthieu.baerts(a)tessares.net>
Signed-off-by Christoph Paasch <cpaasch(a)apple.com>

---

Quoted 8 lines
Quoted 2 lines

Notes:

     v2: Use "Closes" tag, properly use $(( ... )), limit delay to 50ms (feedback from Matthieu B.)

Thank you for this v2, it looks good to me!

Reviewed-by Matthieu Baerts <matthieu.baerts(a)tessares.net>

I can apply it in the export branch and let the CI validating this!

Sounds good!

Christoph

Quoted 6 lines

Cheers,
Matt

Signature · 2 lines
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net