SCTP(7)

πŸ“¦
version 1.0.21 Β· 2 versions
, in arch rolling, centos-stream 10, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ¦‹ SCTP(7) πŸ¦‹

okay bestie, this is the SCTP(7) page from the Linux Programmer's Manual, and we are gonna make SCTP make sense together. grab a boba, we're going in. πŸ’–


✨ NAME ✨

sctp β€” the SCTP protocol. that's it, that's the whole name. iconic behaviour. πŸ’…


🌸 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 πŸ’–

So. This is an implementation of the SCTP protocol, exactly as defined in RFC4960. It's a message oriented, reliable transport protocol with direct support for multihoming, and it runs on top of ip(7). It supports both the v4 and v6 versions. no cap. 🫢

Like TCP, SCTP hands you reliable, connection oriented data delivery with congestion control. Unlike TCP, bestie, SCTP also gives you message boundary preservation, ordered and unordered message delivery, multi-streaming and multi-homing. ✨ Detection of data corruption, loss of data and duplication of data? handled with checksums and sequence numbers. And when something does get lost or corrupted, a selective retransmission mechanism swoops in to fix it. she's thorough. πŸ’…

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

πŸŽ€ the one-to-many style πŸŽ€

This one has a 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()

And a typical client uses these calls, in sequence, to set up an association with a server to request services:

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

πŸ¦‹ the one-to-one style πŸ¦‹

This one has a 1 to 1 relationship between socket and association, which means existing TCP applications can be ported to SCTP with very little effort. the way that's a glow-up fr fr. 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 that new socket descriptor to communicate with the client, using recv() and send() calls to get requests and send back responses. Then it calls:

  1. close()

to terminate the association.

And a typical client uses the following system call sequence to set up 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:

  1. close()

to terminate this association when done. and that's the whole lifecycle, periodt. πŸ’…


🌈 ADDRESS FORMATS 🌈

SCTP is built on top of IP (see ip(7)). The address formats defined by ip(7) apply to SCTP too. 🫢

SCTP only supports point-to-point communication. Broadcasting and multicasting are not supported. sorry babe, that's just not the vibe here. πŸ™ˆ

⭐ SYSCTLS ⭐

