#!/usr/bin/perl # # $Copyright$ # $TINY: RA_GA_Success.seq,v 1.14 2002/03/05 17:13:55 miyata Exp $ # ######################################################################## BEGIN { $V6evalTool::TestVersion = '$Name: $ '; } use V6evalTool; use DAD_LCNA; #------------------------------------------------------ #----- get sequence arguments #------------------------------------------------------ $howto_initNUT="none"; $send = "ok"; $DAD_GA=$DAD_LCNA::DADTransmitsGA; $DAD_GA =~ tr/a-z/A-Z/ ; 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 = 1; # 1[sec] time between DAD NS and DAD NS, send to NUT # (RandomDelay is 0-1sec e.g. default RetransTimer 1000msec) $recvVLT=30; ########################################################## #----- initialize NUT vLog("*** Target initialization phase ***"); $rret=vRemote("reboot_async.rmt","","timeout=5"); vLog("reboot_async.rmt returned status $rret"); #----- start Capturing vLog("*** Target testing phase ***"); vCapture($IF); #----- LLA PHASE #----- Wait DAD NS from NUT or timeout vLog("TN wait DAD NS(DADNS_from_NUT) from NUT for $DAD_LCNA::wait_dadns{$DAD_LCNA::howto_addrconf} [sec],"); %ret1=vRecv($IF,$DAD_LCNA::wait_dadns{$DAD_LCNA::howto_addrconf},0,0,DADNS_from_NUT); if ($ret1{status} != 0){ vLog("TN wait DAD NS from NUT for $DAD_LCNA::wait_dadns{$DAD_LCNA::howto_addrconf}, but NUT had not transmit DAD NS"); seqNG(); } #----- RA PHASE vLog("TN received DAD NS from NUT."); vLog("OK! Let's go ahead!"); %ret2=vRecv($IF,$DAD_LCNA::wait_rs,0,0,RS_from_NUT,RS_from_NUT_wSLL); if ($ret2{status} != 0){ vLog("Though TN had waited RS from NUT for $DAD_LCNA::wait_rs,"); vLog(" NUT seems not to send RS."); vLog(" Anyway TN is sending Unsolicited RA (Prefix=Global)"); }else{ vLog("TN received RS from NUT."); vLog("TN is sending RA (Prefix=Global)"); } #-------------------------- # Send RA #-------------------------- vSend($IF, RA_GA0); #--- VLT=30/PLT=15 $t0 = time(); #----- Wait DAD NS from NUT or timeout vLog("TN wait DAD NS for Global address from NUT for $DAD_LCNA::wait_dadns{ra} [sec],"); %ret3=vRecv($IF,$DAD_LCNA::wait_dadns{ra},0,0,DADNS_from_NUT_GA0Tgt); if ($ret3{status} == 0){ #----- check if NUT's address is configured vLog("NUT had transmitted DAD NS for its Global address."); vSleep($DAD_LCNA::RetransTimerSec); $t0 = time(); #-- Here is the better posiotion for t0 vLog("DAD complete time= $t0"); if (seqCheckNUTAddrConfiguredGA($IF,DADNS_from_TN_GA0Tgt, DADNA_from_NUT_GA0Tgt, DADNA_from_NUT_GA0Tgt_woTLL, DADNA_from_GA0NUT_GA0Tgt, DADNA_from_GA0NUT_GA0Tgt_woTLL) eq TRUE) { vLog("NUT assigned Global address to the interface."); if ($DAD_GA eq "NO") { vLog("NUT transmit DAD NS though DADTransmitsGA == 0"); seqNG(); }else{ vLog("OK! Let's go ahead."); } }else{ vLog(" NUT had not assign Global address."); seqNG(); } } elsif ($ret3{status} != 0){ vLog("NUT had not transmitted DAD NS for Global address."); if (seqCheckNUTAddrConfiguredGA($IF,DADNS_from_TN_GA0Tgt, DADNA_from_NUT_GA0Tgt, DADNA_from_NUT_GA0Tgt_woTLL, DADNA_from_GA0NUT_GA0Tgt, DADNA_from_GA0NUT_GA0Tgt_woTLL) eq TRUE) { vLog("NUT assigned Global address to the interface."); if ($DAD_GA eq "YES") { vLog("NUT did not transmit DAD NS though DADTransmitsGA != 0"); seqNG(); }else{ vLog("But it is OK if Global address consists of MAC address as LLA."); vLog("OK! Let's go ahead."); } }else{ vLog("NUT did not assign Global address."); seqNG(); } } #-------------------------- # Sleep until 3 sec before expiration of VLT in the RA since receiving it. #-------------------------- $t1 = time(); vSleep($t0+$recvVLT-$t1-3); vLog("It is 3 sec before the expiration of VLT in the RA."); vLog("Confirming whether assinged address is available."); if (seqCheckNUTAddrConfiguredGA($IF,DADNS_from_TN_GA0Tgt, DADNA_from_NUT_GA0Tgt, DADNA_from_NUT_GA0Tgt_woTLL, DADNA_from_GA0NUT_GA0Tgt, DADNA_from_GA0NUT_GA0Tgt_woTLL) eq TRUE) { vLog("The address is still available."); }else{ vLog("The address is not available."); seqNG(); } #-------------------------- # Sleep until 3 sec after expiration of VLT in the RA since receiving it. #-------------------------- vSleep(6); vLog("It is 3 sec after the expiration of VLT in the RA."); vLog("Confirming whether assinged address is available."); if (seqCheckNUTAddrConfiguredGA($IF,DADNS_from_TN_GA0Tgt, DADNA_from_NUT_GA0Tgt, DADNA_from_NUT_GA0Tgt_woTLL, DADNA_from_GA0NUT_GA0Tgt, DADNA_from_GA0NUT_GA0Tgt_woTLL) eq TRUE) { vLog("The address is still available."); seqNG(); }else{ vLog("The address is not available."); seqOK(); } ########################################################## #end ######################################################################## __END__ =head1 NAME RA_GA_Success - check the process when NUT receives RA which contains one Global Prefix.(Assigning and Expiring Global address) =head1 TARGET All Node =head1 SYNOPSIS RA_GA_Success.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 When NUT receives RA which contains Global Prefix, NUT assignes autoconfigured address. NUT MAY perform DAD for its Global address prior to assigning it. Because received Prefix has Valid Life Time(VLT), the Global address MUST expire when VLT expired. B TN NUT --------------------------------- Initialize NUT Configure address of NUT (reboot or interface initialization etc...) TN wait the DAD NS sent from NUT <=== Judgement #1: DAD NS ======= name: DADNS_from_NUT <=== Judgement #2: RS =========== name: RS_from_NUT, RS_from_NUT_wSLL ==== Action #1: RA =============> name: RA_GA0 <=== Judgement #3: DAD NS ======= name: DADNS_from_NUT_GA0Tgt Wait for DupAddrDetectTransmits*RetransTimer Check if NUT's address is configured ==== Action #2: DAD NS =========> name: DADNS_from_TN_GA0Tgt <=== Judgement #4: DAD NA ======= name: DADNA_from_NUT_GA0Tgt, DADNA_from_NUT_GA0Tgt_woTLL Wait until 3[sec] before expiration of VLT Check if NUT's address is available ==== Action #3: DAD NS =========> name: DADNS_from_TN_GA0Tgt <=== Judgement #5: DAD NA ======= name: DADNA_from_NUT_GA0Tgt, DADNA_from_NUT_GA0Tgt_woTLL Wait until 3[sec] after expiration of VLT ==== Action #4: DAD NS =========> name: DADNS_from_TN_GA0Tgt X <== Judgement #6: DAD NA ======= name: DADNA_from_NUT_GA0Tgt, DADNA_from_NUT_GA0Tgt_woTLL =back 1 =head1 JUDGEMENT =over 1 =item Test for Global Unicast address autoconfiguration B B Judgement #1. NUT MUST 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 Judgement #2. NUT SHOULD transmit RS. name: RS_from_NUT src: NUT's Link-local dst: allrouter Action #1. TN transmits RA which contains Global Prefix. name: RA_GA0 src: TN's Link-local dst: allnode PXOPT: Global0 Judgement #3. NUT MUST transmit DAD NS for its autoconfigured Global address. (* If the address is consisits of EUI64, as same as Link-local address, This DAD MAY be omitted.) name: DADNS_from_NUT_GA0Tgt src: ::0 dst: solnode[NUT's tentative Global0] TargetAddress: NUT's tentative Global0 Action #2. TN transmits DAD NS to check if NUT's address is configured. name: DADNS_from_TN_GA0Tgt src: ::0 dst: solnode[NUT's Global0] TargetAddress: NUT's Global0 Judgement #4. NUT MUST transmit DAD NA for its autoconfigured Global address. name: DADNA_from_NUT_GA0Tgt, DADNA_from_NUT_GA0Tgt_woTLL src: NUT's Link-local dst: allnode TargetAddress: NUT's Global0 RFlag: 0 SFlag: 0 OFlag: 1 TLLOPT: NUT's MAC address (* TLLOPT may be omitted) Action #3. TN transmits DAD NS to check if NUT's address is configured. (3 [sec] before expiration) name: DADNS_from_TN_GA0Tgt src: ::0 dst: solnode[NUT's Global0] TargetAddress: NUT's Global0 Judgement #5. NUT MUST transmit DAD NA for its autoconfigured Global address. name: DADNA_from_NUT_GA0Tgt, DADNA_from_NUT_GA0Tgt_woTLL src: NUT's Link-local dst: allnode TargetAddress: NUT's Global0 RFlag: 0 SFlag: 0 OFlag: 1 TLLOPT: NUT's MAC address (* TLLOPT may be omitted) Action #4. TN transmits DAD NS to check if NUT's address is configured. (3 [sec] after expiration) name: DADNS_from_TN_GA0Tgt src: ::0 dst: solnode[NUT's Global0] TargetAddress: NUT's Global0 Judgement #6. NUT MUST NOT transmit DAD NA for its autoconfigured Global address. name: DADNA_from_NUT_GA0Tgt, DADNA_from_NUT_GA0Tgt_woTLL src: NUT's Link-local dst: allnode TargetAddress: NUT's Global0 RFlag: 0 SFlag: 0 OFlag: 1 TLLOPT: NUT's MAC address (* TLLOPT may be omitted) =back 1 =head1 SEE ALSO =begin html
 detail of v6eval tool option: see perldoc V6evalTool.pm, perldoc V6evalRemote.pm
=end html =cut