<?xml version='1.0' encoding='utf-8'?>
<?xml-model href="rfc7991bis.rnc"?>
<?rfc toc='yes'?>
<?rfc compact='yes'?>
<?rfc subcompact='no'?>

<rfc xmlns:xi="http://www.w3.org/2001/XInclude"
     xml:lang="en"
     ipr="trust200902"
     submissionType="IETF"
     consensus="true"
     category="std"
     docName="draft-ietf-tsvwg-sctp-zero-checksum-00"
     version="3">

<front>
<title abbrev='Zero Checksum for SCTP'>
Zero Checksum for the Stream Control Transmission Protocol
</title>
<seriesInfo name="Internet-Draft" value="draft-ietf-tsvwg-sctp-zero-checksum-00"/>

<author initials="M." surname="Tüxen" fullname="Michael Tüxen">
  <organization abbrev='Münster Univ. of Appl. Sciences'>
                Münster University of Applied Sciences</organization>
  <address>
    <postal>
        <street>Stegerwaldstrasse 39</street>
        <city>48565 Steinfurt</city>
        <country>Germany</country>
    </postal>
    <email>tuexen@fh-muenster.de</email>
  </address>
</author>

<author initials='V.' surname='Boivie' fullname='Victor Boivie'>
  <organization>Google</organization>
  <address>
    <postal>
      <street>Kungsbron 2</street>
      <city>Stockholm</city>
      <code>11122</code>
      <country>Sweden</country>
    </postal>
    <email>boivie@google.com</email>
  </address>
</author>

<author initials='F.' surname='Castelli' fullname='Florent Castelli'>
  <organization>Google</organization>
  <address>
    <postal>
      <street>Kungsbron 2</street>
      <city>Stockholm</city>
      <code>11122</code>
      <country>Sweden</country>
    </postal>
    <email>orphis@google.com</email>
  </address>
</author>

<author initials="R." surname="Jesup" fullname="Randell Jesup">
<organization abbrev='Mozilla'>
              Mozilla Corporation</organization>
<address>
    <postal>
        <street>1835 Horse Shoe Trl</street>
        <city>Malvern</city>
        <region>PA</region>
        <code>19355</code>
        <country>US</country>
    </postal>
    <email>randell-ietf@jesup.org</email>
</address>
</author>

<date />

<abstract>
<t>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 the lower layer 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 the checksum in a backwards
compatible way.</t>
</abstract>
</front>

<middle>
<section>
<name>Introduction</name>
<t>SCTP as specified in <xref target="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 <xref target="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.</t>
<t>The extension described in this document allows an SCTP end point to
declare that it accepts SCTP packets with a checksum of zero.
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.</t>
</section>

<section anchor='conventions'>
<name>Conventions</name>
<t>The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>",
"<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL NOT</bcp14>",
"<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>",
"<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
"<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to
be interpreted as described in
BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when,
they appear in all capitals, as shown here.</t>
</section>

<section>
<name>A New Chunk Parameter</name>
<t>The Zero Checksum Acceptable Chunk Parameter is defined by the
following figure.</t>
<figure>
<name>Zero Checksum Acceptable Chunk Parameter</name>
<artwork align="left">
 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 (suggested)   |          Length = 4           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
</artwork>
</figure>
<dl newline="true">
<dt>Type: 16 bits (unsigned integer)</dt>
<dd>
<t>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.</t>
</dd>
<dt>Length: 16 bits (unsigned integer)</dt>
<dd>
<t>This field holds the length in bytes of the chunk parameter;
the value <bcp14>MUST</bcp14> be 4.</t>
</dd>
</dl>
<t>All transported integer numbers are in "network byte order" a.k.a.,
Big Endian.</t>
<t>The Zero Checksum Acceptable Chunk Parameter <bcp14>MAY</bcp14> appear
in INIT and INIT ACK chunks.
It <bcp14>MUST NOT</bcp14> appear in any other chunk.</t>
<t>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 <bcp14>REQUIRED</bcp14> by <xref target="RFC9260"/> because
the highest-order two bits of the Type are '10'.</t>
</section>

<section>
<name>Procedures</name>

<section>
<name>Declaration of Feature Support</name>
<t>If the lower layer of SCTP 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 <bcp14>MAY</bcp14> 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 <bcp14>SHOULD NOT</bcp14> be willing to accept SCTP packets
with an incorrect CRC32c checksum value of zero, if the lower layer does not
provide at least the level of data integrity the CRC32c checksum algorithm
provides.</t>
<t>One example of such a lower layer is the use of SCTP over DTLS as described
in <xref target="RFC8261"/> (as used in the WebRTC context).
Counter examples include:</t>
<ul>
<li><t>SCTP over IPv4 or IPv6 as specified in <xref target="RFC9260"/>.</t></li>
<li><t>SCTP over UDP as specified in <xref target="RFC6951"/>.</t></li>
<li><t>The use of SCTP Authentication as specified in <xref target="RFC4895"/>.</t></li>
</ul>
<t>Therefore using an incorrect zero checksum, in particular when using SCTP
over DTLS, will not result in problems with the middle boxes expecting correct
CRC32c checksums in SCTP packets.</t>
<t>An SCTP implementation <bcp14>MAY</bcp14> also require the upper layer to
indicate that it is fine to accept SCTP packets with an incorrect CRC32c value
of zero.</t>
<t>An end point willing to accept SCTP packets with a checksum of zero
<bcp14>MUST</bcp14> include the Zero Checksum Acceptable Chunk Parameter in
the INIT or INIT ACK chunk it sends.</t>
</section>

