SCTP socket APIs

The features of SCTP socket APIs include consistency, accessibility, and compatibility.

SCTP Socket APIs were designed to provide the following features:
  • Maintain consistency with existing socket APIs
  • Provide a base for access to new SCTP Features
  • Provide compatibility so that most existing TCP and UDP applications can be migrated to SCTP with few changes
In order to facilitate easy migration of existing TCP and UDP applications, two different styles of SCTP APIs have been formulated:
  • UDP-Style API – Semantics are similar to that defined for connectionless protocols like UDP
  • TCP-Style API – Semantics are similar to that defined for connection-oriented protocols like TCP

Though SCTP allows for both TCP and UDP style of socket APIs to be defined and used, in AIX 5.3, only support for UDP-style socket syntax is provided because the UDP-style API provides more flexibility in accessing new features of SCTP. Using the UDP-style API a typical server uses the following sequence of calls during the lifetime of an association.

  1. socket()
  2. bind()
  3. listen()
  4. recvmsg()
  5. sendmsg()
  6. close()

A typical client uses the following sequence of socket API calls:

  1. socket()
  2. sendmsg()
  3. recvmsg()
  4. close()

The associations created using the above call sequence are called explicitly created associations. An association can be created implicitly after creating a socket, by simply calling sendmsg(), recvmsg() or sendto() and recvto(). In the case of implicit association, the bind() and listen() calls are not required. The syntax of all these system calls are similar to those used with UDP sockets. For the socket subroutine, the Type field should be set to SOCK_SEQPACKET and the Protocol field should be IPPROTO_SCTP. In addition to these standard socket APIs SCTP provides two new APIs: sctp_peeloff() and sctp_opt_info(). More information about the use of Socket API for SCTP can be found in the SCTP Socket API Draft. SCTP has been implemented as a kernel extension in AIX 5.3. A user can use the sctpctrl command to load and unload the SCTP kernel extension.

In addition, this command can also be used to view and change various other statistics and tunable parameters of the SCTP kernel extension using different options like get and set.