#!/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/natpt/rfc2765_3.1_options.seq,v 1.4 2001/10/11 01:41:47 akisada Exp $ # BEGIN { $V6evalTool::TestVersion = '$Name: REL_2_1_2 $'; } use V6evalTool; use natpt; checkNUT(router); # Interface $IF="Link0"; $IF1="Link1"; vCapture($IF); vCapture($IF1); %pktdesc = ( ipv4_looserouteexpired => 'Send IPv4 option Loose Source Route (Route Expired)', ipv4_looseroute => 'Send IPv4 option Loose Source Route (NUT is last step)', ipv4_strictrouteexpired => 'Send IPv4 option Strict Source Route (Route Expired)', ipv4_strictroute => 'Send IPv4 option Strict Source Route (NUT is last step)', ipv4_timestamp => 'Send IPv4 option Timestamp', ipv4_recordroute => 'Send IPv4 option Record Route', ipv4_multipass => 'Send IPv4 with many different options', ipv6_echo => 'Recv IPv6 Translated Packet', arp_nut2tn_request => 'Recv ARP request on Link1 (TN IPv4addr)', arp_tn2nut_reply => 'Send ARP reply on Link1 (TN IPv4addr)', ns_nut2tn_siit0 => 'Recv Neighbor Solicitation on Link0 (SIIT V6addr)', na_tn2nut_siit0 => 'Send Neighbor Advertisement on Link0 (SIIT V6addr)', ); $result = $V6evalTool::exitPass; $result += send_recv($IF1, 'ipv4_timestamp', $IF, 'ipv6_echo'); $result += send_recv($IF1, 'ipv4_recordroute', $IF, 'ipv6_echo'); $result += send_recv($IF1, 'ipv4_looserouteexpired', $IF, 'ipv6_echo'); $result += send_recv($IF1, 'ipv4_looseroute', $IF, 'ipv6_echo'); $result += send_recv($IF1, 'ipv4_strictrouteexpired', $IF, 'ipv6_echo'); $result += send_recv($IF1, 'ipv4_strictroute', $IF, 'ipv6_echo'); $result += send_recv($IF1, 'ipv4_multipass', $IF, 'ipv6_echo'); if($result == $V6evalTool::exitPass) { vLogHTML("

OK

"); exit $V6evalTool::exitPass; } error: vLogHTML("

NG

"); exit $V6evalTool::exitFail; ######################################################################## __END__ =head1 NAME rfc2765_3.1_options.seq - Verify IPv6 <-> IPv4 header translation in accordance with RFC2765 [SIIT] =head1 TARGET Router =head1 SYNOPSIS rfc2765_3.1_options.seq [-tooloption ...] -p rfc2765_3.1_options.def =head1 INITIALIZATION =begin html
	Before this test starts, run initialize.seq.
=end html =head1 TEST PROCEDURE This test verifies that NUT ignores IPv4 header options (except unexpired Source Route options, which are not tested here.) Network Topology Link0 -------------------------- | | TN NUT | | -------------------------- Link1 TN -- (Link0) -- NUT NUT -- (Link1) -- TN --------------------- ------------------------ =begin html
1.1.[1-6]. <=================== ICMPv4 Echo request IPv4 Header src address : TN LINK1 IPv4 address dst address : TN LINK0 IPv4 address Don't Fragment = 1 More fragments = 0 Offset = 0 Option = Timestamp or Record Route or Loose Source Route (Route expired) or Loose Source Route (NUT is last step) or Strict Source Route (Route expired) or Strict Source Route (NUT is last step) ICMPv4 echo request 1.2.[1-6]. <> <=================== ICMPv6 Echo Request IPv6 Header src address : TN LINK1 IPv4 embedded IPv6 address dst address : TN LINK0 IPv4 embedded IPv6 address ICMPv6 echo request =begin html
2.1.1 <=================== ICMPv4 Echo request IPv4 Header src address : TN LINK1 IPv4 address dst address : NUT LINK1 IPv4 address Don't Fragment = 1 More fragments = 0 Offset = 0 option = Timestamp option = NOP option = Loose Source Route (Route expired) option = NOP option = Strict Source Route (NUT is last step) option = NOP option = Record Route option = End of OptionList Padding = 0; Padding = 0; Padding = 0; ICMPv4 echo request 2.2.1. <> <=================== ICMPv6 Echo Request IPv6 Header src address : TN LINK1 IPv4 embedded IPv6 address dst address : TN LINK0 IPv4 embedded IPv6 address ICMPv6 echo request =head1 JUDGMENT << PASS >> NUT ignores all options and translates the echo request. << FAIL >> NUT doesn't translate the ICMPv4 echo request to ICMPv6 echo requests. =head1 NOTE =head1 REFERENCE B 3.1. Translating IPv4 Headers into IPv6 Headers If IPv4 options are present in the IPv4 packet, they are ignored i.e., there is no attempt to translate them. However, if an unexpired source route option is present then the packet MUST instead be discarded, and an ICMPv4 "destination unreachable/source route failed" (Type 3/Code 5) error message SHOULD be returned to the sender. =head1 SEE ALSO perldoc V6evalTool =cut