draft-ietf-tsvwg-sctpsocket-01.txt   draft-ietf-tsvwg-sctpsocket-02.txt 
skipping to change at page 1, line 14 skipping to change at page 1, line 14
INTERNET-DRAFT Cisco INTERNET-DRAFT Cisco
Q. Xie Q. Xie
L Yarroll L Yarroll
Motorola Motorola
J. Wood J. Wood
K. Poon K. Poon
Sun Microsystems Sun Microsystems
K. Fujita K. Fujita
NEC NEC
expires in six months July 19, 2001 expires in six months November 19, 2001
Sockets API Extensions for SCTP Sockets API Extensions for SCTP
<draft-ietf-tsvwg-sctpsocket-01.txt> <draft-ietf-tsvwg-sctpsocket-02.txt>
Status of This Memo Status of This Memo
This document is an Internet-Draft and is in full conformance with This document is an Internet-Draft and is in full conformance with
all provisions of Section 10 of [RFC2026]. Internet-Drafts are all provisions of Section 10 of [RFC2026]. Internet-Drafts are
working documents of the Internet Engineering Task Force (IETF), its working documents of the Internet Engineering Task Force (IETF), its
areas, and its working groups. Note that other groups may also areas, and its working groups. Note that other groups may also
distribute working documents as Internet-Drafts. distribute working documents as Internet-Drafts.
The list of current Internet-Drafts can be accessed at The list of current Internet-Drafts can be accessed at
skipping to change at page 1, line 56 skipping to change at page 1, line 56
3.1 Basic Operation....................................... 4 3.1 Basic Operation....................................... 4
3.1.1 socket() - UDP Style Syntax...................... 5 3.1.1 socket() - UDP Style Syntax...................... 5
3.1.2 bind() - UDP Style Syntax........................ 5 3.1.2 bind() - UDP Style Syntax........................ 5
3.1.3 listen() - UDP Style Syntax...................... 6 3.1.3 listen() - UDP Style Syntax...................... 6
3.1.4 sendmsg() and recvmsg() - UDP Style Syntax....... 7 3.1.4 sendmsg() and recvmsg() - UDP Style Syntax....... 7
3.1.5 close() - UDP Style Syntax....................... 8 3.1.5 close() - UDP Style Syntax....................... 8
3.2 Implicit Association Setup............................ 8 3.2 Implicit Association Setup............................ 8
3.3 Non-blocking mode..................................... 9 3.3 Non-blocking mode..................................... 9
4. TCP-style Interface.....................................10 4. TCP-style Interface.....................................10
4.1 Basic Operation.......................................10 4.1 Basic Operation.......................................10
4.1.1 socket() - TCP Style Syntax........................11 4.1.1 socket() - TCP Style Syntax........................10
4.1.2 bind() - TCP Style Syntax..........................11 4.1.2 bind() - TCP Style Syntax..........................11
4.1.3 listen() - TCP Style Syntax........................12 4.1.3 listen() - TCP Style Syntax........................12
4.1.4 accept() - TCP Style Syntax........................12 4.1.4 accept() - TCP Style Syntax........................12
4.1.5 connect() - TCP Style Syntax.......................12 4.1.5 connect() - TCP Style Syntax.......................12
4.1.6 close() - TCP Style Syntax.........................13 4.1.6 close() - TCP Style Syntax.........................13
4.1.7 shutdown() - TCP Style Syntax......................13 4.1.7 shutdown() - TCP Style Syntax......................13
4.1.8 sendmsg() and recvmsg() - TCP Style Syntax.........14 4.1.8 sendmsg() and recvmsg() - TCP Style Syntax.........14
4.1.9 getsockname() .....................................15 4.1.9 getsockname() .....................................15
4.1.10 getpeername() ....................................15 4.1.10 getpeername() ....................................15
5. Data Structures..........................................16 5. Data Structures..........................................16
5.1 The msghdr and cmsghdr Structures......................16 5.1 The msghdr and cmsghdr Structures......................16
5.2 SCTP msg_control Structures............................17 5.2 SCTP msg_control Structures............................17
5.2.1 SCTP Initiation Structure (SCTP_INIT)...............18 5.2.1 SCTP Initiation Structure (SCTP_INIT)...............18
5.2.2 SCTP Header Information Structure (SCTP_SNDRCV).....19 5.2.2 SCTP Header Information Structure (SCTP_SNDRCV).....19
5.3 SCTP Events and Notifications..........................20 5.3 SCTP Events and Notifications..........................21
5.3.1 SCTP Notification Structure.........................21 5.3.1 SCTP Notification Structure.........................21
5.3.1.1 SCTP_ASSOC_CHANGE................................22 5.3.1.1 SCTP_ASSOC_CHANGE................................22
5.3.1.2 SCTP_PEER_ADDR_CHANGE............................23 5.3.1.2 SCTP_PEER_ADDR_CHANGE............................24
5.3.1.3 SCTP_REMOTE_ERROR................................25 5.3.1.3 SCTP_REMOTE_ERROR................................25
5.3.1.4 SCTP_SEND_FAILE..................................26 5.3.1.4 SCTP_SEND_FAILE..................................26
5.3.1.5 SCTP_SHUTDOWN_EVENT..............................27 5.3.1.5 SCTP_SHUTDOWN_EVENT..............................27
5.4 Ancillary Data Considerations and Semantics...........27 5.3.1.6 SCTP_ADAPTION_INDICATION.........................28
5.4.1 Multiple Items and Ordering........................27 5.4 Ancillary Data Considerations and Semantics...........29
5.4.2 Accessing and Manipulating Ancillary Data..........28 5.4.1 Multiple Items and Ordering........................29
5.4.3 Control Message Buffer Sizing......................28 5.4.2 Accessing and Manipulating Ancillary Data..........29
6. Common Operations for Both Styles.......................29 5.4.3 Control Message Buffer Sizing......................30
6.1 send(), recv(), sendto(), recvfrom()..................29 6. Common Operations for Both Styles.......................30
6.2 setsockopt(), getsockopt()............................30 6.1 send(), recv(), sendto(), recvfrom()..................30
6.3 read() and write()....................................30 6.2 setsockopt(), getsockopt()............................31
7. Socket Options..........................................30 6.3 read() and write()....................................32
7.1 Read / Write Options..................................31 7. Socket Options..........................................32
7.1.1 Retransmission Timeout Parameters (SCTP_RTOINFO)...31 7.1 Read / Write Options..................................32
7.1.1 Retransmission Timeout Parameters (SCTP_RTOINFO)...32
7.1.2 Association Retransmission Parameter 7.1.2 Association Retransmission Parameter
(SCTP_ASSOCRTXINFO)................................32 (SCTP_ASSOCRTXINFO)................................33
7.1.3 Initialization Parameters (SCTP_INITMSG)...........32 7.1.3 Initialization Parameters (SCTP_INITMSG)...........34
7.1.4 SO_LINGER..........................................33 7.1.4 SO_LINGER..........................................34
7.1.5 SO_NODELAY.........................................33 7.1.5 SO_NODELAY.........................................34
7.1.6 SO_RCVBUF..........................................33 7.1.6 SO_RCVBUF..........................................34
7.1.7 SO_SNDBUF..........................................33 7.1.7 SO_SNDBUF..........................................35
7.1.8 Automatic Close of associations (SCTP_AUTOCLOSE)...33 7.1.8 Automatic Close of associations (SCTP_AUTOCLOSE)...35
7.1.9 SCTP_SET_PRIMARY_ADDR..............................34 7.1.9 SCTP_SET_PRIMARY_ADDR..............................35
7.1.10 SCTP_SET_PEER_PRIMARY_ADDR........................34 7.1.10 SCTP_SET_PEER_PRIMARY_ADDR........................35
7.2 Read-Only Options.....................................34 7.1.11 Set Adaption Layer Bits...........................36
7.2.1 Association Status (SCTP_STATUS)...................34 7.2 Read-Only Options.....................................36
7.3. Ancillary Data and Notification Interest Options.....35 7.2.1 Association Status (SCTP_STATUS)...................36
8. New Interfaces..........................................36 7.3. Ancillary Data and Notification Interest Options.....37
8.1 sctp_bindx()..........................................36 8. New Interfaces..........................................38
8.2 Branched-off Association, sctp_peeloff()..............37 8.1 sctp_bindx()..........................................38
8.3 sctp_getpaddrs()......................................38 8.2 Branched-off Association, sctp_peeloff()..............39
8.4 sctp_freepaddrs().....................................38 8.3 sctp_getpaddrs()......................................39
8.5 sctp_getladdrs()......................................38 8.4 sctp_freepaddrs().....................................40
8.6 sctp_freeladdrs().....................................39 8.5 sctp_getladdrs()......................................40
8.7 sctp_opt_info().......................................39 8.6 sctp_freeladdrs().....................................40
8.7.1 Peer Address Parameters............................39 8.7 sctp_opt_info().......................................41
8.7.2 Peer Address Information...........................40 8.7.1 Peer Address Parameters............................41
9. Security Considerations.................................41 8.7.2 Peer Address Information...........................42
10. Acknowledgements......................................41 9. Security Considerations.................................42
11. Authors' Addresses....................................41 10. Acknowledgements......................................43
12. References............................................42 11. Authors' Addresses....................................43
Appendix A: TCP-style Code Example.........................42 12. References............................................44
Appendix B: UDP-style Code Example.........................47 Appendix A: TCP-style Code Example.........................44
Appendix B: UDP-style Code Example.........................49
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] and UDP Protocol suite to many operating systems. Both TCP [RFC793] and UDP
[RFC768] have benefited from this standard representation and access [RFC768] 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 the existing sockets API for use with SCTP, providing both a base
skipping to change at page 12, line 28 skipping to change at page 12, line 31
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 allowed in the socket's accept queue. These are the
associations that have finished the four-way initiation associations that have finished the four-way initiation
handshake (see Section 5 of [SCTP]) and are in the handshake (see Section 5 of [SCTP]) and are in the
ESTABLISHED state. ESTABLISHED state. Note, a backlog of '0' indicates
that the caller no longer wishes to receive new
associations.
4.1.4 accept() - TCP Style Syntax 4.1.4 accept() - TCP Style Syntax
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:
skipping to change at page 15, line 10 skipping to change at page 15, line 14
2) An application must use close() to gracefully shutdown an 2) An application must use close() to gracefully shutdown an
association, or use SO_LINGER option with close() to abort 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 association. It must not use the MSG_ABORT or MSG_EOF flag in
sendmsg(). The system returns an error if an application tries to sendmsg(). The system returns an error if an application tries to
do so. do so.
4.1.9 getsockname() 4.1.9 getsockname()
Applications use getsockname() to retrieve the locally-bound socket Applications use getsockname() to retrieve the locally-bound socket
address of the specified socket. The 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 TCP caller let SCTP chose a local port. This call is for where the
compatibility, and is not multihomed. It does not work with endpoint is not multihomed. It does not work well with multi-homed
UDP-style sockets. See section 8.5 for a multihomed/UDP-sockets sockets. See section 8.5 for a multihomed version of the call.
version of the call.
The syntax is: The syntax is:
int getsockname(int socket, struct sockaddr *address, int getsockname(int socket, 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 address - On return, one locally bound address (chosen by
the SCTP stack) is stored in this buffer. If the the SCTP stack) is stored in this buffer. If the
skipping to change at page 19, line 26 skipping to change at page 19, line 29
IPPROTO_SCTP SCTP_SNDRCV struct sctp_sndrcvinfo IPPROTO_SCTP SCTP_SNDRCV struct sctp_sndrcvinfo
Here is the defintion of sctp_sndrcvinfo: Here is the defintion 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;
uint32_t sinfo_ppid; uint32_t sinfo_ppid;
uint32_t sinfo_context; uint32_t sinfo_context;
uint32_t sinfo_timetolive;
sctp_assoc_t sinfo_assoc_id; sctp_assoc_t sinfo_assoc_id;
}; };
sinfo_stream: 16 bits (unsigned integer) sinfo_stream: 16 bits (unsigned integer)
For recvmsg() the SCTP stack places the message's stream number in For recvmsg() the SCTP stack places the message's stream number in
this value. For sendmsg() this value holds the stream number that this value. For sendmsg() this value holds the stream number that
the application wishes to send this message to. If a sender the application wishes to send this message to. If a sender
specifies an invalid stream number an error indication is returned specifies an invalid stream number an error indication is returned
and the call fails. and the call fails.
skipping to change at page 20, line 40 skipping to change at page 20, line 45
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
(UDP-style only). (UDP-style only).
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 (UDP-style only). the association (UDP-style only).
sinfo_timetolive: 32 bit (unsigned integer)
For the sending side, this field contains the message time
to live in milliseconds. The sending side wil expire the
message within the specified time period if the message as
not been sent to the peer within this time period.
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 COMMUNICATION_UP notification. for the association announced in the COMMUNICATION_UP notification.
All notifications for a given association have the same identifier. All notifications for a given association have the same identifier.
Ignored for TCP-style sockets. Ignored for TCP-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.3 SCTP Events and Notifications 5.3 SCTP Events and Notifications
skipping to change at page 21, line 12 skipping to change at page 21, line 24
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 7.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.
Multiple notifications may be returned to a single recvmsg()
call.
This section details the notification structures. Every This section details the notification structures. Every
notification structure carries some common fields which provides notification structure carries some common fields which provides
general information. general 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 5.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 {
uint16_t sn_type; /* Notification type. */ uint16_t sn_type; /* Notification type. */
struct sctp_assoc_change; uint16_t sn_flags;
struct sctp_paddr_change; uint32_t sn_length;
struct sctp_remote_error; } h;
struct sctp_shutdown_event; struct sctp_assoc_change sn_assoc_change;
struct sctp_paddr_change sn_padr_change;
struct sctp_remote_error sn_remote_error;
struct sctp_send_failed sn_send_failed;
struct sctp_shutdown_event sn_shutdown_event;
}; };
sn_type: sizeof (uint16_t) sn_type: 16 bits (unsigned integer)
The following table describes the SCTP notification and event types The following table describes the SCTP notification and event types
for the field sn_type. for the field sn_type.
sn_type Description sn_type Description
--------- --------------------------- --------- ---------------------------
SCTP_ASSOC_CHANGE This tag indicates that an SCTP_ASSOC_CHANGE This tag indicates that an
association has either been association has either been
opened or closed. Refer to opened or closed. Refer to
skipping to change at page 22, line 23 skipping to change at page 22, line 41
This structure includes the This structure includes the
original SCTP_SNDRCVINFO original SCTP_SNDRCVINFO
that was used in sending this that was used in sending this
message i.e. this structure message i.e. this structure
uses the sctp_sndrecvinfo per uses the sctp_sndrecvinfo per
section 5.3.1.4. section 5.3.1.4.
SCTP_SHUTDOWN_EVENT The peer has sent a SHUTDOWN. No further SCTP_SHUTDOWN_EVENT The peer has sent a SHUTDOWN. No further
data should be sent on this socket. data should be sent on this socket.
All standard values for sn_type flags are greater than 2^15.
Values from 2^15 and down are reserved.
sn_flags: 16 bits (unsigned integer)
These are notification-specific flags.
sn_length: 32 bits (unsigned integer)
This is the length of the whole sctp_notification structure
including the sn_type, sn_flags, and sn_length fields.
5.3.1.1 SCTP_ASSOC_CHANGE 5.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 notificaion. The notification information has the provided by this notificaion. 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;
skipping to change at page 22, line 49 skipping to change at page 23, line 27
}; };
sac_type: sac_type:
It should be SCTP_ASSOC_CHANGE. It should be SCTP_ASSOC_CHANGE.
sac_flags: 16 bits (unsigned integer) sac_flags: 16 bits (unsigned integer)
Currently unused. Currently unused.
sac_length: sizeof (uint32_t) sac_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. the notification header.
sac_state: 32 bits (signed integer) sac_state: 32 bits (signed integer)
This field holds one of a number of values that communicate the This field holds one of a number of values that communicate the
event that happened to the association. They include: event that happened to the association. They include:
Event Name Description Event Name Description
skipping to change at page 24, line 15 skipping to change at page 24, line 48
} }
spc_type: spc_type:
It should be SCTP_PEER_ADDR_CHANGE. It should be SCTP_PEER_ADDR_CHANGE.
spc_flags: 16 bits (unsigned integer) spc_flags: 16 bits (unsigned integer)
Currently unused. Currently unused.
spc_length: sizeof (uint32_t) spc_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. the notification header.
spc_aaddr: sizeof (struct sockaddr_storage) spc_aaddr: sizeof (struct sockaddr_storage)
The affected address field, holds the remote peer's address that is The affected address field, holds the remote peer's address that is
encountering the change of state. encountering the change of state.
spc_state: 32 bits (signed integer) spc_state: 32 bits (signed integer)
skipping to change at page 25, line 22 skipping to change at page 25, line 55
association. The entire error TLV as it appears on the wire is association. The entire error TLV 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 [SCTP] and any extensions for a list of possible specification [SCTP] and any extensions for a list of possible
error formats. SCTP error TLVs have the format: error formats. SCTP error TLVs have the format:
struct sctp_remote_error { struct sctp_remote_error {
uint16_t sre_type; uint16_t sre_type;
uint16_t sre_flags; uint16_t sre_flags;
uint32_t sre_length; uint32_t sre_length;
uint16_t sre_error; uint16_t sre_error;
uint16_t sre_len;
sctp_assoc_t sre_assoc_id; sctp_assoc_t sre_assoc_id;
uint8_t sre_data[0]; uint8_t sre_data[0];
}; };
sre_type: sre_type:
It should be SCTP_REMOTE_ERROR. It should be SCTP_REMOTE_ERROR.
sre_flags: 16 bits (unsigned integer) sre_flags: 16 bits (unsigned integer)
Currently unused. Currently unused.
sre_length: sizeof (uint32_t) sre_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. the notification header and the contents of sre_data.
sre_error: 16 bits (unsigned integer) sre_error: 16 bits (unsigned integer)
This value represents one of the Operational Error causes defined in This value represents one of the Operational Error causes defined in
the SCTP specification, in network byte order. the SCTP specification, in network byte order.
sre_len: 16 bits (unsigned integer)
This value represents the length of the operational error payload in
plus the size of sre_error and sre_len in network byte order.
sre_assoc_id: sizeof (sctp_assoc_t) sre_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 TCP style socket, this field is ignored. identifier. For TCP style socket, this field is ignored.
sre_data: variable sre_data: variable
This contains the payload of the operational error as defined in the This contains the payload of the operational error as defined in the
SCTP specification [SCTP] section 3.3.10. SCTP specification [SCTP] section 3.3.10.
skipping to change at page 26, line 36 skipping to change at page 27, line 9
The flag value will take one of the following values The flag value will take one of the following values
SCTP_DATA_UNSENT - Indicates that the data was never put on SCTP_DATA_UNSENT - Indicates that the data was never put on
the wire. the wire.
SCTP_DATA_SENT - Indicates that the data was put on the wire. SCTP_DATA_SENT - Indicates that the data was put on the wire.
Note that this does not necessarily mean that the Note that this does not necessarily mean that the
data was (or was not) successfully delivered. data was (or was not) successfully delivered.
ssf_length: sizeof (uint32_t) ssf_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. the notification header and the payload in ssf_data.
ssf_error: 16 bits (unsigned integer) ssf_error: 16 bits (unsigned integer)
This value represents the reason why the send failed, and if set, This value represents the reason why the send failed, and if set,
will be a SCTP protocol error code as defined in [SCTP] section will be a SCTP protocol error code as defined in [SCTP] section
3.3.10. 3.3.10.
ssf_info: sizeof (struct sctp_sndrcvinfo) ssf_info: sizeof (struct sctp_sndrcvinfo)
The original send information associated with the undelivered The original send information associated with the undelivered
skipping to change at page 27, line 20 skipping to change at page 27, line 46
5.3.1.5 SCTP_SHUTDOWN_EVENT 5.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;
uint16_t sse_flags;
sctp_assoc_t sse_assoc_id; sctp_assoc_t sse_assoc_id;
}; };
sse_type sse_type
It should be SCTP_SHUTDOWN_EVENT It should be SCTP_SHUTDOWN_EVENT
sse_flags: 16 bits (unsigned integer) sse_flags: 16 bits (unsigned integer)
Currently unused. Currently unused.
sse_length: sizeof (uint32_t) sse_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. the notification header. It will generally be
sizeof (struct sctp_shutdown_event).
sse_flags: 16 bits (unsigned integer)
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 TCP style socket, this field is ignored. identifier. For TCP style socket, this field is ignored.
5.3.1.6 SCTP_ADAPTION_INDICATION
When a peer sends a Adaption Layer Indication parameter , SCTP
delivers this notification to inform the application
that of the peers requested adaption layer.
struct sctp_adaption_event {
uint16_t sai_type;
uint16_t sai_flags;
uint32_t sai_length;
uint32_t sai_adaptation_bits;
sctp_assoc_t sse_assoc_id;
};
sai_type
It should be SCTP_ADAPTION_INDICATION
sai_flags: 16 bits (unsigned integer)
Currently unused.
sai_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_adaption_event).
sai_adaption_bits: 32 bits (unsigned integer)
This field holds the bit array sent by the peer in the
adaption layer indication parameter. The bits are in
network byte order.
sai_assoc_id: sizeof (sctp_assoc_t)
The association id field, holds the identifier for the association.
All notifications for a given association have the same association
identifier. For TCP style socket, this field is ignored.
5.4 Ancillary Data Considerations and Semantics 5.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 5.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.
skipping to change at page 31, line 52 skipping to change at page 33, line 19
uint32_t srto_initial; uint32_t srto_initial;
uint32_t srto_max; uint32_t srto_max;
uint32_t srto_min; uint32_t srto_min;
sctp_assoc_t srto_assoc_id; sctp_assoc_t srto_assoc_id;
}; };
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 minumum bounds srto_max and srto_min - These contain the maximum and minumum bounds
for all RTOs. for all RTOs.
srto_assoc_id - (UDP style socket) This is filled in the application, srto_assoc_id - (UDP style socket) This is filled in the application,
and identifies the association for this query. and identifies the association for this query. If
this parameter is missing (on a UDP 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 modifying the parameters, indicates that the current value should
not be changed. not 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 Retransmission Parameter (SCTP_ASSOCRTXINFO) 7.1.2 Association Retransmission Parameter (SCTP_ASSOCRTXINFO)
skipping to change at page 34, line 45 skipping to change at page 36, line 15
struct sctp_setpeerprim { struct sctp_setpeerprim {
struct sockaddr_storage sspp_addr; struct sockaddr_storage sspp_addr;
sctp_assoc_t sspp_assoc_id; sctp_assoc_t sspp_assoc_id;
}; };
sspp_addr The address to set as primary sspp_addr The address to set as primary
sspp_assoc_id (UDP style socket) This is filled in by the sspp_assoc_id (UDP style socket) This is filled in by the
application, and identifies the association application, and identifies the association
for this request. for this request.
7.1.11 Set Adaption Layer Bits (SCTP_SET_ADAPTION_LAYER_BITS)
Requests that the local endpoint set the indicated bits
in its Adaption Layer Indication parameter for all future
INIT and INIT-ACK exchanges.
struct sctp_setadaption_bits {
u_int32_t ssb_bit_array;
}
ssb_bit_array The adaption layer bits that will be included
in any outgoing Adaption Layer Indication
parameter.
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 35, line 51 skipping to change at page 37, line 35
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_RECVDATAIOEVNT: Per-message information (i.e. stream number, 1. SCTP_RECVDATAIOEVNT: Per-message information (i.e. stream number,
TSN, SSN, etc. described in section 5.2.2) TSN, SSN, etc. described in section 5.2.2)
2. SCTP_RECVASSOCEVNT: (described in section 5.3.1.1) 2. SCTP_RECVASSOCEVNT: (described in section 5.3.1.1)
3. SCTP_RECVPADDREVNT: (described in section 5.3.1.2) 3. SCTP_RECVPADDREVNT: (described in section 5.3.1.2)
4. SCTP_RECVPEERERR: (described in section 5.3.1.3) 4. SCTP_RECVPEERERR: (described in section 5.3.1.3)
5. SCTP_RECVSENDFAILEVNT: (described in section 5.3.1.4) 5. SCTP_RECVSENDFAILEVNT: (described in section 5.3.1.4)
6. SCTP_RECVSHUTDOWNEVNT: (described in section 5.3.1.5); 6. SCTP_RECVSHUTDOWNEVNT: (described in section 5.3.1.5)
7. SCTP_ADAPTION_INDICATION: (described in section 5.3.1.6)
To receive any ancillary data or notifications, first the To receive any ancillary data or notifications, first the
application registers it's interest by calling setsockopt() to turn application registers it's interest by calling setsockopt() to turn
on the corresponding flag: on the corresponding flag:
int on = 1; int on = 1;
setsockopt(fd, IPPROTO_SCTP, SCTP_RECVDATAIOEVNT, &on, sizeof(on)); setsockopt(fd, IPPROTO_SCTP, SCTP_RECVDATAIOEVNT, &on, sizeof(on));
setsockopt(fd, IPPROTO_SCTP, SCTP_RECVASSOCEVNT, &on, sizeof(on)); setsockopt(fd, IPPROTO_SCTP, SCTP_RECVASSOCEVNT, &on, sizeof(on));
setsockopt(fd, IPPROTO_SCTP, SCTP_RECVPADDREVNT, &on, sizeof(on)); setsockopt(fd, IPPROTO_SCTP, SCTP_RECVPADDREVNT, &on, sizeof(on));
setsockopt(fd, IPPROTO_SCTP, SCTP_RECVSENDFAILEVNT, &on, sizeof(on)); setsockopt(fd, IPPROTO_SCTP, SCTP_RECVSENDFAILEVNT, &on, sizeof(on));
setsockopt(fd, IPPROTO_SCTP, SCTP_RECVPEERERR, &on, sizeof(on)); setsockopt(fd, IPPROTO_SCTP, SCTP_RECVPEERERR, &on, sizeof(on));
setsockopt(fd, IPPROTO_SCTP, SCTP_RECVSHUTDOWNEVNT, &on, sizeof(on)); setsockopt(fd, IPPROTO_SCTP, SCTP_RECVSHUTDOWNEVNT, &on, sizeof(on));
setsockopt(fd, IPPROTO_SCTP, SCTP_ADAPTION_INDICATION, &on, sizeof(on));
Note that for UDP-style SCTP sockets, the caller of recvmsg() Note that for UDP-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 TCP-style SCTP sockets, the caller to the file descriptor. For TCP-style SCTP sockets, the caller
receives ancillary data and notifications for only the single receives ancillary data and notifications for only the single
association bound to the file descriptor. association bound to the file descriptor.
By default a TCP-style socket has all options off. By default a TCP-style socket has all options off.
By default a UDP-style socket has SCTP_RECVDATAIOEVNT and By default a UDP-style socket has SCTP_RECVDATAIOEVNT and
 End of changes. 

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