Internet-Draft | Zero Checksum for SCTP | July 2023 |
Tüxen, et al. | Expires 11 January 2024 | [Page] |
The Stream Control Transmission Protocol (SCTP) uses a 32-bit checksum in the common header of each packet to provide some level of data integrity. When an alternate method used by SCTP provides already the same or a higher level of data integrity, computing this checksum does not provide any additional protection, but does require computing resources. This document provides a simple extension to SCTP allowing to save these computing resources by using the constant 0 as a checksum in a backwards compatible way.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 11 January 2024.¶
Copyright (c) 2023 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.¶
SCTP as specified in [RFC9260] uses a CRC32c to provide some level of data integrity. When using, for example, Datagram Transport Layer Security (DTLS) as the lower layer for SCTP as specified in [RFC8261], using the CRC32c does not provide any additional protection over the one already provided by DTLS. However, computing the CRC32c at the sender and receiver side does require computationally resources for no benefit. This is in particular important for computational limited end points using SCTP encapsulated in DTLS.¶
The extension described in this document allows an SCTP end point to declare that it accepts SCTP packets with a checksum of zero when using a specified alternate method of error detection. This declaration happens during the setup of the SCTP association and allows end points supporting this extension to be interoperable with end points not supporting the extension described in this document. To provide this backwards compatibility, end points using this extension still need to implement the CRC32c checksum algorithm.¶
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.¶
The Zero Checksum Acceptable Chunk Parameter is defined by the following figure.¶
This field holds the IANA defined parameter type for the "Zero Checksum Acceptable" chunk parameter. IANA is requested to assign the value 32769 (0x8001) (suggested) for this parameter type.¶
This field holds the length in bytes of the chunk parameter; the value MUST be 8.¶
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. It MUST NOT appear more than once in INIT and INIT ACK chunks and it MUST NOT appear in any other chunk.¶
If an end point not supporting the extension described in this document receives this parameter in an INIT or INIT ACK chunk, it skips this parameter and continues to process further parameters in the chunk. This behavior is REQUIRED by [RFC9260] because the highest-order two bits of the Type are '10'.¶
If some alternate error detection method provides an equal or better level of data integrity protection than the one provided by using the CRC32c algorithm, the computation of the CRC32c checksum requires computational resources without providing any benefit. To avoid this, an SCTP end point MAY be willing to accept SCTP packets with an incorrect CRC32c checksum value of zero in addition to SCTP packets with correct CRC32c checksum values. An SCTP endpoint MUST NOT be willing to accept SCTP packets with an incorrect CRC32c checksum value of zero, if the alternate error detection method does not provide at least the level of data integrity the CRC32c checksum algorithm provides.¶
One example of an alternate error detection method is the use of SCTP over DTLS as described in [RFC8261] (as used in the WebRTC context). A counter example is the use of SCTP over UDP as specified in [RFC6951].¶
An incorrect zero checksum MUST NOT be used if middle boxes expecting correct CRC32c checksums in SCTP packets might impact the communication.¶
An SCTP implementation MAY also require the upper layer to indicate that it is fine to use a specific alternate error detection mechanism for accepting SCTP packets with an incorrect CRC32c value of zero.¶
An end point 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 in the INIT or INIT ACK chunk it sends.¶
If an end point has 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 SHOULD use zero as the checksum for all packets sent in this association with the following four exceptions:¶
When an end point sends a packet containing an INIT chunk, it MUST include a correct CRC32c checksum in the packet containing the INIT chunk.¶
When an end point 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 end point 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.¶
Alternate error detection methods might have some additional conditions requiring that the sender MUST include a correct CRC32c checksum in the packet.¶
The first exception allows backwards compatibility and the second and third exception allow a simpler implementation of the extension defined in this document. The last condition covers alternate error detection method specific constraints.¶
When an end point responds to an "Out of the Blue" (OOTB) SCTP packet, it MUST include a correct CRC32c checksum in the response packet.¶
An SCTP end point MAY only send packets with an incorrect checksum of zero, if the upper layer allowed the use of the alternate error detection method which was announced by the peer.¶
Zero is a valid result of the CRC32c algorithm. Therefore, a receiver of an SCTP packet fulfilling the constraints of the alternate error detection method and containing a checksum value of zero cannot determine whether the sender included an incorrect CRC32c of zero to reduce the CPU cost or the result of the CRC32c computation was actually zero. However, if the receiver has sent the Zero Checksum Acceptable Chunk Parameter during the handshake, this ambiguity is irrelevant, since the receiver is fine with not using the CRC32c to protect incoming packets fulfilling the constraints of the alternate error detection method.¶
If an end point has sent the Zero Checksum Acceptable Chunk Parameter indicating the support of an alternate error detection method in an INIT or INIT ACK chunk, it MUST accept SCTP packets fulfilling the requirements of the announced alternate error detection method using an incorrect checksum value of zero in addition to SCTP packets containing the correct CRC32c checksum value for this association.¶
An SCTP implementation MAY process OOTB SCTP packets having an incorrect zero checksum in addition to OOTB packets with a correct CRC32c checksum.¶
Using SCTP over DTLS as specified in [RFC8261] provides a better error detection method than using the CRC32c. Since middle boxes will not observe the unencrypted SCTP packet, there is no risk in interferring with using zero as an incorrect checksum. There are no additional error detection specific constraints on packets when using DTLS encapsulation.¶
IANA is requested to assign the Error Detection Method Identifier of 1 (suggested) for this method.¶
This section describes how the socket API defined in [RFC6458] needs to be extended to provide a way for the application to control the acceptance of a zero checksum.¶
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.¶
This IPPROTO_SCTP-level socket option with name SCTP_ACCEPT_ZERO_CHECKSUM can be used to control the acceptance of a zero checksum. It is a write-only socket option and applies only to future SCTP associations on the socket.¶
This option expects an unsigned integer. Possible values include:¶
Disable the use of alternate error detection mechanisms. This means that all SCTP packets being sent have a correct CRC32c.¶
Use the alternate error detection mechanisms described in Section 5.¶
An implementation might only send packets with an incorrect checksum of zero, if the alternate error detection mechanism announced by the peer is also enabled locally via this socket option.¶
The default for this socket option is that the use of alternate error detection mechanisms is disabled.¶
[NOTE to RFC-Editor: "RFCXXXX" is to be replaced by the RFC number you assign this document.]¶
[NOTE to RFC-Editor: The suggested value for the parameter type is tentative and to be confirmed by IANA.]¶
This document (RFCXXXX) is the reference for the registration described in this section.¶
A new chunk parameter type has to be assigned by IANA. This requires an additional line in the "Chunk Parameter Types" registry for SCTP:¶
ID Value | Chunk Parameter Type | Reference |
---|---|---|
32769 (suggested) | Zero Checksum Acceptable (0x8001 (suggested)) | [RFCXXXX] |
Furthermore, IANA is requested to establish a new "Error Detection Method" registry for SCTP. The assignment of new error detection methods is done through a First Come First Served policy as defined in [RFC8126]. Documentation for a new error detection method MUST contain the following information:¶
A name of an alternate error detection method.¶
A reference describing the alternate detection method, in particular any method specific constraints.¶
IANA is requested to use the following as the initial contents of the registry:¶
ID Value | Error Detection Method | Reference |
---|---|---|
0 (suggested) | Reserved | [RFCXXXX] |
1 (suggested) | SCTP over DTLS | [RFCXXXX] |
This document does not change the considerations given in [RFC9260].¶
The authors wish to thank Gorry Fairhurst, Mike Heard, Nils Ohlmeier, Claudio Porfiri, and Magnus Westerlund for their invaluable comments.¶