draft-ietf-tsvwg-sctpsocket-16.txt   draft-ietf-tsvwg-sctpsocket-17.txt 
Network Working Group R. Stewart Network Working Group R. Stewart
Internet-Draft Cisco Systems, Inc. Internet-Draft The Resource Group
Intended status: Informational Q. Xie Intended status: Informational K. Poon
Expires: August 27, 2008 Motorola, Inc. Expires: January 15, 2009 Sun Microsystems, Inc.
L. Yarroll
TimeSys Corp
K. Poon
Sun Microsystems, Inc.
M. Tuexen M. Tuexen
Univ. of Applied Sciences Muenster Univ. of Applied Sciences Muenster
V. Yasevich V. Yasevich
HP HP
February 24, 2008 P. Lei
Cisco Systems, Inc.
July 14, 2008
Sockets API Extensions for Stream Control Transmission Protocol (SCTP) Sockets API Extensions for Stream Control Transmission Protocol (SCTP)
draft-ietf-tsvwg-sctpsocket-16.txt draft-ietf-tsvwg-sctpsocket-17.txt
Status of this Memo Status of this Memo
By submitting this Internet-Draft, each author represents that any By submitting this Internet-Draft, each author represents that any
applicable patent or other IPR claims of which he or she is aware applicable patent or other IPR claims of which he or she is aware
have been or will be disclosed, and any of which he or she becomes have been or will be disclosed, and any of which he or she becomes
aware will be disclosed, in accordance with Section 6 of BCP 79. aware will be disclosed, in accordance with Section 6 of BCP 79.
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF), its areas, and its working groups. Note that Task Force (IETF), its areas, and its working groups. Note that
skipping to change at page 1, line 43 skipping to change at page 1, line 41
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
The list of current Internet-Drafts can be accessed at The list of current Internet-Drafts can be accessed at
http://www.ietf.org/ietf/1id-abstracts.txt. http://www.ietf.org/ietf/1id-abstracts.txt.
The list of Internet-Draft Shadow Directories can be accessed at The list of Internet-Draft Shadow Directories can be accessed at
http://www.ietf.org/shadow.html. http://www.ietf.org/shadow.html.
This Internet-Draft will expire on August 27, 2008. This Internet-Draft will expire on January 15, 2009.
Abstract Abstract
This document describes a mapping of the Stream Control Transmission This document describes a mapping of the Stream Control Transmission
Protocol SCTP into a sockets API. The benefits of this mapping Protocol SCTP into a sockets API. The benefits of this mapping
include compatibility for TCP applications, access to new SCTP include compatibility for TCP applications, access to new SCTP
features and a consolidated error and event notification scheme. features and a consolidated error and event notification scheme.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 5 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 5
2. Conventions . . . . . . . . . . . . . . . . . . . . . . . . . 6 2. Conventions . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.1. Data Types . . . . . . . . . . . . . . . . . . . . . . . . 6 3. Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3. one-to-many style Interface . . . . . . . . . . . . . . . . . 6 4. one-to-many style Interface . . . . . . . . . . . . . . . . . 6
3.1. Basic Operation . . . . . . . . . . . . . . . . . . . . . 6 4.1. Basic Operation . . . . . . . . . . . . . . . . . . . . . 6
3.1.1. socket() - one-to-many style socket . . . . . . . . . 7 4.1.1. socket() - one-to-many style socket . . . . . . . . . 8
3.1.2. bind() - one-to-many style socket . . . . . . . . . . 8 4.1.2. bind() - one-to-many style socket . . . . . . . . . . 8
3.1.3. listen() - One-to-many style socket . . . . . . . . . 9 4.1.3. listen() - One-to-many style socket . . . . . . . . . 9
3.1.4. sendmsg() and recvmsg() - one-to-many style socket . . 9 4.1.4. sendmsg() and recvmsg() - one-to-many style socket . . 10
3.1.5. close() - one-to-many style socket . . . . . . . . . . 11 4.1.5. close() - one-to-many style socket . . . . . . . . . . 11
3.1.6. connect() - one-to-many style socket . . . . . . . . . 12 4.1.6. connect() - one-to-many style socket . . . . . . . . . 12
3.2. Implicit Association Setup . . . . . . . . . . . . . . . . 12 4.2. Implicit Association Setup . . . . . . . . . . . . . . . . 12
3.3. Non-blocking mode . . . . . . . . . . . . . . . . . . . . 13 4.3. Non-blocking mode . . . . . . . . . . . . . . . . . . . . 13
3.4. Special considerations . . . . . . . . . . . . . . . . . . 14 4.4. Special considerations . . . . . . . . . . . . . . . . . . 14
4. one-to-one style Interface . . . . . . . . . . . . . . . . . . 15 5. one-to-one style Interface . . . . . . . . . . . . . . . . . . 15
4.1. Basic Operation . . . . . . . . . . . . . . . . . . . . . 15 5.1. Basic Operation . . . . . . . . . . . . . . . . . . . . . 16
4.1.1. socket() - one-to-one style socket . . . . . . . . . . 16 5.1.1. socket() - one-to-one style socket . . . . . . . . . . 16
4.1.2. bind() - one-to-one style socket . . . . . . . . . . . 17 5.1.2. bind() - one-to-one style socket . . . . . . . . . . . 17
4.1.3. listen() - one-to-one style socket . . . . . . . . . . 18 5.1.3. listen() - one-to-one style socket . . . . . . . . . . 18
4.1.4. accept() - one-to-one style socket . . . . . . . . . . 18 5.1.4. accept() - one-to-one style socket . . . . . . . . . . 18
4.1.5. connect() - one-to-one style socket . . . . . . . . . 18 5.1.5. connect() - one-to-one style socket . . . . . . . . . 19
4.1.6. close() - one-to-one style socket . . . . . . . . . . 19 5.1.6. close() - one-to-one style socket . . . . . . . . . . 20
4.1.7. shutdown() - one-to-one style socket . . . . . . . . . 20 5.1.7. shutdown() - one-to-one style socket . . . . . . . . . 20
4.1.8. sendmsg() and recvmsg() - one-to-one style socket . . 20 5.1.8. sendmsg() and recvmsg() - one-to-one style socket . . 21
4.1.9. getpeername() . . . . . . . . . . . . . . . . . . . . 21 5.1.9. getpeername() . . . . . . . . . . . . . . . . . . . . 21
5. Data Structures . . . . . . . . . . . . . . . . . . . . . . . 21 6. Data Structures . . . . . . . . . . . . . . . . . . . . . . . 21
5.1. The msghdr and cmsghdr Structures . . . . . . . . . . . . 21 6.1. The msghdr and cmsghdr Structures . . . . . . . . . . . . 22
5.2. SCTP msg_control Structures . . . . . . . . . . . . . . . 22 6.2. SCTP msg_control Structures . . . . . . . . . . . . . . . 23
5.2.1. SCTP Initiation Structure (SCTP_INIT) . . . . . . . . 23 6.2.1. SCTP Initiation Structure (SCTP_INIT) . . . . . . . . 24
5.2.2. SCTP Header Information Structure (SCTP_SNDRCV) . . . 25 6.2.2. SCTP Header Information Structure (SCTP_SNDRCV) . . . 25
5.2.3. Extended SCTP Header Information Structure 6.2.3. Extended SCTP Header Information Structure
(SCTP_EXTRCV) . . . . . . . . . . . . . . . . . . . . 27 (SCTP_EXTRCV) . . . . . . . . . . . . . . . . . . . . 28
5.3. SCTP Events and Notifications . . . . . . . . . . . . . . 29 6.3. SCTP Events and Notifications . . . . . . . . . . . . . . 29
5.3.1. SCTP Notification Structure . . . . . . . . . . . . . 30 6.3.1. SCTP Notification Structure . . . . . . . . . . . . . 30
5.4. Ancillary Data Considerations and Semantics . . . . . . . 41 6.4. Ancillary Data Considerations and Semantics . . . . . . . 42
5.4.1. Multiple Items and Ordering . . . . . . . . . . . . . 41 6.4.1. Multiple Items and Ordering . . . . . . . . . . . . . 42
5.4.2. Accessing and Manipulating Ancillary Data . . . . . . 42 6.4.2. Accessing and Manipulating Ancillary Data . . . . . . 43
5.4.3. Control Message Buffer Sizing . . . . . . . . . . . . 42 6.4.3. Control Message Buffer Sizing . . . . . . . . . . . . 43
6. Common Operations for Both Styles . . . . . . . . . . . . . . 43 7. Common Operations for Both Styles . . . . . . . . . . . . . . 44
6.1. send(), recv(), sendto(), recvfrom() . . . . . . . . . . . 43 7.1. send(), recv(), sendto(), recvfrom() . . . . . . . . . . . 44
6.2. setsockopt(), getsockopt() . . . . . . . . . . . . . . . . 44 7.2. setsockopt(), getsockopt() . . . . . . . . . . . . . . . . 46
6.3. read() and write() . . . . . . . . . . . . . . . . . . . . 45 7.3. read() and write() . . . . . . . . . . . . . . . . . . . . 46
6.4. getsockname() . . . . . . . . . . . . . . . . . . . . . . 45 7.4. getsockname() . . . . . . . . . . . . . . . . . . . . . . 46
7. Socket Options . . . . . . . . . . . . . . . . . . . . . . . . 46 8. Socket Options . . . . . . . . . . . . . . . . . . . . . . . . 47
7.1. Read / Write Options . . . . . . . . . . . . . . . . . . . 48 8.1. Read / Write Options . . . . . . . . . . . . . . . . . . . 49
7.1.1. Retransmission Timeout Parameters (SCTP_RTOINFO) . . . 48 8.1.1. Retransmission Timeout Parameters (SCTP_RTOINFO) . . . 49
7.1.2. Association Parameters (SCTP_ASSOCINFO) . . . . . . . 48 8.1.2. Association Parameters (SCTP_ASSOCINFO) . . . . . . . 49
7.1.3. Initialization Parameters (SCTP_INITMSG) . . . . . . . 50 8.1.3. Initialization Parameters (SCTP_INITMSG) . . . . . . . 51
7.1.4. SO_LINGER . . . . . . . . . . . . . . . . . . . . . . 50 8.1.4. SO_LINGER . . . . . . . . . . . . . . . . . . . . . . 51
7.1.5. SCTP_NODELAY . . . . . . . . . . . . . . . . . . . . . 50 8.1.5. SCTP_NODELAY . . . . . . . . . . . . . . . . . . . . . 51
7.1.6. SO_RCVBUF . . . . . . . . . . . . . . . . . . . . . . 51 8.1.6. SO_RCVBUF . . . . . . . . . . . . . . . . . . . . . . 52
7.1.7. SO_SNDBUF . . . . . . . . . . . . . . . . . . . . . . 51 8.1.7. SO_SNDBUF . . . . . . . . . . . . . . . . . . . . . . 52
7.1.8. Automatic Close of associations (SCTP_AUTOCLOSE) . . . 51 8.1.8. Automatic Close of associations (SCTP_AUTOCLOSE) . . . 52
7.1.9. Set Peer Primary Address 8.1.9. Set Peer Primary Address
(SCTP_SET_PEER_PRIMARY_ADDR) . . . . . . . . . . . . . 51 (SCTP_SET_PEER_PRIMARY_ADDR) . . . . . . . . . . . . . 52
7.1.10. Set Primary Address (SCTP_PRIMARY_ADDR) . . . . . . . 52 8.1.10. Set Primary Address (SCTP_PRIMARY_ADDR) . . . . . . . 53
7.1.11. Set Adaptation Layer Indicator 8.1.11. Set Adaptation Layer Indicator
(SCTP_ADAPTATION_LAYER) . . . . . . . . . . . . . . . 52 (SCTP_ADAPTATION_LAYER) . . . . . . . . . . . . . . . 53
7.1.12. Enable/Disable message fragmentation 8.1.12. Enable/Disable message fragmentation
(SCTP_DISABLE_FRAGMENTS) . . . . . . . . . . . . . . . 53 (SCTP_DISABLE_FRAGMENTS) . . . . . . . . . . . . . . . 54
7.1.13. Peer Address Parameters (SCTP_PEER_ADDR_PARAMS) . . . 53 8.1.13. Peer Address Parameters (SCTP_PEER_ADDR_PARAMS) . . . 54
7.1.14. Set default send parameters 8.1.14. Set default send parameters
(SCTP_DEFAULT_SEND_PARAM) . . . . . . . . . . . . . . 55 (SCTP_DEFAULT_SEND_PARAM) . . . . . . . . . . . . . . 56
7.1.15. Set notification and ancillary events (SCTP_EVENTS) . 56 8.1.15. Set notification and ancillary events (SCTP_EVENTS) . 57
7.1.16. Set/clear IPv4 mapped addresses 8.1.16. Set/clear IPv4 mapped addresses
(SCTP_I_WANT_MAPPED_V4_ADDR) . . . . . . . . . . . . . 56 (SCTP_I_WANT_MAPPED_V4_ADDR) . . . . . . . . . . . . . 57
7.1.17. Get or set the maximum fragmentation size 8.1.17. Get or set the maximum fragmentation size
(SCTP_MAXSEG) . . . . . . . . . . . . . . . . . . . . 56 (SCTP_MAXSEG) . . . . . . . . . . . . . . . . . . . . 57
7.1.18. Add a chunk that must be authenticated 8.1.18. Add a chunk that must be authenticated
(SCTP_AUTH_CHUNK) . . . . . . . . . . . . . . . . . . 57 (SCTP_AUTH_CHUNK) . . . . . . . . . . . . . . . . . . 58
7.1.19. Get or set the list of supported HMAC Identifiers 8.1.19. Get or set the list of supported HMAC Identifiers
(SCTP_HMAC_IDENT) . . . . . . . . . . . . . . . . . . 57 (SCTP_HMAC_IDENT) . . . . . . . . . . . . . . . . . . 58
7.1.20. Set a shared key (SCTP_AUTH_KEY) . . . . . . . . . . . 58 8.1.20. Set a shared key (SCTP_AUTH_KEY) . . . . . . . . . . . 59
7.1.21. Get or set the active shared key 8.1.21. Get or set the active shared key
(SCTP_AUTH_ACTIVE_KEY) . . . . . . . . . . . . . . . . 58 (SCTP_AUTH_ACTIVE_KEY) . . . . . . . . . . . . . . . . 59
7.1.22. Delete a shared key (SCTP_AUTH_DELETE_KEY) . . . . . . 59 8.1.22. Delete a shared key (SCTP_AUTH_DELETE_KEY) . . . . . . 60
7.1.23. Get or set delayed ack timer (SCTP_DELAYED_SACK) . . . 60 8.1.23. Delete a shared key (SCTP_AUTH_DEACTIVATE_KEY) . . . . 61
7.1.24. Get or set fragmented interleave 8.1.24. Get or set delayed ack timer (SCTP_DELAYED_SACK) . . . 61
(SCTP_FRAGMENT_INTERLEAVE) . . . . . . . . . . . . . . 60 8.1.25. Get or set fragmented interleave
7.1.25. Set or Get the sctp partial delivery point (SCTP_FRAGMENT_INTERLEAVE) . . . . . . . . . . . . . . 62
(SCTP_PARTIAL_DELIVERY_POINT) . . . . . . . . . . . . 62 8.1.26. Set or Get the sctp partial delivery point
7.1.26. Set or Get the use of extended receive info (SCTP_PARTIAL_DELIVERY_POINT) . . . . . . . . . . . . 63
(SCTP_USE_EXT_RCVINFO) . . . . . . . . . . . . . . . . 62 8.1.27. Set or Get the use of extended receive info
7.1.27. Set or Get the auto asconf flag (SCTP_AUTO_ASCONF) . . 62 (SCTP_USE_EXT_RCVINFO) . . . . . . . . . . . . . . . . 64
7.1.28. Set or Get the maximum burst (SCTP_MAX_BURST) . . . . 62 8.1.28. Set or Get the auto asconf flag (SCTP_AUTO_ASCONF) . . 64
7.1.29. Set or Get the default context (SCTP_CONTEXT) . . . . 63 8.1.29. Set or Get the maximum burst (SCTP_MAX_BURST) . . . . 64
7.1.30. Enable or disable explicit EOR marking 8.1.30. Set or Get the default context (SCTP_CONTEXT) . . . . 65
(SCTP_EXPLICIT_EOR) . . . . . . . . . . . . . . . . . 63 8.1.31. Enable or disable explicit EOR marking
7.1.31. Enable SCTP port reusage (SCTP_REUSE_PORT) . . . . . . 64 (SCTP_EXPLICIT_EOR) . . . . . . . . . . . . . . . . . 65
7.2. Read-Only Options . . . . . . . . . . . . . . . . . . . . 64 8.1.32. Enable SCTP port reusage (SCTP_REUSE_PORT) . . . . . . 65
7.2.1. Association Status (SCTP_STATUS) . . . . . . . . . . . 64 8.2. Read-Only Options . . . . . . . . . . . . . . . . . . . . 66
7.2.2. Peer Address Information (SCTP_GET_PEER_ADDR_INFO) . . 65 8.2.1. Association Status (SCTP_STATUS) . . . . . . . . . . . 66
7.2.3. Get the list of chunks the peer requires to be 8.2.2. Peer Address Information (SCTP_GET_PEER_ADDR_INFO) . . 67
authenticated (SCTP_PEER_AUTH_CHUNKS) . . . . . . . . 66 8.2.3. Get the list of chunks the peer requires to be
7.2.4. Get the list of chunks the local endpoint requires authenticated (SCTP_PEER_AUTH_CHUNKS) . . . . . . . . 68
to be authenticated (SCTP_LOCAL_AUTH_CHUNKS) . . . . . 67 8.2.4. Get the list of chunks the local endpoint requires
7.2.5. Get the current number of associations to be authenticated (SCTP_LOCAL_AUTH_CHUNKS) . . . . . 69
(SCTP_GET_ASSOC_NUMBER) . . . . . . . . . . . . . . . 67 8.2.5. Get the current number of associations
7.2.6. Get the current identifiers of associations (SCTP_GET_ASSOC_NUMBER) . . . . . . . . . . . . . . . 69
(SCTP_GET_ASSOC_ID_LIST) . . . . . . . . . . . . . . . 67 8.2.6. Get the current identifiers of associations
7.3. Ancillary Data and Notification Interest Options . . . . . 68 (SCTP_GET_ASSOC_ID_LIST) . . . . . . . . . . . . . . . 69
8. New Interfaces . . . . . . . . . . . . . . . . . . . . . . . . 70 8.3. Ancillary Data and Notification Interest Options . . . . . 70
8.1. sctp_bindx() . . . . . . . . . . . . . . . . . . . . . . . 70 9. New Interfaces . . . . . . . . . . . . . . . . . . . . . . . . 72
8.2. Branched-off Association . . . . . . . . . . . . . . . . . 72 9.1. sctp_bindx() . . . . . . . . . . . . . . . . . . . . . . . 72
8.3. sctp_getpaddrs() . . . . . . . . . . . . . . . . . . . . . 72 9.2. Branched-off Association . . . . . . . . . . . . . . . . . 74
8.4. sctp_freepaddrs() . . . . . . . . . . . . . . . . . . . . 73 9.3. sctp_getpaddrs() . . . . . . . . . . . . . . . . . . . . . 74
8.5. sctp_getladdrs() . . . . . . . . . . . . . . . . . . . . . 73 9.4. sctp_freepaddrs() . . . . . . . . . . . . . . . . . . . . 75
8.6. sctp_freeladdrs() . . . . . . . . . . . . . . . . . . . . 74 9.5. sctp_getladdrs() . . . . . . . . . . . . . . . . . . . . . 75
8.7. sctp_sendmsg() . . . . . . . . . . . . . . . . . . . . . . 74 9.6. sctp_freeladdrs() . . . . . . . . . . . . . . . . . . . . 76
8.8. sctp_recvmsg() . . . . . . . . . . . . . . . . . . . . . . 75 9.7. sctp_sendmsg() . . . . . . . . . . . . . . . . . . . . . . 76
8.9. sctp_connectx() . . . . . . . . . . . . . . . . . . . . . 75 9.8. sctp_recvmsg() . . . . . . . . . . . . . . . . . . . . . . 77
8.10. sctp_send() . . . . . . . . . . . . . . . . . . . . . . . 76 9.9. sctp_connectx() . . . . . . . . . . . . . . . . . . . . . 77
8.11. sctp_sendx() . . . . . . . . . . . . . . . . . . . . . . . 77 9.10. sctp_send() . . . . . . . . . . . . . . . . . . . . . . . 78
8.12. sctp_getaddrlen . . . . . . . . . . . . . . . . . . . . . 78 9.11. sctp_sendx() . . . . . . . . . . . . . . . . . . . . . . . 79
9. IANA considerations . . . . . . . . . . . . . . . . . . . . . 78 9.12. sctp_getaddrlen . . . . . . . . . . . . . . . . . . . . . 80
10. Security Considerations . . . . . . . . . . . . . . . . . . . 78 10. IANA considerations . . . . . . . . . . . . . . . . . . . . . 80
11. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 79 11. Security Considerations . . . . . . . . . . . . . . . . . . . 80
12. Normative references . . . . . . . . . . . . . . . . . . . . . 79 12. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 81
Appendix A. one-to-one style Code Example . . . . . . . . . . . . 80 13. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 81
Appendix B. one-to-many style Code Example . . . . . . . . . . . 85 14. Normative references . . . . . . . . . . . . . . . . . . . . . 81
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 86 Appendix A. one-to-one style Code Example . . . . . . . . . . . . 82
Intellectual Property and Copyright Statements . . . . . . . . . . 89 Appendix B. one-to-many style Code Example . . . . . . . . . . . 87
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 89
Intellectual Property and Copyright Statements . . . . . . . . . . 91
1. Introduction 1. Introduction
The sockets API has provided a standard mapping of the Internet The sockets API has provided a standard mapping of the Internet
Protocol suite to many operating systems. Both TCP [RFC0793] and UDP Protocol suite to many operating systems. Both TCP [RFC0793] and UDP
[RFC0768] have benefited from this standard representation and access [RFC0768] have benefited from this standard representation and access
method across many diverse platforms. SCTP is a new protocol that method across many diverse platforms. SCTP is a new protocol that
provides many of the characteristics of TCP but also incorporates provides many of the characteristics of TCP but also incorporates
semantics more akin to UDP. This document defines a method to map semantics more akin to UDP. This document defines a method to map
the existing sockets API for use with SCTP, providing both a base for the existing sockets API for use with SCTP, providing both a base for
skipping to change at page 6, line 10 skipping to change at page 6, line 10
structures and operations, but will require the use of two different structures and operations, but will require the use of two different
application programming styles. Note that all new SCTP features can application programming styles. Note that all new SCTP features can
be used with both styles of socket. The decision on which one to use be used with both styles of socket. The decision on which one to use
depends mainly on the nature of applications. depends mainly on the nature of applications.
A mechanism is defined to extract a one-to-many style SCTP A mechanism is defined to extract a one-to-many style SCTP
association into a one-to-one style socket. association into a one-to-one style socket.
Some of the SCTP mechanisms cannot be adequately mapped to existing Some of the SCTP mechanisms cannot be adequately mapped to existing
socket interface. In some cases, it is more desirable to have new socket interface. In some cases, it is more desirable to have new
interface instead of using existing socket calls. Section 8 of this interface instead of using existing socket calls. Section 9 of this
document describes those new interface. document describes those new interface.
2. Conventions 2. Conventions
2.1. Data Types The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in [RFC2119].
3. Data Types
Whenever possible, data types from Draft 6.6 (March 1997) of POSIX Whenever possible, data types from Draft 6.6 (March 1997) of POSIX
1003.1g are used: uintN_t means an unsigned integer of exactly N bits 1003.1g are used: uintN_t means an unsigned integer of exactly N bits
(e.g., uint16_t). We also assume the argument data types from (e.g., uint16_t). We also assume the argument data types from
1003.1g when possible (e.g., the final argument to setsockopt() is a 1003.1g when possible (e.g., the final argument to setsockopt() is a
size_t value). Whenever buffer sizes are specified, the POSIX 1003.1 size_t value). Whenever buffer sizes are specified, the POSIX 1003.1
size_t data type is used. size_t data type is used.
3. one-to-many style Interface 4. one-to-many style Interface
The one-to-many style interface has the following characteristics: The one-to-many style interface has the following characteristics:
A) Outbound association setup is implicit. A) Outbound association setup is implicit.
B) Messages are delivered in complete messages (with one notable B) Messages are delivered in complete messages (with one notable
exception). exception).
C) There is a 1 to MANY relationship between socket and association. C) There is a 1 to MANY relationship between socket and association.
3.1. Basic Operation 4.1. Basic Operation
A typical server in this style uses the following socket calls in A typical server in this style uses the following socket calls in
sequence to prepare an endpoint for servicing requests: sequence to prepare an endpoint for servicing requests:
1. socket() 1. socket()
2. bind() 2. bind()
3. listen() 3. listen()
4. recvmsg() 4. recvmsg()
5. sendmsg() 5. sendmsg()
6. close() 6. close()
skipping to change at page 7, line 37 skipping to change at page 7, line 42
is terminated gracefully automatically, the association ID assigned is terminated gracefully automatically, the association ID assigned
to it can be reused. All applications using this option should be to it can be reused. All applications using this option should be
aware of this to avoid the possible problem of sending data to an aware of this to avoid the possible problem of sending data to an
incorrect peer end point. incorrect peer end point.
If the server or client wishes to branch an existing association off If the server or client wishes to branch an existing association off
to a separate socket, it is required to call sctp_peeloff() and in to a separate socket, it is required to call sctp_peeloff() and in
the parameter specifies the association identification. The the parameter specifies the association identification. The
sctp_peeloff() call will return a new socket which can then be used sctp_peeloff() call will return a new socket which can then be used
with recv() and send() functions for message passing. See with recv() and send() functions for message passing. See
Section 8.2 for more on branched-off associations. Section 9.2 for more on branched-off associations.
Once an association is branched off to a separate socket, it becomes Once an association is branched off to a separate socket, it becomes
completely separated from the original socket. All subsequent completely separated from the original socket. All subsequent
control and data operations to that association must be done through control and data operations to that association must be done through
the new socket. For example, the close operation on the original the new socket. For example, the close operation on the original
socket will not terminate any associations that have been branched socket will not terminate any associations that have been branched
off to a different socket. off to a different socket.
We will discuss the one-to-many style socket calls in more details in We will discuss the one-to-many style socket calls in more details in
the following subsections. the following subsections.
3.1.1. socket() - one-to-many style socket 4.1.1. socket() - one-to-many style socket
Applications use socket() to create a socket descriptor to represent Applications use socket() to create a socket descriptor to represent
an SCTP endpoint. an SCTP endpoint.
The syntax is, The syntax is,
sd = socket(PF_INET, SOCK_SEQPACKET, IPPROTO_SCTP); sd = socket(PF_INET, SOCK_SEQPACKET, IPPROTO_SCTP);
or, or,
sd = socket(PF_INET6, SOCK_SEQPACKET, IPPROTO_SCTP); sd = socket(PF_INET6, SOCK_SEQPACKET, IPPROTO_SCTP);
Here, SOCK_SEQPACKET indicates the creation of a one-to-many style Here, SOCK_SEQPACKET indicates the creation of a one-to-many style
socket. socket.
The first form creates an endpoint which can use only IPv4 addresses, The first form creates an endpoint which can use only IPv4 addresses,
while, the second form creates an endpoint which can use both IPv6 while, the second form creates an endpoint which can use both IPv6
and IPv4 addresses. and IPv4 addresses.
3.1.2. bind() - one-to-many style socket 4.1.2. bind() - one-to-many style socket
Applications use bind() to specify which local address the SCTP Applications use bind() to specify which local address the SCTP
endpoint should associate itself with. endpoint should associate itself with.
An SCTP endpoint can be associated with multiple addresses. To do An SCTP endpoint can be associated with multiple addresses. To do
this, sctp_bindx() is introduced in section Section 8.1 to help this, sctp_bindx() is introduced in section Section 9.1 to help
applications do the job of associating multiple addresses. applications do the job of associating multiple addresses.
These addresses associated with a socket are the eligible transport These addresses associated with a socket are the eligible transport
addresses for the endpoint to send and receive data. The endpoint addresses for the endpoint to send and receive data. The endpoint
will also present these addresses to its peers during the association will also present these addresses to its peers during the association
initialization process, see [RFC4960]. initialization process, see [RFC4960].
After calling bind(), if the endpoint wishes to accept new After calling bind(), if the endpoint wishes to accept new
associations on the socket, it must call listen() (see section associations on the socket, it must call listen() (see section
Section 3.1.3). Section 4.1.3).
The syntax of bind() is, The syntax of bind() is,
ret = bind(int sd, struct sockaddr *addr, socklen_t addrlen); ret = bind(int sd, struct sockaddr *addr, socklen_t addrlen);
sd - the socket descriptor returned by socket(). sd - the socket descriptor returned by socket().
addr - the address structure (struct sockaddr_in or struct addr - the address structure (struct sockaddr_in or struct
sockaddr_in6 [RFC2553]). sockaddr_in6 [RFC3493]).
addrlen - the size of the address structure. addrlen - the size of the address structure.
If sd is an IPv4 socket, the address passed must be an IPv4 address. If sd is an IPv4 socket, the address passed must be an IPv4 address.
If the sd is an IPv6 socket, the address passed can either be an IPv4 If the sd is an IPv6 socket, the address passed can either be an IPv4
or an IPv6 address. or an IPv6 address.
Applications cannot call bind() multiple times to associate multiple Applications cannot call bind() multiple times to associate multiple
addresses to an endpoint. After the first call to bind(), all addresses to an endpoint. After the first call to bind(), all
subsequent calls will return an error. subsequent calls will return an error.
skipping to change at page 9, line 17 skipping to change at page 9, line 28
or as IN6ADDR_ANY_INIT or in6addr_any for an IPv6 address), the or as IN6ADDR_ANY_INIT or in6addr_any for an IPv6 address), the
operating system will associate the endpoint with an optimal address operating system will associate the endpoint with an optimal address
set of the available interfaces. set of the available interfaces.
If a bind() is not called prior to a sendmsg() call that initiates a If a bind() is not called prior to a sendmsg() call that initiates a
new association, the system picks an ephemeral port and will choose new association, the system picks an ephemeral port and will choose
an address set equivalent to binding with a wildcard address. One of an address set equivalent to binding with a wildcard address. One of
those addresses will be the primary address for the association. those addresses will be the primary address for the association.
This automatically enables the multi-homing capability of SCTP. This automatically enables the multi-homing capability of SCTP.
3.1.3. listen() - One-to-many style socket 4.1.3. listen() - One-to-many style socket
By default, new associations are not accepted for one-to-many style By default, new associations are not accepted for one-to-many style
sockets. An application uses listen() to mark a socket as being able sockets. An application uses listen() to mark a socket as being able
to accept new associations. The syntax is, to accept new associations. The syntax is,
int listen(int sd, int backlog); int listen(int sd, int backlog);
sd - the socket descriptor of the endpoint. sd - the socket descriptor of the endpoint.
backlog - if backlog is non-zero, enable listening else disable backlog - if backlog is non-zero, enable listening else disable
listening. listening.
skipping to change at page 9, line 46 skipping to change at page 10, line 11
the socket will be ones they actively initiated. Server or peer-to- the socket will be ones they actively initiated. Server or peer-to-
peer sockets, on the other hand, will always accept new associations, peer sockets, on the other hand, will always accept new associations,
so a well-written application using server one-to-many style sockets so a well-written application using server one-to-many style sockets
must be prepared to handle new associations from unwanted peers. must be prepared to handle new associations from unwanted peers.
Also note that the SCTP_ASSOC_CHANGE event provides the association Also note that the SCTP_ASSOC_CHANGE event provides the association
ID for a new association, so if applications wish to use the ID for a new association, so if applications wish to use the
association ID as input to other socket calls, they should ensure association ID as input to other socket calls, they should ensure
that the SCTP_ASSOC_CHANGE event is enabled. that the SCTP_ASSOC_CHANGE event is enabled.
3.1.4. sendmsg() and recvmsg() - one-to-many style socket 4.1.4. sendmsg() and recvmsg() - one-to-many style socket
An application uses sendmsg() and recvmsg() call to transmit data to An application uses sendmsg() and recvmsg() call to transmit data to
and receive data from its peer. and receive data from its peer.
ssize_t sendmsg(int sd, const struct msghdr *message, int flags); ssize_t sendmsg(int sd, const struct msghdr *message, int flags);
ssize_t recvmsg(int sd, struct msghdr *message, int flags); ssize_t recvmsg(int sd, struct msghdr *message, int flags);
sd - the socket descriptor of the endpoint. sd - the socket descriptor of the endpoint.
message: pointer to the msghdr structure which contains a single message: pointer to the msghdr structure which contains a single
user message and possibly some ancillary data. See Section 5 for user message and possibly some ancillary data. See Section 6 for
complete description of the data structures. complete description of the data structures.
flags - No new flags are defined for SCTP at this level. See flags - No new flags are defined for SCTP at this level. See
Section 5 for SCTP-specific flags used in the msghdr structure. Section 5 for SCTP-specific flags used in the msghdr structure.
As we will see in Section 5, along with the user data, the ancillary As we will see in Section 6, along with the user data, the ancillary
data field is used to carry the sctp_sndrcvinfo and/or the data field is used to carry the sctp_sndrcvinfo and/or the
sctp_initmsg structures to perform various SCTP functions including sctp_initmsg structures to perform various SCTP functions including
specifying options for sending each user message. Those options, specifying options for sending each user message. Those options,
depending on whether sending or receiving, include stream number, depending on whether sending or receiving, include stream number,
stream sequence number, various flags, context and payload protocol stream sequence number, various flags, context and payload protocol
Id, etc. Id, etc.
When sending user data with sendmsg(), the msg_name field in msghdr When sending user data with sendmsg(), the msg_name field in msghdr
structure will be filled with one of the transport addresses of the structure will be filled with one of the transport addresses of the
intended receiver. If there is no association existing between the intended receiver. If there is no association existing between the
sender and the intended receiver, the sender's SCTP stack will set up sender and the intended receiver, the sender's SCTP stack will set up
a new association and then send the user data (see Section 3.2 for a new association and then send the user data (see Section 4.2 for
more on implicit association setup). If an SCTP_INIT cmsg structure more on implicit association setup). If an SCTP_INIT cmsg structure
is used with NULL data, an association will be established using the is used with NULL data, an association will be established using the
parameters from the struct sctp_initmsg structure. If no SCTP_INIT parameters from the struct sctp_initmsg structure. If no SCTP_INIT
cmsg structure is used in combination with NULL data, an association cmsg structure is used in combination with NULL data, an association
is established using the default parameters. If NULL data is used, is established using the default parameters. If NULL data is used,
no association exists and the SCTP_ABORT or SCTP_EOF -1 MUST be no association exists and the SCTP_ABORT or SCTP_EOF -1 MUST be
returned and an errno SHOULD be set to something like EDONOTBESTUPID. returned and an errno SHOULD be set to something like EDONOTBESTUPID.
Sending a message using sendmsg() is atomic unless explicit EOR Sending a message using sendmsg() is atomic unless explicit EOR
marking is enabled on the socket specified by sd. marking is enabled on the socket specified by sd.
skipping to change at page 11, line 8 skipping to change at page 11, line 20
msghdr structure will be populated with the source transport address msghdr structure will be populated with the source transport address
of the user data. The caller of recvmsg() can use this address of the user data. The caller of recvmsg() can use this address
information to determine to which association the received user information to determine to which association the received user
message belongs. Note that if SCTP_ASSOC_CHANGE events are disabled, message belongs. Note that if SCTP_ASSOC_CHANGE events are disabled,
applications must use the peer transport address provided in the applications must use the peer transport address provided in the
msg_name field by recvmsg() to perform correlation to an association, msg_name field by recvmsg() to perform correlation to an association,
since they will not have the association ID. since they will not have the association ID.
If all data in a single message has been delivered, MSG_EOR will be If all data in a single message has been delivered, MSG_EOR will be
set in the msg_flags field of the msghdr structure (see section set in the msg_flags field of the msghdr structure (see section
Section 5.1). Section 6.1).
If the application does not provide enough buffer space to completely If the application does not provide enough buffer space to completely
receive a data message, MSG_EOR will not be set in msg_flags. receive a data message, MSG_EOR will not be set in msg_flags.
Successive reads will consume more of the same message until the Successive reads will consume more of the same message until the
entire message has been delivered, and MSG_EOR will be set. entire message has been delivered, and MSG_EOR will be set.
If the SCTP stack is running low on buffers, it may partially deliver If the SCTP stack is running low on buffers, it may partially deliver
a message. In this case, MSG_EOR will not be set, and more calls to a message. In this case, MSG_EOR will not be set, and more calls to
recvmsg() will be necessary to completely consume the message. Only recvmsg() will be necessary to completely consume the message. Only
one message at a time can be partially delivered in any stream. The one message at a time can be partially delivered in any stream. The
socket option SCTP_FRAGMENT_INTERLEAVE controls various aspects of socket option SCTP_FRAGMENT_INTERLEAVE controls various aspects of
what interlacing of messages occurs for both the one-to-one and the what interlacing of messages occurs for both the one-to-one and the
one-to-many model sockets. Please consult Section 7.1.24 for further one-to-many model sockets. Please consult Section 8.1.25 for further
details on message delivery options. details on message delivery options.
Note, if the socket is a branched-off socket that only represents one Note, if the socket is a branched-off socket that only represents one
association (see Section 3.1), the msg_name field can be used to association (see Section 4.1), the msg_name field can be used to
override the primary address when sending data. override the primary address when sending data.
3.1.5. close() - one-to-many style socket 4.1.5. close() - one-to-many style socket
Applications use close() to perform graceful shutdown (as described Applications use close() to perform graceful shutdown (as described
in Section 10.1 of [RFC4960]) on ALL the associations currently in Section 10.1 of [RFC4960]) on ALL the associations currently
represented by a one-to-many style socket. represented by a one-to-many style socket.
The syntax is: The syntax is:
ret = close(int sd); ret = close(int sd);
sd - the socket descriptor of the associations to be closed. sd - the socket descriptor of the associations to be closed.
To gracefully shutdown a specific association represented by the one- To gracefully shutdown a specific association represented by the one-
to-many style socket, an application should use the sendmsg() call, to-many style socket, an application should use the sendmsg() call,
and including the SCTP_EOF flag. A user may optionally terminate an and including the SCTP_EOF flag. A user may optionally terminate an
association non-gracefully by sending with the SCTP_ABORT flag and association non-gracefully by sending with the SCTP_ABORT flag and
possibly passing a user specified abort code in the data field. Both possibly passing a user specified abort code in the data field. Both
flags SCTP_EOF and SCTP_ABORT are passed with ancillary data (see flags SCTP_EOF and SCTP_ABORT are passed with ancillary data (see
Section 5.2.2) in the sendmsg call. Section 6.2.2) in the sendmsg call.
If sd in the close() call is a branched-off socket representing only If sd in the close() call is a branched-off socket representing only
one association, the shutdown is performed on that association only. one association, the shutdown is performed on that association only.
3.1.6. connect() - one-to-many style socket 4.1.6. connect() - one-to-many style socket
An application may use the connect() call in the one-to-many style to An application may use the connect() call in the one-to-many style to
initiate an association without sending data. initiate an association without sending data.
The syntax is: The syntax is:
ret = connect(int sd, const struct sockaddr *nam, socklen_t len); ret = connect(int sd, const struct sockaddr *nam, socklen_t len);
sd - the socket descriptor to have a new association added to. sd - the socket descriptor to have a new association added to.
nam - the address structure (either struct sockaddr_in or struct nam - the address structure (either struct sockaddr_in or struct
sockaddr_in6 defined in [RFC2553]). sockaddr_in6 defined in [RFC3493]).
len - the size of the address. len - the size of the address.
Multiple connect() calls can be made on the same socket to create Multiple connect() calls can be made on the same socket to create
multiple associations. This is different from the semantics of multiple associations. This is different from the semantics of
connect() on a UDP socket. connect() on a UDP socket.
3.2. Implicit Association Setup 4.2. Implicit Association Setup
Implicit association setup applies only to one-to-many style sockets.
For one-to-one style sockets implicit association setup MUST NOT be
used.
Once the bind() call is complete on a one-to-many style socket, the Once the bind() call is complete on a one-to-many style socket, the
application can begin sending and receiving data using the sendmsg()/ application can begin sending and receiving data using the sendmsg()/
recvmsg() or sendto()/recvfrom() calls, without going through any recvmsg() or sendto()/recvfrom() calls, without going through any
explicit association setup procedures (i.e., no connect() calls explicit association setup procedures (i.e., no connect() calls
required). required).
Whenever sendmsg() or sendto() is called and the SCTP stack at the Whenever sendmsg() or sendto() is called and the SCTP stack at the
sender finds that there is no association existing between the sender sender finds that there is no association existing between the sender
and the intended receiver (identified by the address passed either in and the intended receiver (identified by the address passed either in
the msg_name field of msghdr structure in the sendmsg() call or the the msg_name field of msghdr structure in the sendmsg() call or the
dest_addr field in the sendto() call), the SCTP stack will dest_addr field in the sendto() call), the SCTP stack will
automatically setup an association to the intended receiver. automatically setup an association to the intended receiver.
Upon the successful association setup a SCTP_COMM_UP notification Upon the successful association setup a SCTP_COMM_UP notification
will be dispatched to the socket at both the sender and receiver will be dispatched to the socket at both the sender and receiver
side. This notification can be read by the recvmsg() system call side. This notification can be read by the recvmsg() system call
(see Section 3.1.3). (see Section 4.1.3).
Note, if the SCTP stack at the sender side supports bundling, the Note, if the SCTP stack at the sender side supports bundling, the
first user message may be bundled with the COOKIE ECHO message first user message may be bundled with the COOKIE ECHO message
[RFC4960]. [RFC4960].
When the SCTP stack sets up a new association implicitly, it first When the SCTP stack sets up a new association implicitly, it first
consults the sctp_initmsg structure, which is passed along within the consults the sctp_initmsg structure, which is passed along within the
ancillary data in the sendmsg() call (see Section 5.2.1 for details ancillary data in the sendmsg() call (see Section 6.2.1 for details
of the data structures), for any special options to be used on the of the data structures), for any special options to be used on the
new association. new association.
If this information is not present in the sendmsg() call, or if the If this information is not present in the sendmsg() call, or if the
implicit association setup is triggered by a sendto() call, the implicit association setup is triggered by a sendto() call, the
default association initialization parameters will be used. These default association initialization parameters will be used. These
default association parameters may be set with respective default association parameters may be set with respective
setsockopt() calls or be left to the system defaults. setsockopt() calls or be left to the system defaults.
Implicit association setup cannot be initiated by send()/recv() Implicit association setup cannot be initiated by send()/recv()
calls. calls.
3.3. Non-blocking mode 4.3. Non-blocking mode
Some SCTP users might want to avoid blocking when they call socket Some SCTP users might want to avoid blocking when they call socket
interface function. interface function.
Once all bind() calls are complete on a one-to-many style socket, the Once all bind() calls are complete on a one-to-many style socket, the
application must set the non-blocking option by a fcntl() (such as application must set the non-blocking option by a fcntl() (such as
O_NONBLOCK). After which the sendmsg() function returns immediately, O_NONBLOCK). After which the sendmsg() function returns immediately,
and the success or failure of the data message (and possible and the success or failure of the data message (and possible
SCTP_INITMSG parameters) will be signaled by the SCTP_ASSOC_CHANGE SCTP_INITMSG parameters) will be signaled by the SCTP_ASSOC_CHANGE
event with SCTP_COMM_UP or CANT_START_ASSOC. If user data could not event with SCTP_COMM_UP or CANT_START_ASSOC. If user data could not
skipping to change at page 13, line 34 skipping to change at page 13, line 51
SCTP_SEND_FAILED event. Those event(s) can be received by the user SCTP_SEND_FAILED event. Those event(s) can be received by the user
calling of recvmsg(). A server (having called listen()) is also calling of recvmsg(). A server (having called listen()) is also
notified of an association up event by the reception of a notified of an association up event by the reception of a
SCTP_ASSOC_CHANGE with SCTP_COMM_UP via the calling of recvmsg() and SCTP_ASSOC_CHANGE with SCTP_COMM_UP via the calling of recvmsg() and
possibly the reception of the first data message. possibly the reception of the first data message.
In order to shutdown the association gracefully, the user must call In order to shutdown the association gracefully, the user must call
sendmsg() with no data and with the SCTP_EOF flag set. The function sendmsg() with no data and with the SCTP_EOF flag set. The function
returns immediately, and completion of the graceful shutdown is returns immediately, and completion of the graceful shutdown is
indicated by an SCTP_ASSOC_CHANGE notification of type indicated by an SCTP_ASSOC_CHANGE notification of type
SHUTDOWN_COMPLETE (see Section 5.3.1.1). Note that this can also be SHUTDOWN_COMPLETE (see Section 6.3.1.1). Note that this can also be
done using the sctp_send() call described in Section 8.10. done using the sctp_send() call described in Section 9.10.
An application is recommended to use caution when using select() (or An application is recommended to use caution when using select() (or
poll()) for writing on a one-to-many style socket. The reason being poll()) for writing on a one-to-many style socket. The reason being
that interpretation of select on write is implementation specific. that interpretation of select on write is implementation specific.
Generally a positive return on a select on write would only indicate Generally a positive return on a select on write would only indicate
that one of the associations represented by the one-to-many socket is that one of the associations represented by the one-to-many socket is
writable. An application that writes after the select return may writable. An application that writes after the select return may
still block since the association that was writeable is not the still block since the association that was writeable is not the
destination association of the write call. Likewise select (or destination association of the write call. Likewise select (or
poll()) for reading from a one-to-many socket will only return an poll()) for reading from a one-to-many socket will only return an
indication that one of the associations represented by the socket has indication that one of the associations represented by the socket has
data to be read. data to be read.
An application that wishes to know that a particular association is An application that wishes to know that a particular association is
ready for reading or writing should either use the one-to-one style ready for reading or writing should either use the one-to-one style
or use the sctp_peeloff() (see Section 8.2) function to separate the or use the sctp_peeloff() (see Section 9.2) function to separate the
association of interest from the one-to-many socket. association of interest from the one-to-many socket.
3.4. Special considerations 4.4. Special considerations
The fact that a one-to-many style socket can provide access to many The fact that a one-to-many style socket can provide access to many
SCTP associations through a single socket descriptor has important SCTP associations through a single socket descriptor has important
implications for both application programmers and system programmers implications for both application programmers and system programmers
implementing this API. A key issue is how buffer space inside the implementing this API. A key issue is how buffer space inside the
sockets layer is managed. Because this implementation detail sockets layer is managed. Because this implementation detail
directly affects how application programmers must write their code to directly affects how application programmers must write their code to
ensure correct operation and portability, this section provides some ensure correct operation and portability, this section provides some
guidance to both implementors and application programmers. guidance to both implementors and application programmers.
skipping to change at page 15, line 26 skipping to change at page 15, line 41
(b) verify that their application layer protocol does not permit (b) verify that their application layer protocol does not permit
large amounts of unread data at the receiver (this is true of some large amounts of unread data at the receiver (this is true of some
request-response protocols, for example), or request-response protocols, for example), or
(c) use one-to-one style sockets for association which may (c) use one-to-one style sockets for association which may
potentially stall (either from the beginning, or by using potentially stall (either from the beginning, or by using
sctp_peeloff before sending large amounts of data that may cause a sctp_peeloff before sending large amounts of data that may cause a
stalled condition). stalled condition).
An implementation which dedicates independent buffer space for An implementation which dedicates independent buffer space for
each association should define HAVE_SCTP_MULTIBUF to 1. each association should define HAVE_SCTP_MULTIBUF to 1.
4. one-to-one style Interface 5. one-to-one style Interface
The goal of this style is to follow as closely as possible the The goal of this style is to follow as closely as possible the
current practice of using the sockets interface for a connection current practice of using the sockets interface for a connection
oriented protocol, such as TCP. This style enables existing oriented protocol, such as TCP. This style enables existing
applications using connection oriented protocols to be ported to SCTP applications using connection oriented protocols to be ported to SCTP
with very little effort. with very little effort.
Note that some new SCTP features and some new SCTP socket options can Note that some new SCTP features and some new SCTP socket options can
only be utilized through the use of sendmsg() and recvmsg() calls, only be utilized through the use of sendmsg() and recvmsg() calls,
see Section 4.1.8. Also note that some socket interfaces may not be see Section 5.1.8. Also note that some socket interfaces may not be
able to provide data on the third leg of the association set up with able to provide data on the third leg of the association set up with
this interface style. this interface style.
4.1. Basic Operation 5.1. Basic Operation
A typical server in one-to-one style uses the following system call A typical server in one-to-one style uses the following system call
sequence to prepare an SCTP endpoint for servicing requests: sequence to prepare an SCTP endpoint for servicing requests:
1. socket() 1. socket()
2. bind() 2. bind()
3. listen() 3. listen()
4. accept() 4. accept()
The accept() call blocks until a new association is set up. It The accept() call blocks until a new association is set up. It
returns with a new socket descriptor. The server then uses the new returns with a new socket descriptor. The server then uses the new
socket descriptor to communicate with the client, using recv() and socket descriptor to communicate with the client, using recv() and
send() calls to get requests and send back responses. send() calls to get requests and send back responses.
Then it calls Then it calls
5. close() 5. close()
skipping to change at page 16, line 33 skipping to change at page 16, line 48
After returning from connect(), the client uses send() and recv() After returning from connect(), the client uses send() and recv()
calls to send out requests and receive responses from the server. calls to send out requests and receive responses from the server.
The client calls The client calls
3. close() 3. close()
to terminate this association when done. to terminate this association when done.
4.1.1. socket() - one-to-one style socket 5.1.1. socket() - one-to-one style socket
Applications calls socket() to create a socket descriptor to Applications calls socket() to create a socket descriptor to
represent an SCTP endpoint. represent an SCTP endpoint.
The syntax is: The syntax is:
int socket(PF_INET, SOCK_STREAM, IPPROTO_SCTP); int socket(PF_INET, SOCK_STREAM, IPPROTO_SCTP);
or, or,
int socket(PF_INET6, SOCK_STREAM, IPPROTO_SCTP); int socket(PF_INET6, SOCK_STREAM, IPPROTO_SCTP);
Here, SOCK_STREAM indicates the creation of a one-to-one style Here, SOCK_STREAM indicates the creation of a one-to-one style
socket. socket.
The first form creates an endpoint which can use only IPv4 addresses, The first form creates an endpoint which can use only IPv4 addresses,
while the second form creates an endpoint which can use both IPv6 and while the second form creates an endpoint which can use both IPv6 and
IPv4 addresses. IPv4 addresses.
4.1.2. bind() - one-to-one style socket 5.1.2. bind() - one-to-one style socket
Applications use bind() to pass an address to be associated with an Applications use bind() to pass an address to be associated with an
SCTP endpoint to the system. bind() allows only either a single SCTP endpoint to the system. bind() allows only either a single
address or a IPv4 or IPv6 wildcard address to be bound. An SCTP address or a IPv4 or IPv6 wildcard address to be bound. An SCTP
endpoint can be associated with multiple addresses. To do this, endpoint can be associated with multiple addresses. To do this,
sctp_bindx() is introduced in Section 8.1 to help applications do the sctp_bindx() is introduced in Section 9.1 to help applications do the
job of associating multiple addresses. job of associating multiple addresses.
These addresses associated with a socket are the eligible transport These addresses associated with a socket are the eligible transport
addresses for the endpoint to send and receive data. The endpoint addresses for the endpoint to send and receive data. The endpoint
will also present these addresses to its peers during the association will also present these addresses to its peers during the association
initialization process, see [RFC4960]. initialization process, see [RFC4960].
The syntax is: The syntax is:
int bind(int sd, struct sockaddr *addr, socklen_t addrlen); int bind(int sd, struct sockaddr *addr, socklen_t addrlen);
sd: the socket descriptor returned by socket() call. sd: the socket descriptor returned by socket() call.
addr: the address structure (either struct sockaddr_in or struct addr: the address structure (either struct sockaddr_in or struct
sockaddr_in6 defined in [RFC2553]). sockaddr_in6 defined in [RFC3493]).
addrlen: the size of the address structure. addrlen: the size of the address structure.
If sd is an IPv4 socket, the address passed must be an IPv4 address. If sd is an IPv4 socket, the address passed must be an IPv4 address.
Otherwise, i.e., the sd is an IPv6 socket, the address passed can Otherwise, i.e., the sd is an IPv6 socket, the address passed can
either be an IPv4 or an IPv6 address. either be an IPv4 or an IPv6 address.
Applications cannot call bind() multiple times to associate multiple Applications cannot call bind() multiple times to associate multiple
addresses to the endpoint. After the first call to bind(), all addresses to the endpoint. After the first call to bind(), all
subsequent calls will return an error. subsequent calls will return an error.
skipping to change at page 18, line 5 skipping to change at page 18, line 19
binding with a wildcard address. One of those addresses will be the binding with a wildcard address. One of those addresses will be the
primary address for the association. This automatically enables the primary address for the association. This automatically enables the
multi-homing capability of SCTP. multi-homing capability of SCTP.
The completion of this bind() process does not ready the SCTP The completion of this bind() process does not ready the SCTP
endpoint to accept inbound SCTP association requests. Until a endpoint to accept inbound SCTP association requests. Until a
listen() system call, described below, is performed on the socket, listen() system call, described below, is performed on the socket,
the SCTP endpoint will promptly reject an inbound SCTP INIT request the SCTP endpoint will promptly reject an inbound SCTP INIT request
with an SCTP ABORT. with an SCTP ABORT.
4.1.3. listen() - one-to-one style socket 5.1.3. listen() - one-to-one style socket
Applications use listen() to ready the SCTP endpoint for accepting Applications use listen() to ready the SCTP endpoint for accepting
inbound associations. inbound associations.
The syntax is: The syntax is:
int listen(int sd, int backlog); int listen(int sd, int backlog);
sd: the socket descriptor of the SCTP endpoint. sd: the socket descriptor of the SCTP endpoint.
backlog: this specifies the max number of outstanding associations backlog: this specifies the max number of outstanding associations
allowed in the socket's accept queue. These are the associations allowed in the socket's accept queue. These are the associations
that have finished the four-way initiation handshake (see Section that have finished the four-way initiation handshake (see Section
5 of [RFC4960]) and are in the ESTABLISHED state. Note, a backlog 5 of [RFC4960]) and are in the ESTABLISHED state. Note, a backlog
of '0' indicates that the caller no longer wishes to receive new of '0' indicates that the caller no longer wishes to receive new
associations. associations.
4.1.4. accept() - one-to-one style socket 5.1.4. accept() - one-to-one style socket
Applications use accept() call to remove an established SCTP Applications use accept() call to remove an established SCTP
association from the accept queue of the endpoint. A new socket association from the accept queue of the endpoint. A new socket
descriptor will be returned from accept() to represent the newly descriptor will be returned from accept() to represent the newly
formed association. formed association.
The syntax is: The syntax is:
new_sd = accept(int sd, struct sockaddr *addr, socklen_t *addrlen); new_sd = accept(int sd, struct sockaddr *addr, socklen_t *addrlen);
skipping to change at page 18, line 34 skipping to change at page 19, line 4
Applications use accept() call to remove an established SCTP Applications use accept() call to remove an established SCTP
association from the accept queue of the endpoint. A new socket association from the accept queue of the endpoint. A new socket
descriptor will be returned from accept() to represent the newly descriptor will be returned from accept() to represent the newly
formed association. formed association.
The syntax is: The syntax is:
new_sd = accept(int sd, struct sockaddr *addr, socklen_t *addrlen); new_sd = accept(int sd, struct sockaddr *addr, socklen_t *addrlen);
new_sd - the socket descriptor for the newly formed association. new_sd - the socket descriptor for the newly formed association.
sd - the listening socket descriptor. sd - the listening socket descriptor.
addr - on return, will contain the primary address of the peer addr - on return, will contain the primary address of the peer
endpoint. endpoint.
addrlen - on return, will contain the size of addr. addrlen - on return, will contain the size of addr.
4.1.5. connect() - one-to-one style socket 5.1.5. connect() - one-to-one style socket
Applications use connect() to initiate an association to a peer. Applications use connect() to initiate an association to a peer.
The syntax is: The syntax is:
int connect(int sd, const struct sockaddr *addr, socklen_t addrlen); int connect(int sd, const struct sockaddr *addr, socklen_t addrlen);
sd - the socket descriptor of the endpoint. sd - the socket descriptor of the endpoint.
addr - the peer's address. addr - the peer's address.
addrlen - the size of the address. addrlen - the size of the address.
This operation corresponds to the ASSOCIATE primitive described in This operation corresponds to the ASSOCIATE primitive described in
section 10.1 of [RFC4960]. section 10.1 of [RFC4960].
By default, the new association created has only one outbound stream. By default, the new association created has only one outbound stream.
The SCTP_INITMSG option described in Section 7.1.3 should be used The SCTP_INITMSG option described in Section 8.1.3 should be used
before connecting to change the number of outbound streams. before connecting to change the number of outbound streams.
If a bind() is not called prior to the connect() call, the system If a bind() is not called prior to the connect() call, the system
picks an ephemeral port and will choose an address set equivalent to picks an ephemeral port and will choose an address set equivalent to
binding with INADDR_ANY and IN6ADDR_ANY for IPv4 and IPv6 socket binding with INADDR_ANY and IN6ADDR_ANY for IPv4 and IPv6 socket
respectively. One of those addresses will be the primary address for respectively. One of those addresses will be the primary address for
the association. This automatically enables the multi-homing the association. This automatically enables the multi-homing
capability of SCTP. capability of SCTP.
Note that SCTP allows data exchange, similar to T/TCP [RFC1644], Note that SCTP allows data exchange, similar to T/TCP [RFC1644],
skipping to change at page 19, line 38 skipping to change at page 20, line 4
setsockopt(). Note that some sockets implementations may not support setsockopt(). Note that some sockets implementations may not support
the sending of data to initiate an association with the one-to-one the sending of data to initiate an association with the one-to-one
style (implementations that do not support T/TCP normally have this style (implementations that do not support T/TCP normally have this
restriction). Implementations which allow sending of data to restriction). Implementations which allow sending of data to
initiate an association without calling connect() define the initiate an association without calling connect() define the
preprocessor constant HAVE_SCTP_NOCONNECT to 1. preprocessor constant HAVE_SCTP_NOCONNECT to 1.
SCTP does not support half close semantics. This means that unlike SCTP does not support half close semantics. This means that unlike
T/TCP, MSG_EOF should not be set in the flags parameter when calling T/TCP, MSG_EOF should not be set in the flags parameter when calling
sendto() or sendmsg() when the call is used to initiate a connection. sendto() or sendmsg() when the call is used to initiate a connection.
MSG_EOF is not an acceptable flag with SCTP socket. MSG_EOF is not an acceptable flag with SCTP socket.
4.1.6. close() - one-to-one style socket 5.1.6. close() - one-to-one style socket
Applications use close() to gracefully close down an association. Applications use close() to gracefully close down an association.
The syntax is: The syntax is:
int close(int sd); int close(int sd);
sd - the socket descriptor of the association to be closed. sd - the socket descriptor of the association to be closed.
After an application calls close() on a socket descriptor, no further After an application calls close() on a socket descriptor, no further
socket operations will succeed on that descriptor. socket operations will succeed on that descriptor.
4.1.7. shutdown() - one-to-one style socket 5.1.7. shutdown() - one-to-one style socket
SCTP differs from TCP in that it does not have half closed semantics. SCTP differs from TCP in that it does not have half closed semantics.
Hence the shutdown() call for SCTP is an approximation of the TCP Hence the shutdown() call for SCTP is an approximation of the TCP
shutdown() call, and solves some different problems. Full TCP- shutdown() call, and solves some different problems. Full TCP-
compatibility is not provided, so developers porting TCP applications compatibility is not provided, so developers porting TCP applications
to SCTP may need to recode sections that use shutdown(). (Note that to SCTP may need to recode sections that use shutdown(). (Note that
it is possible to achieve the same results as half close in SCTP it is possible to achieve the same results as half close in SCTP
using SCTP streams.) using SCTP streams.)
The syntax is: The syntax is:
skipping to change at page 20, line 34 skipping to change at page 20, line 49
SCTP shutdown sequence. SCTP shutdown sequence.
SHUT_RDWR - Disables further send and receive operations and SHUT_RDWR - Disables further send and receive operations and
initiates the SCTP shutdown sequence. initiates the SCTP shutdown sequence.
The major difference between SCTP and TCP shutdown() is that SCTP The major difference between SCTP and TCP shutdown() is that SCTP
SHUT_WR initiates immediate and full protocol shutdown, whereas TCP SHUT_WR initiates immediate and full protocol shutdown, whereas TCP
SHUT_WR causes TCP to go into the half closed state. SHUT_RD behaves SHUT_WR causes TCP to go into the half closed state. SHUT_RD behaves
the same for SCTP as TCP. The purpose of SCTP SHUT_WR is to close the same for SCTP as TCP. The purpose of SCTP SHUT_WR is to close
the SCTP association while still leaving the socket descriptor open, the SCTP association while still leaving the socket descriptor open,
so that the caller can receive back any data SCTP was unable to so that the caller can receive back any data SCTP was unable to
deliver (see Section 5.3.1.4 for more information). deliver (see Section 6.3.1.4 for more information).
To perform the ABORT operation described in [RFC4960] section 10.1, To perform the ABORT operation described in [RFC4960] section 10.1,
an application can use the socket option SO_LINGER. It is described an application can use the socket option SO_LINGER. It is described
in Section 7.1.4. in Section 8.1.4.
4.1.8. sendmsg() and recvmsg() - one-to-one style socket 5.1.8. sendmsg() and recvmsg() - one-to-one style socket
With a one-to-one style socket, the application can also use With a one-to-one style socket, the application can also use
sendmsg() and recvmsg() to transmit data to and receive data from its sendmsg() and recvmsg() to transmit data to and receive data from its
peer. The semantics is similar to those used in the one-to-many peer. The semantics is similar to those used in the one-to-many
style (section Section 3.1.3), with the following differences: style (section Section 4.1.3), with the following differences:
1. When sending, the msg_name field in the msghdr is not used to 1. When sending, the msg_name field in the msghdr is not used to
specify the intended receiver, rather it is used to indicate a specify the intended receiver, rather it is used to indicate a
preferred peer address if the sender wishes to discourage the preferred peer address if the sender wishes to discourage the
stack from sending the message to the primary address of the stack from sending the message to the primary address of the
receiver. If the socket is connected and the transport address receiver. If the socket is connected and the transport address
given is not part of the current association, the data will not given is not part of the current association, the data will not
be sent and a SCTP_SEND_FAILED event will be delivered to the be sent and a SCTP_SEND_FAILED event will be delivered to the
application if send failure events are enabled. application if send failure events are enabled.
2. Using sendmsg() on a non-connected one-to-one style socket for 2. Using sendmsg() on a non-connected one-to-one style socket for
implicit connection setup may or may not work depending on the implicit connection setup may or may not work depending on the
SCTP implementation. SCTP implementation.
4.1.9. getpeername() 5.1.9. getpeername()
Applications use getpeername() to retrieve the primary socket address Applications use getpeername() to retrieve the primary socket address
of the peer. This call is for TCP compatibility, and is not multi- of the peer. This call is for TCP compatibility, and is not multi-
homed. It does not work with one-to-many style sockets. See homed. It does not work with one-to-many style sockets. See
Section 8.3 for a multi-homed/one-to-many style version of the call. Section 9.3 for a multi-homed/one-to-many style version of the call.
The syntax is: The syntax is:
int getpeername(int sd, struct sockaddr *address, int getpeername(int sd, struct sockaddr *address,
socklen_t *len); socklen_t *len);
sd - the socket descriptor to be queried. sd - the socket descriptor to be queried.
address - On return, the peer primary address is stored in this address - On return, the peer primary address is stored in this
buffer. If the socket is an IPv4 socket, the address will be buffer. If the socket is an IPv4 socket, the address will be
IPv4. If the socket is an IPv6 socket, the address will be either IPv4. If the socket is an IPv6 socket, the address will be either
an IPv6 or IPv4 address. an IPv6 or IPv4 address.
len - The caller should set the length of address here. On return, len - The caller should set the length of address here. On return,
this is set to the length of the returned address. this is set to the length of the returned address.
If the actual length of the address is greater than the length of the If the actual length of the address is greater than the length of the
supplied sockaddr structure, the stored address will be truncated. supplied sockaddr structure, the stored address will be truncated.
5. Data Structures 6. Data Structures
We discuss in this section important data structures which are We discuss in this section important data structures which are
specific to SCTP and are used with sendmsg() and recvmsg() calls to specific to SCTP and are used with sendmsg() and recvmsg() calls to
control SCTP endpoint operations and to access ancillary information control SCTP endpoint operations and to access ancillary information
and notifications. and notifications.
5.1. The msghdr and cmsghdr Structures 6.1. The msghdr and cmsghdr Structures
The msghdr structure used in the sendmsg() and recvmsg() calls, as The msghdr structure used in the sendmsg() and recvmsg() calls, as
well as the ancillary data carried in the structure, is the key for well as the ancillary data carried in the structure, is the key for
the application to set and get various control information from the the application to set and get various control information from the
SCTP endpoint. SCTP endpoint.
The msghdr and the related cmsghdr structures are defined and The msghdr and the related cmsghdr structures are defined and
discussed in details in [RFC2292]. Here we will cite their discussed in details in [RFC3542]. Here we will cite their
definitions from [RFC2292]. definitions from [RFC3542].
The msghdr structure: The msghdr structure:
struct msghdr { struct msghdr {
void *msg_name; /* ptr to socket address structure */ void *msg_name; /* ptr to socket address structure */
socklen_t msg_namelen; /* size of socket address structure */ socklen_t msg_namelen; /* size of socket address structure */
struct iovec *msg_iov; /* scatter/gather array */ struct iovec *msg_iov; /* scatter/gather array */
size_t msg_iovlen; /* # elements in msg_iov */ size_t msg_iovlen; /* # elements in msg_iov */
void *msg_control; /* ancillary data */ void *msg_control; /* ancillary data */
socklen_t msg_controllen; /* ancillary data buffer length */ socklen_t msg_controllen; /* ancillary data buffer length */
skipping to change at page 22, line 27 skipping to change at page 22, line 41
The cmsghdr structure: The cmsghdr structure:
struct cmsghdr { struct cmsghdr {
socklen_t cmsg_len; /* #bytes, including this header */ socklen_t cmsg_len; /* #bytes, including this header */
int cmsg_level; /* originating protocol */ int cmsg_level; /* originating protocol */
int cmsg_type; /* protocol-specific type */ int cmsg_type; /* protocol-specific type */
/* followed by unsigned char cmsg_data[]; */ /* followed by unsigned char cmsg_data[]; */
}; };
In the msghdr structure, the usage of msg_name has been discussed in In the msghdr structure, the usage of msg_name has been discussed in
previous sections (see Section 3.1.3 and Section 4.1.8). previous sections (see Section 4.1.3 and Section 5.1.8).
The scatter/gather buffers, or I/O vectors (pointed to by the msg_iov The scatter/gather buffers, or I/O vectors (pointed to by the msg_iov
field) are treated as a single SCTP data chunk, rather than multiple field) are treated as a single SCTP data chunk, rather than multiple
chunks, for both sendmsg() and recvmsg(). chunks, for both sendmsg() and recvmsg().
The msg_flags are not used when sending a message with sendmsg(). The msg_flags are not used when sending a message with sendmsg().
If a notification has arrived, recvmsg() will return the notification If a notification has arrived, recvmsg() will return the notification
with the MSG_NOTIFICATION flag set in msg_flags. If the with the MSG_NOTIFICATION flag set in msg_flags. If the
MSG_NOTIFICATION flag is not set, recvmsg() will return data. See MSG_NOTIFICATION flag is not set, recvmsg() will return data. See
Section 5.3 for more information about notifications. Section 6.3 for more information about notifications.
If all portions of a data frame or notification have been read, If all portions of a data frame or notification have been read,
recvmsg() will return with MSG_EOR set in msg_flags. recvmsg() will return with MSG_EOR set in msg_flags.
5.2. SCTP msg_control Structures 6.2. SCTP msg_control Structures
A key element of all SCTP-specific socket extensions is the use of A key element of all SCTP-specific socket extensions is the use of
ancillary data to specify and access SCTP-specific data via the ancillary data to specify and access SCTP-specific data via the
struct msghdr's msg_control member used in sendmsg() and recvmsg(). struct msghdr's msg_control member used in sendmsg() and recvmsg().
Fine-grained control over initialization and sending parameters are Fine-grained control over initialization and sending parameters are
handled with ancillary data. handled with ancillary data.
Each ancillary data item is proceeded by a struct cmsghdr (see Each ancillary data item is proceeded by a struct cmsghdr (see
Section 5.1), which defines the function and purpose of the data Section 6.1), which defines the function and purpose of the data
contained in in the cmsg_data[] member. contained in in the cmsg_data[] member.
There are two kinds of ancillary data used by SCTP: initialization There are two kinds of ancillary data used by SCTP: initialization
data, and, header information (SNDRCV). Initialization data (one-to- data, and, header information (SNDRCV). Initialization data (one-to-
many style only) sets protocol parameters for new associations. many style only) sets protocol parameters for new associations.
Section 5.2.1 provides more details. Header information can set or Section 6.2.1 provides more details. Header information can set or
report parameters on individual messages in a stream. See report parameters on individual messages in a stream. See
Section 5.2.2 for how to use SNDRCV ancillary data. Section 6.2.2 for how to use SNDRCV ancillary data.
By default on a one-to-one style socket, SCTP will pass no ancillary By default on a one-to-one style socket, SCTP will pass no ancillary
data; on a one-to-many style socket, SCTP will only pass SCTP_SNDRCV data; on a one-to-many style socket, SCTP will only pass SCTP_SNDRCV
and SCTP_ASSOC_CHANGE information. Specific ancillary data items can and SCTP_ASSOC_CHANGE information. Specific ancillary data items can
be enabled with socket options defined for SCTP; see Section 7.3. be enabled with socket options defined for SCTP; see Section 8.3.
Note that all ancillary types are fixed length; see Section 5.4 for Note that all ancillary types are fixed length; see Section 6.4 for
further discussion on this. These data structures use struct further discussion on this. These data structures use struct
sockaddr_storage (defined in [RFC2553]) as a portable, fixed length sockaddr_storage (defined in [RFC3493]) as a portable, fixed length
address format. address format.
Other protocols may also provide ancillary data to the socket layer Other protocols may also provide ancillary data to the socket layer
consumer. These ancillary data items from other protocols may consumer. These ancillary data items from other protocols may
intermingle with SCTP data. For example, the IPv6 socket API intermingle with SCTP data. For example, the IPv6 socket API
definitions ([RFC2292] and [RFC2553]) define a number of ancillary definitions ([RFC3542] and [RFC3493]) define a number of ancillary
data items. If a socket API consumer enables delivery of both SCTP data items. If a socket API consumer enables delivery of both SCTP
and IPv6 ancillary data, they both may appear in the same msg_control and IPv6 ancillary data, they both may appear in the same msg_control
buffer in any order. An application may thus need to handle other buffer in any order. An application may thus need to handle other
types of ancillary data besides that passed by SCTP. types of ancillary data besides that passed by SCTP.
The sockets application must provide a buffer large enough to The sockets application must provide a buffer large enough to
accommodate all ancillary data provided via recvmsg(). If the buffer accommodate all ancillary data provided via recvmsg(). If the buffer
is not large enough, the ancillary data will be truncated and the is not large enough, the ancillary data will be truncated and the
msghdr's msg_flags will include MSG_CTRUNC. msghdr's msg_flags will include MSG_CTRUNC.
5.2.1. SCTP Initiation Structure (SCTP_INIT) 6.2.1. SCTP Initiation Structure (SCTP_INIT)
This cmsghdr structure provides information for initializing new SCTP This cmsghdr structure provides information for initializing new SCTP
associations with sendmsg(). The SCTP_INITMSG socket option uses associations with sendmsg(). The SCTP_INITMSG socket option uses
this same data structure. This structure is not used for recvmsg(). this same data structure. This structure is not used for recvmsg().
cmsg_level cmsg_type cmsg_data[] +--------------+-----------+---------------------+
------------ ------------ ---------------------- | cmsg_level | cmsg_type | cmsg_data[] |
IPPROTO_SCTP SCTP_INIT struct sctp_initmsg +--------------+-----------+---------------------+
| IPPROTO_SCTP | SCTP_INIT | struct sctp_initmsg |
+--------------+-----------+---------------------+
Here is the definition of the sctp_initmsg structure: Here is the definition of the sctp_initmsg structure:
struct sctp_initmsg { struct sctp_initmsg {
uint16_t sinit_num_ostreams; uint16_t sinit_num_ostreams;
uint16_t sinit_max_instreams; uint16_t sinit_max_instreams;
uint16_t sinit_max_attempts; uint16_t sinit_max_attempts;
uint16_t sinit_max_init_timeo; uint16_t sinit_max_init_timeo;
}; };
skipping to change at page 24, line 44 skipping to change at page 25, line 4
sinit_max_attempts: 16 bits (unsigned integer) sinit_max_attempts: 16 bits (unsigned integer)
This integer specifies how many attempts the SCTP endpoint should This integer specifies how many attempts the SCTP endpoint should
make at resending the INIT. This value overrides the system SCTP make at resending the INIT. This value overrides the system SCTP
'Max.Init.Retransmits' value. The default value of 0 indicates to 'Max.Init.Retransmits' value. The default value of 0 indicates to
use the endpoints default value. This is normally set to the use the endpoints default value. This is normally set to the
system's default 'Max.Init.Retransmit' value. system's default 'Max.Init.Retransmit' value.
sinit_max_init_timeo: 16 bits (unsigned integer) sinit_max_init_timeo: 16 bits (unsigned integer)
This value represents the largest Time-Out or RTO value (in This value represents the largest Time-Out or RTO value (in
milliseconds) to use in attempting an INIT. Normally the 'RTO.Max' milliseconds) to use in attempting an INIT. Normally the 'RTO.Max'
is used to limit the doubling of the RTO upon timeout. For the INIT is used to limit the doubling of the RTO upon timeout. For the INIT
message this value MAY override 'RTO.Max'. This value MUST NOT message this value MAY override 'RTO.Max'. This value MUST NOT
influence 'RTO.Max' during data transmission and is only used to influence 'RTO.Max' during data transmission and is only used to
bound the initial setup time. A default value of 0 indicates to use bound the initial setup time. A default value of 0 indicates to use
the endpoints default value. This is normally set to the system's the endpoints default value. This is normally set to the system's
'RTO.Max' value (60 seconds). 'RTO.Max' value (60 seconds).
5.2.2. SCTP Header Information Structure (SCTP_SNDRCV) 6.2.2. SCTP Header Information Structure (SCTP_SNDRCV)
This cmsghdr structure specifies SCTP options for sendmsg() and This cmsghdr structure specifies SCTP options for sendmsg() and
describes SCTP header information about a received message through describes SCTP header information about a received message through
recvmsg(). recvmsg().
cmsg_level cmsg_type cmsg_data[] +--------------+-------------+------------------------+
------------ ------------ ---------------------- | cmsg_level | cmsg_type | cmsg_data[] |
IPPROTO_SCTP SCTP_SNDRCV struct sctp_sndrcvinfo +--------------+-------------+------------------------+
| IPPROTO_SCTP | SCTP_SNDRCV | struct sctp_sndrcvinfo |
+--------------+-------------+------------------------+
Here is the definition of sctp_sndrcvinfo: Here is the definition of sctp_sndrcvinfo:
struct sctp_sndrcvinfo { struct sctp_sndrcvinfo {
uint16_t sinfo_stream; uint16_t sinfo_stream;
uint16_t sinfo_ssn; uint16_t sinfo_ssn;
uint16_t sinfo_flags; uint16_t sinfo_flags;
uint16_t sinfo_pr_policy; uint16_t sinfo_pr_policy;
uint32_t sinfo_ppid; uint32_t sinfo_ppid;
uint32_t sinfo_context; uint32_t sinfo_context;
skipping to change at page 27, line 45 skipping to change at page 28, line 5
sinfo_assoc_id: sizeof (sctp_assoc_t) sinfo_assoc_id: sizeof (sctp_assoc_t)
The association handle field, sinfo_assoc_id, holds the identifier The association handle field, sinfo_assoc_id, holds the identifier
for the association announced in the SCTP_COMM_UP notification. All for the association announced in the SCTP_COMM_UP notification. All
notifications for a given association have the same identifier. notifications for a given association have the same identifier.
Ignored for one-to-one style sockets. Ignored for one-to-one style sockets.
A sctp_sndrcvinfo item always corresponds to the data in msg_iov. A sctp_sndrcvinfo item always corresponds to the data in msg_iov.
5.2.3. Extended SCTP Header Information Structure (SCTP_EXTRCV) 6.2.3. Extended SCTP Header Information Structure (SCTP_EXTRCV)
This cmsghdr structure specifies SCTP options for SCTP header This cmsghdr structure specifies SCTP options for SCTP header
information about a received message via recvmsg(). Note that this information about a received message via recvmsg(). Note that this
structure is an extended version of SCTP_SNDRCV (see Section 5.2.2) structure is an extended version of SCTP_SNDRCV (see Section 6.2.2)
and will only be received if the user has set the socket option and will only be received if the user has set the socket option
SCTP_USE_EXT_RCVINFO to true in addition to any event subscription SCTP_USE_EXT_RCVINFO to true in addition to any event subscription
needed to receive ancillary data. Note that next message data is not needed to receive ancillary data. Note that next message data is not
valid unless the current message is completely read, i.e. the MSG_EOR valid unless the current message is completely read, i.e. the MSG_EOR
is set, in other words if you have more data to read from the current is set, in other words if you have more data to read from the current
message then no next message information will be available. message then no next message information will be available.
cmsg_level cmsg_type cmsg_data[] +--------------+-------------+------------------------+
------------ ------------ ---------------------- | cmsg_level | cmsg_type | cmsg_data[] |
IPPROTO_SCTP SCTP_EXTRCV struct sctp_extrcvinfo +--------------+-------------+------------------------+
| IPPROTO_SCTP | SCTP_EXTRCV | struct sctp_extrcvinfo |
+--------------+-------------+------------------------+
Here is the definition of sctp_extrcvinfo Here is the definition of sctp_extrcvinfo structure:
struct sctp_extrcvinfo { struct sctp_extrcvinfo {
struct sctp_sndrcvinfo serinfo_sinfo; struct sctp_sndrcvinfo serinfo_sinfo;
uint16_t serinfo_next_flags; uint16_t serinfo_next_flags;
uint16_t serinfo_next_stream; uint16_t serinfo_next_stream;
uint32_t serinfo_next_aid; uint32_t serinfo_next_aid;
uint32_t serinfo_next_length; uint32_t serinfo_next_length;
uint32_t serinfo_next_ppid; uint32_t serinfo_next_ppid;
}; };
serinfo_sinfo: structure serinfo_sinfo: structure
Please see Section 5.2.2 for the details for this structure. Please see Section 6.2.2 for the details for this structure.
serinfo_next_flags: 16 bit (unsigned integer) serinfo_next_flags: 16 bit (unsigned integer)
This bitmask will hold one or more of the following values: This bitmask will hold one or more of the following values:
SCTP_NEXT_MSG_AVAIL - This bit, when set to 1, indicates that next SCTP_NEXT_MSG_AVAIL - This bit, when set to 1, indicates that next
message information is available i.e.: next_stream, next_asocid, message information is available i.e.: next_stream, next_asocid,
next_length and next_ppid fields all have valid values. If this next_length and next_ppid fields all have valid values. If this
bit is set to 0, then these fields are not valid and should be bit is set to 0, then these fields are not valid and should be
ignored. ignored.
skipping to change at page 29, line 34 skipping to change at page 29, line 39
of the next message that will be received on a subsequent call to one of the next message that will be received on a subsequent call to one
of the receive message functions. Note that this length may be a of the receive message functions. Note that this length may be a
partial length depending on the settings of next_flags. partial length depending on the settings of next_flags.
sreinfo_next_ppid: 32 bit (unsigned integer) sreinfo_next_ppid: 32 bit (unsigned integer)
This value, when valid (see sreinfo_next_flags), contains the ppid of This value, when valid (see sreinfo_next_flags), contains the ppid of
the next message that will be received on a subsequent call to one of the next message that will be received on a subsequent call to one of
the receive message functions. the receive message functions.
5.3. SCTP Events and Notifications 6.3. SCTP Events and Notifications
An SCTP application may need to understand and process events and An SCTP application may need to understand and process events and
errors that happen on the SCTP stack. These events include network errors that happen on the SCTP stack. These events include network
status changes, association startups, remote operational errors and status changes, association startups, remote operational errors and
undeliverable messages. All of these can be essential for the undeliverable messages. All of these can be essential for the
application. application.
When an SCTP application layer does a recvmsg() the message read is When an SCTP application layer does a recvmsg() the message read is
normally a data message from a peer endpoint. If the application normally a data message from a peer endpoint. If the application
wishes to have the SCTP stack deliver notifications of non-data wishes to have the SCTP stack deliver notifications of non-data
events, it sets the appropriate socket option for the notifications events, it sets the appropriate socket option for the notifications
it wants. See Section 7.3 for these socket options. When a it wants. See Section 8.3 for these socket options. When a
notification arrives, recvmsg() returns the notification in the notification arrives, recvmsg() returns the notification in the
application-supplied data buffer via msg_iov, and sets application-supplied data buffer via msg_iov, and sets
MSG_NOTIFICATION in msg_flags. MSG_NOTIFICATION in msg_flags.
This section details the notification structures. Every notification This section details the notification structures. Every notification
structure carries some common fields which provides general structure carries some common fields which provides general
information. information.
A recvmsg() call will return only one notification at a time. Just A recvmsg() call will return only one notification at a time. Just
as when reading normal data, it may return part of a notification if as when reading normal data, it may return part of a notification if
the msg_iov buffer is not large enough. If a single read is not the msg_iov buffer is not large enough. If a single read is not
sufficient, msg_flags will have MSG_EOR clear. The user MUST finish sufficient, msg_flags will have MSG_EOR clear. The user MUST finish
reading the notification before subsequent data can arrive. reading the notification before subsequent data can arrive.
5.3.1. SCTP Notification Structure 6.3.1. SCTP Notification Structure
The notification structure is defined as the union of all The notification structure is defined as the union of all
notification types. notification types.
union sctp_notification { union sctp_notification {
struct { struct {
uint16_t sn_type; /* Notification type. */ uint16_t sn_type; /* Notification type. */
uint16_t sn_flags; uint16_t sn_flags;
uint32_t sn_length; uint32_t sn_length;
} sn_header; } sn_header;
skipping to change at page 30, line 40 skipping to change at page 30, line 46
struct sctp_authkey_event sn_auth_event; struct sctp_authkey_event sn_auth_event;
struct sctp_no_auth_event sn_no_auth_event; struct sctp_no_auth_event sn_no_auth_event;
}; };
sn_type: 16 bits (unsigned integer) sn_type: 16 bits (unsigned integer)
The following list describes the SCTP notification and event types The following list describes the SCTP notification and event types
for the field sn_type. for the field sn_type.
SCTP_ASSOC_CHANGE: This tag indicates that an association has either SCTP_ASSOC_CHANGE: This tag indicates that an association has either
been opened or closed. Refer to Section 5.3.1.1 for details. been opened or closed. Refer to Section 6.3.1.1 for details.
SCTP_PEER_ADDR_CHANGE: This tag indicates that an address that is SCTP_PEER_ADDR_CHANGE: This tag indicates that an address that is
part of an existing association has experienced a change of state part of an existing association has experienced a change of state
(e.g. a failure or return to service of the reachability of a (e.g. a failure or return to service of the reachability of a
endpoint via a specific transport address). Please see endpoint via a specific transport address). Please see
Section 5.3.1.2 for data structure details. Section 6.3.1.2 for data structure details.
SCTP_REMOTE_ERROR: The attached error message is an Operational SCTP_REMOTE_ERROR: The attached error message is an Operational
Error received from the remote peer. It includes the complete TLV Error received from the remote peer. It includes the complete TLV
sent by the remote endpoint. See Section 5.3.1.3 for the detailed sent by the remote endpoint. See Section 6.3.1.3 for the detailed
format. format.
SCTP_SEND_FAILED: The attached datagram could not be sent to the SCTP_SEND_FAILED: The attached datagram could not be sent to the
remote endpoint. This structure includes the original remote endpoint. This structure includes the original
SCTP_SNDRCVINFO that was used in sending this message i.e. this SCTP_SNDRCVINFO that was used in sending this message i.e. this
structure uses the sctp_sndrecvinfo per Section 5.3.1.4. structure uses the sctp_sndrecvinfo per Section 6.3.1.4.
SCTP_SHUTDOWN_EVENT: The peer has sent a SHUTDOWN. No further data SCTP_SHUTDOWN_EVENT: The peer has sent a SHUTDOWN. No further data
should be sent on this socket. should be sent on this socket.
SCTP_ADAPTATION_INDICATION: This notification holds the peers SCTP_ADAPTATION_INDICATION: This notification holds the peers
indicated adaptation layer. Please see Section 5.3.1.6. indicated adaptation layer. Please see Section 6.3.1.6.
SCTP_PARTIAL_DELIVERY_EVENT: This notification is used to tell a SCTP_PARTIAL_DELIVERY_EVENT: This notification is used to tell a
receiver that the partial delivery has been aborted. This may receiver that the partial delivery has been aborted. This may
indicate the association is about to be aborted. Please see indicate the association is about to be aborted. Please see
Section 5.3.1.7 Section 6.3.1.7
SCTP_AUTHENTICATION_EVENT: This notification is used to tell a SCTP_AUTHENTICATION_EVENT: This notification is used to tell a
receiver that either an error occurred on authentication, or a new receiver that either an error occurred on authentication, or a new
key was made active. Section 5.3.1.8 key was made active. Section 6.3.1.8
SCTP_NO_AUTHENTICATION_EVENT: This notification is used to tell a SCTP_NO_AUTHENTICATION_EVENT: This notification is used to tell a
receiver that the peer does not support SCTP-AUTH. receiver that the peer does not support SCTP-AUTH.
Section 5.3.1.9 Section 6.3.1.9
SCTP_AUTHENTICATION_KEY_FREE_EVENT: This notification is used to
tell a receiver that a key is not used anymore for sending.
Section 6.3.1.11
SCTP_SENDER_DRY_EVENT: This notification is used to inform the
application that the sender has no user data queued anymore,
neither for transmission or retransmission. Section 6.3.1.10
All standard values for sn_type are greater than 2^15. Values from All standard values for sn_type are greater than 2^15. Values from
2^15 and down are reserved. 2^15 and down are reserved.
sn_flags: 16 bits (unsigned integer) sn_flags: 16 bits (unsigned integer)
These are notification-specific flags. These are notification-specific flags.
sn_length: 32 bits (unsigned integer) sn_length: 32 bits (unsigned integer)
This is the length of the whole sctp_notification structure including This is the length of the whole sctp_notification structure including
the sn_type, sn_flags, and sn_length fields. the sn_type, sn_flags, and sn_length fields.
5.3.1.1. SCTP_ASSOC_CHANGE 6.3.1.1. SCTP_ASSOC_CHANGE
Communication notifications inform the ULP that an SCTP association Communication notifications inform the ULP that an SCTP association
has either begun or ended. The identifier for a new association is has either begun or ended. The identifier for a new association is
provided by this notification. The notification information has the provided by this notification. The notification information has the
following format: following format:
struct sctp_assoc_change { struct sctp_assoc_change {
uint16_t sac_type; uint16_t sac_type;
uint16_t sac_flags; uint16_t sac_flags;
uint32_t sac_length; uint32_t sac_length;
skipping to change at page 33, line 19 skipping to change at page 33, line 28
The association id field, holds the identifier for the association. The association id field, holds the identifier for the association.
All notifications for a given association have the same association All notifications for a given association have the same association
identifier. For one-to-one style socket, this field is ignored. identifier. For one-to-one style socket, this field is ignored.
sac_info: variable sac_info: variable
If the sac_state is SCTP_COMM_LOST and an ABORT chunk was received If the sac_state is SCTP_COMM_LOST and an ABORT chunk was received
for this association, sac_info[] contains the complete ABORT chunk as for this association, sac_info[] contains the complete ABORT chunk as
defined in the SCTP specification [RFC4960] section 3.3.7. defined in the SCTP specification [RFC4960] section 3.3.7.
5.3.1.2. SCTP_PEER_ADDR_CHANGE 6.3.1.2. SCTP_PEER_ADDR_CHANGE
When a destination address on a multi-homed peer encounters a change When a destination address on a multi-homed peer encounters a change
an interface details event is sent. The information has the an interface details event is sent. The information has the
following structure: following structure:
struct sctp_paddr_change { struct sctp_paddr_change {
uint16_t spc_type; uint16_t spc_type;
uint16_t spc_flags; uint16_t spc_flags;
uint32_t spc_length; uint32_t spc_length;
struct sockaddr_storage spc_aaddr; struct sockaddr_storage spc_aaddr;
skipping to change at page 34, line 39 skipping to change at page 34, line 48
If the state was reached due to any error condition (e.g. If the state was reached due to any error condition (e.g.
SCTP_ADDR_UNREACHABLE) any relevant error information is available in SCTP_ADDR_UNREACHABLE) any relevant error information is available in
this field. this field.
spc_assoc_id: sizeof (sctp_assoc_t) spc_assoc_id: sizeof (sctp_assoc_t)
The association id field, holds the identifier for the association. The association id field, holds the identifier for the association.
All notifications for a given association have the same association All notifications for a given association have the same association
identifier. For one-to-one style socket, this field is ignored. identifier. For one-to-one style socket, this field is ignored.
5.3.1.3. SCTP_REMOTE_ERROR 6.3.1.3. SCTP_REMOTE_ERROR
A remote peer may send an Operational Error message to its peer. A remote peer may send an Operational Error message to its peer.
This message indicates a variety of error conditions on an This message indicates a variety of error conditions on an
association. The entire ERROR chunk as it appears on the wire is association. The entire ERROR chunk as it appears on the wire is
included in a SCTP_REMOTE_ERROR event. Please refer to the SCTP included in a SCTP_REMOTE_ERROR event. Please refer to the SCTP
specification [RFC4960] and any extensions for a list of possible specification [RFC4960] and any extensions for a list of possible
error formats. SCTP error notifications have the format: error formats. SCTP error notifications have the format:
struct sctp_remote_error { struct sctp_remote_error {
uint16_t sre_type; uint16_t sre_type;
skipping to change at page 35, line 43 skipping to change at page 35, line 46
The association id field, holds the identifier for the association. The association id field, holds the identifier for the association.
All notifications for a given association have the same association All notifications for a given association have the same association
identifier. For one-to-one style socket, this field is ignored. identifier. For one-to-one style socket, this field is ignored.
sre_data: variable sre_data: variable
This contains the ERROR chunk as defined in the SCTP specification This contains the ERROR chunk as defined in the SCTP specification
[RFC4960] section 3.3.10. [RFC4960] section 3.3.10.
5.3.1.4. SCTP_SEND_FAILED 6.3.1.4. SCTP_SEND_FAILED
If SCTP cannot deliver a message it may return the message as a If SCTP cannot deliver a message it may return the message as a
notification. notification.
struct sctp_send_failed { struct sctp_send_failed {
uint16_t ssf_type; uint16_t ssf_type;
uint16_t ssf_flags; uint16_t ssf_flags;
uint32_t ssf_length; uint32_t ssf_length;
uint32_t ssf_error; uint32_t ssf_error;
struct sctp_sndrcvinfo ssf_info; struct sctp_sndrcvinfo ssf_info;
skipping to change at page 37, line 10 skipping to change at page 37, line 10
The association id field, sf_assoc_id, holds the identifier for the The association id field, sf_assoc_id, holds the identifier for the
association. All notifications for a given association have the same association. All notifications for a given association have the same
association identifier. For one-to-one style socket, this field is association identifier. For one-to-one style socket, this field is
ignored. ignored.
ssf_data: variable length ssf_data: variable length
The undelivered message, exactly as delivered by the caller to the The undelivered message, exactly as delivered by the caller to the
original send*() call. original send*() call.
5.3.1.5. SCTP_SHUTDOWN_EVENT 6.3.1.5. SCTP_SHUTDOWN_EVENT
When a peer sends a SHUTDOWN, SCTP delivers this notification to When a peer sends a SHUTDOWN, SCTP delivers this notification to
inform the application that it should cease sending data. inform the application that it should cease sending data.
struct sctp_shutdown_event { struct sctp_shutdown_event {
uint16_t sse_type; uint16_t sse_type;
uint16_t sse_flags; uint16_t sse_flags;
uint32_t sse_length; uint32_t sse_length;
sctp_assoc_t sse_assoc_id; sctp_assoc_t sse_assoc_id;
}; };
skipping to change at page 37, line 46 skipping to change at page 37, line 46
sse_flags: 16 bits (unsigned integer) sse_flags: 16 bits (unsigned integer)
Currently unused. Currently unused.
sse_assoc_id: sizeof (sctp_assoc_t) sse_assoc_id: sizeof (sctp_assoc_t)
The association id field, holds the identifier for the association. The association id field, holds the identifier for the association.
All notifications for a given association have the same association All notifications for a given association have the same association
identifier. For one-to-one style socket, this field is ignored. identifier. For one-to-one style socket, this field is ignored.
5.3.1.6. SCTP_ADAPTATION_INDICATION 6.3.1.6. SCTP_ADAPTATION_INDICATION
When a peer sends a Adaptation Layer Indication parameter , SCTP When a peer sends a Adaptation Layer Indication parameter , SCTP
delivers this notification to inform the application that of the delivers this notification to inform the application that of the
peers requested adaptation layer. peers requested adaptation layer.
struct sctp_adaptation_event { struct sctp_adaptation_event {
uint16_t sai_type; uint16_t sai_type;
uint16_t sai_flags; uint16_t sai_flags;
uint32_t sai_length; uint32_t sai_length;
uint32_t sai_adaptation_ind; uint32_t sai_adaptation_ind;
skipping to change at page 38, line 38 skipping to change at page 38, line 38
This field holds the bit array sent by the peer in the adaptation This field holds the bit array sent by the peer in the adaptation
layer indication parameter. The bits are in network byte order. layer indication parameter. The bits are in network byte order.
sai_assoc_id: sizeof (sctp_assoc_t) sai_assoc_id: sizeof (sctp_assoc_t)
The association id field, holds the identifier for the association. The association id field, holds the identifier for the association.
All notifications for a given association have the same association All notifications for a given association have the same association
identifier. For one-to-one style socket, this field is ignored. identifier. For one-to-one style socket, this field is ignored.
5.3.1.7. SCTP_PARTIAL_DELIVERY_EVENT 6.3.1.7. SCTP_PARTIAL_DELIVERY_EVENT
When a receiver is engaged in a partial delivery of a message this When a receiver is engaged in a partial delivery of a message this
notification will be used to indicate various events. notification will be used to indicate various events.
struct sctp_pdapi_event { struct sctp_pdapi_event {
uint16_t pdapi_type; uint16_t pdapi_type;
uint16_t pdapi_flags; uint16_t pdapi_flags;
uint32_t pdapi_length; uint32_t pdapi_length;
uint32_t pdapi_indication; uint32_t pdapi_indication;
uint32_t pdapi_stream; uint32_t pdapi_stream;
skipping to change at page 39, line 41 skipping to change at page 39, line 41
This field holds the stream sequence number which was being partially This field holds the stream sequence number which was being partially
delivered. delivered.
pdapi_assoc_id: sizeof (sctp_assoc_t) pdapi_assoc_id: sizeof (sctp_assoc_t)
The association id field, holds the identifier for the association. The association id field, holds the identifier for the association.
All notifications for a given association have the same association All notifications for a given association have the same association
identifier. For one-to-one style socket, this field is ignored. identifier. For one-to-one style socket, this field is ignored.
5.3.1.8. SCTP_AUTHENTICATION_EVENT 6.3.1.8. SCTP_AUTHENTICATION_EVENT
When a receiver is using authentication this message will provide When a receiver is using authentication this message will provide
notifications regarding new keys being made active as well as errors. notifications regarding new keys being made active as well as errors.
struct sctp_authkey_event { struct sctp_authkey_event {
uint16_t auth_type; uint16_t auth_type;
uint16_t auth_flags; uint16_t auth_flags;
uint32_t auth_length; uint32_t auth_length;
uint16_t auth_keynumber; uint16_t auth_keynumber;
uint16_t auth_altkeynumber; uint16_t auth_altkeynumber;
skipping to change at page 41, line 6 skipping to change at page 41, line 6
made active (used for the first time by the peer) and is now the made active (used for the first time by the peer) and is now the
active key. The auth_keynumber field holds the user specified key active key. The auth_keynumber field holds the user specified key
number. number.
auth_assoc_id: sizeof (sctp_assoc_t) auth_assoc_id: sizeof (sctp_assoc_t)
The association id field, holds the identifier for the association. The association id field, holds the identifier for the association.
All notifications for a given association have the same association All notifications for a given association have the same association
identifier. identifier.
5.3.1.9. SCTP_AUTHENTICATION_EVENT 6.3.1.9. SCTP_AUTHENTICATION_EVENT
When an association is set up and the peer does not support SCTP-AUTH When an association is set up and the peer does not support SCTP-AUTH
this notification is provided by the kernel to the user. this notification is provided by the kernel to the user.
struct sctp_no_auth_event { struct sctp_no_auth_event {
uint16_t no_auth_type; uint16_t no_auth_type;
uint16_t no_auth_flags; uint16_t no_auth_flags;
uint32_t no_auth_length; uint32_t no_auth_length;
sctp_assoc_t no_auth_assoc_id; sctp_assoc_t no_auth_assoc_id;
}; };
skipping to change at page 41, line 32 skipping to change at page 41, line 32
no_auth_flags: 16 bits (unsigned integer) no_auth_flags: 16 bits (unsigned integer)
Currently unused. Currently unused.
no_auth_length: 32 bits (unsigned integer) no_auth_length: 32 bits (unsigned integer)
This field is the total length of the notification data, including This field is the total length of the notification data, including
the notification header. It will generally be sizeof (struct the notification header. It will generally be sizeof (struct
sctp_no_auth_event). sctp_no_auth_event).
5.4. Ancillary Data Considerations and Semantics 6.3.1.10. SCTP_SENDER_DRY_EVENT
When an association is set up and the peer does not support SCTP-AUTH
this notification is provided by the kernel to the user.
struct sctp_sender_dry_event {
uint16_t sender_dry_type;
uint16_t sender_dry_flags;
uint32_t sender_dry_length;
sctp_assoc_t sender_dry_assoc_id;
};
sender_dry_type:
It should be SCTP_SENDER_DRY_EVENT
sender_dry_flags: 16 bits (unsigned integer)
Currently unused.
sender_dry_length: 32 bits (unsigned integer)
This field is the total length of the notification data, including
the notification header. It will generally be sizeof (struct
sctp_sender_dry_event).
6.3.1.11. SCTP_AUTHENTICATION_FREE_KEY_EVENT
When SCTP-AUTH wik not use a key identifier for sending packets
anymore, this notification is provided by the kernel to the user.
struct sctp_auth_free_key_event {
uint16_t type;
uint16_t flags;
uint32_t length;
uint16_t keynumber;
sctp_assoc_t assoc_id;
};
type:
It should be SCTP_AUTHENTICATION_FREE_KEY_EVENT
flags: 16 bits (unsigned integer)
Currently unused.
length: 32 bits (unsigned integer)
This field is the total length of the notification data, including
the notification header. It will generally be sizeof (struct
sctp_auth_free_key_event).
keynumber: 16 bits (unsigned integer)
This field holds the keynumber set by the user for the effected key.
6.4. Ancillary Data Considerations and Semantics
Programming with ancillary socket data contains some subtleties and Programming with ancillary socket data contains some subtleties and
pitfalls, which are discussed below. pitfalls, which are discussed below.
5.4.1. Multiple Items and Ordering 6.4.1. Multiple Items and Ordering
Multiple ancillary data items may be included in any call to Multiple ancillary data items may be included in any call to
sendmsg() or recvmsg(); these may include multiple SCTP or non-SCTP sendmsg() or recvmsg(); these may include multiple SCTP or non-SCTP
items, or both. items, or both.
The ordering of ancillary data items (either by SCTP or another The ordering of ancillary data items (either by SCTP or another
protocol) is not significant and is implementation-dependent, so protocol) is not significant and is implementation-dependent, so
applications must not depend on any ordering. applications must not depend on any ordering.
SCTP_SNDRCV items must always correspond to the data in the msghdr's SCTP_SNDRCV items must always correspond to the data in the msghdr's
msg_iov member. There can be only a single SCTP_SNDRCV info for each msg_iov member. There can be only a single SCTP_SNDRCV info for each
sendmsg() or recvmsg() call. sendmsg() or recvmsg() call.
5.4.2. Accessing and Manipulating Ancillary Data 6.4.2. Accessing and Manipulating Ancillary Data
Applications can infer the presence of data or ancillary data by Applications can infer the presence of data or ancillary data by
examining the msg_iovlen and msg_controllen msghdr members, examining the msg_iovlen and msg_controllen msghdr members,
respectively. respectively.
Implementations may have different padding requirements for ancillary Implementations may have different padding requirements for ancillary
data, so portable applications should make use of the macros data, so portable applications should make use of the macros
CMSG_FIRSTHDR, CMSG_NXTHDR, CMSG_DATA, CMSG_SPACE, and CMSG_LEN. See CMSG_FIRSTHDR, CMSG_NXTHDR, CMSG_DATA, CMSG_SPACE, and CMSG_LEN. See
[RFC2292] and your SCTP implementation's documentation for more [RFC3542] and your SCTP implementation's documentation for more
information. Following is an example, from [RFC2292], demonstrating information. Following is an example, from [RFC3542], demonstrating
the use of these macros to access ancillary data: the use of these macros to access ancillary data:
struct msghdr msg; struct msghdr msg;
struct cmsghdr *cmsgptr; struct cmsghdr *cmsgptr;
/* fill in msg */ /* fill in msg */
/* call recvmsg() */ /* call recvmsg() */
for (cmsgptr = CMSG_FIRSTHDR(&msg); cmsgptr != NULL; for (cmsgptr = CMSG_FIRSTHDR(&msg); cmsgptr != NULL;
cmsgptr = CMSG_NXTHDR(&msg, cmsgptr)) { cmsgptr = CMSG_NXTHDR(&msg, cmsgptr)) {
if (cmsgptr->cmsg_level == ... && cmsgptr->cmsg_type == ... ) { if (cmsgptr->cmsg_level == ... && cmsgptr->cmsg_type == ... ) {
u_char *ptr; u_char *ptr;
ptr = CMSG_DATA(cmsgptr); ptr = CMSG_DATA(cmsgptr);
/* process data pointed to by ptr */ /* process data pointed to by ptr */
} }
} }
5.4.3. Control Message Buffer Sizing 6.4.3. Control Message Buffer Sizing
The information conveyed via SCTP_SNDRCV events will often be The information conveyed via SCTP_SNDRCV events will often be
fundamental to the correct and sane operation of the sockets fundamental to the correct and sane operation of the sockets
application. This is particularly true of the one-to-many semantics, application. This is particularly true of the one-to-many semantics,
but also of the one-ton-one semantics. For example, if an but also of the one-ton-one semantics. For example, if an
application needs to send and receive data on different SCTP streams, application needs to send and receive data on different SCTP streams,
SCTP_SNDRCV events are indispensable. SCTP_SNDRCV events are indispensable.
Given that some ancillary data is critical, and that multiple Given that some ancillary data is critical, and that multiple
ancillary data items may appear in any order, applications should be ancillary data items may appear in any order, applications should be
skipping to change at page 43, line 9 skipping to change at page 44, line 17
the buffer is too small, and crucial data is truncated, it may pose a the buffer is too small, and crucial data is truncated, it may pose a
fatal error condition. fatal error condition.
Thus it is essential that applications be able to deterministically Thus it is essential that applications be able to deterministically
calculate the maximum required buffer size to pass to recvmsg(). One calculate the maximum required buffer size to pass to recvmsg(). One
constraint imposed on this specification that makes this possible is constraint imposed on this specification that makes this possible is
that all ancillary data definitions are of a fixed length. One way that all ancillary data definitions are of a fixed length. One way
to calculate the maximum required buffer size might be to take the to calculate the maximum required buffer size might be to take the
sum the sizes of all enabled ancillary data item structures, as sum the sizes of all enabled ancillary data item structures, as
calculated by CMSG_SPACE. For example, if we enabled calculated by CMSG_SPACE. For example, if we enabled
SCTP_SNDRCV_INFO and IPV6_RECVPKTINFO [RFC2292], we would calculate SCTP_SNDRCV_INFO and IPV6_RECVPKTINFO [RFC3542], we would calculate
and allocate the buffer size as follows: and allocate the buffer size as follows:
size_t total; size_t total;
void *buf; void *buf;
total = CMSG_SPACE(sizeof (struct sctp_sndrcvinfo)) + total = CMSG_SPACE(sizeof (struct sctp_sndrcvinfo)) +
CMSG_SPACE(sizeof (struct in6_pktinfo)); CMSG_SPACE(sizeof (struct in6_pktinfo));
buf = malloc(total); buf = malloc(total);
We could then use this buffer for msg_control on each call to We could then use this buffer for msg_control on each call to
recvmsg() and be assured that we would not lose any ancillary data to recvmsg() and be assured that we would not lose any ancillary data to
truncation. truncation.
6. Common Operations for Both Styles 7. Common Operations for Both Styles
6.1. send(), recv(), sendto(), recvfrom() 7.1. send(), recv(), sendto(), recvfrom()
Applications can use send() and sendto() to transmit data to the peer Applications can use send() and sendto() to transmit data to the peer
of an SCTP endpoint. recv() and recvfrom() can be used to receive of an SCTP endpoint. recv() and recvfrom() can be used to receive
data from the peer. data from the peer.
The syntax is: The syntax is:
ssize_t send(int sd, const void *msg, size_t len, int flags); ssize_t send(int sd, const void *msg, size_t len, int flags);
ssize_t sendto(int sd, const void *msg, size_t len, int flags, ssize_t sendto(int sd, const void *msg, size_t len, int flags,
const struct sockaddr *to, socklen_t tolen); const struct sockaddr *to, socklen_t tolen);
skipping to change at page 44, line 49 skipping to change at page 46, line 6
returns as much data as will fit in the buffer. returns as much data as will fit in the buffer.
Note, the send() and recv() calls may not be used for a one-to-many Note, the send() and recv() calls may not be used for a one-to-many
style socket. style socket.
Note, if an application calls a send function with no user data and Note, if an application calls a send function with no user data and
no ancillary data the SCTP implementation should reject the request no ancillary data the SCTP implementation should reject the request
with an appropriate error message. An implementation is NOT allowed with an appropriate error message. An implementation is NOT allowed
to send a Data chunk with no user data [RFC4960]. to send a Data chunk with no user data [RFC4960].
6.2. setsockopt(), getsockopt() 7.2. setsockopt(), getsockopt()
Applications use setsockopt() and getsockopt() to set or retrieve Applications use setsockopt() and getsockopt() to set or retrieve
socket options. Socket options are used to change the default socket options. Socket options are used to change the default
behavior of sockets calls. They are described in Section 7 behavior of sockets calls. They are described in Section 8
The syntax is: The syntax is:
ret = getsockopt(int sd, int level, int optname, void *optval, ret = getsockopt(int sd, int level, int optname, void *optval,
socklen_t *optlen); socklen_t *optlen);
ret = setsockopt(int sd, int level, int optname, const void *optval, ret = setsockopt(int sd, int level, int optname, const void *optval,
socklen_t optlen); socklen_t optlen);
sd - the socket descriptor. sd - the socket descriptor.
level - set to IPPROTO_SCTP for all SCTP options. level - set to IPPROTO_SCTP for all SCTP options.
optname - the option name. optname - the option name.
optval - the buffer to store the value of the option. optval - the buffer to store the value of the option.
optlen - the size of the buffer (or the length of the option optlen - the size of the buffer (or the length of the option
returned). returned).
All socket options set on a 1-to-1 listening sockets also apply all All socket options set on a 1-to-1 listening sockets also apply all
accepted sockets. All socket options set on a 1-to-many socket using accepted sockets. All socket options set on a 1-to-many socket using
the assoc_id 0 applies for all future assocs on the socket. the assoc_id 0 applies for all future assocs on the socket.
6.3. read() and write() 7.3. read() and write()
Applications can use read() and write() to send and receive data to Applications can use read() and write() to send and receive data to
and from peer. They have the same semantics as send() and recv() and from peer. They have the same semantics as send() and recv()
except that the flags parameter cannot be used. except that the flags parameter cannot be used.
Note, these calls, when used in the one-to-many style, may only be Note, these calls, when used in the one-to-many style, may only be
used with branched off socket descriptors (see Section 8.2). used with branched off socket descriptors (see Section 9.2).
6.4. getsockname() 7.4. getsockname()
Applications use getsockname() to retrieve the locally-bound socket Applications use getsockname() to retrieve the locally-bound socket
address of the specified socket. This is especially useful if the address of the specified socket. This is especially useful if the
caller let SCTP chose a local port. This call is for where the caller let SCTP chose a local port. This call is for where the
endpoint is not multi-homed. It does not work well with multi-homed endpoint is not multi-homed. It does not work well with multi-homed
sockets. See Section 8.5 for a multi-homed version of the call. sockets. See Section 9.5 for a multi-homed version of the call.
The syntax is: The syntax is:
int getsockname(int sd, struct sockaddr *address, int getsockname(int sd, struct sockaddr *address,
socklen_t *len); socklen_t *len);
sd - the socket descriptor to be queried. sd - the socket descriptor to be queried.
address - On return, one locally bound address (chosen by the SCTP address - On return, one locally bound address (chosen by the SCTP
stack) is stored in this buffer. If the socket is an IPv4 socket, stack) is stored in this buffer. If the socket is an IPv4 socket,
the address will be IPv4. If the socket is an IPv6 socket, the the address will be IPv4. If the socket is an IPv6 socket, the
address will be either an IPv6 or IPv4 address. address will be either an IPv6 or IPv4 address.
len - The caller should set the length of address here. On return, len - The caller should set the length of address here. On return,
this is set to the length of the returned address. this is set to the length of the returned address.
If the actual length of the address is greater than the length of the If the actual length of the address is greater than the length of the
supplied sockaddr structure, the stored address will be truncated. supplied sockaddr structure, the stored address will be truncated.
skipping to change at page 46, line 18 skipping to change at page 47, line 18
address will be either an IPv6 or IPv4 address. address will be either an IPv6 or IPv4 address.
len - The caller should set the length of address here. On return, len - The caller should set the length of address here. On return,
this is set to the length of the returned address. this is set to the length of the returned address.
If the actual length of the address is greater than the length of the If the actual length of the address is greater than the length of the
supplied sockaddr structure, the stored address will be truncated. supplied sockaddr structure, the stored address will be truncated.
If the socket has not been bound to a local name, the value stored in If the socket has not been bound to a local name, the value stored in
the object pointed to by address is unspecified. the object pointed to by address is unspecified.
7. Socket Options 8. Socket Options
The following sub-section describes various SCTP level socket options The following sub-section describes various SCTP level socket options
that are common to both styles. SCTP associations can be multi- that are common to both styles. SCTP associations can be multi-
homed. Therefore, certain option parameters include a homed. Therefore, certain option parameters include a
sockaddr_storage structure to select which peer address the option sockaddr_storage structure to select which peer address the option
should be applied to. should be applied to.
For the one-to-many style sockets, an sctp_assoc_t structure For the one-to-many style sockets, an sctp_assoc_t structure
(association ID) is used to identify the association instance that (association ID) is used to identify the association instance that
the operation affects. So it must be set when using this style. the operation affects. So it must be set when using this style.
For the one-to-one style sockets and branched off one-to-many style For the one-to-one style sockets and branched off one-to-many style
sockets (see Section 8.2) this association ID parameter is ignored. sockets (see Section 9.2) this association ID parameter is ignored.
Note that socket or IP level options are set or retrieved per socket. Note that socket or IP level options are set or retrieved per socket.
This means that for one-to-many style sockets, those options will be This means that for one-to-many style sockets, those options will be
applied to all associations belonging to the socket. And for one-to- applied to all associations belonging to the socket. And for one-to-
one style, those options will be applied to all peer addresses of the one style, those options will be applied to all peer addresses of the
association controlled by the socket. Applications should be very association controlled by the socket. Applications should be very
careful in setting those options. careful in setting those options.
For some IP stacks getsockopt() is read-only; so a new interface will For some IP stacks getsockopt() is read-only; so a new interface will
be needed when information must be passed both in to and out of the be needed when information must be passed both in to and out of the
skipping to change at page 47, line 25 skipping to change at page 48, line 26
SCTP_GET_PEER_ADDR_INFO SCTP_GET_PEER_ADDR_INFO
SCTP_PRIMARY_ADDR SCTP_PRIMARY_ADDR
SCTP_PEER_ADDR_PARAMS SCTP_PEER_ADDR_PARAMS
SCTP_STATUS SCTP_STATUS
SCTP_CONTEXT SCTP_CONTEXT
SCTP_AUTH_ACTIVE_KEY SCTP_AUTH_ACTIVE_KEY
SCTP_PEER_AUTH_CHUNKS SCTP_PEER_AUTH_CHUNKS
SCTP_LOCAL_AUTH_CHUNKS SCTP_LOCAL_AUTH_CHUNKS
arg is an option-specific structure buffer provided by the caller. arg is an option-specific structure buffer provided by the caller.
See Section 8.5) subsections for more information on these options See Section 9.5) subsections for more information on these options
and option-specific structures. and option-specific structures.
sctp_opt_info() returns 0 on success, or on failure returns -1 and sctp_opt_info() returns 0 on success, or on failure returns -1 and
sets errno to the appropriate error code. sets errno to the appropriate error code.
All options that support specific settings on an association by All options that support specific settings on an association by
filling in either an association id variable or a sockaddr_storage filling in either an association id variable or a sockaddr_storage
SHOULD also support setting of the same value for the entire endpoint SHOULD also support setting of the same value for the entire endpoint
(i.e. future associations). To accomplish this the following logic (i.e. future associations). To accomplish this the following logic
is used when setting one of these options: is used when setting one of these options:
skipping to change at page 48, line 10 skipping to change at page 49, line 10
the entire association (since a specific address is not the entire association (since a specific address is not
specified). Note this also applies to options that hold an specified). Note this also applies to options that hold an
association identification in their structure but do not have a association identification in their structure but do not have a
sockaddr_storage field. sockaddr_storage field.
c) If neither the sockaddr_storage or association identification is c) If neither the sockaddr_storage or association identification is
set, i.e. the sockaddr_storage is set to all 0's (INADDR_ANY) and set, i.e. the sockaddr_storage is set to all 0's (INADDR_ANY) and
the association identification is 0, the settings are a default the association identification is 0, the settings are a default
and to be applied to the endpoint (all future associations). and to be applied to the endpoint (all future associations).
7.1. Read / Write Options 8.1. Read / Write Options
7.1.1. Retransmission Timeout Parameters (SCTP_RTOINFO) 8.1.1. Retransmission Timeout Parameters (SCTP_RTOINFO)
The protocol parameters used to initialize and bound retransmission The protocol parameters used to initialize and bound retransmission
timeout (RTO) are tunable. See [RFC4960] for more information on how timeout (RTO) are tunable. See [RFC4960] for more information on how
these parameters are used in RTO calculation. these parameters are used in RTO calculation.
The following structure is used to access and modify these The following structure is used to access and modify these
parameters: parameters:
struct sctp_rtoinfo { struct sctp_rtoinfo {
sctp_assoc_t srto_assoc_id; sctp_assoc_t srto_assoc_id;
skipping to change at page 48, line 44 skipping to change at page 49, line 44
change effects the entire endpoint. change effects the entire endpoint.
All parameters are time values, in milliseconds. A value of 0, when All parameters are time values, in milliseconds. A value of 0, when
modifying the parameters, indicates that the current value should not modifying the parameters, indicates that the current value should not
be changed. be changed.
To access or modify these parameters, the application should call To access or modify these parameters, the application should call
getsockopt or setsockopt() respectively with the option name getsockopt or setsockopt() respectively with the option name
SCTP_RTOINFO. SCTP_RTOINFO.
7.1.2. Association Parameters (SCTP_ASSOCINFO) 8.1.2. Association Parameters (SCTP_ASSOCINFO)
This option is used to both examine and set various association and This option is used to both examine and set various association and
endpoint parameters. endpoint parameters.
See [RFC4960] for more information on how this parameter is used. See [RFC4960] for more information on how this parameter is used.
The sasoc_assoc_id parameter is ignored for one-to-one style socket. The sasoc_assoc_id parameter is ignored for one-to-one style socket.
The following structure is used to access and modify this parameters: The following structure is used to access and modify this parameters:
struct sctp_assocparams { struct sctp_assocparams {
skipping to change at page 50, line 14 skipping to change at page 51, line 14
shall return an error. The reason for this, from [RFC4960] section shall return an error. The reason for this, from [RFC4960] section
8.2: 8.2:
Note: When configuring the SCTP endpoint, the user should avoid Note: When configuring the SCTP endpoint, the user should avoid
having the value of 'Association.Max.Retrans' larger than the having the value of 'Association.Max.Retrans' larger than the
summation of the 'Path.Max.Retrans' of all the destination addresses summation of the 'Path.Max.Retrans' of all the destination addresses
for the remote endpoint. Otherwise, all the destination addresses for the remote endpoint. Otherwise, all the destination addresses
may become inactive while the endpoint still considers the peer may become inactive while the endpoint still considers the peer
endpoint reachable. endpoint reachable.
7.1.3. Initialization Parameters (SCTP_INITMSG) 8.1.3. Initialization Parameters (SCTP_INITMSG)
Applications can specify protocol parameters for the default Applications can specify protocol parameters for the default
association initialization. The structure used to access and modify association initialization. The structure used to access and modify
these parameters is defined in Section 5.2.1). The option name these parameters is defined in Section 6.2.1). The option name
argument to setsockopt() and getsockopt() is SCTP_INITMSG. argument to setsockopt() and getsockopt() is SCTP_INITMSG.
Setting initialization parameters is effective only on an unconnected Setting initialization parameters is effective only on an unconnected
socket (for one-to-many style sockets only future associations are socket (for one-to-many style sockets only future associations are
effected by the change). With one-to-one style sockets, this option effected by the change). With one-to-one style sockets, this option
is inherited by sockets derived from a listener socket. is inherited by sockets derived from a listener socket.
7.1.4. SO_LINGER 8.1.4. SO_LINGER
An application using the one-to-one style socket can use this option An application using the one-to-one style socket can use this option
to perform the SCTP ABORT primitive. The linger option structure is: to perform the SCTP ABORT primitive. The linger option structure is:
struct linger { struct linger {
int l_onoff; /* option on/off */ int l_onoff; /* option on/off */
int l_linger; /* linger time */ int l_linger; /* linger time */
}; };
To enable the option, set l_onoff to 1. If the l_linger value is set To enable the option, set l_onoff to 1. If the l_linger value is set
skipping to change at page 50, line 48 skipping to change at page 51, line 48
value is set to a negative value, the setsockopt() call will return value is set to a negative value, the setsockopt() call will return
an error. If the value is set to a positive value linger_time, the an error. If the value is set to a positive value linger_time, the
close() can be blocked for at most linger_time ms. If the graceful close() can be blocked for at most linger_time ms. If the graceful
shutdown phase does not finish during this period, close() will shutdown phase does not finish during this period, close() will
return but the graceful shutdown phase continues in the system. return but the graceful shutdown phase continues in the system.
Note, this is a socket level option NOT an SCTP level option. So Note, this is a socket level option NOT an SCTP level option. So
when setting SO_LINGER you must specify a level of SOL_SOCKET in the when setting SO_LINGER you must specify a level of SOL_SOCKET in the
setsockopt() call. setsockopt() call.
7.1.5. SCTP_NODELAY 8.1.5. SCTP_NODELAY
Turn on/off any Nagle-like algorithm. This means that packets are Turn on/off any Nagle-like algorithm. This means that packets are
generally sent as soon as possible and no unnecessary delays are generally sent as soon as possible and no unnecessary delays are
introduced, at the cost of more packets in the network. Expects an introduced, at the cost of more packets in the network. Expects an
integer boolean flag. integer boolean flag.
7.1.6. SO_RCVBUF 8.1.6. SO_RCVBUF
Sets receive buffer size in octets. For SCTP one-to-one style Sets receive buffer size in octets. For SCTP one-to-one style
sockets, this controls the receiver window size. For one-to-many sockets, this controls the receiver window size. For one-to-many
style sockets the meaning depends on the constant HAVE_SCTP_MULTIBUF style sockets the meaning depends on the constant HAVE_SCTP_MULTIBUF
(see Section 3.4). If the implementation defines HAVE_SCTP_MULTIBUF (see Section 4.4). If the implementation defines HAVE_SCTP_MULTIBUF
as 1, this controls the receiver window size for each association as 1, this controls the receiver window size for each association
bound to the socket descriptor. If the implementation defines bound to the socket descriptor. If the implementation defines
HAVE_SCTP_MULTIBUF as 0, this controls the size of the single receive HAVE_SCTP_MULTIBUF as 0, this controls the size of the single receive
buffer for the whole socket. The call expects an integer. buffer for the whole socket. The call expects an integer.
7.1.7. SO_SNDBUF 8.1.7. SO_SNDBUF
Sets send buffer size. For SCTP one-to-one style sockets, this Sets send buffer size. For SCTP one-to-one style sockets, this
controls the amount of data SCTP may have waiting in internal buffers controls the amount of data SCTP may have waiting in internal buffers
to be sent. This option therefore bounds the maximum size of data to be sent. This option therefore bounds the maximum size of data
that can be sent in a single send call. For one-to-many style that can be sent in a single send call. For one-to-many style
sockets, the effect is the same, except that it applies to one or all sockets, the effect is the same, except that it applies to one or all
associations (see Section 3.4) bound to the socket descriptor used in associations (see Section 4.4) bound to the socket descriptor used in
the setsockopt() or getsockopt() call. The option applies to each the setsockopt() or getsockopt() call. The option applies to each
association's window size separately. The call expects an integer. association's window size separately. The call expects an integer.
7.1.8. Automatic Close of associations (SCTP_AUTOCLOSE) 8.1.8. Automatic Close of associations (SCTP_AUTOCLOSE)
This socket option is applicable to the one-to-many style socket This socket option is applicable to the one-to-many style socket
only. When set it will cause associations that are idle for more only. When set it will cause associations that are idle for more
than the specified number of seconds to automatically close using the than the specified number of seconds to automatically close using the
graceful shutdown procedure. An association being idle is defined as graceful shutdown procedure. An association being idle is defined as
an association that has NOT sent or received user data. The special an association that has NOT sent or received user data. The special
value of '0' indicates that no automatic close of any associations value of '0' indicates that no automatic close of any associations
should be performed, this is the default value. The option expects should be performed, this is the default value. The option expects
an integer defining the number of seconds of idle time before an an integer defining the number of seconds of idle time before an
association is closed. association is closed.
An application using this option should enable receiving the An application using this option should enable receiving the
association change notification. This is the only mechanism an association change notification. This is the only mechanism an
application is informed about the closing of an association. After application is informed about the closing of an association. After
an association is closed, the association ID assigned to it can be an association is closed, the association ID assigned to it can be
reused. An application should be aware of this to avoid the possible reused. An application should be aware of this to avoid the possible
problem of sending data to an incorrect peer end point. problem of sending data to an incorrect peer end point.
7.1.9. Set Peer Primary Address (SCTP_SET_PEER_PRIMARY_ADDR) 8.1.9. Set Peer Primary Address (SCTP_SET_PEER_PRIMARY_ADDR)
Requests that the peer mark the enclosed address as the association Requests that the peer mark the enclosed address as the association
primary. The enclosed address must be one of the association's primary. The enclosed address must be one of the association's
locally bound addresses. The following structure is used to make a locally bound addresses. The following structure is used to make a
set primary request: set primary request:
struct sctp_setpeerprim { struct sctp_setpeerprim {
sctp_assoc_t sspp_assoc_id; sctp_assoc_t sspp_assoc_id;
struct sockaddr_storage sspp_addr; struct sockaddr_storage sspp_addr;
}; };
skipping to change at page 52, line 23 skipping to change at page 53, line 23
sspp_assoc_id - This is filled in by the application, and identifies sspp_assoc_id - This is filled in by the application, and identifies
the association for this request. the association for this request.
Note that this option really should be considered a write only option Note that this option really should be considered a write only option
(not a read/write option) since it can NOT be passed to a (not a read/write option) since it can NOT be passed to a
getsockopt() call and is only valid when used with setsockopt() if getsockopt() call and is only valid when used with setsockopt() if
the implementation supports this feature since this functionality is the implementation supports this feature since this functionality is
optional. Implementations that do not support this functionality optional. Implementations that do not support this functionality
should return EOPNOTSUPP. should return EOPNOTSUPP.
7.1.10. Set Primary Address (SCTP_PRIMARY_ADDR) 8.1.10. Set Primary Address (SCTP_PRIMARY_ADDR)
Requests that the local SCTP stack use the enclosed peer address as Requests that the local SCTP stack use the enclosed peer address as
the association primary. The enclosed address must be one of the the association primary. The enclosed address must be one of the
association peer's addresses. The following structure is used to association peer's addresses. The following structure is used to
make a set peer primary request: make a set peer primary request:
struct sctp_setprim { struct sctp_setprim {
sctp_assoc_t ssp_assoc_id; sctp_assoc_t ssp_assoc_id;
struct sockaddr_storage ssp_addr; struct sockaddr_storage ssp_addr;
}; };
ssp_addr - The address to set as primary ssp_addr - The address to set as primary
ssp_assoc_id - This is filled in by the application, and identifies ssp_assoc_id - This is filled in by the application, and identifies
the association for this request. the association for this request.
7.1.11. Set Adaptation Layer Indicator (SCTP_ADAPTATION_LAYER) 8.1.11. Set Adaptation Layer Indicator (SCTP_ADAPTATION_LAYER)
Requests that the local endpoint set the specified Adaptation Layer Requests that the local endpoint set the specified Adaptation Layer
Indication parameter for all future INIT and INIT-ACK exchanges. Indication parameter for all future INIT and INIT-ACK exchanges.
struct sctp_setadaptation { struct sctp_setadaptation {
uint32_t ssb_adaptation_ind; uint32_t ssb_adaptation_ind;
}; };
ssb_adaptation_ind - The adaptation layer indicator that will be ssb_adaptation_ind - The adaptation layer indicator that will be
included in any outgoing Adaptation Layer Indication parameter. included in any outgoing Adaptation Layer Indication parameter.
7.1.12. Enable/Disable message fragmentation (SCTP_DISABLE_FRAGMENTS) 8.1.12. Enable/Disable message fragmentation (SCTP_DISABLE_FRAGMENTS)
This option is a on/off flag and is passed an integer where a non- This option is a on/off flag and is passed an integer where a non-
zero is on and a zero is off. If enabled no SCTP message zero is on and a zero is off. If enabled no SCTP message
fragmentation will be performed. Instead if a message being sent fragmentation will be performed. Instead if a message being sent
exceeds the current PMTU size, the message will NOT be sent and exceeds the current PMTU size, the message will NOT be sent and
instead a error will be indicated to the user. instead a error will be indicated to the user.
7.1.13. Peer Address Parameters (SCTP_PEER_ADDR_PARAMS) 8.1.13. Peer Address Parameters (SCTP_PEER_ADDR_PARAMS)
Applications can enable or disable heartbeats for any peer address of Applications can enable or disable heartbeats for any peer address of
an association, modify an address's heartbeat interval, force a an association, modify an address's heartbeat interval, force a
heartbeat to be sent immediately, and adjust the address's maximum heartbeat to be sent immediately, and adjust the address's maximum
number of retransmissions sent before an address is considered number of retransmissions sent before an address is considered
unreachable. The following structure is used to access and modify an unreachable. The following structure is used to access and modify an
address's parameters: address's parameters:
struct sctp_paddrparams { struct sctp_paddrparams {
sctp_assoc_t spp_assoc_id; sctp_assoc_t spp_assoc_id;
skipping to change at page 55, line 35 skipping to change at page 56, line 35
field) then that specific destination addresses tos value is field) then that specific destination addresses tos value is
returned. If just an association is specified then the returned. If just an association is specified then the
association default tos is returned. If neither an association association default tos is returned. If neither an association
nor an destination is specified, then the sockets default tos nor an destination is specified, then the sockets default tos
is returned. For non IPv4 sockets, then this flag will be left is returned. For non IPv4 sockets, then this flag will be left
cleared. cleared.
To read or modify these parameters, the application should call To read or modify these parameters, the application should call
sctp_opt_info() with the SCTP_PEER_ADDR_PARAMS option. sctp_opt_info() with the SCTP_PEER_ADDR_PARAMS option.
7.1.14. Set default send parameters (SCTP_DEFAULT_SEND_PARAM) 8.1.14. Set default send parameters (SCTP_DEFAULT_SEND_PARAM)
Applications that wish to use the sendto() system call may wish to Applications that wish to use the sendto() system call may wish to
specify a default set of parameters that would normally be supplied specify a default set of parameters that would normally be supplied
through the inclusion of ancillary data. This socket option allows through the inclusion of ancillary data. This socket option allows
such an application to set the default sctp_sndrcvinfo structure. such an application to set the default sctp_sndrcvinfo structure.
The application that wishes to use this socket option simply passes The application that wishes to use this socket option simply passes
in to this call the sctp_sndrcvinfo structure defined in in to this call the sctp_sndrcvinfo structure defined in
Section 5.2.2. The input parameters accepted by this call include Section 6.2.2. The input parameters accepted by this call include
sinfo_stream, sinfo_flags, sinfo_ppid, sinfo_context, sinfo_pr_policy sinfo_stream, sinfo_flags, sinfo_ppid, sinfo_context, sinfo_pr_policy
and sinfo_pr_value. The sinfo_flags is composed of a bitwise OR of and sinfo_pr_value. The sinfo_flags is composed of a bitwise OR of
SCTP_UNORDERED, SCTP_EOF, and SCTP_SENDALL. The sinfo_assoc_id field SCTP_UNORDERED, SCTP_EOF, and SCTP_SENDALL. The sinfo_assoc_id field
specifies the association to apply the parameters to in a one-to-many specifies the association to apply the parameters to in a one-to-many
style sockets. It is ignored on the one-to-one style. Note that style sockets. It is ignored on the one-to-one style. Note that
setting the sinfo_assoc_id field to zero indicates that the users setting the sinfo_assoc_id field to zero indicates that the users
wishes to set the endpoint default send parameters for all future wishes to set the endpoint default send parameters for all future
associations. associations.
7.1.15. Set notification and ancillary events (SCTP_EVENTS) 8.1.15. Set notification and ancillary events (SCTP_EVENTS)
This socket option is used to specify various notifications and This socket option is used to specify various notifications and
ancillary data the user wishes to receive. Please see Section 7.3) ancillary data the user wishes to receive. Please see Section 8.3)
for a full description of this option and its usage. for a full description of this option and its usage.
7.1.16. Set/clear IPv4 mapped addresses (SCTP_I_WANT_MAPPED_V4_ADDR) 8.1.16. Set/clear IPv4 mapped addresses (SCTP_I_WANT_MAPPED_V4_ADDR)
This socket option is a boolean flag which turns on or off mapped V4 This socket option is a boolean flag which turns on or off mapped V4
addresses. If this option is turned on and the socket is type addresses. If this option is turned on and the socket is type
PF_INET6, then IPv4 addresses will be mapped to V6 representation. PF_INET6, then IPv4 addresses will be mapped to V6 representation.
If this option is turned off, then no mapping will be done of V4 If this option is turned off, then no mapping will be done of V4
addresses and a user will receive both PF_INET6 and PF_INET type addresses and a user will receive both PF_INET6 and PF_INET type
addresses on the socket. addresses on the socket.
By default this option is turned off and expects an integer to be By default this option is turned off and expects an integer to be
passed where non-zero turns on the option and zero turns off the passed where non-zero turns on the option and zero turns off the
option. option.
7.1.17. Get or set the maximum fragmentation size (SCTP_MAXSEG) 8.1.17. Get or set the maximum fragmentation size (SCTP_MAXSEG)
This option will get or set the maximum size to put in any outgoing This option will get or set the maximum size to put in any outgoing
SCTP DATA chunk. If a message is larger than this size it will be SCTP DATA chunk. If a message is larger than this size it will be
fragmented by SCTP into the specified size. Note that the underlying fragmented by SCTP into the specified size. Note that the underlying
SCTP implementation may fragment into smaller sized chunks when the SCTP implementation may fragment into smaller sized chunks when the
PMTU of the underlying association is smaller than the value set by PMTU of the underlying association is smaller than the value set by
the user. The default value for this option is '0' which indicates the user. The default value for this option is '0' which indicates
the user is NOT limiting fragmentation and only the PMTU will effect the user is NOT limiting fragmentation and only the PMTU will effect
SCTP's choice of DATA chunk size. Note also that values set larger SCTP's choice of DATA chunk size. Note also that values set larger
than the maximum size of an IP datagram will effectively let SCTP than the maximum size of an IP datagram will effectively let SCTP
skipping to change at page 57, line 5 skipping to change at page 58, line 5
sctp_assoc_t assoc_id; sctp_assoc_t assoc_id;
uint32_t assoc_value; uint32_t assoc_value;
}; };
assoc_id - This parameter, indicates which association the user is assoc_id - This parameter, indicates which association the user is
performing an action upon. Note that if this field's value is performing an action upon. Note that if this field's value is
zero then the endpoints default value is changed (effecting future zero then the endpoints default value is changed (effecting future
associations only). associations only).
assoc_value - This parameter specifies the maximum size in bytes. assoc_value - This parameter specifies the maximum size in bytes.
7.1.18. Add a chunk that must be authenticated (SCTP_AUTH_CHUNK) 8.1.18. Add a chunk that must be authenticated (SCTP_AUTH_CHUNK)
This set option adds a chunk type that the user is requesting to be This set option adds a chunk type that the user is requesting to be
received only in an authenticated way. Changes to the list of chunks received only in an authenticated way. Changes to the list of chunks
will only effect future associations on the socket. will only effect future associations on the socket.
struct sctp_authchunk { struct sctp_authchunk {
uint8_t sauth_chunk; uint8_t sauth_chunk;
}; };
sauth_chunks - This parameter contains a chunk type sauth_chunks - This parameter contains a chunk type
that the user is requesting to be authenticated. that the user is requesting to be authenticated.
The chunk types for INIT, INIT-ACK, SHUTDOWN-COMPLETE, and AUTH The chunk types for INIT, INIT-ACK, SHUTDOWN-COMPLETE, and AUTH
chunks MUST not be used. If they are used an error MUST be returned. chunks MUST NOT be used. If they are used an error MUST be returned.
The usage of this option enables SCTP-AUTH in cases where it is not The usage of this option enables SCTP-AUTH in cases where it is not
required by other means (for example the use of ADD-IP). required by other means (for example the use of ADD-IP).
Note that this option is write-only. Using this option in a Note that this option is write-only. Using this option in a
getsockopt() or sctp_opt_info() call will return EOPNOTSUPP. getsockopt() or sctp_opt_info() call will return EOPNOTSUPP.
7.1.19. Get or set the list of supported HMAC Identifiers 8.1.19. Get or set the list of supported HMAC Identifiers
(SCTP_HMAC_IDENT) (SCTP_HMAC_IDENT)
This option gets or sets the list of HMAC algorithms that the local This option gets or sets the list of HMAC algorithms that the local
endpoint requires the peer to use. endpoint requires the peer to use.
struct sctp_hmacalgo { struct sctp_hmacalgo {
uint32_t shmac_number_of_idents; uint32_t shmac_number_of_idents;
uint16_t shmac_idents[]; uint16_t shmac_idents[];
}; };
skipping to change at page 58, line 14 skipping to change at page 59, line 14
4) SCTP_AUTH_HMAC_ID_SHA384 (optional) 4) SCTP_AUTH_HMAC_ID_SHA384 (optional)
4) SCTP_AUTH_HMAC_ID_SHA512 (optional) 4) SCTP_AUTH_HMAC_ID_SHA512 (optional)
Note that the list supplied must include SHA1 and may include any Note that the list supplied must include SHA1 and may include any
of the other values in its preferred order (lowest list postion of the other values in its preferred order (lowest list postion
has the most preference in algorithm selection). Note also that has the most preference in algorithm selection). Note also that
the lack of SHA1, or the inclusion of an unknown HMAC identifier the lack of SHA1, or the inclusion of an unknown HMAC identifier
(including optional identifers unknown to the implementation) will (including optional identifers unknown to the implementation) will
cause the set option to fail and return an error. cause the set option to fail and return an error.
7.1.20. Set a shared key (SCTP_AUTH_KEY) 8.1.20. Set a shared key (SCTP_AUTH_KEY)
This option will set a shared secret key which is used to build an This option will set a shared secret key which is used to build an
association shared key. association shared key.
struct sctp_authkey { struct sctp_authkey {
sctp_assoc_t sca_assoc_id; sctp_assoc_t sca_assoc_id;
uint16_t sca_keynumber; uint16_t sca_keynumber;
uint16_t sca_keylength; uint16_t sca_keylength;
uint8_t sca_key[]; uint8_t sca_key[];
}; };
skipping to change at page 58, line 47 skipping to change at page 59, line 47
existing key. Note that shared key identifier '0' defaults to a existing key. Note that shared key identifier '0' defaults to a
null key. null key.
sca_keylength - this parameter is the length of the array sca_key. sca_keylength - this parameter is the length of the array sca_key.
sca_key - This parameter contains an array of bytes that is to be sca_key - This parameter contains an array of bytes that is to be
used by the endpoint (or association) as the shared secret key. used by the endpoint (or association) as the shared secret key.
Note, if the length of this field is zero, a null key is set. Note, if the length of this field is zero, a null key is set.
Note that this option is write-only. Using this option in a Note that this option is write-only. Using this option in a
getsockopt() or sctp_opt_info() call will return EOPNOTSUPP. getsockopt() or sctp_opt_info() call will return EOPNOTSUPP.
7.1.21. Get or set the active shared key (SCTP_AUTH_ACTIVE_KEY) 8.1.21. Get or set the active shared key (SCTP_AUTH_ACTIVE_KEY)
This option will get or set the active shared key to be used to build This option will get or set the active shared key to be used to build
the association shared key. the association shared key.
struct sctp_authkeyid { struct sctp_authkeyid {
sctp_assoc_t scact_assoc_id; sctp_assoc_t scact_assoc_id;
uint16_t scact_keynumber; uint16_t scact_keynumber;
}; };
scact_assoc_id - This parameter, if non-zero, indicates what scact_assoc_id - This parameter, if non-zero, indicates what
skipping to change at page 59, line 24 skipping to change at page 60, line 24
will use the specified shared key identifier. For one-to-one will use the specified shared key identifier. For one-to-one
sockets, this parameter is ignored. Note, however, that this sockets, this parameter is ignored. Note, however, that this
option will set the active key on the association if the socket is option will set the active key on the association if the socket is
connected, otherwise this will set the default active key for the connected, otherwise this will set the default active key for the
endpoint. endpoint.
scact_keynumber - this parameter is the shared key identifier which scact_keynumber - this parameter is the shared key identifier which
the application is requesting to become the active shared key to the application is requesting to become the active shared key to
be used for sending authenticated chunks. The key identifier MUST be used for sending authenticated chunks. The key identifier MUST
correspond to an existing shared key. Note that shared key correspond to an existing shared key. Note that shared key
identifier '0' defaults to a null key. identifier '0' defaults to a null key.
When used with setsockopt() the SCTP implementation MUST use the
indicated shared key identifier for all messages being sent after
the setsockopt() call until changed again. Therefore the SCTP
implementation MUST NOT bundle user messages which should be
authenticated using different shared key identifiers.
7.1.22. Delete a shared key (SCTP_AUTH_DELETE_KEY) 8.1.22. Delete a shared key (SCTP_AUTH_DELETE_KEY)
This set option will delete a shared secret key from use. This set option will delete a shared secret key in the SCTP
implementation.
struct sctp_authkeyid { struct sctp_authkeyid {
sctp_assoc_t scact_assoc_id; sctp_assoc_t scact_assoc_id;
uint16_t scact_keynumber; uint16_t scact_keynumber;
}; };
scact_assoc_id - This parameter, if non-zero, indicates what scact_assoc_id - This parameter, if non-zero, indicates what
association that the shared key identifier is being deleted from. association that the shared key identifier is being deleted from.
Note that if this element contains zero, then the shared key is Note that if this element contains zero, then the shared key is
deleted from the endpoint and all associations will no longer use deleted from the endpoint and all associations will no longer use
skipping to change at page 59, line 43 skipping to change at page 61, line 4
scact_assoc_id - This parameter, if non-zero, indicates what scact_assoc_id - This parameter, if non-zero, indicates what
association that the shared key identifier is being deleted from. association that the shared key identifier is being deleted from.
Note that if this element contains zero, then the shared key is Note that if this element contains zero, then the shared key is
deleted from the endpoint and all associations will no longer use deleted from the endpoint and all associations will no longer use
the specified shared key identifier (unless otherwise set on the the specified shared key identifier (unless otherwise set on the
association using SCTP_AUTH_KEY). For one-to-one sockets, this association using SCTP_AUTH_KEY). For one-to-one sockets, this
parameter is ignored. Note, however, that this option will delete parameter is ignored. Note, however, that this option will delete
the key from the association if the socket is connected, otherwise the key from the association if the socket is connected, otherwise
this will delete the key from the endpoint. this will delete the key from the endpoint.
scact_keynumber - this parameter is the shared key identifier which scact_keynumber - this parameter is the shared key identifier which
the application is requesting to be deleted. The key identifier the application is requesting to be deleted. The key identifier
MUST correspond to an existing shared key and MUST NOT be the MUST correspond to an existing shared key and MUST NOT be in use
current active key. Note if this parameter is zero, use of the for any packet being sent by the SCTP implementation. This means
null key identifier '0' is disabled on the endpoint and/or in particular, that it MUST be deactivated first. Note if this
association. parameter is zero, use of the null key identifier '0' is deleted
from the endpoint and/or association.
Note that this option is write-only. Using this option in a Note that this option is write-only. Using this option in a
getsockopt() or sctp_opt_info() call will return EOPNOTSUPP. getsockopt() or sctp_opt_info() call will return EOPNOTSUPP.
7.1.23. Get or set delayed ack timer (SCTP_DELAYED_SACK) 8.1.23. Delete a shared key (SCTP_AUTH_DEACTIVATE_KEY)
This set option indicates that the application will not send user
messages anymore requiring the usage of the indicated key identifier.
struct sctp_authkeyid {
sctp_assoc_t scact_assoc_id;
uint16_t scact_keynumber;
};
scact_assoc_id - This parameter, if non-zero, indicates what
association that the shared key identifier is being deactivated.
Note that if this element contains zero, then the shared key is
deactivated for the endpoint and all associations will no longer
use the specified shared key identifier (unless otherwise set on
the association using SCTP_AUTH_KEY). For one-to-one sockets,
this parameter is ignored. Note, however, that this option will
deactivate the key from the association if the socket is
connected, otherwise this will deactivate the key from the
endpoint.
scact_keynumber - this parameter is the shared key identifier which
the application is requesting to be deactivated. The key
identifier MUST correspond to an existing shared key. Note if
this parameter is zero, use of the null key identifier '0' is
deactivated on the endpoint and/or association.
Note that this option is write-only. Using this option in a
getsockopt() or sctp_opt_info() call will return EOPNOTSUPP.
8.1.24. Get or set delayed ack timer (SCTP_DELAYED_SACK)
This option will effect the way delayed acks are performed. This This option will effect the way delayed acks are performed. This
option allows you to get or set the delayed ack time, in option allows you to get or set the delayed ack time, in
milliseconds. It also allows changing the delayed ack frequency. milliseconds. It also allows changing the delayed ack frequency.
Changing the frequency to 1 disables the delayed sack algorithm. If Changing the frequency to 1 disables the delayed sack algorithm. If
the assoc_id is 0, then this sets or gets the endpoints default the assoc_id is 0, then this sets or gets the endpoints default
values. If the assoc_id field is non-zero, then the set or get values. If the assoc_id field is non-zero, then the set or get
effects the specified association for the one to many model (the effects the specified association for the one to many model (the
assoc_id field is ignored by the one to one model). Note that if assoc_id field is ignored by the one to one model). Note that if
sack_delay or sack_freq are 0 when setting this option, then the sack_delay or sack_freq are 0 when setting this option, then the
skipping to change at page 60, line 40 skipping to change at page 62, line 28
associations only). associations only).
sack_delay - This parameter contains the number of milliseconds that sack_delay - This parameter contains the number of milliseconds that
the user is requesting the delayed ACK timer be set to. Note that the user is requesting the delayed ACK timer be set to. Note that
this value is defined in the standard to be between 200 and 500 this value is defined in the standard to be between 200 and 500
milliseconds. milliseconds.
sack_freq - This parameter contains the number of packets that must sack_freq - This parameter contains the number of packets that must
be received before a sack is sent without waiting for the delay be received before a sack is sent without waiting for the delay
timer to expire. The default value for this is 2, setting this timer to expire. The default value for this is 2, setting this
value to 1 will disable the delayed sack algorithm. value to 1 will disable the delayed sack algorithm.
7.1.24. Get or set fragmented interleave (SCTP_FRAGMENT_INTERLEAVE) 8.1.25. Get or set fragmented interleave (SCTP_FRAGMENT_INTERLEAVE)
Fragmented interleave controls how the presentation of messages Fragmented interleave controls how the presentation of messages
occurs for the message receiver. There are three levels of fragment occurs for the message receiver. There are three levels of fragment
interleave defined. Two of the levels effect the one-to-one model, interleave defined. Two of the levels effect the one-to-one model,
while the one-to-many model is effected by all three levels. while the one-to-many model is effected by all three levels.
This option takes an integer value. It can be set to a value of 0, 1 This option takes an integer value. It can be set to a value of 0, 1
or 2. Attempting to set this level to other values will return an or 2. Attempting to set this level to other values will return an
error. error.
skipping to change at page 61, line 46 skipping to change at page 63, line 37
receive, some other associations message may be delivered upon the receive, some other associations message may be delivered upon the
next receive. next receive.
An implementation should default the one-to-many model to level 1. An implementation should default the one-to-many model to level 1.
The reason for this is that otherwise it is possible that a peer The reason for this is that otherwise it is possible that a peer
could begin sending a partial message and thus block all other peers could begin sending a partial message and thus block all other peers
from sending data. However a setting of level 2 requires the from sending data. However a setting of level 2 requires the
application to not only be aware of the association (via the application to not only be aware of the association (via the
association id or peers address) but also the stream number. The association id or peers address) but also the stream number. The
stream number is NOT present unless the user has subscribed to the stream number is NOT present unless the user has subscribed to the
sctp_data_io_events (see Section 7.3). This is also why we recommend sctp_data_io_events (see Section 8.3). This is also why we recommend
that the one-to-one model be defaulted to level 0 (level 1 for the that the one-to-one model be defaulted to level 0 (level 1 for the
one-to-one model has no effect). Note that an implementation should one-to-one model has no effect). Note that an implementation should
return an error if a application attempts to set the level to 2 and return an error if a application attempts to set the level to 2 and
has NOT subscribed to the sctp_data_io_events. has NOT subscribed to the sctp_data_io_events.
7.1.25. Set or Get the sctp partial delivery point 8.1.26. Set or Get the sctp partial delivery point
(SCTP_PARTIAL_DELIVERY_POINT) (SCTP_PARTIAL_DELIVERY_POINT)
This option will set or get the SCTP partial delivery point. This This option will set or get the SCTP partial delivery point. This
point is the size of a message where the partial delivery API will be point is the size of a message where the partial delivery API will be
invoked to help free up rwnd space for the peer. Setting this to a invoked to help free up rwnd space for the peer. Setting this to a
lower value will cause partial deliveries to happen more often. The lower value will cause partial deliveries to happen more often. The
calls argument is an integer that sets or gets the partial delivery calls argument is an integer that sets or gets the partial delivery
point. Note also that the call will fail if the user attempts to set point. Note also that the call will fail if the user attempts to set
this value larger than the socket receive buffer size. this value larger than the socket receive buffer size.
Note that any single message having a length smaller than or equal to Note that any single message having a length smaller than or equal to
the SCTP partial delivery point will be delivered in one single read the SCTP partial delivery point will be delivered in one single read
call as long as the user provided buffer is large enough to hold the call as long as the user provided buffer is large enough to hold the
message. message.
7.1.26. Set or Get the use of extended receive info 8.1.27. Set or Get the use of extended receive info
(SCTP_USE_EXT_RCVINFO) (SCTP_USE_EXT_RCVINFO)
This option will enable or disable the use of the extended version of This option will enable or disable the use of the extended version of
the sctp_sndrcvinfo structure. If this option is disabled, then the the sctp_sndrcvinfo structure. If this option is disabled, then the
normal sctp_sndrcvinfo structure is returned in all receive message normal sctp_sndrcvinfo structure is returned in all receive message
calls. If this option is enabled then the sctp_extrcvinfo structure calls. If this option is enabled then the sctp_extrcvinfo structure
is returned in all receive message calls. is returned in all receive message calls.
Note that the sctp_extrcvinfo structure is never used in any send Note that the sctp_extrcvinfo structure is never used in any send
call. call.
7.1.27. Set or Get the auto asconf flag (SCTP_AUTO_ASCONF) 8.1.28. Set or Get the auto asconf flag (SCTP_AUTO_ASCONF)
This option will enable or disable the use of the automatic This option will enable or disable the use of the automatic
generation of ASCONF chunks to add and delete addresses to an generation of ASCONF chunks to add and delete addresses to an
existing association. Note that this option has two caveats namely: existing association. Note that this option has two caveats namely:
a) it only effects sockets that are bound to all addresses on the a) it only effects sockets that are bound to all addresses on the
machine, and b) the system administrator may have an overriding machine, and b) the system administrator may have an overriding
control that turns the asconf feature off no matter what setting the control that turns the asconf feature off no matter what setting the
socket option may have. socket option may have.
7.1.28. Set or Get the maximum burst (SCTP_MAX_BURST) 8.1.29. Set or Get the maximum burst (SCTP_MAX_BURST)
This option will allow a user to change the maximum burst of packets This option will allow a user to change the maximum burst of packets
that can be emitted by this association. Note that the default value that can be emitted by this association. Note that the default value
is 4, and some implementations may restrict this setting so that it is 4, and some implementations may restrict this setting so that it
can only be lowered. can only be lowered.
To set or get this option the user fills in the following structure: To set or get this option the user fills in the following structure:
struct sctp_assoc_value { struct sctp_assoc_value {
sctp_assoc_t assoc_id; sctp_assoc_t assoc_id;
skipping to change at page 63, line 14 skipping to change at page 65, line 4
struct sctp_assoc_value { struct sctp_assoc_value {
sctp_assoc_t assoc_id; sctp_assoc_t assoc_id;
uint32_t assoc_value; uint32_t assoc_value;
}; };
assoc_id - This parameter, indicates which association the user is assoc_id - This parameter, indicates which association the user is
performing an action upon. Note that if this field's value is performing an action upon. Note that if this field's value is
zero then the endpoints default value is changed (effecting future zero then the endpoints default value is changed (effecting future
associations only). associations only).
assoc_value - This parameter contains the maximum burst. assoc_value - This parameter contains the maximum burst.
7.1.29. Set or Get the default context (SCTP_CONTEXT) 8.1.30. Set or Get the default context (SCTP_CONTEXT)
The context field in the sctp_sndrcvinfo structure is normally only The context field in the sctp_sndrcvinfo structure is normally only
used when a failed message is retrieved holding the value that was used when a failed message is retrieved holding the value that was
sent down on the actual send call. This option allows the setting of sent down on the actual send call. This option allows the setting of
a default context on an association basis that will be received on a default context on an association basis that will be received on
reading messages from the peer. This is especially helpful in the reading messages from the peer. This is especially helpful in the
one-2-many model for an application to keep some reference to an one-2-many model for an application to keep some reference to an
internal state machine that is processing messages on the internal state machine that is processing messages on the
association. Note that the setting of this value only effects association. Note that the setting of this value only effects
received messages from the peer and does not effect the value that is received messages from the peer and does not effect the value that is
skipping to change at page 63, line 42 skipping to change at page 65, line 33
sctp_assoc_t assoc_id; sctp_assoc_t assoc_id;
uint32_t assoc_value; uint32_t assoc_value;
}; };
assoc_id - This parameter, indicates which association the user is assoc_id - This parameter, indicates which association the user is
performing an action upon. Note that if this field's value is performing an action upon. Note that if this field's value is
zero then the endpoints default value is changed (effecting future zero then the endpoints default value is changed (effecting future
associations only). associations only).
assoc_value - This parameter contains the context. assoc_value - This parameter contains the context.
7.1.30. Enable or disable explicit EOR marking (SCTP_EXPLICIT_EOR) 8.1.31. Enable or disable explicit EOR marking (SCTP_EXPLICIT_EOR)
This boolean flag is used to enable or disable explict end of record This boolean flag is used to enable or disable explict end of record
(EOR) marking. When this option is enabled, a user may make multiple (EOR) marking. When this option is enabled, a user may make multiple
send system calls to send a record and must indicate that they are send system calls to send a record and must indicate that they are
finished sending a particular record by including on the send the finished sending a particular record by including on the send the
SCTP_EOR flag. If this boolean flag is disabled then each individual SCTP_EOR flag. If this boolean flag is disabled then each individual
send system call is considered to have a SCTP_EOR indicator set on it send system call is considered to have a SCTP_EOR indicator set on it
implicitly without the user having to explicitly add this flag. implicitly without the user having to explicitly add this flag.
7.1.31. Enable SCTP port reusage (SCTP_REUSE_PORT) 8.1.32. Enable SCTP port reusage (SCTP_REUSE_PORT)
This option only supports one-to-one style SCTP sockets. If used on This option only supports one-to-one style SCTP sockets. If used on
a one-to-many style SCTP socket an error is indicated. a one-to-many style SCTP socket an error is indicated.
The setsockopt() call MUST NOT be used after calling bind() or The setsockopt() call MUST NOT be used after calling bind() or
sctp_bindx() for an one-to-one style SCTP socket. If using bind() or sctp_bindx() for an one-to-one style SCTP socket. If using bind() or
sctp_bindx() on a socket with the SCTP_REUSE_PORT option, all other sctp_bindx() on a socket with the SCTP_REUSE_PORT option, all other
SCTP sockets bound to the same port MUST have set the SCTP sockets bound to the same port MUST have set the
SCTP_REUSE_PORT. Calling bind() or sctp_bindx() for a socket without SCTP_REUSE_PORT. Calling bind() or sctp_bindx() for a socket without
having set the SCTP_REUSE_PORT option will fail if there are other having set the SCTP_REUSE_PORT option will fail if there are other
sockets bound to the same port. At most one socket being bound to sockets bound to the same port. At most one socket being bound to
the same port may be listening. the same port may be listening.
It should be noted that the behaviour of the socket level socket It should be noted that the behaviour of the socket level socket
option to reuse ports and/or addresses for SCTP sockets in option to reuse ports and/or addresses for SCTP sockets in
unspecified. unspecified.
7.2. Read-Only Options 8.2. Read-Only Options
7.2.1. Association Status (SCTP_STATUS) 8.2.1. Association Status (SCTP_STATUS)
Applications can retrieve current status information about an Applications can retrieve current status information about an
association, including association state, peer receiver window size, association, including association state, peer receiver window size,
number of unacked data chunks, and number of data chunks pending number of unacked data chunks, and number of data chunks pending
receipt. This information is read-only. The following structure is receipt. This information is read-only. The following structure is
used to access this information: used to access this information:
struct sctp_status { struct sctp_status {
sctp_assoc_t sstat_assoc_id; sctp_assoc_t sstat_assoc_id;
int32_t sstat_state; int32_t sstat_state;
skipping to change at page 65, line 36 skipping to change at page 67, line 26
inbound. inbound.
sstat_outstrms - The number of streams that the endpoint is allowed sstat_outstrms - The number of streams that the endpoint is allowed
to use outbound. to use outbound.
sstat_fragmentation_point - The size at which SCTP fragmentation sstat_fragmentation_point - The size at which SCTP fragmentation
will occur. will occur.
To access these status values, the application calls getsockopt() To access these status values, the application calls getsockopt()
with the option name SCTP_STATUS. The sstat_assoc_id parameter is with the option name SCTP_STATUS. The sstat_assoc_id parameter is
ignored for one-to-one style socket. ignored for one-to-one style socket.
7.2.2. Peer Address Information (SCTP_GET_PEER_ADDR_INFO) 8.2.2. Peer Address Information (SCTP_GET_PEER_ADDR_INFO)
Applications can retrieve information about a specific peer address Applications can retrieve information about a specific peer address
of an association, including its reachability state, congestion of an association, including its reachability state, congestion
window, and retransmission timer values. This information is read- window, and retransmission timer values. This information is read-
only. The following structure is used to access this information: only. The following structure is used to access this information:
struct sctp_paddrinfo { struct sctp_paddrinfo {
sctp_assoc_t spinfo_assoc_id; sctp_assoc_t spinfo_assoc_id;
struct sockaddr_storage spinfo_address; struct sockaddr_storage spinfo_address;
int32_t spinfo_state; int32_t spinfo_state;
skipping to change at page 66, line 34 skipping to change at page 68, line 28
address does not belong to the association specified then this address does not belong to the association specified then this
call will fail. If the application does NOT fill in the call will fail. If the application does NOT fill in the
spinfo_assoc_id, then the address will be used to lookup the spinfo_assoc_id, then the address will be used to lookup the
association and on return this field will have the valid association and on return this field will have the valid
association id. In other words, this call can be used to association id. In other words, this call can be used to
translate a address into an association id. translate a address into an association id.
To retrieve this information, use sctp_opt_info() with the To retrieve this information, use sctp_opt_info() with the
SCTP_GET_PEER_ADDR_INFO options. SCTP_GET_PEER_ADDR_INFO options.
7.2.3. Get the list of chunks the peer requires to be authenticated 8.2.3. Get the list of chunks the peer requires to be authenticated
(SCTP_PEER_AUTH_CHUNKS) (SCTP_PEER_AUTH_CHUNKS)
This option gets a list of chunks for a specified association that This option gets a list of chunks for a specified association that
the peer requires to be received authenticated only. the peer requires to be received authenticated only.
struct sctp_authchunks { struct sctp_authchunks {
sctp_assoc_t gauth_assoc_id; sctp_assoc_t gauth_assoc_id;
guint32_t gauth_number_of_chunks guint32_t gauth_number_of_chunks
uint8_t gauth_chunks[]; uint8_t gauth_chunks[];
}; };
skipping to change at page 67, line 4 skipping to change at page 68, line 39
(SCTP_PEER_AUTH_CHUNKS) (SCTP_PEER_AUTH_CHUNKS)
This option gets a list of chunks for a specified association that This option gets a list of chunks for a specified association that
the peer requires to be received authenticated only. the peer requires to be received authenticated only.
struct sctp_authchunks { struct sctp_authchunks {
sctp_assoc_t gauth_assoc_id; sctp_assoc_t gauth_assoc_id;
guint32_t gauth_number_of_chunks guint32_t gauth_number_of_chunks
uint8_t gauth_chunks[]; uint8_t gauth_chunks[];
}; };
gauth_assoc_id - This parameter, indicates which association the gauth_assoc_id - This parameter, indicates which association the
user is requesting the list of peer authenticated chunks. For user is requesting the list of peer authenticated chunks. For
one-to-one sockets, this parameter is ignored. one-to-one sockets, this parameter is ignored.
gauth_number_of_chunks - This parameter gives the number of elements gauth_number_of_chunks - This parameter gives the number of elements
in the array gauth_chunks. in the array gauth_chunks.
gauth_chunks - This parameter contains an array of chunks that the gauth_chunks - This parameter contains an array of chunks that the
peer is requesting to be authenticated. peer is requesting to be authenticated.
7.2.4. Get the list of chunks the local endpoint requires to be 8.2.4. Get the list of chunks the local endpoint requires to be
authenticated (SCTP_LOCAL_AUTH_CHUNKS) authenticated (SCTP_LOCAL_AUTH_CHUNKS)
This option gets a list of chunks for a specified association that This option gets a list of chunks for a specified association that
the local endpoint requires to be received authenticated only. the local endpoint requires to be received authenticated only.
struct sctp_authchunks { struct sctp_authchunks {
sctp_assoc_t gauth_assoc_id; sctp_assoc_t gauth_assoc_id;
uint32_t gauth_number_of_chunks; uint32_t gauth_number_of_chunks;
uint8_t gauth_chunks[]; uint8_t gauth_chunks[];
}; };
gauth_assoc_id - This parameter, indicates which association the gauth_assoc_id - This parameter, indicates which association the
user is requesting the list of local authenticated chunks. For user is requesting the list of local authenticated chunks. For
one-to-one sockets, this parameter is ignored. one-to-one sockets, this parameter is ignored.
gauth_number_of_chunks - This parameter gives the number of elements gauth_number_of_chunks - This parameter gives the number of elements
in the array gauth_chunks. in the array gauth_chunks.
gauth_chunks - This parameter contains an array of chunks that the gauth_chunks - This parameter contains an array of chunks that the
local endpoint is requesting to be authenticated. local endpoint is requesting to be authenticated.
7.2.5. Get the current number of associations (SCTP_GET_ASSOC_NUMBER) 8.2.5. Get the current number of associations (SCTP_GET_ASSOC_NUMBER)
This option gets the current number of associations that are attached This option gets the current number of associations that are attached
to a one-to-many style socket. The option value is an uint32_t. to a one-to-many style socket. The option value is an uint32_t.
7.2.6. Get the current identifiers of associations 8.2.6. Get the current identifiers of associations
(SCTP_GET_ASSOC_ID_LIST) (SCTP_GET_ASSOC_ID_LIST)
This option gets the current list of SCTP association identifiers of This option gets the current list of SCTP association identifiers of
the SCTP associations handled by a one-to-many style socket. The the SCTP associations handled by a one-to-many style socket. The
option value has the structure option value has the structure
struct sctp_assoc_ids { struct sctp_assoc_ids {
uint32_t gaids_number_of_ids; uint32_t gaids_number_of_ids;
sctp_assoc_t gaids_assoc_id[]; sctp_assoc_t gaids_assoc_id[];
}; };
skipping to change at page 68, line 4 skipping to change at page 69, line 41
(SCTP_GET_ASSOC_ID_LIST) (SCTP_GET_ASSOC_ID_LIST)
This option gets the current list of SCTP association identifiers of This option gets the current list of SCTP association identifiers of
the SCTP associations handled by a one-to-many style socket. The the SCTP associations handled by a one-to-many style socket. The
option value has the structure option value has the structure
struct sctp_assoc_ids { struct sctp_assoc_ids {
uint32_t gaids_number_of_ids; uint32_t gaids_number_of_ids;
sctp_assoc_t gaids_assoc_id[]; sctp_assoc_t gaids_assoc_id[];
}; };
The caller MUST provide a large enough buffer to hold all association The caller MUST provide a large enough buffer to hold all association
identifiers. If the buffer is too small, an error MUST be returned. identifiers. If the buffer is too small, an error MUST be returned.
The user can use the SCTP_GET_ASSOC_NUMBER socket option to get an The user can use the SCTP_GET_ASSOC_NUMBER socket option to get an
idea how large the buffer has to be. gaids_number_of_ids gives the idea how large the buffer has to be. gaids_number_of_ids gives the
number of elements in the array gaids_assoc_id. number of elements in the array gaids_assoc_id.
7.3. Ancillary Data and Notification Interest Options 8.3. Ancillary Data and Notification Interest Options
Applications can receive per-message ancillary information and Applications can receive per-message ancillary information and
notifications of certain SCTP events with recvmsg(). notifications of certain SCTP events with recvmsg().
The following optional information is available to the application: The following optional information is available to the application:
1. SCTP_SNDRCV (sctp_data_io_event): Per-message information (i.e. 1. SCTP_SNDRCV (sctp_data_io_event): Per-message information (i.e.
stream number, TSN, SSN, etc. described in Section 5.2.2) stream number, TSN, SSN, etc. described in Section 6.2.2)
2. SCTP_ASSOC_CHANGE (sctp_association_event): (described in 2. SCTP_ASSOC_CHANGE (sctp_association_event): (described in
Section 5.3.1.1) Section 6.3.1.1)
3. SCTP_PEER_ADDR_CHANGE (sctp_address_event): (described in 3. SCTP_PEER_ADDR_CHANGE (sctp_address_event): (described in
Section 5.3.1.2) Section 6.3.1.2)
4. SCTP_SEND_FAILED (sctp_send_failure_event): (described in 4. SCTP_SEND_FAILED (sctp_send_failure_event): (described in
Section 5.3.1.4) Section 6.3.1.4)
5. SCTP_REMOTE_ERROR (sctp_peer_error_event): (described in 5. SCTP_REMOTE_ERROR (sctp_peer_error_event): (described in
Section 5.3.1.3) Section 6.3.1.3)
6. SCTP_SHUTDOWN_EVENT (sctp_shtudown_event): (described in 6. SCTP_SHUTDOWN_EVENT (sctp_shtudown_event): (described in
Section 5.3.1.5) Section 6.3.1.5)
7. SCTP_PARTIAL_DELIVERY_EVENT (sctp_partial_delivery_event): 7. SCTP_PARTIAL_DELIVERY_EVENT (sctp_partial_delivery_event):
(described in Section 5.3.1.7) (described in Section 6.3.1.7)
8. SCTP_ADAPTATION_INDICATION (sctp_adaptation_layer_event): 8. SCTP_ADAPTATION_INDICATION (sctp_adaptation_layer_event):
(described in Section 5.3.1.6) (described in Section 6.3.1.6)
9. SCTP_AUTHENTICATION_INDICATION (sctp_authentication_event): 9. SCTP_AUTHENTICATION_INDICATION (sctp_authentication_event):
(described in Section 5.3.1.8) (described in Section 6.3.1.8)
To receive any ancillary data or notifications, first the application To receive any ancillary data or notifications, first the application
registers it's interest by calling the SCTP_EVENTS setsockopt() with registers it's interest by calling the SCTP_EVENTS setsockopt() with
the following structure. the following structure.
struct sctp_event_subscribe{ struct sctp_event_subscribe{
uint8_t sctp_data_io_event; uint8_t sctp_data_io_event;
uint8_t sctp_association_event; uint8_t sctp_association_event;
uint8_t sctp_address_event; uint8_t sctp_address_event;
uint8_t sctp_send_failure_event; uint8_t sctp_send_failure_event;
skipping to change at page 69, line 4 skipping to change at page 70, line 46
uint8_t sctp_data_io_event; uint8_t sctp_data_io_event;
uint8_t sctp_association_event; uint8_t sctp_association_event;
uint8_t sctp_address_event; uint8_t sctp_address_event;
uint8_t sctp_send_failure_event; uint8_t sctp_send_failure_event;
uint8_t sctp_peer_error_event; uint8_t sctp_peer_error_event;
uint8_t sctp_shutdown_event; uint8_t sctp_shutdown_event;
uint8_t sctp_partial_delivery_event; uint8_t sctp_partial_delivery_event;
uint8_t sctp_adaptation_layer_event; uint8_t sctp_adaptation_layer_event;
uint8_t sctp_authentication_event; uint8_t sctp_authentication_event;
}; };
sctp_data_io_event - Setting this flag to 1 will cause the reception sctp_data_io_event - Setting this flag to 1 will cause the reception
of SCTP_SNDRCV information on a per message basis. The application of SCTP_SNDRCV information on a per message basis. The application
will need to use the recvmsg() interface so that it can receive the will need to use the recvmsg() interface so that it can receive the
event information contained in the msg_control field. Please see event information contained in the msg_control field. Please see
Section 5.2 for further details. Setting the flag to 0 will disable Section 6.2 for further details. Setting the flag to 0 will disable
reception of the message control information. reception of the message control information.
sctp_association_event - Setting this flag to 1 will enable the sctp_association_event - Setting this flag to 1 will enable the
reception of association event notifications. Setting the flag to 0 reception of association event notifications. Setting the flag to 0
will disable association event notifications. For more information will disable association event notifications. For more information
on event notifications please see Section 5.3. on event notifications please see Section 6.3.
sctp_address_event - Setting this flag to 1 will enable the reception sctp_address_event - Setting this flag to 1 will enable the reception
of address event notifications. Setting the flag to 0 will disable of address event notifications. Setting the flag to 0 will disable
address event notifications. For more information on event address event notifications. For more information on event
notifications please see Section 5.3. notifications please see Section 6.3.
sctp_send_failure_event - Setting this flag to 1 will enable the sctp_send_failure_event - Setting this flag to 1 will enable the
reception of send failure event notifications. Setting the flag to 0 reception of send failure event notifications. Setting the flag to 0
will disable send failure event notifications. For more information will disable send failure event notifications. For more information
on event notifications please see Section 5.3. on event notifications please see Section 6.3.
sctp_peer_error_event - Setting this flag to 1 will enable the sctp_peer_error_event - Setting this flag to 1 will enable the
reception of peer error event notifications. Setting the flag to 0 reception of peer error event notifications. Setting the flag to 0
will disable peer error event notifications. For more information on will disable peer error event notifications. For more information on
event notifications please see Section 5.3. event notifications please see Section 6.3.
sctp_shutdown_event - Setting this flag to 1 will enable the sctp_shutdown_event - Setting this flag to 1 will enable the
reception of shutdown event notifications. Setting the flag to 0 reception of shutdown event notifications. Setting the flag to 0
will disable shutdown event notifications. For more information on will disable shutdown event notifications. For more information on
event notifications please see Section 5.3. event notifications please see Section 6.3.
sctp_partial_delivery_event - Setting this flag to 1 will enable the sctp_partial_delivery_event - Setting this flag to 1 will enable the
reception of partial delivery notifications. Setting the flag to 0 reception of partial delivery notifications. Setting the flag to 0
will disable partial delivery event notifications. For more will disable partial delivery event notifications. For more
information on event notifications please see Section 5.3. information on event notifications please see Section 6.3.
sctp_adaptation_layer_event - Setting this flag to 1 will enable the sctp_adaptation_layer_event - Setting this flag to 1 will enable the
reception of adaptation layer notifications. Setting the flag to 0 reception of adaptation layer notifications. Setting the flag to 0
will disable adaptation layer event notifications. For more will disable adaptation layer event notifications. For more
information on event notifications please see Section 5.3. information on event notifications please see Section 6.3.
sctp_authentication_event - Setting this flag to 1 will enable the sctp_authentication_event - Setting this flag to 1 will enable the
reception of authentication layer notifications. Setting the flag to reception of authentication layer notifications. Setting the flag to
0 will disable authentication layer event notifications. For More 0 will disable authentication layer event notifications. For More
information please see Section 5.3. information please see Section 6.3.
An example where an application would like to receive data io events An example where an application would like to receive data io events
and association events but no others would be as follows: and association events but no others would be as follows:
{ {
struct sctp_event_subscribe event; struct sctp_event_subscribe event;
memset(&event,0,sizeof(event)); memset(&event,0,sizeof(event));
event.sctp_data_io_event = 1; event.sctp_data_io_event = 1;
skipping to change at page 70, line 26 skipping to change at page 72, line 25
Note that for one-to-many style SCTP sockets, the caller of recvmsg() Note that for one-to-many style SCTP sockets, the caller of recvmsg()
receives ancillary data and notifications for ALL associations bound receives ancillary data and notifications for ALL associations bound
to the file descriptor. For one-to-one style SCTP sockets, the to the file descriptor. For one-to-one style SCTP sockets, the
caller receives ancillary data and notifications for only the single caller receives ancillary data and notifications for only the single
association bound to the file descriptor. association bound to the file descriptor.
By default both the one-to-one style and one-to-many style socket has By default both the one-to-one style and one-to-many style socket has
all options off. all options off.
8. New Interfaces 9. New Interfaces
Depending on the system, the following interface can be implemented Depending on the system, the following interface can be implemented
as a system call or library function. as a system call or library function.
8.1. sctp_bindx() 9.1. sctp_bindx()
The syntax of sctp_bindx() is, The syntax of sctp_bindx() is,
int sctp_bindx(int sd, struct sockaddr *addrs, int addrcnt, int sctp_bindx(int sd, struct sockaddr *addrs, int addrcnt,
int flags); int flags);
If sd is an IPv4 socket, the addresses passed must be IPv4 addresses. If sd is an IPv4 socket, the addresses passed must be IPv4 addresses.
If the sd is an IPv6 socket, the addresses passed can either be IPv4 If the sd is an IPv6 socket, the addresses passed can either be IPv4
or IPv6 addresses. or IPv6 addresses.
A single address may be specified as INADDR_ANY or IN6ADDR_ANY, see A single address may be specified as INADDR_ANY or IN6ADDR_ANY, see
Section 3.1.2 for this usage. Section 4.1.2 for this usage.
addrs is a pointer to an array of one or more socket addresses. Each addrs is a pointer to an array of one or more socket addresses. Each
address is contained in its appropriate structure. For an IPv6 address is contained in its appropriate structure. For an IPv6
socket, an array of sockaddr_in6 would be returned. For a IPv4 socket, an array of sockaddr_in6 would be returned. For a IPv4
socket, an array of sockaddr_in would be returned. The caller socket, an array of sockaddr_in would be returned. The caller
specifies the number of addresses in the array with addrcnt. Note specifies the number of addresses in the array with addrcnt. Note
that the wildcard addresses cannot be used in combination with non that the wildcard addresses cannot be used in combination with non
wildcard addresses on a socket with this function, doing so will wildcard addresses on a socket with this function, doing so will
result in an error. result in an error.
skipping to change at page 72, line 7 skipping to change at page 74, line 5
have the same value as the first one. For an already bound socket, have the same value as the first one. For an already bound socket,
all port numbers provided MUST be the bound one or 0. all port numbers provided MUST be the bound one or 0.
bindx() is an atomic operation. Therefore the binding will be either bindx() is an atomic operation. Therefore the binding will be either
successful on all addresses or fail on all addresses. If multiple successful on all addresses or fail on all addresses. If multiple
addresses are provided and the bindx() call fails there is no addresses are provided and the bindx() call fails there is no
indication which address is responsable for the failure. The only indication which address is responsable for the failure. The only
way to get an specific error indication is to call bindx() with only way to get an specific error indication is to call bindx() with only
one address sequentially. one address sequentially.
8.2. Branched-off Association 9.2. Branched-off Association
After an association is established on a one-to-many style socket, After an association is established on a one-to-many style socket,
the application may wish to branch off the association into a the application may wish to branch off the association into a
separate socket/file descriptor. separate socket/file descriptor.
This is particularly desirable when, for instance, the application This is particularly desirable when, for instance, the application
wishes to have a number of sporadic message senders/receivers remain wishes to have a number of sporadic message senders/receivers remain
under the original one-to-many style socket but branch off those under the original one-to-many style socket but branch off those
associations carrying high volume data traffic into their own associations carrying high volume data traffic into their own
separate socket descriptors. separate socket descriptors.
skipping to change at page 72, line 32 skipping to change at page 74, line 30
socket is a one-to-one style socket. Thus it will be confined to socket is a one-to-one style socket. Thus it will be confined to
operations allowed for a one-to-one style socket. operations allowed for a one-to-one style socket.
The syntax is: The syntax is:
new_sd = sctp_peeloff(int sd, sctp_assoc_t assoc_id); new_sd = sctp_peeloff(int sd, sctp_assoc_t assoc_id);
new_sd: the new socket descriptor representing the branched-off new_sd: the new socket descriptor representing the branched-off
association. association.
sd: the original one-to-many style socket descriptor returned from sd: the original one-to-many style socket descriptor returned from
the socket() system call (see Section 3.1.1). the socket() system call (see Section 4.1.1).
assoc_id: the specified identifier of the association that is to be assoc_id: the specified identifier of the association that is to be
branched off to a separate file descriptor (Note, in a traditional branched off to a separate file descriptor (Note, in a traditional
one-to-one style accept() call, this would be an out parameter, one-to-one style accept() call, this would be an out parameter,
but for the one-to-many style call, this is an in parameter). but for the one-to-many style call, this is an in parameter).
8.3. sctp_getpaddrs() 9.3. sctp_getpaddrs()
sctp_getpaddrs() returns all peer addresses in an association. The sctp_getpaddrs() returns all peer addresses in an association. The
syntax is, syntax is,
int sctp_getpaddrs(int sd, sctp_assoc_t id, int sctp_getpaddrs(int sd, sctp_assoc_t id,
struct sockaddr **addrs); struct sockaddr **addrs);
On return, addrs will point to an array dynamically allocated On return, addrs will point to an array dynamically allocated
sockaddr structures of the appropriate type for the socket type. The sockaddr structures of the appropriate type for the socket type. The
caller should use sctp_freepaddrs() to free the memory. Note that caller should use sctp_freepaddrs() to free the memory. Note that
skipping to change at page 73, line 18 skipping to change at page 75, line 14
For one-to-many style sockets, id specifies the association to query. For one-to-many style sockets, id specifies the association to query.
For one-to-one style sockets, id is ignored. For one-to-one style sockets, id is ignored.
On success, sctp_getpaddrs() returns the number of peer addresses in On success, sctp_getpaddrs() returns the number of peer addresses in
the association. If there is no association on this socket, the association. If there is no association on this socket,
sctp_getpaddrs() returns 0, and the value of *addrs is undefined. If sctp_getpaddrs() returns 0, and the value of *addrs is undefined. If
an error occurs, sctp_getpaddrs() returns -1, and the value of *addrs an error occurs, sctp_getpaddrs() returns -1, and the value of *addrs
is undefined. is undefined.
8.4. sctp_freepaddrs() 9.4. sctp_freepaddrs()
sctp_freepaddrs() frees all resources allocated by sctp_freepaddrs() frees all resources allocated by
sctp_getpaddrs(). Its syntax is, sctp_getpaddrs(). Its syntax is,
void sctp_freepaddrs(struct sockaddr *addrs); void sctp_freepaddrs(struct sockaddr *addrs);
addrs is the array of peer addresses returned by sctp_getpaddrs(). addrs is the array of peer addresses returned by sctp_getpaddrs().
8.5. sctp_getladdrs() 9.5. sctp_getladdrs()
sctp_getladdrs() returns all locally bound address(es) on a socket. sctp_getladdrs() returns all locally bound address(es) on a socket.
The syntax is, The syntax is,
int sctp_getladdrs(int sd, sctp_assoc_t id, int sctp_getladdrs(int sd, sctp_assoc_t id,
struct sockaddr **ss); struct sockaddr **ss);
On return, addrs will point to a dynamically allocated array of On return, addrs will point to a dynamically allocated array of
sockaddr structures of the appropriate type for the socket type. The sockaddr structures of the appropriate type for the socket type. The
caller should use sctp_freeladdrs() to free the memory. Note that caller should use sctp_freeladdrs() to free the memory. Note that
skipping to change at page 74, line 10 skipping to change at page 76, line 5
For one-to-one style sockets, id is ignored. For one-to-one style sockets, id is ignored.
If the id field is set to the value '0' then the locally bound If the id field is set to the value '0' then the locally bound
addresses are returned without regard to any particular association. addresses are returned without regard to any particular association.
On success, sctp_getladdrs() returns the number of local addresses On success, sctp_getladdrs() returns the number of local addresses
bound to the socket. If the socket is unbound, sctp_getladdrs() bound to the socket. If the socket is unbound, sctp_getladdrs()
returns 0, and the value of *addrs is undefined. If an error occurs, returns 0, and the value of *addrs is undefined. If an error occurs,
sctp_getladdrs() returns -1, and the value of *addrs is undefined. sctp_getladdrs() returns -1, and the value of *addrs is undefined.
8.6. sctp_freeladdrs() 9.6. sctp_freeladdrs()
sctp_freeladdrs() frees all resources allocated by sctp_freeladdrs() frees all resources allocated by
sctp_getladdrs(). Its syntax is, sctp_getladdrs(). Its syntax is,
void sctp_freeladdrs(struct sockaddr *addrs); void sctp_freeladdrs(struct sockaddr *addrs);
addrs is the array of peer addresses returned by sctp_getladdrs(). addrs is the array of peer addresses returned by sctp_getladdrs().
8.7. sctp_sendmsg() 9.7. sctp_sendmsg()
An implementation may provide a library function (or possibly system An implementation may provide a library function (or possibly system
call) to assist the user with the advanced features of SCTP. call) to assist the user with the advanced features of SCTP.
sctp_sendmsg(). Its syntax is, sctp_sendmsg(). Its syntax is,
ssize_t sctp_sendmsg(int sd, ssize_t sctp_sendmsg(int sd,
const void *msg, const void *msg,
size_t len, size_t len,
const struct sockaddr *to, const struct sockaddr *to,
skipping to change at page 75, line 7 skipping to change at page 77, line 5
stream_no - is the same as sinfo_stream (see section 5.2.2) stream_no - is the same as sinfo_stream (see section 5.2.2)
pr_value - is the same as sinfo_pr_value (see section 5.2.2). pr_value - is the same as sinfo_pr_value (see section 5.2.2).
context - is the same as sinfo_context (see section 5.2.2) context - is the same as sinfo_context (see section 5.2.2)
The call returns the number of characters sent, or -1 if an error The call returns the number of characters sent, or -1 if an error
occurred. The variable errno is then set appropriately. Sending a occurred. The variable errno is then set appropriately. Sending a
message using sctp_sendmsg() is atomic unless explicit EOR marking is message using sctp_sendmsg() is atomic unless explicit EOR marking is
enabled on the socket specified by sd. Using sendto() on a non- enabled on the socket specified by sd. Using sendto() on a non-
connected one-to-one style socket for implicit connection setup may connected one-to-one style socket for implicit connection setup may
or may not work depending on the SCTP implementation. or may not work depending on the SCTP implementation.
8.8. sctp_recvmsg() 9.8. sctp_recvmsg()
An implementation may provide a library function (or possibly system An implementation may provide a library function (or possibly system
call) to assist the user with the advanced features of SCTP. Note call) to assist the user with the advanced features of SCTP. Note
that in order for the sctp_sndrcvinfo structure to be filled in by that in order for the sctp_sndrcvinfo structure to be filled in by
sctp_recvmsg() the caller must enable the sctp_data_io_events with sctp_recvmsg() the caller must enable the sctp_data_io_events with
the SCTP_EVENTS option. Note that the setting of the the SCTP_EVENTS option. Note that the setting of the
SCTP_USE_EXT_RCVINFO will effect this function as well, causing the SCTP_USE_EXT_RCVINFO will effect this function as well, causing the
sctp_sndrcvinfo information to be extended. sctp_sndrcvinfo information to be extended.
sctp_recvmsg(). Its syntax is, sctp_recvmsg(). Its syntax is,
skipping to change at page 75, line 40 skipping to change at page 77, line 38
from - is a pointer to a address to be filled with the sender of from - is a pointer to a address to be filled with the sender of
this messages address. this messages address.
fromlen - is the from length. fromlen - is the from length.
sinfo - A pointer to a sctp_sndrcvinfo structure to be filled upon sinfo - A pointer to a sctp_sndrcvinfo structure to be filled upon
receipt of the message. receipt of the message.
msg_flags - A pointer to a integer to be filled with any message msg_flags - A pointer to a integer to be filled with any message
flags (e.g. MSG_NOTIFICATION). flags (e.g. MSG_NOTIFICATION).
The call returns the number of bytes received, or -1 if an error The call returns the number of bytes received, or -1 if an error
occurred. The variable errno is then set appropriately. occurred. The variable errno is then set appropriately.
8.9. sctp_connectx() 9.9. sctp_connectx()
An implementation may provide a library function (or possibly system An implementation may provide a library function (or possibly system
call) to assist the user with associating to an endpoint that is call) to assist the user with associating to an endpoint that is
multi-homed. Much like sctp_bindx() this call allows a caller to multi-homed. Much like sctp_bindx() this call allows a caller to
specify multiple addresses at which a peer can be reached. The way specify multiple addresses at which a peer can be reached. The way
the SCTP stack uses the list of addresses to set up the association the SCTP stack uses the list of addresses to set up the association
is implementation dependent. This function only specifies that the is implementation dependent. This function only specifies that the
stack will try to make use of all the addresses in the list when stack will try to make use of all the addresses in the list when
needed. needed.
skipping to change at page 76, line 28 skipping to change at page 78, line 25
sd - is the socket descriptor sd - is the socket descriptor
addrs - is an array of addresses. addrs - is an array of addresses.
addrcnt - is the number of addresses in the array. addrcnt - is the number of addresses in the array.
id - is an output parameter that if passed in as a non-NULL will id - is an output parameter that if passed in as a non-NULL will
return the association identification for the newly created return the association identification for the newly created
association (if successful). association (if successful).
The call returns 0 on success or -1 if an error occurred. The The call returns 0 on success or -1 if an error occurred. The
variable errno is then set appropriately. variable errno is then set appropriately.
8.10. sctp_send() 9.10. sctp_send()
An implementation may provide another alternative function or system An implementation may provide another alternative function or system
call to assist an application with the sending of data without the call to assist an application with the sending of data without the
use of the CMSG header structures. The function takes the following use of the CMSG header structures. The function takes the following
form: form:
sctp_send(). Its syntax is, sctp_send(). Its syntax is,
int sctp_send(int sd, int sctp_send(int sd,
const void *msg, const void *msg,
skipping to change at page 77, line 24 skipping to change at page 79, line 23
Using sctp_send() on a non-connected one-to-one style socket for Using sctp_send() on a non-connected one-to-one style socket for
implicit connection setup may or may not work depending on the SCTP implicit connection setup may or may not work depending on the SCTP
implementation. implementation.
Sending a message using sctp_send() is atomic unless explicit EOR Sending a message using sctp_send() is atomic unless explicit EOR
marking is enabled on the socket specified by sd. The call returns marking is enabled on the socket specified by sd. The call returns
the number of characters sent, or -1 if an error occurred. The the number of characters sent, or -1 if an error occurred. The
variable errno is then set appropriately. variable errno is then set appropriately.
8.11. sctp_sendx() 9.11. sctp_sendx()
An implementation may provide another alternative function or system An implementation may provide another alternative function or system
call to assist an application with the sending of data without the call to assist an application with the sending of data without the
use of the CMSG header structures that also gives a list of use of the CMSG header structures that also gives a list of
addresses. The list of addresses is provided for implicit addresses. The list of addresses is provided for implicit
association setup. In such a case the list of addresses serves the association setup. In such a case the list of addresses serves the
same purpose as the addresses given in sctp_connectx (see same purpose as the addresses given in sctp_connectx (see
Section 8.9). Section 9.9).
sctp_sendx(). Its syntax is, sctp_sendx(). Its syntax is,
int sctp_sendx(int sd, int sctp_sendx(int sd,
const void *msg, const void *msg,
size_t len, size_t len,
struct sockaddr *addrs, struct sockaddr *addrs,
int addrcnt, int addrcnt,
struct sctp_sndrcvinfo *sinfo, struct sctp_sndrcvinfo *sinfo,
int flags); int flags);
skipping to change at page 78, line 30 skipping to change at page 80, line 29
Sending a message using sctp_send() is atomic unless explicit EOR Sending a message using sctp_send() is atomic unless explicit EOR
marking is enabled on the socket specified by sd. The call returns marking is enabled on the socket specified by sd. The call returns
the number of characters sent, or -1 if an error occurred. The the number of characters sent, or -1 if an error occurred. The
variable errno is then set appropriately. variable errno is then set appropriately.
Using sctp_sendx() on a non-connected one-to-one style socket for Using sctp_sendx() on a non-connected one-to-one style socket for
implicit connection setup may or may not work depending on the SCTP implicit connection setup may or may not work depending on the SCTP
implementation. implementation.
8.12. sctp_getaddrlen 9.12. sctp_getaddrlen
For application binary portability it is sometimes desirable to know For application binary portability it is sometimes desirable to know
what the kernel thinks is the length of a socket address family. what the kernel thinks is the length of a socket address family.
This function, when called with a valid family type will return the This function, when called with a valid family type will return the
length that the operating system uses in the specified family's length that the operating system uses in the specified family's
socket address structure. socket address structure.
int sctp_getaddrlen(sa_family_t family); int sctp_getaddrlen(sa_family_t family);
9. IANA considerations 10. IANA considerations
This document contains no IANA considerations. This document contains no IANA considerations.
10. Security Considerations 11. Security Considerations
Many TCP and UDP implementations reserve port numbers below 1024 for Many TCP and UDP implementations reserve port numbers below 1024 for
privileged users. If the target platform supports privileged users, privileged users. If the target platform supports privileged users,
the SCTP implementation SHOULD restrict the ability to call bind() or the SCTP implementation SHOULD restrict the ability to call bind() or
sctp_bindx() on these port numbers to privileged users. sctp_bindx() on these port numbers to privileged users.
Similarly unprivileged users should not be able to set protocol Similarly unprivileged users should not be able to set protocol
parameters which could result in the congestion control algorithm parameters which could result in the congestion control algorithm
being more aggressive than permitted on the public Internet. These being more aggressive than permitted on the public Internet. These
parameters are: parameters are:
o struct sctp_rtoinfo
struct sctp_rtoinfo
If an unprivileged user inherits a one-to-many style socket with open If an unprivileged user inherits a one-to-many style socket with open
associations on a privileged port, it MAY be permitted to accept new associations on a privileged port, it MAY be permitted to accept new
associations, but it SHOULD NOT be permitted to open new associations, but it SHOULD NOT be permitted to open new
associations. This could be relevant for the r* family of protocols. associations. This could be relevant for the r* family of protocols.
11. Acknowledgments Applications using the one-to-many style sockets and using the
interleave level if 0 are subject to denial of service attacks as
described in Section 8.1.25.
Special acknowledgment is given to Ken Fujita and Jonathan Woods who 12. IANA Considerations
helped extensively in the early formation of this document.
There are no actions required from IANA.
13. Acknowledgments
Special acknowledgment is given to Ken Fujita, Jonathan Woods,
Qiaobing Xie, and La Monte Yarroll, who helped extensively in the
early formation of this document.
The authors also wish to thank Kavitha Baratakke, Mike Bartlett, Jon The authors also wish to thank Kavitha Baratakke, Mike Bartlett, Jon
Berger, Mark Butler, Scott Kimble, Renee Revis, Andreas Fink, Berger, Mark Butler, Scott Kimble, Renee Revis, Andreas Fink,
Jonathan Leighton and many others on the TSVWG mailing list for Jonathan Leighton and many others on the TSVWG mailing list for
contributing valuable comments. contributing valuable comments.
A special thanks to Phillip Conrad, for his suggested text, quick and A special thanks to Phillip Conrad, for his suggested text, quick and
constructive insights, and most of all his persistent fighting to constructive insights, and most of all his persistent fighting to
keep the interface to SCTP usable for the application programmer. keep the interface to SCTP usable for the application programmer.
12. Normative references 14. Normative references
[RFC0793] Postel, J., "Transmission Control Protocol", STD 7, [RFC0793] Postel, J., "Transmission Control Protocol", STD 7,
RFC 793, September 1981. RFC 793, September 1981.
[RFC0768] Postel, J., "User Datagram Protocol", STD 6, RFC 768, [RFC0768] Postel, J., "User Datagram Protocol", STD 6, RFC 768,
August 1980. August 1980.
[RFC1644] Braden, B., "T/TCP -- TCP Extensions for Transactions [RFC1644] Braden, B., "T/TCP -- TCP Extensions for Transactions
Functional Specification", RFC 1644, July 1994. Functional Specification", RFC 1644, July 1994.
[RFC2026] Bradner, S., "The Internet Standards Process -- Revision
3", BCP 9, RFC 2026, October 1996.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, March 1997. Requirement Levels", BCP 14, RFC 2119, March 1997.
[RFC2292] Stevens, W. and M. Thomas, "Advanced Sockets API for [RFC3493] Gilligan, R., Thomson, S., Bound, J., McCann, J., and W.
IPv6", RFC 2292, February 1998. Stevens, "Basic Socket Interface Extensions for IPv6",
RFC 3493, February 2003.
[RFC2553] Gilligan, R., Thomson, S., Bound, J., and W. Stevens, [RFC3542] Stevens, W., Thomas, M., Nordmark, E., and T. Jinmei,
"Basic Socket Interface Extensions for IPv6", RFC 2553, "Advanced Sockets Application Program Interface (API) for
March 1999. IPv6", RFC 3542, May 2003.
[RFC3758] Stewart, R., Ramalho, M., Xie, Q., Tuexen, M., and P. [RFC3758] Stewart, R., Ramalho, M., Xie, Q., Tuexen, M., and P.
Conrad, "Stream Control Transmission Protocol (SCTP) Conrad, "Stream Control Transmission Protocol (SCTP)
Partial Reliability Extension", RFC 3758, May 2004. Partial Reliability Extension", RFC 3758, May 2004.
[RFC4960] Stewart, R., "Stream Control Transmission Protocol", [RFC4960] Stewart, R., "Stream Control Transmission Protocol",
RFC 4960, September 2007. RFC 4960, September 2007.
Appendix A. one-to-one style Code Example Appendix A. one-to-one style Code Example
skipping to change at page 87, line 8 skipping to change at page 89, line 8
/* Wait for new associations */ /* Wait for new associations */
while(1){ while(1){
/* Echo back any and all data */ /* Echo back any and all data */
echo(fd,1); echo(fd,1);
} }
} }
Authors' Addresses Authors' Addresses
Randall R. Stewart Randall R. Stewart
Cisco Systems, Inc. The Resource Group
4875 Forest Drive 1700 Pennsylvania Ave NW
Suite 200 Suite 56
Columbia, SC 29206 Washington, DC 20006
USA
Phone:
Email: rrs@cisco.com
Qiaobing Xie
Motorola, Inc.
1501 W. Shure Drive, #2309
Arlington Heights, IL 60004
USA
Phone:
Email: qxie1@email.mot.com
La Monte H.P. Yarroll
TimeSys Corp
925 Liberty Ave.
Pittsburgh, PA 15222
USA USA
Phone: Phone:
Email: piggy@acm.org Email: randall.stewart@trgworld.com
Kacheong Poon Kacheong Poon
Sun Microsystems, Inc. Sun Microsystems, Inc.
4150 Network Circle 4150 Network Circle
Santa Clara, CA 95054 Santa Clara, CA 95054
USA USA
Phone: Phone:
Email: kacheong.poon@sun.com Email: kacheong.poon@sun.com
Michael Tuexen Michael Tuexen
Univ. of Applied Sciences Muenster Univ. of Applied Sciences Muenster
Stegerwaldstr. 39 Stegerwaldstr. 39
48565 Steinfurt 48565 Steinfurt
Germany Germany
Email: tuexen@fh-muenster.de Email: tuexen@fh-muenster.de
Vladislav Yasevich Vladislav Yasevich
HP HP
skipping to change at page 89, line 4 skipping to change at page 90, line 4
Email: tuexen@fh-muenster.de Email: tuexen@fh-muenster.de
Vladislav Yasevich Vladislav Yasevich
HP HP
110 Spitrook Rd 110 Spitrook Rd
Nashua, NH, 03062 Nashua, NH, 03062
USA USA
Email: vladislav.yasevich@hp.com Email: vladislav.yasevich@hp.com
Peter Lei
Cisco Systems, Inc.
8735 West Higgins Road
Suite 300
Chicago, IL 60631
USA
Phone:
Email: peterlei@cisco.com
Full Copyright Statement Full Copyright Statement
Copyright (C) The IETF Trust (2008). Copyright (C) The IETF Trust (2008).
This document is subject to the rights, licenses and restrictions This document is subject to the rights, licenses and restrictions
contained in BCP 78, and except as set forth therein, the authors contained in BCP 78, and except as set forth therein, the authors
retain all their rights. retain all their rights.
This document and the information contained herein are provided on an This document and the information contained herein are provided on an
 End of changes. 224 change blocks. 
378 lines changed or deleted 491 lines changed or added

This html diff was produced by rfcdiff 1.35. The latest version is available from http://tools.ietf.org/tools/rfcdiff/