#!/usr/bin/perl
#
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 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/hostRecvRedirect4RouterLifetime02.seq,v 1.17 2002/02/27 06:11:41 masaxmasa Exp $
########################################################################
BEGIN { $V6evalTool::TestVersion = '$Name: REL_2_1_2 $ '; }
use V6evalTool;
use nd;
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_stale=$nd::REACHABLE_TIME * $nd::MAX_RANDOM_FACTOR;
$wait_nonce=$nd::DELAY_FIRST_PROBE_TIME +
($nd::RETRANS_TIMER * $nd::MAX_UNICAST_SOLICIT) + 1;
$exit_rtn=$V6evalTool::exitPass;
#
#
#
$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 B
State: NONCE (for R1, TN)
==== unsolicited RA ===> src=R1'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 R1), NONCE (for TN)
==== solicited NA ===> src=R1's link-local dst=NUT's link-local R=1, S=1, O=1 target=R1's link-local TLLA=R1's LLA
State: REACHABLE (for R1), NONCE (for TN)
Wait (3 sec) for DAD NS
TN NUT ----------------------=end html =head1 JUDGMENT =for html 1. NUT must throw echo-reply whose destination is off-link global to the default router (i.e. R1). =for html 2. NUT must throw echo-reply whose destination is off-link global to the better router (i.e. TN). =for html =head1 TERMINATION Send RA with RouterLifetime=0 to clear the Default Router List. XXX Clear IPv6 routes by remote command. XXX =head1 NOTE =begin html
State: REACHABLE (for R1), NONCE (for TN)
==== echo-request ===> src=H1(off-link global), prefix=3ffe:501:ffff:109::/64, but LLA is R1's one dst=NUT's global, prefix=3ffe:501:ffff:100::/64
<=== Judgment #1: echo-reply ==== src=NUT's global, prefix=3ffe:501:ffff:100::/64 dst=H1(off-link global), prefix=3ffe:501:ffff:109::/64, but LLA is R1's one
==== redirect ===> src=R1's link-local dst=NUT's link-local icmp target=TN's link-local icmp destination=H1's global w/ TLLA w/o Redirected header
State: REACHABLE (for R1), STALE (for TN)
==== unsolicited RA ===> src=TN's link-local dst=all-node M=0, O=0 RouterLifetime=0 ReachableTime=0 RetransTimer=0 w/ SLLA
==== echo-request ===> src=H1(off-link global), prefix=3ffe:501:ffff:109::/64, but LLA is R1's one dst=NUT's global, prefix=3ffe:501:ffff:100::/64
CASE 1: Redirected entries are flushed by RA w/ RouterLifetime=0 ********************************************************************
<=== Judgment #1: echo-reply ==== src=NUT's global, prefix=3ffe:501:ffff:100::/64 dst=H1(off-link global), prefix=3ffe:501:ffff:109::/64, but LLA is R1's one
State: REACHABLE (for R1), STALE (for TN)
********************************************************************
CASE 2: Redirected entries are flushed by not RA w/ RouterLifetime=0, but Neighbor Unreachability Detection. ********************************************************************
<=== Judgment #2: echo-reply ==== src=NUT's global, prefix=3ffe:501:ffff:100::/64 dst=H1(off-link global), prefix=3ffe:501:ffff:109::/64, but LLA is TN's one
State: REACHABLE (for R1), DELAY (for TN)
Wait (5 sec)
State: REACHABLE (for R1), PROBE (for TN)
<=== NS ==== src=NUT's link-local dst=TN's link-local target=TN's link-local
<=== NS ==== src=NUT's link-local dst=TN's link-local target=TN's link-local
<=== NS ==== src=NUT's link-local dst=TN's link-local target=TN's link-local
State: REACHABLE (for R1), NONCE (for TN)
==== echo-request ===> src=H1(off-link global), prefix=3ffe:501:ffff:109::/64, but LLA is R1's one dst=NUT's global, prefix=3ffe:501:ffff:100::/64
<=== Judgment #1: echo-reply ==== src=NUT's global, prefix=3ffe:501:ffff:100::/64 dst=H1(off-link global), prefix=3ffe:501:ffff:109::/64, but LLA is R1's one
********************************************************************
1. It is not fail that NUT does not flush the redirected entries
with RA w/ RouterLifetime=0. Because RFC2461 does not mention
the case where a router's address is not present in NUT's
Default Router List and received Router Lifetime value is zero:
6.3.4. Processing Received Router Advertisements
On receipt of a valid Router Advertisement, a host extracts the
source address of the packet and does the following:
- If the address is not already present in the host's Default
Router List, and the advertisement's Router Lifetime is non-
zero, create a new entry in the list, and initialize its
invalidation timer value from the advertisement's Router
Lifetime field.
- If the address is already present in the host's Default Router
List as a result of a previously-received advertisement, reset
its invalidation timer to the Router Lifetime value in the
newly-received advertisement.
- 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 as specified in Section 6.3.5.
If NUT is so, the test verify if NUT's NUD can flush the redirected
entries or not. However, if NUT's Reachable Time is long, the redirected
entries will remain for a while. This is why the test judges NUT
WARN in stead of FAIL in the case.
2. The test invokes the following command:
- Clear IPv6 routes
=end html
=head1 SEE ALSO
perldoc V6evalTool
perldoc V6evalRemote
=cut