---
name: "sctp"
section: "7"
platform: "linux"
package: "lksctp-tools"
version: "1.0.21-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/sctp"
---

# sctp(7)

SCTP protocol.

## NAME

sctp - SCTP protocol.

## SYNOPSIS

```
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/sctp.h>

sctp_socket = socket(PF_INET, SOCK_STREAM, IPPROTO_SCTP);
sctp_socket = socket(PF_INET, SOCK_SEQPACKET, IPPROTO_SCTP);
```

## DESCRIPTION

This is an implementation of the SCTP protocol as defined in RFC4960. It is a message oriented, reliable transport protocol with direct support for multihoming that runs on top of [**ip**(7)](/ip/7.md), and supports both v4 and v6 versions.

Like TCP, SCTP provides reliable, connection oriented data delivery with  congestion control. Unlike TCP, SCTP also provides message boundary  preservation, ordered and unordered message delivery, multi-streaming and multi-homing. Detection of data corruption, loss of data and duplication of data is achieved by using checksums and sequence numbers. A selective  retransmission mechanism is applied to correct loss or corruption of data.

This implementation supports a mapping of SCTP into sockets API as defined in the RFC6458(Sockets API extensions for SCTP). Two styles of interfaces are supported.

A  **one-to-many** style interface with 1 to MANY relationship between socket and associations  where the outbound association setup is implicit. The syntax of a one-to-many style socket() call is

**sd = socket(PF\_INET, SOCK\_SEQPACKET, IPPROTO\_SCTP);**

A typical server in this style uses the following socket calls in sequence to prepare an endpoint for servicing requests.

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

A typical client uses the following calls in sequence to setup an association with a server to request services.

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

A **one-to-one style** interface with a 1 to 1 relationship between socket and association which enables existing TCP applications to be ported to SCTP with very little effort. The syntax of a one-to-one style socket() call is

**sd = socket(PF\_INET, SOCK\_STREAM, IPPROTO\_SCTP);**

A typical server in one-to-one style uses the following system call sequence to prepare an SCTP endpoint for servicing requests:

     1\. socket()\
      2\. bind()\
      3\. listen()\
      4\. accept()

The accept() call blocks until a new association is set up. It returns with a new socket descriptor. The server then uses the new socket descriptor to communicate with the client, using recv() and send() calls to get requests and send back responses. Then it calls

     5\. close()

to terminate the association. A typical client uses the following system call sequence to setup an association with a server to request services:

     1\. socket()\
      2\. connect()

After returning from connect(), the client uses send() and recv() calls to send out requests and receive responses from the server. The client calls

     3\. close()

to terminate this association when done.

## ADDRESS FORMATS

SCTP is built on top of IP (see  [**ip**(7)](/ip/7.md)). The address formats defined by [**ip**(7)](/ip/7.md) apply to SCTP.  SCTP only supports point-to-point communication; broadcasting and multicasting are not supported.

## SYSCTLS

These variables can be accessed by the  **/proc/sys/net/sctp/\*** files or with the  [**sysctl**(2)](/sysctl/2.md) interface.  In addition, most IP sysctls also apply to SCTP. See [**ip**(7)](/ip/7.md).

- Please check kernel documentation for this, at Documentation/networking/ip-sysctl.rst.

  ## STATISTICS

These variables can be accessed by the  **/proc/net/sctp/\*** files.

- **assocs**

  Displays the following information about the active associations. assoc ptr, sock ptr, socket style, sock state, association state, hash bucket, association id, bytes in transmit queue, bytes in receive queue, user id,  inode, local port, remote port, local addresses, remote addresses, heartbeat interval, in streams, out streams, max retransmissions, init retries, shutdown retries, retransmitted chunks, sock transmit queue committed bytes, sock transmit queue bytes, and sock send and receive buffer bytes.

- **eps**

  Displays the following information about the active endpoints. endpoint ptr, sock ptr, socket style, sock state, hash bucket, local port, user id, inode and local addresses.

- **snmp**

  Displays the following statistics related to SCTP states, packets and chunks.

-

  - **SctpCurrEstab**

  The number of associations for which the current state is either ESTABLISHED, SHUTDOWN-RECEIVED or SHUTDOWN-PENDING.

- **SctpActiveEstabs**

  The number of times that associations have made a direct transition to the ESTABLISHED state from the COOKIE-ECHOED state. The upper layer initiated the association attempt.

- **SctpPassiveEstabs**

  The number of times that associations have made a direct transition to the ESTABLISHED state from the CLOSED state. The remote endpoint initiated the association attempt.

- **SctpAborteds**

  The number of times that associations have made a direct transition to the CLOSED state from any state using the primitive 'ABORT'. Ungraceful termination of the association.

- **SctpShutdowns**

  The number of times that associations have made a direct transition to the CLOSED state from either the SHUTDOWN-SENT state or the SHUTDOWN-ACK-SENT state. Graceful termination of the association.

- **SctpOutOfBlues**

  The number of out of the blue packets received by the host. An out of the blue packet is an SCTP packet correctly formed, including the proper checksum, but for which the receiver was unable to identify an appropriate association.

- **SctpChecksumErrors**

  The number of SCTP packets received with an invalid checksum.

- **SctpOutCtrlChunks**

  The number of SCTP control chunks sent (retransmissions are not included). Control chunks are those chunks different from DATA.

- **SctpOutOrderChunks**

  The number of SCTP ordered data chunks sent (retransmissions are not included).

- **SctpOutUnorderChunks**

  The number of SCTP unordered chunks(data chunks in which the U bit is set to 1) sent (retransmissions are not included).

- **SctpInCtrlChunks**

  The number of SCTP control chunks received (no duplicate chunks included).

