#!/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", sctp_chunk_heartbeat => "Recv SCTP CHUNK_HEARTBEAT", sctp_chunk_heartbeat_ack => "Send SCTP CHUNK_HEARTBEAT_ACK", ); $IF0 = Link0; vCapture($IF0); sctpCheckEnv($IF0); $SIZE = 1352; @cwnds = (); sctpStatusClient($IF0, 5, "-c $SIZE"); vListen($IF0); vAccept($IF0); # Now CWND is 4380 $cwnds[@cwnds] = 4380; vLogHTML('Now the cwnd is 4380'); for($i = 0; $i < 4; $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; } } vLogHTML('flight_size(5408) is greater than cwnd(4380)'); sctpUpdateRecvACK(4); vSend($IF0, sctp_chunk_sack_snd); $cwnds[@cwnds] = $cwnds[@cwnds - 1] + 1500; vLogHTML("Now the cwnd is $cwnds[@cwnds - 1]"); vRecvMsg($IF0, sctp_chunk_data_loc); vLogHTML('================ Main Test ================='); %ret = vWarpRecv3($IF0, 100, 0, 0, sctp_chunk_heartbeat); if($ret{status} != 0 || $ret{recvFrame} ne 'sctp_chunk_heartbeat') { vLogHTML('Cannot receive SCTP CHUNK_HEARTBEAT
'); vLogHTML('NG'); exit $V6evalTool::exitFail; } $HBINFO = $ret{sctpGetFieldName("CHUNK_HEARTBEAT.HeartbeatInfo.Data")}; vWarpCPP("-DHBINFO=\\\"$HBINFO\\\""); vSend($IF0, sctp_chunk_heartbeat_ack); $cwnds[@cwnds] = 6000; 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 InitCwndAfterIdle.seq - The cwnd of the transport address should be adjusted to max(cwnd/2, 4*MTU) when does not transmit data =head1 PURPOSE To check that when the endpoint does not transmit data on a given transport address, the cwnd of the transport address should be adjusted to max(cwnd/2, 4*MTU) per RTO. =head1 SYNOPSIS =begin html
  ./InitCwndAfterIdle.seq [-tooloption ...] -pkt ./InitCwndAfterIdle.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 SACK -----------------> (From DATA1 to DATA 4) <---------------- DATA 5 SACK -----------------> (Does not transmit data) <----------------- HEARTBEAT HEARTBEAT-ACK ------------------> TEST DESCRIPTION: 1. Check A: the initial cwnd before DATA transmission is set to 4380. 2. From endpoint B, send valid DATA message 5 times to endpoint A, when there is association between them. 3. From endpoint A, after received 4 DATA message, send SACK of all the DATA to endpoint B. 4. Check B: Congestion control window is 5880 now. 5. Received one DATA message on endpoint A and send SACK to this message. 6. Do not send any message to another endpoint within the current Heartbeat period. HEARTBEAT message is sent from endpoint B. 7. Check C: Congestion control window is 6000 now. =head1 NOTE None =head1 REFERENCE RFC 4960 7.2.1. Slow-Start Because an endpoint's cwnd is not tied to its Cumulative TSN Ack Point, as duplicate SACKs come in, even though they may not advance the Cumulative TSN Ack Point an endpoint can still use them to clock out new data. That is, the data newly acknowledged by the SACK diminishes the amount of data now in flight to less than cwnd, and so the current, unchanged value of cwnd now allows new data to be sent. On the other hand, the increase of cwnd must be tied to the Cumulative TSN Ack Point advancement as specified above. Otherwise, the duplicate SACKs will not only clock out new data, but also will adversely clock out more new data than what has just left the network, during a time of possible congestion. =begin html
    o  When the endpoint does not transmit data on a given transport
       address, the cwnd of the transport address should be adjusted to
       max(cwnd/2, 4*MTU) per RTO.
=end html