Commit bf403713 authored by Mike Hibler's avatar Mike Hibler

Enough already Mike! A couple of changes for high latency (> 2 sec) links.

Change the rude.cfg script we generate to have a final "wait around" period
(MODIFY with 0 rate) before exiting.  We have it wait for the one-way latency
of the link.  This way, rude will not exit--and linktest will not do the
barrier synch--til all packets have had a fair chance to get to the other side.
This way we don't need a randomly chosen sleep after the barrier returns
and before we read the crude results.  Though rude already supported the
MODIFY with zero rate, I had to fix it since it didn't work if it was the
last command for the flow.

Adjust the timeout period for ping when doing the latency tests.  Previously
we waited for 3 seconds, now wait for max(RTT+1, 3) seconds.

Much more work will have to be done to support multi-second latencies
all around, this was just the low-hanging fruit.
parent d7ef17c7
......@@ -588,11 +588,21 @@ sub write_rude_cfg {
my $millis = LOSS_TEST_DURATION * 1000;
my @contents;
#
# Run for the desired time and then tell rude to not transmit, but
# wait, for the edge one-way latency time. This way rude will not
# exit before the last packet has a chance to arrive at the destination.
# Delaying here simplifies the barrier synchronization (we don't have
# to do a sub-second delay in perl). Note that a final, zero rate
# MODIFY like we use here only works in our modified version of rude!
# Stock rude will just exit after the last actual transmission; i.e.,
# prior to the final one-way latency wait.
#
# START <when>
# <start-offset-ms> <flowID> ON <src-port> \
# <dst-addr>:<dst-port> CONSTANT <packets per second> <packet size>
# <stop-offset-ms> <flowID> OFF
# <stop-offset-ms> <flowID> MODIFY CONSTANT 0 <XX>
# <stop-offset-ms+one-way-link-latency> <flowID> OFF
#
# For our purposes, the variables are:
# $sample_size packet rate
......@@ -602,6 +612,10 @@ sub write_rude_cfg {
push @contents, "0000 $stream_id ON 3001 "
. $edge->dst . "-" . $edge->name
. ":10001 CONSTANT $sample_size 20\n";
if ($edge->delay) {
push @contents, "$millis $stream_id MODIFY CONSTANT 0 20\n";
$millis += int($edge->delay);
}
push @contents, "$millis $stream_id OFF\n";
&write_file(RUDE_CFG, @contents);
......@@ -940,11 +954,20 @@ sub latency_test {
if($hostname eq $edge->src ) {
# todo: consider ignoring latency if no delay node.
if(&valid_latency($edge) && &valid_latency($other_edge)) {
#
# Tell ping to wait at least one round-trip time.
# XXX should be reconciled with expected values below.
#
my $ptimo = $edge->delay + $other_edge->delay;
$ptimo = int(($ptimo + 500) / 1000) + 1;
$ptimo = 3 if ($ptimo < 3);
if ($printsched) {
&schedlog("ping " . schedprint_link($edge) .
" (pkts=" . PING_SEND_COUNT .
", pps=" . (PING_SEND_COUNT/2) .
", timo=3s)");
", timo=${ptimo}s)");
next;
}
my $pid = fork();
......@@ -952,7 +975,8 @@ sub latency_test {
# call ping_node with ttl=1
my ($result_cnt, $sample_avg, $sample_dev) =
&ping_node($edge->dst . "-" . $edge->name,1);
&ping_node($edge->dst . "-" . $edge->name,
1, undef, $ptimo);
if ($reportonly) {
&info(" Latency result on $hostname for " .
......
......@@ -27,7 +27,7 @@ if [ ! -d rude-$version/src ]; then
if [ -d rude -a ! -d rude-$version ]; then
mv rude rude-$version
fi
cd rude-$version && patch -p1 < ../rude-patch || {
cd rude-$version && patch -p0 < ../rude-patch || {
echo "ERROR: rude-fetch.sh: patch failed"
exit 1
}
......
diff -cr rude.orig/autoconf/configure.in rude/autoconf/configure.in
*** rude.orig/autoconf/configure.in Thu Jun 13 06:15:20 2002
--- rude/autoconf/configure.in Wed Apr 12 12:31:38 2006
Index: configure
===================================================================
RCS file: /flux/CVS/emulab-rude/configure,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -c -r1.1.1.1 -r1.2
*** configure 27 Jun 2006 17:50:14 -0000 1.1.1.1
--- configure 27 Jun 2006 18:26:14 -0000 1.2
***************
*** 121,126 ****
*** 2062,2068 ****
###################
# Make it happen. #
###################
! CFLAGS="$CFLAGS -I../include"
AC_OUTPUT(Makefile:autoconf/Makefile.in rude/Makefile crude/Makefile, \
echo timestamp > include/stamp.h)
--- 121,126 ----
trap '' 1 2 15
cat > confcache <<\EOF
# This file is a shell script that caches the results of configure
--- 2062,2068 ----
###################
# Make it happen. #
###################
! CFLAGS="$CFLAGS -I\$(srcdir)/../include -I../include"
AC_OUTPUT(Makefile:autoconf/Makefile.in rude/Makefile crude/Makefile, \
echo timestamp > include/stamp.h)
diff -cr rude.orig/configure rude/configure
*** rude.orig/configure Thu Jun 27 03:44:09 2002
--- rude/configure Wed Apr 12 12:31:46 2006
trap '' 1 2 15
cat > confcache <<\EOF
# This file is a shell script that caches the results of configure
Index: autoconf/configure.in
===================================================================
RCS file: /flux/CVS/emulab-rude/autoconf/configure.in,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -c -r1.1.1.1 -r1.2
***************
*** 2062,2068 ****
*** 121,126 ****
###################
# Make it happen. #
###################
! CFLAGS="$CFLAGS -I../include"
trap '' 1 2 15
cat > confcache <<\EOF
# This file is a shell script that caches the results of configure
--- 2062,2068 ----
AC_OUTPUT(Makefile:autoconf/Makefile.in rude/Makefile crude/Makefile, \
echo timestamp > include/stamp.h)
--- 121,126 ----
###################
# Make it happen. #
###################
! CFLAGS="$CFLAGS -I\$(srcdir)/../include -I../include"
trap '' 1 2 15
cat > confcache <<\EOF
# This file is a shell script that caches the results of configure
diff -cr rude.orig/crude/main.c rude/crude/main.c
*** rude.orig/crude/main.c Thu Jun 13 06:15:21 2002
--- rude/crude/main.c Wed Apr 12 11:44:29 2006
AC_OUTPUT(Makefile:autoconf/Makefile.in rude/Makefile crude/Makefile, \
echo timestamp > include/stamp.h)
Index: crude/main.c
===================================================================
RCS file: /flux/CVS/emulab-rude/crude/main.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -c -r1.1.1.1 -r1.2
*** crude/main.c 27 Jun 2006 17:50:15 -0000 1.1.1.1
--- crude/main.c 27 Jun 2006 18:22:10 -0000 1.2
***************
*** 294,302 ****
--- 294,306 ----
......@@ -87,9 +100,14 @@ diff -cr rude.orig/crude/main.c rude/crude/main.c
printf("Delay: average = -%lld.%06llu ", sec, usec);
} else {
printf("Delay: average = %lld.%06llu ", sec, usec);
diff -cr rude.orig/include/rude.h rude/include/rude.h
*** rude.orig/include/rude.h Mon Sep 2 08:28:01 2002
--- rude/include/rude.h Wed Apr 12 10:03:36 2006
Index: include/rude.h
===================================================================
RCS file: /flux/CVS/emulab-rude/include/rude.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -c -r1.1.1.1 -r1.2
*** include/rude.h 27 Jun 2006 17:50:15 -0000 1.1.1.1
--- include/rude.h 27 Jun 2006 18:22:18 -0000 1.2
***************
*** 24,29 ****
--- 24,30 ----
......@@ -100,9 +118,14 @@ diff -cr rude.orig/include/rude.h rude/include/rude.h
#include <netinet/in.h> /* for struct sockaddr_in */
#include <sys/time.h> /* for struct timeval */
diff -cr rude.orig/rude/flow_txmit.c rude/rude/flow_txmit.c
*** rude.orig/rude/flow_txmit.c Thu Jun 13 06:15:21 2002
--- rude/rude/flow_txmit.c Wed Apr 12 11:53:03 2006
Index: rude/flow_txmit.c
===================================================================
RCS file: /flux/CVS/emulab-rude/rude/flow_txmit.c,v
retrieving revision 1.1.1.1
retrieving revision 1.3
diff -c -r1.1.1.1 -r1.3
*** rude/flow_txmit.c 27 Jun 2006 17:50:14 -0000 1.1.1.1
--- rude/flow_txmit.c 27 Jun 2006 18:28:48 -0000 1.3
***************
*** 43,58 ****
extern struct udp_data *data;
......@@ -197,9 +220,27 @@ diff -cr rude.orig/rude/flow_txmit.c rude/rude/flow_txmit.c
continue;
}
return;
diff -cr rude.orig/rude/main.c rude/rude/main.c
*** rude.orig/rude/main.c Thu Jun 13 06:15:21 2002
--- rude/rude/main.c Wed Apr 12 11:37:37 2006
***************
*** 78,83 ****
--- 137,146 ----
data->sequence_number = htonl(flow->sequence_nmbr);
wait_for_xmit(&flow->next_tx, &now);
+ /* Emulab hack: this can happen for a final zero transmission */
+ if (p->rate == 0)
+ return;
+
/* ...and fill in the rest of the data */
data->tx_time_seconds = htonl(now.tv_sec);
data->tx_time_useconds = htonl(now.tv_usec);
Index: rude/main.c
===================================================================
RCS file: /flux/CVS/emulab-rude/rude/main.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -c -r1.1.1.1 -r1.2
*** rude/main.c 27 Jun 2006 17:50:14 -0000 1.1.1.1
--- rude/main.c 27 Jun 2006 18:22:23 -0000 1.2
***************
*** 95,101 ****
exit(1);
......@@ -281,3 +322,23 @@ diff -cr rude.orig/rude/main.c rude/rude/main.c
return;
} /* print_results() */
Index: rude/parse.c
===================================================================
RCS file: /flux/CVS/emulab-rude/rude/parse.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -c -r1.1.1.1 -r1.2
*** rude/parse.c 27 Jun 2006 17:50:14 -0000 1.1.1.1
--- rude/parse.c 27 Jun 2006 18:28:48 -0000 1.2
***************
*** 688,694 ****
--- 688,696 ----
/* NEW in 0.50: Enable flow "stop" - ZERO transmission rate... */
if(temp->params.cbr.rate == 0){
temp->next_tx = temp->flow_stop;
+ /* Emulab hack: make final zero transmission actually happen
temp->next_tx.tv_sec++;
+ */
}
break;
case(TRACE):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment