#!/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); sctpStartClient($IF0); vListen($IF0); vAccept($IF0); vLogHTML('================ Main Test ================='); 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; } sctpUpdateRecvACK(-1); vSend($IF0, sctp_chunk_sack_snd); vRecvMsg($IF0); vShutdown($IF0); vLogHTML(OK); exit $V6evalTool::exitPass; ###################################################################### __END__ =head1 NAME TSNLessThanAckPoint.seq - SACK containing Cumulative TSN less than the Cumulative TSN Ack point =head1 PURPOSE To check that if SACK containing Cumulative TSN Ack is less than the Cumulative TSN Ack Point, the endpoint should drop the SACK. =head1 SYNOPSIS =begin html
  ./TSNLessThanAckPoint.seq [-tooloption ...] -pkt ./TSNLessThanAckPoint.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 A such that SACK containing Cumulative TSN less than the Cumulative TSN Ack point is sent to endpoint A. =head1 TEST PROCEDURE Endpoint A Endpoint B ULP (ESTABLISHED) (ESTABLISHED) <----- Send <----------------- DATA SACK -----------------> (containing Cumulative TSN less than the Cumulative TSN Ack point) <----------------- DATA SACK -----------------> TEST DESCRIPTION: 1. From endpoint B, send valid DATA message to endpoint A, when there is association between them. 2. From endpoint A, send SACK which containing Cumulative TSN less than the Cumulative TSN Ack point. 3. Check A: SACK message is dropped and DATA message is send again. =head1 NOTE None =head1 REFERENCE RFC 4960 6.2.1. Processing a Received SACK An endpoint SHOULD use the following rules to calculate the rwnd, using the a_rwnd value, the Cumulative TSN Ack, and Gap Ack Blocks in a received SACK. A) At the establishment of the association, the endpoint initializes the rwnd to the Advertised Receiver Window Credit (a_rwnd) the peer specified in the INIT or INIT ACK. B) Any time a DATA chunk is transmitted (or retransmitted) to a peer, the endpoint subtracts the data size of the chunk from the rwnd of that peer. C) Any time a DATA chunk is marked for retransmission, either via T3-rtx timer expiration (Section 6.3.3) or via Fast Retransmit (Section 7.2.4), add the data size of those chunks to the rwnd. Note: If the implementation is maintaining a timer on each DATA chunk, then only DATA chunks whose timer expired would be marked for retransmission. D) Any time a SACK arrives, the endpoint performs the following: =begin html
        i)  If Cumulative TSN Ack is less than the Cumulative TSN Ack
            Point, then drop the SACK.  Since Cumulative TSN Ack is
            monotonically increasing, a SACK whose Cumulative TSN Ack is
            less than the Cumulative TSN Ack Point indicates an out-of-
            order SACK.
=end html ii) Set rwnd equal to the newly received a_rwnd minus the number of bytes still outstanding after processing the Cumulative TSN Ack and the Gap Ack Blocks. iii) If the SACK is missing a TSN that was previously acknowledged via a Gap Ack Block (e.g., the data receiver reneged on the data), then consider the corresponding DATA that might be possibly missing: Count one miss indication towards Fast Retransmit as described in Section 7.2.4, and if no retransmit timer is running for the destination address to which the DATA chunk was originally transmitted, then T3-rtx is started for that destination address. iv) If the Cumulative TSN Ack matches or exceeds the Fast Recovery exitpoint (Section 7.2.4), Fast Recovery is exited.