International Engineering Consortium
Web ProForums
Stream Control Transmission Protocol (SCTP)

6. SCTP Application Programming Interface (API)

Transport protocols in IP networks, such as TCP and UDP, benefit from the sockets API. A sockets API provides a standard design interface across diverse operating systems and multiple platforms. This section describes the socket's API that is used to introduce SCTP services into TCP and UDP based applications.

In the following applications, the active primary endpoint that issues establishment requests has been denoted as the "client." The passive endpoint that receives establishment requests has been denoted as the "server."

UDP–Style Interface

The UDP–style interface accepts inbound association automatically and supports the delivery of complete messages. In addition, individual interfaces use a set of calls that execute the responses. In an SCTP association, the client and the server use these calls to establish an association. Table 2 describes the functions of UDP–style-interface calls in sequence.

Sq CALLS DEFINITION
1 socket () The socket() call creates a socket descriptor to represent SCTP endpoint.
2 bind() The bind() call designates the primary address from the list of local addresses.
3 setsocketopt() The setsocketopt() call sets the default association parameters.
4 rcvmsg() The rcvmsg() call requests that data be received from the endpoint.
5 sendmsg() The sendmsg() call requests that data be transmitted to the endpoint.
6 close() The close() call performs a graceful shutdown.

Table 2: UDP–Style-Interface Calls for the Server to Prepare Itself for Servicing Requests

The client uses the same interface calls listed in Table 2 except for possibly bind() and setsocketopt() calls, which are handled by the server. In case the client or server wants to divert an existing association to a separate socket, the sctp_peeloff() call is available.

TCP–Style Interface

Since TCP connections are more prevalent in IP networks, the TCP–style interface enables connection oriented protocols to be linked with SCTP. Similar to the UDP–style interface, the client and server execute calls in the sequence described in Table 3.

Sq CALLS DEFINITION
1 socket () The socket() call generates a socket descriptor corresponding to an SCTP endpoint.
2 bind() The bind() call is used to bypass the primary address associated with the SCTP endpoint.
3 listen() The listen() call prepares the SCTP endpoint to receive inbound associations.
4 accept() The accept() call blocks the endpoint until a new association is initialized and a new socket descriptor is returned.
5 close() The close() call is used to terminate an association.

Table 3: TCP–Style Interface Calls for the Server to Prepare itself for Servicing Requests

While the server executes the calls described in Table 3, the client uses a separate set of calls to set up an association with a server. These calls are listed in sequence in Table 4.

Sq CALLS DEFINITION
1 socket () The socket() call generates a socket descriptor corresponding to the SCTP endpoint.
2 connect() The connect() call is used to initiate an association with the peer endpoint.
3 sendmsg() The sendmsg() call is used to send a request to the server.
4 recvmsg() The recvmsg() call is used to receive messages from the server.
5 close() The close() call is used to terminate an association.

Table 4: TCP–Style-Interface Calls for the client to set up an association with a server.

The API sendmsg() and recvmsg() calls contain unique data structures that control endpoints and provide access to supplementary information.

Registered Users
Enjoy exclusive access to free On-Line Education and receive the biweekly IEC newsletter.

IEC Newsletter
Get the latest industry information including critical insights from key industry leaders, technology briefings, and an Analyst Corner.
Current
Subscribe

Newsroom

IEC Corporate Member

Advertising Kit