#!/usr/bin/perl # # $Name: V6LC_4_0_1 $ # # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # Yokogawa Electric Corporation. # 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. # # 5. The copyrighters, the project and the contributors may prohibit # the use of this software at any time. # # 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. # # $Id: R_UnrecognizedRoutingTypeIN.seq,v 1.10 2007/10/04 10:07:22 akisada Exp $ # ###################################################################### BEGIN { $V6evalTool::TestVersion = '$Name: V6LC_4_0_1 $'; } use V6evalTool; use CommonSPEC; $pktdesc{'echo_request_rh'} = 'Send Echo Request with Routing Header contains unrecognized Routing Type'; $pktdesc{'echo_reply'} = 'Recv Echo Reply'; $pktdesc{'echo_reply_rh_rv'} = 'Recv Echo Reply with reversal of Routing Header'; $pktdesc{'icmperr'} = 'Recv ICMPv6 Parameter Problem (errorneous header field encountered)'; $endStatus = $V6evalTool::exitPass; $IF = 'Link0'; vCapture($IF); #====================================================================== if (setup11($IF) != $CommonSPEC::Success) { $ret = cleanup($IF); if ($ret == $CommonSPEC::Success) { exit($V6evalTool::exitFail); } else { exit($V6evalTool::exitFatal); } } #====================================================================== vSend($IF, 'echo_request_rh'); %ret = nd_vRecv_EN($IF, $CommonSPEC::wait_reply, 0, 0, 'icmperr'); if ($ret{'status'} == 0) { vLogHTML('OK
'); } else { vLogHTML('Cannot receive ICMPv6 Parameter Problem message
'); vLogHTML('NG
'); $endStatus = $V6evalTool::exitFail; } #----- end test $ret = cleanup($IF); vStop($IF); if ($ret == $CommonSPEC::Success) { exit($endStatus); } else { exit($V6evalTool::exitFatal); } ###################################################################### __END__ =head1 NAME R_UnrecognizedRoutingTypeIN - Unrecognized Routing Type - End Node =head1 TARGET Host and Router =head1 SYNOPSIS =begin html
  R_UnrecognizedRoutingTypeIN.seq [-tooloption ...] -pkt R_UnrecognizedRoutingTypeIN.def
    -tooloption : v6eval tool option
=end html =head1 INITIALIZATION Common Test Setup 1.1 1. Send Router Advertisement 2. Send Echo Request 3. Wait Echo Reply =head1 TEST PROCEDURE Tester Target | | |-------------------------->| | ICMP Echo Request | | | |<--------------------------| | ICMP Parameter Problem | | | v v 1. Send Echo Request 2. Receive Parameter Problem Network topology (Link0) Target Tester Host1 ------ Router1 ------ Router2 ------ Host2 ------ Router3 Global 6 Global 4 Global 0 Global 2 ICMP Echo Request is: IPv6 Header Version = 6 Traffic Class = 0 FlowLabel = 0 PayloadLength = 72 NextHeader = 43 (Routing Header) SourceAddress = Global 6 Address (Host1) DestinationAddress = Global 0 Address (Host2) Routing Header NextHeader = 58 (ICMPv6) HeaderExtLength = 6 RoutingType = 33 (unknown) SegmentsLeft = 1 Address[1] = Global 6 Address (Router1) Address[2] = Global 4 Address (Router2) Address[3] = Global 2 Address (Router3) ICMP Echo Request Type = 128 (Echo Request) =head1 JUDGEMENT PASS: receive ICMP Parameter Problem IPv6 Header Version = 6 Traffic Class = 0 FlowLabel = 0 PayloadLength = 120 NextHeader = 58 (ICMPv6) SourceAddress = Global 0 Address (Host2) DestinationAddress = Global 6 Address (Host1) ICMP Error Type = 4 (Parameter Problem) Code = 0 (Erroneous header field encountered) Checksum = (auto) Pointer = 42 (Offset to Routing Type field of the Routing Header) PayloadData = (Sent Packet) =cut # =head1 REFERENCE # # RFC2460 # # 4.4 Routing Header # # If, while processing a received packet, a node encounters a Routing # header with an unrecognized Routing Type value, the required behavior # of the node depends on the value of the Segments Left field, as # follows: # # =begin html #
#       If Segments Left is zero, the node must ignore the Routing header
#       and proceed to process the next header in the packet, whose type
#       is identified by the Next Header field in the Routing header.
# 
# # =end html # # If Segments Left is non-zero, the node must discard the packet and # send an ICMP Parameter Problem, Code 0, message to the packet's # Source Address, pointing to the unrecognized Routing Type. # # 8.4 Responding to Packets Carrying Routing Headers # # When an upper-layer protocol sends one or more packets in response to # a received packet that included a Routing header, the response # packet(s) must not include a Routing header that was automatically # derived by "reversing" the received Routing header UNLESS the # integrity and authenticity of the received Source Address and Routing # header have been verified (e.g., via the use of an Authentication # header in the received packet). In other words, only the following # kinds of packets are permitted in response to a received packet # bearing a Routing header: # # =begin html #
#       o  Response packets that do not carry Routing headers.
# 
# # =end html # # o Response packets that carry Routing headers that were NOT # derived by reversing the Routing header of the received packet # (for example, a Routing header supplied by local # configuration). # # o Response packets that carry Routing headers that were derived # by reversing the Routing header of the received packet IF AND # ONLY IF the integrity and authenticity of the Source Address # and Routing header from the received packet have been verified # by the responder. # =pod =head1 REFERENCE =begin html
RFC 2460 - IPv6 Specification
=end html =head1 SEE ALSO perldoc V6evalTool =cut