RFC 6951
UDP Encapsulation of Stream Control Transmission Protocol (SCTP) Packets for End-Host to End-Host Communication
RFC 6951: UDP Encapsulation of SCTP Packets for End-Host to End-Host Communication ๐ฆ
Okay bestie, let's start with the title block because it's giving important ๐ This is RFC 6951, published by the IETF in May 2013 (ISSN 2070-1721 if you're a catalog nerd โจ). M. Tuexen from Muenster Univ. of Appl. Sciences and R. Stewart from Adara Networks wrote it, and it's a Standards Track document, so it's an actual Internet standard in the making, not just someone's opinion ๐ฅ The header doesn't list any RFCs that it obsoletes or updates, so there's no drama there ๐ธ
Abstract ๐
Okay so the big idea is simple: this doc explains how to wrap SCTP packets inside UDP packets, and it's honest about the limitations ๐ง Why bother? Because it lets SCTP get through legacy NATs that don't know SCTP exists, and it lets you build SCTP onto a host without touching the IP layer directly. Think of it as building SCTP into an app without needing special privileges, which is seriously iconic ๐
Quick heads-up though ๐ This doc only covers what an SCTP stack needs to add UDP encapsulation, so two end-hosts can talk to each other over UDP ports. It does not explain how to tell whether the peer is using UDP encapsulation, and it doesn't explain how to figure out which remote UDP port to use. Those jobs are out of scope ๐
And just so we're clear, it's only about end-hosts, not tunneling (egress or ingress) endpoints ๐ซถ
Status of This Memo ๐
Okay, the status is this: it's an Internet Standards Track document ๐ฆ
It's a product of the Internet Engineering Task Force (IETF), which means it reflects the consensus of the IETF community. It went through public review and was approved for publication by the Internet Engineering Steering Group (IESG). If you want more on Internet Standards, check out Section 2 of RFC 5741 โจ
For the current status, any errata, and how to send feedback, head to http://www.rfc-editor.org/info/rfc6951 ๐
Copyright Notice โ๏ธ
Copyright (c) 2013 IETF Trust and the persons identified as the document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) as they stand on the date this document was published. Please read these carefully, because they spell out your rights and restrictions for this document ๐ Any Code Components pulled out of this document must include the Simplified BSD License text, as described in Section 4.e of the Trust Legal Provisions, and they come without warranty, as described in the Simplified BSD License ๐
Table of Contents ๐บ๏ธ
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3
2. Conventions . . . . . . . . . . . . . . . . . . . . . . . . . 3
3. Use Cases . . . . . . . . . . . . . . . . . . . . . . . . . . 3
3.1. Portable SCTP Implementations . . . . . . . . . . . . . . 3
3.2. Legacy NAT Traversal . . . . . . . . . . . . . . . . . . 4
4. Unilateral Self-Address Fixing (UNSAF) Considerations . . . . 4
5. SCTP over UDP . . . . . . . . . . . . . . . . . . . . . . . . 4
5.1. Architectural Considerations . . . . . . . . . . . . . . 4
5.2. Packet Format . . . . . . . . . . . . . . . . . . . . . . 5
5.3. Encapsulation Procedure . . . . . . . . . . . . . . . . . 6
5.4. Decapsulation Procedure . . . . . . . . . . . . . . . . . 7
5.5. ICMP Considerations . . . . . . . . . . . . . . . . . . . 7
5.6. Path MTU Considerations . . . . . . . . . . . . . . . . . 7
5.7. Handling of Embedded IP Addresses . . . . . . . . . . . . 8
5.8. Explicit Congestion Notification (ECN) Considerations . . 8
6. Socket API Considerations . . . . . . . . . . . . . . . . . . 8
6.1. Get or Set the Remote UDP Encapsulation Port Number
(SCTP_REMOTE_UDP_ENCAPS_PORT) . . . . . . . . . . . . . . 9
7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 9
8. Security Considerations . . . . . . . . . . . . . . . . . . . 9
9. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 10
10. References . . . . . . . . . . . . . . . . . . . . . . . . . 10
10.1. Normative References . . . . . . . . . . . . . . . . . . 10
10.2. Informative References . . . . . . . . . . . . . . . . . 11
1. Introduction โจ
Okay so this doc is all about a simple method for wrapping SCTP packets inside UDP packets. SCTP, as defined in [RFC4960], normally runs directly over IPv4 or IPv6. There are two main reasons to encapsulate it:
- To let SCTP traffic get through legacy NATs ๐ธ, which don't offer native SCTP support as specified in [BEHAVE] and [NATSUPP].
- To let SCTP run on hosts that don't have direct access to the IP layer ๐ง. Apps can bring their own SCTP implementation when the operating system doesn't provide one.
SCTP also brings the congestion control and reliability service that UDP doesn't provide ๐
2. Conventions ๐
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119] ๐
3. Use Cases ๐ฆ
This section talks through two important use cases for encapsulating SCTP into UDP ๐ฅ
3.1. Portable SCTP Implementations ๐ง
Some operating systems support SCTP natively ๐ For other operating systems, implementations exist, but you need special privileges to install and/or use them. Sometimes there's no kernel implementation at all ๐ And when you build an SCTP implementation as part of a user process, most operating systems require special privileges to reach the IP layer directly.
Using UDP encapsulation makes it possible to provide an SCTP implementation as part of a user process without needing any special privileges, which is so iconic ๐
Here's the crucial bit: for SCTP in user space, you need to control the source address of outgoing packets ๐ That's not a problem if the SCTP stack can use every address configured at the IP layer as a source address. It does become a problem when you also use the address management needed for NAT traversal, which is described in Section 5.7 ๐
3.2. Legacy NAT Traversal ๐ธ
UDP encapsulation lets SCTP communicate when it's traversing legacy NATs (i.e., NATs that don't support SCTP, as described in [BEHAVE] and [NATSUPP]) ๐ซถ For single-homed associations, IP addresses MUST NOT be listed in the INIT and INIT-ACK chunks. If you want to use multiple addresses, the dynamic address reconfiguration extension described in [RFC5061] MUST be used only with wildcard addresses in the ASCONF chunks (Address Configuration Change Chunks), in combination with [RFC4895] โจ
For multihomed SCTP associations, the address management described in Section 5.7 MUST be performed ๐ฅ
Also, SCTP sends periodic HEARTBEAT chunks on all idle paths, and those can help keep the NAT state alive ๐
4. Unilateral Self-Address Fixing (UNSAF) Considerations ๐
As [RFC3424] requires a limited scope, this document only covers SCTP endpoints dealing with the legacy constraints described in Section 3. It doesn't cover generic tunneling endpoints ๐
Obviously, the exit strategy is to use hosts that support SCTP natively, plus middleboxes that support SCTP as specified in [BEHAVE] and [NATSUPP] ๐
5. SCTP over UDP ๐
5.1. Architectural Considerations ๐ฆ
UDP-encapsulated SCTP is normally communicated between SCTP stacks using the IANA-assigned UDP port number 9899 (sctp-tunneling) at both ends ๐ Sometimes other ports get used at either end. As we said earlier, implementations in the application space might need to use ports other than the registered one ๐ง Also, NAT boxes might change UDP port numbers, so the receiver might see different UDP port numbers than the sender used ๐ Finding alternate ports is outside the scope of this document, but this section covers design considerations for SCTP stacks in light of how those ports might get used โจ
Each SCTP stack uses a single local UDP encapsulation port number as the destination port for all of its incoming SCTP packets. The uniqueness of that local port number isn't strictly required by the protocol, but using one port makes implementation way simpler ๐ If every address used a different port, the sender would have to pick the right port while it's doing source address selection. Using one local UDP encapsulation port number per host isn't possible if the SCTP stack is built into each application, there are multiple applications, and some of them want to use the same IP address ๐ธ
An SCTP implementation that supports UDP encapsulation MUST maintain a remote UDP encapsulation port number per destination address for each SCTP association ๐ซถ The remote stack might be using ports other than the well-known one, so each port can differ from stack to stack. Plus, because NATs remap ports, the remote ports tied to different remote IP addresses might not match, even when they belong to the same stack ๐
Implementation note: Since the well-known port might not be used, implementations need to let other port numbers be specified as a local or remote UDP encapsulation port number through APIs ๐
To be continued... part 2 is coming, bestie ๐ง๐
5.2. Packet Format ๐
okay so, to encapsulate an SCTP packet, you slide a UDP header (from [RFC0768]) in between the IP header (from [RFC0791]) and the SCTP common header (from [RFC4960]). it's giving sandwich ๐ฅชโจ
Figure 1 shows what that looks like with IPv4:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| IPv4 Header |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| UDP Header |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| SCTP Common Header |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| SCTP Chunk #1 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| SCTP Chunk #n |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 1: An SCTP/UDP/IPv4 Packet
The packet format for an encapsulated SCTP packet using IPv6 (as defined in [RFC2460]) is shown in Figure 2. Please note that the number m of IPv6 extension headers can be 0. ๐ง
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| IPv6 Base Header |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| IPv6 Extension Header #1 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| IPv6 Extension Header #m |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| UDP Header |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| SCTP Common Header |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| SCTP Chunk #1 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| SCTP Chunk #n |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 2: An SCTP/UDP/IPv6 Packet
5.3. Encapsulation Procedure ๐ฆ
okay, the UDP header has its own rules. The source port MUST be the local UDP encapsulation port number of the SCTP stack. The destination port MUST be the remote UDP encapsulation port number kept for the association and the destination address the packet is headed to (see Section 5.1). so the ports are not random, bestie, they're tied to the association ๐
Because the SCTP packet is the UDP payload, the length of the UDP packet MUST be the length of the SCTP packet plus the size of the UDP header. ๐
The SCTP checksum MUST be computed for IPv4 and IPv6. The UDP checksum SHOULD be computed for IPv4 and IPv6. (See [RFC0768] for IPv4, and [RFC2460] and [RFC6936] for IPv6.) Even though UDP with a zero checksum over IPv6 is allowed under certain constraints [RFC6936], this document doesn't specify any mechanisms for that mode. Deployed support may be limited. Also, at the time of writing, using a zero UDP checksum would go against the goal of legacy NAT traversal. ๐
5.4. Decapsulation Procedure ๐ธ
When an encapsulated packet comes in, the UDP header gets removed. Then the generic lookup happens, the same way an SCTP stack does whenever a packet is received, to find the association for the SCTP packet. After finding the SCTP association (which includes checking the verification tag), the UDP source port MUST be stored as the encapsulation port for the destination address the SCTP packet came from (see Section 5.1).
When a non-encapsulated SCTP packet is received by the SCTP stack, the encapsulation of outgoing packets for the same association and the corresponding destination address MUST be disabled. not me going "wait, it just turns off?" yes bestie, it just turns off ๐ญ
5.5. ICMP Considerations ๐
When receiving ICMP or ICMPv6 response packets, there might not be enough bytes in the payload to identify the SCTP association that the triggering SCTP packet belongs to. If a received ICMP or ICMPv6 packet can't be related to a specific SCTP association, or the verification tag can't be verified, it MUST be discarded silently. In particular, this means the SCTP stack MUST NOT rely on receiving ICMP or ICMPv6 messages. Implementation constraints could also stop received ICMP or ICMPv6 messages from being processed. ๐
If received ICMP or ICMPv6 messages are processed, the following mapping SHOULD apply:
- ICMP messages with type 'Destination Unreachable' and code 'Port Unreachable' SHOULD be treated as ICMP messages with type 'Destination Unreachable' and code 'Protocol Unreachable'. See [RFC0792] for more details. ๐ฅ
- ICMPv6 messages with type 'Destination Unreachable' and code 'Port Unreachable' SHOULD be treated as ICMPv6 messages with type 'Parameter Problem' and code 'unrecognized Next Header type encountered'. See [RFC4443] for more details. โจ
5.6. Path MTU Considerations ๐
If an SCTP endpoint starts encapsulating the packets of a path, it MUST decrease the Path MTU of that path by the size of the UDP header. If it stops encapsulating them, the Path MTU SHOULD be increased by the size of the UDP header. math check: the UDP header is 8 bytes of sass ๐งฎ
When performing Path MTU discovery as described in [RFC4820] and [RFC4821], it MUST be taken into account that one cannot rely on the feedback provided by ICMP or ICMPv6, due to the limitation laid out in Section 5.5. ๐ฅบ
If the implementation doesn't allow control of the Don't Fragment (DF) bit in the IPv4 header, then Path MTU discovery can't be used. In this case, an implementation-specific value should be used instead.
5.7. Handling of Embedded IP Addresses ๐งธ
When using UDP encapsulation for legacy NAT traversal, IP addresses that might require translation MUST NOT be put into any SCTP packet. ๐ซ
This means a multihomed SCTP association is set up initially as a single-homed one. The protocol extension [RFC5061], in combination with [RFC4895], is then used to add the other addresses. Only wildcard addresses are put into the SCTP packet. wildcards only, that's the whole vibe ๐ธ
When addresses change during the lifetime of an association, the protocol extension [RFC5061] MUST be used with wildcard addresses only. If an SCTP endpoint receives an ABORT with the T-bit set, it MAY use this as an indication that the addresses seen by the peer might have changed. ๐
5.8. Explicit Congestion Notification (ECN) Considerations ๐ฆ
If the implementation supports sending and receiving the ECN bits for the IP protocols an SCTP association uses, the ECN bits MUST NOT be changed during sending and receiving. ๐
6. Socket API Considerations ๐ง
This section describes how the socket API defined in [RFC6458] needs to be extended, so the application can control the UDP encapsulation.
Please note that this section is informational only.
A socket API implementation based on [RFC6458] is extended by supporting one new read/write socket option.
6.1. Get or Set the Remote UDP Encapsulation Port Number (SCTP_REMOTE_UDP_ENCAPS_PORT) ๐
This socket option can be used to set and retrieve the UDP encapsulation port number. It lets an endpoint encapsulate initial packets. โจ
struct sctp_udpencaps {
sctp_assoc_t sue_assoc_id;
struct sockaddr_storage sue_address;
uint16_t sue_port;
};
sue_assoc_id: this parameter is ignored for one-to-one style sockets. For one-to-many style sockets, the application may fill in an association identifier orSCTP_FUTURE_ASSOCfor this query. It is an error to useSCTP_{CURRENT|ALL}_ASSOCinsue_assoc_id. ๐ซถsue_address: this specifies which address is of interest. If a wildcard address is provided, it applies only to future paths.sue_port: the UDP port number in network byte order, used as the destination port number for UDP encapsulation. Providing a value of 0 disables UDP encapsulation. ๐ฅ
7. IANA Considerations ๐
This document refers to the already assigned UDP port 9899 (sctp-tunneling). IANA has updated this assignment to refer to this document. As per [RFC6335], the Assignee is [IESG] and the Contact is [IETF_Chair]. ๐
Please note that the TCP port 9899 (sctp-tunneling) assignment is no longer needed. IANA has removed this TCP port number assignment and marked TCP port 9899 as "Reserved". bye bye TCP 9899 ๐๐ฉต
8. Security Considerations ๐
Encapsulating SCTP into UDP does not add any additional security considerations to the ones given in [RFC4960] and [RFC5061]. ๐ค
Firewalls inspecting SCTP packets must also be aware of the encapsulation and apply corresponding rules to the encapsulated packets. ๐จ
An attacker might send a malicious UDP packet towards an SCTP endpoint to change the encapsulation port for a single remote address of a particular SCTP association. However, as specified in Section 5.4, this requires the usage of one of the two negotiated verification tags. This protects against blind attackers the same way as described in [RFC4960] for SCTP over IPv4 or IPv6. Non-blind attackers can affect SCTP associations using the UDP encapsulation described in this document in the same way as SCTP associations that don't use the UDP encapsulation of SCTP described here. ๐ต๏ธโโ๏ธ๐
9. Acknowledgments ๐ซถ
The authors wish to thank Stewart Bryant, Dave Crocker, Gorry Fairhurst, Tero Kivinen, Barry Leiba, Pete Resnick, Martin Stiemerling, Irene Ruengeler, and Dan Wing for their invaluable comments. thank you, legends ๐โจ๐
10. References ๐
10.1. Normative References ๐
okay bestie, these are the docs the spec literally can't function without ๐ซถ (normative = must-read, no cap)
[RFC0768] Postel, J., "User Datagram Protocol", STD 6, RFC 768,
August 1980.
[RFC0791] Postel, J., "Internet Protocol", STD 5, RFC 791, September
1981.
[RFC0792] Postel, J., "Internet Control Message Protocol", STD 5,
RFC 792, September 1981.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, March 1997.
[RFC2460] Deering, S.E. and R.M. Hinden, "Internet Protocol, Version
6 (IPv6) Specification", RFC 2460, December 1998.
[RFC4443] Conta, A., Deering, S., and M. Gupta, "Internet Control
Message Protocol (ICMPv6) for the Internet Protocol
Version 6 (IPv6) Specification", RFC 4443, March 2006.
[RFC4820] Tuexen, M., Stewart, R., and P. Lei, "Padding Chunk and
Parameter for the Stream Control Transmission Protocol
(SCTP)", RFC 4820, March 2007.
[RFC4821] Mathis, M. and J. Heffner, "Packetization Layer Path MTU
Discovery", RFC 4821, March 2007.
[RFC4895] Tuexen, M., Stewart, R., Lei, P., and E. Rescorla,
"Authenticated Chunks for the Stream Control Transmission
Protocol (SCTP)", RFC 4895, August 2007.
[RFC4960] Stewart, R., "Stream Control Transmission Protocol", RFC
4960, September 2007.
[RFC5061] Stewart, R., Xie, Q., Tuexen, M., Maruyama, S., and M.
Kozuka, "Stream Control Transmission Protocol (SCTP)
Dynamic Address Reconfiguration", RFC 5061, September
2007.
10.2. Informative References ๐ฆ
these ones are the helpful extras ๐ง good to know, not strictly needed to implement
[BEHAVE] Stewart, R., Tuexen, M., and I. Ruengeler, "Stream Control
Transmission Protocol (SCTP) Network Address Translation",
Work in Progress, February 2013.
[NATSUPP] Stewart, R., Tuexen, M., and I. Ruengeler, "Stream Control
Transmission Protocol (SCTP) Network Address Translation
Support", Work in Progress, February 2013.
[RFC3424] Daigle, L. IAB, "IAB Considerations for UNilateral Self-
Address Fixing (UNSAF) Across Network Address
Translation", RFC 3424, November 2002.
[RFC6335] Cotton, M., Eggert, L., Touch, J., Westerlund, M., and S.
Cheshire, "Internet Assigned Numbers Authority (IANA)
Procedures for the Management of the Service Name and
Transport Protocol Port Number Registry", BCP 165, RFC
6335, August 2011.
[RFC6458] Stewart, R., Tuexen, M., Poon, K., Lei, P., and V.
Yasevich, "Sockets API Extensions for the Stream Control
Transmission Protocol (SCTP)", RFC 6458, December 2011.
[RFC6936] Fairhurst, G. and M. Westerlund, "Applicability Statement
for the Use of IPv6 UDP Datagrams with Zero Checksums",
RFC 6936, April 2013.
Authors' Addresses ๐ซถ
these are the humans who wrote it, so you know who to thank (or DM) ๐
Michael Tuexen
Muenster University of Applied Sciences
Stegerwaldstrasse 39
48565 Steinfurt
DE
EMail: tuexen@fh-muenster.de
Randall R. Stewart
Adara Networks
Chapin, SC 29036
US
EMail: randall@lakerest.net
๐ฆ where this page comes from
- ietf: rfc6951 2013-05
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms