#!/usr/bin/perl # # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 Yokogawa Electric Corporation, # IPA (Information-technology Promotion Agency, Japan). # 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. However, using this software for the # purpose of testing or evaluating any products including merchantable # products may be permitted without any notification to the copyrighters. # # # # 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/hostRecvRas.seq,v 1.26 2002/02/27 01:08:25 masaxmasa Exp $ ######################################################################## BEGIN { $V6evalTool::TestVersion = '$Name: REL_2_1_2 $ '; } use V6evalTool; use nd; ndOptions(@ARGV); # The following generate debugging messages. $nd::debug=$ndOpt_v|$ndOpt_vv; # You can specifies debug options 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; # # # $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; } # # # vLogHTML("
Initialization
"); vCapture($IF); # # # goto error if ndClearPrefix() != 0; #goto error if nd2NoNce($IF) != 0; # # # $pktdesc{ra_tn2allnode_sll_a}='Send RA w/ SLL w/ Prefix A'; $pktdesc{ra_tn2allnode_sll_b}='Send RA w/ SLL w/ Prefix B'; $pktdesc{ra_tn2allnode_sll_c}='Send RA w/ SLL w/ Prefix C'; vSend($IF, ra_tn2allnode_sll_a, ra_tn2allnode_sll_b, ra_tn2allnode_sll_c, ); vLogHTML("Then STALE
"); vLogHTML("Wait for DAD NSs
"); vRecv($IF, $wait_dad, 0, 0); $pktdesc{unicast_na_tn2nut_RSO_tll}='Send NA w/ TLL, then REACHABLE'; %ret=vSend($IF, unicast_na_tn2nut_RSO_tll); vLogHTML("
Test
"); $pktdesc{echo_request_x2nut_a}='Send echo-request (Prefix A)'; $pktdesc{echo_request_x2nut_b}='Send echo-request (Prefix B)'; $pktdesc{echo_request_x2nut_c}='Send echo-request (Prefix C)'; %ret=vSend($IF, echo_request_x2nut_a, echo_request_x2nut_b, echo_request_x2nut_c, ); goto error if $ret{status} != 0; $i=0; $a_done=0; $b_done=0; $c_done=0; $pktdesc{echo_reply_nut2x_a}='Got echo-reply (Prefix A)'; $pktdesc{echo_reply_nut2x_b}='Got echo-reply (Prefix B)'; $pktdesc{echo_reply_nut2x_c}='Got echo-reply (Prefix C)'; while(1) { %ret=vRecv($IF, $wait_echo, 0, 1, echo_reply_nut2x_a, echo_reply_nut2x_b, echo_reply_nut2x_c, ); last if $ret{status} == 1; # timeout goto error if $ret{status} != 0; # other error if($ret{recvFrame} eq echo_reply_nut2x_a) { if($a_done) { vLogHTML(ndErrmsg("ERROR: Got duplicated echo-reply
")); goto error; } $a_done=1; } elsif($ret{recvFrame} eq echo_reply_nut2x_b) { if($b_done) { vLogHTML(ndErrmsg("ERROR: Got duplicated echo-reply
")); goto error; } $b_done=1; } elsif($ret{recvFrame} eq echo_reply_nut2x_c) { if($c_done) { vLogHTML(ndErrmsg("ERROR: Got duplicated echo-reply
")); goto error; } $c_done=1; } $i++; } if($i != 3) { vLogHTML(ndErrmsg("ERROR: Some echo-reply was missed
")); goto error; } # # # clear(); # # # vLogHTML("*** OK ***
"); exit $V6evalTool::exitPass; error: clear(); vLogHTML(vErrmsg(%ret)."
"); vLogHTML(ndErrmsg("*** NG ***
")); exit $V6evalTool::exitFail; sub clear() { vLogHTML("
Termination
"); $pktdesc{ra_tn2allnode_clrrtr}='Clear the Default Router List
'; vSend($IF, ra_tn2allnode_clrrtr); } ######################################################################## __END__ =head1 NAME hostRecvRas - Verifying that a host accept the union of all RAs =head1 TARGET Host only =head1 SYNOPSIS hostRecvRas .seq [-tooloption ...] -p hostRecvRas.def =head1 INITIALIZATION =begin html
  1. Clear the Prefix List that was learned with RAs.
  2. Create a neighbor cache entry for TN where the IsRouter flag is TRUE.
  3. Set its state to REACHABLE.
  4. Give three global prefixes by TN:
  TN                 NUT
  ----------------------

State: NONCE (for TN)
==== unsolicited RA ===> src=TN's link-local dst=all-node M=0, O=0 RouterLifetime=600 ReachableTime=0 RetransTimer=0 w/ SLLA Prefix Option: L=1, A=1 ValidLifetime=2592000 PreferredLifetime=604800 Prefix=3ffe:501:ffff:100::/64
State: STALE (for TN)
==== unsolicited RA ===> src=TN's link-local dst=all-node M=0, O=0 RouterLifetime=600 ReachableTime=0 RetransTimer=0 w/ SLLA Prefix Option: L=1, A=1 ValidLifetime=2592000 PreferredLifetime=604800 Prefix=3ffe:501:ffff:108::/64
==== unsolicited RA ===> src=TN's link-local dst=all-node M=0, O=0 RouterLifetime=600 ReachableTime=0 RetransTimer=0 w/ SLLA Prefix Option: L=1, A=1 ValidLifetime=2592000 PreferredLifetime=604800 Prefix=3ffe:501:ffff:107::/64
<=== Ns for DAD ==== src=unspecified dst=solicited-node[NUT's global, prefix=3ffe:501:ffff:100::/64] target=NUT's global
<=== Ns for DAD ==== src=unspecified dst=solicited-node[NUT's global, prefix=3ffe:501:ffff:108::/64] target=NUT's global
<=== Ns for DAD ==== src=unspecified dst=solicited-node[NUT's global, prefix=3ffe:501:ffff:107::/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=X's link-local TLLA=X's LLA
State: REACHABLE (for TN)
=head1 TEST PROCEDURE B verifies that a host accept the union of all RAs. =begin html
  TN               NUT
  ----------------------
  State: REACHABLE (for TN)

==== echo-request ===> src=off-link global, but LLA is TN's one dst=NUT's global, prefix==3ffe:501:ffff:100::/64
<=== Judgment #2: echo-reply ==== src=NUT's global, prefix==3ffe:501:ffff:100::/64 dst=off-link global, but LLA is TN's one
==== echo-request ===> src=off-link global, but LLA is TN's one dst=NUT's global, prefix==3ffe:501:ffff:108::/64
<=== Judgment #2: echo-reply ==== src=NUT's global, prefix==3ffe:501:ffff:108::/64 dst=off-link global, but LLA is TN's one
==== echo-request ===> src=off-link global, but LLA is TN's one dst=NUT's global, prefix==3ffe:501:ffff:107::/64
<=== Judgment #2: echo-reply ==== src=NUT's global, prefix==3ffe:501:ffff:107::/64 dst=off-link global, but LLA is TN's one
=end html =head1 JUDGMENT =for html 1. NUT accepts the union of all received information; the receipt of a RA must not invalidate all information received in a previous RA or from another source. =for html 2. NUT throw three echo-replies to the default router (i.e. TN), and their source addresses are different global prefixes. =head1 TERMINATION Send RA with RouterLifetime=0 to clear the Default Router List. Clear the Prefix List by remote command. XXX =head1 NOTE The test invokes the following command: - Clear the Prefix List =head1 SEE ALSO perldoc V6evalTool perldoc V6evalRemote =cut