<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">

<?rfc toc="yes"?>
<?rfc tocdepth='1'?>
<?rfc compact="yes" ?>
<?rfc subcompact="no" ?>
<?rfc rfcedstyle="yes" ?>
<?rfc symrefs="yes" ?>
<?rfc sortrefs="yes" ?>

<!--[rfced] Please note that after you have approved the document,
post-xml2rfc changes will be made to update the header and
boilerplate as described in RFC 5741.
-->

<rfc docName="draft-tuexen-tsvwg-rfc6083-bis-00" category="std" ipr="trust200902">

<front>
<title abbrev="DTLS for SCTP">
       Datagram Transport Layer Security (DTLS)
       for&nbsp;Stream&nbsp;Control&nbsp;Transmission&nbsp;Protocol&nbsp;(SCTP)
</title>


<!-- ************** MICHAEL TUEXEN *************** -->
<author initials="M." surname="Tuexen" fullname="Michael Tuexen">
<organization abbrev="Muenster Univ. of Applied Sciences">
              Muenster University of Applied Sciences</organization>
<address>
    <postal>
        <street>Stegerwaldstr. 39</street>
        <city>48565 Steinfurt</city>
        <country>Germany</country>
    </postal>
    <email>tuexen@fh-muenster.de</email>
</address>
</author>

<!-- ************** ROBIN SEGGELMANN *************** -->
<author initials="R." surname="Seggelmann" fullname="Robin Seggelmann">
<organization abbrev="Muenster Univ. of Applied Sciences">
              Muenster University of Applied Sciences</organization>
<address>
    <postal>
        <street>Stegerwaldstr. 39</street>
        <city>48565 Steinfurt</city>
        <country>Germany</country>
    </postal>
    <email>seggelmann@fh-muenster.de</email>
</address>
</author>

<!-- ************** ERIC RESCORLA *************** -->
<author initials="E." surname="Rescorla" fullname="Eric Rescorla">
<organization>RTFM, Inc.</organization>
<address>
    <postal>
        <street>2064 Edgewood Drive</street>
        <city>Palo Alto, CA 94303</city>
        <country>USA</country>
    </postal>
    <email>ekr@networkresonance.com</email>
</address>
</author>

<date/>

<!-- [rfced] Please insert any keywords (beyond those that appear in 
the title) for use on http://www.rfc-editor.org/rfcsearch.html. -->
<!-- [MT] no additional keywords are required! -->

<abstract>
<t>This document describes the usage of the Datagram Transport Layer
Security (DTLS) protocol over the Stream Control Transmission
Protocol (SCTP).</t>
<t>DTLS over SCTP provides communications privacy for applications that
use SCTP as their transport protocol and allows client/server applications to
communicate in a way that is designed to prevent eavesdropping and
detect tampering or message forgery.</t>
<t>Applications using DTLS over SCTP can use almost all transport
features provided by SCTP and its extensions.</t>
</abstract>

</front>

<middle>
<section title="Introduction">
<section title="Overview">
<t>This document describes the usage of the Datagram Transport Layer
Security (DTLS) protocol, as defined in
<xref target='RFC4347'/>, over the
Stream Control Transmission Protocol (SCTP), as defined in
<xref target='RFC4960'/>.</t>

<t>DTLS over SCTP provides communications privacy for applications that
use SCTP as their transport protocol and allows client/server applications to
communicate in a way that is designed to prevent eavesdropping and
detect tampering or message forgery.</t>
<t>Applications using DTLS over SCTP can use almost all transport
features provided by SCTP and its extensions.</t>

<t>TLS, from which DTLS was derived, is designed to run on top of a byte-stream-oriented transport protocol providing a reliable, in-sequence delivery.
Thus, TLS is currently mainly being used on top of the Transmission Control
Protocol (TCP), as defined in <xref target='RFC0793'/>.</t>

<t>TLS over SCTP as described in <xref target='RFC3436'/>
has some serious limitations:
<list style="symbols">
<t>It does not support the unordered delivery of SCTP user messages.</t>
<t>It does not support partial reliability as defined in
   <xref target='RFC3758'/>.</t>
<t>It only supports the usage of the same number of streams in both
   directions.</t>
<t>It uses a TLS connection for every bidirectional stream, which requires
   a substantial amount of resources and message exchanges if a large number
   of streams is used.</t>
</list></t>

<t>DTLS over SCTP as described in this document overcomes these limitations
of TLS over SCTP. In particular, DTLS/SCTP supports:
<list style="symbols">
<t>preservation of message boundaries.</t>
<t>a large number of unidirectional and bidirectional streams.</t>
<t>ordered and unordered delivery of SCTP user messages.</t>
<t>the partial reliability extension as defined in
   <xref target='RFC3758'/>.</t>
<t>the dynamic address reconfiguration extension as defined in
   <xref target='RFC5061'/>.</t>
