#!/usr/bin/perl # # $Copyright$ # $TINY: LLA_DAD_NAPreDAD_SameTgt.seq,v 1.6 2002/03/05 03:04:55 masaxmasa Exp $ # ######################################################################## BEGIN { $V6evalTool::TestVersion = '$Name: $ '; } use V6evalTool; use DAD_LCNA; #------------------------------------------------------ #----- get sequence arguments #------------------------------------------------------ $howto_initNUT="none"; $send = "ok"; foreach (@ARGV) { # How to configure address of NUT? # sample: boot, ra, manual+_GLOBAL0A0N_UCAST /^addrconf=(\S+)/ && do {$DAD_LCNA::howto_addrconf=$1; next; }; # How to initialize NUT? # sample: none, DADSuccess_boot, DADFail_boot /^init=(\S+)/ && do {$howto_initNUT=$1; next; }; # "none" if send no pakcet to NUT in state DADPostSendNS # sample: ok, none /^send=(\S+)/ && do {$send=$1; next; }; # sequence debug options # sample: qR /^sd=(\S+)/ && do {$seqdebugopt=$1; next; }; seqERROR("Unknown sequence option '$_'"); } #------------------------------------------------------ #----- test condition $IF=Link0; # network interface $max_retry_count = 10; # retry if NUT state becomes DADPostSendNS $max_retry_count = 2 if $DAD_LCNA::sd =~ /q/; # quick retry $send_interval = 0.5; # 1[sec] time between DAD NS and DAD NS, send to NUT # (RandomDelay is 0-1sec e.g. default RetransTimer 1000msec) #----- retry loop $retry_count = 0; #----- start Capturing vLog("*** Target testing phase ***"); vCapture($IF); #----- initialize Counter $loopcnt=0; $recvdadns=0; $t0 = time(); #manual address configuration or reboot start time #----- send DAD NA to Allnode with interval_time for a couple of minits #----- or wait until receiving a DAD NS from NUT in every interval. vLog("TN transmits DAD NA($DAD_LCNA::dadpkt_to_NUT) to Allnode(include NUT) and wait "); vLog(" for $send_interval [sec],"); vLog(" TN expect not to receive DAD NS or NA($DAD_LCNA::dadns_from_NUT, $DAD_LCNA::chkconf_dadna_from_NUT) from NUT for $send_interval [sec],"); vLog(" to force NUT to detect the address duplication before transmitting DAD NS."); vLog(" Try this process for $DAD_LCNA::wait_dadns{$DAD_LCNA::howto_addrconf} [sec]."); #sleep $send_interval; #random wait 0.0-1.0sec ########## do { if ($loopcnt == 0){ #----- initialize NUT vLog("*** Target initialization phase ***"); $rret=vRemote("reboot_async.rmt","","timeout=5"); vLog("reboot_async.rmt returned status $rret"); # Just send trigger to reboot. vLog("*** Target testing phase ***"); } #--- Send NA vLog("Transmit NA to allnode with same Target: DADNA_from_TN_SameTgt"); %ret=vSend($IF, DADNA_from_TN_SameTgt); seqERROR(vErrmsg(%ret)) if $ret{status} != 0 ; if ($loopcnt == 0){ $firstNATime=$ret{sentTime1}; } #--- Wait NS vLog("Waiting for DAD NS : DADNS_from_NUT"); %ret=vRecv($IF,$send_interval,0,0,DADNS_from_NUT); if ($ret{status} == 0 && $ret{recvTime1} > $firstNATime) { if ($ret{recvFrame} eq DADNS_from_NUT) { $recvdadns=1; vLog("Received DAD NS packet count=$ret{recvCount}"); } } $td = $DAD_LCNA::wait_dadns{$DAD_LCNA::howto_addrconf} - (time()-$t0); $td = 0 if $td < 0; vLog("countdown timer: $td [sec]"); $loopcnt++; } while($recvdadns == 0 && $td > 0 ); #endof loop vLog("End of retry loop (retry_cout=$retry_count)"); #----- if timeout if ($ret{status}==1) { #timeout vLog("Although $DAD_LCNA::wait_dadns{$DAD_LCNA::howto_addrconf}\[sec] has past since NUT's address configured, no DAD NS came from NUT."); vLog("It seems that NUT has detected address duplication in state DADPreSendNS."); vLog("Confirming ....."); #----- check if NUT's address is configured vSleep($DAD_LCNA::RetransTimerSec); if (seqCheckNUTAddrConfigured($IF) eq TRUE) { vLog("Without DAD, NUT assigned the address to the interface."); if ($DAD_LCNA::DupAddrDetectTransmits == 0) { vLog("Because DupAddrDetectTransmits == 0"); vLog("But it means that NUT could not detect address duplication"); seqNG(); }else{ vLog("Even though DupAddrDetectTransmits != 0"); vLog("And it means that NUT could not detect address duplication"); seqNG(); } }else{ vLog("NUT has not assigned the address to the interface."); vLog("NUT detected address duplication."); seqOK(); } } if ($recvdadns==1) { #timeout vLog("NUT sent DAD NS, it means that NUT could not detect Address duplication"); vLog("by receiving NA with the same target address as NUT's one."); seqNG(); } #----- else vLog("recvFrame is '$ret{recvFrame}'"); seqERROR("Cannot reach here!");#exit #end ######################################################################## __END__ =head1 NAME LLA_DAD_NAPreDAD_SameTgt - check the process when NUT receives DAD NS with same Target address before sending DAD NS. =head1 TARGET All Node =head1 SYNOPSIS LLA_DAD_NAPreDAD_SameTgt.seq [-tooloption ...] -pkt [addrconf=] -tooloption : v6eval tool option : packet definition file (v6eval tool option) : how to configure address on NUT; boot/reboot =begin html
 detail of v6eval tool option: see perldoc V6evalTool.pm, perldoc V6evalRemote.pm
