SCTP(7)

NAME
sctp - Stream Control Transmission Protocol (SCTP).

SYNOPSIS
#include <sys/socket.h>
#include <netinet/in.h>
sctp_socket = socket(PF_INET, SOCK_SEQPACKET, 0);
sctp_socket = socket(PF_INET, SOCK_SEQPACKET, IPPROTO_SCTP);
sctp_socket = socket(PF_INET, SOCK_STREAM, IPPROTO_SCTP);
sctp_socket = socket(PF_INET, SOCK_RDM, IPPROTO_SCTP);

DESCRIPTION

SCTP is an implementation of the SCTP (Stream Transmission Control Protocol) defined in RFC 2960. SCTP provides reliable delivery of ordered or unordered packets over a full duplex connection between two SOCK_SEQPACKET sockets on top of ip(7). SCTP can guarantee that the data arrives in order on a stream, if requested, and retransmits lost packets. It generates and checks a per packet checksum to catch transmission errors.

SCTP provides the following socket types:

SOCK_SEQPACKET
    A standard SOCK_SEQPACKET socket that preserves message boundaries, Nagles at the association level, and provides ordered and unordered reliable and partial reliable, acknowledged and unacknowledged delivery on multiple streams.

SOCK_STREAM
    A tcp(7) compatible SOCK_STREAM socket that does not preserve message boundaries, Nagles at the stream level, and provides ordered and out-of-band unacknowledged delivery on a single stream. This is an optional capability of SCTP which provides for maximum compatibility with applications written for tcp(7). This socket type is available when SCTP is compiled with the kernel configuration parameter CONFIG_SCTP_TCP_COMPATIBLE set.

SOCK_RDM
    A udp(7) compatible SOCK_RDM socket that preserves message boundaries, does not Nagle, and provides only unordered but reliable or partially reliable delivery on multiple streams. This is an optional capability of SCTP which provides for maximum compatibility with applications written for rudp(7). This socket type is available when SCTP is compiled with the kernel configuration parameter CONFIG_SCTP_UDP_COMPATIBLE set.

  Connection Establishment

A fresh SCTP socket has no remote or local address and is not fully specified. To create an outgoing SCTP association use connect(2) to establish an association with another SCTP endpoint. To receive incoming associations bind(2) the socket first to a number of local addresses and a port and then call listen(2) to put the socket into listening state. Then a new socket for each incoming association can be accepted using accept(2). A socket that has had accept(2) or connect(2) successfully called on it is fully specified and may transmit data. Data cannot be transmitted on listening or not yet connected sockets.

SCTP supports large windows to support links with high latency or bandwidth. Large SCTP windows can be used by increasing the send and receive buffer sizes. They can be set globally with the net.core.wmem_default and net.core.rmem_default system controls, or on individual sockets by using the SO_SNDBUF and SO_RCVBUF socket options. The maximum sizes for socket buffers are limited by the net.core.wmem_max and net.core.rmem_max system controls. See socket(7) for more information.

  Sending Data

When sending data, the specific destination address within the association to which to send the data can be specified by providing a valid destination address as an argument to sendto(2) or sendmsg(2). Data sent with send(2) or write(2) will use SCTP's destination transport address selection policies for transmission and retransmission to single- and multi-homed hosts. The stream upon which to send the data can also be set with the SCTP_SID socket option on a socket basis with setsockopt(2) or on a per-message basis with SCTP_SID control message to sendmsg(2). In addition, the ip(7) IP_PKTINFO option can be used with sendmsg(2) to specify the interface, first-hop destination address and source address to be used in the outbound packet on SOCK_SEQPACKET and SOCK_RDM sockets. IP options can also be specified for the outbound packet with the ip(7) IP_OPTIONS or IP_RETOPTS control messages to sendmsg(2).

For SOCK_SEQPACKET socket, send operations may also use the MSG_MORE flag when sending with send(2), sendto(2) or sendmsg(2) to indicate that the next write operation will provide additional data belonging to the same packet. SOCK_STREAM sockets do not support send options and do not return the MSG_TRUNC flag on send operations.

If a SOCK_SEQPACKET or SOCK_STREAM socket does not have sufficient room to buffer the sent data, it buffers what it can and returns the amount of user data buffered. SOCK_RDM sockets wait for sufficient room to buffer the entire sent packet before returning. SOCK_SEQPACKET and SOCK_STREAM sockets will segment large data writes in to smaller segments for delivery to the peer.

SCTP provides a mechanism for receiving positive and negative acknowledgments of sent data on SOCK_SEQPACKET and SOCK_RDM sockets. When the socket option SCTP_DISPOSITION is set to SCTP_DISPOSITION_ACKED, or when data is sent using the MSG_CONFIRM flag to send(2), sendto(2) or sendmsg(2), message confirmation or delivery failures can be received by passing the MSG_CONFIRM flag to recv(2), recvfrom(2) or recvmsg(2). This mechanism also provides for retrieval and disposition of undelivered messages after the association has aborted or shut down, but before a call to close(2).

  Receiving Data

For SOCK_SEQPACKET and SOCK_RDM sockets, all receive operations return only one packet, or a portion of one packet. When the packet is smaller than the passed buffer only that much data is returned, when it is larger the packet is truncated and the MSG_TRUNC flag is set for SOCK_RDM sockets. Subsequent recv or read(2), or a subsequent recvfrom(2) or recvmsg(2) for the same stream will return the remainder of the packet for SOCK_SEQPACKET sockets. SOCK_SEQPACKET sockets also return the MSG_EOR flag when the end of the packet has been received successfully. For SOCK_STREAM sockets, all receive operations return only the amount of data available on the current stream. MSG_TRUNC and MSG_EOR are never set for SOCK_STREAM sockets.

IP options may be sent or received using the socket options described in ip(7). They are only processed by the kernel when the appropriate system control is enabled (but still passed to the user even when it is turned off). See ip(7).

When the MSG_DONTROUTE flag is set on sending, the destination address must refer to a local interface address and the packet is only sent to that interface.

SCTP fragments a packet when its total length exceeds the association MTU (Maximum Transmission Unit). A more network friendly alternative is to use path MTU discovery as described in the IP_PMTU_DISCOVER section of ip(7).

SCTP supports urgent data similar to tcp(7). Urgent data is used to signal the receiver that some important message is part of the data stream and that it should be processed as soon as possible. Urgent data is always sent out of order. To send urgent (or out of order) data specify the MSG_OOB option to send(2), sendto(2), or sendmsg(2). When urgent data is received, the kernel sends a SIGURG signal to the reading process or the process or process group that has been set for the socket using the FIOCSPGRP or FIOCSETOWN I/O controls. When the SO_OOBINLINE socket option is enabled, urgent data is put into the normal data stream (and can be tested for by the SIOCATMARK I/O control), otherwise it can only be received when the MSG_OOB flag is set for recvmsg(2).

  ADDRESS FORMATS
SCTP is built on top of IP (see ip(7)). The address formats defined by ip(7) apply to SCTP. SCTP uses the IPv4 sockaddr_in address format described in ip(7).

SCTP supports multiple-stream point-to-point communication within multi-homed associations; broadcasting and multi-casting are not supported.

In addition to normal IP addressing, SCTP provides extensions on the bind(2), accept(2), connect(2), getsockname(2), and getpeername(2) system calls. These functions normally take or return a single sockaddr_in as an address argument. When used in conjunction with an SCTP socket on or to a multi-homed host, these calls will accept or return an array of sockaddr_in structures. The number of addresses in the structure is indicated by the length of the structure and the protocol family of the socket. SCTP will only support one port number being specified in the address list, and each sockaddr_in structure in the list must contain the same sin_port. (Note: Linux uses MAX_SOCK_ADDR as a maximum size of the socket address length. This is currently only 128 bytes or eight (8) sockaddr_in structures. Eight (8) addresses should be sufficient for most applications.)

Multiple addresses provided to the bind(2) system call will be interpreted as multiple local addresses to provide to the peer at connection time as well as the local address/port combinations upon which a listening socket will accept incoming associations. A call to accept(2) requesting the source address of the peer will return multiple transport addresses if the connecting peer is multi-homed. Multiple addresses provided to the connect(2) system call will be interpreted as multiple destination address/port combinations to which to attempt to form an association. The getpeername(2) system call returns the list of destination address/port combinations to which the socket is connected. The getsockname(2) system call returns the list of local address/port combinations to which the socket is bound.

getsockname(2)
    A call to getsockname(2) can provide multiple bound transport addresses for a multi-homed host when the socket is bound to multiple addresses or INADDR_ANY using bind(2). The first address in the list is the primary address to which the socket is bound. This is the first address that will be attempted to be used as a source address when sending an INIT chunk to the SCTP peer as a result of a call to connect(2). Otherwise, the order of the addresses has no significance. When the socket is not bound to any address, the call to getsockname(2) returns a socket address with address family AF_UNSPEC.

    As a result of binding to INADDR_ANY or the ADD-IP extension, subsequent calls to getsockname(2) may return different addresses depending on the state of the connection or resulting from the exchange of ASCONF control chunks. This list of transport addresses returned by getsockname(2) represents the current list of local transport addresses bound to the endpoint. When the connection is multi-homed or supports ADD-IP, this behavior is different from tcp(7) and other connection-oriented protocols, whose bound address does not change during the lifespan of a connection.

getpeername(2)
    A call to getpeername(2) can provide multiple peer transport addresses for a multi-homed peer when the socket is connecting or connected to multiple addresses using connect(2). The first address is always the current primary destination transport address. The current primary destination transport address is the address to which all messages will be sent in the absence of congestion or failure.

    As a result of connecting to multiple transport addresses using connect(2) or the ADD-IP extension, the membership of the list of transport addresses returned by getpeername(2) may change due to the state of the socket or resulting from the exchange of ASCONF control chunks. When the SCTP connection is multi-homed or supports ADD-IP, this behavior is different from tcp(7) and other connection-oriented protocol, whose peer address does not change during the lifespan of a connection.

  SOCKET CALLS

Socket calls for SOCK_STREAM, SOCK_SEQPACKET and SOCK_RDM sockets are different in some respects (addressing and options) than their tcp(7) or udp(7) counterparts. These differences are described here. For common behavior, please see the indicated manual page in Section 2.