- **SctpInOrderChunks**

  The number of SCTP ordered data chunks received (no duplicate chunks included).

- **SctpInUnorderChunks**

  The number of SCTP unordered chunks(data chunks in which the U bit is set to 1) received (no duplicate chunks included).

- **SctpFragUsrMsgs**

  The number of user messages that have to be fragmented because of the MTU.

- **SctpReasmUsrMsgs**

  The number of user messages reassembled, after conversion into DATA chunks.

- **SctpOutSCTPPacks**

  The number of SCTP packets sent. Retransmitted DATA chunks are included.

- **SctpInSCTPPacks**

  The number of SCTP packets received. Duplicates are included.

- **SctpT1InitExpireds**

  The number of timer T1 INIT expired.

- **SctpT1CookieExpireds**

  The number of timer T1 COOKIE-ECHO expired.

- **SctpT2ShutdownExpireds**

  The number of timer T2 SHUTDOWN expired.

- **SctpT3RtxExpireds**

  The number of timer T3 RTX expired.

- **SctpT4RtoExpireds**

  The number of timer T4 RTO expired.

- **SctpT5ShutdownGuardExpireds**

  The number of timer T5 SHUTDOWN GUARD expired.

- **SctpDelaySackExpireds**

  The number of timer DELAY\_SACK expired.

- **SctpAutocloseExpireds**

  The number of timer AUTOCLOSE expired.

- **SctpT3Retransmits**

  The number of T3 timer retransmission.

- **SctpPmtudRetransmits**

  The number of PMTUD retransmission.

- **SctpFastRetransmits**

  The number of FAST retransmission.

- **SctpInPktSoftirq**

  The number of SCTP packets received in Softirq.

- **SctpInPktBacklog**

  The number of SCTP packets received in Backlog.

- **SctpInPktDiscards**

  The number of SCTP packets discarded in receiving.

- **SctpInDataChunkDiscards**

  The number of SCTP data chunks discarded in receiving.

## CONTROL MSGS

The ancillary data is carried in msg\_control field of struct msghdr, which is used in **[sendmsg(2)](/sendmsg/2.md)** and **[recvmsg(2)](/recvmsg/2.md)** call. The SCTP stack uses the ancillary data to communicate the attributes, such as SCTP\_RCVINFO, of the message stored in msg\_iov to the socket endpoint. Each ancillary data item is preceded by a struct cmsghdr, see **[cmsg(3)](/cmsg/3.md).** The different cmsg types for SCTP are listed below, and all these related macros and structures are defined in /usr/include/netinet/sctp.h.

- **SCTP\_INIT**

  This cmsg provides information for initializing new SCTP associations for sendmsg() with struct sctp\_initmsg, which is the same as SCTP\_INITMSG socket option's data structure.

- **SCTP\_SNDRCV**

  This cmsg specifies SCTP options for sendmsg() and describes SCTP header information about a received message through recvmsg() with struct sctp\_sndrcvinfo. It mixes the send and receive path, and SCTP\_SNDINFO and SCTP\_RCVINFO split this information, so these structures should be used, when possible, since SCTP\_SNDRCV is deprecated. **[sctp\_sendmsg(3)](/sctp_sendmsg/3.md)** and **[sctp\_send(3)](/sctp_send/3.md)** provide a simple way to use this cmsg.

  Note that an application must use the SCTP\_RECVRCVINFO socket option to enable the delivery of this information.

- **SCTP\_EXTRCV**

  This cmsg specifies SCTP options for SCTP header information about a received message via recvmsg() with struct sctp\_extrcvinfo, and this structure is an extended version of SCTP\_SNDRCV. Note that data in the next message is not valid unless the current message is completely read, i.e., unless the MSG\_EOR is set. SCTP\_NXTINFO should be used when possible, since SCTP\_EXTRCV is considered deprecated. **[sctp\_recvmsg(3)](/sctp_recvmsg/3.md)** provides a simple way to use this cmsg.

  Note that an application must use the SCTP\_RECVNXTINFO socket option to enable the delivery of this information.

- **SCTP\_RCVINFO, SCTP\_NXTINFO**

  These cmsgs describe SCTP receive information about a received message through recvmsg() with struct sctp\_rcvinfo, and SCTP receive information of the next message that will be delivered through recvmsg() if this information is already available when delivering the current message with struct sctp\_nxtinfo. **[sctp\_recvv(3)](/sctp_recvv/3.md)** provides a simple way to use these cmsgs.

  Note that an application must use the SCTP\_RECVRCVINFO and SCTP\_RECVNXTINFO socket options accordingly to enable the delivery of this information.

- **SCTP\_SNDINFO, SCTP\_PRINFO, SCTP\_AUTHINFO, SCTP\_DSTADDRV4, SCTP\_DSTADDRV6**

  These cmsgs specifie a couple of SCTP options for sendmsg() for SEND, PRSCTP, AUTH and DSTADDR information with struct sctp\_sndinfo, sctp\_prinfo, sctp\_authinfo and in(6)\_addr accordingly. **[sctp\_sendv(3)](/sctp_sendv/3.md)** provides a simple way to use these cmsgs.

## EVENTS and NOTIFICATIONS

An SCTP application may need to understand and process events and errors that happen on the SCTP stack. These events include network status changes, association startups, remote operational errors, and undeliverable messages. When a notification arrives, recvmsg() returns the notification in the application-supplied data buffer via msg\_iov, and sets MSG\_NOTIFICATION in msg\_flags. See socket option SCTP\_EVENT for the event enabling. The different events are listed below, and all these related macros and structures are defined in /usr/include/netinet/sctp.h.

- **SCTP\_ASSOC\_CHANGE**

  Communication notifications inform the application that an SCTP association has either begun or ended. The notification format is struct sctp\_assoc\_change.

