SCTP Programmer's Guide

However, because of the unique features of SCTP, such as multistreaming and
multihoming, the existing socket APIs either do not work on an SCTP socket, or the
semantics of the socket APIs need modification. For example, because of the
multi-homing feature supported in SCTP, the socket APIs, getsockname() and
getpeername(), do not work on an SCTP socket if a given association is bound to
multiple local addresses and the association has multiple peer addresses. Applications
must use the sctp_getpaddrs() SCTP socket API to obtain the peer addresses in
an association.
Unlike the existing socket APIs, the SCTP socket APIs disclose many features of the
SCTP protocol and association status to the application, to enable applications gain
better control over the SCTP protocol. For example, an application can specify some
of the association setup parameters, such as the number of desired outbound streams
and maximum number of inbound streams, to control an association.
Different Socket API Styles
This section discusses the different socket API styles and the basic call flow sequence
of each socket API style.
Following are the different socket API styles:
One-to-one socket APIs
One-to-many socket APIs
The one-to-one style API is similar to the existing socket APIs for a connection-oriented
protocol, such as TCP. The one-to-many style API facilitates simultaneous associations
with multiple peers using one end point (that is, it associates with multiple peers using
one socket file descriptor simultaneously).
These socket API styles share common data structures and operations. However, each
socket API style requires a different application programming style. You can use these
socket APIs to implement all the SCTP features. You can also select the API style
depending on the type of association you need in the application.
This section addresses the following topics:
“One-to-One Socket APIs” (page 42)
“Basic One-to-One Call Flow Sequence” (page 43)
“One-to-Many Socket APIs” (page 48)
“Basic One-to-Many Call Flow Sequence” (page 48)
One-to-One Socket APIs
The one-to-one style socket APIs are designed to enable the existing TCP applications
to migrate to SCTP with minimal changes. The sequence of socket calls made by the
client and server of a one-to-one style SCTP application is similar to the sequence of
socket calls made by a TCP application. A one-to-one style SCTP application can control
only one association using one file descriptor.
42 SCTP Socket APIs