bind(2)
    A call to bind(2) can provide multiple address if the host is multi-homed. Binds to INADDR_ANY will result in a binding to all of the local transport addresses belonging to the host that do not cause a conflict at the time that a connection is formed. As with other sockets, the local port number is assigned at the time that bind(2) is called.

    As with other sockets, binding to a socket address with address family AF_UNSPEC will cause the socket to be unbound from all transport addresses.

    Consistent with tcp(7), SCTP supports binding of multiple sockets to the same transport address providing that the socket option SO_REUSEADDR (see socket(7)) is set on the sockets and that no sockets have executed listen(2) bound to the same transport address.

accept(2)
    A call to accept(2) requesting the peer address of the connection will return multiple transport addresses if the connecting peer is multi-homed. The first transport address in the list is the primary transport address of the connecting peer. The primary transport address is the address upon which the INIT message was received. Otherwise, the accept(2) operation is unchanged.

connect(2)
    A call to connect(2) can provide multiple destination transport addresses if the peer host is multi-homed. If an INIT chunk sent to the first destination transport address is not acknowledged, the next INIT chunk will be sent to the next address in the list. This will occur until an acknowledgment is received from one of the addresses or the connection attempt times out. Each address will be retried sctp_max_init_retries times before the connection process is considered to have timed out. Broadcast and multicast addresses are permitted for the call to connect(2) but will not form an endpoint address in the association. This feature permits fast and reliable initialization of associations.

    As with other connection-oriented sockets, connecting to a socket address with address family AF_UNSPEC will cause a socket engaged in active connections to be disconnected.

read(2), recv(2), recvfrom(2) and recvmsg(2)
    SCTP preserves message boundaries on read for SOCK_SEQPACKET and SOCK_RDM sockets. Message boundaries are never preserved for SOCK_STREAM sockets.

    The following message flags to, or returned from, recv(2), recvfrom(2) and recvmsg(2) have special interpretations for SCTP:

    MSG_OOB
        SCTP supports the return of the MSG_OOB flag from recv(2), recvfrom(2) and recvmsg(2). Data read with the MSG_OOB flag set indicates that the data was received on the specified SCTP stream with the Unordered bit set. Operation is similar to tcp(7).

    MSG_EOR
        For SOCK_SEQPACKET sockets, the MSG_EOR flag returned from recv(2), recvfrom(2) or recvmsg(2) indicates that the data read has been read to the end of a record. The MSG_EOR flag is not used for SOCK_STREAM or SOCK_RDM sockets.

    MSG_TRUNC
        SCTP supports the use of the MSG_TRUNC flag to recv(2), recvfrom(2) and recvmsg(2). Data read with the MSG_TRUNC flag set will return the number of bytes available in the packet rather than the number of bytes read.

        When the MSG_TRUNC flag is returned from recv(2), recvfrom(2) and recvmsg(2), it indicates that the record was truncated. MSG_TRUNC will only be returned on SOCK_RDM sockets. MSG_TRUNC is never set on return for SOCK_STREAM and SOCK_SEQPACKET sockets.

    MSG_CONFIRM
        SCTP supports the use of the MSG_CONFIRM flag to recv(2), recvfrom(2) and recvmsg(2). Data read with the MSG_CONFIRM flag set will return messages receipt acknowledgments as well as messages which have exceeded their life-times, messages which have been dropped by PR-SCTP, and messages held for retrieval after abort or shutdown.

        When the MSG_CONFIRM flag is returned from recv(2), recvfrom(2) and recvmsg(2), it indicates that the read data represents data that was confirmed as acknowledged by the peer. See also SCTP_DISPOSITION under SOCKET OPTIONS.

    Other message flags have the same interpretation as described in recv(2), recvfrom(2) and recvmsg(2).

write(2), send(2), sendto(2) and sendmsg(2)
    SCTP preserves message boundaries on write for SOCK_SEQPACKET and SOCK_RDM sockets. Message boundaries are never preserved for SOCK_STREAM sockets.

    The following message flags to send(2), sendto(2) and sendmsg(2) have special interpretations for SCTP:

    MSG_OOB
        SCTP supports the use of the MSG_OOB flag to send(2), sendto(2) and sendmsg(2). Data written with the MSG_OOB flag set indicates that the data is to be sent on the specified SCTP stream with the Unordered bit set.

    MSG_MORE
        SCTP supports the use of the MSG_MORE flag to send(2), sendto(2) and sendmsg(2). Data written with the MSG_MORE flag set indicates that the data of a subsequent send operation on the same stream contains additional data belonging to the same record. Use of the MSG_MORE flag is only supported for SOCK_SEQPACKET sockets. Data written with write(2) is assumed to contain an entire record.

    MSG_PROBE
        SCTP supports the use of the MSG_PROBE flag to send(2), sendto(2) and sendmsg(2). Data written with the MSG_PROBE flag set indicates that the data is to be used to fill out the heartbeat data in a HEARTBEAT chunk and request that SCTP send a HEARTBEAT to the peer. Use of the MSG_PROBE flag is supported on all socket types.

    MSG_EOF
        SCTP supports the use of the MSG_EOF flag to send(2), sendto(2) and sendmsg(2). Data written with the MSG_EOF flag will be the last data sent on the association and then a shutdown initiated.

    MSG_CONFIRM
        SCTP supports the use of the MSG_CONFIRM flag to send(2) sendto(2) and sendmsg(2) for SOCK_SEQPACKET and SOCK_RDM sockets. Records or packets written with the MSG_CONFIRM flag set are marked for acknowledgment. Acknowledgments can be received with the MSG_CONFIRM flag to recv(2), recvfrom(2) and recvmsg(2) as described above. See also SCTP_DISPOSITION under SOCKET OPTIONS.

    Other message flags have the same interpretation as described in send(2), sendto(2) and sendmsg(2).

shutdown(2) and close(2)
    SCTP supports orderly release using shutdown(2) and both orderly and abortive release using close(2) similar to tcp(7).

    When the SHUT_RD flag is given to shutdown(2), receive will be disabled locally and further receive operations on the socket will fail. When the SHUT_WR or SHUT_RDWR flag is given to shutdown(2), orderly release will be initiated and further send operations on the socket will fail.

    Distinctions between orderly and abortive release when close(2) or exit(2) are called are similar to that of tcp(7).

  FEATURES

SCTP provides the following basic features:

•   Compiled into kernel or as a loadable module.

•   Standards support for socket type SOCK_SEQPACKET.

•   Supports a partial packet delivery interface on all packets. MSG_TRUNC set when receiving a packet does not discard the remainder of the packet but permits subsequent reads to read the remainder of the packet.

•   Silly Window Syndrome (SWS) avoidance per RFC 1122 Section 4.2.3.2 and 4.2.3.3 as recommended in the SCTP Implementor's Guide.

•   Nagle algorithm per RFC 896 and RFC 1122 Section 4.2.3 with delayed ACK modifications presented by Minshall in draft-minshall-tsvwg-nagle-01.txt.

•   Message disposition and retrieval on connection shutdown or abort, lifetime expiry, and receipt confirmation acknowledgment.

•   Support for hardware assisted checksum for drivers which support NETIF_F_HW_CSUM.

•   Support for hardware assisted scatter/gather and fragmentation for devices which support NETIF_F_SG and NETIF_F_FRAGLIST.

•   For security of HMACs, SCTP includes a re-keying algorithm for secret keys that rotates secret keys after the key's first cookie lifetime to provide for maximum security for HMACs.

•   High performance routing algorithm alters multi-homed routes on a per-packet basis.

•   Wide range of settings for timers and protocol parameters permitting fast (average 5ms with 100Hz tick clock; 0.5ms with 1000Hz tick clock) failover between failed destination addresses on high-speed networks.

•   Deferral of checksum calculation until after socket lookup for protection from software checksum DoS attacks.

•   Support for the changes and modifications in the SCTP Implementers Guide (draft-ietf-tsvwg-sctpimpguide-08.txt). (See CAVEATS.).

SCTP provides the following added features:

•   A tcp(7)-compatible mode for sockets of type SOCK_STREAM when SCTP is compiled with kernel configuration parameter CONFIG_SCTP_TCP_COMPATIBLE set.

•   A udp(7)-compatible mode for sockets of type SOCK_RDM when SCTP is compiled with kernel configuration parameter CONFIG_SCTP_UDP_COMPATIBLE set.

•   Support for both Adler32 and CRC-32c checksums with automatic detection of checksum on receive when SCTP is compiled with kernel configuration parameters CONFIG_SCTP_ADLER_32 or CONFIG_SCTP_CRC_32C set.

•   Support for multiple HMAC types when compiled with kernel configuration parameters CONFIG_SCTP_HMAC_SHA_1 or CONFIG_SCTP_HMAC_MD5.

•   Support for RFC 2960 Appendix A and RFC 3168 compatible Explicit Congestion Notification when compiled with kernel configuration parameter CONFIG_SCTP_ECN set.

•   Support for draft-ietf-tsvwg-addip-sctp-07.txt Adaptation Layer Indication when compiled with kernel configuration parameter CONFIG_SCTP_ADAPTATION_LAYER_INFO set.

•   Support for ADD-IP extensions from draft-ietf-tsvwg-addip-sctp-07.txt when compiled with kernel configuration parameter CONFIG_SCTP_ADD_IP set.

•   Support for PR-SCTP extensions as described in draft-stewart-tsvwg-prsctp-03.txt when compiled with kernel configuration parameter CONFIG_SCTP_PARTIAL_RELIABILITY set.

SYSCTLS

