#!/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_init_ack_mismatch => "Send SCTP CHUNK_INIT_ACK (Mismatch in the OS and MIS parameters)", sctp_chunk_data_bad_str => "Send SCTP CHUNK_DATA (Invalid Stream Identifier)", sctp_chunk_error => "Recv SCTP CHUNK_ERROR (Invalid Stream Identifier)", sctp_chunk_error_and_sack => "Recv SCTP CHUNK_ERROR bundling with CHUNK_SACK", ); $IF0 = Link0; vCapture($IF0); sctpCheckEnv($IF0); sctpStartEchoClient($IF0); vListen($IF0, sctp_chunk_init_rcv, sctp_chunk_init_ack_mismatch); vAccept($IF0); vRecvMsg($IF0); vLogHTML('================ Main Test ================='); sctpUpdateSendTSN(); vSend($IF0, sctp_chunk_data_bad_str); %ret = vWarpRecv($IF0, 10, 0, 0, sctp_chunk_sack_rcv, sctp_chunk_error, sctp_chunk_error_and_sack); if($ret{status} != 0) { vLogHTML('Cannot receive SCTP CHUNK_ERROR
'); vLogHTML('NG'); exit $V6evalTool::exitFail; } if($ret{recvFrame} eq sctp_chunk_error) { %ret = vWarpRecv($IF0, 10, 0, 0, sctp_chunk_sack_rcv); if($ret{status} != 0 || $ret{recvFrame} ne sctp_chunk_sack_rcv) { vLogHTML('Cannot receive SCTP CHUNK_SACK
'); vLogHTML('NG'); exit $V6evalTool::exitFail; } } if($ret{recvFrame} eq sctp_chunk_sack_rcv) { %ret = vWarpRecv($IF0, 10, 0, 0, sctp_chunk_error); if($ret{status} != 0 || $ret{recvFrame} ne sctp_chunk_error) { vLogHTML('Cannot receive SCTP CHUNK_ERROR
'); vLogHTML('NG'); exit $V6evalTool::exitFail; } } sctpUpdateSendTSN(); vSend($IF0, sctp_chunk_data_snd); vShutdown($IF0, sctp_chunk_sack_rcv); vLogHTML(OK); exit $V6evalTool::exitPass; ###################################################################### __END__ =head1 NAME InitAckStreamMismatch.seq - INIT-ACK chunk is received with mismatch in the Outbound Stream and Inbound Stream parameters =head1 PURPOSE To check that if INIT-ACK chunk is received with mismatch in the Outbound Stream and Inbound Stream parameters then the endpoint should settle with minimum of the two parameters. =head1 SYNOPSIS =begin html
  ./InitAckStreamMismatch.seq [-tooloption ...] -pkt ./InitAckStreamMismatch.def
    -tooloption : v6eval tool option
  See Also: ../common/STD_PKT_COMMON.def
            ../common/SCTP_COMMON.def
=end html =head1 PRE-TEST CONDITION Association is not established between endpoint A and B. Also let the OS of B is Z. Arrange data in endpoint A such that INIT-ACK message is sent from endpoint A with MIS Y (OS = Z, MIS = Z, Z < Y) <----------------- COOKIE-ECHO COOKIE-ACK -----------------> TEST DESCRIPTION: 1. Attempt to initiate an association from endpoint B to A. Send INIT-ACK message with Maximal Inbound stream parameter less than the Outbound Stream of B. Record the message sequence using a signal emulator. 2. Check A: Either the association is aborted or COOKIE-ECHO is received 3. Check B: Range of MIS Stream id in endpoint B is 0 to Y-1. 4. Check C: Was the message sequence as above. Note: Association may be aborted in this case. =head1 NOTE None =head1 REFERENCE RFC 4960 5.1.1. Handle Stream Parameters In the INIT and INIT ACK chunks, the sender of the chunk MUST indicate the number of outbound streams (OSs) it wishes to have in the association, as well as the maximum inbound streams (MISs) it will accept from the other endpoint. =begin html
    After receiving the stream configuration information from the other
    side, each endpoint MUST perform the following check: If the peer's
    MIS is less than the endpoint's OS, meaning that the peer is
    incapable of supporting all the outbound streams the endpoint wants
    to configure, the endpoint MUST use MIS outbound streams and MAY
    report any shortage to the upper layer.  The upper layer can then
    choose to abort the association if the resource shortage is
    unacceptable.
=end html After the association is initialized, the valid outbound stream identifier range for either endpoint shall be 0 to min(local OS, remote MIS)-1.