#!/usr/bin/perl
#
# Copyright (C) 1999, 2000, 2001, 2002, 2003 Yokogawa Electric Corporation,
# IPA (Information-technology Promotion Agency, Japan).
# 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. However, using this software for the
# purpose of testing or evaluating any products including merchantable
# products may be permitted without any notification to the copyrighters.
#
#
#
# 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.
#
# $TAHI: ct/nd/hostRecvRaRLifetimeN.seq,v 1.26 2002/02/27 01:08:25 masaxmasa Exp $
########################################################################
BEGIN { $V6evalTool::TestVersion = '$Name: REL_2_1_1 $ '; }
use V6evalTool;
use nd;
sub checkDefaultRouter($);
ndOptions(@ARGV);
# The following generate debugging messages.
$nd::debug=$ndOpt_v|$ndOpt_vv;
# You can specifies debug options to a remote control program.
# If you want to know more detail, please see the following:
# - V6evalTool.pm: perldoc V6evalTool
# - V6evalRemote.pm: perldoc V6evalRemote
$nd::remote_debug="-o1" if $ndOpt_vv;
$IF=Link0;
$wait_dad=3;
$wait_echo=2;
$wait_clear=5+2;
$wait_probe=$nd::DELAY_FIRST_PROBE_TIME +
($nd::RETRANS_TIMER * $nd::MAX_UNICAST_SOLICIT) + 1;
#
#
#
$type=$V6evalTool::NutDef{Type};
if($type eq router) {
vLogHTML("This test is for the host only
");
exit $V6evalTool::exitHostOnly;
}
$type=$V6evalTool::NutDef{Type};
if($type ne host) {
vLogHTML(ndErrmsg("ERROR: $V6evalTool::NutDef{Type}: ".
"Unknown target type
"));
exit $V6evalTool::exitFail;
}
#
#
#
vLogHTML("
TN NUT ----------------------=end html =head1 TEST PROCEDURE =begin html
State: NONCE (for all)
==== unsolicited RA ===> src=TN's link-local dst=all-node M=0, O=0 RouterLifetime=600 ReachableTime=0 RetransTimer=0 w/ SLLA Prefix Option: L=1, A=1 ValidLifetime=2592000 PreferredLifetime=604800 Prefix=3ffe:501:ffff:100::/64
State: STALE (for TN), NONCE (for Y, Z)
==== unsolicited RA ===> src=Y's link-local dst=all-node M=0, O=0 RouterLifetime=600 ReachableTime=0 RetransTimer=0 w/ SLLA Prefix Option: L=1, A=1 ValidLifetime=2592000 PreferredLifetime=604800 Prefix=3ffe:501:ffff:100::/64
State: STALE (for TN, Y), NONCE (for Z)
==== unsolicited RA ===> src=Z's link-local dst=all-node M=0, O=0 RouterLifetime=600 ReachableTime=0 RetransTimer=0 w/ SLLA Prefix Option: L=1, A=1 ValidLifetime=2592000 PreferredLifetime=604800 Prefix=3ffe:501:ffff:100::/64
State: STALE (for all)
<=== Ns for DAD ==== src=unspecified dst=solicited-node[NUT's global, prefix=3ffe:501:ffff:100::/64] target=NUT's global
Wait (3 sec)
==== solicited NA ===> src=TN's link-local dst=NUT's link-local R=1, S=1, O=1 target=TN's link-local TLLA=TN's LLA
State: REACHABLE (for TN), STALE (for Y and Z) ==== solicited NA ===> src=Y's link-local dst=NUT's link-local R=1, S=1, O=1 target=Y's link-local TLLA=X's LLA
State: REACHABLE (for TN, Y), STALE (for Z) ==== solicited NA ===> src=Z's link-local dst=NUT's link-local R=1, S=1, O=1 target=Z's link-local TLLA=Z's LLA
State: REACHABLE (for all)
TN NUT ----------------------=end html =head1 JUDGMENT =for html 1. If the address is already present in the host's Default Router List and the received Router Lifetime value is zero, immediately time-out the entry. =for html 2. Whenever the Lifetime of an entry in the Default Router List expires, that entry is discarded. When removing a router from the Default Router list, NUT must update the Destination Cache in such a way that all entries using the router perform next-hop determination again rather than continue sending traffic to the (deleted) router. =for html 3. NUT must retain at least two router addresses and should retain more. =for html 4. NUT must throw an echo-reply to the default router (NUT or Y or Z). =for html 5. NUT must throw an echo-reply to the default router (Y or Z). =for html 6. NUT must throw an echo-reply to the default router (i.e. Z). =for html 7. NUT must not throw an echo-reply to any routers. NUT may throw multicast NS for onlink determination. =head1 TERMINATION Send RAs to clear the Default Router List: - RA (src=TN) with RouterLifetime=0 - RA (src=Y) with RouterLifetime=0 - RA (src=Z) with RouterLifetime=0 =head1 NOTE The test does not invoke any remote command. =head1 SEE ALSO perldoc V6evalTool perldoc V6evalRemote =cut
State: REACHABLE (for all)
==== echo-request ===> src=off-link global, but LLA is the W's one dst=NUT's global
<=== Judgment #4: echo-reply ==== src=NUT's global dst=off-link global, but LLA is one of the routers(TN, Y, Z)
==== unsolicited RA ===> src=TN's link-local dst=all-node M=0, O=0 RouterLifetime=5 ReachableTime=0 RetransTimer=0 w/ SLLA
Wait (7 sec) for the entry of the Default Router List to be expired.
==== echo-request ===> src=off-link global, but LLA is the W's one dst=NUT's global
<=== Judgment #5: echo-reply ==== src=NUT's global dst=off-link global, but LLA is one of the routers(Y, Z)
==== unsolicited RA ===> src=Y's link-local dst=all-node M=0, O=0 RouterLifetime=5 ReachableTime=0 RetransTimer=0 w/ SLLA
Wait (7 sec) for the entry of the Default Router List to be expired.
==== echo-request ===> src=off-link global, but LLA is the W's one dst=NUT's global
<=== Judgment #6: echo-reply ==== src=NUT's global dst=off-link global, but LLA is one of the routers(Z)
==== unsolicited RA ===> src=Z's link-local dst=all-node M=0, O=0 RouterLifetime=5 ReachableTime=0 RetransTimer=0 w/ SLLA
Wait (7 sec) for the entry of the Default Router List to be expired.
==== echo-request ===> src=off-link global, but LLA is the W's one dst=NUT's global
<=== Judgment #7: multicast NS (if any) ==== src=NUT's global dst=solicited-node[off-link global] w/ SLLA