- **SCTP\_PEER\_ADDR\_CHANGE**

  When a destination address of a multi-homed peer encounters a state change, a peer address change event is sent. The notification format is struct sctp\_paddr\_change.

- **SCTP\_REMOTE\_ERROR**

  A remote peer may send an Operation Error message to its peer.  This message indicates a variety of error conditions on an association. The notification format is struct sctp\_remote\_error.

- **SCTP\_SEND\_FAILED**

  If SCTP cannot deliver a message, it can return back the message as a notification if the SCTP\_SEND\_FAILED event is enabled. The notification format is struct sctp\_send\_failed. Please note that this notification is deprecated. Use SCTP\_SEND\_FAILED\_EVENT instead.

- **SCTP\_SHUTDOWN\_EVENT**

  When a peer sends a SHUTDOWN, SCTP delivers this notification to inform the application that it should cease sending data. The notification format is struct sctp\_shutdown\_event.

- **SCTP\_ADAPTATION\_INDICATION**

  When a peer sends an Adaptation Layer Indication parameter, SCTP delivers this notification to inform the application about the peer's adaptation layer indication. The notification format is struct sctp\_adaptation\_event.

- **SCTP\_PARTIAL\_DELIVERY\_EVENT**

  When a receiver is engaged in a partial delivery of a message, this notification will be used to indicate various events. The notification format is struct sctp\_pdapi\_event.

- **SCTP\_AUTHENTICATION\_EVENT**

  This is used to report different events relating to the use of the extension to authenticate SCTP messages. The notification format is struct sctp\_authkey\_event.

- **SCTP\_SENDER\_DRY\_EVENT**

  When the SCTP stack has no more user data to send or retransmit, this notification is given to the user.  Also, at the time when a user app subscribes to this event, if there is no data to be sent or retransmit, the stack will immediately send up this notification. The notification format is struct sctp\_sender\_dry\_event.

- **SCTP\_SEND\_FAILED\_EVENT**

  If SCTP cannot deliver a message, it can return back the message as a notification if the SCTP\_SEND\_FAILED\_EVENT event is enabled. The notification format is struct sctp\_send\_failed\_event.

## SOCKET OPTIONS

To set or get a SCTP socket option, call [**getsockopt**(2)](/getsockopt/2.md) to read or [**setsockopt**(2)](/setsockopt/2.md) to write the option with the option level argument set to  **SOL\_SCTP.** Note that all these macros and structures described for parameters are defined in /usr/include/netinet/sctp.h, and for one-to-one style sockets a specified assoc\_id works the same as SCTP\_FUTURE\_ASSOC.

- **SCTP\_RTOINFO.**

  This option is used to get or set the protocol parameters used to initialize and bound retransmission timeout(RTO).

  The parameter type is struct sctp\_rtoinfo, for reading and writing. srto\_assoc\_id is a specified assoc\_id or SCTP\_FUTURE\_ASSOC.

  Default: srto\_max=sysctl\_net.sctp.rto\_max, srto\_min=sysctl\_net.sctp.rto\_min, srto\_initial=sysctl\_net.sctp.rto\_initial.

- **SCTP\_ASSOCINFO**

  This option is used to both examine and set various association and endpoint parameters.

  The parameter type is struct sctp\_assocparams, for reading and writing. sasoc\_assoc\_id is a specified assoc\_id or SCTP\_FUTURE\_ASSOC. Note that some fields of this structure are for reading only:

    struct sctp\_assocparams {\
             sctp\_assoc\_t    sasoc\_assoc\_id;\
             \_\_u16           sasoc\_asocmaxrxt; (RW)\
             \_\_u16           sasoc\_number\_peer\_destinations; (R)\
             \_\_u32           sasoc\_peer\_rwnd; (R)\
             \_\_u32           sasoc\_local\_rwnd; (R)\
             \_\_u32           sasoc\_cookie\_life; (RW)\
     };

  Default: sasoc\_asocmaxrxt=sysctl\_net.sctp.association\_max\_retrans, sasoc\_cookie\_life=sysctl\_net.sctp.valid\_cookie\_life.

- **SCTP\_INITMSG**

  This option is used to get or set the protocol parameters for the default association initialization.

  The parameter type is struct sctp\_initmsg, for reading and writing.

  Default: sinit\_num\_ostreams=10, sinit\_max\_instreams=10, sinit\_max\_attempts=sysctl\_net.sctp.max\_init\_retransmits, sinit\_max\_init\_timeo=sysctl\_net.sctp.rto\_max.

- **SCTP\_NODELAY**

  Turn on/off any Nagle-like algorithm. This means that packets are generally sent as soon as possible and no unnecessary delays are introduced, at the cost of more packets in the network.

  The parameter type is int boolean, for reading and writing.

  Default: 0.

- **SCTP\_AUTOCLOSE**

  This socket option is applicable to the one-to-many style socket only. When set it will cause associations that are idle for more than the specified number of seconds to automatically close. An association being idle is defined an association that has NOT sent or received user data within a period.

  The parameter type is int(seconds), for reading and writing. 0 indicates that no automatic close of any associations should be performed.

  Default: sysctl\_net.sctp.max\_autoclose.

- **SCTP\_SET\_PEER\_PRIMARY\_ADDR**

  Requests that the peer mark the enclosed address as the association primary. The enclosed address must be one of the association's locally bound addresses.

  The parameter type is struct sctp\_setpeerprim, for writing only. sspp\_assoc\_id is a specified assoc\_id.

  Default: the 1st local address added. Require: SCTP\_ASCONF\_SUPPORTED.

