Index: [Article Count Order] [Thread]

Date: Fri, 29 Feb 2008 17:30:11 +0900
From: Mitsuru Chinen <mitch@linux.vnet.ibm.com>
Subject: [dhcptest:00257] RT calculation of #42, rfc3315 client test
To: dhcptest@tahi.org
Message-Id: <20080229173011.1d19524b.mitch@linux.vnet.ibm.com>
X-Mail-Count: 00257

Hi there,

I found a bug in one of the client tests:
  #42 Part D : Maximum Retransmission Duration of Confirm message 

Section 14 in RFC3315 says:

>    RT for each subsequent message transmission is based on the previous
>    value of RT:
> 
>       RT = 2*RTprev + RAND*RTprev
> 
>    MRT specifies an upper bound on the value of RT (disregarding the
>    randomization added by the use of RAND).  If MRT has a value of 0,
>    there is no upper limit on the value of RT.  Otherwise:
> 
>       if (RT > MRT)
>          RT = MRT + RAND*MRT

However, the test handles latter case only.

Best Regards,
----
Mitsuru Chinen <mitch@linux.vnet.ibm.com>

--- DHCPv6_Self_Test/rfc3315/C_RFC3315_18_1_2_RetransCnf.seq	2007-10-30 21:56:45.000000000 +0900
+++ DHCPv6_Self_Test_client/rfc3315/C_RFC3315_18_1_2_RetransCnf.seq	2008-02-25 22:03:52.000000000 +0900
@@ -67,6 +67,7 @@ my $timeout = 30;
 my $remain = 0;
 my $lastflag = 0;
 my $mrdflag = 0;
+my $min_rt = 0;
 
 my $IRT = $CNF_TIMEOUT;
 my $MRT = $CNF_MAX_RT;
@@ -253,7 +254,11 @@ while(1){
 		vLogHTML('<FONT COLOR="#FF0000">MRD expired! </FONT><BR>');
 		dhcpExitFail;
 	}
-	if($rd + $interval*(1-$RAND) > $MRD){
+	$min_rt = (2 - $RAND) * $interval;
+	if ($min_rt > $MRT) {
+		$min_rt = (1 - $RAND) * $MRT;
+	}
+	if($rd + $min_rt > $MRD){
 		vLogHTML('<FONT COLOR="#FF0000">Next message must not be observed</FONT><BR>');
 		$mrdflag += 1;
 	}