#!/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: DADSendNS_DADPostSendNS.seq,v 1.1.1.1 2000/09/28 00:15:55 sekiya Exp $ ######################################################################## BEGIN { $V6evalTool::TestVersion = '$Name: $ '; } use V6evalTool; use DAD; #----- get sequence arguments $howto_initNUT="none"; 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 seqConfAddrNUT($IF); #----- wait a DAD NS coming 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."); if ($DAD::DupAddrDetectTransmits == 0) { vLog("But DupAddrDetectTransmits == 0"); seqNG(); }elsif($DAD::addr_cast_type ne "unicast" ){ #-- anycast or multicast vLog("But the configured address type is '$DAD::addr_cast_type'."); seqNG(); }else{ seqOK(); } } #----- if timeout if( $ret{status} == 1 ) { #timeout vLog("TN received no DAD NS sends from NUT. It seems that NUT doesn't perform DAD process."); #----- check if NUT's address is configured #seqWaitNUTbeReady(); vSleep($DAD::RetransTimerSec); if (seqCheckNUTAddrConfigured($IF) eq TRUE) { vLog('Without DAD, NUT assigned the address to the interface.'); if ($DAD::DupAddrDetectTransmits == 0) { vLog("So DupAddrDetectTransmits == 0"); seqOK(); }elsif($DAD::addr_cast_type ne "unicast" ){ #-- anycast or multicast vLog("So the configured address type is '$DAD::addr_cast_type'."); seqOK(); }else{ seqNG(); } }else{ vLog("NUT's interface is down or in strange state."); seqNG(); } } #----- error if( $ret{status} != 0 ) { seqERROR(vErrmsg(%ret)); #exit } #end ######################################################################## __END__ =head1 NAME DADSendNS_DADPostSendNS - check if NUT performs DAD process =head1 TARGET Host and Router =head1 SYNOPSIS DADSendNS_DADPostSendNS.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 =over 1 =item Test for Unicast address configuration The following tests are prepared in this test package. See INDEX file. B DAD is performed on NUT by Stateless Link-local address autoconfiguration DAD is performed on NUT by Manual Link-local address configuration DAD is performed on NUT by Manual Global address configuration B DAD is performed on NUT by Stateless Global address autoconfiguration DAD is performed on NUT by Stateless Global address autoconfiguration after DAD Failed for Link-local address autoconfiguration B TN(or X) NUT ------------------------------ Initialize NUT (see ...) Configure address of NUT (boot or manual or ra, see ...) TN wait the DAD NS sends from NUT <=== Judgement #1: DAD NS ==== name: dadns_from_NUT =item Test for Anycast address configuration The following test is prepared in this test package. See INDEX file. B DAD is not performed on NUT by Manual Link-local Anycast address configuration DAD is not performed on NUT by Manual Global Anycast address configuration B TN(or X) NUT ---------------------- Initialize NUT (see ...) Configure address of NUT (boot or manual or ra, see ...) TN wait the DAD NS sends from NUT <=== Judgement #1: DAD NS does not come==== name: dadns_from_NUT Wait for NUT to finish DAD. (sleep $RetransTimerSec [sec]) Check if NUT's address is configured ==== Action #1: DAD NS ====> name: chkconf_dadns_to_NUT <=== Judgement #2: DAD NA ==== name: chkconf_dadna_from_NUT (or chkconf_dadna_from_NUT_rf1 if NUT is a Router) =back 1 =head1 JUDGEMENT =over 1 =item Test for Unicast address configuration B B< DAD is performed on NUT by Stateless Link-local address autoconfiguration -pkt LLOCAL.def addrconf=boot init=none> Judgement #1. DAD NS must come from NUT on Link-local address autoconfiguration. name: dadns_from_NUT src: ::0 dst: solnode[NUT's tentative Link-local] TargetAddress: NUT's tentative Link-local B< DAD is performed on NUT by Manual Link-local address configuration -pkt LLOCAL0A0N.def addrconf=manual+_LLOCAL0A0N_UCAST init=DADSuccess_boot> Judgement #1. DAD NS must come from NUT on Manual Link-local address configuration. name: dadns_from_NUT src: ::0 dst: solnode[NUT's tentative _LLOCAL0A0N_UCAST_ADDR] TargetAddress: NUT's tentative _LLOCAL0A0N_UCAST_ADDR B< DAD is performed on NUT by Manual Global address configuration -pkt GLOBAL0A0N.def addrconf=manual+_GLOBAL0A0N_UCAST init=DADSuccess_boot> Judgement #1. DAD NS must come from NUT on Manual Global address configuration. name: dadns_from_NUT src: ::0 dst: solnode[NUT's tentative _GLOBAL0A0N_UCAST_ADDR] TargetAddress: NUT's tentative _GLOBAL0A0N_UCAST_ADDR B B< DAD is performed on NUT by Stateless Global address autoconfiguration -pkt GLOBAL0_valRA.def addrconf=ra init=DADSuccess_boot> Judgement #1. DAD NS should come from NUT on Global address autoconfiguration. 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 B< DAD is performed on NUT by Stateless Global address autoconfiguration after DAD Failed for Link-local address autoconfiguration -pkt GLOBAL0_valRA_NoLLOCAL.def addrconf=ra init=DADFail_boot> Judgement #1. DAD NS must come from NUT on Global address autoconfiguration after DAD Failed for Link-local address autoconfiguration 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 =item Test for Anycast address configuration B B< DAD is not performed on NUT by Manual Link-local Anycast address configuration -pkt LLOCAL0A0N_ACAST.def addrconf=manual+_LLOCAL0A0N_ACAST init=DADSuccess_boot> Judgement #1. DAD NS must not come from NUT on Anycast address configuration name: dadns_from_NUT src: ::0 dst: solnode[NUT's tentative _LLOCAL0A0N_ACAST_ADDR] TargetAddress: NUT's tentative _LLOCAL0A0N_ACAST_ADDR Action #2. Send DAD NS to check if NUT's address is configured name: chkconf_dadns_to_NUT src: ::0 dst: solnode[NUT's _LLOCAL0A0N_ACAST_ADDR] TargetAddress: NUT's _LLOCAL0A0N_ACAST_ADDR Judgement #2. DAD NA must come from NUT for Anycast address name: chkconf_dadna_from_NUT (or chkconf_dadna_from_NUT_rf1 if NUT is a Router) src: NUT's Link-local address dst: allnodes multicast TargetAddress: NUT's _LLOCAL0A0N_ACAST_ADDR OFlag: 0 ( it should be 0 in NA of TargetAddress is an Anycast address ) RFlag: 0 ( if NUT is a Router then 1) B< DAD is not performed on NUT by Manual Global Anycast address configuration -pkt GLOBAL0A0N_ACAST.def addrconf=manual+_GLOBAL0A0N_ACAST init=DADSuccess_boot> Judgement #1. DAD NS must not come from NUT on Anycast address configuration name: dadns_from_NUT src: ::0 dst: solnode[NUT's tentative _GLOBAL0A0N_ACAST_ADDR] TargetAddress: NUT's tentative _GLOBAL0A0N_ACAST_ADDR Action #2. Send DAD NS to check if NUT's address is configured name: chkconf_dadns_to_NUT src: ::0 dst: solnode[NUT's _GLOBAL0A0N_ACAST_ADDR] TargetAddress: NUT's _GLOBAL0A0N_ACAST_ADDR Judgement #2. DAD NA must come from NUT for Anycast address name: chkconf_dadna_from_NUT (or chkconf_dadna_from_NUT_rf1 if NUT is a Router) src: NUT's Link-local address dst: allnodes multicast TargetAddress: NUT's _GLOBAL0A0N_ACAST_ADDR OFlag: 0 ( it should be 0 in NA of TargetAddress is an Anycast address ) RFlag: 0 ( if NUT is a Router then 1) =back 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