#!/usr/bin/perl # # $Copyright$ # # $Id: ncStateByRa4Incomplete.seq,v 1.1.1.1 2000/10/31 22:39:03 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; $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; } # # sub test definition: # - sending pattern, # - SLLA vs cached LLA # - expected state # - message # $idx_ptn=0; $idx_lla=1; $idx_exp=2; $idx_explla=3; $idx_msg=4; $idx_inc_ip=5; $idx_prb_ip=6; $idx_rpy_ip=7; $idx_ign_ip=8; $idx_non_n=9; $idx_rpy_n=10; $idx_ign_n=11; $idx_stl_sr=12; $idx_ign_sr=13; @null=(); # @reply_ra_tn2allnode=(nd_echo_reply); @def_ra_tn2allnode= ( ra_tn2allnode, same, INCOMPLETE, unchanged, 'RA w/o SLL', \@null, \@null, \@reply_ra_tn2allnode, \@null, \@null, \@null, \@null, \@null, \@null ); # @reply_ra_tn2allnode_sll=(nd_echo_reply); @def_ra_tn2allnode_sll= ( ra_tn2allnode_sll, same, STALE, unchanged, 'RA w/ SLL', \@null, \@null, \@reply_ra_tn2allnode_sll, \@null, \@null, \@null, \@null, \@null, \@null ); # # # @defs= ( \@def_ra_tn2allnode, \@def_ra_tn2allnode_sll, ); # # # vCapture($IF); # # # $idx=0; foreach(@defs) { $exp=@$_[$idx_exp]; $explla=@$_[$idx_explla]; $msg=@$_[$idx_msg]; vLogHTML("
"); vLogHTML("*** INCOMPLETE vs. $msg ***
"); $s=checkState($_); $c=ndCachedLLA($explla); if($s =~ /$exp/ && $c eq $explla) { $result{$idx}=$V6evalTool::exitPass; vLogHTML("OK: The target was $s/$c
"); } else { $exit_rtn=$V6evalTool::exitFail; $result{$idx}=$exit_rtn; vLogHTML("". ndErrmsg("NG: The target was $s/$c")."
"); } $title{$idx}="$msgexp:$exp/$expllaresult:$s/$c"; $idx++; clear(); } $idx--; # # # @col=('PTN', 'EXP(State/Cached LLA)', 'RESULT(State/Cached LLA)'); vLogHTML("*** Test Summary: INCOMPLETE vs. a RA ***
"); ndPrintSummaryHTML("*** Test Summary: INCOMPLETE vs. RA ***", @col, %title, %result, $idx); # # # vLogHTML("*** EOT ***
"); exit $exit_rtn; # # # sub checkState(\@) { my($def)=@_; my($ptn)=@$def[$idx_ptn]; my($lla)=@$def[$idx_lla]; my($exp)=@$def[$idx_exp]; my($msg)=@$def[$idx_msg]; my($inc_ip)=@$def[$idx_inc_ip]; my($prb_ip)=@$def[$idx_prb_ip]; my($rpy_ip)=@$def[$idx_rpy_ip]; my($ign_ip)=@$def[$idx_ign_ip]; my($non_n)=@$def[$idx_non_n]; my($rpy_n)=@$def[$idx_rpy_n]; my($ign_n)=@$def[$idx_ign_n]; my($stl_sr)=@$def[$idx_stl_sr]; my($ign_sr)=@$def[$idx_ign_sr]; vLogHTML("Initialization
"); goto error if nd2Incomplete($IF) != 0; vClear($IF); vLogHTML("Test
"); $pktdesc{$ptn}="Send $msg"; vSend($IF, $ptn); my($s)=ndStatusNum2Str(ndStatus( $IF, @$inc_ip, @$prb_ip, @$rpy_ip, @$ign_ip, @$non_n, @$rpy_n, @$ign_n, @$stl_sr, @$ign_sr, ) ); return $s; error: return("ERROR"); } sub clear() { vLogHTML("Termination
"); $pktdesc{ra_tn2allnode_clrrtr}= "Clear TN from the Default Router List"; vSend($IF, ra_tn2allnode_clrrtr); } ######################################################################## __END__ =head1 NAME ncStateByRa4Incomplete - Verifying State Machine: RA vs. INCOMPLETE =head1 TARGET Host only =head1 SYNOPSIS ncStateByRa4Incomplete.seq [-tooloption ...] -p ncStateByRa4Incomplete.def =head1 INITIALIZATION Set the state of neighbor cache entry to INCOMPLETE. TN NUT ---------------------- State: NONCE (for TN) ==== echo-request ===> src=TN's link-local dst=NUT's link-local State: INCOMPLETE (for TN) =head1 TEST PROCEDURE B verifies that state transition for NUT in INCOMPLETE state when receiving a RA. =begin html
  TN               NUT
  ----------------------

State: INCOMPLETE (for TN)
==== RA ===> src=TN's link dst=all-node RouterLifetime=600 ReachableTime=0 RetransTimer=0 M=0, O=0 w/o or w/ TLLA
Judgment: Examining NUT's neighbor cache state
=end html =head1 JUDGMENT =begin html

6.3.4. Processing Received Router Advertisements
After extracting information from the fixed part of the Router Advertisement message, the advertisement is scanned for valid options. If the advertisement contains a Source Link-Layer Address option the link-layer address SHOULD be recorded in the Neighbor Cache entry for the router (creating an entry if necessary) and the IsRouter flag in the Neighbor Cache entry MUST be set to TRUE. If no Source Link-Layer Address is included, but a corresponding Neighbor Cache entry exists, its IsRouter flag MUST be set to TRUE. The IsRouter flag is used by Neighbor Unreachability Detection to determine when a router changes to being a host (i.e., no longer capable of forwarding packets). If a Neighbor Cache entry is created for the router its reachability state MUST be set to STALE as specified in Section 7.3.3. If a cache entry already exists and is updated with a different link-layer address the reachability state MUST also be set to STALE.
====================+====================================+=============== RA | Neighbor Cache | Comment ------------+-------+------------+-----------+-----------+--------------- Destination | TLLA | Current | New | LLA | ============+=======+============+===========+===========+=============== all-node | none | INCOMPLETE | unchanged | unchanged | Not mentioned | | | | | in RFC2461 ------------+-------+------------+-----------+-----------+--------------- all-node | exist | INCOMPLETE | STALE | updated | ============+=======+============+===========+===========+===============
=end html =head1 TERMINATION N/A =head1 NOTE The test does not invoke any remote command. =head1 SEE ALSO perldoc V6evalTool perldoc V6evalRemote =cut