</list></t>

<t>However, the following limitations still apply:
<list style="symbols">
<t>The maximum user message size is 2^14 bytes, which is the DTLS limit.</t>
<t>The DTLS user cannot perform the SCTP-AUTH key management
   because this is done by the DTLS layer.</t>
</list></t>

<t>The method described in this document requires that the SCTP implementation
supports the optional feature of fragmentation of SCTP user messages as
defined in <xref target='RFC4960'/> and the SCTP authentication extension
defined in <xref target='RFC4895'/>.</t>
</section>

<section title="Terminology">
<t>This document uses the following terms:
<list style="hanging">
<t hangText="Association:">An SCTP association.</t>
<t hangText="Stream:">A unidirectional stream of an SCTP association.
It is uniquely identified by a stream identifier.</t>
</list></t>
</section>

<section title="Abbreviations">
<t><list style="hanging">
<t hangText="DTLS:">Datagram Transport Layer Security</t>
<t hangText="MTU:">Maximum Transmission Unit</t>
<t hangText="PPID:">Payload Protocol Identifier</t>
<t hangText="SCTP:">Stream Control Transmission Protocol</t>
<t hangText="TCP:">Transmission Control Protocol</t>
<t hangText="TLS:">Transport Layer Security</t>
</list></t>
</section>
</section>

<section title="Conventions">
<t>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
<xref target='RFC2119'/>.</t>
</section>

<section title="DTLS Considerations">

<section title="Version of DTLS">
<t>This document is based on <xref target='RFC4347'/>, and it
is expected that DTLS/SCTP as described in this document will
work with future versions of DTLS.</t>
</section>

<section anchor="size"
         title="Message Sizes">
<t>DTLS limits the DTLS user message size to the current Path MTU
minus the header sizes.
For the purposes of running over SCTP, the DTLS path MTU MUST be
considered to be 2^14.</t>
</section>

<section title="Replay Detection">
<t>The replay detection of DTLS may result in the DTLS
layer dropping messages. Since DTLS/SCTP provides a 
reliable service if requested by the application, replay
detection cannot be used. Therefore, replay detection of
DTLS MUST NOT be used.</t>
</section>

<section title="Path MTU Discovery">
<t>SCTP provides Path MTU discovery and fragmentation/reassembly
for user messages. According to <xref target="size"/>, DTLS
can send maximum sized messages.
Therefore, Path MTU discovery of DTLS MUST NOT be used.</t>
</section>

<section title="Retransmission of Messages">
<t>SCTP provides a reliable and in-sequence transport service
for DTLS messages that require it. See <xref target="stream"/>.
Therefore, DTLS procedures for retransmissions MUST NOT be used.</t>
</section>
</section>

<section title="SCTP Considerations">

<section title="Mapping of DTLS Records">
<t>The supported maximum length of SCTP user messages MUST be at
least 2^14 + 2048 + 13 = 18445 bytes (2^14 + 2048 is the maximum
length of the DTLSCiphertext.fragment, and 13 is the size of the
DTLS record header). In particular, the SCTP implementation MUST
support fragmentation of user messages.</t>
<t>Every SCTP user message MUST consist of exactly one DTLS record.</t>
</section>

<section title="DTLS Connection Handling">
<t>Each DTLS connection MUST be established and terminated
within the same SCTP association. A DTLS connection MUST NOT
span multiple SCTP associations.</t>
</section>

<section title="Payload Protocol Identifier Usage">
<t>Application protocols using DTLS over SCTP SHOULD
register and use a separate payload protocol identifier (PPID)
and SHOULD NOT reuse the PPID that they registered for running
directly over SCTP.</t>
<t>Using the same PPID does not harm as long as the application
can determine whether or not DTLS is used.
However, for protocol analyzers, for example, it is much easier
if a separate PPID is used.</t>
<t>This means, in particular, that there is no specific PPID for DTLS.</t>
</section>

<section anchor="stream"
         title="Stream Usage">
<t>All DTLS messages of the ChangeCipherSpec, Alert, or Handshake protocol
MUST be transported on stream 0 with unlimited reliability and with the
ordered delivery feature.</t>
<t>DTLS messages of the ApplicationData protocol SHOULD use multiple streams
other than stream 0;
they MAY use stream 0 for everything if they do not care about
minimizing head of line blocking.</t>
</section>

<section title="Chunk Handling">
<t>DATA chunks of SCTP MUST be sent in an authenticated way
as described in <xref target='RFC4895'/>.
Other chunks MAY be sent in an authenticated way.
This makes sure that an attacker cannot modify the stream
in which a message is sent or affect the ordered/unordered delivery
of the message.</t>
<t>If PR-SCTP as defined in <xref target='RFC3758'/> is used,
FORWARD-TSN chunks MUST also be sent in an authenticated way
as described in <xref target='RFC4895'/>.
This makes sure that it is not possible for an attacker to drop
messages and use forged FORWARD-TSN, SACK, and/or SHUTDOWN chunks to
hide this dropping.</t>
</section>

