#!/usr/bin/perl
#
# $Copyright$
#
# $Id: hostRecvRaNHD.seq,v 1.1.1.1 2000/10/31 22:38:59 sekiya Exp $
########################################################################
BEGIN { $V6evalTool::TestVersion = '$Name: $ '; }
use V6evalTool;
use nd;
sub checkNHD($);
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;
$wait_dad=3;
$wait_echo=2;
#
#
#
%pktdesc=(
ra_tn2allnode_sll_lp => 'Send RA w/ RL=0, w/o Prefix',
ra_tn2allnode_sll_Lp => 'Send RA w/ RL=600, w/o Prefix',
ra_tn2allnode_sll_lP => 'Send RA w/ RL=0, w/ Prefix',
);
@ra_name=(
ra_tn2allnode_sll_lp,
ra_tn2allnode_sll_Lp,
ra_tn2allnode_sll_lP,
);
@ra_title=(
"Prefix List: empty / Default Router List: empty",
"Prefix List: empty / Default Router List: NOT empty",
"Prefix List: NOT empty / Default Router List: empty",
);
@ra_expect=(
"on-link",
"off-link",
"on-link",
);
@ra_bin=(
$V6evalTool::exitWarn,
$V6evalTool::exitWarn,
$V6evalTool::exitWarn,
);
#
#
#
$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;
}
#
#
#
vCapture($IF);
#
#
#
$exit_rtn=$V6evalTool::exitPass;
$idx=0;
foreach(@ra_name) {
vLogHTML("
TN NUT ----------------------=head1 TEST PROCEDURE =begin html hostRecvRaNHD verifies next-hop determination for an unicast address: =head2 Off-link =begin html
State: NONCE (for TN)
==== unsolicited RA ===> src=TN's link-local dst=all-node M=0, O=0 RouterLifetime=0 or 600 ReachableTime=0 RetransTimer=0 w/ SLLA w/o Prefix option or 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, prefix=3ffe:501:ffff:100::/64] target=NUT's global
Wait (3 sec)
==== solicited 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: REACHABLE (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
=end html =head2 On-link =begin htmlTN NUT ----------------------
State: REACHABLE (for TN)
==== echo-request ===> src=off-link global, but LLA is TN's one dst=NUT's global
<=== Judgment #3: multicast NS ==== src=NUT's link-local dst=solicited-node[off-link global] target=off-link global w/ SLLA =end html =head1 JUDGMENT =begin html1. Next-hop determination=end html =head1 TERMINATION Send RA with RouterLifetime=0 to clear the Default Router List. Clear the Prefix List and the Defaut Router List by remote commands. XXX =head1 NOTE =for html 1. RFC2461 describes that a host assumes the destination is on-link if the Default Router List is empty. However, it also describes that multihomed related issues are not concerned. It is also one of the issues that a host assumes an address is on-link if the Default Router List is empty. This test judges NUT "WARN" instead of "FAIL" in such case. =for html 2. The echo request that NUT captures has an off-link source address and a link-local soruce address. It is reasonable for NUT not to throw the echo-reply to the default router because its source address is a link-local. This test judges NUT "WARN" insted of "FAIL" in such case. 3. The test invokes the following command: - Clear the Prefix List - Clear the Default Router List =head1 SEE ALSO perldoc V6evalTool perldoc V6evalRemote =cut
5.2. Conceptual Sending Algorithm
Next-hop determination for a given unicast destination operates as follows. NUT performs a longest prefix match against the Prefix List to determine whether the packet's destination is on- or off-link. If the destination is on-link, the next-hop address is the same as the packet's destination address. Otherwise, NUT selects a router from the Default Router List. If the Default Router List is empty, NUT assumes that the destination is on-link.
=========+========+========================================== RA recieved | NUT by NUT | ---------+--------+-----------------+-------------+--------- Prefix |Router | The Prefix List | The Default | Next Hop Option |Lifetime| | Router List | =========+========+=================+=============+========== none | 0 | empty | empty | on-link ---------+--------+-----------------+-------------+---------- none | 600 | empty | NOT empty | off-link ---------+--------+-----------------+-------------+---------- exist | 0 | NOT empty | empty | on-link =========+========+=================+=============+==========
2. NUT throws an echo-reply to the default router (i.e. TN) because the given address should be off-link.
3. NUT sends multicast NSs for the given address because it should be on-link.