#!/usr/bin/perl
#
# Copyright (C) 1999,2000 Yokogawa Electric Corporation and
# YDC 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.
#
# $Id: recvNsRFlag.seq,v 1.1.1.1 2000/10/31 22:39:35 sekiya Exp $
########################################################################
BEGIN { $V6evalTool::TestVersion = '$Name: $ '; }
use V6evalTool;
use nd;
ndOptions(@ARGV);
# The following generate debugging messages.
$nd::debug=$ndOpt_v|$ndOpt_vv;
# You can specifies debug optons 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;
$idx=0;
$wait_echo=2;
$wait_ns=$nd::DELAY_FIRST_PROBE_TIME +
($nd::RETRANS_TIMER * $nd::MAX_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;
}
#
#
#
$idx_ptn=0;
$idx_lla=1;
$idx_msg=2;
#
@def_unicast_ns_tn2nut=
(
unicast_ns_tn2nut,
same,
'unicast NS w/o SLL',
);
#
@def_unicast_ns_tn2nut_sll=
(
unicast_ns_tn2nut_sll,
same,
'unicast NS w/ SLL',
);
#
@def_multicast_ns_tn2nut=
(
multicast_ns_tn2nut,
same,
'multicast NS w/o SLL',
);
#
@def_multicast_ns_tn2nut_sll=
(
multicast_ns_tn2nut_sll,
same,
'multicast NS w/ SLL',
);
#
@def_unicast_ns_tn2nut_sll_diff=
(
unicast_ns_tn2nut_sll,
diff,
'unicast NS w/ SLL, diff. LLA',
);
#
@def_multicast_ns_tn2nut_sll_diff=
(
multicast_ns_tn2nut_sll,
diff,
'multicast NS w/ SLL, diff. LLA',
);
#
#
#
@defs=
(
\@def_unicast_ns_tn2nut,
\@def_unicast_ns_tn2nut_sll,
\@def_multicast_ns_tn2nut,
\@def_multicast_ns_tn2nut_sll,
\@def_unicast_ns_tn2nut_sll_diff,
\@def_multicast_ns_tn2nut_sll_diff,
);
#
#
#
vCapture($IF);
#
#
#
$idx=0;
foreach(@defs) {
$ptn=@$_[$idx_ptn];
$lla=@$_[$idx_lla];
$msg=@$_[$idx_msg];
vLogHTML("
TN NUT ---------------------- State: NONCE (for TN)=end html =head2 Cache a bogus LLA =begin html
==== unsolicited RA ===> src=TN's link-local dst=all-node M=0, O=0 RouterLifetime=600 ReachableTime=0 RetransTimer=0 SLLA=TN's LLA Prefix Option: L=1, A=1 ValidLifetime=2592000 PreferredLifetime=604800 Prefix=3ffe:501:ffff:100::/64
State: STALE (for TN)
<=== Ns for DAD (if any) ==== src=unspecified dst=solicited-node[NUT's global] target=NUT's global
==== 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)
TN NUT ---------------------- State: NONCE (for TN)=end html =head1 TEST PROCEDURE B
==== unsolicited RA ===> src=TN's link-local dst=all-node M=0, O=0 RouterLifetime=600 ReachableTime=0 RetransTimer=0 SLLA=a bogus LLA Prefix Option: L=1, A=1 ValidLifetime=2592000 PreferredLifetime=604800 Prefix=3ffe:501:ffff:100::/64
State: STALE (for TN)
<=== Ns for DAD (if any) ==== src=unspecified dst=solicited-node[NUT's global] target=NUT's global
==== NA ===> src=TN's link-local dst=NUT's link-local R=1, S=1, O=1 target=TN's link-local TLLA=a bogus LLA
State: REACHABLE (for TN)
TN NUT ----------------------
State: REACHABLE (for TN)
==== NS ===> src=TN's link-local dst=teh NUT's link-local or solicited-node[NUT's link-local] target=NUT's link-local w/ or w/o SLL
State: REACHABLE or STALE (for TN)
==== echo-request ===> src=off-link global, but LLA is TN's one dst=NUT's global
<=== Judgement #2: echo-reply ==== src=NUT's global dst=off-link global, but LLA is TN's one
State: REACHABLE or DELAY->PROBE (for TN)
<=== Ns for TN (if the state is PROBE) ==== src=NUT's link-local dst=TN's link-local target=TN's global
State: REACHABLE or NONCE (for TN) =end html =head1 JUDGEMENT =begin html1. IsRouter flag MUST NOT be modified=end html =for html 2. NUT sends an echo-reply that is thrown to the default router (i.e. TN). =head1 TERMINATION Send RA with RouterLifetime=0 to clear the Default Router List. =head1 NOTE The command does not invoke any remote command. =head1 SEE ALSO perldoc V6evalTool perldoc V6evalRemote =cut
7.2.3. Receipt of Neighbor Solicitations
If a Neighbor Cache entry is created the IsRouter flag SHOULD be set to FALSE. This will be the case even if the Neighbor Solicitation is sent by a router since the Neighbor Solicitation messages do not contain an indication of whether or not the sender is a router. In the event that the sender is a router, subsequent Neighbor Advertisement or Router Advertisement messages will set the correct IsRouter value. If a Neighbor Cache entry already exists its IsRouter flag MUST NOT be modified.
========================+===================== Received NS | a IsRouter flag by NUT | of NUT's NCE ------------+-----------+ ---------+---------- Dst | SLLA | Current | New ============+===========+==========+========== unicast | none | 1 | unchanged ------------+-----------+----------+---------- unicast | same | 1 | unchanged ------------+-----------+----------+---------- multicast | none | 1 | unchanged ------------+-----------+----------+---------- multicast | same | 1 | unchanged ------------+-----------+----------+---------- unicast | different | 1 | unchanged ------------+-----------+----------+---------- multicast | different | 1 | unchanged ============+===========+==========+==========