- **SCTP\_PRIMARY\_ADDR**

  Requests that the local SCTP stack use the enclosed peer address as the association primary. The enclosed address must be one of the association peer's addresses.

  The parameter type is struct sctp\_prim, for writing only. ssp\_assoc\_id is a specified assoc\_id.

  Default: the 1st peer address added. Require: SCTP\_ASCONF\_SUPPORTED.

- **SCTP\_DISABLE\_FRAGMENTS**

  If enabled no SCTP message fragmentation will be performed. Instead if a message being sent exceeds the current PMTU size, the message will NOT be sent and an error will be indicated to the user.

  The parameter type is int boolean, for reading and writing.

  Default: 0.

- **SCTP\_PEER\_ADDR\_PARAMS**

  Using this option, applications can enable or disable heartbeats for any peer address of an association, modify an address's heartbeat interval, force a heartbeat to be sent immediately, and adjust the address's maximum number of retransmissions sent before an address is considered unreachable.

  The parameter type is struct sctp\_paddrparams, for reading and writing. spp\_address is a specified transport address or 0, spp\_assoc\_id is a specified assoc\_id or SCTP\_FUTURE\_ASSOC.

  Default: hbinterval=sysctl\_net.sctp.hb\_interval, pathmaxrxt=sysctl\_net.sctp.path\_max\_retrans, pathmtu=dev/route's, sackdelay=sysctl\_net.sctp.sack\_timeout, param\_flags=HB\_ENABLE\|PMTUD\_ENABLE\|SACKDELAY\_ENABLE, flowlabel=0, dscp=0.

- **SCTP\_DEFAULT\_SEND\_PARAM**

  Applications that wish to use the sendto() system call may wish to specify a default set of parameters that would normally be supplied through the inclusion of ancillary data. This option has been obsoleted by SCTP\_DEFAULT\_SNDINFO.

  The parameter type is struct sctp\_sndrcvinfo. For reading, sinfo\_assoc\_id is a specified assoc\_id or SCTP\_FUTURE\_ASSOC. For writing, sinfo\_assoc\_id is a specified assoc\_id or SCTP\_{FUTURE\|CURRENT\|ALL}\_ASSOC.

  Default: default\_stream=0, default\_flags=0, default\_ppid=0, default\_context=0, default\_timetolive=0.

- **SCTP\_EVENTS**

  This socket option is used to specify various notifications and ancillary data the user wishes to receive. This option has been obsoleted by SCTP\_EVENT.

  The parameter type is struct sctp\_event\_subscribe, for reading and writing.

  Default: 0.

- **SCTP\_I\_WANT\_MAPPED\_V4\_ADDR**

  This socket option is used to turn on or off mapped V4 addresses. If this option is turned on and the socket is type PF\_INET6, then IPv4 addresses will be mapped to V6 representation. If this option is turned off, then no mapping will be done of V4 addresses and a user will receive both PF\_INET6 and PF\_INET type addresses on the socket.

  The parameter type is int boolean, for reading and writing.

  Default: 1.

- **SCTP\_MAXSEG**

  This socket option specifies the maximum size to put in any outgoing SCTP DATA chunk. If a message is larger than this size it will be fragmented by SCTP into the specified size. Note that the underlying SCTP implementation may fragment into smaller sized chunks when the PMTU of the underlying association is smaller than the value set by the user. 0 indicates the user is NOT limiting fragmentation and only the PMTU will effect SCTP's choice of DATA chunk size.

  The parameter type is struct sctp\_assoc\_value, for reading and writing. assoc\_id is a specified assoc\_id or SCTP\_FUTURE\_ASSOC.

  Default: 0(no limit).

- **SCTP\_STATUS**

  Applications can retrieve current status information about an association, including association state, peer receiver window size, number of unacked data chunks, and number of data chunks pending receipt.

  The parameter type is struct sctp\_status, for reading only. sstat\_assoc\_id is a specified assoc\_id.

- **SCTP\_GET\_PEER\_ADDR\_INFO**

  Applications can retrieve information about a specific peer address of an association, including its reachability state, congestion window, and retransmission timer values.

  The parameter type is struct sctp\_paddrinfo, for reading only. spinfo\_address is a specified transport address, sas\_assoc\_id is a specified assoc\_id or SCTP\_FUTURE\_ASSOC.

- **SCTP\_GET\_ASSOC\_STATS**

  Applications can retrieve current statistics about an association, including SACKs sent and received, SCTP packets sent and received.

  The parameter type is struct sctp\_assoc\_stats, for reading only. sas\_assoc\_id is a specified assoc\_id.

- **SCTP\_DELAYED\_ACK, SCTP\_DELAYED\_ACK\_TIME, SCTP\_DELAYED\_SACK**

  These options will affect the way delayed SACKs are performed. They allow the application to get or set the delayed SACK time, in milliseconds, and also allow changing the delayed SACK frequency. Changing the frequency to 1 disables the delayed SACK algorithm. Note that if sack\_delay or sack\_freq is 0 when setting this option, the current values will remain unchanged.

  The parameter type is struct sctp\_sack\_info. For reading, sack\_assoc\_id is a specified assoc\_id or SCTP\_FUTURE\_ASSOC. For writing, sack\_assoc\_id is a specified assoc\_id or SCTP\_{FUTURE\|CURRENT\|ALL}\_ASSOC.

  Default: sackdelay=sysctl\_net.sctp.sack\_timeout,sackfreq=2.

- **SCTP\_CONTEXT**

  This option allows the setting, on an association basis, of a default context that will be received on reading messages from the peer. This is especially helpful for an application when using one-to-many style sockets to keep some reference to an internal state machine that is processing messages on the association.  Note that the setting of this value only affects received messages from the peer and does not affect the value that is saved with outbound messages.

  The parameter type is struct sctp\_assoc\_value. For reading, assoc\_id is a specified assoc\_id or SCTP\_FUTURE\_ASSOC. For writing, assoc\_id is a specified assoc\_id or SCTP\_{FUTURE\|CURRENT\|ALL}\_ASSOC.

  Default: 0.

