<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes"?>
<?rfc tocdepth='2'?>
<?rfc compact="yes" ?>
<?rfc subcompact="no" ?>
<?rfc rfcedstyle="yes" ?>

<rfc number="7496" category="std"
     ipr="trust200902" submissionType="IETF" consensus="yes">

<front>
<title abbrev="Additional PR-SCTP Policies">
       Additional Policies for the Partially Reliable  
Stream&nbsp;Control&nbsp;Transmission&nbsp;Protocol&nbsp;Extension
</title>

<author initials="M." surname="Tuexen" fullname="Michael Tuexen">
<organization abbrev="Muenster Univ. of Appl. Sciences">
              Muenster 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="R." surname="Seggelmann" fullname="Robin Seggelmann">
<organization>Metafinanz Informationssysteme GmbH</organization>
<address>
    <postal>
        <street>Leopoldstrasse 146</street>
        <city>80804 Muenchen</city>
        <country>Germany</country>
    </postal>
    <email>rfc@robin-seggelmann.com</email>
</address>
</author>

<author initials="R. R." surname="Stewart" fullname="Randall R. Stewart">
<organization>Netflix, Inc.</organization>
<address>
    <postal>
        <street></street>
        <city>Chapin</city> <region>SC</region>
        <code>29036</code>
        <country>United States</country>
    </postal>
    <email>randall@lakerest.net</email>
</address>
</author>

<author initials='S.' surname='Loreto' fullname='Salvatore Loreto'>
  <organization>Ericsson</organization>
  <address>
    <postal>
      <street>Hirsalantie 11</street>
      <city>Jorvas</city>
      <code> 02420 </code>
      <country>Finland</country>
    </postal>
    <email>Salvatore.Loreto@ericsson.com</email>
  </address>
</author>

<date month="March" year="2015"/>

<abstract>
<t>This document defines two additional policies for the Partially Reliable
Stream Control Transmission Protocol (PR-SCTP) extension.  These policies allow limitation of the number of retransmissions and prioritization of user messages for
more efficient usage of the send buffer.</t>
</abstract>

</front>

<middle>
<section title="Introduction">
<t>The Partially Reliable SCTP (PR-SCTP) extension defined in
<xref target='RFC3758'/> provides a generic method for senders to
abandon user messages. The decision to abandon a user message
is sender side only, and the exact condition is called a "PR-SCTP policy"
(<xref target='RFC3758'/> refers to them as "PR-SCTP Services").
<xref target='RFC3758'/> also defines one particular PR-SCTP policy,
called "Timed Reliability". This allows the sender to specify a timeout
for a user message after which the SCTP stack abandons the user message.</t>
<t>This document specifies the following two additional PR-SCTP policies:
<list style='hanging'>
<t hangText='Limited Retransmission Policy:'>
Allows limitation of the number of retransmissions.</t>
<t hangText='Priority Policy:'>
Allows removal of lower-priority messages if space for higher-priority messages is needed in the send buffer.</t>
</list></t>
</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='Additional PR-SCTP Policies'>
<t>This section defines two new PR-SCTP policies, one in each subsection.</t>
<t>Please note that it is REQUIRED to implement <xref target='RFC3758'/>,
if you want to implement these additional policies. However, these
additional policies are OPTIONAL when implementing <xref target='RFC3758'/>.</t>
<section title='Limited Retransmissions Policy'
         anchor='rtx'>
<t>Using the Limited Retransmission Policy allows the sender of a user message
to specify an upper limit for the number of retransmissions for each DATA chunk
of the given user messages. The sender MUST abandon a user message if the
number of retransmissions of any of the DATA chunks of the user message
would exceed the provided limit. The sender MUST perform all other actions
required for processing the retransmission event, such as adapting
the congestion window and the retransmission timeout.
Please note that the number of retransmissions includes both fast and
timer-based retransmissions.</t>
<t>The sender MAY limit the number of retransmissions to 0. This will
result in abandoning the message when it would get retransmitted for
the first time. The use of this setting provides a service similar to UDP,
which also does not perform any retransmissions.</t>
<t>Please note that using this policy does not affect the handling of the
thresholds 'Association.Max.Retrans' and 'Path.Max.Retrans' as specified
in Section 8 of <xref target='RFC4960'/>.</t>
<t>The WebRTC protocol stack (see <xref target='DATA-CHAN'/>)
is an example of where the Limited Retransmissions Policy is used.</t>
</section>

