#!/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: checkPMTUincrease.seq,v 1.1.1.1 2000/10/31 22:39:41 sekiya Exp $ ######################################################################## BEGIN { $V6evalTool::TestVersion = '$Name: $ '; } use V6evalTool; use PMTU; $IF=Link0; $WAIT_TIME=5; $WAIT_DONOT_INCREASE_TIME=295; #$WAIT_DONOT_INCREASE_TIME=120; $WAIT_DETECT_INCREASE_TIME=900; #$WAIT_DETECT_INCREASE_TIME=120; %pktdesc = ( TooBigMesg => 'TN --TooBigMesg(MTU:1300)--> NUT', frag_1400_1st => 'TN --1st Fragmented 800/1360--> NUT', frag_1400_2nd => 'TN --2nd Fragmented 560/1360--> NUT', EchoRequest_1st_1500 => 'TN --1st Fragmented 800/1460--> NUT', EchoRequest_2nd_1500 => 'TN --1st Fragmented 660/1460--> NUT', ); # # check that detection of increases is done less than 5 minutes # checkNUT(hostrouter); #rebootNUT(); vCapture($IF); if(1) { $ret=pmtuClearNCE(); if( $ret != 0) { vLog("NUT'NCE can not be cleared"); goto error; } $ret=pmtuClearGlobalNCE(); if( $ret != 0) { vLog("NUT'NCE can not be cleared"); goto error; } } $ret=makeNCE(); if( $ret !=0) { vLog("NUT can not be initialized !!"); goto error; } vSend($IF,"EchoRequest_1500"); %ret=vRecv($IF,5,0,1,"EchoReply_1500"); if( $ret{status} != 0) { vLog("Can not receive Echo Reply from Virtual host!!"); goto error; } vSend($IF,"TooBigMesg_1350"); vSleep ($WAIT_DONOT_INCREASE_TIME); sendFragmentEchoRequest($IF, [frag_1400_1st,frag_1400_2nd], ['1st Fragmented 800/1360', '2nd Fragmented 560/1360'] ); %ret=vRecv($IF,5,0,1, ('frag_1400_reply_1st','frag_1400_reply_2nd','reply_1400')); if( $ret{status} !=0) { vLog("Can not receive smaller Echo Reply !!"); goto error; }elsif ( $ret{recvFrame} eq 'reply_1400') { vLog("** Test is FALL **"); vLog("NUT start detect of Path MTU increase"); goto error; }elsif ( $ret{recvFrame} eq frag_1400_reply_1st || $ret{recvFrame} eq frag_1400_reply_2nd) { vLog("NUT don't start detect of Path MTU increase"); }else { vLog("Can not receive Echo Reply !!"); goto error; } # # check that attempt to detect is done or not # #rebootNUT(); if(1) { $ret=pmtuClearGlobalNCE(); if( $ret != 0) { vLog("NUT'NCE can not be cleared"); goto error; } $ret=pmtuClearNCE(); if( $ret != 0) { vLog("NUT'NCE can not be cleared"); goto error; } } $ret=makeNCE(); if( $ret !=0) { vLog("NUT can not be initialized !!"); goto error; } vSend($IF,"EchoRequest_1350"); %ret=vRecv($IF,5,0,1,"EchoReply_1350"); if( $ret{status} != 0) { vLog("Can not receive Echo Reply from Virtual host!!"); goto error; } vSend($IF,"TooBigMesg_1300"); vSleep ($WAIT_DETECT_INCREASE_TIME); sendFragmentEchoRequest($IF, [EchoRequest_1st_1500,EchoRequest_2nd_1500], ['1st Fragmented 800/1460','2nd Fragmented 660/1460'] ); vLog("Send Fragmented even Echo Request (MTU:1500)"); %ret=vRecv($IF,5,0,0, (frag_1500_reply_1st,frag_1500_reply_2nd,EchoReply_1500,ns)); if( $ret{status} !=0) { vLog("Can not receive smaller Echo Reply !!"); goto error; }elsif ( $ret{recvFrame} eq 'ns') { vLog("TN(Router) receives ns from NUT"); if ($type eq host) { vSend($IF, na); }else { vSend($IF, na_router); } %ret=vRecv($IF,5,0,1, (frag_1500_reply_1st,frag_1500_reply_2nd,EchoReply_1500)); if( $ret{status} !=0) { vLog("Can not receive smaller Echo Reply !!"); goto error; } } if ( $ret{recvFrame} eq 'frag_1500_reply_1st' || $ret{recvFrame} eq 'frag_1500_reply_2nd') { vLog("Can not receive Echo Reply (MTU:1500)!!"); vLog("******************************************************"); vLog("* BUT detect Path MTU increase SHOULD be implemented *"); vLog("******************************************************"); vLog("FAIL"); exit $V6evalTool::exitWarn; }elsif ( $ret{recvFrame} eq 'EchoReply_1500') { vLog("NUT detects increase of Path MTU"); vLog("OK"); exit $V6evalTool::exitPass; } goto error; # # Error # error: vLog("FAIL"); exit $V6evalTool::exitFail; ######################################################################## __END__ =head1 NAME checkPMTUincrease - Verify that node detects increase Path MTU =head1 TARGET Host =head1 SYNOPSIS checkPMTUincrease.seq [-tooloption ...] -p checkPMTUincrease.def =head1 NETWORK CONFIGURATION This test is OFF-LINK Network Configuration test. In this test, TN play a Roll of the Router. Physical Network configuration --------------------------------------- | | NUT TN Logical Network Configuration HOST A (globaladdress:A) | ---------------------------------- | Router | ---------------------------------- | NUT (globaladdress:B) 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 There are 2 patterns for initialize. -- Test for host -- 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 Wait (5 sec.) Ignoring DAD packets for global address. -- Test for router -- TN attempt to execute remote command 'vRemote(route.rmt)'. 'route add -inet6 3ffe:501:ffff:109 TN'slink-local-address' =head1 TEST PROCEDURE "checkPMTUincrease" verifies that the node attempts to detect increase of Path MTU. - NUT must not attempt to detect an increase less than 5 minutes after a Too Big Mesg. TN NUT --------------------------- 1. TN send Echo Request. === echo request ===> 2. NUT send Echo Reply. <=== echo reply === 3. TN send ICMPv6 Too Big Mesg include MTU (1300). === ICMPv6 Too Big Mesg ===> 4. TN sleep 295 seconds in perl script. 5.1 TN send Echo Request which is fragmented. orignal packet's size is 1500 (ether's Link MTU. === echo request 1st ===> === echo request 2nd ===> 5.2 NUT send Echo Reply << JUDGMENT >> <=== echo reply 1st === <=== echo reply 2nd === - NUT attemp to detect an increase of Path MTU at infrequent intervals. The recommended se TN NUT --------------------------- 1. TN send Echo Request. === echo request ===> 2. NUT send Echo Reply. <=== echo reply === 3. TN send ICMPv6 Too Big Mesg include MTU (1300). === ICMPv6 Too Big Mesg ===> 4. TN sleep 900 seconds in perl script. why 900 second ? The recommended setting for this timer is 10 minutes. 5.1 TN send Echo Request which is fragmented. orignal packet's size is 1500 (ether's Link MTU. === echo request 1st ===> === echo request 2nd ===> 5.2 NUT send Echo Reply << JUDGMENT >> <=== echo reply === =head1 JUDGMENT << PASS >> NUT send Echo Reply which is no fragmented. node detects the increase of Path MTU. =head1 SEE ALSO perldoc V6evalTool perldoc V6evalRemote =cut