SCTP socket APIs
The features of SCTP socket APIs include consistency, accessibility, and compatibility.
- 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
- 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.
- socket()
- bind()
- listen()
- recvmsg()
- sendmsg()
- close()
A typical client uses the following sequence of socket API calls:
- socket()
- sendmsg()
- recvmsg()
- 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.