#!/usr/bin/perl
#
# $Name: V6LC_4_0_5 $
#
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
# 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_UnrecognizedRoutingTypeEN.seq,v 1.8 2008/07/31 02:40:32 hide Exp $
#
######################################################################
BEGIN {
$V6evalTool::TestVersion = '$Name: V6LC_4_0_5 $';
}
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';
$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, 'echo_reply', 'echo_reply_rh_rv');
if ($ret{'status'} == 0) {
if ($ret{'recvFrame'} eq 'echo_reply') {
vLogHTML('OK
');
} elsif ($ret{'recvFrame'} eq 'echo_reply_rh_rv') {
vLogHTML('Received Reversal of Routing Header
');
vLogHTML('NG
');
$endStatus = $V6evalTool::exitFail;
}
} else {
vLogHTML('Cannot receive Echo Reply
');
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_UnrecognizedRoutingTypeEN - Unrecognized Routing Type - End Node (Unrecognized Routing Type 33)
=head1 TARGET
Host and Router
=head1 SYNOPSIS
=begin html
R_UnrecognizedRoutingTypeEN.seq [-tooloption ...] -pkt R_UnrecognizedRoutingTypeEN.def
-tooloption : v6eval tool option
=end html
=head1 INITIALIZATION
Common Test Setup 1.1
=head1 TEST PROCEDURE
Verify that a node properly processes an IPv6 packet destined for it that contains a Routing header with an unrecognized Routing Type value.
TR NUT
| |
|-------------------------->|
| ICMP Echo Request |
| |
|<--------------------------|
| ICMP Echo Reply |
| |
v v
1. TR forwards an Echo Request that has a Routing header
with a Routing Type valude of 33 and Segments Left value of 0.
The Echo Request is destined for the NUT.
2. Observe the packets transmitted by the NUT.
Network topology
(Link0)
TR
Host1 ------ Router1 ------ Router2 ------ Router3 ------ NUT
Global 6 Global 4 Global 2 Global 0
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 = NUT's Global 0 Address
Routing Header
NextHeader = 58 (ICMPv6)
HeaderExtLength = 6
RoutingType = 33 (unknown)
SegmentsLeft = 0
Address[1] = Global 6 Address (Router1)
Address[2] = Global 4 Address (Router2)
Address[3] = TR's Global 2 Address (Router3)
ICMP Echo Request
Type = 128 (Echo Request)
=head1 JUDGEMENT
PASS: The NUT must ignore the unrecognized Routing Type value
and should respond to the Request by sending an Echo Reply
to Host1 using TR as the first-hop.
ICMP Echo Reply is:
IPv6 Header
Version = 6
Traffic Class = 0
FlowLabel = 0
PayloadLength = 16
NextHeader = 58 (ICMPv6)
SourceAddress = NUT's Global 0 Address
DestinationAddress = Global 6 Address (Host1)
ICMP Echo Reply
Type = 129 (Echo Reply)
=head1 CLEANUP
Common Test Cleanup
=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
=end html =head1 SEE ALSO perldoc V6evalTool =cutRFC 2460 - IPv6 Specification