#!/usr/bin/perl # # Copyright (C) 2002, 2003, 2004, 2005 Yokogawa Electric Corporation, # INTAP(Interoperability Technology Association for Information # Processing, Japan), 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. # $TINY: setMTUwithRA.seq,v 1.9 2002/03/05 02:59:12 masaxmasa Exp $ # ######################################################################## BEGIN { $V6evalTool::TestVersion = '$Name: REL_2_1_2 $ '; } use V6evalTool; use PMTU; $IF=Link0; $WAIT_TO_SET_LINK_MTU=1; %pktdesc = ( RA_1400 => 'TN ---RA with MTU option (MTU1400)--> NUT', echo_request_1500 => 'TN ---ICMP Echo Request (1500)------> NUT', echo_reply_1500 => 'TN <--ICMP Echo Reply (1500)--------- NUT', echo_request_1400 => 'TN ---ICMP Echo Request (1400)------> NUT', echo_reply_1400 => 'TN <--ICMP Echo Reply (1400)--------- NUT', frag_echo_reply_1500_1st_mtu1280 => 'TN <--ICMP Echo Reply (1/2,MTU1280)-- NUT', frag_echo_reply_1500_2nd_mtu1280 => 'TN <--ICMP Echo Reply (2/2,MTU1280)-- NUT', frag_echo_reply_1500_1st_mtu1400 => 'TN <--ICMP Echo Reply (1/2,MTU1400)-- NUT', frag_echo_reply_1500_2nd_mtu1400 => 'TN <--ICMP Echo Reply (2/2,MTU1400)-- NUT', frag_echo_request_1500_1st_mtu1400 => 'TN ---ICMP Echo Request (1/2,MTU1400)-> NUT', frag_echo_request_1500_2nd_mtu1400 => 'TN ---ICMP Echo Request (2/2,MTU1400)-> NUT' ); ########################################################## #----- Check Target Type $type=$V6evalTool::NutDef{Type}; if($type eq router) { vLogHTML("This test is for the host only
"); exit $V6evalTool::exitHostOnly; } if($type ne host) { vLogHTML(ndErrmsg("ERROR: $V6evalTool::NutDef{Type}: ". "Unknown target type
")); exit $V6evalTool::exitFail; } ########################################################## # # Test for MTU1400 # vLogHTML("force Link MTU of NUT to 1400 with MTU option in RA"); flushtables($V6evalTool::NutDef{System}); vCapture($IF); vSend($IF, RA_1400); vSleep ($WAIT_TO_SET_LINK_MTU); #vSend($IF, na); vClear($IF); vSend($IF, echo_request_1400); %ret=vRecv($IF,5,0,0, 'echo_reply_1400', 'frag_echo_reply_1400_1st_mtu1280', 'frag_echo_reply_1400_2nd_mtu1280', 'ns', 'ns_srcGlobal' ); if( $ret{recvFrame} eq 'ns' || $ret{recvFrame} eq 'ns_srcGlobal') { if( $ret{recvFrame} eq 'ns' ) { PMTU::sendNA(); }elsif( $ret{recvFrame} eq 'ns_srcGlobal' ) { PMTU::sendNA_srcGlobal(); } %ret=vRecv($IF,5,0,0, 'echo_reply_1400', 'frag_echo_reply_1400_1st_mtu1280', 'frag_echo_reply_1400_2nd_mtu1280', ); if( $ret{status} != 0) { vLogHTML("TN CAN NOT receive Echo Reply from NUT
"); vLogHTML('NG'); vClear($IF); exit $V6evalTool::exitFail; }elsif( $ret{recvFrame} eq 'frag_echo_reply_1400_1st_mtu1280') { vLogHTML("TN receives Echo Reply from NUT(1/2 MTU1280)"); %ret=vRecv($IF, 5,0,0, 'frag_echo_reply_1400_2nd_mtu1280' ); if( $ret{recvFrame} eq 'frag_echo_reply_1400_2nd_mtu1280' ) { # Correct Case vLogHTML("TN receives Echo Reply from NUT(2/2 MTU1280)
"); vLogHTML('OK'); }else{ vLogHTML("TN CAN'T receives Echo Reply from NUT(2/2 MTU1280)
"); vLogHTML('NG'); exit $V6evalTool::exitFail; } }elsif( $ret{recvFrame} eq 'echo_reply_1400') { # Correct Case vLogHTML("TN received Echo Reply (1400)
"); vLogHTML('OK'); }else { vLogHTML("NUT can not transmit any packets
"); vLogHTML('NG'); exit $V6evalTool::exitFail; } ####################### }elsif( $ret{recvFrame} eq 'frag_echo_reply_1400_1st_mtu1280') { vLogHTML("TN receives Echo Reply from NUT(1/2 MTU1280)"); %ret=vRecv($IF, 5,0,0, 'frag_echo_reply_1400_2nd_mtu1280' ); if( $ret{recvFrame} eq 'frag_echo_reply_1400_2nd_mtu1280' ) { # Correct Case vLogHTML("TN receives Echo Reply from NUT(2/2 MTU1280)
"); vLogHTML('OK'); }else{ vLogHTML("TN CAN'T receives Echo Reply from NUT(2/2 MTU1280)
"); vLogHTML('NG'); exit $V6evalTool::exitFail; } }elsif( $ret{recvFrame} eq 'echo_reply_1400') { # Correct Case vLogHTML("TN received Echo Reply (1400)
"); vLogHTML('OK'); }else { vLogHTML("NUT can not transmit any packets
"); vLogHTML('NG'); exit $V6evalTool::exitFail; } ####################### vClear($IF); vSend($IF, frag_echo_request_1500_1st_mtu1400); vSend($IF, frag_echo_request_1500_2nd_mtu1400); %ret=vRecv($IF,5,0,0, ns,ns_srcGlobal, 'echo_reply_1500', 'frag_echo_reply_1500_1st_mtu1280', 'frag_echo_reply_1500_2nd_mtu1280', 'frag_echo_reply_1500_1st_mtu1400', 'frag_echo_reply_1500_2nd_mtu1400', 'ns', 'ns_srcGlobal' ); if( $ret{recvFrame} eq 'ns' || $ret{recvFrame} eq 'ns_srcGlobal') { if( $ret{recvFrame} eq 'ns' ) { PMTU::sendNA(); }elsif( $ret{recvFrame} eq 'ns_srcGlobal' ) { PMTU::sendNA_srcGlobal(); } %ret=vRecv($IF, 5,0,0, 'echo_reply_1500', 'frag_echo_reply_1500_1st_mtu1280', 'frag_echo_reply_1500_2nd_mtu1280', 'frag_echo_reply_1500_1st_mtu1400', 'frag_echo_reply_1500_2nd_mtu1400' ); if( $ret{status} != 0) { vLogHTML("TN CAN NOT receive Echo Reply from NUT
"); vLogHTML('NG'); vClear($IF); exit $V6evalTool::exitFail; }else{ # Correct Case vLogHTML("TN received Echo Reply from NUT
"); vLogHTML('OK'); vClear($IF); } }elsif( $ret{recvFrame} eq 'frag_echo_reply_1500_1st_mtu1400' ) { vLogHTML("TN receives Echo Reply from NUT(1/2 MTU1400)"); %ret=vRecv($IF, 5,0,0, 'frag_echo_reply_1500_2nd_mtu1400' ); if( $ret{recvFrame} eq 'frag_echo_reply_1500_2nd_mtu1400' ) { # Correct Case vLogHTML("TN receives Echo Reply from NUT(2/2 MTU1400)
"); vLogHTML('OK'); }else{ vLogHTML("TN CAN'T receives Echo Reply from NUT(2/2 MTU1400)
"); vLogHTML('NG'); exit $V6evalTool::exitFail; } }elsif( $ret{recvFrame} eq 'frag_echo_reply_1500_1st_mtu1280') { vLogHTML("TN receives Echo Reply from NUT(1/2 MTU1280)"); %ret=vRecv($IF, 5,0,0, 'frag_echo_reply_1500_2nd_mtu1280' ); if( $ret{recvFrame} eq 'frag_echo_reply_1500_2nd_mtu1280' ) { # Correct Case vLogHTML("TN receives Echo Reply from NUT(2/2 MTU1280)
"); vLogHTML('OK'); }else{ vLogHTML("TN CAN'T receives Echo Reply from NUT(2/2 MTU1280)
"); vLogHTML('NG'); exit $V6evalTool::exitFail; } }elsif( $ret{recvFrame} eq 'echo_reply_1500') { vLogHTML("TN received Echo Reply (1500)
"); vLogHTML('NG'); exit $V6evalTool::exitFail; }else { vLogHTML("NUT can not transmit any packets
"); vLogHTML('NG'); exit $V6evalTool::exitFail; } # check the sizeof Echo Reply exit $V6evalTool::exitPass; ######################################################################## __END__ =head1 NAME setMTUwithRA - Verify changing MTU w/ received RA =head1 TARGET Host =head1 SYNOPSIS setMTUwithRA.seq [-tooloption ...] -p setMTUwithRA.def =head1 NETWORK CONFIGURATION This test evaluate the behavior of NUT when it receive the RA with MTU option. In this test, NUT is a host and TN plays a Roll of Router and other host. Phisical Network configuration --------+---------------+---------- | | NUT TN Logical Network Configuration NUT | ----------------+-------+-------- | Router-A | ----------------+-------+-------- | HOST In this test, NUT receives RA with MTU. =head1 INITIALIZATION The TN send a RA to assign global address prefix. TN NUT | | ---+------------+------ ===multicast RA===> src=TN's link-local dst=LinkLocal-all-node M=0, O=0, Lifetime=3600, ReachableTime=60000, RetransTimer=1005 Prefix: L=1, A=1, ValidLifetime=3600005, PreferredLifetime=3600005 Prefix=3ffe:501:ffff:100::, PrefixLength=64 option MTU=1400 Wait (5 sec.) Ignoring DAD packets for global address. =head1 TEST PROCEDURE "setMTUwithRA" verify NUT's behavior when it receives RA with MTU option. TN NUT | | ---+------------+------ 1. RA (MTU=1400) TN send RA with MTU=1400. TN === RA(MTU=1400) ===> NUT 2. TN Sends Fragmented Echo Request TN send Echo Request. TN ==== echo request(1400) ===> NUT 4. NUT Sends Fragmented Echo Reply NUT send Echo Reply. << JUDGMENT 1 >> TN <=== echo reply(1400) ====== NUT 3. TN Sends Fragmented Echo Request TN send Echo Request. TN === echo request(1/2 of 1500 MTU=1400) ===> NUT TN === echo request(2/2 of 1500 MTU=1400) ===> NUT 4. NUT Sends Fragmented Echo Reply NUT send Echo Reply << JUDGMENT 1 >> TN <=== echo reply(1/2 of 1500 MTU=1400) === NUT TN <=== echo reply(2/2 of 1500 MTU=1400) === NUT =head1 JUDGMENT << JUDGMENT 1 -PASS- >> NUT sends Echo Reply "PASS" means that NUT set valid MTU in received RA. And fragmented packets are correct. But if the NUT doesn't support PMTU Discovery, the NUT MUST NOT send echo reply greater than Minimum MTU. << JUDGMENT 2 -PASS- >> NUT sends Echo Reply "PASS" means that NUT sets valid MTU in received RA. And fragmented packets are correct. But if the NUT is LCNA, it may not be able to deal with packets greater than Minimum MTU, in this case NUT doesn't transmit echo reply. And also it could not fragment packets, in this case NUT doesn't transmit echo reply. Both cases are allowed in LCNA specification. =head1 SEE ALSO perldoc V6evalTool perldoc V6evalRemote =cut