#!/usr/bin/perl # # $Copyright$ # # $Id: recvNsInvalid.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; $exit_rtn=$V6evalTool::exitPass; $idx=0; $timeout=($nd::RETRANS_TIMER * $nd::MAX_MULTICAST_SOLICIT) + 1; # # Start capture buffer # vCapture($IF); # # # $idx_ptn=0; $idx_msg=1; $idx_errexp=2; $idx_errval=3; @null=(); # @def_ucast_ns_tgt_mcast= ( ucast_ns_tgt_mcast, 'Target=all-node multicast', \@null, $V6evalTool::exitFail, ); # @def_ucast_ns_unspec= ( ucast_ns_unspec, 'Souce=unspecified, Destination=link', \@null, $V6evalTool::exitFail, ); # @errptn_mcast_ns_unspec_sll= ( multicast_na_tn2allnode_RsO_tll, multicast_na_tn2allnode_rsO_tll, ); $pktdesc{multicast_na_tn2allnode_RsO_tll}= ndWarnmsg('WARN: NUT sent a NA in response to the NS. '. 'It seems for backward compatibility with RFC1970'); $pktdesc{multicast_na_tn2allnode_rsO_tll}= ndWarnmsg('WARN: NUT sent a NA in response to the NS. '. 'It seems for backward compatibility with RFC1970'); @def_mcast_ns_unspec_sll= ( mcast_ns_unspec_sll, 'Souce=unspecified, w/ SLL', \@errptn_mcast_ns_unspec_sll, $V6evalTool::exitWarn, ); # @def_mcast_ns_from_nut= ( mcast_ns_from_nut, 'Destination=solicited-node, w/o SLL', \@null, $V6evalTool::exitWarn, ); # @def_ucast_ns_hoplimit= ( ucast_ns_hoplimit, 'CurHopLimit!=255', \@null, $V6evalTool::exitFail, ); # # # @defs= ( \@def_ucast_ns_tgt_mcast, \@def_ucast_ns_unspec, \@def_mcast_ns_unspec_sll, \@def_mcast_ns_from_nut, \@def_ucast_ns_hoplimit, ); # # # $idx=0; foreach(@defs) { $ptn=@$_[$idx_ptn]; $msg=@$_[$idx_msg]; $errexp=@$_[$idx_errexp]; $errval=@$_[$idx_errval]; vLogHTML("*** NS: $msg ***
"); $title{$idx}="$msg"; if(check($_)) { $result{$idx}=$V6evalTool::exitPass; vLogHTML("OK: The NS was ignored
"); } else { $exit_rtn=$errval if $exit_rtn != $V6evalTool::exitFail; $result{$idx}=$errval; if($errval==$V6evalTool::exitFail) { vLogHTML("". ndErrmsg("NG: Should ignore the NS")."
"); } else { vLogHTML("". ndWarnmsg("NG: Didn't ingore the NS")."
"); } } $idx++; } $idx--; # # # @col=('PTN'); ndPrintSummaryHTML("*** Test Summary: invalid NA ***", @col, %title, %result, $idx); vLogHTML("****** EOT ******
"); exit $exit_rtn; # # # sub check(\@) { my($def)=@_; my($ptn)=@$def[$idx_ptn]; my($msg)=@$def[$idx_msg]; my($errexp)=@$def[$idx_errexp]; my($errval)=@$def[$idx_errval]; # # # vLogHTML("Initialization
"); goto error if nd2NoNce($IF) != 0; # # # vLogHTML("Test
"); $pktdesc{$ptn}= "Send NS: $msg"; %ret=vSend($IF, $ptn); # # # %ret=vRecv($IF, $timeout, 0, 1, @$errexp); if($ret{status} == 0) { # got specified error packet return(0); } elsif($ret{status} == 1) { # timeout vLogHTML("The NS was ignored"); return(1); } else { # got unexpected packet vLogHTML("The NS was not ignored"); return(0); } error: return(0); } ######################################################################## __END__ =head1 NAME recvNsInvalid - Verify that NUT ignores invalid NSs =head1 TARGET Host and Router =head1 SYNOPSIS recvNsInvalid.seq [-tooloption ...] -p recvNsInvalid.def =head1 INITIALIZATION Clear NC state for TN. =head1 TEST PROCEDURE B verifies that NUT ignores invalid NSs. =begin html
  TN                 NUT
  ----------------------

State: NONCE
==== invalid NS ===>
Judgment #2: Not to capture any packet from NUT within 5 sec.
=end html =head1 JUDGMENT =begin html

  1. NUT must ignore the following NS:

Source |Destination |Hop|Target |SLL ============+====================+===+===================+====== link-local link-local 255 *all-node multicast exist ------------+--------------------+---+-------------------+------ *unspecified *link-local 255 link-local none ------------+--------------------+---+-------------------+------ *unspecified sol-node[link-local] 255 link-local *exist ------------+--------------------+---+-------------------+------ link *sol-node[link-local]255 link-local *none ------------+--------------------+---+-------------------+------ link-local link-local *2 link-local exist ============+====================+===+===================+====== 2. NUT does not sends any packet.
=end html =head1 TERMINATION N/A =head1 NOTE =begin html
  1. The test does not invoke any remote command.

2. An implementation may send a NA in response to the NS (src=unspedified, with SLLA option) because of backward compatibility with RFC1970. RFC defined the NS as valid, whereas RFC2461 defined the NS as invalid. In such case, this test judges "WARN" that never means the implementation is wrong. The test intends to inform such behavior.
RFC1970
4.3. Neighbor Solicitation Message Format
IP Fields:
Source Address Either an address assigned to the interface from which this message is sent or (if Duplicate Address Detection is in progress [ADDRCONF]) the unspecified address.
Possible options:
Source link-layer address The link-layer address for the sender. On link layers that have addresses this option MUST be included in multicast solicitations and SHOULD be included in unicast solicitations.
RFC2461
4.3. Neighbor Solicitation Message Format
Possible options:
Source link-layer address The link-layer address for the sender. MUST NOT be included when the source IP address is the unspecified address. Otherwise, on link layers that have addresses this option MUST be included in multicast solicitations and SHOULD be included in unicast solicitations.

3. An implementation may send a NA in response to the NS (src=solicited-node multicast, without SLLA option). The NS is not invalid as a receiver side, whereas it is invalid as a sender side (please see the following). In such case, this test judges "WARN" that never means the implementation is wrong. The test intends to inform such behavior.
RFC2461 Sender side:
4.3. Neighbor Solicitation Message Format
Possible options:
Source link-layer address The link-layer address for the sender. MUST NOT be included when the source IP address is the unspecified address. Otherwise, on link layers that have addresses this option MUST be included in multicast solicitations and SHOULD be included in unicast solicitations.
RFC2461 Receiver side:
7.1.1. Validation of Neighbor Solicitations
A node must silently discard any received Neighbor Solicitation messages that do not satisfy all of the following validity checks:
- The IP Hop Limit field has a value of 255, i.e., the packet could not possibly have been forwarded by a router.
- If the message includes an IP Authentication Header, the message authenticates correctly.
- ICMP Checksum is valid.
- ICMP Code is 0.
- ICMP length (derived from the IP length) is 24 or more octets.
- Target Address is not a multicast address.
- All included options have a length that is greater than zero.
- If the IP source address is the unspecified address, the IP destination address is a solicited-node multicast address.
- If the IP source address is the unspecified address, there is no source link-layer address option in the message.
=end html =head1 SEE ALSO perldoc V6evalTool perldoc V6evalRemote =cut