#!/usr/bin/perl
#
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
# Yokogawa Electric 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.
#
# $TAHI: ct/nd.p2/V6LC_2_1_21_H.seq,v 1.2 2008/02/07 10:45:44 akisada Exp $
#
########################################################################
use nd;
BEGIN {}
END {}
if($V6evalTool::NutDef{'Type'} ne 'host') {
exitHostOnly();
#NOTREACHED
}
startNdiscWorld($Link0);
vLogHTML('Procedure
');
step1($Link0);
$tr1_cache = 1;
if(ndiscStale2ReachableByPacketForwarding1($Link0) < 0) {
exitFail();
#NOTREACHED
}
if(ndSendNaReachable2ReachableFalse($Link0, 'local_ucast_na_rSo_tll') < 0) {
exitFail();
#NOTREACHED
}
exitPass();
#NOTREACHED
#------------------------------#
# setupCommon11() #
#------------------------------#
sub
step1($)
{
my ($Link) = @_;
$NEED_COMMON_CLEANUP = 1;
my $ra = 'mcast_ra_commonsetup';
vClear($Link);
vSend($Link, $ra);
ignoreDAD($Link);
$force_cleanup_r0 = 1;
return;
}
#
# perldoc
#
########################################################################
__END__
=head1 NAME
=begin html
V6LC_2_1_21_A - NA Processing, R-bit Change (unicast NA (S=1&O=1) w/o TLL) =end html =begin html=end html =head1 TARGET =begin html
Host=end html =head1 TOPOLOGY =begin html
=end html =head1 SETUP =begin htmlTN1 | ----+-------+--- Link1 | TR1 NUT | | ----+-------+--- Link0
Link0 global 3ffe:501:ffff:100::/64 link-local fe80::/64 Link1 global 3ffe:501:ffff:101::/64 link-local fe80::/64 TN1
(Link1)global 3ffe:501:ffff:101:200:ff:fe00:a0a0 TR1
(Link0)global 3ffe:501:ffff:100::<TnDef.Link0_addr> link-local fe80::<TnDef.Link0_addr> ether <TnDef.Link0_addr> NUT
(Link0)global 3ffe:501:ffff:100::<NutDef.Link0_addr> link-local fe80::<NutDef.Link0_addr> ether <NutDef.Link0_addr>
=end html =head1 TEST PROCEDURE =begin htmlnone
- Verify that NUT updates IsRouter=end html =head1 JUDGEMENT =begin html
- Verify that NUT assumes TN1 is on-link
- Verify that NUT transmits valid NSs in INCOMPLETE state
TN1 TR1 NUT | | | | | --> | RA | | | | * | Wait (MAX_RTR_SOLICITATION_DELAY + RetransTimer * DupAddrDetectTransmits) | | | | ------------> | Echo Request | | <-- | NS (multicast) [Judgment #1] | | ----> | NA (unicast) | <------------ | Echo Reply | | | | | ----> | NA (unicast) | ------------> | Echo Request [Judgment #2] | | | | | * Observe packets [Judgment #3] | | | V V V
State: NONE (TR1) (link-local)1. Send RAIPv6 header hop limit = 255 source = TR1 (link-local) destination = all-nodes multicast address RA cur hop limit = 64 M = 0 O = 0 router lifetime = 1800 reachable time = 0 retrans timer = 0 SLL option Prefix Information option prefix length = 64 L = 1 A = 1 valid Lifetime = 2592000 preferred lifetime = 604800 prefix = 3ffe:501:ffff:100::2. Wait (MAX_RTR_SOLICITATION_DELAY + RetransTimer * DupAddrDetectTransmits)Host constants: MAX_RTR_SOLICITATION_DELAY: 1 secondNode constants: RETRANS_TIMER : 1,000 millisecondsHost Variables: RetransTimer Default : RETRANS_TIMER millisecondsNode Variables: DupAddrDetectTransmits Default : 1State: STALE (TR1) (link-local)3. Send Echo RequestIPv6 header source = TN1 (global) destination = NUT (global) Echo Request4. Observe NS [Judgment #1]IPv6 header hop limit = 255 source = NUT (link-local) destination = TR1 (link-local) NS target = TR1 (link-local) SLL option5. Send NAIPv6 header hop limit = 255 source = TR1 (link-local) destination = NUT (link-local) NA R = 1 S = 1 O = 1 target = TR1 (link-local) TLL optionState: REACHABLE (TR1) (link-local) State: NONE (TN1) (link-local)6. Observe Echo Reply [Judgment #2]IPv6 header source = NUT (global) destination = TN1 (global) Echo Reply7. Send NAIPv6 header hop limit = 255 source = TR1 (link-local) destination = NUT (link-local) NA R = 0 S = 1 O = 1 target = TR1 (link-local)8. Send Echo RequestIPv6 header source = TN1 (global) destination = NUT (global) Echo RequestState: REACHABLE (TR1) (link-local) State: INCOMPLETE (TN1) (link-local)9. Observe MAX_MULTICAST_SOLICIT NSs [Judgment #3]IPv6 header hop limit = 255 source = NUT (link-local) destination = TR1 (solicited-node multicast address) NS target = TR1 (link-local) SLL optionNode constants: MAX_MULTICAST_SOLICIT: 3 transmissionsState: REACHABLE (TR1) (link-local) State: NONE (TN1) (link-local)
=end html =head1 CLEANUP =begin html[Judgment #1] NUT must transmit NS to T$1 [Judgment #2] NUT must transmit Echo Reply to TN1 [Judgment #3] NUT must not transmit NS to TR1 and transmit Echo Reply to TN1
Index NA Previous New Source Addr Destination Addr R S O TLL option State Cached LLA IsRouter State Cached LLA IsRouter v6LC_2_1_21_A unicast unicast 0 1 1 none REACHABLE exist true REACHABLE unchanged false v6LC_2_1_21_B unicast unicast 0 0 0 none REACHABLE exist true REACHABLE unchanged false v6LC_2_1_21_C unicast unicast 0 0 1 none REACHABLE exist true REACHABLE unchanged false v6LC_2_1_21_D unicast unicast 0 1 0 none REACHABLE exist true REACHABLE unchanged false
- Remove global address=end html =cut # =head1 REFERENCE # # =begin html #
- Clear default router
- Set neighbor cache state for TR1 to NONE
TR1 NUT | | | ----> | RA (rltime=0, vltime=0, pltime=0) | | | ----> | NS (unicast) (different cached address) | <---- | NA | | * | Wait (DELAY_FIRST_PROBE_TIME) | | | <---- | NS (unicast) | <---- | NS (unicast) | <---- | NS (unicast) | | V V
State: REACHABLE (TR1) (link-local)1. Send RAIPv6 header hop limit = 255 source = TR1 (link-local) destination = all-nodes multicast address RA cur hop limit = 64 M = 0 O = 0 router lifetime = 0 reachable time = 0 retrans timer = 0 Prefix Information option prefix length = 64 L = 1 A = 1 valid Lifetime = 0 preferred lifetime = 0 prefix = 3ffe:501:ffff:100::2. Send NSIPv6 header hop limit = 255 source = TR1 (link-local) destination = NUT (link-local) NS target = NUT (link-local) SLL option address = TN1 (ether)State: STALE (TR1) (link-local)3. Observe NAIPv6 header source = NUT (link-local) destination = TR1 (link-local) NA R = 0 S = 1 O = 1 target = NUT (link-local) TLL optionState: DELAY (TR1) (link-local)4. Wait (DELAY_FIRST_PROBE_TIME)Node constants: DELAY_FIRST_PROBE_TIME: 5 secondsState: PROBE (TR1) (link-local)5. Observe MAX_UNICAST_SOLICIT NSsIPv6 header hop limit = 255 source = NUT (link-local) destination = TR1 (link-local) NS target = TR1 (link-local) SLL optionNode constants: MAX_UNICAST_SOLICIT: 3 transmissionsState: NONE (TR1) (link-local)
# RFC2461 Neighbor Discovery for IPv6 ## # =end html # =pod =head1 REFERENCE =begin html
## 7.2.5. Receipt of Neighbor Advertisements ### If the target's Neighbor Cache entry is in any state other than # INCOMPLETE when the advertisement is received, processing becomes # quite a bit more complex. If the Override flag is clear and the # supplied link-layer address differs from that in the cache, then one # of two actions takes place: if the state of the entry is REACHABLE, # set it to STALE, but do not update the entry in any other way; # otherwise, the received advertisement should be ignored and MUST NOT # update the cache. If the Override flag is set, both the Override # flag is clear and the supplied link-layer address is the same as that # in the cache, or no Target Link-layer address option was supplied, # the received advertisement MUST update the Neighbor Cache entry as # follows: ### - The link-layer address in the Target Link-Layer Address option # MUST be inserted in the cache (if one is supplied and is different # than the already recorded address). ### - If the Solicited flag is set, the state of the entry MUST be set # to REACHABLE. If the Solicited flag is zero and the link-layer # address was updated with a different address the state MUST be set # to STALE. Otherwise, the entry's state remains unchanged. ### An advertisement's Solicited flag should only be set if the # advertisement is a response to a Neighbor Solicitation. Because # Neighbor Unreachability Detection Solicitations are sent to the # cached link-layer address, receipt of a solicited advertisement # indicates that the forward path is working. Receipt of an # unsolicited advertisement, however, suggests that a neighbor has # urgent information to announce (e.g., a changed link-layer # address). If the urgent information indicates a change from what # a node is currently using, the node should verify the reachability # of the (new) path when it sends the next packet. There is no need # to update the state for unsolicited advertisements that do not # change the contents of the cache. ### - The IsRouter flag in the cache entry MUST be set based on the # Router flag in the received advertisement. In those cases where # the IsRouter flag changes from TRUE to FALSE as a result of this # update, the node MUST remove that router from the Default Router # List and update the Destination Cache entries for all destinations # using that neighbor as a router as specified in Section 7.3.3. # This is needed to detect when a node that is used as a router # stops forwarding packets due to being configured as a host. ### The above rules ensure that the cache is updated either when the # Neighbor Advertisement takes precedence (i.e., the Override flag is # set) or when the Neighbor Advertisement refers to the same link-layer # address that is currently recorded in the cache. If none of the # above apply, the advertisement prompts future Neighbor Unreachability # Detection (if it is not already in progress) by changing the state in # the cache entry. ##
=end html =cutRFC 2461 - Neighbor Discovery for IPv6