#!/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 = (); $IF0 = Link0; vCapture($IF0); sctpCheckEnv($IF0); @cwnds = (); sctpStatusClient($IF0); vListen($IF0); vAccept($IF0); # Now CWND is 4380 $cwnds[@cwnds] = 4380; vLogHTML('Now the cwnd is 4380'); sctpUpdateRecvACK(); %ret = vWarpRecv($IF0, 30, 0, 0, sctp_chunk_data_rcv); if($ret{status} != 0 || $ret{recvFrame} ne sctp_chunk_data_rcv) { vLogHTML('Cannot receive SCTP CHUNK_DATA
'); vLogHTML('NG'); exit $V6evalTool::exitFail; } vLogHTML('================ Main Test ================='); %ret = vWarpRecv($IF0, 30, 0, 0, sctp_chunk_data_rcv); if($ret{status} != 0 || $ret{recvFrame} ne sctp_chunk_data_rcv) { vLogHTML('Cannot receive SCTP CHUNK_DATA
'); vLogHTML('NG'); exit $V6evalTool::exitFail; } vSend($IF0, sctp_chunk_sack_snd); $cwnds[@cwnds] = 1500; vLogHTML("Now the cwnd is $cwnds[@cwnds - 1]"); 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 InitCwndAfterRetran.seq - The initial cwnd after a retransmission timeout MUST be no more than 1*MTU =head1 PURPOSE To check that after a retransmission timeout, the initial cwnd is no more than 1*MTU. =head1 SYNOPSIS =begin html
  ./InitCwndAfterRetran.seq [-tooloption ...] -pkt ./InitCwndAfterRetran.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 Don't Send SACK <---------------- DATA (retransmission) SACK -----------------> TEST DESCRIPTION: 1. Check A: the initial cwnd before DATA transmission is set to 4380. 2. From endpoint B, send valid DATA message to endpoint A, when there is association between them. 3. From endpoint A, don't send SACK, and DATA should be transmitted again. 4. Check B: Congestion control window is 1*MTU. =head1 NOTE None =head1 REFERENCE RFC 4960 7.2.1. Slow-Start Beginning data transmission into a network with unknown conditions or after a sufficiently long idle period requires SCTP to probe the network to determine the available capacity. The slow-start algorithm is used for this purpose at the beginning of a transfer, or after repairing loss detected by the retransmission timer. o The initial cwnd before DATA transmission or after a sufficiently long idle period MUST be set to min(4*MTU, max (2*MTU, 4380 bytes)). =begin html
    o  The initial cwnd after a retransmission timeout MUST be no more
       than 1*MTU.
=end html o The initial value of ssthresh MAY be arbitrarily high (for example, implementations MAY use the size of the receiver advertised window). o Whenever cwnd is greater than zero, the endpoint is allowed to have cwnd bytes of data outstanding on that transport address. o When cwnd is less than or equal to ssthresh, an SCTP endpoint MUST use the slow-start algorithm to increase cwnd only if the current congestion window is being fully utilized, an incoming SACK advances the Cumulative TSN Ack Point, and the data sender is not in Fast Recovery. Only when these three conditions are met can the cwnd be increased; otherwise, the cwnd MUST not be increased. If these conditions are met, then cwnd MUST be increased by, at most, the lesser of 1) the total size of the previously outstanding DATA chunk(s) acknowledged, and 2) the destination's path MTU. This upper bound protects against the ACK-Splitting attack outlined in [SAVAGE99].