#!/usr/bin/perl
#
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
# 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_5_B.seq,v 1.4 2005/06/14 06:03:15 akisada Exp $
#
########################################################################
use nd;
BEGIN {}
END {}
if($V6evalTool::NutDef{'Type'} ne 'host') {
exitHostOnly();
#NOTREACHED
}
startNdiscWorld($Link0);
vLogHTML('TEST PROCEDURE'.
'
');
#----------------------------------------------------------------------
# Send RA WITHOUT Prefix Option
#----------------------------------------------------------------------
if(setupCase5A($Link0) < 0) {
exitFatal();
#NOTREACHED
}
#----------------------------------------------------------------------
# Send LOCAL Echo Request
#----------------------------------------------------------------------
if(ndiscNone2ReachableRTest($Link0, 'ndisc_ereq_LL') < 0) {
exitFail();
#NOTREACHED
}
#----------------------------------------------------------------------
# Send RA and Wait 8 seconds
#----------------------------------------------------------------------
$pktdesc{'ra_local_default'}
= ' Send RA w/o SLL (vltime=10, pltime=10): '.
'TN (link-local) -> all-nodes multicast address';
my %vsend0 = vSend($Link0, 'ra_local_default');
vSleep(8);
#----------------------------------------------------------------------
# Send RA and Wait 8 seconds
#----------------------------------------------------------------------
my %vsend1 = vSend($Link0, 'ra_local_default');
vSleep(8);
vLogHTML('Ignore packet for DAD
');
vClear($Link0);
#----------------------------------------------------------------------
# Send Echo Request from GLOBAL to LINK-LOCAL
#----------------------------------------------------------------------
my @frames = mcastNS('ndisc_ereq_GL');
vSend($Link0, 'ndisc_ereq_GL');
my %vrecv = vRecv($Link0, $TimeOut, 0, 0, @frames);
my $got_mcast_ns = 0;
if($vrecv{'recvCount'}) {
foreach my $frame (@frames) {
if($vrecv{'recvFrame'} eq $frame) {
$got_mcast_ns ++;
last;
}
}
}
unless($got_mcast_ns) {
vLogHTML('Could\'t observe NS
');
exitFail();
}
exitPass();
#NOTREACHED
#
# perldoc
#
########################################################################
__END__
=head1 NAME
=begin html
V6LC_2_1_5_B - Host Prefix List (Prefix Lifetime updated by RA) =end html =begin html=end html =head1 TARGET =begin html
Host=end html =head1 TOPOLOGY =begin html
=end html =head1 SETUP =begin html| TN NUT | | ----+-------+--- Link0
Link0 global 3ffe:501:ffff:100::/64 link-local fe80::/64 TN global 3ffe:501:ffff:100::<TnDef.Link0_addr> link-local fe80::<TnDef.Link0_addr> ether <TnDef.Link0_addr> NUT 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
=end html =head1 JUDGEMENT =begin htmlTN NUT | | | --> | RA | | * | Wait (MAX_RTR_SOLICITATION_DELAY + RetransTimer * DupAddrDetectTransmits) | | | ----> | Echo Request | <-- | NS (multicast) [Judgment #1] | ----> | NA | <---- | Echo Reply [Judgment #2] | | | --> | RA | | * | Wait (8) Ignore DAD | | | --> | RA | | * | Wait (8) Ignore DAD | | | ----> | Echo Request | <-- | NS (multicast) [Judgment #3] V V
State: NONE (TN) (link-local)1. Send RAIPv6 header hop limit = 255 source = TN (link-local) destination = all-nodes multicast address RA cur hop limit = 64 M = 0 O = 0 router lifetime = 20 reachable time = 600000 retrans timer = 10002. 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 (TN) (link-local)State: NONE (TN) (link-local)3. Send Echo RequestIPv6 header source = TN (link-local) destination = NUT (link-local) Echo RequestState: INCOMPLETE (TN) (link-local)4. Observe NS [Judgment #1]IPv6 header hop limit = 255 source = NUT (link-local) destination = TN (solicited-node multicast address) NS target = TN (link-local) SLL option5. Send NAIPv6 header hop limit = 255 source = TN (link-local) destination = NUT (link-local) NA R = 1 S = 1 O = 1 target = TN (link-local) TLL optionState: REACHABLE (TN) (link-local)6. Observe Echo Reply [Judgment #2]IPv6 header source = NUT (link-local) destination = TN (link-local) Echo ReplyState: REACHABLE (TN) (link-local)7. Send RAIPv6 header hop limit = 255 source = TN (link-local) destination = all-nodes multicast address RA cur hop limit = 64 M = 0 O = 0 router lifetime = 20 reachable time = 600000 retrans timer = 1000 Prefix Information option prefix length = 64 L = 1 A = 1 valid Lifetime = 10 preferred lifetime = 10 prefix = 3ffe:501:ffff:100::8. Wait (8) - Ignore DAD9. Send RAIPv6 header hop limit = 255 source = TN (link-local) destination = all-nodes multicast address RA cur hop limit = 64 M = 0 O = 0 router lifetime = 20 reachable time = 600000 retrans timer = 1000 Prefix Information option prefix length = 64 L = 1 A = 1 valid Lifetime = 10 preferred lifetime = 10 prefix = 3ffe:501:ffff:100::10. Wait (8) - Ignore DAD11. Observe NS [Judgment #3]IPv6 header hop limit = 255 source = NUT (link-local) destination = TN (solicited-node multicast address) NS target = TN (link-local) SLL option
=end html =head1 CLEANUP =begin html[Judgment #1] NUT must transmit NS to TN solicited-node multicast address [Judgment #2] NUT must transmit Echo Reply to TN [Judgment #3] NUT must transmit NS to TN solicited-node multicast address
- Remove global address=end html =cut # =head1 REFERENCE # # =begin html #
- Clear default router
- Set neighbor cache state for TN to NONE
TN 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 (TN) (link-local)1. Send RAIPv6 header hop limit = 255 source = TN (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 = TN (link-local) destination = NUT (link-local) NS target = NUT (link-local) SLL option address = H0 (ether)State: STALE (TN) (link-local)3. Observe NAIPv6 header source = NUT (link-local) destination = TN (link-local) NA R = 0 S = 1 O = 1 target = NUT (link-local) TLL optionState: DELAY (TN) (link-local)4. Wait (DELAY_FIRST_PROBE_TIME)Node constants: DELAY_FIRST_PROBE_TIME: 5 secondsState: PROBE (TN) (link-local)5. Observe MAX_UNICAST_SOLICIT NSsIPv6 header hop limit = 255 source = NUT (link-local) destination = TN (link-local) NS target = TN (link-local) SLL optionNode constants: MAX_UNICAST_SOLICIT: 3 transmissionsState: NONE (TN) (link-local)
# RFC2461 Neighbor Discovery for IPv6 ## # =end html # =pod =head1 REFERENCE =begin html
## 6.3.4. Processing Received Router Advertisements ### For each Prefix Information option with the on-link flag set, a host # does the following: ### # - If the prefix is the link-local prefix, silently ignore the # Prefix Information option. ### - If the prefix is not already present in the Prefix List, and the # Prefix Information option's Valid Lifetime field is non-zero, # create a new entry for the prefix and initialize its # invalidation timer to the Valid Lifetime value in the Prefix # Information option. ### - If the prefix is already present in the host's Prefix List as # the result of a previously-received advertisement, reset its # invalidation timer to the Valid Lifetime value in the Prefix # Information option. If the new Lifetime value is zero, time-out # the prefix immediately (see Section 6.3.5). ### - If the Prefix Information option's Valid Lifetime field is zero, # and the prefix is not present in the host's Prefix List, # silently ignore the option. ##
=end html =cutRFC 2461 - Neighbor Discovery for IPv6