<section title='Priority Policy'
         anchor='prio'>
<t>Using the Priority Policy allows the sender of a user message to specify
a priority. When storing a user message in the send buffer while there is not
enough available space, the SCTP stack at the sender side MAY abandon other
user message(s) of the same SCTP association (with the same or a different
stream) with a priority lower than the provided one.
User messages sent reliably are considered to have a priority higher than
all messages sent with the Priority Policy.
The algorithm for selecting the message(s) being abandoned is implementation
specific.</t>
<t>After lower-priority messages have been abandoned, high-priority
messages can be transferred without the send call blocking (if used
in blocking mode) or the send call failing (if used in non-blocking
mode).</t>
<t>The IP Flow Information Export (IPFIX) protocol stack (see <xref target='RFC7011'/>) is an example
of where the Priority Policy can be used. 
Template records would be sent with
full reliability, while flow records related to billing, security,
and other monitoring would be sent using the Priority Policy with
varying priority.  The priority of security-related flow records would 
be set higher than the priority of monitoring-related flow records.
</t>
</section>
</section>

<section title='Socket API Considerations'>
<t>This section describes how the socket API defined in
<xref target='RFC6458'/> is extended to support the newly defined
PR-SCTP policies, to provide some statistical information, and to
control the negotiation of the PR-SCTP extension during the
SCTP association setup.</t>
<t>Please note that this section is informational only.</t>

<section title="Data Types">
<t>This section uses data types from <xref target='IEEE.1003-1G.1997'/>:
uintN_t means an unsigned integer of exactly N bits (e.g., uint16_t).
This is the same as in <xref target='RFC6458'/>.</t>
</section>

<section title='Support for Added PR-SCTP Policies'>
<t>As defined in <xref target='RFC6458'/>, the PR-SCTP policy is
specified and configured by using the following sctp_prinfo structure:</t>
<figure>
<artwork>
struct sctp_prinfo {
  uint16_t pr_policy;
  uint32_t pr_value;
};
</artwork>
</figure>
<t>When the Limited Retransmission Policy described in <xref target='rtx'/>
is used, pr_policy has the value SCTP_PR_SCTP_RTX and the number of
retransmissions is given in pr_value.</t>
<t>When using the Priority Policy described in <xref target='prio'/>,
pr_policy has the value SCTP_PR_SCTP_PRIO. The priority is given
in pr_value. The value of zero is the highest priority, and larger numbers in
pr_value denote lower priorities.</t>
<t>The following table summarizes the possible parameter settings defined in
<xref target='RFC6458'/> and this document:</t>
<texttable>
<ttcol align='left'>pr_policy</ttcol>
<ttcol align='left'>pr_value</ttcol>
<ttcol align='left'>Specification</ttcol>
<c>SCTP_PR_SCTP_NONE</c><c>Ignored</c>                  <c><xref target='RFC6458'/></c>
<c>SCTP_PR_SCTP_TTL</c> <c>Lifetime in ms</c>           <c><xref target='RFC6458'/></c>
<c>SCTP_PR_SCTP_RTX</c> <c>Number of retransmissions</c><c><xref target='rtx'/></c>
<c>SCTP_PR_SCTP_PRIO</c><c>Priority</c>                 <c><xref target='prio'/></c>
</texttable>
</section>

<section title='Socket Option for Getting the Stream-Specific PR-SCTP Status (SCTP_PR_STREAM_STATUS)'
         anchor='SCTP_PR_STREAM_STATUS'>