These variables can be accessed by the /proc/sys/net/sctp/* files, or with the sysctl(2) interface. On top of that, most IP sysctls also apply to SCTP. See ip(7).

Please check the 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. she's giving full transparency. πŸ’–
  • 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. πŸ“

πŸ“Š the snmp counters πŸ“Š

  • 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'. That's an 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. That one is a 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 that's correctly formed, proper checksum and all, but the receiver couldn't identify an appropriate association for it. πŸ™ˆ
  • 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.

that's part 1, bestie β€” and there is so much more coming, don't you dare leave the group chat yet. 🫢

πŸŽ€ CONTROL MSGS πŸŽ€

okay so bestie, the ancillary data rides inside the msg_control field of struct msghdr, and that's the struct you're using in the sendmsg(2) and recvmsg(2) calls. the SCTP stack uses this ancillary data to pass the attributes around β€” things like SCTP_RCVINFO β€” for the message chillin' in msg_iov, handing it to the socket endpoint. every single ancillary data item is preceded by a struct cmsghdr, peep cmsg(3) for that. all the cmsg types for SCTP are listed right here, and every one of these macros and structures lives in /usr/include/netinet/sctp.h. periodt. ✨


  • SCTP_INIT β€” this cmsg hands over the info for initializing new SCTP associations for sendmsg() using struct sctp_initmsg, which is literally the same data structure as the SCTP_INITMSG socket option's. πŸ’–
  • SCTP_SNDRCV β€” this cmsg specifies SCTP options for sendmsg() and describes the SCTP header info about a received message through recvmsg() using struct sctp_sndrcvinfo. it mixes the send path and the receive path together, and SCTP_SNDINFO and SCTP_RCVINFO split that info apart, so those structures are the ones you should use whenever possible, because SCTP_SNDRCV is deprecated. sctp_sendmsg(3) and sctp_send(3) give you a simple way to use this cmsg.
no cap: 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 info about a received message via recvmsg() using struct sctp_extrcvinfo, and this structure is an extended version of SCTP_SNDRCV. note that the 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) gives you a simple way to use this cmsg.
again bestie, the app must use the SCTP_RECVNXTINFO socket option to enable the delivery of this information. 😭
  • SCTP_RCVINFO, SCTP_NXTINFO β€” these cmsgs describe SCTP receive info about a received message through recvmsg() using struct sctp_rcvinfo, plus SCTP receive info of the next message that will be delivered through recvmsg() if that info is already available when the current message is being delivered, using struct sctp_nxtinfo. sctp_recvv(3) gives you a simple way to use these cmsgs.
and yeah, 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 specify a couple of SCTP options for sendmsg() for SEND, PRSCTP, AUTH and DSTADDR info, using struct sctp_sndinfo, sctp_prinfo, sctp_authinfo and in(6)_addr accordingly. sctp_sendv(3) gives you a simple way to use these cmsgs. πŸ’…

✨ EVENTS and NOTIFICATIONS ✨

an SCTP application may need to understand and process the 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. peep the 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 gets 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 the message back 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 gets used to indicate various events. the notification format is struct sctp_pdapi_event. 🧚
  • SCTP_AUTHENTICATION_EVENT β€” this one reports 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's no data to be sent or retransmitted, 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 the message back 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 an SCTP socket option, call getsockopt(2) to read or setsockopt(2) 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. iykyk πŸ’…


  • SCTP_RTOINFO β€” this option gets or sets the protocol parameters used to initialize and bound the 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 gets or sets 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 β€” turns on/off any Nagle-like algorithm. this means 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 as 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, bestie β€” for reading and writing. spp_address is a specified transport address or 0, and 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 β€” okay so if you're the kind of girlie who wants to use the sendto() system call directly, this lets you set up a default lil bundle of parameters that would normally come in through ancillary data. ✨ heads up though: this one has been obsoleted by SCTP_DEFAULT_SNDINFO, so it's giving legacy, not main character.

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 lets you say which notifications and ancillary data you wanna receive. πŸ’Œ And yep, another obsoleted icon β€” SCTP_EVENT is the glow-up that replaced it.

The parameter type is struct sctp_event_subscribe, for reading and writing.

Default: 0.

  • SCTP_I_WANT_MAPPED_V4_ADDR β€” this one flips mapped V4 addresses on or off. πŸ¦‹ Turn it on and if your socket is type PF_INET6, then IPv4 addresses get mapped into V6 representation. Turn it off and no mapping happens at all β€” you'll just receive both PF_INET6 and PF_INET type addresses right there on the socket.

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

Default: 1.

  • SCTP_MAXSEG β€” sets the max size that can go into any outgoing SCTP DATA chunk. If a message is bigger than this, SCTP will fragment it down to the size you said. πŸŽ€ But plot twist: the underlying SCTP implementation can still fragment into smaller chunks whenever the PMTU of the association is smaller than whatever value you set. Setting it to 0 means you are NOT limiting fragmentation at all β€” only the PMTU gets a say in how SCTP picks its 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 β€” lets an application pull the current status tea about an association, including the 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 β€” want the deets on one specific peer address of an association? Reachability state, congestion window, retransmission timer values β€” all of it. 🌈

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 β€” grabs current statistics about an association: 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 three besties all mess with how delayed SACKs get done. They let the app get or set the delayed SACK time (in milliseconds) and also change the delayed SACK frequency. Setting the frequency to 1 disables the delayed SACK algorithm entirely. 🚫 And lowkey important: if sack_delay or sack_freq is 0 when you're setting this option, the current values just stay unchanged. No cap.

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 one lets you set, on an association basis, a default context that you'll receive when reading messages from the peer. 🫢 It's literally so helpful when you're using one-to-many style sockets and you want to keep some reference to an internal state machine that's processing messages on the association. Just know that setting this value only affects messages received from the peer β€” it does not touch the value 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 messages get presented to the receiver. πŸ’… There are three levels, and the way that they stack is genuinely iconic:
    • 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 β€” sets or gets the SCTP partial delivery point. This point is the size of a message where the partial delivery API gets invoked, which helps free up rwnd space for the peer. Lower value = partial deliveries happening more often. πŸ“ This option expects an integer that sets or gets the partial delivery point in bytes.
Not me forgetting to mention: the call will fail if you try to set this value larger than the socket receive buffer size. πŸ’€

Also, any single message with a length smaller than or equal to the SCTP partial delivery point gets delivered in a single read call β€” as long as the buffer you provided is big enough to hold the message. πŸŽ€

The parameter type is uint32_t, for reading and writing.

Default: 0.

  • SCTP_MAX_BURST β€” lets you 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 β€” adds a chunk type that you're requesting to be received only in an authenticated way. And note bestie: it only affects future associations. 🧚

The parameter type is struct sauth_chunk, for writing only.

Default: no chunks. Require: SCTP_AUTH_SUPPORTED. RFC: RFC4895.

  • SCTP_HMAC_IDENT β€” 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 β€” sets a shared secret key that's 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 β€” gets or sets the active shared key 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 says 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 deletes an SCTP association's shared secret key that has already been deactivated. bye bestie πŸ‘‹

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 β€” 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 β€” 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 β€” gets the current number of associations attached to a one-to-many style socket. ⭐
Careful bestie, this number is only a snapshot. Meaning the number of associations may have totally changed by the time the caller gets back the option result. πŸ’€

The parameter type is uint32_t, for reading only.

  • SCTP_GET_ASSOC_ID_LIST β€” 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 you must provide a buffer large enough to hold all the association identifiers. If the buffer is too small, an error must be returned. You can hit up the SCTP_GET_ASSOC_NUMBER socket option to get an idea of how big that buffer has to be. πŸ¦‹

The parameter type is struct sctp_assoc_ids, for reading only.

  • SCTP_EXPOSE_POTENTIALLY_FAILED_STATE, SCTP_EXPOSE_PF_STATE β€” bestie this one is literally the PF-state privacy slider πŸ’… it lets applications control the exposure of the PF path state in the SCTP_PEER_ADDR_CHANGE event. 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 the SCTP_GET_PEER_ADDR_INFO option. So like, gatekeeping but make it a socket option 🫢
    • param type: 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 β€” lets applications control the SCTP-PF behavior by getting or setting the number of consecutive timeouts before a peer address is considered PF or unreachable. Counting strikes, basically ⭐
    • param type: 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 β€” same energy as 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. Glow up version, no cap.
    • param type: 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, iykyk πŸ’–
    • param type: 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. Peeking at what's next, main character behavior 🌸
    • param type: int, for reading and writing
    • Default: 0
  • SCTP_DEFAULT_SNDINFO β€” okay so this option obsoletes SCTP_DEFAULT_SEND_PARAM, rip to that one πŸͺ¦
    • param type: 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() 🚨 so like, timing matters bestie.
    • param type: 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.
    • param type: 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. Subtract era πŸ’€
    • param type: 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. It's giving "new socket, who dis" πŸ¦‹
    • param type: 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. Same peel, extra sprinkles ✨
    • param type: 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 old one, respect your elders πŸ™ˆ
    • param type: 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.
    • param type: 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. Third time's the charm, fr fr πŸ”₯
    • param type: 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.
    • param type: 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.
    • param type: 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. Setting the vibe for every future handshake πŸ’…
    • param type: 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. One event at a time, queen πŸ‘‘
    • param type: 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.
    • param type: 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.
    • param type: 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. Receipts, but for PR-SCTP 🧾
    • param type: 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.
    • param type: 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.
    • param type: 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. Bouncer energy, but for chunks πŸšͺ
    • param type: 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. Fresh start, we love to see it 🌈
    • param type: 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. Clean slate, literally ✨
    • param type: 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. More streams, more problems? no bestie, more streams more opportunities πŸŽ€
    • param type: 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. Choose your fighter πŸ’…
    • param type: 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. Not every scheduler is low-maintenance, and that's okay πŸ¦‹
    • param type: 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 β€” okay so this one lets you enable or disable 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 β€” this turns on 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 β€” enables or disables 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 β€” enables 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. (yes bestie, ssoc_id β€” we are keeping the original spelling exactly, no cap πŸ’…)
    • Default: sysctl_net.sctp.auth_enable. RFC: RFC4895.
  • SCTP_ECN_SUPPORTED β€” enables 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 πŸ‘‘

The iconic author of this page is Sridhar Samudrala <sri@us.ibm.com>. Give them their flowers, bestie. πŸ’


πŸ”— SEE ALSO πŸ”—

socket(7), socket(2), ip(7), bind(2), listen(2), accept(2), connect(2), sendmsg(2), recvmsg(2), sysctl(2), getsockopt(2), sctp_bindx(3), sctp_connectx(3), sctp_sendmsg(3), sctp_sendv(3), sctp_send(3), sctp_recvmsg(3), sctp_recvv(3), sctp_peeloff(3), sctp_getladdrs(3), sctp_getpaddrs(3), sctp_opt_info(3).

RFC2960, RFC3309 for the SCTP specification.


And that's the whole vibe, bestie β€” this page is from the Linux Man Page, dated 2005-10-25, and it's literally SCTP(7). Periodt. πŸ’–βœ¨πŸŽ€