draft-ietf-tsvwg-sctpsocket-09.txt   draft-ietf-tsvwg-sctpsocket-10.txt 
Network Working Group R. Stewart Network Working Group R. Stewart
Internet-Draft Cisco Systems, Inc. Internet-Draft Cisco Systems, Inc.
Expires: March 28, 2005 Q. Xie Expires: August 25, 2005 Q. Xie
Motorola, Inc. Motorola, Inc.
L. Yarroll L. Yarroll
TimeSys Corp TimeSys Corp
J. Wood J. Wood
DoCoMo USA Labs DoCoMo USA Labs
K. Poon K. Poon
Sun Microsystems, Inc. Sun Microsystems, Inc.
M. Tuexen M. Tuexen
Univ. of Applied Sciences Muenster Univ. of Applied Sciences Muenster
September 27, 2004 February 21, 2005
Sockets API Extensions for Stream Control Transmission Protocol Sockets API Extensions for Stream Control Transmission Protocol
(SCTP) (SCTP)
draft-ietf-tsvwg-sctpsocket-09.txt draft-ietf-tsvwg-sctpsocket-10.txt
Status of this Memo Status of this Memo
This document is an Internet-Draft and is subject to all provisions This document is an Internet-Draft and is subject to all provisions
of section 3 of RFC 3667. By submitting this Internet-Draft, each of Section 3 of RFC 3667. By submitting this Internet-Draft, each
author represents that any applicable patent or other IPR claims of author represents that any 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 is aware have been or will be disclosed, and any of
which he or she become aware will be disclosed, in accordance with which he or she become aware will be disclosed, in accordance with
RFC 3668. RFC 3668.
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
other groups may also distribute working documents as other groups may also distribute working documents as
Internet-Drafts. Internet-Drafts.
skipping to change at page 1, line 46 skipping to change at page 1, line 46
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 March 28, 2005. This Internet-Draft will expire on August 25, 2005.
Copyright Notice Copyright Notice
Copyright (C) The Internet Society (2004). Copyright (C) The Internet Society (2005).
Abstract Abstract
This document describes a mapping of the Stream Control Transmission This document describes a mapping of the Stream Control Transmission
Protocol SCTP RFC2960 [8] into a sockets API. The benefits of this Protocol SCTP RFC2960 [8] into a sockets API. The benefits of this
mapping include compatibility for TCP applications, access to new mapping include compatibility for TCP applications, access to new
SCTP features and a consolidated error and event notification scheme. SCTP features and a consolidated error and event notification scheme.
Table of Contents Table of Contents
skipping to change at page 3, line 24 skipping to change at page 3, line 26
7.1.7 SO_SNDBUF . . . . . . . . . . . . . . . . . . . . . . 51 7.1.7 SO_SNDBUF . . . . . . . . . . . . . . . . . . . . . . 51
7.1.8 Automatic Close of associations (SCTP_AUTOCLOSE) . . . 51 7.1.8 Automatic Close of associations (SCTP_AUTOCLOSE) . . . 51
7.1.9 Set Peer Primary Address 7.1.9 Set Peer Primary Address
(SCTP_SET_PEER_PRIMARY_ADDR) . . . . . . . . . . . . . 51 (SCTP_SET_PEER_PRIMARY_ADDR) . . . . . . . . . . . . . 51
7.1.10 Set Primary Address (SCTP_PRIMARY_ADDR) . . . . . . 52 7.1.10 Set Primary Address (SCTP_PRIMARY_ADDR) . . . . . . 52
7.1.11 Set Adaption Layer Indicator (SCTP_ADAPTION_LAYER) . 52 7.1.11 Set Adaption Layer Indicator (SCTP_ADAPTION_LAYER) . 52
7.1.12 Enable/Disable message fragmentation 7.1.12 Enable/Disable message fragmentation
(SCTP_DISABLE_FRAGMENTS) . . . . . . . . . . . . . . 53 (SCTP_DISABLE_FRAGMENTS) . . . . . . . . . . . . . . 53
7.1.13 Peer Address Parameters (SCTP_PEER_ADDR_PARAMS) . . 53 7.1.13 Peer Address Parameters (SCTP_PEER_ADDR_PARAMS) . . 53
7.1.14 Set default send parameters 7.1.14 Set default send parameters
(SCTP_DEFAULT_SEND_PARAM) . . . . . . . . . . . . . 53 (SCTP_DEFAULT_SEND_PARAM) . . . . . . . . . . . . . 55
7.1.15 Set notification and ancillary events 7.1.15 Set notification and ancillary events
(SCTP_EVENTS) . . . . . . . . . . . . . . . . . . . 54 (SCTP_EVENTS) . . . . . . . . . . . . . . . . . . . 55
7.1.16 Set/clear IPv4 mapped addresses 7.1.16 Set/clear IPv4 mapped addresses
(SCTP_I_WANT_MAPPED_V4_ADDR) . . . . . . . . . . . . 54 (SCTP_I_WANT_MAPPED_V4_ADDR) . . . . . . . . . . . . 55
7.1.17 Set the maximum fragmentation size (SCTP_MAXSEG) . . 54 7.1.17 Set the maximum fragmentation size (SCTP_MAXSEG) . . 55
7.2 Read-Only Options . . . . . . . . . . . . . . . . . . . . 54 7.1.18 Set/Get the list of chunks that must be
7.2.1 Association Status (SCTP_STATUS) . . . . . . . . . . . 54 authenticated (SCTP_AUTH_CHUNKS) . . . . . . . . . . 56
7.2.2 Peer Address Information (SCTP_GET_PEER_ADDR_INFO) . . 56 7.1.19 Set/Get the current authentication shared secret
7.3 Ancillary Data and Notification Interest Options . . . . . 57 (SCTP_AUTH_SECRET) . . . . . . . . . . . . . . . . . 56
8. New Interfaces . . . . . . . . . . . . . . . . . . . . . . . 60 7.1.20 Get the list of chunks that peer requires to be
8.1 sctp_bindx() . . . . . . . . . . . . . . . . . . . . . . . 60 authenticated (SCTP_PEER_AUTH_CHUNKS) . . . . . . . 57
8.2 Branched-off Association . . . . . . . . . . . . . . . . . 61 7.2 Read-Only Options . . . . . . . . . . . . . . . . . . . . 57
8.3 sctp_getpaddrs() . . . . . . . . . . . . . . . . . . . . . 61 7.2.1 Association Status (SCTP_STATUS) . . . . . . . . . . . 57
8.4 sctp_freepaddrs() . . . . . . . . . . . . . . . . . . . . 62 7.2.2 Peer Address Information (SCTP_GET_PEER_ADDR_INFO) . . 58
8.5 sctp_getladdrs() . . . . . . . . . . . . . . . . . . . . . 62 7.3 Ancillary Data and Notification Interest Options . . . . . 59
8.6 sctp_freeladdrs() . . . . . . . . . . . . . . . . . . . . 63 8. New Interfaces . . . . . . . . . . . . . . . . . . . . . . . 62
8.7 sctp_sendmsg() . . . . . . . . . . . . . . . . . . . . . . 63 8.1 sctp_bindx() . . . . . . . . . . . . . . . . . . . . . . . 62
8.8 sctp_recvmsg() . . . . . . . . . . . . . . . . . . . . . . 64 8.2 Branched-off Association . . . . . . . . . . . . . . . . . 63
8.9 sctp_connectx() . . . . . . . . . . . . . . . . . . . . . 65 8.3 sctp_getpaddrs() . . . . . . . . . . . . . . . . . . . . . 63
8.10 sctp_send() . . . . . . . . . . . . . . . . . . . . . . 66 8.4 sctp_freepaddrs() . . . . . . . . . . . . . . . . . . . . 64
8.11 sctp_sendx() . . . . . . . . . . . . . . . . . . . . . . 66 8.5 sctp_getladdrs() . . . . . . . . . . . . . . . . . . . . . 64
9. Preprocessor Constants . . . . . . . . . . . . . . . . . . . 68 8.6 sctp_freeladdrs() . . . . . . . . . . . . . . . . . . . . 65
10. Security Considerations . . . . . . . . . . . . . . . . . . 69 8.7 sctp_sendmsg() . . . . . . . . . . . . . . . . . . . . . . 65
11. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . 70 8.8 sctp_recvmsg() . . . . . . . . . . . . . . . . . . . . . . 66
12. References . . . . . . . . . . . . . . . . . . . . . . . . . 70 8.9 sctp_connectx() . . . . . . . . . . . . . . . . . . . . . 67
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . 71 8.10 sctp_send() . . . . . . . . . . . . . . . . . . . . . . 68
A. one-to-one style Code Example . . . . . . . . . . . . . . . 73 8.11 sctp_sendx() . . . . . . . . . . . . . . . . . . . . . . 68
B. one-to-many style Code Example . . . . . . . . . . . . . . . 79 9. Preprocessor Constants . . . . . . . . . . . . . . . . . . . 70
Intellectual Property and Copyright Statements . . . . . . . 81 10. Security Considerations . . . . . . . . . . . . . . . . . . 71
11. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . 72
12. References . . . . . . . . . . . . . . . . . . . . . . . . . 72
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . 73
A. one-to-one style Code Example . . . . . . . . . . . . . . . 75
B. one-to-many style Code Example . . . . . . . . . . . . . . . 81
Intellectual Property and Copyright Statements . . . . . . . 83
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 RFC793 [1] and Protocol suite to many operating systems. Both TCP RFC793 [1] and
UDP RFC768 [2] have benefited from this standard representation and UDP RFC768 [2] have benefited from this standard representation and
access method across many diverse platforms. SCTP is a new protocol access method across many diverse platforms. SCTP is a new protocol
that provides many of the characteristics of TCP but also that provides many of the characteristics of TCP but also
incorporates semantics more akin to UDP. This document defines a incorporates semantics more akin to UDP. This document defines a
method to map the existing sockets API for use with SCTP, providing method to map the existing sockets API for use with SCTP, providing
skipping to change at page 9, line 13 skipping to change at page 9, line 13
option (section 7.1.8) is set. In this case, after the association option (section 7.1.8) is set. In this case, after the association
is terminated automatically, the association ID assigned to it can be is terminated automatically, the association ID assigned to it can be
reused. All applications using this option should be aware of this reused. All applications using this option should be aware of this
to avoid the possible problem of sending data to an incorrect peer to avoid the possible problem of sending data to an incorrect peer
end point. 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 Section with recv() and send() functions for message passing. See
8.2 for more on branched-off associations. Section 8.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.
skipping to change at page 13, line 37 skipping to change at page 13, line 37
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 [7]). sockaddr_in6 defined in RFC2553 [7]).
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 3.2 Implicit Association Setup
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
recvmsg() or sendto()/recvfrom() calls, without going through any sendmsg()/recvmsg() or sendto()/recvfrom() calls, without going
explicit association setup procedures (i.e., no connect() calls through any explicit association setup procedures (i.e., no connect()
required). calls 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
skipping to change at page 22, line 51 skipping to change at page 23, line 5
style (section Section 3.1.3), with the following differences: style (section Section 3.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 stack preferred peer address if the sender wishes to discourage the stack
from sending the message to the primary address of the receiver. If from sending the message to the primary address of the receiver. If
the transport address given is not part of the current association, the transport address given is not part of the current association,
the data will not be sent and a SCTP_SEND_FAILED event will be the data will not be sent and a SCTP_SEND_FAILED event will be
delivered to the application if send failure events are enabled. delivered to the application if send failure events are enabled.
2) An application must use close() to gracefully shutdown an
association, or use SO_LINGER option with close() to abort an
association. It must not use the MSG_ABORT or MSG_EOF flag in
sendmsg(). The system returns an error if an application tries to do
so.
4.1.9 getpeername() 4.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 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 multi-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 8.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 address - On return, the peer primary address is stored in
this buffer. If the socket is an IPv4 socket, the this buffer. If the socket is an IPv4 socket, the
skipping to change at page 29, line 23 skipping to change at page 29, line 23
message. If this flag is clear the datagram is message. If this flag is clear the datagram is
considered an ordered send. considered an ordered send.
MSG_ADDR_OVER - This flag, in the one-to-many style, requests the SCTP MSG_ADDR_OVER - This flag, in the one-to-many style, requests the SCTP
stack to override the primary destination address stack to override the primary destination address
with the address found with the sendto/sendmsg with the address found with the sendto/sendmsg
call. call.
MSG_ABORT - Setting this flag causes the specified association MSG_ABORT - Setting this flag causes the specified association
to abort by sending an ABORT message to the peer to abort by sending an ABORT message to the peer
(one-to-many style only). The ABORT chunk will contain an (one-to-many style only). The ABORT chunk
error cause 'User Initiated Abort' with cause code 12. will contain an error cause 'User Initiated Abort'
The cause specific information of this error cause is with cause code 12.The cause specific
provided in msg_iov. information of this error cause is provided in msg_iov.
MSG_EOF - Setting this flag invokes the SCTP graceful shutdown MSG_EOF - Setting this flag invokes the SCTP graceful shutdown
procedures on the specified association. Graceful procedures on the specified association. Graceful
shutdown assures that all data enqueued by both shutdown assures that all data enqueued by both
endpoints is successfully transmitted before closing endpoints is successfully transmitted before closing
the association (one-to-many style only). the association (one-to-many style only).
MSG_SENDALL - This flag, if set, will cause a one-to-many model MSG_SENDALL - This flag, if set, will cause a one-to-many model
socket to send the message to all associations socket to send the message to all associations
that are currently established on this socket. For that are currently established on this socket. For
skipping to change at page 31, line 30 skipping to change at page 31, line 30
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 5.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 Section endpoint via a specific transport address). Please see
5.3.1.2 for data structure details. Section 5.3.1.2 for data structure details.
SCTP_REMOTE_ERROR: The attached error message is an Operational Error SCTP_REMOTE_ERROR: The attached error message is an Operational Error
received from the remote peer. It includes the complete TLV sent received from the remote peer. It includes the complete TLV sent
by the remote endpoint. See Section 5.3.1.3 for the detailed by the remote endpoint. See Section 5.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 5.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.
skipping to change at page 46, line 27 skipping to change at page 46, line 27
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 8.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 applied to all associations belonging to the socket. And for
one-to-one style, those options will be applied to all peer addresses one-to-one style, those options will be applied to all peer addresses
of the association controlled by the socket. Applications should be of the association controlled by the socket. Applications should be
very careful in setting those options. very 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
SCTP stack. The syntax for scpt_opt_info() is, SCTP stack. The syntax for sctp_opt_info() is,
int sctp_opt_info(int sd, int sctp_opt_info(int sd,
sctp_assoc_t id, sctp_assoc_t id,
int opt, int opt,
void *arg, void *arg,
socklen_t *size); socklen_t *size);
The sctp_opt_info() call is a replacement for getsockopt() only and
will not set any options associated with the specified socket. A
setsockopt() must be used to set any writeable option.
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.
opt specifies which SCTP socket option to get. It can any socket opt specifies which SCTP socket option to get. It can get any socket
option currently supported that requests information (either read/ option currently supported that requests information (either
write options or read only) such as: read/write options or read only) such as:
SCTP_RTOINFO SCTP_RTOINFO
SCTP_ASSOCINFO SCTP_ASSOCINFO
SCTP_DEFAULT_SEND_PARAM SCTP_DEFAULT_SEND_PARAM
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_AUTH_CHUNKS
SCTP_AUTH_SECRET
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 8.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
skipping to change at page 47, line 18 skipping to change at page 47, line 29
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:
a) If an address is specified via a sockaddr_storage that is included a) If an address is specified via a sockaddr_storage that is included
in the structure the address is used to lookup the association and in the structure, the address is used to lookup the association
the settings are applied to the specific address (if appropriate) and the settings are applied to the specific address (if
or to the entire association. appropriate) or to the entire association.
b) If an association identification is filled in but not a b) If an association identification is filled in but not a
sockaddr_storage (if present) the association is found using the sockaddr_storage (if present), the association is found using the
association identification and the settings should be applied to association identification and the settings should be applied to
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).
skipping to change at page 48, line 14 skipping to change at page 48, line 15
struct sctp_rtoinfo { struct sctp_rtoinfo {
sctp_assoc_t srto_assoc_id; sctp_assoc_t srto_assoc_id;
uint32_t srto_initial; uint32_t srto_initial;
uint32_t srto_max; uint32_t srto_max;
uint32_t srto_min; uint32_t srto_min;
}; };
srto_initial - This contains the initial RTO value. srto_initial - This contains the initial RTO value.
srto_max and srto_min - These contain the maximum and minimum bounds srto_max and srto_min - These contain the maximum and minimum bounds
for all RTOs. for all RTOs.
srto_assoc_id - (one-to-many style socket) This is filled in the application, srto_assoc_id - (one-to-many style socket) This is filled in
and identifies the association for this query. If the application, and identifies the association
this parameter is '0' (on a one-to-many style socket), for this query. If this parameter is '0'
then the change effects the entire endpoint. (on a one-to-many style socket), then the 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) 7.1.2 Association Parameters (SCTP_ASSOCINFO)
skipping to change at page 49, line 25 skipping to change at page 49, line 25
sasoc_number_peer_destinations - This is the number of destination sasoc_number_peer_destinations - This is the number of destination
addresses that the peer has. addresses that the peer has.
sasoc_peer_rwnd - This holds the current value of the peers sasoc_peer_rwnd - This holds the current value of the peers
rwnd (reported in the last SACK) minus any rwnd (reported in the last SACK) minus any
outstanding data (i.e. data inflight). outstanding data (i.e. data inflight).
sasoc_local_rwnd - This holds the last reported rwnd that was sasoc_local_rwnd - This holds the last reported rwnd that was
sent to the peer. sent to the peer.
sasoc_cookie_life - This is the associations cookie life value sasoc_cookie_life - This is the associations cookie life value
used when issuing cookies. used when issuing cookies.
sasoc_assoc_id - (one-to-many style socket) This is filled in the application, sasoc_assoc_id - (one-to-many style socket) This is filled in the
and identifies the association for this query. application, and identifies the association
for this query.
This information may be examined for either the endpoint or a This information may be examined for either the endpoint or a
specific association. To examine a endpoints default parameters the specific association. To examine a endpoints default parameters the
association id (sasoc_assoc_id) should must be set to the value '0'. association id (sasoc_assoc_id) should must be set to the value '0'.
The values of the sasoc_peer_rwnd is meaningless when examining The values of the sasoc_peer_rwnd is meaningless when examining
endpoint information. endpoint information.
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.
skipping to change at page 53, line 27 skipping to change at page 53, line 27
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;
struct sockaddr_storage spp_address; struct sockaddr_storage spp_address;
uint32_t spp_hbinterval; uint32_t spp_hbinterval;
uint16_t spp_pathmaxrxt; uint16_t spp_pathmaxrxt;
uint32_t spp_pathmtu;
uint32_t spp_sackdelay;
uint32_t spp_flags;
}; };
spp_assoc_id - (one-to-many style socket) This is filled in the application, spp_assoc_id - (one-to-many style socket) This is filled in the
and identifies the association for this query. application, and identifies the association for
this query.
spp_address - This specifies which address is of interest. spp_address - This specifies which address is of interest.
spp_hbinterval - This contains the value of the heartbeat interval, spp_hbinterval - This contains the value of the heartbeat interval,
in milliseconds. A value of 0, when modifying the in milliseconds. If a value of zero
parameter, specifies that the heartbeat on this is present in this field then no changes are to
address should be disabled. A value of UINT32_MAX be made to this parameter.
(4294967295), when modifying the parameter,
specifies that a heartbeat should be sent
immediately to the peer address, and the current
interval should remain unchanged.
spp_pathmaxrxt - This contains the maximum number of spp_pathmaxrxt - This contains the maximum number of
retransmissions before this address shall be retransmissions before this address shall be
considered unreachable. If a value of zero considered unreachable. If a value of zero
is present in this field then no changes are to is present in this field then no changes are to
be made to this parameter. be made to this parameter.
spp_pathmtu - When Path MTU discovery is disabled the value
specified here will be the "fixed" path mtu.
Note that if the spp_address field is empty
then all associations on this address will
have this fixed path mtu set upon them.
spp_sackdelay - When delayed sack is enabled, this value specifies
the number of milliseconds that sacks will be delayed
for. This value will apply to all addresses of an
association if the spp_address field is empty. Note
also, that if delayed sack is enabled and this
value is set to 0, no change is made to the last
recorded delayed sack timer value.
spp_flags - These flags are used to control various features
on an association. The flag field may contain
zero or more of the following options.
SPP_HB_ENABLED - Enable heartbeats on the
specified address. Note that if the address
field is empty all addresses for the association
have heartbeats enabled upon them.
SPP_HB_DISABLED - Disable heartbeats on the
speicifed address. Note that if the address
field is empty all addresses for the association
will have their heartbeats disabled. Note also
that SPP_HB_ENABLED and SPP_HB_DISABLED are
mutually exclusive, only one of these two should
be specified. Enabling both fields will have
undetermined results.
SPP_PMTUD_ENABLED - This field will enable PMTU
discovery upon the specified address. Note that
if the address feild is empty then all addresses
on the association are effected.
SPP_PMTUD_DISABLED - This field will disable PMTU
discovery upon the specified address. Note that
if the address feild is empty then all addresses
on the association are effected. Not also that
SPP_PMTUD_ENABLE and SPP_PMTUD_DISABLE are mutually
exclusive. Enabling both will have undetermined
results.
SPP_SACKDELAY_ENABLED - Setting this flag turns
on delayed sack. The time specified in spp_sackdelay
is used to specify the sack delay for this address. Note
that if spp_address is empty then all addresses will
enable delayed sack and take on the sack delay
value specified in spp_sackdelay.
SPP_SACKDELAY_DISABLED - Setting this flag turns
off delayed sack. If the spp_address field is blank then
delayed sack is disabled for the entire association. Note
also that this field is mutually exclusive to
SPP_SACKDELAY_ENABLED, setting both will have undefined
results.
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) 7.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 Section in to this call the sctp_sndrcvinfo structure defined in
5.2.2) The input parameters accepted by this call include Section 5.2.2) The input parameters accepted by this call include
sinfo_stream, sinfo_flags, sinfo_ppid, sinfo_context, sinfo_stream, sinfo_flags, sinfo_ppid, sinfo_context,
sinfo_timetolive. The user must set the sinfo_assoc_id field to sinfo_timetolive. The user must set the sinfo_assoc_id field to
identify the association to affect if the caller is using the identify the association to affect if the caller is using the
one-to-many style. one-to-many style.
7.1.15 Set notification and ancillary events (SCTP_EVENTS) 7.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 7.3)
for a full description of this option and its usage. for a full description of this option and its usage.
skipping to change at page 54, line 47 skipping to change at page 56, line 10
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 option expects an integer. the user. The option expects an integer.
The default value for this option is '0' which indicates the user is The default value for this option is '0' which indicates the user is
NOT limiting fragmentation and only the PMTU will effect SCTP's NOT limiting fragmentation and only the PMTU will effect SCTP's
choice of DATA chunk size. choice of DATA chunk size.
7.1.18 Set/Get the list of chunks that must be authenticated
(SCTP_AUTH_CHUNKS)
This options gets or sets a list of chunks that the user is
requesting to be received only in an authenticated way. Changes to
this list will only effect associations that have not been formed.
struct sctp_authchunks {
uint8_t sauth_chunks[];
};
sauth_chunks - This parameter contains an array of chunks
that the user is requesting to be authenticated.
7.1.19 Set/Get the current authentication shared secret
(SCTP_AUTH_SECRET)
This option will get or set the shared secret to be used with any
authentication parameters.
struct sctp_authsecrets {
sctp_assoc_t sca_assoc_id;
uint8_t sca_secret[];
};
sca_assoc_id - This parameter, if non-zero, indicates what
association that the shared secret is being set
upon. Note that if this element contains zero, then
the secret is set upon the endpoint and all future
associations will use this secret (if not changed by
subsequent calls to SCTP_AUTH_SECRET).
sca_secret - This parameter contains an array of bytes
that is to be used by the endpoint (or association)
as the shared secret.
7.1.20 Get the list of chunks that peer requires to be authenticated
(SCTP_PEER_AUTH_CHUNKS)
This options gets a list of chunks for a specified association that
the peer requires to be authenticated. The requesting to be received
only in an authenticated way. Changes to this list will only effect
associations that have not been formed.
struct sctp_authchunks {
sctp_assoc_t gpauth_assoc_id;
uint8_t gpauth_chunks[];
};
sca_assoc_id - This parameter, indicates for which association the
user is requesting the list of peer authenticated
chunks.
gputh_chunks - This parameter contains an array of chunks
that the peer is requesting to be authenticated.
7.2 Read-Only Options 7.2 Read-Only Options
7.2.1 Association Status (SCTP_STATUS) 7.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:
skipping to change at page 55, line 41 skipping to change at page 58, line 20
SCTP_SHUTDOWN_SENT SCTP_SHUTDOWN_SENT
SCTP_SHUTDOWN_RECEIVED SCTP_SHUTDOWN_RECEIVED
SCTP_SHUTDOWN_ACK_SENT SCTP_SHUTDOWN_ACK_SENT
sstat_rwnd - This contains the association peer's current sstat_rwnd - This contains the association peer's current
receiver window size. receiver window size.
sstat_unackdata - This is the number of unacked data chunks. sstat_unackdata - This is the number of unacked data chunks.
sstat_penddata - This is the number of data chunks pending receipt. sstat_penddata - This is the number of data chunks pending receipt.
sstat_primary - This is information on the current primary peer sstat_primary - This is information on the current primary peer
address. address.
sstat_assoc_id - (one-to-many style socket) This holds the an identifier for the sstat_assoc_id - (one-to-many style socket) This holds the an
association. All notifications for a given association identifier for the association. All
notifications for a given association
have the same association identifier. have the same association identifier.
sstat_instrms - The number of streams that the peer will sstat_instrms - The number of streams that the peer will
be using inbound. be using inbound.
sstat_outstrms - The number of streams that the endpoint is sstat_outstrms - The number of streams that the endpoint is
allowed to use outbound. allowed 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.
skipping to change at page 56, line 46 skipping to change at page 59, line 31
SCTP_ACTIVE or SCTP_INACTIVE and possibly the modifer SCTP_ACTIVE or SCTP_INACTIVE and possibly the modifer
SCTP_UNCONFIRMED) SCTP_UNCONFIRMED)
spinfo_cwnd - This contains the peer addresses's current congestion spinfo_cwnd - This contains the peer addresses's current congestion
window. window.
spinfo_srtt - This contains the peer addresses's current smoothed spinfo_srtt - This contains the peer addresses's current smoothed
round-trip time calculation in milliseconds. round-trip time calculation in milliseconds.
spinfo_rto - This contains the peer addresses's current spinfo_rto - This contains the peer addresses's current
retransmission timeout value in milliseconds. retransmission timeout value in milliseconds.
spinfo_mtu - The current P-MTU of this address. spinfo_mtu - The current P-MTU of this address.
spinfo_assoc_id - (one-to-many style socket) This is filled in the application, spinfo_assoc_id - (one-to-many style socket) This is filled in
and identifies the association for this query. the application, and identifies the
association for this query.
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.3 Ancillary Data and Notification Interest Options 7.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 5.2.2)
2. SCTP_ASSOC_CHANGE (sctp_association_event): (described in Section 2. SCTP_ASSOC_CHANGE (sctp_association_event): (described in
5.3.1.1) Section 5.3.1.1)
3. SCTP_PEER_ADDR_CHANGE (sctp_address_event): (described in Section 3. SCTP_PEER_ADDR_CHANGE (sctp_address_event): (described in
5.3.1.2) Section 5.3.1.2)
4. SCTP_SEND_FAILED (sctp_send_failure_event): (described in Section 4. SCTP_SEND_FAILED (sctp_send_failure_event): (described in
5.3.1.4) Section 5.3.1.4)
5. SCTP_REMOTE_ERROR (sctp_peer_error_event): (described in Section 5. SCTP_REMOTE_ERROR (sctp_peer_error_event): (described in
5.3.1.3) Section 5.3.1.3)
6. SCTP_SHUTDOWN_EVENT (sctp_shtudown_event): (described in Section 6. SCTP_SHUTDOWN_EVENT (sctp_shtudown_event): (described in
5.3.1.5) Section 5.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 5.3.1.7)
8. SCTP_ADAPTION_INDICATION (sctp_adaption_layer_event): (described 8. SCTP_ADAPTION_INDICATION (sctp_adaption_layer_event): (described
in Section 5.3.1.6) in Section 5.3.1.6)
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{
skipping to change at page 66, line 42 skipping to change at page 68, line 42
MSG_EOF and the sinfo.sinf_associd to the association that needs to MSG_EOF and the sinfo.sinf_associd to the association that needs to
be terminated. In such a case the len of the message would be zero. be terminated. In such a case the len of the message would be zero.
8.11 sctp_sendx() 8.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 Section same purpose as the addresses given in sctp_connectx (see
8.9). Section 8.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,
const struct sctp_sndrcvinfo *sinfo, struct sctp_sndrcvinfo *sinfo,
int flags); int flags);
sd - is the socket descriptor sd - is the socket descriptor
msg - The message to be sent msg - The message to be sent
len - The length of the message len - The length of the message
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.
sinfo - A pointer to a sctp_sndrcvinfo struture used sinfo - A pointer to a sctp_sndrcvinfo struture used
as described in 5.2.2 for a sendmsg call. as described in 5.2.2 for a sendmsg call.
flags - is used in the same format as the sendmsg call flags - is used in the same format as the sendmsg call
flags (e.g. MSG_DONTROUTE). flags (e.g. MSG_DONTROUTE).
Note that on return from this call the sinfo structure will have
changed in that the sinfo_assoc_id will be filled in with the new
association id.
This function call may also be used to terminate an association using This function call may also be used to terminate an association using
an association identification by setting the sinfo.sinfo_flags to an association identification by setting the sinfo.sinfo_flags to
MSG_EOF and the sinfo.sinf_associd to the association that needs to MSG_EOF and the sinfo.sinf_associd to the association that needs to
be terminated. In such a case the len of the message would be zero. be terminated. In such a case the len of the message would be zero.
9. Preprocessor Constants 9. Preprocessor Constants
For application portability it is desireable to define pre-processor For application portability it is desireable to define pre-processor
constants for determination if sctp is present and supports various constants for determination if sctp is present and supports various
features. The following pre-processor constants should be defined in features. The following pre-processor constants should be defined in
skipping to change at page 68, line 33 skipping to change at page 70, line 33
HAVE_SCTP_SAT_NETWORK_CAPABILITY - If this constant is defined to 1, HAVE_SCTP_SAT_NETWORK_CAPABILITY - If this constant is defined to 1,
then the SCTP implementation supports the satellite network then the SCTP implementation supports the satellite network
extension to SCTP. extension to SCTP.
HAVE_SCTP_MULTIBUF - If this constant is defined to 1, then the SCTP HAVE_SCTP_MULTIBUF - If this constant is defined to 1, then the SCTP
implementation dedicates separate buffer space to each association implementation dedicates separate buffer space to each association
on a one-to-many socket. If this constant is defined to 0, then on a one-to-many socket. If this constant is defined to 0, then
the implementation provides a single block of shared buffer space the implementation provides a single block of shared buffer space
for a one-to-many socket. for a one-to-many socket.
HAVE_SCTP_NOCONNECT - If this constant is defined to 1, then the SCTP HAVE_SCTP_NOCONNECT - If this constant is defined to 1, then the SCTP
implementation supports initiating an association on a one-to-one implementation supports initiating an association on a one-to-one
style socket without the use of connect(), as outlined in Section style socket without the use of connect(), as outlined in
4.1.5. Section 4.1.5.
10. Security Considerations 10. 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 unpriviledged users should not be able to set protocol Similarly unpriviledged 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
skipping to change at page 70, line 18 skipping to change at page 72, line 18
in the early formation of this document. 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, Scott Kimble, Renee Revis, and many others on the TSVWG Berger, Scott Kimble, Renee Revis, and many others on the TSVWG
mailing list for contributing valuable comments. mailing list for 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 References 12. References
[1] Postel, J., "Transmission Control Protocol", STD 7, RFC 793, [1] Postel, J., "Transmission Control Protocol", STD 7, RFC 793,
September 1981. September 1981.
[2] Postel, J., "User Datagram Protocol", STD 6, RFC 768, August [2] Postel, J., "User Datagram Protocol", STD 6, RFC 768, August
1980. 1980.
[3] Braden, B., "T/TCP -- TCP Extensions for Transactions Functional [3] Braden, B., "T/TCP -- TCP Extensions for Transactions Functional
Specification", RFC 1644, July 1994. Specification", RFC 1644, July 1994.
[4] Bradner, S., "The Internet Standards Process -- Revision 3", BCP [4] Bradner, S., "The Internet Standards Process -- Revision 3",
9, RFC 2026, October 1996. BCP 9, RFC 2026, October 1996.
[5] Bradner, S., "Key words for use in RFCs to Indicate Requirement [5] Bradner, S., "Key words for use in RFCs to Indicate Requirement
Levels", BCP 14, RFC 2119, March 1997. Levels", BCP 14, RFC 2119, March 1997.
[6] Stevens, W. and M. Thomas, "Advanced Sockets API for IPv6", RFC [6] Stevens, W. and M. Thomas, "Advanced Sockets API for IPv6",
2292, February 1998. RFC 2292, February 1998.
[7] Gilligan, R., Thomson, S., Bound, J. and W. Stevens, "Basic [7] Gilligan, R., Thomson, S., Bound, J. and W. Stevens, "Basic
Socket Interface Extensions for IPv6", RFC 2553, March 1999. Socket Interface Extensions for IPv6", RFC 2553, March 1999.
[8] Stewart, R., Xie, Q., Morneault, K., Sharp, C., Schwarzbauer, [8] Stewart, R., Xie, Q., Morneault, K., Sharp, C., Schwarzbauer,
H., Taylor, T., Rytina, I., Kalla, M., Zhang, L. and V. Paxson, H., Taylor, T., Rytina, I., Kalla, M., Zhang, L. and V. Paxson,
"Stream Control Transmission Protocol", RFC 2960, October 2000. "Stream Control Transmission Protocol", RFC 2960, October 2000.
Authors' Addresses Authors' Addresses
Randall R. Stewart Randall R. Stewart
Cisco Systems, Inc. Cisco Systems, Inc.
4875 Forest Drive 4875 Forest Drive
Suite 200 Suite 200
Columbia, SC 29206 Columbia, SC 29206
USA USA
Phone: Phone:
EMail: rrs@cisco.com Email: rrs@cisco.com
Qiaobing Xie Qiaobing Xie
Motorola, Inc. Motorola, Inc.
1501 W. Shure Drive, #2309 1501 W. Shure Drive, #2309
Arlington Heights, IL 60004 Arlington Heights, IL 60004
USA USA
Phone: Phone:
EMail: qxie1@email.mot.com Email: qxie1@email.mot.com
La Monte H.P. Yarroll La Monte H.P. Yarroll
TimeSys Corp TimeSys Corp
925 Liberty Ave. 925 Liberty Ave.
Pittsburgh, PA 15222 Pittsburgh, PA 15222
USA USA
Phone: Phone:
EMail: piggy@acm.org Email: piggy@acm.org
Jonathan Wood Jonathan Wood
DoCoMo USA Labs DoCoMo USA Labs
181 Metro Drive, Suite 300 181 Metro Drive, Suite 300
San Jose, CA 95110 San Jose, CA 95110
USA USA
Phone: Phone:
EMail: jonwood@speakeasy.net Email: jonwood@speakeasy.net
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
Appendix A. one-to-one style Code Example Appendix A. one-to-one style Code Example
The following code is a simple implementation of an echo server over The following code is a simple implementation of an echo server over
SCTP. The example shows how to use some features of one-to-one style SCTP. The example shows how to use some features of one-to-one style
IPv4 SCTP sockets, including: IPv4 SCTP sockets, including:
o Opening, binding, and listening for new associations on a socket; o Opening, binding, and listening for new associations on a socket;
o Enabling ancillary data o Enabling ancillary data
o Enabling notifications o Enabling notifications
skipping to change at page 79, line 18 skipping to change at page 81, line 18
SCTP. The example shows how to use some features of one-to-many SCTP. The example shows how to use some features of one-to-many
style IPv4 SCTP sockets, including: style IPv4 SCTP sockets, including:
o Opening and binding of a socket; o Opening and binding of a socket;
o Enabling ancillary data o Enabling ancillary data
o Enabling notifications o Enabling notifications
o Using ancillary data with sendmsg() and recvmsg() o Using ancillary data with sendmsg() and recvmsg()
o Using MSG_EOR to determine if an entire message has been read o Using MSG_EOR to determine if an entire message has been read
o Handling notifications o Handling notifications
Note most functions defined in Appendix A are reused in this example. Note most functions defined in Appendix A are reused in thi
s example.
int main() int main()
{ {
int fd; int fd;
int idleTime = 2; int idleTime = 2;
struct sockaddr_in sin[1]; struct sockaddr_in sin[1];
struct sctp_event_subscribe event; struct sctp_event_subscribe event;
if ((fd = socket(AF_INET, SOCK_SEQPACKET, IPPROTO_SCTP)) == -1) { if ((fd = socket(AF_INET, SOCK_SEQPACKET, IPPROTO_SCTP)) == -1) {
perror("socket"); perror("socket");
skipping to change at page 81, line 41 skipping to change at page 83, line 41
This document and the information contained herein are provided on an This document and the information contained herein are provided on an
"AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET
ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE
INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
Copyright Statement Copyright Statement
Copyright (C) The Internet Society (2004). This document is subject Copyright (C) The Internet Society (2005). This document is subject
to the rights, licenses and restrictions contained in BCP 78, and to the rights, licenses and restrictions contained in BCP 78, and
except as set forth therein, the authors retain all their rights. except as set forth therein, the authors retain all their rights.
Acknowledgment Acknowledgment
Funding for the RFC Editor function is currently provided by the Funding for the RFC Editor function is currently provided by the
Internet Society. Internet Society.
 End of changes. 

This html diff was produced by rfcdiff 1.23, available from http://www.levkowetz.com/ietf/tools/rfcdiff/