#!/usr/bin/perl # # $Copyright$ # # $Id: ADDRSTATE_not_reset_VLT.seq,v 1.1.1.1 2000/10/31 22:39:23 sekiya Exp $ ######################################################################## BEGIN { $V6evalTool::TestVersion = '$Name: $ '; } use V6evalTool; use DAD; #----- get sequence arguments $howto_initNUT="none"; $send = "ok"; foreach (@ARGV) { /^sequence=(\S+)/ && do {$sequence=$1; # next; }; # sample: usolra_vlt60,wait30,usolra_vlt120 # /^addrconf=(\S+)/ && do {$DAD::howto_addrconf=$1; # How to configure address of NUT? # next; }; # sample: boot, ra, manual+_GLOBAL0A0N_UCAST /^init=(\S+)/ && do {$howto_initNUT=$1; # How to initialize NUT? next; }; # sample: none, DADSuccess_boot, DADFail_boot /^sd=(\S+)/ && do {$seqdebugopt=$1; # sequence debug options next; }; # sample: qR seqERROR("Unknown sequence option '$_'"); } #----- test condition $IF=Link0; # network interface seqSetDADParam($seqdebugopt); $overwrite = "NO"; #YES/NO, overwrite 1st RA ValidLifetime by 2nd RA ValidLifetime # YES for ./ADDRSTATE_overwrite_VLT.seq # NO for ./ADDRSTATE_not_overwrite_VLT.seq @vltlist = (30, 60, 90, 120, 150, 180); # this is for seqProbeLT(), not for sending RA #----- set %pktdesc seqSetPktdesc(); #----- initialize NUT vLog("*** Target initialization phase ***"); seqInitNUT($IF, $howto_initNUT); #----- start Capturing vLog("*** Target testing phase ***"); vCapture($IF); #----- Configure Address on NUT and wait and reconfigure @sequence = split(/,/ , $sequence); while($usolra_to_NUT = shift(@sequence)) { #----- get VLT from framename push (@usolra_vlt, ($usolra_to_NUT =~ /usolra_vlt([0-9]+)/)); #----- Configure Address on NUT # stateless addrconf by RA vLog("Stateless address configuration by sending RA to NUT: $usolra_to_NUT"); %ret=vSend($IF, $usolra_to_NUT); $seektime_for_dadns = $ret{'sentTime1'}; #----- wait a DAD NS comming from NUT $timeout_for_dadns = $DAD::wait_dadns{"ra"}; vLog("TN wait the DAD NS sends from NUT : $DAD::dadns_from_NUT"); %ret=vRecv($IF,$timeout_for_dadns, $seektime_for_dadns, 1, $DAD::dadns_from_NUT); #----- if received frame is a DAD NS if( $ret{status} == 0) { vLog("TN received the DAD NS sends from NUT."); #----- wait for NUT to finish DAD vSleep($DAD::RetransTimerSec, "Wait for NUT to finish DAD. ($DAD::RetransTimerSec [sec])"); }elsif( $ret{status} == 1 ) { #----- timeout vLog("TN received no DAD NS sends from NUT. It seems that NUT doesn't perform DAD process."); }else{ #----- error seqERROR(vErrmsg(%ret)); #exit } #----- check if NUT's address is configured #seqWaitNUTbeReady(); vSleep($DAD::RetransTimerSec); if (seqCheckNUTAddrConfigured($IF) eq TRUE) { vLog("The address is configured (valid preferred)."); }else{ vLog("The address is not configured although address must be valid preferred."); seqNG(); } if ($sequence_waitsec = shift(@sequence)) { ($reconfig_waitsec) = ($sequence_waitsec =~ /wait([0-9]+)/); vSleep($reconfig_waitsec, "Wait $reconfig_waitsec [sec] to spent NUT's address lifetime."); } } #----- Probing ValidLifetime vLog(" *** Probing ValidLifetime phase ***"); ($total_waitsec, $vlt_index) = seqProbeVLT($IF, 30, @vltlist); # check which ValidLifetime is set (probe interval 30[sec]) vLog("total_waitsec=$total_waitsec, vlt_index=$vlt_index, vlt=$vltlist[$vlt_index]") if $debug > 0; seqNG() if $vlt_index < 0; vLog("$total_waitsec [sec] spent to wait for NUT's address becomes invalid."); if ( $usolra_vlt[0] < $reconfig_waitsec) { vLog("Before expiration of 1st ValidLifetime=$usolra_vlt[0]"); }else{ vLog("After expiration of 1st ValidLifetime=$usolra_vlt[0]"); } if ($vltlist[$vlt_index] == $usolra_vlt[1]) { vLog("1st ValidLifetime=$usolra_vlt[0] were overwritten by 2nd RA(ValidLifetime=$usolra_vlt[1]). "); ($overwrite eq "YES")? seqOK() : seqNG() ; }else{ vLog("1st ValidLifetime=$usolra_vlt[0] were not overwritten by 2nd RA(ValidLifetime=$usolra_vlt[1]). "); ($overwrite eq "YES")? seqNG() : seqOK() ; seqNG(); } #end ######################################################################## __END__ =head1 NAME ADDRSTATE_not_reset_VLT - Check if ValidLifetime is not reset by RA with same prefix =head1 TARGET Host =head1 SYNOPSIS ADDRSTATE_not_reset_VLT.seq [-tooloption ...] -pkt [sequence=,,] [init=,...] [sd=] -tooloption : v6eval tool option : packet definition file (v6eval tool option) : send RA to NUT ; usolra_vlt(30|60|90|120) : wait NN [sec]; waitNN : how to initialize NUT; DADSuccess_boot/DADFail_boot/ra : debug options =begin html
 detail of v6eval tool option: see perldoc V6evalTool.pm, perldoc V6evalRemote.pm
 detail of parameters: see Test sequence for IPv6 Stateless Address Autoconfiguration.