- **SCTP\_FRAGMENT\_INTERLEAVE**

  Fragmented interleave controls how the presentation of messages occurs for the message receiver. There are three levels of fragment interleave defined: level 0: SCTP\_FRAGMENT\_INTERLEAVE = 0; level 1: SCTP\_FRAGMENT\_INTERLEAVE = 1; level 2: SCTP\_FRAGMENT\_INTERLEAVE = 1 & SCTP\_INTERLEAVING\_SUPPORTED = 1.

  The parameter type is int boolean, for reading and writing.

  Default: 0.

- **SCTP\_PARTIAL\_DELIVERY\_POINT**

  This option will set or get the SCTP partial delivery point.  This point is the size of a message where the partial delivery API will be invoked to help free up rwnd space for the peer.  Setting this to a lower value will cause partial deliveries to happen more often.  This option expects an integer that sets or gets the partial delivery point in bytes.  Note also that the call will fail if the user attempts to set this value larger than the socket receive buffer size. Note that any single message having a length smaller than or equal to the SCTP partial delivery point will be delivered in a single read call as long as the user-provided buffer is large enough to hold the message.

  The parameter type is uint32\_t, for reading and writing.

  Default: 0.

- **SCTP\_MAX\_BURST**

  This option will allow a user to change the maximum burst of packets that can be emitted by this association.

  The parameter type is struct sctp\_assoc\_value. For reading, assoc\_id is a specified assoc\_id or SCTP\_FUTURE\_ASSOC. For writing, assoc\_id is a specified assoc\_id or SCTP\_{FUTURE\|CURRENT\|ALL}\_ASSOC.

  Default: sysctl\_net.sctp.max\_burst.

- **SCTP\_AUTH\_CHUNK**

  This option adds a chunk type that the user is requesting to be received only in an authenticated way, and it only affects the future associations.

  The parameter type is struct sauth\_chunk, for writing only.

  Default: no chunks. Require: SCTP\_AUTH\_SUPPORTED. RFC: RFC4895.

- **SCTP\_HMAC\_IDENT**

  This option gets or sets the list of Hashed Message Authentication Code (HMAC) algorithms that the local endpoint requires the peer to use.

  The parameter type is struct sctp\_hmacalgo, for reading and writing. shmac\_idents can include SCTP\_AUTH\_HMAC\_ID\_{SHA1\|SHA256}.

  Default: SCTP\_AUTH\_HMAC\_ID\_SHA1. Require: SCTP\_AUTH\_SUPPORTED.

- **SCTP\_AUTH\_KEY**

  This option will set a shared secret key that is used to build an association shared key.

  The parameter type is struct sctp\_authkey, for writing only. sca\_assoc\_id is a specified assoc\_id or SCTP\_{FUTURE\|CURRENT\|ALL}\_ASSOC.

  Default: null\_key. Require: SCTP\_AUTH\_SUPPORTED.

- **SCTP\_AUTH\_ACTIVE\_KEY**

  This option will get or set the active shared key to be used to build the association shared key.

  The parameter type is struct sctp\_authkeyid, for writing only. scact\_assoc\_id is a specified assoc\_id or SCTP\_{FUTURE\|CURRENT\|ALL}\_ASSOC.

  Default: 0. Require: SCTP\_AUTH\_SUPPORTED.

- **SCTP\_AUTH\_DEACTIVATE\_KEY**

  This set option indicates that the application will no longer send user messages using the indicated key identifier.

  The parameter type is struct sctp\_authkeyid, for writing only. scact\_assoc\_id is a specified assoc\_id or SCTP\_{FUTURE\|CURRENT\|ALL}\_ASSOC.

  Require: SCTP\_AUTH\_SUPPORTED.

- **SCTP\_AUTH\_DELETE\_KEY**

  This set option will delete an SCTP association's shared secret key that has been deactivated.

  The parameter type is struct sctp\_authkeyid, for writing only. scact\_assoc\_id is a specified assoc\_id or SCTP\_{FUTURE\|CURRENT\|ALL}\_ASSOC.

  Require: SCTP\_AUTH\_SUPPORTED.

- **SCTP\_PEER\_AUTH\_CHUNKS**

  This option gets a list of chunk types for a specified association that the peer requires to be received authenticated only.

  The parameter type is struct sctp\_authchunks, for reading only. gauth\_assoc\_id is a specified assoc\_id.

  Require: SCTP\_AUTH\_SUPPORTED.

- **SCTP\_LOCAL\_AUTH\_CHUNKS**

  This option gets a list of chunk types for a specified association that the local endpoint requires to be received authenticated only.

  The parameter type is struct sctp\_authchunks, for reading only. gauth\_assoc\_id is a specified assoc\_id or SCTP\_FUTURE\_ASSOC.

  Require: SCTP\_AUTH\_SUPPORTED.

- **SCTP\_GET\_ASSOC\_NUMBER**

  This option gets the current number of associations that are attached to a one-to-many style socket. Note that this number is only a snapshot. This means that the number of associations may have changed when the caller gets back the option result.

  The parameter type is uint32\_t, for reading only.

- **SCTP\_GET\_ASSOC\_ID\_LIST**

  This option gets the current list of SCTP association identifiers of the SCTP associations handled by a one-to-many style socket. It uses struct sctp\_assoc\_ids and must provide a large enough buffer to hold all association identifiers. If the buffer is too small, an error must be returned. The user can use the SCTP\_GET\_ASSOC\_NUMBER socket option to get an idea of how large the buffer has to be.

  The parameter type is struct sctp\_assoc\_ids, for reading only.

