#!/usr/bin/perl # # $Copyright$ # $TINY: setMTUwithRA.seq,v 1.9 2002/03/05 02:59:12 masaxmasa Exp $ # ######################################################################## BEGIN { $V6evalTool::TestVersion = '$Name: $ '; } 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' ); # # Test for MTU1400 # vLogHTML("force Link MTU of NUT to 1400 with MTU option in RA"); rebootNUT(); 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