<?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-02"
     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-02"/>

<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 some 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.</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 when using
a specified alternate error detection method.
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 = 8           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|           Error Detection Method Identifier (EDMID)           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
</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 8.</t>
</dd>
<dt>Error Detection Method Identifier (EDMID): 32 bits (unsigned integer)</dt>
<dd>
<t>An IANA registered value specifying the alternate error detection method
the sender of this parameter is willing to use for received packets.</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 more than once in INIT and INIT ACK chunks and
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 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 <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>MUST NOT</bcp14> 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.</t>
<t>One example of an alternate error detection method is the use of SCTP over
DTLS as described in <xref target="RFC8261"/> (as used in the WebRTC context).
A counter example is the use of SCTP over UDP as specified in
<xref target="RFC6951"/>.</t>
<t>If middle boxes expecting correct CRC32c checksums in SCTP packets might
impact the communication, an incorrect zero checksum <bcp14>MUST NOT</bcp14>
be used.</t>
<t>An SCTP implementation <bcp14>MAY</bcp14> also require the upper layer to
indicate that it is fine to use a specific alternate error detection method
for accepting SCTP packets with an incorrect CRC32c value of zero.</t>
<t>An end point willing to accept SCTP packets with an incorrect checksum of
zero <bcp14>MUST</bcp14> include the Zero Checksum Acceptable Chunk Parameter
indicating the alternate error detection method 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 indicating an alternate error detection
method it supports 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 four 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>
<li><t>Alternate error detection methods might have some additional conditions
requiring that the sender <bcp14>MUST</bcp14> include a correct CRC32c checksum
in the packet.</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.
The last condition covers alternate error detection method specific
constraints.</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 use of the alternate error
detection method that was announced by the peer.</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 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.</t>
<t>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 <bcp14>MUST</bcp14> 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.</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 anchor='edm_sctp_over_dlts'>
<name>Error Detection via SCTP over DTLS</name>
<t>Using SCTP over DTLS as specified in <xref target="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.</t>
<t>IANA is requested to assign the Error Detection Method Identifier
of 1 for this method.</t>
</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 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.</t>
<t>This option expects an unsigned integer.
Possible values include:</t>
<dl>
<dt>SCTP_EDMID_NONE:</dt>
<dd><t>Disable the use of alternate error detection method.
This means that all SCTP packets being sent have a correct CRC32c.</t></dd>
<dt>SCTP_EDMID_LOWER_LAYER_DTLS:</dt>
<dd><t>Use the alternate error detection method described in
<xref target='edm_sctp_over_dlts'/>.</t></dd>
</dl>
<t>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.</t>
<t>The default for this socket option is that the use of alternate error
detection methods is disabled.</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>
<t>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 <xref target='RFC8126'/>. 
Documentation for a new error detection method <bcp14>MUST</bcp14> contain the
following information:</t>
<ol>
<li><t>A name of an alternate error detection method.</t></li>
<li><t>A reference describing the alternate error detection method, in
particular any method specific constraints.</t></li>
</ol>
<t>IANA is requested to use the following as the initial contents of the
registry:</t>
<table>
<name>Initial Contents of the "Error Detection Method" registry</name>
<thead>
<tr><th>ID Value</th>       <th>Error Detection Method</th> <th>Reference</th></tr>
</thead>
<tbody>
<tr><td>0             </td> <td>Reserved</td>               <td>[RFCXXXX]</td></tr>
<tr><td>1             </td> <td>SCTP over DTLS</td>         <td>[RFCXXXX]</td></tr>
<tr><td>2 - 4294967295</td> <td>Unassigned</td>             <td>         </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.8126.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.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="Peter Lei"/>,
<contact fullname="Nils Ohlmeier"/>,
<contact fullname="Claudio Porfiri"/>, and
<contact fullname="Magnus Westerlund"/>
for their invaluable comments.</t>
</section>
</back>
</rfc>
