#!/usr/bin/perl # # $Copyright$ # # $Id: ADDRSTATE_sameprfxes_order.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) { # /^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); #----- 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 # stateless addrconf by RA vLog("Stateless address configuration by sending RA to NUT. (same 4 prefixes with different lifetime) "); %ret=vSend($IF, $DAD::usolra_to_NUT); $seektime_for_dadns = $ret{'sentTime1'}; #------------------------------------------------------ # Contents of RA # Prefix1 GLOBAL0 (3ffe:501:ffff:100::) # PreferredLifetime[sec] 60 # ValidLifetime[sec] 60 # Prefix2 GLOBAL0 (3ffe:501:ffff:100::) # PreferredLifetime[sec] 180 # ValidLifetime[sec] 180 # Prefix3 GLOBAL0 (3ffe:501:ffff:100::) # PreferredLifetime[sec] 120 # ValidLifetime[sec] 120 # Prefix4 GLOBAL0 (3ffe:501:ffff:100::) # PreferredLifetime[sec] 20 # ValidLifetime[sec] 20 #------------------------------------------------------ @vltlist = (60, 180, 120, 20); # this @ is for seqProbeLT(), not for sending RA #----- 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 } #----- stop test sequence if debug seqOK() if $seqdebugopt =~ /s/; #----- 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(); } ($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; $vlt_no = $vlt_index + 1; vLog("$total_waitsec [sec] spent to wait for NUT's address becomes invalid."); vLog("NUT's address is configured by Prefix No.$vlt_no (ValidLifetime=$vltlist[$vlt_index])."); vLog("But no specification are written in RFC2462 which Prefix should be used."); seqExitWARN(); #end ######################################################################## __END__ =head1 NAME ADDRSTATE_sameprfxes_order - Probe PrefixOptions processing order of same prefix in one RA =head1 TARGET Host =head1 SYNOPSIS ADDRSTATE_sameprfxes_order.seq [-tooloption ...] -pkt [init=,...] [sd=] -tooloption : v6eval tool option : packet definition file (v6eval tool option) : 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 Probe PrefixOptions processing order of same prefixes in one RA (Surprise test) B TN(or X) NUT ------------------------------ Initialize NUT (see ...) Send Unsolicited RA to configure address of NUT ==== Action #1: Unsolicited RA ===> name: usolra src: TN's Link-local address dst: allnodes multicast SLL option exists Prefix option PrefixLength: 64 LFlag: 1 AFlag: 1 ValidLifetime: 60 PreferredLifetime: 60 Prefix: _GLOBAL0_UCAST_PRFX Prefix option PrefixLength: 64 LFlag: 1 AFlag: 1 ValidLifetime: 180 PreferredLifetime: 180 Prefix: _GLOBAL0_UCAST_PRFX Prefix option PrefixLength: 64 LFlag: 1 AFlag: 1 ValidLifetime: 120 PreferredLifetime: 120 Prefix: _GLOBAL0_UCAST_PRFX Prefix option PrefixLength: 64 LFlag: 1 AFlag: 1 ValidLifetime: 20 PreferredLifetime: 20 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]) 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 #2: 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) if DAD NA doesn't come, exit the permanent loop. <=== Judgement #2: 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) } =head1 JUDGEMENT B B B< -pkt GLOBAL0_valRA_sameprfxes.def init=DADSuccess_boot> Judgement #1: TN wait the DAD NS sends from NUT. (This judgement is informational only.) Judgement #2: Check if DAD NA come from NUT (check if NUT's address configured) if DAD NA doesn't come, exit the permanent loop, and inform totoal count [sec] to wait for NUT's address be invalid. =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