#!/usr/bin/perl # # Copyright (C) 1999,2000 Yokogawa Electric Corporation and # YDC Corporation. # All rights reserved. # # Redistribution and use of this software in source and binary # forms, with or without modification, are permitted provided that # the following conditions and disclaimer are agreed and accepted # by the user: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in # the documentation and/or other materials provided with # the distribution. # # 3. Neither the names of the copyrighters, the name of the project # which is related to this software (hereinafter referred to as # "project") nor the names of the contributors may be used to # endorse or promote products derived from this software without # specific prior written permission. # # 4. No merchantable use may be permitted without prior written # notification to the copyrighters. # # 5. The copyrighters, the project and the contributors may prohibit # the use of this software at any time. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHTERS, THE PROJECT AND # CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING # BUT NOT LIMITED THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS # FOR A PARTICULAR PURPOSE, ARE DISCLAIMED. IN NO EVENT SHALL THE # COPYRIGHTERS, THE PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # # $Id: ADDRCONFFail.seq,v 1.1.1.1 2000/10/31 22:39:53 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); $term_handler = \&termination; # set termination handler #----- 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 vLog("Configure Address by strange RA."); seqConfAddrNUT($IF); #----- wait a DAD NS comming from NUT %ret=seqWaitDADNSfromNUT($IF); #----- 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) { seqNG(); }else{ seqOK(); } ### termination sequence after vLog OK,NG ### set as $term_handler=\&termination; sub termination() { my ($total_waitsec, $vlt_index, $ret); my (@vltlist) = (0,60); vLog("*** Target termination phase ***"); #seqWaitNUTbeReady("NOSTOP"); ## wait for address lifetime expiry vLog("Wait for NUT's address Lifetime expiry."); ($total_waitsec, $vlt_index) = seqProbeVLT($IF, 10, @vltlist); if ($vlt_index < 0) { vLog("NUT's address Lifetime does not expire."); vLog("Remote boot NUT. "); $rret=vRemote("reboot.rmt","","timeout=300"); vLog("reboot.rmt returned status $rret") if $rret > 0; }else{ vLog("NUT's address Lifetime expired: total_waitsec=$total_waitsec [sec]"); } } #end ######################################################################## __END__ =head1 NAME ADDRCONFFail - check if address is not configured =head1 TARGET Host and Router =head1 SYNOPSIS ADDRCONFFail.seq [-tooloption ...] -pkt [addrconf=] [init=,...] [sd=] -tooloption : v6eval tool option : packet definition file (v6eval tool option) : how to configure address on NUT; boot/manual+/ra : 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 tests are prepared in this test package. See INDEX file. B Global address is not configured when NUT received Valid RA after Link-local DAD Fail NUT ignores prefixopt if PreferredLifeTime > ValidLifeTime NUT ignores prefixopt if Prefixlen > 64 (interface ID len is 64) NUT ignores prefixopt if Prefixlen < 64 (interface ID len is 64) NUT ignores prefixopt if A flag is 0 NUT ignores prefixopt if prefix is Link-local NUT ignores prefixopt if Prefixlen > 128 NUT ignores prefixopt if ValidLifeTime is 0 (unknown prefix) B TN(or X) NUT ------------------------------ Initialize NUT (see ...) Send Unsolicited RA to configure address of NUT (sequence parameter addrconf=ra) ==== Action #1: Unsolicited RA ===> name: usolra TN wait the DAD NS sends from NUT. (This judgment is informational only.) <=== Judgement #1: DAD NS ==== name: dadns_from_NUT Wait for NUT to finish DAD. (sleep $RetransTimerSec [sec]) Check if NUT's address is not configured. ==== Action #2: DAD NS ====> name: chkconf_dadns_to_NUT DAD NA does not come because NUT's address is not configured. <=== Judgement #2: DAD NA does not come==== name: chkconf_dadna_from_NUT (or chkconf_dadna_from_NUT_rf1 if NUT is a Router) =head1 JUDGEMENT B B B< -pkt GLOBAL0_valRA_NoLLOCAL.def addrconf=ra init=DADFail_boot> Initialize NUT. reboot NUT and force to detect address duplication on stateless Link-local address autoconfiguration. Action #1. Send valid Unsolicited RA to configure address of NUT name: usolra src: TN's Link-local address dst: allnodes multicast SLL option exists Prefix option PrefixLength: _GLOBAL0_UCAST_PRFXLEN (64) LFlag: 1 AFlag: 1 ValidLifetime: 10000 PreferredLifetime: 10000 Prefix: _GLOBAL0_UCAST_PRFX Judgement #1. DAD NS may come from NUT on Global address autoconfiguration. (This judgement is informational only.) name: dadns_from_NUT src: ::0 dst: solnode[NUT's tentative _GLOBAL0_UCAST_PRFX + interface-id] TargetAddress: NUT's tentative _GLOBAL0_UCAST_PRFX + interface-id Action #2. Send DAD NS to check if NUT's address is not configured name: chkconf_dadns_to_NUT src: ::0 dst: solnode[NUT's _GLOBAL0_UCAST_PRFX + interface-id] TargetAddress: NUT's _GLOBAL0_UCAST_PRFX + interface-id Judgement #2. DAD NA does not come from NUT because NUT's address is not configured. name: chkconf_dadna_from_NUT (or chkconf_dadna_from_NUT_rf1 if NUT is a Router) src: NUT's Link-local address or _GLOBAL0_UCAST_PRFX + interface-id dst: allnodes multicast TargetAddress: NUT's _GLOBAL0_UCAST_PRFX + interface-id OFlag: 1 RFlag: 0 ( if NUT is a Router then 1) B ValidLifeTime> B< -pkt GLOBAL0_irregRA_prfxopt_ignore_PLTgtVLT.def addrconf=ra init=DADSuccess_boot> Action #1. Send irregular Unsolicited RA to configure address of NUT name: usolra src: TN's Link-local address dst: allnodes multicast SLL option exists Prefix option PrefixLength: _GLOBAL0_UCAST_PRFXLEN (64) LFlag: 1 AFlag: 1 ValidLifetime: 10000 PreferredLifetime: 10001 (irregular, VLTime >= PLTime is regular) Prefix: _GLOBAL0_UCAST_PRFX Judgement #1. DAD NS should come from NUT on Global address autoconfiguration. (This judgement is informational only.) name: dadns_from_NUT src: ::0 dst: solnode[NUT's tentative _GLOBAL0_UCAST_PRFX + interface-id] TargetAddress: NUT's tentative _GLOBAL0_UCAST_PRFX + interface-id Action #2. Send DAD NS to check if NUT's address is not configured name: chkconf_dadns_to_NUT src: ::0 dst: solnode[NUT's _GLOBAL0_UCAST_PRFX + interface-id] TargetAddress: NUT's _GLOBAL0_UCAST_PRFX + interface-id Judgement #2. DAD NA doesnot come from NUT because NUT's address is not configured. name: chkconf_dadna_from_NUT (or chkconf_dadna_from_NUT_rf1 if NUT is a Router) src: NUT's Link-local address or _GLOBAL0_UCAST_PRFX + interface-id dst: allnodes multicast TargetAddress: NUT's _GLOBAL0_UCAST_PRFX + interface-id OFlag: 1 RFlag: 0 ( if NUT is a Router then 1) B 64 (interface ID len is 64)> B< -pkt GLOBAL0_irregRA_prfxopt_ignore_PRFXLENgt64.def addrconf=ra init=DADSuccess_boot> Action #1. Send irregular Unsolicited RA to configure address of NUT name: usolra src: TN's Link-local address dst: allnodes multicast SLL option exists Prefix option PrefixLength: 65 (irregular, 64 is regular) LFlag: 1 AFlag: 1 ValidLifetime: 10000 PreferredLifetime: 10000 Prefix: _GLOBAL0_UCAST_PRFX Judgement #1. DAD NS should come from NUT on Global address autoconfiguration. (This judgement is informational only.) name: dadns_from_NUT src: ::0 dst: solnode[NUT's tentative _GLOBAL0_UCAST_PRFX + interface-id] TargetAddress: NUT's tentative _GLOBAL0_UCAST_PRFX + interface-id Action #2. Send DAD NS to check if NUT's address is not configured name: chkconf_dadns_to_NUT src: ::0 dst: solnode[NUT's _GLOBAL0_UCAST_PRFX + interface-id] TargetAddress: NUT's _GLOBAL0_UCAST_PRFX + interface-id Judgement #2. DAD NA doesnot come from NUT because NUT's address is not configured. name: chkconf_dadna_from_NUT (or chkconf_dadna_from_NUT_rf1 if NUT is a Router) src: NUT's Link-local address or _GLOBAL0_UCAST_PRFX + interface-id dst: allnodes multicast TargetAddress: NUT's _GLOBAL0_UCAST_PRFX + interface-id OFlag: 1 RFlag: 0 ( if NUT is a Router then 1) B 64 (interface ID len is 64)> B< -pkt GLOBAL0_irregRA_prfxopt_ignore_PRFXLENlt64.def addrconf=ra init=DADSuccess_boot> Action #1. Send irregular Unsolicited RA to configure address of NUT name: usolra src: TN's Link-local address dst: allnodes multicast SLL option exists Prefix option PrefixLength: 63 (irregular, 64 is regular) LFlag: 1 AFlag: 1 ValidLifetime: 10000 PreferredLifetime: 10000 Prefix: _GLOBAL0_UCAST_PRFX Judgement #1. DAD NS should come from NUT on Global address autoconfiguration. (This judgement is informational only.) name: dadns_from_NUT src: ::0 dst: solnode[NUT's tentative _GLOBAL0_UCAST_PRFX + interface-id] TargetAddress: NUT's tentative _GLOBAL0_UCAST_PRFX + interface-id Action #2. Send DAD NS to check if NUT's address is not configured name: chkconf_dadns_to_NUT src: ::0 dst: solnode[NUT's _GLOBAL0_UCAST_PRFX + interface-id] TargetAddress: NUT's _GLOBAL0_UCAST_PRFX + interface-id Judgement #2. DAD NA doesnot come from NUT because NUT's address is not configured. name: chkconf_dadna_from_NUT (or chkconf_dadna_from_NUT_rf1 if NUT is a Router) src: NUT's Link-local address or _GLOBAL0_UCAST_PRFX + interface-id dst: allnodes multicast TargetAddress: NUT's _GLOBAL0_UCAST_PRFX + interface-id OFlag: 1 RFlag: 0 ( if NUT is a Router then 1) B B< -pkt GLOBAL0_irregRA_prfxopt_ignore_af0.def addrconf=ra init=DADSuccess_boot> Action #1. Send irregular Unsolicited RA to configure address of NUT name: usolra src: TN's Link-local address dst: allnodes multicast SLL option exists Prefix option PrefixLength: _GLOBAL0_UCAST_PRFXLEN (64) LFlag: 1 AFlag: 0 (irregular, 1 is regular) ValidLifetime: 10000 PreferredLifetime: 10000 Prefix: _GLOBAL0_UCAST_PRFX Judgement #1. DAD NS should come from NUT on Global address autoconfiguration. (This judgement is informational only.) name: dadns_from_NUT src: ::0 dst: solnode[NUT's tentative _GLOBAL0_UCAST_PRFX + interface-id] TargetAddress: NUT's tentative _GLOBAL0_UCAST_PRFX + interface-id Action #2. Send DAD NS to check if NUT's address is not configured name: chkconf_dadns_to_NUT src: ::0 dst: solnode[NUT's _GLOBAL0_UCAST_PRFX + interface-id] TargetAddress: NUT's _GLOBAL0_UCAST_PRFX + interface-id Judgement #2. DAD NA doesnot come from NUT because NUT's address is not configured. name: chkconf_dadna_from_NUT (or chkconf_dadna_from_NUT_rf1 if NUT is a Router) src: NUT's Link-local address or _GLOBAL0_UCAST_PRFX + interface-id dst: allnodes multicast TargetAddress: NUT's _GLOBAL0_UCAST_PRFX + interface-id OFlag: 1 RFlag: 0 ( if NUT is a Router then 1) B B< -pkt LLOCAL_irregRA_prfxopt_ignore_llocal.def addrconf=ra init=DADFail_boot> Action #1. Send irregular Unsolicited RA to configure address of NUT name: usolra src: TN's Link-local address dst: allnodes multicast SLL option exists Prefix option PrefixLength: 64 LFlag: 1 AFlag: 1 ValidLifetime: 10000 PreferredLifetime: 10000 Prefix: _LLOCAL_UCAST_PRFX (irregular, Link-local prefix is ignored) Judgement #1. DAD NS should come from NUT on Global address autoconfiguration. (This judgement is informational only.) name: dadns_from_NUT src: ::0 dst: solnode[NUT's tentative _GLOBAL0_UCAST_PRFX + interface-id] TargetAddress: NUT's tentative _GLOBAL0_UCAST_PRFX + interface-id Action #2. Send DAD NS to check if NUT's address is not configured name: chkconf_dadns_to_NUT src: ::0 dst: solnode[NUT's _GLOBAL0_UCAST_PRFX + interface-id] TargetAddress: NUT's _GLOBAL0_UCAST_PRFX + interface-id Judgement #2. DAD NA doesnot come from NUT because NUT's address is not configured. name: chkconf_dadna_from_NUT (or chkconf_dadna_from_NUT_rf1 if NUT is a Router) src: NUT's Link-local address or _GLOBAL0_UCAST_PRFX + interface-id dst: allnodes multicast TargetAddress: NUT's _GLOBAL0_UCAST_PRFX + interface-id OFlag: 1 RFlag: 0 ( if NUT is a Router then 1) B 128> B< -pkt GLOBAL0_irregRA_prfxopt_ignore_PRFXLENgt128.def addrconf=ra init=DADSuccess_boot> Action #1. Send irregular Unsolicited RA to configure address of NUT name: usolra src: TN's Link-local address dst: allnodes multicast SLL option exists Prefix option PrefixLength: 192 (irregular, 0<=PrefixLength<=128 is regular) LFlag: 1 AFlag: 1 ValidLifetime: 10000 PreferredLifetime: 10000 Prefix: _GLOBAL0_UCAST_PRFX Judgement #1. DAD NS should come from NUT on Global address autoconfiguration. (This judgement is informational only.) name: dadns_from_NUT src: ::0 dst: solnode[NUT's tentative _GLOBAL0_UCAST_PRFX + interface-id] TargetAddress: NUT's tentative _GLOBAL0_UCAST_PRFX + interface-id Action #2. Send DAD NS to check if NUT's address is not configured name: chkconf_dadns_to_NUT src: ::0 dst: solnode[NUT's _GLOBAL0_UCAST_PRFX + interface-id] TargetAddress: NUT's _GLOBAL0_UCAST_PRFX + interface-id Judgement #2. DAD NA doesnot come from NUT because NUT's address is not configured. name: chkconf_dadna_from_NUT (or chkconf_dadna_from_NUT_rf1 if NUT is a Router) src: NUT's Link-local address or _GLOBAL0_UCAST_PRFX + interface-id dst: allnodes multicast TargetAddress: NUT's _GLOBAL0_UCAST_PRFX + interface-id OFlag: 1 RFlag: 0 ( if NUT is a Router then 1) B B< -pkt GLOBAL0_irregRA_prfxopt_ignore_VLT0.def addrconf=ra init=DADSuccess_boot> Action #1. Send irregular Unsolicited RA to configure address of NUT name: usolra src: TN's Link-local address dst: allnodes multicast SLL option exists Prefix option PrefixLength: _GLOBAL0_UCAST_PRFXLEN (64) LFlag: 1 AFlag: 1 ValidLifetime: 0 (irregular, VLTime > 0 is regular) PreferredLifetime: 0 (irregular, PLTime > 0 is regular) Prefix: _GLOBAL0_UCAST_PRFX Judgement #1. DAD NS should come from NUT on Global address autoconfiguration. (This judgement is informational only.) name: dadns_from_NUT src: ::0 dst: solnode[NUT's tentative _GLOBAL0_UCAST_PRFX + interface-id] TargetAddress: NUT's tentative _GLOBAL0_UCAST_PRFX + interface-id Action #2. Send DAD NS to check if NUT's address is not configured name: chkconf_dadns_to_NUT src: ::0 dst: solnode[NUT's _GLOBAL0_UCAST_PRFX + interface-id] TargetAddress: NUT's _GLOBAL0_UCAST_PRFX + interface-id Judgement #2. DAD NA doesnot come from NUT because NUT's address is not configured. name: chkconf_dadna_from_NUT (or chkconf_dadna_from_NUT_rf1 if NUT is a Router) src: NUT's Link-local address or _GLOBAL0_UCAST_PRFX + interface-id dst: allnodes multicast TargetAddress: NUT's _GLOBAL0_UCAST_PRFX + interface-id OFlag: 1 RFlag: 0 ( if NUT is a Router then 1) =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