<section>
<name>Sender Side Considerations</name>
<t>If an end point has received an INIT or INIT ACK chunk containing a Zero
Checksum Acceptable Chunk Parameter from its peer during the association setup,
it <bcp14>SHOULD</bcp14> use zero as the checksum for all packets sent in this
association with the following three exceptions:</t>
<ul>
<li><t>When an end point sends a packet containing an INIT chunk, it
<bcp14>MUST</bcp14> include a correct CRC32c checksum in the packet containing
the INIT chunk.</t></li>
<li><t>When an end point sends a packet containing a COOKIE ECHO chunk, it
<bcp14>MUST</bcp14> include a correct CRC32c checksum in the packet containing
the COOKIE ECHO chunk.</t></li>
<li><t>When an end point supports the dynamic address reconfiguration specified
in <xref target='RFC5061'/> and sends a packet containing an ASCONF chunk, it
<bcp14>MUST</bcp14> include a correct CRC32c checksum in the packet containing
the ASCONF chunk.</t></li>
</ul>
<t>The first exception allows backwards compatibility and the second and
third exception allow a simpler implementation of the extension defined in this
document.</t>
<t>When an end point responds to an "Out of the Blue" (OOTB) SCTP packet,
it <bcp14>MUST</bcp14> include a correct CRC32c checksum in the response
packet.</t>
<t>An SCTP end point <bcp14>MAY</bcp14> only send packets with an incorrect
checksum of zero, if the upper layer allowed the reception of SCTP packets with
an incorrect zero checksum.</t>
</section>

<section>
<name>Receiver Side Considerations</name>
<t>Zero is a valid result of the CRC32c algorithm.
<!-- Maybe present an example; would also be a good additional test case. -->
Therefore, a receiver of an SCTP packet 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.</t>
<t>If an end point has sent the Zero Checksum Acceptable Chunk Parameter in
an INIT or INIT ACK chunk, it <bcp14>MUST</bcp14> accept SCTP packets using
an incorrect checksum value of zero in addition to SCTP packets containing the
correct CRC32c checksum value for this association.</t>
<t>An SCTP implementation <bcp14>MAY</bcp14> process OOTB SCTP packets having
an incorrect zero checksum in addition to OOTB packets with a correct CRC32c
checksum.</t>
</section>
</section>

<section>
<name>Socket API Considerations</name>
<t>This section describes how the socket API defined in
<xref target='RFC6458'/> needs to be extended to provide a way for the
application to control the acceptance of a zero checksum.</t>
<t>Please note that this section is informational only.</t>
<t>A socket API implementation based on <xref target='RFC6458'/> is extended by
supporting one new write-only IPPROTO_SCTP-level socket option.</t>

<section>
<name>Set Accepting a Zero Checksum (SCTP_ACCEPT_ZERO_CHECKSUM)</name>
<t>This socket option 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.</t>
<t>This option expects an integer boolean flag, where a non-zero value
enables the option, and a zero value disables the option.
An implementation might only send packets with an incorrect checksum of zero,
if this option is enabled.</t>
<t>This option is disabled by default.</t>
</section>
</section>

<section>
<name>IANA Considerations</name>
<t>[NOTE to RFC-Editor: "RFCXXXX" is to be replaced by the RFC number you
assign this document.]</t>
<t>[NOTE to RFC-Editor: The suggested value for the parameter type is tentative
and to be confirmed by IANA.]</t>
<t>This document (RFCXXXX) is the reference for the registration described
in this section.</t>
<t>A new chunk parameter type has to be assigned by IANA.
This requires an additional line in the "Chunk Parameter Types" registry for
SCTP:</t>
<table>
<name>New entry in "Chunk Parameter Types" registry</name>
<thead>
<tr><th>ID Value</th>             <th>Chunk Parameter Type</th>                          <th>Reference</th></tr>
</thead>
<tbody>
<tr><td>32769 (suggested)</td>    <td>Zero Checksum Acceptable (0x8001 (suggested))</td> <td>[RFCXXXX]</td></tr>
</tbody>
</table>
</section>

<section>
<name>Security Considerations</name>
<t>This document does not change the considerations given in
<xref target="RFC9260"/>.</t>
</section>
</middle>

<back>
<references>
<name>References</name>
<references>
<name>Normative References</name>
<xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
<xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5061.xml"/>
<xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
<xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8261.xml"/>
<xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.9260.xml"/>
</references>

<references>
<name>Informative References</name>
<xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.4895.xml"/>
<xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6458.xml"/>
<xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6951.xml"/>
</references>
</references>

<section numbered='false'>
<name>Acknowledgments</name>
<t>The authors wish to thank
<contact fullname="Gorry Fairhurst"/>,
<contact fullname="Mike Heard"/>,
<contact fullname="Nils Ohlmeier"/>,
<contact fullname="Claudio Porfiri"/>, and
<contact fullname="Magnus Westerlund"/>
for their invaluable comments.</t>
</section>
</back>
</rfc>