<t>This socket option uses IPPROTO_SCTP as its level and SCTP_PR_STREAM_STATUS
as its name. It can only be used with getsockopt() but not with setsockopt().
The socket option value uses the following structure:</t>
<figure>
<artwork>
struct sctp_prstatus {
  sctp_assoc_t sprstat_assoc_id;
  uint16_t sprstat_sid;
  uint16_t sprstat_policy;
  uint64_t sprstat_abandoned_unsent;
  uint64_t sprstat_abandoned_sent;
};
</artwork>
</figure>
<t><list style="hanging">
<t hangText="sprstat_assoc_id:">
This parameter is ignored for one-to-one style sockets.
For one-to-many style sockets, this parameter indicates for which association
the user wants the information. It is an error to use
SCTP_{CURRENT|ALL|FUTURE}_ASSOC in sprstat_assoc_id.</t>
<t hangText="sprstat_sid:">
This parameter indicates for which outgoing SCTP stream the user wants the
information.</t>
<t hangText="sprstat_policy:">
This parameter indicates for which PR-SCTP policy the user wants the information.
It is an error to use SCTP_PR_SCTP_NONE in sprstat_policy.
If SCTP_PR_SCTP_ALL is used, the counters provided are aggregated over all
supported policies.</t>
<t hangText="sprstat_abandoned_unsent:">
The number of user messages that have been abandoned using the policy
specified in sprstat_policy on the stream specified in sprstat_sid for the
association specified by sprstat_assoc_id,
before any part of the user message could be sent.</t>
<t hangText="sprstat_abandoned_sent:">
The number of user messages that have been abandoned using the policy
specified in sprstat_policy on the stream specified in sprstat_sid for the
association specified by sprstat_assoc_id,
after a part of the user message has been sent.</t>
</list>
There are separate counters for unsent and sent user messages because
the SCTP_SEND_FAILED_EVENT supports a similar differentiation.
Please note that an abandoned large user message requiring SCTP-level
fragmentation is reported in the sprstat_abandoned_sent counter as soon as
at least one fragment of it has been sent. Therefore, each abandoned user
message is counted in either sprstat_abandoned_unsent or
sprstat_abandoned_sent.</t>
<t>If more detailed information about abandoned user messages is required,
the subscription to the SCTP_SEND_FAILED_EVENT is recommended.
Please note that some implementations might choose not to support this option,
since it increases the resources needed for an outgoing SCTP stream.
For the same reasons, some implementations might only support using
SCTP_PR_SCTP_ALL in sprstat_policy.</t>
<t>sctp_opt_info() needs to be extended to support SCTP_PR_STREAM_STATUS.</t>
</section>

<section title='Socket Option for Getting the Association-Specific PR-SCTP Status (SCTP_PR_ASSOC_STATUS)'>
<t>This socket option uses IPPROTO_SCTP as its level and SCTP_PR_ASSOC_STATUS
as its name. It can only be used with getsockopt(), but not with setsockopt().
The socket option value uses the same structure as described in
<xref target='SCTP_PR_STREAM_STATUS'/>:</t>
<figure>
<artwork>
struct sctp_prstatus {
  sctp_assoc_t sprstat_assoc_id;
  uint16_t sprstat_sid;
  uint16_t sprstat_policy;
  uint64_t sprstat_abandoned_unsent;
  uint64_t sprstat_abandoned_sent;
};
</artwork>
</figure>
<t><list style="hanging">
<t hangText="sprstat_assoc_id:">
This parameter is ignored for one-to-one style sockets.
For one-to-many style sockets, this parameter indicates for which association
the user wants the information. It is an error to use
SCTP_{CURRENT|ALL|FUTURE}_ASSOC in sprstat_assoc_id.</t>
<t hangText="sprstat_sid:">
This parameter is ignored.</t>
<t hangText="sprstat_policy:">
This parameter indicates for which PR-SCTP policy the user wants the information.
It is an error to use SCTP_PR_SCTP_NONE in sprstat_policy.
If SCTP_PR_SCTP_ALL is used, the counters provided are aggregated over all
supported policies.</t>
<t hangText="sprstat_abandoned_unsent:">
The number of user messages that have been abandoned using the policy
specified in sprstat_policy for the association specified by sprstat_assoc_id,
before any part of the user message could be sent.</t>
<t hangText="sprstat_abandoned_sent:">
The number of user messages that have been abandoned using the policy
specified in sprstat_policy for the association specified by sprstat_assoc_id,
after a part of the user message has been sent.</t>
</list>
There are separate counters for unsent and sent user messages because
the SCTP_SEND_FAILED_EVENT supports a similar differentiation.
Please note that an abandoned large user message requiring SCTP-level
fragmentation is reported in the sprstat_abandoned_sent counter as soon as
at least one fragment of it has been sent. Therefore, each abandoned user
message is counted in either sprstat_abandoned_unsent or
sprstat_abandoned_sent.</t>
<t>If more detailed information about abandoned user messages is required,
the usage of the option described in <xref target='SCTP_PR_STREAM_STATUS'/> or
the subscription to the SCTP_SEND_FAILED_EVENT is recommended.</t>
<t>sctp_opt_info() needs to be extended to support SCTP_PR_ASSOC_STATUS.</t>
</section>

<section title='Socket Option for Getting and Setting the PR-SCTP Support
                (SCTP_PR_SUPPORTED)'>