- **SCTP\_EXPOSE\_POTENTIALLY\_FAILED\_STATE, SCTP\_EXPOSE\_PF\_STATE**

  Applications can control the exposure of the PF path state in the SCTP\_PEER\_ADDR\_CHANGE event, and if pf\_expose is not 'enabled', no notification will be sent for a transport state change to SCTP\_PF. It also affects the SCTP\_GET\_PEER\_ADDR\_INFO socket option, and if pf\_expose is 'disabled', users can not access the transport info via SCTP\_GET\_PEER\_ADDR\_INFO option.

  The parameter type is struct sctp\_assoc\_value, for reading and writing. assoc\_id is a specified assoc\_id or SCTP\_FUTURE\_ASSOC.

  Default: sysctl\_net.sctp.pf\_expose.

- **SCTP\_PEER\_ADDR\_THLDS**

  Applications can control the SCTP-PF behavior by getting or setting the number of consecutive timeouts before a peer address is considered PF or unreachable..

  The parameter type is struct sctp\_paddrthlds, for reading and writing. spt\_address is a specified transport address or 0, spt\_assoc\_id is a specified assoc\_id or SCTP\_FUTURE\_ASSOC.

  Default: pathmaxrxt=sysctl\_net.sctp.path\_max\_retrans, ps\_retrans=sysctl\_net.sctp.ps\_retrans.

- **SCTP\_PEER\_ADDR\_THLDS\_V2**

  Similar to SCTP\_PEER\_ADDR\_THLDS, but it can also be used by applications to set and get the number of timeouts before the primary path is changed automatically by the Primary Path Switchover function.

  The parameter type is struct sctp\_paddrthlds\_v2, for reading and writing. spt\_address is a specified transport address or 0, spt\_assoc\_id is a specified assoc\_id or SCTP\_FUTURE\_ASSOC.

  Default: pathmaxrxt=sysctl\_net.sctp.path\_max\_retrans, ps\_retrans=sysctl\_net.sctp.ps\_retrans, pf\_retrans=sysctl\_net.sctp.pf\_retrans.

- **SCTP\_RECVRCVINFO**

  Setting this option specifies that SCTP\_RCVINFO (SCTP receive information about a received message) is returned as ancillary data by recvmsg(). See **CONTROL MSGS** for more details.

  The parameter type is int, for reading and writing.

  Default: 0.

- **SCTP\_RECVNXTINFO**

  Setting this option specifies that SCTP\_NXTINFO (SCTP receive information of the next message) is returned as ancillary data by recvmsg(). See **CONTROL MSGS** for details.

  The parameter type is int, for reading and writing.

  Default: 0.

- **SCTP\_DEFAULT\_SNDINFO**

  This option obsoletes SCTP\_DEFAULT\_SEND\_PARAM.

  The parameter type is struct sctp\_sndinfo. For reading, snd\_assoc\_id is a specified assoc\_id or SCTP\_FUTURE\_ASSOC. For writing, snd\_assoc\_id is a specified assoc\_id or SCTP\_{FUTURE\|CURRENT\|ALL}\_ASSOC.

  Default: default\_stream=0, default\_flags=0, default\_ppid=0, default\_context=0.

- **SCTP\_REUSE\_PORT**

  This option is similar to the socket level option SO\_REUSEADDR, besides only supports one-to-one style SCTP sockets and must not be used after calling bind() or sctp\_bindx().

  The parameter type is int, for reading and writing.

  Default: 0.

- **SCTP\_SOCKOPT\_BINDX\_ADD**

  This option allows the user to bind a specific subset of addresses or, if the SCTP extension ASCONF is supported (see SCTP\_ASCONF\_SUPPORTED), add specific addresses. The API sctp\_bindx() is based on this.

  The parameter type is struct sockaddr\[\], for writing only.

- **SCTP\_SOCKOPT\_BINDX\_REM**

  Similar to SCTP\_SOCKOPT\_BINDX\_ADD, but delete specific addresses. The API sctp\_bindx() is based on this.

  The parameter type is struct sockaddr\[\], for writing only.

- **SCTP\_SOCKOPT\_PEELOFF**

  This option branches off an UDP type association into a separate socket returned back to users. The API sctp\_peeloff() is based on this option.

  The parameter type is sctp\_peeloff\_arg\_t, for reading only. associd is a specified assoc\_id.

- **SCTP\_SOCKOPT\_PEELOFF\_FLAGS**

  Peel off an UDP type association from a socket similar to SCTP\_SOCKOPT\_PEELOFF option, but it allows the flags like O\_CLOEXEC and O\_NONBLOCK to be used when creating the new socket. The API sctp\_peeloff\_flags() is based on this option.

  The parameter type is sctp\_peeloff\_flags\_arg\_t, for reading only. associd is a specified assoc\_id.

- **SCTP\_SOCKOPT\_CONNECTX\_OLD**

  This option allows a user to specify multiple addresses at which a peer can be reached, and the kernel stack will use the list of addresses to set up the association. The API sctp\_connectx() is based on this option.

  The parameter type is struct sockaddr\[\], for writing only.

- **SCTP\_SOCKOPT\_CONNECTX**

  Similar to SCTP\_SOCKOPT\_CONNECTX\_OLD, but it returns the new assoc's id. The API sctp\_connectx2() is based on this option.

  The parameter type is struct sockaddr\[\], for writing only. The new assoc's id is passed to users by the return value.