=end html =head1 INITIALIZATION =begin html
 Reboot NUT or Initialize interface of NUT or Initialize IPv6 stack of NUT.
=end html =head1 TEST PROCEDURE =over 1 =item Test for Unicast address configuration The following tests are prepared in this test package. See INDEX file. B NUT performs DAD for its Link-local unicast address made by stateless address autoconfiguration though NUT receives DAD NS which contains same target as NUT's tentative Link-local address before transimitting DAD NS. B TN NUT --------------------------------- Initialize NUT Configure address of NUT (reboot or interface initialization etc...) ==== Action #1: DAD NA =========> ==== #1: DAD NA =========> : : ==== #1: DAD NA =========> name: DADNA_from_TN_SameTgt TN wait the DAD NS sent from NUT X<=== Judgement #1: DAD NS ======= name: DADNS_from_NUT Wait for DupAddrDetectTransmits*RetransTimer Check if NUT's address is configured ==== Action #2: DAD NS =========> name: DADNS_from_TN X<== Judgement #2: DAD NA ======= name: DADNA_from_NUT, DADNA_from_NUT_woTLL =back 1 =head1 JUDGEMENT =over 1 =item Test for Link-local Unicast address autoconfiguration B B Action #1. TN transmits DAD NA which contains same target Address as NUT's tentative Link-local address. Keep transmitting for *InitializingTime* . name: DADNA_from_TN_SameTgt src: NUT's Link-local dst: allnode TargetAddress: NUT's Link-local RFlag: 0 SFlag: 0 OFlag: 1 OLLOPT: TN's MAC address Judgement #1. NUT MUST NOT transmit DAD NS for its autoconfigured Link-local address. name: DADNS_from_NUT src: ::0 dst: solnode[NUT's tentative Link-local] TargetAddress: NUT's tentative Link-local Action #2. TN transmits DAD NS to check if NUT's address is configured after *InitializingTime*. name: DADNS_from_TN src: ::0 dst: solnode[NUT's Link-local] TargetAddress: NUT's Link-local Judgement #2. NUT MUST transmit DAD NA for its autoconfigured Link-local address. name: DADNA_from_NUT, DADNA_from_NUT_woTLL src: NUT's Link-local dst: allnode TargetAddress: NUT's Link-local RFlag: 0 ( if NUT is a Router then 1) SFlag: 0 OFlag: 1 TLLOPT: NUT's MAC address =back 1 =head1 SEE ALSO =begin html
 detail of v6eval tool option: see perldoc V6evalTool.pm, perldoc V6evalRemote.pm
=end html =cut