#!/usr/bin/perl # # $Copyright$ # # $Id: recvNsRFlag.seq,v 1.1.1.1 2000/09/28 00:14:48 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("
*** $msg ***
"); $s=check($ptn, $lla, $msg); if($s eq unchanged) { $result{$idx}=$V6evalTool::exitPass; $exit_rtn=$V6evalTool::exitPass; vLogHTML("OK: The target was in $s state
"); } else { $result{$idx}=$V6evalTool::exitFail; $exit_rtn=$V6evalTool::exitFail; vLogHTML("".ndErrmsg(NG)."
"); } $title{$idx}="$msgexp:unchangedresult:$s"; $idx++; } $idx--; # # # vLogHTML("Termination
"); clear(); # # # @col=('PTN', 'EXP', 'RESULT'); ndPrintSummaryHTML("*** Test Summary: NS vs. IsRouter flag ***", @col, %title, %result, $idx); # # # vLogHTML("*** EOT ***
"); exit $exit_rtn; # # # sub clear() { $pktdesc{nd_unsol_ra_clrrtr}="Clear the Default Router List"; vSend($IF, nd_unsol_ra_clrrtr); } # # # sub check($$$) { my($ptn, $lla, $msg)=@_; # # # vLogHTML("Initialization
"); #goto error if ndClearPrefix() != 0; #goto error if ndClearDefr() != 0; if($lla eq same) { goto error if nd2ReachableByRa($IF) != 0; } else { goto error if nd2ReachableByRaZ($IF) != 0; } # # # vLogHTML("Test
"); $pktdesc{$ptn}= "Send $msg"; vSend($IF, $ptn); # # # $pktdesc{nd_echo_request_from_offlink}= "Send echo-request from off-link src"; vSend($IF, nd_echo_request_from_offlink); $pktdesc{nd_echo_reply_to_offlink}= "Got echo-reply that was thrown to the default route"; %ret=vRecv($IF, $wait_echo, 0, 0, nd_echo_reply_to_offlink); # # # if($lla ne same) { vLogHTML("Waif for unicast NSs if any.
"); vRecv($IF, $wait_ns, 0, 0); } # # # if($ret{status} == 0) { return(unchanged); } else { vLogHTML("Never got echo-reply ". "that was thrown to the default router
"); return(updated); } error: return(ERROR); } ######################################################################## __END__ =head1 NAME recvNsRFlag - Verifing that a IsRouter flag is not modified by a NS =head1 TARGET Host only =head1 SYNOPSIS recvNsRFlag.seq [-tooloption ...] -p recvNsRFlag.def =head1 INITIALIZATION =begin html
  1. Set the state of neighbor cache entry to REACHABLE whose IsRouter flag is true.
  2. Cache either TN's LLA or a bogus LLA
=head2 Cache a LLA of TN =begin html
  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 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)
=end html =head2 Cache a bogus LLA =begin html
  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 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)
=end html =head1 TEST PROCEDURE B verifies that a IsRouter flag is NOT modified by a NS. =begin html
  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 html
1. IsRouter flag MUST NOT be modified

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 ============+===========+==========+==========
=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