#!/usr/bin/perl # # SCTP Conformance Test Suite Implementation # (C) Copyright Fujitsu Ltd. 2008, 2009 # # This file is part of the SCTP Conformance Test Suite implementation. # # The SCTP Conformance Test Suite implementation is free software; # you can redistribute it and/or modify it under the terms of # the GNU General Public License version 2 as published by # the Free Software Foundation. # # The SCTP Conformance Test Suite implementation is distributed in the # hope that it will be useful, but WITHOUT ANY WARRANTY; without even # the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR # PURPOSE. See the GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU CC; see the file COPYING. If not, write to # the Free Software Foundation, 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # # Please send any bug reports or fixes you make to the # email address(es): # networktest sctp # # Or submit a bug report through the following website: # http://networktest.sourceforge.net/ # # Written or modified by: # Hiroaki Kago # Wei Yongjun # # Any bugs reported given to us we will try to fix... any fixes shared will # be incorporated into the next SCTP release. # ############################################################################## BEGIN { $V6evalTool::TestVersion = '$Name: REL_1_0_0 $'; } use lib "../common"; use V6evalTool; use SCTP; %pktdesc = ( sctp_chunk_data_loc => "Recv SCTP CHUNK_DATA", ); $IF0 = Link0; vCapture($IF0); sctpCheckEnv($IF0); $SIZE = 1352; @cwnds = (); sctpStatusClient($IF0, 2, "-X 7 -x 2 -c $SIZE -I 7 -D"); vListen($IF0); vAccept($IF0); vLogHTML('================ Main Test =================
'); # Now CWND is 4380 $cwnds[@cwnds] = 4380; for($i = 0; $i < 4; $i++) { %ret = vWarpRecv($IF0, 10, 0, 0, sctp_chunk_data_loc); if($ret{status} != 0 || $ret{recvFrame} ne sctp_chunk_data_loc) { vLogHTML('Cannot receive SCTP CHUNK_DATA
'); vLogHTML('NG'); exit $V6evalTool::exitFail; } } vLogHTML('flight_size(5480) is greater than cwnd(4380)'); for($i = 0; $i < 2; $i++) { sctpUpdateRecvACK(1); vSend($IF0, sctp_chunk_sack_snd); $cwnds[@cwnds] = $cwnds[@cwnds - 1] + $SIZE; vLogHTML("Now the cwnd is $cwnds[@cwnds - 1]"); } # Rest 2 data packet we had recv sctpUpdateRecvACK(2); vSend($IF0, sctp_chunk_sack_snd); # Rest 3 data packet we do not recv vRecvMsg($IF0, sctp_chunk_data_loc); vRecvMsg($IF0, sctp_chunk_data_loc); vRecvMsg($IF0, sctp_chunk_data_loc); vSendMsg($IF0); vLogHTML('Now flight_size is 0'); for($i = 0; $i < 5; $i++) { %ret = vWarpRecv($IF0, 30, 0, 0, sctp_chunk_data_loc); if($ret{status} != 0 || $ret{recvFrame} ne sctp_chunk_data_loc) { vLogHTML('Cannot receive SCTP CHUNK_DATA
'); vLogHTML('NG'); exit $V6evalTool::exitFail; } } $cwnds[@cwnds] = 6000; vLogHTML("Now the cwnd is $cwnds[@cwnds - 1]"); sctpUpdateRecvACK(5); vSend($IF0, sctp_chunk_sack_snd); # Rest 2 data packet we do not recv vRecvMsg($IF0, sctp_chunk_data_loc); vRecvMsg($IF0, sctp_chunk_data_loc); vClose($IF0); $cwnds[@cwnds] = '-'; @ret = sctpGetRemoteStatus(@cwnds); for($i = 0; $i < @cwnds; $i++) { if((!defined($ret[$i]) && $cwnds[$i] != '-') || $cwnds[$i] != $ret[$i]) { vLogHTML(sprintf("The initial cwnd is not update correctly, except %s, but get %s
", $cwnds[$i] == '-' ? "NO CHANGE" : $cwnds[$i], defined($ret[$i]) ? $ret[$i]: "NO CHANGE")); vLogHTML('NG'); exit $V6evalTool::exitFail; } } vLogHTML(OK); exit $V6evalTool::exitPass; ###################################################################### __END__ =head1 NAME MaxBurstLimit.seq - Protocol parameter Max.Burst limits the number of new data chunks that can be sent =head1 PURPOSE To check that when the time comes for the sender to transmit new DATA chunks, the protocol parameter Max.Burst SHOULD be used to limit the number of packets sent. =head1 SYNOPSIS =begin html
  ./MaxBurstLimit.seq [-tooloption ...] -pkt ./MaxBurstLimit.def
    -tooloption : v6eval tool option
  See Also: ../common/STD_PKT_COMMON.def
            ../common/SCTP_COMMON.def
=end html =head1 PRE-TEST CONDITION Association is established between endpoint A and B. Arrange data in endpoint B such that DATA chunk is sent to endpoint A. =head1 TEST PROCEDURE Endpoint A Endpoint B ULP (ESTABLISHED) (ESTABLISHED) <----- Send <---------------- DATA 1 Don't Send SACK <---------------- DATA 2 Don't Send SACK <---------------- DATA 3 Don't Send SACK <---------------- DATA 4 Don't Send SACK SACK -----------------> (To DATA 1) SACK -----------------> (To DATA 2) SACK -----------------> (From DATA 3 to DATA 4) <---------------- DATA 5 SACK -----------------> <---------------- DATA 6 SACK -----------------> <---------------- DATA 7 SACK -----------------> DATA -----------------> <---------------- SACK <----- Send <---------------- DATA 1 Don't Send SACK <---------------- DATA 2 Don't Send SACK <---------------- DATA 3 Don't Send SACK <---------------- DATA 4 Don't Send SACK <---------------- DATA 5 SACK -----------------> (From DATA 1 to DATA 5) <---------------- DATA 6 SACK -----------------> <---------------- DATA 7 SACK -----------------> TEST DESCRIPTION: 1. Check A: the initial cwnd before DATA transmission is set to 4380. 2. From endpoint B, send valid DATA message 7 times to endpoint A, when there is association between them. 3. From endpoint A, after received 4 DATA message, send SACK of the first DATA to endpoint B. 4. Check B: Congestion control window is 5732 now. 5. Send SACK of the second DATA to endpoint B. 6. Check C: Congestion control window is 7084 now. 7. Received and SACK the rest DATA messages. 8. Send DATA message to endpoint B, and then endpoint B will send SACK. 9. From endpoint B, send valid DATA message 7 times to endpoint A. 10.From endpoint A, after received 5 DATA message, send SACK of all the five DATA to endpoint B. 11.Received and SACK the rest DATA messages. 12.Check D: Congestion control window is 6000 now. 13.Received and SACK the rest DATA messages. =head1 NOTE None =head1 REFERENCE RFC 4960 6.1. Transmission of DATA Chunks D) When the time comes for the sender to transmit new DATA chunks, the protocol parameter Max.Burst SHOULD be used to limit the number of packets sent. The limit MAY be applied by adjusting cwnd as follows: =begin html
       if((flightsize + Max.Burst*MTU) < cwnd) cwnd = flightsize +
       Max.Burst*MTU
=end html Or it MAY be applied by strictly limiting the number of packets emitted by the output routine.