<t>This socket option allows the enabling or disabling of the negotiation
of PR-SCTP support for future associations.
For existing associations, it allows one to query whether or not PR-SCTP support was
negotiated on a particular association.</t>
<t>Whether or not PR-SCTP is enabled by default is implementation specific.</t>
<t>This socket option uses IPPROTO_SCTP as its level and SCTP_PR_SUPPORTED
as its name. It can be used with getsockopt() and setsockopt().
The socket option value uses the following structure
defined in <xref target='RFC6458'/>:</t>
<figure>
<artwork>
struct sctp_assoc_value {
  sctp_assoc_t assoc_id;
  uint32_t assoc_value;
};
</artwork>
</figure>
<t><list style="hanging">
<t hangText="assoc_id:">
This parameter is ignored for one-to-one style sockets.
For one-to-many style sockets, this parameter indicates upon which association
the user is performing an action.
The special sctp_assoc_t SCTP_FUTURE_ASSOC can also be used;
it is an error to use SCTP_{CURRENT|ALL}_ASSOC in assoc_id.</t>
<t hangText="assoc_value:">
A non-zero value encodes the enabling of PR-SCTP, whereas a value of 0 encodes
the disabling of PR-SCTP.</t>
</list></t>
<t>sctp_opt_info() needs to be extended to support SCTP_PR_SUPPORTED.</t>
</section>
</section>

<section title="Security Considerations">
<t>This document does not add any security considerations
to those given in
<xref target='RFC4960'/>,
<xref target='RFC3758'/>, and
<xref target='RFC6458'/>.
As indicated in the Security Considerations of <xref target='RFC3758'/>,
transport-layer security in the form of TLS over SCTP
(see <xref target='RFC3436'/>) can't be used for PR-SCTP.
However, DTLS over SCTP (see <xref target='RFC6083'/>) could be used instead.
If DTLS over SCTP as specified in <xref target='RFC6083'/> is used, the
Security Considerations of <xref target='RFC6083'/> do apply.
It should also be noted that using PR-SCTP for an SCTP association doesn't
allow that association to behave more aggressively
than an SCTP association not using PR-SCTP.</t>
</section>


</middle>

<back>
<references title='Normative References'>
<?rfc include="reference.RFC.2119" ?>
<?rfc include="reference.RFC.3758" ?>
<?rfc include="reference.RFC.4960" ?>
</references>
<references title='Informative References'>
<?rfc include="reference.RFC.3436" ?>
<?rfc include="reference.RFC.6083" ?>
<?rfc include="reference.RFC.6458" ?>
<?rfc include="reference.RFC.7011" ?>

<!-- draft-ietf-rtcweb-data-channel: in C238 in MISSREF -->
<reference anchor='DATA-CHAN'>
<front>
<title>WebRTC Data Channels</title>

<author initials='R' surname='Jesup' fullname='Randell Jesup'>
    <organization />
</author>

<author initials='S' surname='Loreto' fullname='Salvatore Loreto'>
    <organization />
</author>

<author initials='M' surname='Tuexen' fullname='Michael Tuexen'>
    <organization />
</author>

<date month='January' day='4' year='2015' />

<abstract><t>The WebRTC framework specifies protocol support for direct interactive rich communication using audio, video, and data between two peers' web-browsers.  This document specifies the non-media data transport aspects of the WebRTC framework.  It provides an architectural overview of how the Stream Control Transmission Protocol (SCTP) is used in the WebRTC context as a generic transport service allowing WEB-browsers to exchange generic data from peer to peer.</t></abstract>

</front>

<seriesInfo name='Work in Progress,' value='draft-ietf-rtcweb-data-channel-13' />

</reference>

<reference anchor="IEEE.1003-1G.1997">
<front>
<title>Protocol Independent Interfaces</title>
<author>
<organization>IEEE</organization>
</author>
<date month="March" year="1997" />
</front>

<seriesInfo name="IEEE" value="Standard 1003.1G" />

</reference>

</references>

<section title="Acknowledgments" numbered="no">
<t>The authors wish to thank
Benoit Claise,
Spencer Dawkins,
Gorry Fairhurst,
Stephen Farrell,
Barry Leiba,
Karen Egede Nielsen,
Ka&nbhy;Cheong Poon,
Dan Romascanu,
Irene Ruengeler,
Jamal Hadi Salim,
Joseph Salowey,
Brian Trammell,
and Vlad Yasevich
for their invaluable comments.</t>
</section>

</back>
</rfc>