SCTP provides and supports a number of system controls that can be accessed using the /proc/sys/net/ipv4/* files, with the sysctl(2) interface or using sysctl(8).

SCTP supports all socket(7) system controls rmem_default, rmem_max, wmem_default, wmem_max, msg_cost, msg_burst, netdev_max_backlog and optmem_max in the normal fashion. For more information, see socket(7).

SCTP supports ip(7) system controls ip_default_ttl, ip_dynaddr, ip_autoconfig, ip_local_port_range and ip_no_pmtu_disc in the normal fashion. ip(7) system controls ip_forward, ipfrag_high_thresh, ipfrag_low_thresh and ip_always_defrag are not applicable to SCTP. For more information, see ip(7).

The following SCTP specific system controls are provided by SCTP:

sctp_checksum_algorithm
    Defines the default checksum algorithm that will be used when checksumming packets associated with a socket. Valid values are as follows:

    SCTP_CSUM_ADLER_32
        for the RFC 2960 Appendix B algorithm. To set this value, SCTP must have been compiled with CONFIG_SCTP_ADLER_32 or without CONFIG_SCTP_CRC_32C. When computed in software, Adler 32 checksum algorithm is more amenable to Van Jacobson partial checksum and copy from user approaches and exhibits higher performance than CRC-32c.

    SCTP_CSUM_CRC_32C
        for the RFC 3309 CRC-32c checksum algorithm. To set this value, SCTP must have been compiled with CONFIG_SCTP_CRC_32C. When computed in software, CRC-32c checksum is more processor intensive than Adler-32.

    As RFC 3309 has been approved and replaces RFC 2960 checksum algorithm, the default value for this system control is now SCTP_CSUM_CRC_32C. This value may also be set for a given socket using the SCTP_CKSUM_TYPE socket option as described in SOCKET OPTIONS. This system control will soon be deprecated, should always be set to SCTP_CSUM_CRC_32C and should not be used by portable programs.

sctp_mac_type
    Defines the default MAC (Message Authentication Code) type that will be used when signing cookies in INIT-ACK messages. Valid values are:

    SCTP_HMAC_SHA_1
        for the FIPS 180-1 Secure Hash Algorithm SHA-1 HMAC. SHA-1 performs well on big-endian machines. This option setting is only supported if SCTP was compiled with the kernel configuration parameter CONFIG_SCTP_HMAC_SHA1 set.

    SCTP_HMAC_MD5
        for the RFC 1321 Message Digest 5 HMAC. MD5 performs well on little-endian machines. This option setting is only supported if SCTP was compiled with the kernel configuration parameter CONFIG_SCTP_HMAC_MD5 set.

    SCTP_HMAC_NONE
        for no secure signature. Not signing the cookie performs well on all machines; however, this option should only be used if some other mechanism provides security (such as IPSec) or the system is closed and trusted. This option setting is always supported.

    There is no required or recommended value in RFC 2960. The default value is (in priority of availability) SCTP_HMAC_MD5, SCTP_HMAC_SHA_1, then SCTP_HMAC_NONE. This system control defines the default for new sockets. The MAC for a given socket can be changed before the call to listen(2), or before receiving a passive connection attempt, with the socket option SCTP_MAC_TYPE as described under SOCKET OPTIONS.

sctp_valid_cookie_life
    Defines the default time interval (in milliseconds) in conjunction with sctp_cookie_inc beyond which a COOKIE-ECHO received with a cookie sent in a INIT-ACK will not longer be accepted. For SCTP, this also limits the default maximum time interval for which the HMAC secret key for the cookie will be valid. Valid values are zero (0) or greater (MAXINT). Values of zero (0) will be converted to a Linux system clock tick (1000/HZ milliseconds). The default value is the value recommended in RFC 2960 (60,000 milliseconds). This system control defines the default for new sockets. The value for a given socket can be changed with the socket option SCTP_COOKIE_LIFE before a call to listen(2), or before receiving passive connection attempt, as described under SOCKET OPTIONS.

    Reducing this value will increase the chances that passive connection attempts will fail due to expired cookies. Increasing the value will reduce the overall security of the system by permitting attackers and increased interval to crack HMACs and guess verification tags. This value may be adjusted in conjunction with sctp_cookie_inc to meet most objectives for successful passive connection attempts with the best security afforded by smaller values of sctp_valid_cookie_life.

    Unfortunately the SCTP_COOKIE_LIFE and SCTP_COOKIE_INC must be adjusted to accommodate the slowest peer on the slowest connection. The default setting is adequate for Internet applications.

sctp_cookie_inc
    Defines the default time increment (in milliseconds) that will be added to the lifespan of the cookie in an INIT ACK if the received INIT requests cookie preservative to lengthen the lifespan of the cookie. Valid values are zero (0) or greater (MAXINT). The default value is the value recommended in RFC 2960 5.2.6 (1,000 milliseconds). This system control defines the default for new sockets. The cookie lifetime increment for a given socket can be changed before a call to listen(2), or before receiving a passive connection attempt, with the socket option SCTP_COOKIE_INC as described under SOCKET OPTIONS.

    This value can be adjusted in conjunction with sctp_valid_cookie_life, above, to meet objectives of successful passive connection attempts and security. The default setting is adequate for Internet applications.

sctp_throttle_itvl
    Defines the default time interval (in milliseconds) within which the receiver will not accept more than one INIT or COOKIE ECHO. Zero (don't throttle) is a valid value. The default value is 50 milliseconds. This system control defines the default for new sockets. The throttle interval for a given socket can be changed before the call to listen(2), or before a passive connection attempt, with the socket option SCTP_THROTTLE_ITVL as described under SOCKET OPTIONS.

    When the HMAC type is SHA-1 or MD5, and when CRC-32c software checksum is used, the implementation is particularly vulnerable to DoS flood attacks using bogus INIT or COOKIE ECHO messages. When SCTP is compiled with CONFIG_SCTP_THROTTLE_PASSIVEOPENS, this permits the throttling of INIT and COOKIE ECHO messages. Only one INIT and one COOKIE ECHO message will be accepted in the interval set by this control.

sctp_max_istreams
    Defines the default maximum number of inbound streams that will be requested when forming or receiving connections on a socket. Valid values are in the range from 1 to 65,535 streams. This system control defines the default for new sockets. The actual value used by a socket for both outgoing and incoming connections can be changed with the socket option SCTP_ISTREAMS before a call to connect(2) or accept(2) as described under SOCKET OPTIONS.

    Usable default values for sctp_max_istreams are highly dependent upon the intended applications. SIGTRAN UAs, for example, seldom need more than 257 inbound or outbound streams. The default valid is set to thirty-three (33) streams for SOCK_SEQPACKET sockets. This system control only affects SOCK_SEQPACKET sockets: SOCK_STREAM sockets always have both inbound and outbound streams set to one (1).

sctp_req_ostreams
    Defines the default requested number of outbound streams that will be requested when forming or receiving connections on a socket. Valid values are in the range from 1 to 65,535 streams. This system control defines the default for new sockets. The actual value used by a socket for both outgoing and incoming connections can be changed with socket option SCTP_OSTREAMS before a call to connect(2) or accept(2) as described under SOCKET OPTIONS.

    Usable default values for sctp_max_istreams are highly dependent upon the intended applications. SIGTRAN UAs, for example, seldom need more than 257 inbound or outbound streams. The default valid is set to one (1) streams for SOCK_SEQPACKET sockets. This system control only affects SOCK_SEQPACKET sockets: SOCK_STREAM sockets always have both inbound and outbound streams set to one (1).

sctp_ecn
    Defines a default flag that allows disabling of Explicit Congestion Notification (ECN) operation for SCTP when cleared. This system control defines the default for new sockets. ECN can be overridden on a per-socket basis with the socket option SCTP_ECN, as described under SOCKET OPTIONS. For this system control to have any effect, the kernel must have been compiled with both kernel configuration parameters CONFIG_INET_ECN and CONFIG_SCTP_ECN set.

sctp_adaptation_layer_info
    Defines the default adaptation layer information flags that will be sent in an INIT or INIT-ACK message. Valid values include any 32-bit unsigned integer. The default value for backward compatibility is zero (0) which indicates to not send the Adaptation Layer Information parameter in INIT and INIT-ACK. This system control defines the default for new sockets. The actual value for both outgoing and incoming connections can be changed with socket option SCTP_ALI before a call to connect(2) or listen(2), or before a passive connection indication on a listening socket, as described under SOCKET OPTIONS. For this system control to have any effect, the kernel must have been compiled with kernel configuration parameter CONFIG_SCTP_ADAPTATION_LEVEL_INFO set.

sctp_partial_reliability
    Defines the default partial reliability preference that will be used for the socket. Valid values include zero (0) - no partial reliability reported, one (1) partial reliability support preferred but not required, and two (2), partial reliability support required. The default value for backward compatibility is zero (0). This system control defines the default for new sockets. The actual value for both outgoing and incoming connections can be changed with socket option SCTP_PR before a call to connect(2) or listen(2), or before a passive connection indication on a listening socket, as described under SOCKET OPTIONS. For this system control to have any effect, the kernel must have been compiled with kernel configuration parameter CONFIG_SCTP_PARTIAL_RELIABILITY set.

sctp_wmem
    Defines three values (lower, default, upper) for the socket write buffer. The value associated with a given socket can also be changed with the SO_SNDBUF option, see socket(7).

sctp_rmem
    Defines three values (lower, default, upper) for the socket read buffer. The value associated with a given socket can also be changed with the SO_RCVBUF option, see socket(7).

sctp_max_init_retries
    Defines the default number of times that an INIT or COOKIE-ECHO will be resent to a given destination before abandoning an active open attempt. Valid values are zero (0) or greater (MAXINT). The default value is the value recommended in RFC 2960 (8 retries). This system control defines the default for new sockets. The value for a given socket can be changed with the socket option SCTP_MAX_INIT_RETRIES as described under SOCKET OPTIONS.

sctp_max_burst
    Defines the default maximum number of MTUs of new data chunks that will be sent in a burst in accordance with draft-ietf-tsvwg-sctpimpguide-08.txt. Valid values are one (1) or greater (MAXINT). The default value is the value recommended in draft-ietf-tsvwg-sctpimpguide-08.txt (4 MTUs). This system control defines the default for new sockets. The value for a given socket can be changed with the socket option SCTP_MAX_BURST as described under SOCKET OPTIONS.

sctp_assoc_max_retrans
    Defines the number of times that the sending endpoint will attempt retransmitting a packet on any active destination transport address before it aborts the association. Valid values are zero (0) or greater (MAXINT). The default value is the value recommended in RFC 2960 (10 retries). This system control defines the default for new sockets. The value for a given socket can be changed with the socket option SCTP_ASSOC_MAX_RETRANS as described under SOCKET OPTIONS.

    This value should be larger than the sum of the sctp_path_max_retrans values of each of the destinations. Setting this value to less that sum of the sctp_path_max_retrans values for all of the destinations has the interesting effect of permitting a connection to persist even when all destinations have been deemed inactive.

sctp_max_sack_delay
    Defines the default interval of time (in milliseconds) that the sending endpoint is permitted to delay an acknowledgment of received data. Valid values are in the range from zero (0) to 500 milliseconds. (RFC 2960 forbids setting this value larger than 500 milliseconds.) The default value is the value recommended in RFC 2960 (200 milliseconds). This system control defines the default for new sockets. The value for a given socket can be changed with the socket option SCTP_SACK_DELAY as described under SOCKET OPTIONS.

sctp_rto_min
    Defines the default time interval (in milliseconds) that will be used as a RTO (Retransmission Time Out) value when sending packets to a destination transport address. Valid values are zero (0) or greater (MAXINT) and must be less than or equal to both sctp_rto_initial and sctp_rto_max. The default value is the value recommended in RFC 2960 (1,000 milliseconds). The actual value used can be changed with the socket option SCTP_RTO_MIN before a call to connect(2) or accept(2) or before a new destination transport address is added by the peer. After a socket is connected or a destination transport address has been added, the destination-specific value can be changed using the socket option SCTP_RTO as described under SOCKET OPTIONS.

    In general, sctp_rto_min should not be less than the peer's sctp_max_sack_delay. Otherwise, excessive retransmissions might occur while the peer is delaying acknowledgments.

sctp_rto_initial
    Defines the default time interval (in milliseconds) that will be used as an initial RTO (Retransmission Time Out) value when sending packets to a destination for the first time, or after the destination has been idle for some time. Valid values are zero (0) or greater (MAXINT) and must be in the range from sctp_rto_min to sctp_rto_max. The default value is the value recommended in RFC 2960 (3,000 milliseconds). This system control defines the default for new sockets. The actual value used can be changed with the socket option SCTP_RTO_INITIAL before a call to connect(2) or accept(2) or before a new destination transport address is added by the peer. After a socket is connected or a destination transport address has been added, the destination-specific value can be changed using the socket option SCTP_RTO as described under SOCKET OPTIONS.

    In general, sctp_rto_initial should not be less than the peer's sctp_max_sack_delay. Otherwise, excessive retransmissions might occur while the peer is delaying acknowledgments.

sctp_rto_max
    Defines the default time interval (in milliseconds) that will be used as a maximum RTO (Retransmission Time Out) value when sending packets to a destination. Valid values are zero (0) or greater (MAXINT) and must be greater than or equal to both sctp_rto_min and sctp_rto_initial. The default value is the value recommended in RFC 2960 (60,000 milliseconds). This system control defines the default maximum for new sockets. The actual value used can be changed with the socket option SCTP_RTO_MAX before a call to connect(2) or accept(2) or before a new destination transport address is added by the peer. After an socket is connected or a destination transport address has been added, the destination-specific value can be changed using the socket option SCTP_RTO as described under SOCKET OPTIONS.

    In general, sctp_rto_initial should not be less than the peer's sctp_max_sack_delay. Otherwise, excessive retransmissions might occur while the peer is delaying acknowledgments.

sctp_path_max_retrans
    Defines the default number of times that SCTP will attempt retransmitting a packet on to a given destination transport address before it considers that destination transport address inactive. Valid values are zero (0) or greater (MAXINT). The default value is the value recommended in RFC 2960 (5 retries). This system control defines the default maximum for new sockets. The actual value used can be changed with the socket option SCTP_PATH_MAX_RETRANS before a call to connect(2) or accept(2) or before a new destination transport address is added by the peer. After a socket is connected or a destination transport address has ben added, the destination-specific value can be changed using the socket option SCTP_RTO as described under SOCKET OPTIONS.

    Adjusting this value has an effect on the period of time taken to fail-over between destinations for multi-homed connections. Lower values (including zero) will yield faster fail-over response times. Lower values, however, may cause thrashing between destinations contributing to congestion in the network. Default values are applicable to Internet applications.

sctp_heartbeat_itvl
    Defines the default interval (in seconds) between successive HEARTBEAT messages used to probe destination transport address for RTT calculation and activity. Valid values are 1 second or greater. The default value is the value recommended in RFC 2960 (30 seconds). This system control defines the default for new sockets. The actual value used can be changed with the socket option SCTP_HEARTBEAT_ITVL before a call to connect(2) or accept(2) or before a new destination transport address is added by the peer. After a socket is connected or a destination transport address has been added, the destination-specific value can be changed using the socket option SCTP_HB as described under SOCKET OPTIONS.

    If the kernel configuration parameter CONFIG_SCTP_THROTTLE_HEARTBEATS is set, then half this value is also used for throttling heartbeats. Then only two heartbeats per interval are permitted, any additional heartbeats are discarded.

SOCKET_OPTIONS
To set or get a socket option, call getsockopt(2) to read or setsockopt(2) to write the option with the socket level argument set to SOL_SCTP. In addition, most SOL_SOCKET and SOL_IP socket options are valid on SCTP sockets. For more information see socket(7) and ip(7).

The following SOL_SOCKET socket(7) socket options are supported by SCTP:

SO_KEEPALIVE
    Set or get a flag that controls heartbeats for the entire association. See socket(7) for additional information.

    Normally SCTP is required to send HEARTBEAT chunks on a per-destination basis. Clearing this flag (setting SO_KEEPALIVE to zero) disables exchanging heartbeats on an association level. Exchanging heartbeats is an essential part of the Stream Control Transmission Protocol (SCTP). It is required for clearing retransmission counts against destinations that otherwise will not be cleared if no data is sent and acknowledged to that destination. Disabling heartbeats is provided for in the SCTP specifications (RFC 2960); however, disabling heartbeats is not recommended. This is in contrast to tcp(7) that only rarely heartbeats and for which heartbeats are neither an essential nor necessary part of the protocol.

    Heartbeats can also be enabled or disabled on a destination basis using the SCTP_HB socket option. It is also possible to generate a HEARTBEAT under user control by sending heartbeat data with the MSG_PROBE flag set using send(2), sendto(2) or sendmsg(2).

SO_OOBINLINE
    If this option is enabled, out of order data that has been received on a stream will be placed between the ordered data for that stream. Otherwise, out of order data is only returned on a read call when the MSG_OOB flag is set when receiving. This option is ignored for SOCK_RDM sockets and only applies to SOCK_STREAM and SOCK_SEQPACKET sockets. See socket(7) for additional information.

SO_BINDTODEVICE
    Binds the socket to a particular device. This is not yet supported for SCTP; however, support for it is planned for the future. See socket(7) for additional information.

SO_REUSEADDR
    Supported by SCTP without modification; however, consideration is made for binding of multiple transport addresses. See socket(7) for additional information.

SO_RCVLOWAT, SO_SNDLOWAT, SO_RCVTIMEO, SO_SNDTIMEO, SO_DEBUG, SO_TYPE, SO_DONTROUTE, SO_SNDBUF, SO_RCVBUF, SO_LINGER, SO_PRIORITY and SO_ERROR
    These socket options are supported by SCTP without modification. See socket(7) for additional information.

The following SOL_IP ip(7) socket options are supported by SCTP:

IP_OPTIONS
    Set or get the IP options to be sent with every packet from this socket. See ip(7) for additional information.

IP_PKTINFO
    Pass an IP_PKINFO ancillary message that contains the pktinfo structure that supplies some information about the incoming or outgoing packet. This only works for SOCK_SEQPACKET and SOCK_RDM sockets. It is ignored for SOCK_STREAM sockets. For setsockopt(2) and getsockopt(2), the argument is a flag that tells the socket whether the IP_PKTINFO message should be passed or not. The message itself can only be sent or retrieved as a control message with a packet using recvmsg(2) or sendmsg(2).

    struct in_pktinfo {
            unsigned int    ipi_ifindex;    /* Interface index      */
            struct in_addr  ipi_spec_dst;   /* Local address        */
            struct in_addr  ipi_addr;       /* Header Dest Address  */
    };

    ipi_ifindex
        is the unique index of the interface the packet was received on, or the index of the interface upon which the packet is to be sent;

    ipi_spec_dst
        is the local address of the received packet or sent packet, and

    ipi_addr
        is the destination address in the packet header.

    If IP_PKTINFO is passed to sendmsg(2) then the outgoing packet will be sent over the interface specified in ipi_ifindex with the destination address set to ipi_spec_dst.

    This option is used to control the source (local) address of packets sent with sendmsg(2) and to retrieve the destination (local) address of packets received with recvmsg(2). See ip(7) for additional information.

    Support for IP_PKTINFO is similar to support for this socket option under udp(7). Under udp(7), IP_PKTINFO is used for multi-homed UDP hosts to specify the local address to sendmsg(2) and return remote address from recvmsg(2). SCTP uses this in a similar fashion where the choice of addresses consists of the address space of the association.