=end html =head1 INITIALIZATION =begin html
 detail of Initialization: see Test sequence for IPv6 Stateless Address Autoconfiguration.
=end html =head1 TEST PROCEDURE The following test is prepared in this test package. See INDEX file. B Check if ValidLifetime is not reset by RA with same prefix (before expiry, same VLT) Check if ValidLifetime is not reset by RA with same prefix (before expiry, less VLT) B TN(or X) NUT ------------------------------ Initialize NUT (see ...) Send Unsolicited RA to configure address of NUT ==== Action #1: Unsolicited RA ===> name: src: TN's Link-local address dst: allnodes multicast SLL option exists Prefix option PrefixLength: 64 LFlag: 1 AFlag: 1 ValidLifetime: PreferredLifetime: Prefix: _GLOBAL0_UCAST_PRFX TN wait the DAD NS sends from NUT. (This judgement is informational only.) <=== Judgement #1: DAD NS ==== name: dadns_from_NUT src: ::0 dst: solnode[TargetAddress] TargetAddress: NUT's tentative _GLOBAL0_UCAST_PRFX + interface-id Wait for NUT to finish DAD. (sleep $RetransTimerSec=1 [sec]) Check if NUT's address is configured. ==== Action #2: DAD NS ====> name: chkconf_dadns_to_NUT src: ::0 dst: solnode[TargetAddress] TargetAddress: NUT's _GLOBAL0_UCAST_PRFX + interface-id DAD NA come from NUT because NUT's address is configured (valid preferred). <=== Judgement #2: DAD NA come==== name: chkconf_dadna_from_NUT src: NUT's Link-local address or TargetAddress dst: allnodes multicast TargetAddress: NUT's _GLOBAL0_UCAST_PRFX + interface-id OFlag: 1 RFlag: 0 Wait to spent NUT's address lifetime. Action #3: wait [sec] Send Unsolicited RA to configure address of NUT ==== Action #4: Unsolicited RA ===> name: src: TN's Link-local address dst: allnodes multicast SLL option exists Prefix option PrefixLength: 64 LFlag: 1 AFlag: 1 ValidLifetime: PreferredLifetime: Prefix: _GLOBAL0_UCAST_PRFX TN wait the DAD NS sends from NUT. (This judgement is informational only.) <=== Judgement #4: DAD NS ==== name: dadns_from_NUT src: ::0 dst: solnode[TargetAddress] TargetAddress: NUT's tentative _GLOBAL0_UCAST_PRFX + interface-id Wait for NUT to finish DAD. (sleep $RetransTimerSec=1 [sec]) Check if NUT's address is configured. ==== Action #5: DAD NS ====> name: chkconf_dadns_to_NUT src: ::0 dst: solnode[TargetAddress] TargetAddress: NUT's _GLOBAL0_UCAST_PRFX + interface-id DAD NA come from NUT because NUT's address is configured (valid preferred). <=== Judgement #5: DAD NA come==== name: chkconf_dadna_from_NUT src: NUT's Link-local address or TargetAddress dst: allnodes multicast TargetAddress: NUT's _GLOBAL0_UCAST_PRFX + interface-id OFlag: 1 RFlag: 0 permanent loop { Wait 30 [sec] to spent NUT's address lifetime. Count up totoal wait [sec] to spent NUT's address lifetime. Check if NUT's address is configured. ==== Action #6: DAD NS ====> name: chkconf_dadns_to_NUT src: ::0 dst: solnode[TargetAddress] TargetAddress: NUT's _GLOBAL0_UCAST_PRFX + interface-id Check if DAD NA come from NUT (check if NUT's address configured) Exit the permanent loop if DAD NA doesn't come. <=== Judgement #6: DAD NA come==== name: chkconf_dadna_from_NUT (or chkconf_dadna_from_NUT_rf1 if NUT is a Router) src: NUT's Link-local address or TargetAddress dst: allnodes multicast TargetAddress: NUT's _GLOBAL0_UCAST_PRFX + interface-id OFlag: 1 RFlag: 0 ( if NUT is a Router then 1) } Judgement #6: it must be 0 < total wait [sec] != ValidLifetime of =head1 JUDGEMENT B B B< -pkt GLOBAL0_valRA_sameprfxes.def :sequence=usolra_vlt60,wait30,usolra_vlt60 init=DADSuccess_boot> Action #1: send the Unsolicited RA to NUT name: usolra_vlt60 Prefix option ValidLifetime: 60 PreferredLifetime: 60 Judgement #1: DAD NS come from NUT. (This judgement is informational only.) Action #2: Send DAD NS to NUT Judgement #2: DAD NA must come from NUT because NUT's address is configured Action #3: wait 30 [sec] (not expire the ValidLifetime:60) Action #4: send the Unsolicited RA to NUT name: usolra_vlt60 Prefix option ValidLifetime: 60 PreferredLifetime: 60 Judgement #4: DAD NS come from NUT. (This judgement is informational only.) Action #5: Send DAD NS to NUT Judgement #5: DAD NA must come from NUT because NUT's address is configured permanent loop { Wait 30 [sec] to spent NUT's address lifetime. Count up totoal wait [sec] to spent NUT's address lifetime. Action #6: Send DAD NS to NUT Judgement #6: DAD NA come from NUT if NUT's address is valid exit the permanent loop if DAD NA doesn't come. } Judgement #6: it must be 0 < total wait [sec] != 60 (ValidLifetime of usolra_vlt60) B B< -pkt GLOBAL0_valRA_sameprfxes.def :sequence=usolra_vlt120,wait30,usolra_vlt60 init=DADSuccess_boot> Action #1: send the Unsolicited RA to NUT name: usolra_vlt120 Prefix option ValidLifetime: 120 PreferredLifetime: 120 Judgement #1: DAD NS come from NUT. (This judgement is informational only.) Action #2: Send DAD NS to NUT Judgement #2: DAD NA must come from NUT because NUT's address is configured Action #3: wait 30 [sec] (not expire the ValidLifetime:120) Action #4: send the Unsolicited RA to NUT name: usolra_vlt60 Prefix option ValidLifetime: 60 PreferredLifetime: 60 Judgement #4: DAD NS come from NUT. (This judgement is informational only.) Action #5: Send DAD NS to NUT Judgement #5: DAD NA must come from NUT because NUT's address is configured permanent loop { Wait 30 [sec] to spent NUT's address lifetime. Count up totoal wait [sec] to spent NUT's address lifetime. Action #6: Send DAD NS to NUT Judgement #6: DAD NA come from NUT if NUT's address is valid exit the permanent loop if DAD NA doesn't come. } Judgement #6: it must be 0 < total wait [sec] != 60 (ValidLifetime of usolra_vlt60) =head1 SEE ALSO =begin html
 detail of v6eval tool option: see perldoc V6evalTool.pm, perldoc V6evalRemote.pm
 detail of parameters: see Test sequence for IPv6 Stateless Address Autoconfiguration.
=end html =cut