RFC 9653
Zero Checksum for the Stream Control Transmission Protocol
Zero Checksum for the Stream Control Transmission Protocol π¦
- Request for Comments: 9653
- Series: Internet Engineering Task Force (IETF)
- Category: Standards Track
- ISSN: 2070-1721
- Date: September 2024
- Authors: M. TΓΌxen (MΓΌnster Univ. of Appl. Sciences), V. Boivie (no affiliation listed), F. Castelli (Google), R. Jesup (Mozilla)
- Obsoletes / Updates: The header doesn't list anything this one obsoletes or updates. πΈ
Abstract π
okay so SCTP (the Stream Control Transmission Protocol) slaps a 32-bit checksum into the common header of every packet π§ for some basic data integrity. But if SCTP already has another method doing the same job, or a better one, computing that checksum adds zero extra protection π and still burns compute. This doc adds a simple extension so SCTP can skip that work by putting zero in the checksum field, and it's backwards-compatible too π . It also explains how to use this when SCTP packets are wrapped in DTLS packets π«Ά.
Status of This Memo π
This is an Internet Standards Track document.
This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 7841.
Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at https://www.rfc-editor.org/info/rfc9653.
Copyright Notice Β©οΈ
Copyright (c) 2024 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 (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.
Table of Contents ποΈ
1. Introduction
2. Conventions
3. Alternate Error Detection Methods
4. A New Chunk Parameter
5. Procedures
5.1. Declaration of Feature Support
5.2. Sender-Side Considerations
5.3. Receiver-Side Considerations
6. Error Detection via SCTP over DTLS
7. Socket API Considerations
7.1. Set Accepting a Zero Checksum (SCTP_ACCEPT_ZERO_CHECKSUM)
8. IANA Considerations
9. Security Considerations
10. References
10.1. Normative References
10.2. Informative References
Acknowledgments
Authors' Addresses
1. Introduction β¨
okay so SCTP as specified in [RFC9260] uses a CRC32c checksum for some level of data integrity. When you run it over something like Datagram Transport Layer Security (DTLS) as the lower layer, as in [RFC8261], CRC32c doesn't add any protection on top of what DTLS already gives you π. Computing it on both the sender and receiver sides still eats up computational resources for literally no benefit π€. That's a huge deal for endpoints with limited compute that use SCTP over DTLS π₯Ί.
The extension in this document lets an SCTP endpoint say "hey, I accept packets with a checksum of zero" when it's using a specific alternate error detection method π¦. That gets declared during the setup of the SCTP association, and endpoints with this extension stay interoperable with endpoints that don't have it π«Ά. For that backwards compatibility, endpoints using the extension still need to implement the CRC32c checksum algorithm π.
2. Conventions π
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here. π
3. Alternate Error Detection Methods π¦
SCTP uses a CRC32c checksum to provide some level of data integrity π. The CRC32c checksum is computed based on the SCTP common header and the chunks in the packet π¦. Here's the fun part: the CRC32c computation doesn't involve a pseudo header for IPv4 or IPv6 like the TCP checksum in [RFC9293] or the UDP checksum in [RFC0768] do π.
Zero is a totally valid result of the CRC32c checksum algorithm β¨. For example, Figure 1 shows an SCTP packet with a minimal INIT chunk whose correct CRC32c checksum is zero π.
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Source Port Number = 5001 |Destination Port Number = 5001 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Verification Tag = 0 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Checksum = 0 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = 1 |Chunk Flags = 0| Chunk Length = 20 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Initiate Tag = 0xFCB75CCA |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Advertised Receiver Window Credit (a_rwnd) = 1500 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Number of Outbound Streams = 1 | Number of Inbound Streams = 1 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Initial TSN = 0 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 1: SCTP Packet with a Correct CRC32c Checksum of Zero
Using SCTP together with other mechanisms or protocol extensions might give you data integrity protection with an equal or lower probability of false negatives than CRC32c does π. When you use those alternate error detection methods, the SCTP common header containing the 32-bit checksum field might or might not be visible to middleboxes on the paths between the two endpoints π.
Alternate error detection methods have two requirements, bestie π:
- An alternate error detection method MUST provide an equal or lower probability of false negatives than the one provided by using the CRC32c checksum algorithm. This MAY only apply to packets satisfying some method-specific constraints.
- Using an alternate error detection method MUST NOT result in a path failure for more than two retransmission timeouts (RTOs) due to middleboxes on the path expecting correct CRC32c checksums.
To hit the second requirement, alternate error detection methods could use a heuristic to detect the existence of those middleboxes and then use correct CRC32c checksums on the affected paths π΅οΈ.
Using DTLS as the lower layer of SCTP as specified in [RFC8261] is one example that fulfills the first requirement π. Another example is SCTP Authentication as specified in [RFC4895] π. Of course, this only applies to each SCTP packet having an AUTH chunk as its first chunk π. But using SCTP Authentication without any heuristic does not fulfill the second requirement π¬. Since using DTLS as the lower layer of SCTP as specified in [RFC8261] also fulfills the second requirement, it can be used as an alternate error detection method (see Section 6) β¨.
If an alternate error detection method is used, computing the CRC32c checksum burns computational resources without providing any benefit π₯. To avoid that, an SCTP endpoint could be willing to accept SCTP packets with an incorrect CRC32c checksum value of zero in addition to SCTP packets with correct CRC32c checksum values πΈ.
Because zero is a valid result of the CRC32c checksum algorithm, a receiver of an SCTP packet with a checksum value of zero can't determine whether the sender included an incorrect CRC32c checksum of zero to reduce the CPU cost, or whether the CRC32c computation actually came out to zero π€·ββοΈ. However, if the receiver is willing to use an alternate error detection method, this ambiguity is irrelevant, since the receiver is totally fine not using the CRC32c checksum to protect incoming packets π .
4. A New Chunk Parameter π
The Zero Checksum Acceptable Chunk Parameter is defined by the following figure π.
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = 0x8001 | Length = 8 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Error Detection Method Identifier (EDMID) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 2: Zero Checksum Acceptable Chunk Parameter
Here's the breakdown of each field π§:
- Type: 16 bits (unsigned integer): This field holds the IANA-defined parameter type for the "Zero Checksum Acceptable" chunk parameter. IANA has assigned the value 32769 (0x8001) for this parameter type. β¨
- Length: 16 bits (unsigned integer): This field holds the length in bytes of the chunk parameter. The value MUST be 8.
- Error Detection Method Identifier (EDMID): 32 bits (unsigned integer): An IANA-registered value specifying the alternate error detection method the sender of this parameter is willing to use for received packets. π¦
All transported integer numbers are in network byte order, a.k.a. big endian π§ .
The Zero Checksum Acceptable Chunk Parameter MAY appear in INIT and INIT ACK chunks and MUST NOT appear in any other chunk. The Parameter MUST NOT appear more than once in any chunk π«.
If an endpoint that doesn't support the extension described in this document receives this parameter in an INIT or INIT ACK chunk, it is REQUIRED to skip this parameter and keep processing the further parameters in the chunk π. This behavior is specified by [RFC9260] because the highest-order two bits of the Type are '10' π§.
5. Procedures πΈ
5.1. Declaration of Feature Support π
An endpoint willing to accept SCTP packets with an incorrect checksum of zero MUST include the Zero Checksum Acceptable Chunk Parameter, indicating the alternate error detection method it is willing to use, in the INIT or INIT ACK chunk it sends. π£
An SCTP implementation MAY also require the upper layer to indicate that it is fine to use a specific alternate error detection method before including the corresponding Zero Checksum Acceptable Chunk Parameter β¨.
5.2. Sender-Side Considerations π
okay bestie, an SCTP endpoint cannot just slap a checksum of zero on every single packet it sends π ββοΈ there are some rules, and they're kinda important π«Ά
- If an endpoint has not received an INIT or INIT ACK chunk containing a Zero Checksum Acceptable Chunk Parameter indicating an alternate error detection method it supports from its peer during the association setup, it MUST use a correct CRC32c checksum. In particular, when an endpoint a. sends a packet containing an INIT chunk, it MUST include a correct CRC32c checksum in the packet containing the INIT chunk. b. responds to an "Out of the Blue" (OOTB) SCTP packet, it MUST include a correct CRC32c checksum in the response packet.
- When an endpoint sends a packet containing a COOKIE ECHO chunk, it MUST include a correct CRC32c checksum in the packet containing the COOKIE ECHO chunk.
- When an endpoint supports the dynamic address reconfiguration specified in [RFC5061] and sends a packet containing an ASCONF chunk, it MUST include a correct CRC32c checksum in the packet containing the ASCONF chunk.
- If an alternate error detection method has some method-specific constraints, the sender MUST include a correct CRC32c checksum in all packets that don't fulfill these method-specific constraints.
ngl the first rule is giving backwards compatibility π¦ the second and third ones make life easier to implement, because finding the association for COOKIE ECHO or ASCONF packets can be more complicated than for other packets π§ and the last one just covers whatever specific constraints come with a particular alternate method β¨
An SCTP endpoint MAY require that the upper layer allow the use of the alternate error detection method that was announced by the peer before sending packets with an incorrect checksum of zero. π
If none of the above restrictions apply, an endpoint SHOULD use zero as the checksum when sending an SCTP packet. π
5.3. Receiver-Side Considerations π
if an endpoint has sent the Zero Checksum Acceptable Chunk Parameter in an INIT or INIT ACK chunk to say it supports an alternate error detection method, then on top of packets with the correct CRC32c checksum, it MUST accept SCTP packets that have an incorrect checksum value of zero AND that fulfill the requirements of the announced alternate error detection method used for this association. Otherwise, the endpoint MUST drop all SCTP packets with an incorrect CRC32c checksum. π ββοΈ
In addition to processing OOTB packets with a correct CRC32c checksum as specified in [RFC9260], an SCTP implementation MAY also process OOTB packets having an incorrect zero checksum. Doing so might result in faster SCTP association failure detection. β‘
6. Error Detection via SCTP over DTLS π
using SCTP over DTLS as specified in [RFC8261] gives you a stronger error detection method than the CRC32c checksum algorithm πͺ middleboxes can't see the unencrypted SCTP packet, so there's no risk in using zero as an incorrect checksum. there are no extra constraints (specific to the error detection method) on packets when you're using DTLS encapsulation π
7. Socket API Considerations π§°
this section explains how the socket API defined in [RFC6458] needs to be extended so the application can control whether a zero checksum gets accepted ποΈ
A 'Socket API Considerations' section is contained in all SCTP-related specifications published after [RFC6458] describing an extension for which implementations using the socket API as specified in [RFC6458] would require some extension of the socket API. Please note that this section is informational only. π
A socket API implementation based on [RFC6458] is extended by supporting one new write-only IPPROTO_SCTP-level socket option. πΈ
7.1. Set Accepting a Zero Checksum (SCTP_ACCEPT_ZERO_CHECKSUM) π
this IPPROTO_SCTP-level socket option, called SCTP_ACCEPT_ZERO_CHECKSUM, is what controls whether a zero checksum is accepted π it's write-only and only applies to future SCTP associations on the socket.
this option expects an unsigned integer. the possible values are:
SCTP_EDMID_NONE: disables the use of any alternate error detection method. This means that every SCTP packet being received is only accepted if it has a correct CRC32c checksum value. π«SCTP_EDMID_LOWER_LAYER_DTLS: uses the alternate error detection method described in Section 6. π
An implementation might only send packets with an incorrect checksum of zero if the alternate error detection method announced by the peer is also enabled locally via this socket option. π
the default for this socket option is that alternate error detection methods are disabled. π₯±
8. IANA Considerations π
IANA has assigned a new chunk parameter type in the "Chunk Parameter Types" registry for SCTP π
+==========+===================================+===========+
| ID Value | Chunk Parameter Type | Reference |
+==========+===================================+===========+
| 32769 | Zero Checksum Acceptable (0x8001) | RFC 9653 |
+----------+-----------------------------------+-----------+
Table 1: New Entry in "Chunk Parameter Types" Registry
and IANA also made a brand new "Error Detection Method" registry for SCTP β¨ new error detection methods get assigned through the Specification Required policy from [RFC8126]. Documentation for a new error detection method MUST contain the following information:
- A name of an alternate error detection method.
- A reference to a specification describing: (a) the alternate error detection method, (b) why the alternate error detection method provides an equal or lower probability of false negatives than the one provided by using the CRC32c checksum, (c) any constraints (specific to the alternate error detection method) that are referred to in the fourth exception in Section 5.2, and (d) why using the alternate error detection method does not result in path failures due to middleboxes expecting correct CRC32c checksums for more than two RTOs. In case the alternate error detection method uses a heuristic for detecting such middleboxes, this heuristic needs to be described.
the initial contents of the registry look like this π
+================+========================+===========+
| ID Value | Error Detection Method | Reference |
+================+========================+===========+
| 0 | Reserved | RFC 9653 |
+----------------+------------------------+-----------+
| 1 | SCTP over DTLS | RFC 9653 |
+----------------+------------------------+-----------+
| 2 - 4294967295 | Unassigned | |
+----------------+------------------------+-----------+
Table 2: Initial Contents of the "Error Detection
Method" Registry
a designated expert (DE) is expected to check that suitable documentation (a specification) exists as described in [RFC8126] and to verify that the document is permanently and publicly available π§ the DE is also expected to make sure all four points above have been handled properly π
9. Security Considerations π‘οΈ
β οΈ this part is serious, so read it carefully.
This document does not change the considerations given in [RFC9260].
Due to the first requirement in Section 3, using an alternate error detection method provides an equal or better level of data integrity than the one provided by using the CRC32c checksum algorithm. The second requirement in Section 3 ensures that the existence of middleboxes expecting correct CRC32c checksums does not result in permanent path failures. π
10. References π
10.1. Normative References
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997,
<https://www.rfc-editor.org/info/rfc2119>.
[RFC5061] Stewart, R., Xie, Q., Tuexen, M., Maruyama, S., and M.
Kozuka, "Stream Control Transmission Protocol (SCTP)
Dynamic Address Reconfiguration", RFC 5061,
DOI 10.17487/RFC5061, September 2007,
<https://www.rfc-editor.org/info/rfc5061>.
[RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for
Writing an IANA Considerations Section in RFCs", BCP 26,
RFC 8126, DOI 10.17487/RFC8126, June 2017,
<https://www.rfc-editor.org/info/rfc8126>.
[RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
May 2017, <https://www.rfc-editor.org/info/rfc8174>.
[RFC8261] Tuexen, M., Stewart, R., Jesup, R., and S. Loreto,
"Datagram Transport Layer Security (DTLS) Encapsulation of
SCTP Packets", RFC 8261, DOI 10.17487/RFC8261, November
2017, <https://www.rfc-editor.org/info/rfc8261>.
[RFC9260] Stewart, R., TΓΌxen, M., and K. Nielsen, "Stream Control
Transmission Protocol", RFC 9260, DOI 10.17487/RFC9260,
June 2022, <https://www.rfc-editor.org/info/rfc9260>.
10.2. Informative References
[RFC0768] Postel, J., "User Datagram Protocol", STD 6, RFC 768,
DOI 10.17487/RFC0768, August 1980,
<https://www.rfc-editor.org/info/rfc768>.
[RFC4895] Tuexen, M., Stewart, R., Lei, P., and E. Rescorla,
"Authenticated Chunks for the Stream Control Transmission
Protocol (SCTP)", RFC 4895, DOI 10.17487/RFC4895, August
2007, <https://www.rfc-editor.org/info/rfc4895>.
[RFC6458] Stewart, R., Tuexen, M., Poon, K., Lei, P., and V.
Yasevich, "Sockets API Extensions for the Stream Control
Transmission Protocol (SCTP)", RFC 6458,
DOI 10.17487/RFC6458, December 2011,
<https://www.rfc-editor.org/info/rfc6458>.
[RFC9293] Eddy, W., Ed., "Transmission Control Protocol (TCP)",
STD 7, RFC 9293, DOI 10.17487/RFC9293, August 2022,
<https://www.rfc-editor.org/info/rfc9293>.
Acknowledgments π«Ά
The authors wish to thank Bernard Aboba, Deb Cooley, Martin Duke,
Gorry Fairhurst, Mike Heard, Peter Lei, Nils Ohlmeier, Claudio
Porfiri, Greg Skinner, Timo VΓΆlker, Γric Vyncke, and Magnus
Westerlund for their invaluable comments.
Authors' Addresses π
Michael TΓΌxen
MΓΌnster University of Applied Sciences
Stegerwaldstrasse 39
48565 Steinfurt
Germany
Email: tuexen@fh-muenster.de
Victor Boivie
Google
Kungsbron 2
SE-11122 Stockholm
Sweden
Email: boivie@google.com
Florent Castelli
Google
Kungsbron 2
SE-11122 Stockholm
Sweden
Email: orphis@google.com
Randell Jesup
Mozilla Corporation
1835 Horse Shoe Trl
Malvern, PA 19355
United States of America
Email: randell-ietf@jesup.org
π¦ where this page comes from
- ietf: rfc9653 2024-09
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms