1d8b5fd91SRandall Stewart.\" Copyright (c) 2006, Randall Stewart. 2d8b5fd91SRandall Stewart.\" 3d8b5fd91SRandall Stewart.\" Redistribution and use in source and binary forms, with or without 4d8b5fd91SRandall Stewart.\" modification, are permitted provided that the following conditions 5d8b5fd91SRandall Stewart.\" are met: 6d8b5fd91SRandall Stewart.\" 1. Redistributions of source code must retain the above copyright 7d8b5fd91SRandall Stewart.\" notice, this list of conditions and the following disclaimer. 8d8b5fd91SRandall Stewart.\" 2. Redistributions in binary form must reproduce the above copyright 9d8b5fd91SRandall Stewart.\" notice, this list of conditions and the following disclaimer in the 10d8b5fd91SRandall Stewart.\" documentation and/or other materials provided with the distribution. 11dda5b397SEitan Adler.\" 3. Neither the name of the University nor the names of its contributors 12d8b5fd91SRandall Stewart.\" may be used to endorse or promote products derived from this software 13d8b5fd91SRandall Stewart.\" without specific prior written permission. 14d8b5fd91SRandall Stewart.\" 15d8b5fd91SRandall Stewart.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 16d8b5fd91SRandall Stewart.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17d8b5fd91SRandall Stewart.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18d8b5fd91SRandall Stewart.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 19d8b5fd91SRandall Stewart.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20d8b5fd91SRandall Stewart.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21d8b5fd91SRandall Stewart.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22d8b5fd91SRandall Stewart.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23d8b5fd91SRandall Stewart.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24d8b5fd91SRandall Stewart.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25d8b5fd91SRandall Stewart.\" SUCH DAMAGE. 26d8b5fd91SRandall Stewart.\" 27d8b5fd91SRandall Stewart.\" $FreeBSD$ 28d8b5fd91SRandall Stewart.\" 29*052c5ec4SMark Johnston.Dd July 9, 2020 30d8b5fd91SRandall Stewart.Dt SCTP 4 31d8b5fd91SRandall Stewart.Os 32d8b5fd91SRandall Stewart.Sh NAME 33d8b5fd91SRandall Stewart.Nm sctp 34ab0274e4SChristian Brueffer.Nd Internet Stream Control Transmission Protocol 35d8b5fd91SRandall Stewart.Sh SYNOPSIS 3695033af9SMark Johnston.Cd "options SCTP" 3795033af9SMark Johnston.Cd "options SCTP_SUPPORT" 3895033af9SMark Johnston.Pp 39d8b5fd91SRandall Stewart.In sys/types.h 40d8b5fd91SRandall Stewart.In sys/socket.h 417c376800SRandall Stewart.In netinet/sctp.h 42d8b5fd91SRandall Stewart.Ft int 43d8b5fd91SRandall Stewart.Fn socket AF_INET SOCK_STREAM IPPROTO_SCTP 44d8b5fd91SRandall Stewart.Ft int 45d8b5fd91SRandall Stewart.Fn socket AF_INET SOCK_SEQPACKET IPPROTO_SCTP 46d8b5fd91SRandall Stewart.Sh DESCRIPTION 47d8b5fd91SRandall StewartThe 48d8b5fd91SRandall Stewart.Tn SCTP 49d8b5fd91SRandall Stewartprotocol provides reliable, flow-controlled, two-way 50d8b5fd91SRandall Stewarttransmission of data. 51d8b5fd91SRandall StewartIt is a message oriented protocol and can 52d8b5fd91SRandall Stewartsupport the 53d8b5fd91SRandall Stewart.Dv SOCK_STREAM 54d8b5fd91SRandall Stewartand 55d8b5fd91SRandall Stewart.Dv SOCK_SEQPACKET 56d8b5fd91SRandall Stewartabstractions. 57d8b5fd91SRandall Stewart.Tn SCTP 58d8b5fd91SRandall Stewartuses the standard 59d8b5fd91SRandall StewartInternet address format and, in addition, provides a per-host 60d8b5fd91SRandall Stewartcollection of 61d8b5fd91SRandall Stewart.Dq "port addresses" . 62d8b5fd91SRandall StewartThus, each address is composed of an Internet address specifying 63d8b5fd91SRandall Stewartthe host and network, with a specific 64d8b5fd91SRandall Stewart.Tn SCTP 65d8b5fd91SRandall Stewartport on the host identifying the peer entity. 66d8b5fd91SRandall Stewart.Pp 67d8b5fd91SRandall StewartThere are two models of programming in SCTP. 68d8b5fd91SRandall StewartThe first uses the 69d8b5fd91SRandall Stewart.Dv SOCK_STREAM 70d8b5fd91SRandall Stewartabstraction. 71d8b5fd91SRandall StewartIn this abstraction sockets utilizing the 72d8b5fd91SRandall Stewart.Tn SCTP 73d8b5fd91SRandall Stewartprotocol are either 74d8b5fd91SRandall Stewart.Dq active 75d8b5fd91SRandall Stewartor 76d8b5fd91SRandall Stewart.Dq passive . 77d8b5fd91SRandall StewartActive sockets initiate connections to passive 78d8b5fd91SRandall Stewartsockets. 79d8b5fd91SRandall StewartBy default, 80d8b5fd91SRandall Stewart.Tn SCTP 81d8b5fd91SRandall Stewartsockets are created active; to create a 82d8b5fd91SRandall Stewartpassive socket, the 83d8b5fd91SRandall Stewart.Xr listen 2 84d8b5fd91SRandall Stewartsystem call must be used after binding the socket with the 85d8b5fd91SRandall Stewart.Xr bind 2 86d8b5fd91SRandall Stewartor 87d8b5fd91SRandall Stewart.Xr sctp_bindx 3 88d8b5fd91SRandall Stewartsystem calls. 89d8b5fd91SRandall StewartOnly passive sockets may use the 90d8b5fd91SRandall Stewart.Xr accept 2 91d8b5fd91SRandall Stewartcall to accept incoming connections. 92d8b5fd91SRandall StewartOnly active sockets may use the 93d8b5fd91SRandall Stewart.Xr connect 2 94d8b5fd91SRandall Stewartcall to initiate connections. 95d8b5fd91SRandall Stewart.Pp 96d8b5fd91SRandall StewartThe other abstraction 97d8b5fd91SRandall Stewart.Dv SOCK_SEQPACKET 98d8b5fd91SRandall Stewartprovides a 99d8b5fd91SRandall Stewart.Dq connectionless 100d8b5fd91SRandall Stewartmode of operation in that the user may send to an address 101d8b5fd91SRandall Stewart(using any of the valid send calls that carry a 102d8b5fd91SRandall Stewartsocket address) and an association will be setup 103d8b5fd91SRandall Stewartimplicitly by the underlying 104d8b5fd91SRandall Stewart.Tn SCTP 105d8b5fd91SRandall Stewarttransport stack. 106d8b5fd91SRandall StewartThis abstraction is the only one capable of sending data on the 107d8b5fd91SRandall Stewartthird leg of the four-way handshake. 108d8b5fd91SRandall StewartA user must still call 109d8b5fd91SRandall Stewart.Xr listen 2 110d8b5fd91SRandall Stewartto allow the socket to accept connections. 111d8b5fd91SRandall StewartCalling 112d8b5fd91SRandall Stewart.Xr listen 2 113d8b5fd91SRandall Stewarthowever does not restrict the user from still initiating 114d8b5fd91SRandall Stewartimplicit connections to other peers. 115d8b5fd91SRandall Stewart.Pp 116d8b5fd91SRandall StewartThe 117d8b5fd91SRandall Stewart.Tn SCTP 118d8b5fd91SRandall Stewartprotocol directly supports multi-homing. 119d8b5fd91SRandall StewartSo when binding a socket with the 120d8b5fd91SRandall Stewart.Dq wildcard 121d8b5fd91SRandall Stewartaddress 122d8b5fd91SRandall Stewart.Dv INADDR_ANY , 123d8b5fd91SRandall Stewartthe 124d8b5fd91SRandall Stewart.Tn SCTP 125d8b5fd91SRandall Stewartstack will inform the peer about all of the local addresses 126d8b5fd91SRandall Stewartthat are deemed in scope of the peer. 127d8b5fd91SRandall StewartThe peer will then possibly have multiple paths to reach the local host. 128d8b5fd91SRandall Stewart.Pp 129d8b5fd91SRandall StewartThe 130d8b5fd91SRandall Stewart.Tn SCTP 131d8b5fd91SRandall Stewarttransport protocol is also multi-streamed. 132d8b5fd91SRandall StewartMulti-streaming refers to the ability to send sub-ordered flows of 133d8b5fd91SRandall Stewartmessages. 134d8b5fd91SRandall StewartA user performs this by specifying a specific stream in one of the 135d8b5fd91SRandall Stewartextended send calls such as the 136d8b5fd91SRandall Stewart.Xr sctp_send 3 137d8b5fd91SRandall Stewartfunction call. 138d8b5fd91SRandall StewartSending messages on different streams will allow parallel delivery 139d8b5fd91SRandall Stewartof data i.e., a message loss in stream 1 will not block the delivery 140d8b5fd91SRandall Stewartof messages sent in stream 2. 141d8b5fd91SRandall Stewart.Pp 142d8b5fd91SRandall StewartThe 143d8b5fd91SRandall Stewart.Tn SCTP 144d8b5fd91SRandall Stewarttransport protocol also provides a unordered service as well. 145d8b5fd91SRandall StewartThe unordered service allows a message to be sent and delivered 146d8b5fd91SRandall Stewartwith no regard to the ordering of any other message. 147*052c5ec4SMark Johnston.Pp 148*052c5ec4SMark JohnstonThe 149*052c5ec4SMark Johnston.Tn SCTP 150*052c5ec4SMark Johnstonkernel implementation may either be compiled into the kernel, or loaded 151*052c5ec4SMark Johnstondynamically as a module. 152*052c5ec4SMark JohnstonTo support dynamic loading of the stack, the kernel must be compiled 153*052c5ec4SMark Johnstonwith 154*052c5ec4SMark Johnston.Cd "options SCTP_SUPPORT" . 155d8b5fd91SRandall Stewart.Ss Extensions 156*052c5ec4SMark JohnstonThe 157*052c5ec4SMark Johnston.Fx 158*052c5ec4SMark Johnstonimplementation of 159d8b5fd91SRandall Stewart.Tn SCTP 160d8b5fd91SRandall Stewartalso supports the following extensions: 161de00ad05SMichael Tuexen.Bl -tag -width "sctp partial reliability" 162d8b5fd91SRandall Stewart.It "sctp partial reliability" 163d8b5fd91SRandall StewartThis extension allows one to have message be skipped and 164d8b5fd91SRandall Stewartnot delivered based on some user specified parameters. 165d8b5fd91SRandall Stewart.It "sctp dynamic addressing" 166d8b5fd91SRandall StewartThis extension allows addresses to be added and deleted 167869978d4SRebecca Crandynamically from an existing association. 168d8b5fd91SRandall Stewart.It "sctp authentication" 169d8b5fd91SRandall StewartThis extension allows the user to authenticate specific 170d8b5fd91SRandall Stewartpeer chunks (including data) to validate that the peer 171d8b5fd91SRandall Stewartwho sent the message is in fact the peer who setup the 172d8b5fd91SRandall Stewartassociation. 173d8b5fd91SRandall StewartA shared key option is also provided for 174d8b5fd91SRandall Stewartso that two stacks can pre-share keys. 175d8b5fd91SRandall Stewart.It "packet drop" 176d8b5fd91SRandall StewartSome routers support a special satellite protocol that 177d8b5fd91SRandall Stewartwill report losses due to corruption. 178d8b5fd91SRandall StewartThis allows retransmissions without subsequent loss in bandwidth 179d8b5fd91SRandall Stewartutilization. 180d8b5fd91SRandall Stewart.It "stream reset" 181d8b5fd91SRandall StewartThis extension allows a user on either side to reset the 182d8b5fd91SRandall Stewartstream sequence numbers used by any or all streams. 183d8b5fd91SRandall Stewart.El 184de00ad05SMichael Tuexen.Ss Socket Options 185d8b5fd91SRandall Stewart.Tn SCTP 186d8b5fd91SRandall Stewartsupports a number of socket options which can be set with 187d8b5fd91SRandall Stewart.Xr setsockopt 2 188d8b5fd91SRandall Stewartand tested with 189d8b5fd91SRandall Stewart.Xr getsockopt 2 190d8b5fd91SRandall Stewartor 1912cacf8cfSPeter Pentchev.Xr sctp_opt_info 3 : 1921adc28f5SChristian Brueffer.Bl -tag -width indent 193d8b5fd91SRandall Stewart.It Dv SCTP_NODELAY 194d8b5fd91SRandall StewartUnder most circumstances, 195d8b5fd91SRandall Stewart.Tn SCTP 196d8b5fd91SRandall Stewartsends data when it is presented; when outstanding data has not 197d8b5fd91SRandall Stewartyet been acknowledged, it gathers small amounts of output to be 198d8b5fd91SRandall Stewartsent in a single packet once an acknowledgement is received. 199d8b5fd91SRandall StewartFor some clients, such as window systems that send a stream of 200d8b5fd91SRandall Stewartmouse events which receive no replies, this packetization may 201d8b5fd91SRandall Stewartcause significant delays. 202d8b5fd91SRandall StewartThe boolean option 203d8b5fd91SRandall Stewart.Dv SCTP_NODELAY 204d8b5fd91SRandall Stewartdefeats this algorithm. 205d8b5fd91SRandall Stewart.It Dv SCTP_RTOINFO 206d8b5fd91SRandall StewartThis option returns specific information about an associations 207d8b5fd91SRandall Stewart.Dq "Retransmission Time Out" . 208d8b5fd91SRandall StewartIt can also be used to change the default values. 209d8b5fd91SRandall Stewart.It Dv SCTP_ASSOCINFO 210d8b5fd91SRandall StewartThis option returns specific information about the requested 211d8b5fd91SRandall Stewartassociation. 212d8b5fd91SRandall Stewart.It Dv SCTP_INITMSG 213d8b5fd91SRandall StewartThis option allows you to get or set the default sending 214d8b5fd91SRandall Stewartparameters when an association is implicitly setup. 215c2025a76SJoel DahlIt allows you to change such things as the maximum number of 216d8b5fd91SRandall Stewartstreams allowed inbound and the number of streams requested 217d8b5fd91SRandall Stewartof the peer. 218d8b5fd91SRandall Stewart.It Dv SCTP_AUTOCLOSE 219d8b5fd91SRandall StewartFor the one-to-many model 220d8b5fd91SRandall Stewart.Dv ( SOCK_SEQPACKET ) 221d8b5fd91SRandall Stewartassociations are setup implicitly. 222d8b5fd91SRandall StewartThis option allows the user to specify a default number of idle 223d8b5fd91SRandall Stewartseconds to allow the association be maintained. 224d8b5fd91SRandall StewartAfter the idle timer (where no user message have been sent or have 225d8b5fd91SRandall Stewartbeen received from the peer) the association will be gracefully 226d8b5fd91SRandall Stewartclosed. 227d8b5fd91SRandall StewartThe default for this value is 0, or unlimited (i.e., no automatic 228d8b5fd91SRandall Stewartclose). 229d8b5fd91SRandall Stewart.It Dv SCTP_SET_PEER_PRIMARY_ADDR 230d8b5fd91SRandall StewartThe dynamic address extension allows a peer to also request a 231d8b5fd91SRandall Stewartparticular address of its be made into the primary address. 232d8b5fd91SRandall StewartThis option allows the caller to make such a request to a peer. 233d8b5fd91SRandall StewartNote that if the peer does not also support the dynamic address 234d8b5fd91SRandall Stewartextension, this call will fail. 235d8b5fd91SRandall StewartNote the caller must provide a valid local address that the peer has 236d8b5fd91SRandall Stewartbeen told about during association setup or dynamically. 237d8b5fd91SRandall Stewart.It Dv SCTP_PRIMARY_ADDR 238d8b5fd91SRandall StewartThis option allows the setting of the primary address 239d8b5fd91SRandall Stewartthat the caller wishes to send to. 240d8b5fd91SRandall StewartThe caller provides the address of a peer that is to be made primary. 241d8b5fd91SRandall Stewart.It Dv SCTP_ADAPTATION_LAYER 242d8b5fd91SRandall StewartThe dynamic address extension also allows a user to 243d8b5fd91SRandall Stewartpass a 32 bit opaque value upon association setup. 244d8b5fd91SRandall StewartThis option allows a user to set or get this value. 245d8b5fd91SRandall Stewart.It Dv SCTP_DISABLE_FRAGMENTS 246d8b5fd91SRandall StewartBy default 247d8b5fd91SRandall Stewart.Tn SCTP 248d8b5fd91SRandall Stewartwill fragment user messages into multiple pieces that 249d8b5fd91SRandall Stewartwill fit on the network and then later, upon reception, reassemble 250d8b5fd91SRandall Stewartthe pieces into a single user message. 251d8b5fd91SRandall StewartIf this option is enabled instead, any send that exceeds the path 252d8b5fd91SRandall Stewartmaximum transfer unit (P-MTU) will fail and the message will NOT be 253d8b5fd91SRandall Stewartsent. 254d8b5fd91SRandall Stewart.It Dv SCTP_PEER_ADDR_PARAMS 255d8b5fd91SRandall StewartThis option will allow a user to set or get specific 256d8b5fd91SRandall Stewartpeer address parameters. 257d8b5fd91SRandall Stewart.It Dv SCTP_DEFAULT_SEND_PARAM 258d8b5fd91SRandall StewartWhen a user does not use one of the extended send 259d8b5fd91SRandall Stewartcalls (e.g., 260d8b5fd91SRandall Stewart.Xr sctp_sendmsg 3 ) 261d8b5fd91SRandall Stewarta set of default values apply to each send. 262d8b5fd91SRandall StewartThese values include things like the stream number to send 263d8b5fd91SRandall Stewartto as well as the per-protocol id. 264d8b5fd91SRandall StewartThis option lets a caller both get and set these values. 265d8b5fd91SRandall StewartIf the user changes these default values, then these new values will 266d8b5fd91SRandall Stewartbe used as the default whenever no information is provided by the 267d8b5fd91SRandall Stewartsender (i.e., the non-extended API is used). 268d8b5fd91SRandall Stewart.It Dv SCTP_EVENTS 269d8b5fd91SRandall Stewart.Tn SCTP 270d8b5fd91SRandall Stewarthas non-data events that it can communicate 271d8b5fd91SRandall Stewartto its application. 272d8b5fd91SRandall StewartBy default these are all disabled since they arrive in the data path 273d8b5fd91SRandall Stewartwith a special flag 274d8b5fd91SRandall Stewart.Dv MSG_NOTIFICATION 275d8b5fd91SRandall Stewartset upon the received message. 276d8b5fd91SRandall StewartThis option lets a caller 277d8b5fd91SRandall Stewartboth get what events are current being received 278d8b5fd91SRandall Stewartas well as set different events that they may be interested 279d8b5fd91SRandall Stewartin receiving. 280d8b5fd91SRandall Stewart.It Dv SCTP_I_WANT_MAPPED_V4_ADDR 281d8b5fd91SRandall Stewart.Tn SCTP 282d8b5fd91SRandall Stewartsupports both IPV4 and IPV6. 283d8b5fd91SRandall StewartAn association may span both IPV4 and IPV6 addresses since 284d8b5fd91SRandall Stewart.Tn SCTP 285d8b5fd91SRandall Stewartis multi-homed. 286d8b5fd91SRandall StewartBy default, when opening an IPV6 socket, when 287d8b5fd91SRandall Stewartdata arrives on the socket from a peer's 288d8b5fd91SRandall StewartV4 address the V4 address will be presented with an address family 289d8b5fd91SRandall Stewartof AF_INET. 290c2025a76SJoel DahlIf this is undesirable, then this option 291d8b5fd91SRandall Stewartcan be enabled which will then convert all V4 addresses 292d8b5fd91SRandall Stewartinto mapped V6 representations. 293d8b5fd91SRandall Stewart.It Dv SCTP_MAXSEG 294d8b5fd91SRandall StewartBy default 295d8b5fd91SRandall Stewart.Tn SCTP 296d8b5fd91SRandall Stewartchooses its message fragmentation point 297d8b5fd91SRandall Stewartbased upon the smallest P-MTU of the peer. 298d8b5fd91SRandall StewartThis option lets the caller set it to a smaller value. 299d8b5fd91SRandall StewartNote that while the user can change this value, if the P-MTU 300d8b5fd91SRandall Stewartis smaller than the value set by the user, then the P-MTU 301d8b5fd91SRandall Stewartvalue will override any user setting. 302d8b5fd91SRandall Stewart.It Dv SCTP_DELAYED_ACK_TIME 303d8b5fd91SRandall StewartThis option lets the user both set and get the 304d8b5fd91SRandall Stewartdelayed ack time (in milliseconds) that 305d8b5fd91SRandall Stewart.Tn SCTP 306d8b5fd91SRandall Stewartis using. 307d8b5fd91SRandall StewartThe default is 200 milliseconds. 308d8b5fd91SRandall Stewart.It Dv SCTP_PARTIAL_DELIVERY_POINT 309d8b5fd91SRandall Stewart.Tn SCTP 310d8b5fd91SRandall Stewartat times may need to start delivery of a 311d8b5fd91SRandall Stewartvery large message before the entire message has 312d8b5fd91SRandall Stewartarrived. 313d8b5fd91SRandall StewartBy default SCTP waits until the incoming 314d8b5fd91SRandall Stewartmessage is larger than one fourth of the receive 315d8b5fd91SRandall Stewartbuffer. 316d8b5fd91SRandall StewartThis option allows the stacks value 317d8b5fd91SRandall Stewartto be overridden with a smaller value. 318d8b5fd91SRandall Stewart.It Dv SCTP_FRAGMENT_INTERLEAVE 319d8b5fd91SRandall Stewart.Tn SCTP 320d8b5fd91SRandall Stewartat times will start partial delivery (as mentioned above). 321d8b5fd91SRandall StewartIn the normal case successive reads will continue to return 322d8b5fd91SRandall Stewartthe rest of the message, blocking if needed, until all of 323d8b5fd91SRandall Stewartthat message is read. 324d8b5fd91SRandall StewartHowever this means other messages may have arrived and be ready 325d8b5fd91SRandall Stewartfor delivery and be blocked behind the message being partially 326d8b5fd91SRandall Stewartdelivered. 327d8b5fd91SRandall StewartIf this option is enabled, when a partial delivery 328d8b5fd91SRandall Stewartmessage has no more data to be received, then a subsequent 329d8b5fd91SRandall Stewartread may return a different message that is ready for delivery. 330d8b5fd91SRandall StewartBy default this option is off since the user must be using the 331d8b5fd91SRandall Stewartextended API's to be able to tell the difference between 332d8b5fd91SRandall Stewartmessages (via the stream and stream sequence number). 333d8b5fd91SRandall Stewart.It Dv SCTP_AUTH_CHUNK 334d8b5fd91SRandall StewartBy default only the dynamic addressing chunks are 335d8b5fd91SRandall Stewartauthenticated. 336d8b5fd91SRandall StewartThis option lets a user request an 337d8b5fd91SRandall Stewartadditional chunk be authenticated as well. 338d8b5fd91SRandall StewartNote that successive calls to this option will work and continue 339d8b5fd91SRandall Stewartto add more chunks that require authentication. 340d8b5fd91SRandall StewartNote that this option only effects future associations and 341d8b5fd91SRandall Stewartnot existing ones. 342d8b5fd91SRandall Stewart.It Dv SCTP_AUTH_KEY 343d8b5fd91SRandall StewartThis option allows a user to specify a shared 344d8b5fd91SRandall Stewartkey that can be later used to authenticate 345d8b5fd91SRandall Stewarta peer. 346d8b5fd91SRandall Stewart.It Dv SCTP_HMAC_IDENT 347d8b5fd91SRandall StewartThis option will let you get or set the list of 348d8b5fd91SRandall StewartHMAC algorithms used to authenticate peers. 349d8b5fd91SRandall StewartNote that the HMAC values are in priority order where 350c2025a76SJoel Dahlthe first HMAC identifier is the most preferred 351c2025a76SJoel Dahland the last is the least preferred. 352d8b5fd91SRandall Stewart.It Dv SCTP_AUTH_ACTIVE_KEY 353d8b5fd91SRandall StewartThis option allows you to make a key active for 354d8b5fd91SRandall Stewartthe generation of authentication information. 355d8b5fd91SRandall StewartNote that the peer must have the same key or else the 356d8b5fd91SRandall Stewartdata will be discarded. 357d8b5fd91SRandall Stewart.It Dv SCTP_AUTH_DELETE_KEY 358d8b5fd91SRandall StewartThis option allows you to delete an old key. 359d8b5fd91SRandall Stewart.It Dv SCTP_USE_EXT_RECVINFO 360d8b5fd91SRandall StewartThe sockets api document allows an extended 361d8b5fd91SRandall Stewartsend/receive information structure to be used. 362d8b5fd91SRandall StewartThe extended structure includes additional fields 363d8b5fd91SRandall Stewartrelated to the next message to be received (after the 364d8b5fd91SRandall Stewartcurrent receive completes) if such information is known. 365d8b5fd91SRandall StewartBy default the system will not pass this information. 366d8b5fd91SRandall StewartThis option allows the user to request this information. 367d8b5fd91SRandall Stewart.It Dv SCTP_AUTO_ASCONF 368d8b5fd91SRandall StewartBy default when bound to all address and the system administrator has 369d8b5fd91SRandall Stewartenables automatic dynamic addresses, the 370d8b5fd91SRandall Stewart.Tn SCTP 371d8b5fd91SRandall Stewartstack will automatically generate address changes into add and 372d8b5fd91SRandall Stewartdelete requests to any peers by setting this option to 373d8b5fd91SRandall Stewarttrue. 374d8b5fd91SRandall StewartThis option allows an endpoint to disable that behavior. 375d8b5fd91SRandall Stewart.It Dv SCTP_MAXBURST 376d8b5fd91SRandall StewartBy default 377d8b5fd91SRandall Stewart.Tn SCTP 378d8b5fd91SRandall Stewartimplements micro-burst control so that as the congestion window 379d8b5fd91SRandall Stewartopens up no large burst of packets can be generated. 380d8b5fd91SRandall StewartThe default burst limit is four. 381d8b5fd91SRandall StewartThis option lets the user change this value. 382d8b5fd91SRandall Stewart.It Dv SCTP_CONTEXT 383d8b5fd91SRandall StewartMany sctp extended calls have a context field. 384d8b5fd91SRandall StewartThe context field is a 32 bit opaque value that will be returned in 385d8b5fd91SRandall Stewartsend failures. 386d8b5fd91SRandall StewartThis option lets the caller set the default 387d8b5fd91SRandall Stewartcontext value to use when none is provided by the user. 388d8b5fd91SRandall Stewart.It Dv SCTP_EXPLICIT_EOR 389d8b5fd91SRandall StewartBy default, a single send is a complete message. 390d8b5fd91SRandall Stewart.Tn SCTP 391d8b5fd91SRandall Stewartgenerates an implied record boundary. 392d8b5fd91SRandall StewartIf this option is enabled, then all sends are part of the same message 393d8b5fd91SRandall Stewartuntil the user indicates an end of record with the 394d8b5fd91SRandall Stewartspecial flag 395d8b5fd91SRandall Stewart.Dv SCTP_EOR 396d8b5fd91SRandall Stewartpassed in the sctp_sndrcvinfo flags field. 397d8b5fd91SRandall StewartThis effectively makes all sends part of the same message 398f6ac2391SJoel Dahluntil the user specifies differently. 399d8b5fd91SRandall StewartThis means that a caller must NOT change the stream number until 400d8b5fd91SRandall Stewartafter the 401d8b5fd91SRandall Stewart.Dv SCTP_EOR 402d8b5fd91SRandall Stewartis passed to 403d8b5fd91SRandall Stewart.Tn SCTP 404d8b5fd91SRandall Stewartelse an error will be returned. 405d8b5fd91SRandall Stewart.It Dv SCTP_STATUS 40662cb31dcSWarner LoshThis option is a read-only option that returns 407d8b5fd91SRandall Stewartvarious status information about the specified association. 408d8b5fd91SRandall Stewart.It Dv SCTP_GET_PEER_ADDR_INFO 40962cb31dcSWarner LoshThis read-only option returns information about a peer 410d8b5fd91SRandall Stewartaddress. 411d8b5fd91SRandall Stewart.It Dv SCTP_PEER_AUTH_CHUNKS 41262cb31dcSWarner LoshThis read-only option returns a list of the chunks 413d8b5fd91SRandall Stewartthe peer requires to be authenticated. 414d8b5fd91SRandall Stewart.It Dv SCTP_LOCAL_AUTH_CHUNKS 41562cb31dcSWarner LoshThis read-only option returns a list of the locally 416d8b5fd91SRandall Stewartrequired chunks that must be authenticated. 417d8b5fd91SRandall Stewart.It Dv SCTP_RESET_STREAMS 418d8b5fd91SRandall StewartThis socket option is used to cause a stream sequence 419d8b5fd91SRandall Stewartnumber or all stream sequence numbers to be reset. 420d8b5fd91SRandall StewartNote that the peer 421d8b5fd91SRandall Stewart.Tn SCTP 422d8b5fd91SRandall Stewartendpoint must also support the stream reset extension 423d8b5fd91SRandall Stewartas well. 424d8b5fd91SRandall Stewart.El 425de00ad05SMichael Tuexen.Ss MIB Variables 426de00ad05SMichael TuexenThe 427de00ad05SMichael Tuexen.Tn SCTP 428de00ad05SMichael Tuexenprotocol implements a number of variables in the 429de00ad05SMichael Tuexen.Va net.inet.sctp 430de00ad05SMichael Tuexenbranch of the 431de00ad05SMichael Tuexen.Xr sysctl 3 432de00ad05SMichael TuexenMIB. 433de00ad05SMichael Tuexen.Bl -ohang 434de00ad05SMichael Tuexen.It Sy Congestion Control 435de00ad05SMichael Tuexen.Bl -tag -width indent 436de00ad05SMichael Tuexen.It Va default_cc_module 437de00ad05SMichael TuexenDefault congestion control module. 438de00ad05SMichael TuexenDefault value is 0. 439de00ad05SMichael TuexenThe minimum is 0, and the maximum is 3. 440de00ad05SMichael TuexenA value of 0 enables the default congestion control algorithm. 441de00ad05SMichael TuexenA value of 1 enables the High Speed congestion control algorithm. 442de00ad05SMichael TuexenA value of 2 enables the HTCP congestion control algorithm. 443de00ad05SMichael TuexenA value of 3 enables the data center congestion control (DCCC) algorithm. 444de00ad05SMichael Tuexen.It Va initial_cwnd 445de00ad05SMichael TuexenDefines the initial congestion window size in MTUs. 446de00ad05SMichael Tuexen.It Va cwnd_maxburst 447de00ad05SMichael TuexenUse congestion control instead of 'blind' logic to limit maximum burst when sending. 448de00ad05SMichael TuexenDefault value is 1. May be set to 0 or 1. 449de00ad05SMichael Tuexen.It Va ecn_enable 450de00ad05SMichael TuexenEnable Explicit Congestion Notification (ECN). 451de00ad05SMichael TuexenDefault value is 1. May be set to 0 or 1. 452de00ad05SMichael Tuexen.It Va rttvar_steady_step 453de00ad05SMichael TuexenNumber of identical bandwidth measurements DCCC takes to try step down the congestion window. 454de00ad05SMichael TuexenDefault value is 20. 455de00ad05SMichael TuexenThe minimum is 0, and the maximum is 65535. 456de00ad05SMichael Tuexen.It Va rttvar_eqret 457de00ad05SMichael TuexenWhether DCCC reduces the congestion window size when round-trip time and bandwidth remain unchanged. 458de00ad05SMichael TuexenDefault value is 0. 459de00ad05SMichael TuexenMay be set to 0 or 1. 460de00ad05SMichael Tuexen.It Va rttvar_bw 461de00ad05SMichael TuexenShift amount DCCC uses for bandwidth smoothing on round-trip-time calculation. 462de00ad05SMichael TuexenDefault value is 4. 463de00ad05SMichael TuexenThe minimum is 0, and the maximum is 32. 464de00ad05SMichael Tuexen.It Va rttvar_rtt 465de00ad05SMichael TuexenShift amount DCCC uses for round-trip-time smoothing on round-trip-time calculation. 466de00ad05SMichael TuexenDefault value is 5. 467de00ad05SMichael TuexenThe minimum is 0, and the maximum is 32. 468de00ad05SMichael Tuexen.It Va use_dcccecn 469de00ad05SMichael TuexenEnable ECN when using DCCC. 470de00ad05SMichael TuexenDefault value is 1. 471de00ad05SMichael TuexenMay be set to 0 or 1. 472de00ad05SMichael Tuexen.El 473de00ad05SMichael Tuexen.It Sy Misc 474de00ad05SMichael Tuexen.Bl -tag -width indent 475de00ad05SMichael Tuexen.It Va getcred 476de00ad05SMichael TuexenGet the ucred of a SCTP connection. 477de00ad05SMichael Tuexen.It Va assoclist 478de00ad05SMichael TuexenList of active SCTP associations. 479de00ad05SMichael Tuexen.It Va stats 480de00ad05SMichael TuexenSCTP statistics (struct sctp_stat). 481de00ad05SMichael Tuexen.It Va diag_info_code 482de00ad05SMichael TuexenDiagnostic information error cause code. 483de00ad05SMichael Tuexen.It Va blackhole 484de00ad05SMichael TuexenEnable SCTP blackholing. 485de00ad05SMichael TuexenSee 486de00ad05SMichael Tuexen.Xr blackhole 4 487de00ad05SMichael Tuexenfor more details. 488ae7cc6c9SMichael Tuexen.It Va sendall_limit 489ae7cc6c9SMichael TuexenMaximum message size (in bytes) that can be transmitted with SCTP_SENDALL flags set. 490de00ad05SMichael Tuexen.It Va buffer_splitting 491de00ad05SMichael TuexenEnable send/receive buffer splitting. 492de00ad05SMichael Tuexen.It Va vtag_time_wait 493de00ad05SMichael TuexenVtag wait time in seconds, 0 to disable. 494de00ad05SMichael Tuexen.It Va nat_friendly_init 495de00ad05SMichael TuexenEnable sending of the NAT-friendly SCTP option on INITs. 496de00ad05SMichael Tuexen.It Va enable_sack_immediately 497de00ad05SMichael TuexenEnable sending of the SACK-IMMEDIATELY bit. 498de00ad05SMichael Tuexen.It Va udp_tunneling_port 499de00ad05SMichael TuexenSet the SCTP/UDP tunneling port. 500de00ad05SMichael Tuexen.It Va mobility_fasthandoff 501de00ad05SMichael TuexenEnable SCTP fast handoff. 502de00ad05SMichael Tuexen.It Va mobility_base 503de00ad05SMichael TuexenEnable SCTP base mobility 504de00ad05SMichael Tuexen.It Va default_frag_interleave 505de00ad05SMichael TuexenDefault fragment interleave level. 506de00ad05SMichael Tuexen.It Va default_ss_module 507de00ad05SMichael TuexenDefault stream scheduling module. 508de00ad05SMichael Tuexen.It Va log_level 509de00ad05SMichael TuexenLtrace/KTR trace logging level. 510de00ad05SMichael Tuexen.It Va max_retran_chunk 511de00ad05SMichael TuexenNumber of retransmissions of a DATA chunk before an association is aborted. 512de00ad05SMichael Tuexen.It Va min_residual 513de00ad05SMichael TuexenMinimum residual data chunk in second part of split. 514de00ad05SMichael Tuexen.It Va strict_data_order 515de00ad05SMichael TuexenEnforce strict data ordering, abort if control inside data. 516de00ad05SMichael Tuexen.It Va abort_at_limit 517de00ad05SMichael TuexenAbort when one-to-one hits qlimit. 518de00ad05SMichael Tuexen.It Va hb_max_burst 519de00ad05SMichael TuexenConfirmation heartbeat max burst. 520de00ad05SMichael Tuexen.It Va do_sctp_drain 521de00ad05SMichael TuexenFlush chunks in receive queues with TSN higher than the cumulative TSN if the 522de00ad05SMichael Tuexensystem is low on mbufs. 523de00ad05SMichael Tuexen.It Va max_chained_mbufs 524de00ad05SMichael TuexenDefault max number of small mbufs on a chain. 525de00ad05SMichael Tuexen.It Va abc_l_var 526de00ad05SMichael TuexenSCTP ABC max increase per SACK (L). 527de00ad05SMichael Tuexen.It Va nat_friendly 528de00ad05SMichael TuexenSCTP NAT friendly operation. 529de00ad05SMichael Tuexen.It Va cmt_use_dac 530de00ad05SMichael TuexenCMT DAC on/off flag. 531de00ad05SMichael Tuexen.It Va cmt_on_off 532de00ad05SMichael TuexenCMT settings. 533de00ad05SMichael Tuexen.It Va outgoing_streams 534de00ad05SMichael TuexenDefault number of outgoing streams. 535de00ad05SMichael Tuexen.It Va incoming_streams 536de00ad05SMichael TuexenDefault number of incoming streams. 537de00ad05SMichael Tuexen.It Va add_more_on_output 538de00ad05SMichael TuexenWhen space-wise is it worthwhile to try to add more to a socket send buffer. 539de00ad05SMichael Tuexen.It Va path_pf_threshold 540de00ad05SMichael TuexenDefault potentially failed threshold. 541de00ad05SMichael Tuexen.It Va path_rtx_max 542de00ad05SMichael TuexenDefault maximum of retransmissions per path. 543de00ad05SMichael Tuexen.It Va assoc_rtx_max 544de00ad05SMichael TuexenDefault maximum number of retransmissions per association. 545de00ad05SMichael Tuexen.It Va init_rtx_max 546de00ad05SMichael TuexenDefault maximum number of retransmissions for INIT chunks. 547de00ad05SMichael Tuexen.It Va valid_cookie_life 548de00ad05SMichael TuexenDefault cookie lifetime in seconds. 549de00ad05SMichael Tuexen.It Va init_rto_max 550de00ad05SMichael TuexenDefault maximum retransmission timeout during association setup in ms. 551de00ad05SMichael Tuexen.It Va rto_initial 552de00ad05SMichael TuexenDefault initial retransmission timeout in ms. 553de00ad05SMichael Tuexen.It Va rto_min 554de00ad05SMichael TuexenDefault minimum retransmission timeout in ms. 555de00ad05SMichael Tuexen.It Va rto_max 556de00ad05SMichael TuexenDefault maximum retransmission timeout in ms. 557de00ad05SMichael Tuexen.It Va secret_lifetime 558de00ad05SMichael TuexenDefault secret lifetime in seconds. 559de00ad05SMichael Tuexen.It Va shutdown_guard_time 560de00ad05SMichael TuexenShutdown guard timer in seconds (0 means 5 times RTO.Max). 561de00ad05SMichael Tuexen.It Va pmtu_raise_time 562de00ad05SMichael TuexenDefault PMTU raise timer in seconds. 563de00ad05SMichael Tuexen.It Va heartbeat_interval 564de00ad05SMichael TuexenDefault heartbeat interval in ms. 565de00ad05SMichael Tuexen.It Va asoc_resource 566de00ad05SMichael TuexenMax number of cached resources in an association. 567de00ad05SMichael Tuexen.It Va sys_resource 568de00ad05SMichael TuexenMax number of cached resources in the system. 569de00ad05SMichael Tuexen.It Va sack_freq 570de00ad05SMichael TuexenDefault SACK frequency. 571de00ad05SMichael Tuexen.It Va delayed_sack_time 572de00ad05SMichael TuexenDefault delayed SACK timer in ms. 573de00ad05SMichael Tuexen.It Va chunkscale 574de00ad05SMichael TuexenTunable for scaling of number of chunks and messages. 575de00ad05SMichael Tuexen.It Va min_split_point 576de00ad05SMichael TuexenMinimum size when splitting a chunk. 577de00ad05SMichael Tuexen.It Va pcbhashsize 578de00ad05SMichael TuexenTunable for PCB hash table sizes. 579de00ad05SMichael Tuexen.It Va tcbhashsize 580de00ad05SMichael TuexenTunable for TCB hash table sizes. 581de00ad05SMichael Tuexen.It Va maxchunks 582de00ad05SMichael TuexenDefault max chunks on queue per association. 583de00ad05SMichael Tuexen.It Va fr_maxburst 584de00ad05SMichael TuexenDefault max burst for SCTP endpoints when fast retransmitting. 585de00ad05SMichael Tuexen.It Va maxburst 586de00ad05SMichael TuexenDefault max burst for SCTP endpoints. 587de00ad05SMichael Tuexen.It Va peer_chkoh 588de00ad05SMichael TuexenAmount to debit peers rwnd per chunk sent. 589de00ad05SMichael Tuexen.It Va strict_sacks 590de00ad05SMichael TuexenEnable SCTP Strict SACK checking. 591de00ad05SMichael Tuexen.It Va pktdrop_enable 592de00ad05SMichael TuexenEnable SCTP PKTDROP. 593de00ad05SMichael Tuexen.It Va nrsack_enable 594de00ad05SMichael TuexenEnable SCTP NR-SACK. 595de00ad05SMichael Tuexen.It Va reconfig_enable 596de00ad05SMichael TuexenEnable SCTP RE-CONFIG. 597de00ad05SMichael Tuexen.It Va asconf_enable 598de00ad05SMichael TuexenEnable SCTP ASCONF. 599de00ad05SMichael Tuexen.It Va auth_enable 600de00ad05SMichael TuexenEnable SCTP AUTH. 601de00ad05SMichael Tuexen.It Va pr_enable 602de00ad05SMichael TuexenEnable PR-SCTP. 603de00ad05SMichael Tuexen.It Va auto_asconf 604de00ad05SMichael TuexenEnable SCTP Auto-ASCONF. 605de00ad05SMichael Tuexen.It Va recvspace 606de00ad05SMichael TuexenMaximum incoming SCTP buffer size. 607de00ad05SMichael Tuexen.It Va sendspace 608de00ad05SMichael TuexenMaximum outgoing SCTP buffer size. 609de00ad05SMichael Tuexen.El 61078a49138SMichael Tuexen.El 611d8b5fd91SRandall Stewart.Sh SEE ALSO 612d8b5fd91SRandall Stewart.Xr accept 2 , 613d8b5fd91SRandall Stewart.Xr bind 2 , 614d8b5fd91SRandall Stewart.Xr connect 2 , 615d8b5fd91SRandall Stewart.Xr listen 2 , 616d8b5fd91SRandall Stewart.Xr sctp_bindx 3 , 617d8b5fd91SRandall Stewart.Xr sctp_connectx 3 , 618d8b5fd91SRandall Stewart.Xr sctp_opt_info 3 , 619d8b5fd91SRandall Stewart.Xr sctp_recvmsg 3 , 620de00ad05SMichael Tuexen.Xr sctp_sendmsg 3 , 621de00ad05SMichael Tuexen.Xr blackhole 4 622*052c5ec4SMark Johnston.Sh BUGS 623*052c5ec4SMark JohnstonThe 624*052c5ec4SMark Johnston.Nm 625*052c5ec4SMark Johnstonkernel module cannot be unloaded. 626