IP_RECVTOS
    Set or get the flag indicating whether the recvmsg(2) call will return the type of service field for the received packet in an ancillary message as a IP_TOS control message for sockets of type SOCK_SEQPACKET and SOCK_RDM. This option is ignored for SOCK_STREAM sockets. See ip(7) for additional information.

IP_RECVTTL
    Set or get the flag indicating whether the recvmsg(2) call will return the time to live field for the received packet in an ancillary message as a IP_TTL control message for sockets of type SOCK_SEQPACKET and SOCK_RDM. This option is ignored for SOCK_STREAM sockets. See ip(7) for additional information.

IP_RECVOPTS
    Set or get the flag indicating whether the recvmsg(2) call will return the IP options for the received packet in an ancillary message as an IP_OPTIONS control message for sockets of type SOCK_SEQPACKET and SOCK_RDM. This option is ignored for SOCK_STREAM sockets. See ip(7) for additional information.

IP_RETOPTS
    Set or get the flag indicating whether the recvmsg(2) call will return the IP options for the received packet in an ancillary message as an IP_RETOPTS control message for sockets of type SOCK_SEQPACKET and SOCK_RDM. This option is ignored for SOCK_STREAM sockets. See ip(7) for additional information.

    In contrast to IP_OPTIONS, the IP_RETOPTS ancillary message contains raw, unprocessed options, with the time stamp and route record options not filled in for this hop. It is also possible to pass an IP_RETOPTS ancillary message to sendmsg(2).