- **SCTP\_SOCKOPT\_CONNECTX3**

  Similar to SCTP\_SOCKOPT\_CONNECTX, but it uses different type parameter. The API sctp\_connectx3() is based on this option.

  The parameter type is struct sctp\_getaddrs\_old, for reading only. assoc\_id is set to the new assoc's id by kernel and passed to users.

- **SCTP\_GET\_PEER\_ADDRS**

  This option is used to gets all peer addresses in an association. The API sctp\_getpaddrs() is based on this option.

  The parameter type is struct sctp\_getaddrs, for reading only. assoc\_id is a specified assoc\_id.

- **SCTP\_GET\_LOCAL\_ADDRS**

  This option is used to get all local addresses in an association. The API sctp\_getladdrs() is based on this option.

  The parameter type is struct sctp\_getaddrs, for reading only. assoc\_id is a specified assoc\_id or SCTP\_FUTURE\_ASSOC.

- **SCTP\_ADAPTATION\_LAYER**

  This option requests that the local endpoint set the specified Adaptation Layer Indication parameter for all future INIT and INIT-ACK exchanges.

  The parameter type is struct sctp\_setadaptation, for reading and writing.

  Default: 0.

- **SCTP\_EVENT**

  This option obsoletes SCTP\_EVENTS socket option, and it can set or get one specific type of event for a specified association.

  The parameter type is struct sctp\_event. For reading, se\_assoc\_id is a specified assoc\_id or SCTP\_FUTURE\_ASSOC. For writing, se\_assoc\_id is a specified assoc\_id or SCTP\_{FUTURE\|CURRENT\|ALL}\_ASSOC. se\_type can be one of enum sctp\_sn\_type.

  Default: 0.

- **SCTP\_PR\_SUPPORTED**

  This socket option allows the enabling or disabling of the negotiation of PR-SCTP support for future associations.

  The parameter type is struct sctp\_assoc\_value. For reading, assoc\_id is a specified assoc\_id or SCTP\_FUTURE\_ASSOC. For writing, assoc\_id is SCTP\_FUTURE\_ASSOC.

  Default: sysctl\_net.sctp.prsctp\_enable. RFC: RFC7496.

- **SCTP\_DEFAULT\_PRINFO**

  This option sets and gets the default parameters for PR-SCTP.

  The parameter type is struct sctp\_default\_prinfo. For reading, pr\_assoc\_id is a specified assoc\_id or SCTP\_FUTURE\_ASSOC. For writing, pr\_assoc\_id is a specified assoc\_id or SCTP\_{FUTURE\|CURRENT\|ALL}\_ASSOC. pr\_policy can be SCTP\_PR\_SCTP\_{NONE\|TTL\|RTX\|PRIO}.

  Default: SCTP\_PR\_SCTP\_NONE. Require: SCTP\_DEFAULT\_PRINFO.

- **SCTP\_PR\_ASSOC\_STATUS**

  This option is used to get Association-Specific PR-SCTP Status.

  The parameter type is struct sctp\_prstatus, for reading only. sprstat\_assoc\_id is a specified assoc\_id, sprstat\_policy can be SCTP\_PR\_SCTP\_{TTL\|RTX\|PRIO\|ALL}.

- **SCTP\_PR\_STREAM\_STATUS**

  This option is used to get Stream-Specific PR-SCTP Status.

  The parameter type is struct sctp\_prstatus, for reading only. sprstat\_assoc\_id is a specified assoc\_id, sprstat\_policy can be SCTP\_PR\_SCTP\_{TTL\|RTX\|PRIO\|ALL}.

- **SCTP\_RECONFIG\_SUPPORTED**

  Enable the Stream Reconfiguration(RECONF) for the future associations. For different type of requests enabling, see SCTP\_ENABLE\_STREAM\_RESET option.

  The parameter type is struct sctp\_assoc\_value. For reading, assoc\_id is a specified assoc\_id or SCTP\_FUTURE\_ASSOC. For writing, assoc\_id is SCTP\_FUTURE\_ASSOC.

  Default: sysctl\_net.sctp.reconf\_enable. RFC: RFC6525.

- **SCTP\_ENABLE\_STREAM\_RESET**

  This option allows a user to control whether the kernel processes or denies incoming requests in RECONF chunks.

  The parameter type is struct sctp\_assoc\_value. For reading, assoc\_id is a specified assoc\_id or SCTP\_FUTURE\_ASSOC. For writing, assoc\_id is a specified assoc\_id or SCTP\_{FUTURE\|CURRENT\|ALL}\_ASSOC. assoc\_value can be SCTP\_ENABLE\_{RESET\_STREAM\_REQ\|RESET\_ASSOC\_REQ\|CHANGE\_ASSOC\_REQ}.

  Default: 0. Require: SCTP\_RECONFIG\_SUPPORTED.

- **SCTP\_RESET\_STREAMS**

  This option allows the user to request the reset of incoming and/or outgoing streams.

  The parameter type is struct sctp\_reset\_streams, for writing only. srs\_assoc\_id is a specified assoc\_id.

  Require: SCTP\_ENABLE\_STREAM\_RESET.

- **SCTP\_RESET\_ASSOC**

  This option allows a user to request the reset of the SSN/TSN.

  The parameter type is sctp\_assoc\_t, for writing only. It is a specified assoc\_id.

  Require: SCTP\_ENABLE\_STREAM\_RESET.

- **SCTP\_ADD\_STREAMS**

  This option allows a user to request the addition of a number of incoming and/or outgoing streams.

  The parameter type is struct sctp\_add\_streams, for writing only. sas\_assoc\_id is a specified assoc\_id.

  Require: SCTP\_ENABLE\_STREAM\_RESET.

