#!/usr/bin/perl
#
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
# 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.4 2009/01/05 06:39:39 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 Title
Test v6LC.2.1.21: Neighbor Advertisement Processing, R-bit Change (Hosts Only)
Part H
=head1 Purpose
Verify that a host takes appropriate actions when a neighbor who is a router starts transmitting
Neighbor Advertisements with the Router flag clear.
=head1 References
* [ND] Section 7.2.5
=head1 Resource Requirements
* Packet generator
* Monitor to capture packets
=head1 Test Setup
No Common Test Setup is performed. The Common Test Cleanup procedure is
performed after each part.
=begin html
Router Advertisement
IPv6 Header
Next Header: 58
Source Address: TN1's Link-local Address
|
Router Advertisement
Router Lifetime: 20 seconds
Reachable Time: 100 seconds
Retransmit Interval: 1 second
Prefix: TR1's Global Prefix
|
Packet A
IPv6 Header
Next Header: 58
Source Address: TN1's off-link Global Address
Destination Address: HUT's Global Address
|
|
ICMPv6 Echo Request
|
Neighbor Advertisement H
IPv6 Header
Next Header: 58
Source Address: TR1's Link-local Address
|
Neighbor Advertisement
Router flag: 0
Solicited flag: 1
Override flag: 0
Target Link-Layer option: TR1's Link-layer address
|
=end html
=head1 Procedure
1. TR1 transmits the Router Advertisement without a Source Link-layer Address Option.
2. TN1 transmits Packet A.
3. Observe the packets transmitted by the HUT.
4. TR1 responds to Neighbor Solicitations from the HUT with a Neighbor Advertisement with the
Router, Solicited, and Override flags set.
5. Observe the packets transmitted by the HUT.
6. TR1 transmits Neighbor Advertisement A.
7. TN1 transmits Packet A.
8. Observe the packets transmitted by the HUT.
9. Perform common cleanup procedure.
10. Repeat Steps 1 through 8 seven times with Neighbor Advertisement B, C, D, E, F, G and H
respectively in Step 6.
=head1 Observable Results
Step 3:
The HUT should solicit TR1 by transmitting Neighbor Solicitations with a Target Address of
TR1's Link-local Address.
Step 5:
The HUT should transmit an Echo Reply to Packet A using the TR1 as the first hop.
Step 8:
The HUT MUST not transmit an Echo Reply using TR1 as the first hop in response to Packet
A in Step 7 and the HUT MUST not transmit multicast NS's with a target set to TR1's link-local
address.
=head1 Possible Problems
* None.
=cut