IP_TOS
    Set or get the default type of service to be used in IP packets associated with the connection. For SOCK_SEQPACKET and SOCK_RDM sockets, this option can also be passed to sendmsg(2) in the ancillary data and will be used as the type of service field in the IP packet containing the data chunk associated with the user data provided in the call to sendmsg(2). For SOCK_SEQPACKET and SOCK_RDM sockets, this option returns the type of service parameter associated with a packet in the ancillary data returned from a call to recvmsg(2) when the IP_RECVTOS option has been set on the socket. This option is ignored for SOCK_STREAM sockets. See ip(7) for additional information.

IP_TTL
    Set or get the default time to live to be used in IP packets associated with the connection. This option can also be passed to sendmsg(2) in the ancillary data and will be used as the time to live field in the IP packet containing the data chunk associated with the user data provided in the call to sendmsg(2). See ip(7) for additional information.

IP_MTU
    For SCTP sockets, this returns only the Path MTU for the association. This value is the minimum MTU of all the peer destinations. See SCTP socket options for a mechanism for obtaining MTU on a per-destination basis. When the peer is not multi-homed, this option returns the same value as would be obtained on a per-destination basis. See ip(7) for additional information.

IP_RECVERR
    For SCTP sockets, this enables extended reliable error messages with the use of SO_ERROR as for tcp(7). Error queues are not supported for SCTP (they are not supported for tcp(7) either). As for tcp(7), SCTP does not permit calling recvmsg(2) with the MSG_ERRQUEUE flag for SOCK_SEQPACKET and SOCK_STREAM sockets.

IP_PMTU_DISCOVER
    Supported for SCTP sockets without modification. See ip(7) for additional information.

The following SOL_SCTP socket options are supported: (A number of the following socket options may also be passed as an ancillary message with level SOL_SCTP when calling sendmsg(2) or returned as a control message from a call to recvmsg(2).)

SCTP_NODELAY
    Turn the Nagle algorithm off. This means that packets are always sent as soon as possible and no unnecessary delays are introduced, at the cost of more packets in the network. Expects an integer boolean flag.

    This parallels the TCP_NODELAY socket option for compatibility with tcp(7). SCTP_NODELAY and TCP_NODELAY can be used interchangeably. For SOCK_STREAM sockets, this setting applies to the default stream as set by the SCTP_SID socket option. For regular SOCK_SEQPACKET sockets, this setting applies to the entire association. For SOCK_STREAM sockets, this setting has the same effect as tcp(7). This option has no effect on SOCK_RDM sockets. See tcp(7) for additional information.

    When Nagle is enabled, SCTP uses the Nagle algorithm (RFC 896) for bundling DATA chunks into a packet. This results in far fewer short packets in the network. The algorithm is that described in RFC 896 and RFC 1122 with the Minshall modifications to accommodate delayed SACK as described in draft-minshall-nagle-01.txt. (Note: later versions of tcp(7) also in include the Minshall modification).

SCTP_MAXSEG
    Set or get the maximum segment size for outgoing packets. Values greater than the association MTU are ignored and have no effect.

    This parallels the TCP_MAXSEG socket option for compatibility with tcp(7). SCTP_MAXSEG and TCP_MAXSEG can be used interchangeably. This option is applicable to both SOCK_SEQPACKET and SOCK_STREAM sockets.

    This value determines the maximum size (in bytes) above which SCTP will fragment larger DATA chunks into smaller DATA chunks, and beneath which SCTP will bundle DATA chunks into a single packet or combine smaller DATA chunks into larger DATA chunks. Normally this value is the association MTU value minus the size of the current IP and SCTP headers, minus the size of one DATA chunk header. If the user sets this to a lower value, the lower value will be used.

SCTP_CORK
    If enabled don't send out partial frames. All queued partial frames are sent when the option is cleared again. This is useful for prefixing headers before calling sendfile(2), or for throughput optimization. This option cannot be combined with SCTP_NODELAY.

    This parallels the TCP_CORK socket option for compatibility with tcp(7). SCTP_CORK and TCP_CORK can be used interchangeably. For SOCK_STREAM sockets, this setting applies to the default stream as set by the SCTP_SIB socket option. For regular SOCK_SEQPACKET sockets, this setting applies to the entire association. This option has no effect on SOCK_RDM sockets.

SCTP_SID
    Set or get the default stream identifier for all outgoing packets associated with the connection. If SCTP_SID is passed to sendmsg(2) then the outgoing packet will be sent over the stream specified by the integer stream identifier contained in the ancillary message. If SCTP_SID is received from a call to recvmsg(2) then the incoming packet was received over the stream specified by the integer stream identifier contained in the ancillary message. See also SCTP_RECVSID.