- **SCTP\_STREAM\_SCHEDULER**

  This option is used to select a stream scheduler for data sending.

  The parameter type is struct sctp\_assoc\_value. For reading, assoc\_id is a specified assoc\_id or SCTP\_FUTURE\_ASSOC. For writing, assoc\_id is a specified assoc\_id or SCTP\_{FUTURE\|CURRENT\|ALL}\_ASSOC. assoc\_value can be SCTP\_SS\_{FCFS\|PRIO\|RR\|FC\|WFQ}.

  Default: SCTP\_SS\_FCFS. RFC: RFC8260.

- **SCTP\_STREAM\_SCHEDULER\_VALUE**

  Some stream schedulers require additional information to be set for individual streams.

  The parameter type is struct sctp\_assoc\_value. For reading, assoc\_id is a specified assoc\_id. For writing, assoc\_id is a specified assoc\_id or SCTP\_CURRENT\_ASSOC.

  Require: SCTP\_STREAM\_SCHEDULER.

- **SCTP\_INTERLEAVING\_SUPPORTED**

  This socket option allows the enabling or disabling of the negotiation of user message interleaving support for future associations.

  The parameter type is struct sctp\_assoc\_value. For reading, assoc\_id is a specified assoc\_id or SCTP\_FUTURE\_ASSOC. For writing, assoc\_id is SCTP\_FUTURE\_ASSOC.

  Default: sysctl\_net.sctp.intl\_enable. Require: SCTP\_FRAGMENT\_INTERLEAVE. RFC: RFC8260.

- **SCTP\_ASCONF\_SUPPORTED**

  Enable the Dynamic Address Reconfiguration(ASCONF) for the future associations.

  The parameter type is struct sctp\_assoc\_value. For reading, assoc\_id is a specified assoc\_id or SCTP\_FUTURE\_ASSOC. For writing, assoc\_id is SCTP\_FUTURE\_ASSOC.

  Default: sysctl\_net.sctp.addip\_enable. RFC: RFC5061.

- **SCTP\_AUTO\_ASCONF**

  This option will enable or disable the use of the automatic generation of ASCONF chunks to add and delete addresses to an existing association. Note that this option has two caveats, namely a) it only affects sockets that are bound to all addresses available to the SCTP stack, and b) the system administrator may have an overriding control that turns the ASCONF feature off no matter what setting the socket option may have.

  The parameter type is int boolean, for reading and writing.

  Default: sysctl\_net.sctp.default\_auto\_asconf.

- **SCTP\_AUTH\_SUPPORTED**

  Enable AUTH for the future associations.

  The parameter type is struct sctp\_assoc\_value. For reading, assoc\_id is a specified assoc\_id or SCTP\_FUTURE\_ASSOC. For writing, ssoc\_id is SCTP\_FUTURE\_ASSOC.

  Default: sysctl\_net.sctp.auth\_enable. RFC: RFC4895.

- **SCTP\_ECN\_SUPPORTED**

  Enable ECN for the future associations.

  The parameter type is struct sctp\_assoc\_value. For reading, assoc\_id is a specified assoc\_id or SCTP\_FUTURE\_ASSOC. For writing, assoc\_id is SCTP\_FUTURE\_ASSOC.

  Default: sysctl\_net.sctp.ecn\_enable.

- **SCTP\_REMOTE\_UDP\_ENCAPS\_PORT**

  This option is used to set the encapsulation port(a remote listening or dest port) for SCTP over UDP, which allows SCTP traffic to pass through legacy NATs that do not provide native SCTP support.

  The parameter type is struct sctp\_udpencaps, for reading and writing. sue\_address is a specified transport address or 0, sue\_assoc\_id is a specified assoc\_id or SCTP\_FUTURE\_ASSOC.

  Default: sysctl\_net.sctp.encap\_port. RFC: RFC6951.

- **SCTP\_PLPMTUD\_PROBE\_INTERVAL**

  This option is used to configure the PROBE\_INTERVAL for the Packetization Layer Path MTU Discovery(PLPMTUD). It can be set to a value \>= 5000 or 0(disabled).

  The parameter type is struct sctp\_probeinterval, for reading and writing. spi\_address is a specified transport address or 0, spi\_assoc\_id is a specified assoc\_id or SCTP\_FUTURE\_ASSOC.

  Default: 0(disabled). RFC: RFC8899.

## AUTHORS

Sridhar Samudrala \<sri@us.ibm.com\>

## SEE ALSO

[**socket**(7)](/socket/7.md), [**socket**(2)](/socket/2.md), [**ip**(7)](/ip/7.md), [**bind**(2)](/bind/2.md), [**listen**(2)](/listen/2.md), [**accept**(2)](/accept/2.md), [**connect**(2)](/connect/2.md), [**sendmsg**(2)](/sendmsg/2.md), [**recvmsg**(2)](/recvmsg/2.md), [**sysctl**(2)](/sysctl/2.md), [**getsockopt**(2)](/getsockopt/2.md), [**sctp\_bindx**(3)](/sctp_bindx/3.md), [**sctp\_connectx**(3)](/sctp_connectx/3.md), [**sctp\_sendmsg**(3)](/sctp_sendmsg/3.md), [**sctp\_sendv**(3)](/sctp_sendv/3.md), [**sctp\_send**(3)](/sctp_send/3.md), [**sctp\_recvmsg**(3)](/sctp_recvmsg/3.md), [**sctp\_recvv**(3)](/sctp_recvv/3.md), [**sctp\_peeloff**(3)](/sctp_peeloff/3.md), [**sctp\_getladdrs**(3)](/sctp_getladdrs/3.md), [**sctp\_getpaddrs**(3)](/sctp_getpaddrs/3.md), [**sctp\_opt\_info**(3)](/sctp_opt_info/3.md).

RFC2960, RFC3309 for the SCTP specification.
