#!/usr/bin/perl
#
# Copyright (C) 1999,2000 Yokogawa Electric Corporation and
# YDC 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: packet_too_big.seq,v 1.1.1.1 2000/10/31 22:39:25 sekiya Exp $
########################################################################
BEGIN { $V6evalTool::TestVersion = '$Name: $'; }
use V6evalTool;
use icmp2;
checkNUT(router);
%pktdesc = (
EchoRequest_LINK0_tn2nut_forwarding => 'TN-Echo Request(Link0)->NUT',
EchoRequest_LINK1_nut2tn_forwarding => 'TN<-Echo Request(Link1)-NUT',
packet_LINK0_tn2nut_routingheader => 'TN-Echo Request(Link0)->NUT',
packet_LINK1_nut2tn_routingheader => 'TN<-Echo Request(Link1)-NUT',
icmp6_TooBigMesg_1300 => 'TN<-Packet Too Big(MTU=1300)-NUT',
icmp6_TooBigMesg_1300_1 => 'TN<-Packet Too Big(MTU=1300)-NUT',
icmp6_TooBigMesg_routingheader_1300 => 'TN<-Packet Too Big with Routing Header(MTU=1300)-NUT',
icmp6_TooBigMesg_routingheader_1300_1 => 'TN<-Packet Too Big with Routing Header(MTU=1300)-NUT'
);
# Interface
$IF=Link0;
$IF1=Link1;
# NUT Link1 Interface ID
$Interface_LINK1=$V6evalTool::NutDef{Link1_device};
# NUT Link1 Link MTU
$LinkMTU_LINK1="1300";
$LinkMTU_LINK1_DEFAULT="1500";
# NUT Link1 Offlink Address
$OFFLINK_LINK1_GLOBAL_ADDRESS="3ffe:501:ffff:108::1";
# TN Link1 Link Local Address
$TnLink1MACAddr=$V6evalTool::TnDef{Link1_addr};
$TnLink1LLAddr=vMAC2LLAddr($TnLink1MACAddr);
#
vLogHTML("Initialization
");
vCapture($IF);
vCapture($IF1);
$ret=initNUT();
if( $ret !=0) {
vLog("NUT can not be initialized !!");
vLog("FAIL");
goto error;
}
# make Neighber Chace for Link1 addresses
$ret=makeNCE_LINK1();
if( $ret !=0) {
vLog("NUT can not be initialized LINK1 local!!");
vLog("FAIL");
goto error;
}
# Configuration Test -- Forwarding --
vLog("Check NUT configuration");
vSend($IF,EchoRequest_LINK0_tn2nut_forwarding);
%ret=vRecv($IF1,5,0,0,EchoRequest_LINK1_nut2tn_forwarding);
if($ret{status} != 0) {
vLog("TN(Link1) can not receive Echo Request forwaried by NUT");
goto error;
}
# Configuration Test -- Forwarding with a Routing Header --
vSend($IF,packet_LINK0_tn2nut_routingheader);
%ret=vRecv($IF1,5,0,0,packet_LINK1_nut2tn_routingheader);
if($ret{status} != 0) {
vLog("TN(Link1) can not receive Echo Request with routing header");
}
# Test
vLogHTML("Test
");
# reduce Link MTU of LINK1 Interface from 1500 to 1300
vLog("reduce Link MTU of LINK1 Interface from 1500 to 1300.");
vRemote("mtuconfig.rmt","if=$Interface_LINK1 mtu=$LinkMTU_LINK1")
&& return $V6evalTool::exitFatal;
# JUDGMENT 1
vSend($IF,EchoRequest_LINK0_tn2nut_forwarding);
%ret=vRecv($IF,5,0,0,icmp6_TooBigMesg_1300,icmp6_TooBigMesg_1300_1);
if($ret{status} != 0) {
vLog("TN(Link1) can not receive Packet Too Big Message");
vRecv($IF1,2,0,0,);
goto error;
}else {
vLog("NUT sends Packet Too Big Message to TN");
}
#
# JUDGMENT 2
vSend($IF,packet_LINK0_tn2nut_routingheader);
%ret=vRecv($IF,5,0,0,icmp6_TooBigMesg_routingheader_1300,icmp6_TooBigMesg_routingheader_1300_1);
if($ret{status} != 0) {
vLog("TN(Link1) can not receive Packet Too Big Message");
vRecv($IF1,2,0,0,);
goto error;
}else {
vLog("NUT sends Packet Too Big Message to TN");
}
# increase Link MTU of LINK1 Interface from 1300 to 1500
vRemote("mtuconfig.rmt","if=$Interface_LINK1 mtu=$LinkMTU_LINK1_DEFAULT")
&& return $V6evalTool::exitFatal;
vLog("Success: sending Packet Too Big Message from NUT to TN ");
vLog(OK);
exit $V6evalTool::exitPass;
error:
vRemote("mtuconfig.rmt","if=$Interface_LINK1 mtu=$LinkMTU_LINK1_DEFAULT")
&& return $V6evalTool::exitFatal;
vLog(FAIL);
exit $V6evalTool::exitFail;
########################################################################
__END__
=head1 NAME
packet_too_big - Verify that the NUT sends Packet Too Big Message
=head1 TARGET
Router
=head1 SYNOPSIS
packet_too_big.seq [-tooloption ...] -p packet_too_big.def
=head1 NETWORK CONFIGURATION
This test is OFF-LINK Network Configuration test.
In this test, TN play a Roll of the Router.
Phisical Network configuration
Link0
---------------------------------------
| |
NUT TN
| |
---------------------------------------
Link1
Logical Network Configuration
HOST A (OFFLINK_GLOBAL_ADDRESS)
|
----------------------------------
|
Router(TN-Link0)
| Link0
----------------------------------
|
NUT (globaladdress:B)
|
----------------------------------
| Link1
Router(TN-Link1)
|
----------------------------------
|
HOST A (OFFLINK_LINK1_GLOBAL_ADDRESS)
NUT < --- Router --- > HOST A
In this configuration, Packets are send and received.
for example,
In Logical
HOST A -- Echo Reply --> NUT
Actually, in physical
TN (as Router X) -- Echo Reply --> NUT
=head1 INITIALIZATION
TN attempt to execute remote command 'vRemote(route.rmt)'.
'route add -inet6 OFFLINK_GLOBAL_ADDRESS TN-LINK0-address'
'route add -inet6 OFFLINK_LINK1_GLOBAL_ADDRESS TN-LINK1-address'
=head1 TEST PROCEDURE
"initPMTU" verifies that the node sends a Packet Too Big Message
in response to a packet that it can not forward because the packet
is larger than the MTU of the outgoing link.
TN NUT
---------------------------
1.
After NUT is initialized ( reboot e.t.c) , NUT sets
the Link MTU of LINK1 Interface to 1300 .
2.
TN send Echo Request .
=== echo request ===>
3.
<< JUDGMENT 1 >>
NUT send Packet Too Big Message
<=== Packet Too Big Message ===
4.
TN send Echo Request with Routing Header.
=== echo request ===>
5.
<< JUDGMENT 2 >>
NUT send Packet Too Big Message
<=== Packet Too Big Message ===
=head1 JUDGMENT
<< JUDGMENT 1 >>
<< PASS >>
NUT send a Packet Too Big Message.
Packet_IPv6 (size:1280 octets)
Hdr_IPv6
Version = 6
PayloadLength = 1240
NextHeader = 58
SourceAddress = NUT_GLOBAL_ADDRESS
DestinationAddress = OFFLINK_GLOBAL_ADDRESS
ICMPv6_PacketTooBig
Type = 2
Code = 0
MTU = 1300
Payload (size:1232 octets)
<< FAIL >>
NUT do not send a Packet Too Big Message.
Because,
NUT can not set Link MTU of LINK1 interface.
etc.
<< JUDGMENT 2 >>
<< PASS >>
NUT send a Packet Too Big Message which includes Routing Header.
Packet_IPv6 (size:1280 octets)
Hdr_IPv6
Version = 6
PayloadLength = 1240
NextHeader = 58
SourceAddress = NUT_GLOBAL_ADDRESS
DestinationAddress = OFFLINK_GLOBAL_ADDRESS
ICMPv6_PacketTooBig
Type = 2
Code = 0
MTU = 1300
Payload (size:1232 octets)
<< FAIL >>
NUT do not send a Packet Too Big Message.
Because,
NUT can not set Link MTU of LINK1 interface.
etc.
=head1 SEE ALSO
perldoc V6evalTool
perldoc V6evalRemote
=cut