sctpTestStreamReconfig.pkt 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. //
  2. // Copyright (c) 2016 Jens Hoelscher, Michael Tuexen
  3. // All rights reserved.
  4. //
  5. // Redistribution and use in source and binary forms, with or without
  6. // modification, are permitted provided that the following conditions
  7. // are met:
  8. // 1. Redistributions of source code must retain the above copyright
  9. // notice, this list of conditions and the following disclaimer.
  10. // 2. Redistributions in binary form must reproduce the above copyright
  11. // notice, this list of conditions and the following disclaimer in the
  12. // documentation and/or other materials provided with the distribution.
  13. //
  14. // THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  15. // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  16. // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  17. // ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  18. // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  19. // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  20. // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  21. // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  22. // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  23. // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  24. // SUCH DAMAGE.
  25. //
  26. --tolerance_usecs=75000
  27. // Enable SCTP Extensions
  28. 0.0 `sysctl -w net.inet.sctp.ecn_enable=0`
  29. +0.0 `sysctl -w net.inet.sctp.pr_enable=0`
  30. +0.0 `sysctl -w net.inet.sctp.asconf_enable=0`
  31. #ifdef FreeBSD
  32. +0.0 `sysctl -iw net.inet.sctp.auth_disable=1`
  33. +0.0 `sysctl -iw net.inet.sctp.auth_enable=0`
  34. #endif
  35. +0.0 `sysctl -w net.inet.sctp.reconfig_enable=1`
  36. // Create a non-blocking 1-to-1 style socket
  37. +0.0 socket(..., SOCK_STREAM, IPPROTO_SCTP) = 3
  38. +0.0 fcntl(3, F_GETFL) = 0x02 (flags O_RDWR)
  39. +0.0 fcntl(3, F_SETFL, O_RDWR | O_NONBLOCK) = 0
  40. // Enable reception of stream reset requests
  41. +0.0 setsockopt(3, IPPROTO_SCTP, SCTP_ENABLE_STREAM_RESET, {assoc_id=0, assoc_value=SCTP_ENABLE_RESET_STREAM_REQ}, 8) = 0
  42. // Trigger the active associtation setup
  43. +0.1 connect(3, ..., ...) = -1 EINPROGRESS (Operation now in progress)
  44. +0.0 > sctp: INIT[flgs=0, tag=1, a_rwnd=..., os=..., is=..., tsn=1, SUPPORTED_EXTENSIONS[types=[RECONFIG]], SUPPORTED_ADDRESS_TYPES[types=[IPv4]]]
  45. +0.0 < sctp: INIT_ACK[flgs=0, tag=2, a_rwnd=15000, os=10, is=10, tsn=1, SUPPORTED_EXTENSIONS[types=[RECONFIG]], STATE_COOKIE[len=204, val=...]]
  46. +0.0 > sctp: COOKIE_ECHO[flgs=0, len=..., val=...]
  47. +0.0 < sctp: COOKIE_ACK[flgs=0]
  48. // Made traffic to increment ssn for one stream
  49. +0.0 < sctp: DATA[flgs=BE, len=1016, tsn=1, sid=0, ssn=0, ppid=7]
  50. * > sctp: SACK[flgs=0, cum_tsn=1, a_rwnd=..., gaps=[], dups=[]]
  51. +0.0 read(3, ..., 2000) = 1000
  52. +0.0 < sctp: DATA[flgs=BE, len=1016, tsn=2, sid=0, ssn=1, ppid=7]
  53. * > sctp: SACK[flgs=0, cum_tsn=2, a_rwnd=..., gaps=[], dups=[]]
  54. +0.0 read(3, ..., 2000) = 1000
  55. // Send INCOMING_SSN_RESET_REQUEST from upper Layer
  56. +0.1 setsockopt(3, IPPROTO_SCTP, SCTP_RESET_STREAMS, {srs_assoc_id=3,
  57. srs_flags=SCTP_STREAM_RESET_INCOMING,
  58. srs_number_streams=1,
  59. srs_stream_list=[0]}, 10) = 0
  60. +0.0 > sctp: RECONFIG[flgs=0x00, INCOMING_SSN_RESET[req_sn=1, sids=[0]]]
  61. +0.0 < sctp: RECONFIG[flgs=0x00, RECONFIG_RESPONSE[resp_sn=1, result=2]]
  62. // Send a second INCOMING_SSN_RESET_REQUEST to ensure that SUT increment the req_sn
  63. +0.1 setsockopt(3, IPPROTO_SCTP, SCTP_RESET_STREAMS, {srs_assoc_id=3,
  64. srs_flags=SCTP_STREAM_RESET_INCOMING,
  65. srs_number_streams=1,
  66. srs_stream_list=[0]}, 10) = 0
  67. +0.0 > sctp: RECONFIG[flgs=0x00, INCOMING_SSN_RESET[req_sn=2, sids=[0]]]
  68. +0.1 close(3) = 0
  69. +0.0 > sctp: SHUTDOWN[flgs=0, cum_tsn=2]
  70. +0.1 < sctp: SHUTDOWN_ACK[flgs=0]
  71. +0.0 > sctp: SHUTDOWN_COMPLETE[flgs=0]