SCTP_PPI
    Set or get the default payload protocol identifier for all outgoing packets. If SCTP_PPI is passed to sendmsg((2) then the outgoing packet will be sent with the payload protocol identifier specified by the integer payload protocol identifier contains in the ancillary message. If SCTP_PPI is received from a call to recvmsg(2) then the incoming packet was received with the payload protocol identifier specified the integer payload protocol identifier contained in the ancillary message. See also SCTP_RECVPPI.

SCTP_RECVSID
    When this flag is set, pass a SCTP_SID control message with the stream identifier for received packets as an integer in an ancillary message that may be received with recvmsg(2). Otherwise, no SCTP_SID control message will be passed with normal data. SCTP_SID is always passed for retrieved or negatively acknowledged data.

SCTP_RECVPPI
    When this flag is set, pass a SCTP_PPI control message with the payload protocol identifier for received packets as an integer in an ancillary message that may be received with recvmsg(2). Otherwise, no SCTP_PPI control message will be passed with normal data. SCTP_PPI is always passed for retrieved or negatively acknowledged data.

SCTP_HEARTBEAT_ITVL
    Set or get the time interval (in seconds) between successive HEARTBEAT messages used to probe destination transport addresses for RTT calculation and activity. Valid values are zero (0) - do not heartbeat, or a value of 1 second or greater. The default value is set by the system control sctp_heartbeat_itvl. This is the default value that will be assigned to new destinations. Active destinations can be controlled with the socket option SCTP_HB. This socket option must be set before the call to connect(2) or listen(2), or before a passive connection indication is received on a listening socket.

SCTP_HB
    Set or get the heartbeat activation and interval associated with the specified destination address. The expected value is a sctp_hbitvl structure. This option will return an error if it is attempted on a socket in the unconnected state.

        struct sctp_hbitvl {
            struct sockaddr_in
                  dest;   /* destination address      */
            uint  active; /* activation flag          */
            uint  itvl;   /* interval in milliseconds */
        };

    The sctp_hbitvl structure has the following fields:

    dest
        is a sockaddr_in structure that contains the destination address to which the heartbeat setting applies.

    active
        is an integer boolean activation flag indicating whether heartbeat is active on the destination.

    itvl
        is the integer heartbeat interval in milliseconds.

    For use with setsockopt(2), dest must be one of the valid destination addresses associated with the connection: that is, it must be one of the addresses returned from a call to getpeername(2). Note that heartbeat activity and interval can also be set on an association basis with SO_KEEPALIVE and SCTP_HEARTBEAT_ITVL.

SCTP_RTO_INITIAL
    Set or get the time interval (in milliseconds) that will be used as an initial RTO (Retransmission Time Out) value when sending packets to a destination for the first time. Valid values are zero or greater and must be within the range from SCTP_RTO_MIN to SCTP_RTO_MAX. The default value is the value set by sctp_rto_initial. This socket option must be set before the call to connect(2) or listen(2), or before a passive connection attempt, but the value may be controlled on active destination with the SCTP_RTO socket option.

SCTP_RTO_MIN
    Set or get the time interval (in milliseconds) that will be used as a minimum RTO (Retransmission Time Out) value when sending packets. Valid values are zero or greater and must be less than or equal to the value of SCTP_RTO_MAX. The default value is set by the system control sctp_rto_min. This socket option must be set before the call to connect(2) or listen(2), or before a passive connection attempt, but the value associated with active destinations can be controlled using the SCTP_RTO socket option.

SCTP_RTO_MAX
    Set or get the time interval (in milliseconds) that will be used as a maximum RTO (Retransmission Time Out) value when sending packets. Valid values are zero or greater and must be greater than or equal to the value of SCTP_RTO_MIN. The default value is set by the system control sctp_rto_max. This socket option must be set before the call to connect(2) or listen(2), or before a passive connection attempt, but the value associated with active destinations can be controlled using the SCTP_RTO socket option.

SCTP_PATH_MAX_RETRANS
    Set or get the number of times that the sending endpoint will attempt retransmitting a packet to a given destination transport address before it considers that destination transport address inactive. Valid values include zero. The default values is set by the system control sctp_path_max_retrans. This is the default value assigned to destinations before the call to connect(2) or listen(2), or before a passive connection attempt. Active destinations can be controlled with the SCTP_RTO socket option.

SCTP_RTO
    Set or get the retransmission timeout parameters associated with the specified destination address. The expected value is a sctp_rtoval structure. This option will return an error if it is attempted on a socket in the unconnected state.

        struct sctp_rtoval {
            struct sockaddr_in
                  dest;        /* destination address        */
            uint  rto_initial; /* RTO.Initial (milliseconds) */
            uint  rto_min;     /* RTO.Min     (milliseconds) */
            uint  rto_max;     /* RTO.Max     (milliseconds) */
            uint  max_retrans; /* Path.Max.Retrans (retries) */
        };

    The sctp_rtoval structure has the following fields:

    dest
        is a sockaddr_in structure that contains the destination address to which the rto parameter setting applies.

    rto_initial
        is the integer initial retransmission timeout value in milliseconds. For expected values see SCTP_RTO_INITIAL.

    to_min
        is the integer minimum retransmission timeout value in milliseconds. For expected values see SCTP_RTO_MIN.

    to_max
        is the integer maximum retransmission timeout value in milliseconds. For expected values see SCTP_RTO_MAX.

    ax_retrans
        is the integer maximum number of retransmissions. For expected values see SCTP_PATH_MAX_RETRANS.

    For use with setsockopt(2), dest must be one of the valid destination addresses associated with the connection: that is, it must be one of the addresses returned from a call to getpeername(2).

SCTP_CKSUM_TYPE
    Set or get the checksum algorithm associated with socket. Valid values are SCTP_CSUM_ADLER_32 and SCTP_CSUM_CRC_32C. The default value is set by the system control sctp_csum_algorithm. This socket option must be set before the call to connect(2) or listen(2), or before a passive connection attempt on a listening socket.

SCTP_MAC_TYPE
    Set or get the MAC (Message Authentication Code) type that will be used when signing cookies in INIT ACK messages. Valid values are SCTP_HMAC_SHA_1, SCTP_HMAC_MD5, and SCTP_HMAC_NONE. The default value is set by the system control sctp_mac_type. This socket option must be set before the call to listen(2), or before a passive connection attempt on a listening socket.

SCTP_COOKIE_LIFE
    Set or get the cookie lifetime associated with a socket. This is the amount of time that cookies sent to a peer endpoint in an INIT-ACK message will be valid. For SCTP this also limits the maximum for which the HMAC secret key for the cookie will be valid. The value is a integer time interval in milliseconds. Valid values are zero (0) or greater (MAXINT). The default value is set by the system control sctp_cookie_life. This socket option must be set before the call to listen(2), or before receiving a passive connection attempt. When changing this value, the new value will apply to all passive connection attempts (INIT messages) received on a listening socket after the change is made.

    Reducing this value will increase the chances that passive connection attempts will fail due to expired cookies. Increasing the value will reduce the overall security of the system by permitting attackers and increased interval to crack HMACs and guess verification tags. This value may be adjusted in conjunction with SCTP_COOKIE_INC to meet most objectives for successful passive connection attempts with the best security afforded by smaller values of SCTP_COOKIE_LIFE.

    Unfortunately the SCTP_COOKIE_LIFE and SCTP_COOKIE_INC must be adjusted to accommodate the slowest peer on the slowest connection. The default setting is adequate for Internet applications.

SCTP_COOKIE_INC
    Set or get the time increment (in milliseconds) that will be added to the lifespan of the cookie in an INIT ACK if the sender of the INIT requested cookie preservation to lengthen the lifespan of the cookie. Valid values include zero. The default value is set by the system control sctp_cookie_inc. This socket option must be set before the call to listen(2), or before a passive connection attempt on the listening socket, but can be read at any time.

SCTP_THROTTLE_ITVL
    Set or get the interval (in milliseconds) within which the receiver will not accept more than one INIT or COOKIE ECHO. Zero (don't throttle) is a valid value. The default is set by the system control sctp_throttle_itvl. This socket option must be set before the call to listen(2), or before a passive connection attempt on the listening socket.

SCTP_ISTREAMS
    Set the maximum number of inbound streams or get the actual number of inbound streams associated with a connection. Valid values are from 1 to 16,736. The default value is set by the system control sctp_max_istreams. This socket option must be set before the call to connect(2) or listen(2), or before a passive connection attempt, but can be read at any time. For tcp(7)-compatible SOCK_STREAM sockets, the number of inbound streams is fixed at one (1) and this socket option has no effect.

SCTP_OSTREAMS
    Set the number of requested outbound streams or get the actual number of outbound streams associated with a connection. Valid values are from 1 to 16,736. The default value is set by the system control sctp_req_ostreams. This socket option must be set before the call to connect(2) or listen(2), or before a passive connection attempt on a listening socket, but can be read at any time. For tcp(7)-compatible SOCK_STREAM sockets, the number of outbound streams is fixed at one (1) and this socket option has no effect.

SCTP_ECN
    When set to zero (0), disables the local transport Explicit Congestion Notification (ECN) capability, or get the transport ECN capability of the peer on a connected socket.

    This socket option supports the ECN capability of RFC 3168 and Appendix A of RFC 2960 and is only available if SCTP was compiled with the kernel configuration parameters CONFIG_INET_ECN and CONFIG_SCTP_ECN set.

SCTP_ALI
    Set the adaptation layer information to be used in the INIT or INIT-ACK on all passive or active connection attempts on the socket, or get the adaptation layer information provided by the peer on a connected socket.

    When set to zero (0), no adaptation layer information will be included in the INIT or INIT-ACK; when non-zero, it contains the flag bits that will be sent in the adaptation layer information in the INIT or INIT-ACK when set before the call to connect(2) or listen(2), or before a passive connection information is received on a listening socket.

    If the socket is in a disconnected state (and has never been connected), getting this option returns zero (0). If the socket has been in a connected state, getting this option returns zero (0) if no adaptation layer information was present during connection, or returns the adaptation layer information bits if provided by the peer.

    This socket option supports the adaptation layer information feature described in draft-ietf-tsvwg-addip-sctp-07.txt and is only supported if SCTP was compiled with kernel configuration parameter CONFIG_SCTP_ADAPTATION_LAYER_INFO set.

SCTP_PR
    Set whether Partial Reliability (draft-stewart-tsvwg-prsctp-03.txt> will be supported or required on connection establishment, or get the indication of support for PR-SCTP provided by the peer on a connected socket. Valid values are as follows:

    SCTP_PR_NONE
        Do not place or respond with Forward TSN parameter in an INIT or INIT-ACK indicating that this socket does not support PR-SCTP.

    SCTP_PR_PREFERRED
        Place and respond with a Forward TSN parameter in an INIT or INIT-ACK indicating to the peer that we support PR-SCTP for this connection, but do not require the peer to support PR-SCTP.

    SCTP_PR_REQUIRED
        Place and respond with a Forward TSN parameter in an INIT or INIT-ACK indicating to the peer that we support PR-SCTP and require the peer to do the same.

    The default setting is provided by the sctp_pr system control.

    For a connected socket, when this flag is true, it indicates that the peer supports PR-SCTP. When this flag is false, it indicates that the peer does not support PR-SCTP.

    This socket options supports the partial reliability feature <draft-stewart-tsvwg-prsctp-03.txt> and is only available if SCTP was compiled with the kernel configuration parameter CONFIG_SCTP_PARTIAL_RELIABILITY set.

SCTP_MAX_INIT_RETRIES
    Set or get the number of times that an INIT or COOKIE ECHO will be resent before abandoning the association initialization. Valid values include zero. The default value is set by the system control sctp_max_init_retries. This socket option must be set before the call to connect(2) or listen(2), or before a passive connection attempt on a listening socket.

SCTP_MAX_BURST
    Set or get the number of MTUs of data that will be sent in a single burst as defined by draft-ietf-tsvwg-sctpimpguide-08.txt. Valid values are one (1) or greater. The default value is set by the system control sctp_max_burst. This socket option may be changed at any time during the life of the socket.

SCTP_ASSOC_MAX_RETRANS
    Set or get the number of times that the sending endpoint will attempt retransmitting a packet on a given association before it aborts the association. Valid values include zero. The default value is set by the system control sctp_assoc_max_retrans. This value should be larger than the sum of all the SCTP_PATH_MAX_RETRANS values of each of the destinations. This socket option may be changed at any time during the life of the socket.

SCTP_SACK_DELAY
    Set or get the maximum SACK delay as the interval of time (in milliseconds) that the sending endpoint will delay an acknowledgment of a received data chunk. Valid values are in the range from 0 to MAXINT, however, the value of the maximum SACK delay should not exceed 500 milliseconds (setting this value to greater than 500 milliseconds is forbidden by RFC 2960) for Internet Applications. The default value is set by the system control sctp_sack_delay. This socket option may be changed at any time during the life of the socket.

SCTP_DISPOSITION
    Gets or sets a flag that determines whether SCTP will retain and deliver messages that were not successfully acknowledged by the peer for retrieval, or will deliver confirmation of acknowledgment for messages successfully acknowledged by the peer. If SCTP_DISPOSITION is return in a control message from a call to recvmsg(2) with the MSG_CONFIRM flag set, then the read packet represents a packet that was held for retrieval, exceeded its life-time, was dropped by PR-SCTP or had message confirmation set and was successfully acknowledged. In addition, if the message was successfully acknowledged, the MSG_CONFIRM flag will be returned in a call to recv(2), recvfrom(2) or recvmsg(2). Valid values are:

    SCTP_DISPOSITION_NONE
        When this option is set to SCTP_DISPOSITION_NONE, messages will not be retained for retrieval and acknowledgments will not be provided for messages unless overridden with the MSG_CONFIRM flag to send(2), sendto(2) or sendmsg(2).

    SCTP_DISPOSITION_UNSENT
        When set to SCTP_DISPOSITION_UNSENT, SCTP will retain and provide for retrieval only messages that were unsent. When set to SCTP_DISPOSITION_UNSENT in an ancillary message returned by recvmsg(2) called with the MSG_CONFIRM flag set, the read data represents a packet that was unsent at the time that the connection shut down or aborted. When SCTP_PR is enabled on the connection, unsent data that was dropped by PR-SCTP will be delivered before shut down or abort.

    SCTP_DISPOSITION_SENT
        When set to SCTP_DISPOSITION_SENT, SCTP will retain and provide for retrieval all messages that were sent and unacknowledged, or that were unsent at the time that the connection shut down or aborted. When set to SCTP_DISPOSITION_SENT in an ancillary message returned by recvmsg(2) called with the MSG_CONFIRM flag set, then the read data was a packet that was sent but not acknowledged (with a cumulative ack) before the connection was shut down or aborted. When SCTP_PR is enabled on the connection, sent data that was dropped by PR-SCTP will be delivered before shut down or abort.

    SCTP_DISPOSITION_GAP_ACKED
        When set to SCTP_DISPOSITION_GAP_ACKED, SCTP will retain and provide for retrieval all messages that were sent and gap acknowledged, sent and unacknowledged, or unsent at the time that the connection shut down or aborted. When set to SCTP_DISPOSITION_GAP_ACKED in an ancillary message returned by recvmsg(2) called with the MSG_CONFIRM flag set, then the read data was a packet that was sent but not acknowledged (with a cumulative ack) before the connection was shut down or aborted. When SCTP_PR is enabled on the connection, gap acknowledged data that was dropped by PR-SCTP will be delivered before shut down or abort.

    SCTP_DISPOSITION_ACKED
        When set to SCTP_DISPOSITION_ACKED, SCTP will retain and provide for retrieval acknowledgments for all messages that were confirmed delivered (by cumulative ack). When set to SCTP_DISPOSITION_ACKED in the ancillary message return by recvmsg(2) called with the MSG_CONFIRM flag set, then the read data was a packet that was sent and acknowledged (with a cumulative ack) before the connection was shut down gracefully or at any time before shut down or abort.

    This option permits messages that are unsent, sent but not acknowledged or sent and gap acknowledged, to be retrieved from the socket before close. This is accomplished by setting the SCTP_DISPOSITION socket option prior to shut down or abort, and then calling recvmsg(2) after POLLHUP, SIGPIPE or EPIPE indicating shutdown or abort of the connection. Messages then read with the MSG_CONFIRM flag set on call to recv(2), recvfrom(2) or recvmsg(2) will have the SCTP_DISPOSITION ancillary message attached and will indicate whether they were SCTP_DISPOSITION_UNSENT, SCTP_DISPOSITION_SENT or SCTP_DISPOSITION_GAP_ACKED.

    If the socket option SCTP_PR is set on the socket and the peer supports PR-SCTP, messages which have failed partial reliable delivery (were dropped) will also be retrieved by recvmsg(2) called with the MSG_CONFIRM flag set, with the SCTP_DISPOSITION ancillary data message before shutdown. SCTP must have been compiled with CONFIG_SCTP_PARTIAL_RELIABILITY for this feature to be available.

    Alternatively, if the socket option SCTP_DISPOSITION is set to SCTP_DISPOSITION_ACKED or messages were sent with the MSG_CONFIRM flag set to send(2), sendto(2) or sendmsg(2), then a call to recv(2), recvfrom(2) or recvmsg(2) with the MSG_CONFIRM flag set will return acknowledgments with a SCTP_DISPOSITION control message set to SCTP_DISPOSITION_ACKED for all acknowledged messages a the time of the call. Care should be taken when using this receipt confirmation service as the message will be held in the transmit buffers until confirmation has been received by the user. Receipt confirmation also has an impact on the performance of SCTP.

SCTP_LIFETIME
    Get or set the SCTP lifetime or PR-SCTP timed reliability lifetime associated with messages which are sent on this socket. When this option is included as an control message to sendmsg(2), the specified lifetime is associated with the written message.

    Ordered messages waiting for acknowledgment beyond this lifetime will cause subsequent writes to the same stream to fail until all failed messages have been retrieved with recvmsg(2) with the MSG_CONFIRM flag set. Subsequent unordered writes to the stream will succeed, although unordered data can also be collected by setting both MSG_OOB and MSG_CONFIRM in a call to recvmsg(2).

SCTP_ADD
    Sets a flag that indicates whether SCTP will support the ADD-IP extensions (ADD IP and DEL IP) on this socket, or gets a flags that indicates whether the peer supports the ADD-IP extensions on a connected socket. When the flag is set, requests that SCTP respond to ASCONF chunks with ADD IP or DEL IP requests. When the flag is unset, SCTP will refuse these requests. The default setting for this flag is unset for new sockets. This option is only available when the kernel is compiled with kernel configuration parameter CONFIG_SCTP_ADD_IP set.

SCTP_ADD_IP
    When set, requests that the provided IP address (addr), provided in a sockaddr_in structure be added to the local IP addresses associated with the connection. If the socket is in a connected or connecting state, this invokes the ASCONF procedure to add the IP address to the association. If the socket is in a disconnected state, setting this option will fail. This option is only available when the kernel is compiled with kernel configuration parameter CONFIG_SCTP_ADD_IP set.

    If a connected socket was initially bound to INADDR_ANY, additional IP addresses may be automatically added to the socket if new network interfaces are added to the system, or if existing network interfaces are configured with ifconfig(8) or equivalent commands.

SCTP_DEL_IP
    When set, requests that the provided IP address (addr), provided in a sockaddr_in structure be deleted from the local IP addresses associated with the connection. If the socket is in a connected or connecting state, this invokes the ASCONF procedure to remove the IP address from the association. If the socket is in a disconnected state, setting this option will fail. This option is only available when the kernel is compiled with kernel configuration parameter CONFIG_SCTP_ADD_IP set.

    If the socket was initially bound to INADDR_ANY, IP addresses may be automatically unbound from the socket if network interfaces are removed from the system, or if network interfaces are reconfigured with ifconfig(8) or equivalent commands.

SCTP_SET
    Sets a flag that indicates whether SCTP will support the ADD-IP extensions (SET PRIMARY) on this socket, or gets a flags that indicates whether the peer supports the ADD-IP extensions on a connected socket. When the flag is set, requests that SCTP respond to ASCONF chunks with SET PRIMARY requests. When the flag is unset, SCTP will refuse these requests. The default setting for this flag is unset for new sockets. This option is only available when the kernel is compiled with kernel configuration parameter CONFIG_SCTP_ADD_IP set.

SCTP_STATUS
    Gets the association status and the status associated with each of the destination transport addresses forming the association. The returned value is a sctp_astat structure following by assoc_nrep sctp_dstat structures (one for each destination transport address as returned by getpeername(2)).

        struct sctp_astat {
            uint assoc_rwnd;  /* receive window           */
            uint assoc_rbuf;  /* receive buffer           */
            uint assoc_nrep;  /* destinations reported    */
        };
        struct sctp_dstat {
            struct sockaddr_in
                  dest;       /* destination address      */
            uint dst_cwnd;    /* congestion window        */
            uint dst_unack;   /* unacknowledged chunks    */
            uint dst_srtt;    /* smoothed round trip time */
            uint dst_rvar;    /* rtt variance             */
            uint dst_rto;     /* current rto              */
            uint dst_sst;     /* slow start threshold     */
        };

    The sctp_astat structure has the following fields:

    assoc_rwnd
        is the current advertised receive window in bytes.

    assoc_rbuf
        is the current receive buffer size in bytes.

    assoc_nrep
        is the number of sctp_dstat structures that follow this structure.

    The sctp_dstat structure has the following fields:

    dest
        is the address associated with this sctp_dstat structure.

    dst_cwnd
        is the congestion window for the given destination transport address in bytes.

    dst_unack
        is the number of unacknowledged DATA chunks outstanding to the given destination transport address in chunks.

    dst_srtt
        is the current smoothed round trip time for the destination transport address in milliseconds.

    dst_rvar
        is the RTT variance for the destination transport address in milliseconds.

    dst_rto
        is the current value of the RTO for the destination transport address in milliseconds.

    dst_sst
        is the current value of the slow start threshold in bytes.

SCTP_DEBUG_OPTIONS
    Not Documented. (This socket option provides for special debugging functions intended for developers of SCTP.)

IOCTLS

These I/O controls can be accessed using ioctl(2). The correct syntax is:

    int value;
    error = ioctl(sctp_socket, ioctl_type, &value);

All socket(7) I/O controls are supported by SCTP without modification: SIOCGSTAMP, SIOCSPGRP, FIOASYNC and SIOCGPGRP. All socket(7) fcntls are supported by SCTP: FIOCGETOWN and FIOCSETOWN.

The following tcp(7) I/O controls are supported by SCTP:

SIOCINQ
    Returns the amount of queued unread data in the receive buffer. Argument is a pointer to an integer.

SIOCATMARK
    Returns true when all urgent data has already been received by the user program. This is used together with SO_OOBINLINE. Argument is a pointer to an integer for the test result.

SIOCOUTQ
    Returns the amount of unsent data in the socket send queue in the passed integer value pointer.

ERROR HANDLING
When a network error occurs, SCTP tries to resend the packet. If it doesn't succeed after some time, either ETIMEDOUT or the last received error on this connection is reported.

Some applications require a quicker error notification. This can be enabled with the SOL_IP level IP_RECVERR socket option. When this option is enabled, all incoming errors are immediately passed to the user program. Use this option with care: it makes SCTP less tolerant to routing changes and other normal network conditions.

NOTES

When an error occurs doing a connection setup occurring in a socket write SIGPIPE is only raised when the SO_KEEPOPEN socket option is set.

SCTP has no real out-of-band or urgent data; it has out-of-order data. In Linux this means if the other end sends newer out-of-band data the older urgent data may arrive later.

If the socket option SO_KEEPALIVE is not set (see socket(7)), SCTP will not generate heartbeats to any destination. For regular SOCK_SEQPACKET and SOCK_RDM sockets, SO_KEEPALIVE defaults to set. For tcp(7)-compatible SOCK_STREAM sockets, SO_KEEPALIVE defaults to unset.

ERRORS

EPIPE
    The other end closed the socket unexpectedly or a read is executed on a shut down socket.

ETIMEDOUT
    The other end didn't acknowledge retransmitted data after some time.

EAFNOTSUPPORT
    Passed socket address type in sin_family was not AF_INET or AF_UNSPEC.

Any errors defined for ip(7) or the generic socket(7) layer may also be returned for SCTP.

NETWORK STATISTICS

  Protocol Information

SCTP keeps a number of statistics provided for in the the IP MIB. IP protocol statistics are available in /proc/net/snmp as well as with the -s or --statistics flag to netstat(8). For additional information see proc(5) and netstat(8). ICMP Protocol statistics that are applicable to SCTP are as follows:

InErrors
    The number of ICMP messages received in error. This represents the value for all protocols including SCTP.

SCTP provides the following information in the Linux MIB. Linux MIB statistics are available in /proc/net/netstat. For additional information see proc(5). Linux protocol statistics that are applicable also to SCTP are as follows:

LockDroppedIcmps
    The number of ICMP errors that were dropped because the socket was locked.

ListenOverflows
    The number of COOKIE-ECHO chunks dropped due to listen queue overflows.

SCTP provides for SNMP Protocol Information following the SCTP MIB <draft-ietf-sigtran-sctp-mib-09.txt>. Protocol information is available in /proc/net/snmp as well as with the -s flag to the netstat(8) command. SCTP Protocol Statistics that are applicable to SCTP are as follows:

RtoAlgorithm
    The algorithm used to determine the timeout value (T3-rtx) used for retransmitting unacknowledged chunks.

RtoMin
    The minimum value for the transmission timeout value. This value can be obtained by reading the system control sctp_rto_min. A retransmission time value of zero means immediate retransmission. The value of this object has to be less than or equal to RtoMax's value.

RtoMax
    The maximum value for the retransmission timeout value. This value can be obtained by reading the system control sctp_rto_max. A retransmission timeout value of zero means immediate retransmission. The value of this object has to be greater than or equal to RtoMin's value.

RtoInitial
    The initial value for the retransmission timer. This value can be obtained by reading the system control sctp_rto_initial. A retransmission time value of zero means immediate retransmission.

MaxAssoc
    The maximum number of associations. For SCTP there is no controllable upper limit on the maximum number of associations. The maximum number of associations is constrained by the system maximum number of file descriptors, the process maximum number of file descriptors, and the amount of memory in the system. Therefore, this value will always be -1.

ValCookieLife
    The valid cookie life for COOKIEs in the initialization procedure. This value can be obtained by reading the system control sctp_valid_cookie_life.

MaxInitRetr
    The maximum number of times that an INIT or COOKIE-ECHO chunk will be retransmitted during the startup of an association. This value can be obtained by reading the system control sctp_max_init_retries.

CurrEstab
    The number of SCTP sockets in the established state.

ActiveEstabs
    The number of times that a connect(2) call succeeded on an SCTP socket.

PassiveEstabs
    The number of times that a accept(2) call succeeded on an SCTP socket.

Aborteds
    The number of times that an established SCTP socket completed an abortive release.

Shutdowns
    The number of times that an established SCTP socket completed an orderly release.

OutOfBlues
    The number of out of the blue packets received. Out of the blue packets are packets for which no corresponding SCTP socket could be found.

ChecksumErrors
    The number of received packets that discovered a checksum error and were discarded.

OutCtrlChunks
    The number of SCTP Control Chunks that were sent, excluding retransmissions.

OutOrderChunks
    The number of SCTP Data Chunks that were sent with the Unordered Bit clear, excluding retransmissions.

OutUnorderChunks
    The number of SCTP Data Chunks that were sent with the Unordered Bit set, excluding retransmissions.

InCtrlChunks
    The number of SCTP Control Chunks that were received and processed, excluding duplicates.

InOrderChunks
    The number of SCTP Data Chunks that were received with the Unordered Bit clear, excluding duplicates.

InUnorderChunks
    The number of SCTP Data Chunks that were received with the Unordered Bit set, excluding duplicates.

FragUsrMsgs
    The number of times that SCTP further fragmented a user message.

ReasmUserMsgs
    The number of times that SCTP reassembled fragmented chunks into a user messages.

OutSCTPPacks
    The number of packets delivered for transmission to the IP layer.

InSCTPPacks
    The number of packets received for processing from the IP layer.

DiscontinuityTime
    The last time at which SCTP statistics suffered a discontinuity.

  Connection Information

SCTP provides for SNMP Connection Information following the SCTP MIB <draft-ietf-sigtran-sctp-mib-09.txt>. Connection information is available in /proc/net/sctp but is not yet available with a -sctp flag to the netstat(8) command. (Extensions to the netstat(8) command are required to access this information.)

  Socket Usage Information

SCTP provides for socket usage information available in /proc/net/sockstat.

CAVEATS

SCTP does not subscribe to the RFC 2960 restriction to assign sequential TSNs (Transmit Sequence Numbers) to each fragmented DATA chunk of a large record for SOCK_SEQPACKET sockets. Multiple calls to write(2), send(2), sendto(2) or sendmsg(2) for portions of different records may result in fragments from multiple records being assigned interleaving TSNs. Portable programs should refrain from writing record fragments to more than one stream at a time.

SCTP ignores the source address list in INIT and INIT-ACK chunks when searching for Transmission Control Blocks in opposition to <draft-ietf-tsvwg-sctpimpguide-08.txt> section 2.18. This is because the procedure described there introduces severe vulnerability to DoS and Spoofing attacks. SCTP does not have this vulnerability.

SCTP ignores the source address list in INIT chunks when searching for Transmission Control Block matches in opposition to <draft-ietf-tsvwg-sctpimpguide-08.txt> section 2.6. This is because the procedure described there introduces severe vulnerability to DoS attacks by revealing detailed information about existing associations. SCTP does not have this vulnerability.

SCTP does not implement the UDP-like interface of <draft-ietf-tsvwg-sctpsocket-06.txt>. This is because the socket interface presented in that draft provides unorthodox interface to a SOCK_SEQPACKET socket which is against both the traditional and standard usage of SOCK_SEQPACKET sockets in BSD, XNS 5.2, and POSIX. In BSD, XNS 5.2 and POSIX, SOCK_SEQPACKET sockets are strictly connection-oriented, whereas in this draft they are connectionless. A connectionless use of SOCK_SEQPACKET would conflict with common standard socket code used by X.25, AX.25, DECNET, and other users of SOCK_SEQPACKET sockets.

Although similar, SCTP does not implement the TCP-like interface of <draft-ietf-tsvwg-sctpsocket-06.txt>. This is because the SOCK_STREAM socket interface presented in that draft only provides limited compatibility with tcp(7). The tcp(7) compatible socket interface provided by SCTP more closely follows the tcp(7) interface making it suitable to use SCTP as a drop-in replacement for tcp(7) with minimal (IPPROTO_SCTP) adjustment to applications programs written to tcp(7).

SCTP has way too many options. This is mostly because SCTP is an new protocol and experimentation with the protocol is high. These options provide close control of the interesting features of the protocol. Unfortunately, when all options are compiled, the performance of SCTP is necessarily impacted. Many of these options will become deprecated in future releases. Portable programs should minimize their use of SCTP-specific socket options.

Although SCTP permits the user maximum control over the various SCTP protocol parameters, it is also possible to set protocol parameters in violation of the requirements of RFC 2960 and subsequent SCTP drafts and RFCs. Internet applications should take extreme care with protocol parameter settings, by either using the default values for all protocol parameters (as recommended in RFC 2960 and others) or by taking care not to adjust protocol parameters outside the ranges recommended in RFC 2960 and subsequent RFCs.

SCTP does not currently support IPv6.

SCTP host name addresses are not supported.

SCTP does not implement MOBILE-SCTP extensions due to Intellectual Property Rights claims made against the technologies in MOBILE-SCTP.

SCTP does not currently support tcp(7) undocumented Linux sendpage(2) socket call.

Transparent proxy options and other enhanced IP capabilities available with the kernel configuration parameter CONFIG_SCTP_EXTENDED_IP_SUPPORT are not described, or not implemented.

Providing destination addresses to send(2), sendto(2) and sendmsg(2) does not work as described (it is largely ignored).

SOCK_RDM sockets are not fully supported as described.

The use of SO_BINDTODEVICE, IP_OPTIONS, IP_PKTINFO, IP_RECVOPTS, IP_RETOPTS and SCTP_STATUS socket options are not fully implemented and will probably not work as described.

AUTHOR

Brian F. G. Bidulock <bidulock@openss7.org>. The OpenSS7 Project. http://www.openss7.org/

VERSIONS
This SCTP implementation and interface was new for Linux 2.2. SCTP_NODELAY, SCTP_MAXSEG, SCTP_CORK, SCTP_SID, SCTP_PPI, SCTP_RECVSID and SCTP_RECVPPI were new features in Linux 2.2. The socket options SCTP_HEARTBEAT_ITVL, SCTP_HB, SCTP_RTO_INITIAL, SCTP_RTO_MIN, SCTP_RTO_MAX, SCTP_PATH_MAX_RETRANS, SCTP_RTO, SCTP_CKSUM_TYPE, SCTP_MAC_TYPE, SCTP_COOKIE_LIFE, SCTP_COOKIE_INC, SCTP_THROTTLE_ITVL, SCTP_ISTREAMS, SCTP_OSTREAMS, SCTP_ECN, SCTP_ALI, SCTP_PR, SCTP_MAX_INIT_RETRIES, SCTP_MAX_BURST, SCTP_ASSOC_MAX_RETRANS, SCTP_SACK_DELAY, SCTP_DISPOSITION, SCTP_LIFETIME, SCTP_ADD, SCTP_ADD_IP, SCTP_DEL_IP, SCTP_SET, SCTP_STATUS and SCTP_DEBUG_OPTIONS are new for 2.4.

SEE ALSO
accept(2) bind(2) close(2) connect(2) getpeername(2) getsockname(2) ifconfig(8) ioctl(2) ip(7) listen(2) netstat(8) read(2) recv(2) recvfrom(2) recvmsg(2) rudp(7) send(2) sendfile(2) sendmsg(2) sendpage(2) sendto(2) setsockopt(2) shutdown(2) socket(2) socket(7) sysctl(8) tcp(7) udp(7) and write(2).

REFERENCES
RFC 2960 for the SCTP specification.
RFC 1122 for a description of the Nagle algorithm.
RFC 3309 for a description of the CRC-32c checksum algorithm.
RFC 3168 for Explicit Congestion Notification
draft-ietf-sigtran-sctp-mib-09.txt for the SCTP MIB.
draft-ietf-tsvwg-sctpimpguide-08.txt for the SCTP Implementer's Guide modifications to RFC 2960.
draft-ietf-tsvwg-sctpsocket-06.txt for the description of a TCP-compatible SCTP API for sockets.
draft-ietf-tsvwg-addip-sctp-07.txt for the ADD-IP extension to SCTP.
draft-stewart-tsvwg-prsctp-03.txt for the PR-SCTP extension to SCTP.

COPYRIGHT NOTICE

Copyright © 1997-2003 OpenSS7 Corporation. All Rights Reserved.

PERMISSION NOTICE

Permission is granted to make and distribute verbatim copies of this manual provided that the copyright notice and this permission notice are preserved on all copies.

Permission is grated to copy and distribute modified version of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.

Since the Linux kernel and libraries are constantly changing, this manual may be incorrect or out-of-date. The author(s) and copyright holder(s) assume no responsibility whatsoever for errors or omissions, or for damage resulting from the use of the information contained herein. The author(s) and copyright holder(s) may not have taken the same level of care in the production of this manual, which is licensed free of charge, as they might when working professionally.

Formated or processed versions of this manual, if unaccompanied by the source, must acknowledge the copyright and authors of this work.