<section title="Renegotiation">
<t>DTLS supports renegotiation, and therefore this feature is also
available by DTLS/SCTP. It is up to the upper layer to use/allow
it or not. Application writers should be aware that allowing
renegotiations may result in changes of security parameters.</t>
</section>

<section title="Handshake">
<t>A DTLS implementation discards DTLS messages from older epochs
after some time, as described in Section 4.1 of
<xref target='RFC4347'/>.
This is not acceptable when the DTLS user performs a reliable
data transfer. To avoid discarding messages,
the following procedures are required.</t>
<t>Before sending a ChangeCipherSpec message, all
outstanding SCTP user messages MUST have been acknowledged
by the SCTP peer and MUST NOT be revoked by the SCTP peer.</t>
<t>Prior to processing a received ChangeCipherSpec, all other
received SCTP user messages that are buffered in the SCTP layer
MUST be read and processed by DTLS.</t>
<t>User messages that arrive between ChangeCipherSpec and Finished messages
and use the new epoch have probably passed the Finished message
and MUST be buffered by DTLS until the Finished message is read.</t>
</section>

<section title="Handling of Endpoint-Pair Shared Secrets">
<t>The endpoint-pair shared secret for Shared Key Identifier 0
is empty and MUST be used when establishing a DTLS connection.
Whenever the master key changes, a 64-byte shared
secret is derived from every master secret and provided as a new
endpoint-pair shared secret by using the exporter described
in <xref target='RFC5705'/>. The exporter MUST
use the label given in <xref target='iana'/> and no context.
The new Shared Key Identifier MUST be the old Shared Key Identifier
incremented by 1. If the old one is 65535, the new one MUST be 1.</t>
<t>Before sending the Finished message, the active SCTP-AUTH key
MUST be switched to the new one.</t>
<t>Once the corresponding Finished message from the peer has
been received, the old SCTP-AUTH key SHOULD be removed.</t>
</section>

<section title="Shutdown">
<t>To prevent DTLS from discarding DTLS user messages while it is
shutting down, a CloseNotify message MUST only be sent after
all outstanding SCTP user messages have been acknowledged by the
SCTP peer and MUST NOT still be revoked by the SCTP peer.</t>
<t>Prior to processing a received CloseNotify, all other
received SCTP user messages that are buffered in the SCTP layer
MUST be read and processed by DTLS.</t>
</section>
</section>

<section anchor="iana"
         title="IANA Considerations">
<t>IANA added a value to the TLS Exporter Label registry
as described in <xref target='RFC5705'/>.
The label is "EXPORTER_DTLS_OVER_SCTP".</t>
</section>

<section title="Security Considerations">
<t>The security considerations given in
<xref target='RFC4347'/>,
<xref target='RFC4895'/>, and
<xref target='RFC4960'/>
also apply to this document.</t>
<t>It is possible to authenticate DTLS endpoints based on IP addresses
in certificates. SCTP associations can use multiple addresses per
SCTP endpoint. Therefore, it is possible that DTLS records will be
sent from a different IP address than that originally authenticated.
This is not a problem provided that no security decisions are made
based on that IP address.  This is a special case of a general rule:
all decisions should be based on the peer's authenticated identity,
not on its transport layer identity.</t>
<t>For each message, the SCTP user also provides a stream
identifier, a flag to indicate whether the message is sent
ordered or unordered, and a payload protocol identifier.
Although DTLS can be used to provide privacy for the actual user message,
none of these three are protected by DTLS.
They are sent as clear text, because they are part of the SCTP DATA chunk
header.</t>
<t>DTLS supports cipher suites that contain a NULL cipher algorithm.
Negotiating a NULL cipher algorithm will not provide communications privacy
for applications and will not provide privacy for user messages.</t>
</section>

<section anchor="acks"
         title="Acknowledgments">
<t>The authors wish to thank
Anna Brunstrom,
Lars Eggert,
Gorry Fairhurst,
Ian Goldberg,
Alfred Hoenes,
Carsten Hohendorf,
Stefan Lindskog,
Daniel Mentz,
and Sean Turner
for their invaluable comments.</t>
</section>


</middle>

<back>
<references title='Normative References'>
<?rfc include="reference.RFC.2119" ?>
<?rfc include="reference.RFC.3758" ?>
<?rfc include="reference.RFC.4347" ?>
<?rfc include="reference.RFC.4895" ?>
<?rfc include="reference.RFC.4960" ?>
<?rfc include="reference.RFC.5705" ?>
</references>
<references title='Informative References'>
<?rfc include="reference.RFC.0793" ?>
<?rfc include="reference.RFC.3436" ?>
<?rfc include="reference.RFC.5061" ?>
</references>
</back>
</rfc>
