<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY rfc2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!-- <!ENTITY rfc3095 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3095.xml"> -->
<!ENTITY rfc5052 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5052.xml">
<!-- <!ENTITY rfc3550 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3550.xml"> -->
<!-- <!ENTITY rfc5725 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5725.xml"> -->
<!-- <!ENTITY rfc4588 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4588.xml"> -->
<!ENTITY rfc2736 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2736.xml">
<!-- <!ENTITY rfc4566 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4566.xml"> -->
<!-- <!ENTITY rfc5226 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5226.xml"> -->
<!-- <!ENTITY rfc5234 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5234.xml"> -->
<!-- <!ENTITY rfc3711 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3711.xml"> -->
<!-- <!ENTITY rfc5740 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5740.xml"> -->
<!-- <!ENTITY rfc4303 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4303.xml"> -->
<!-- <!ENTITY rfc4383 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4383.xml"> -->
<!-- <!ENTITY rfc5775 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5775.xml"> -->
<!-- <!ENTITY rfc5424 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5424.xml"> -->
<!-- <!ENTITY rfc3411 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3411.xml"> -->
<!-- <!ENTITY rfc5675 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5675.xml"> -->
<!-- <!ENTITY rfc5676 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5676.xml"> -->
<!ENTITY rfc6363 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6363.xml">
<!ENTITY rfc6364 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6364.xml">
<!ENTITY rfc6681 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6681.xml">
<!-- <!ENTITY rfc6773 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6773.xml"> -->
<!ENTITY rfc6816 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6816.xml">
<!ENTITY rfc6865 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6865.xml">
<!ENTITY rfc8174 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8174.xml">
<!ENTITY rfc8406 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8406.xml">
]>

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

<!-- <rfc category="std" number="6363"
     ipr="pre5378Trust200902" submissionType="IETF" consensus="yes"> -->
<rfc category="std" docName="draft-ietf-tsvwg-fecframe-ext-08" ipr="trust200902" updates="6363">

  <front>
    <title abbrev="FEC Framework Extension">Forward Error Correction (FEC) Framework Extension to Sliding Window Codes</title>

    <author fullname="Vincent Roca" initials="V" surname="Roca">
      <organization>INRIA</organization>
      <address>
        <postal>
	  <!--
          <street>655, av. de l'Europe</street>
          <street>Inovallee; Montbonnot</street>
          <city>ST ISMIER cedex</city>
          <code>38334</code>
	  -->
          <street></street>
          <city>Univ. Grenoble Alpes</city>
          <country>France</country>
        </postal>
        <email>vincent.roca@inria.fr</email>
      </address>
    </author>

    <author fullname="Ali Begen" initials="A." surname="Begen">
      <organization>Networked Media</organization>
      <address>
        <postal>
          <street></street>
          <city>Konya</city>
          <region></region>
          <code></code>
          <country>Turkey</country>
        </postal>
        <email>ali.begen@networked.media</email>
      </address>
    </author>

    <!-- <date month="July" year="2017" /> -->
    <date/>

    <workgroup>TSVWG</workgroup>

    <abstract>
      <t>
RFC 6363 describes a framework for using Forward Error Correction (FEC)
codes to provide protection against packet loss. The framework
supports applying FEC to arbitrary packet flows over unreliable
transport and is primarily intended for real-time, or streaming, media.
However, FECFRAME as per RFC 6363 is restricted to block FEC codes.
This document updates RFC 6363 to support FEC Codes based on a
sliding encoding window, in addition to Block FEC Codes, in a
backward-compatible way.
During multicast/broadcast real-time content delivery, the use of
sliding window codes significantly improves robustness in harsh
environments, with less repair traffic and lower FEC-related added latency.
      </t>
    </abstract>
  </front>


  <middle>
    <section anchor="introduction" title="Introduction">
    <!-- ====================== -->

<t> Many applications need to transport a continuous stream
of packetized data from a source (sender) to one or more destinations
(receivers) over networks that do not provide guaranteed packet delivery.
In particular packets may be lost, which is strictly the focus of this
document: we assume that transmitted packets are either lost (e.g.,
because of a congested router, of a poor signal-to-noise ratio in a
wireless network, or because the number of bit errors exceeds the
correction capabilities of the physical-layer error correcting code) or received
by the transport protocol without any corruption (i.e., the bit-errors,
if any, have been fixed by the physical-layer error correcting code and therefore
are hidden to the upper layers).
</t>

<t>For these use-cases, Forward Error Correction (FEC) applied within
the transport or application layer is an efficient
technique to improve packet transmission robustness in presence of packet
losses (or "erasures"), without going through packet retransmissions that
create a delay often incompatible with real-time constraints.
The FEC Building Block defined in <xref target="RFC5052"/> provides a
framework for the definition of Content Delivery Protocols (CDPs) 
that make use of separately-defined FEC schemes. Any CDP
defined according to the requirements of the FEC Building Block can then
easily be used with any FEC Scheme that is also defined according to
the requirements of the FEC Building Block.
</t>

<t>
Then FECFRAME <xref target="RFC6363"/> provides a framework to define
Content Delivery Protocols (CDPs) that provide FEC protection for arbitrary
packet flows over an unreliable datagram service transport such as UDP.
It is primarily intended for real-time or streaming media applications,
using broadcast, multicast, or on-demand delivery.
</t>

<t>
However, <xref target="RFC6363"/> only considers block FEC schemes defined in
accordance with the FEC Building Block <xref target="RFC5052"/>
(e.g., <xref target="RFC6681"/>, <xref target="RFC6816"/> or <xref target="RFC6865"/>).
These codes require the input flow(s) to be segmented into a sequence of blocks.
Then FEC encoding (at a sender or an encoding middlebox) and decoding (at a receiver
or a decoding middlebox) are both performed on a per-block basis.
For instance, if the current block encompasses the 100's to 119's source symbols
(i.e., a block of size 20 symbols) of an input flow, encoding (and decoding) will
be performed on this block independently of other blocks.
This approach has major impacts on FEC encoding and decoding delays.
The data packets of continuous media flow(s) may be passed to the transport layer
immediately, without delay.
But the block creation time, that depends on the number of source symbols in
this block, impacts both the FEC encoding delay (since encoding requires that all
source symbols be known), and mechanically the packet loss recovery delay at a
receiver (since no repair symbol for the current block can be generated and
therefore received before that time).
Therefore a good value for the block size is necessarily a balance between the
maximum FEC decoding latency at the receivers (which must be in line with the most
stringent real-time requirement of the protected flow(s), hence an incentive to
reduce the block size), and the desired robustness against long loss bursts (which
increases with the block size, hence an incentive to increase this size). 
</t>

<t>
This document updates <xref target="RFC6363"/> in order to also support FEC codes
based on a sliding encoding window (A.K.A. convolutional codes) <xref target="RFC8406"/>.
This encoding window, either of fixed or variable size, slides over the set of
source symbols.
FEC encoding is launched whenever needed, from the set of source symbols present
in the sliding encoding window at that time.
This approach significantly reduces FEC-related latency, since repair symbols can
be generated and passed to the transport layer on-the-fly, at any time, and can be
regularly received by receivers to quickly recover packet losses.
Using sliding window FEC codes is therefore highly beneficial to real-time flows,
one of the primary targets of FECFRAME. 
<xref target="RLC-ID"/> provides an  example of such FEC Scheme for FECFRAME,
built upon the simple sliding window Random Linear Codes (RLC).
</t>

<t>
This document is fully backward compatible with <xref target="RFC6363"/>. Indeed:
<list style="symbols">
	<t> this FECFRAME update does not prevent nor compromise in any way the support
	of block FEC codes. Both types of codes can nicely co-exist, just like different
	block FEC schemes can co-exist;</t>

	<t> each sliding window FEC Scheme is associated to a specific FEC Encoding ID subject
	to IANA registration, just like block FEC Schemes;</t>

	<t> any receiver, for instance a legacy receiver that only supports block FEC schemes,
	can easily identify the FEC Scheme used in a FECFRAME session.
	Indeed, the FEC Encoding ID that identifies the FEC Scheme is carried in the
	FEC Framework Configuration Information (see section 5.5 of <xref target="RFC6363"/>).
	For instance, when the Session Description Protocol (SDP) is used to carry the
	FEC Framework Configuration Information, the FEC Encoding ID can be communicated
	in the "encoding-id=" parameter of a "fec-repair-flow" attribute <xref target="RFC6364"/>.
	This mechanism is the basic approach for a FECFRAME receiver to determine
	whether or not it supports the FEC Scheme used in a given FECFRAME session; </t>

</list>
This document leverages on <xref target="RFC6363"></xref> and re-uses its structure.
It proposes new sections specific to sliding window FEC codes whenever required.
The only exception is <xref target="ArchitectureOverview"/> that provides a quick
summary of FECFRAME in order to facilitate the understanding of this document to readers
not familiar with the concepts and terminology.
</t>

    </section>

    <section anchor="definitionsAndAbbreviations" title="Definitions and Abbreviations">
    <!-- ====================== -->

<t>The following list of definitions and abbreviations is copied from <xref target="RFC6363"/>,
adding only the Block/sliding window FEC Code and Encoding/Decoding Window definitions (tagged
with "ADDED"):
<list hangIndent="4" style="hanging">

<t hangText="Application Data Unit (ADU):"> The unit of source data provided as
payload to the transport layer. 
For instance, it can be a payload containing the result of the RTP packetization of a compressed video frame.
</t>

      <t hangText="ADU Flow:"> A sequence of ADUs associated with a transport-layer flow
      identifier (such as the standard 5-tuple {source IP address, source
      port, destination IP address, destination port, transport
      protocol}).</t>

      <t hangText="AL-FEC:"> Application-layer Forward Error Correction.</t>

      <t hangText="Application Protocol:"> Control protocol used to establish and control
      the source flow being protected, e.g., the Real-Time Streaming Protocol
      (RTSP).</t>

      <t hangText="Content Delivery Protocol (CDP):"> A complete application protocol
      specification that, through the use of the framework defined in this
      document, is able to make use of FEC schemes to provide FEC
      capabilities.</t>

      <t hangText="FEC Code:"> An algorithm for encoding data such that the encoded data
      flow is resilient to data loss. Note that, in general, FEC codes may also
      be used to make a data flow resilient to corruption, but that is not
      considered in this document.</t>

<t hangText="Block FEC Code: (ADDED)"> An FEC Code that operates on blocks, i.e., for
which the input flow MUST be segmented into a sequence of blocks,
FEC encoding and decoding being performed independently on a
per-block basis.</t>

<t hangText="Sliding Window FEC Code: (ADDED)"> An FEC Code that can generate repair symbols
on-the-fly, at any time, from the set of source symbols present in the sliding
encoding window at that time.
These codes are also known as convolutional codes.</t>

      <t hangText="FEC Framework:"> A protocol framework for the definition of Content
      Delivery Protocols using FEC, such as the framework defined in this
      document.</t>

      <t hangText="FEC Framework Configuration Information:"> Information that controls
      the operation of the FEC Framework.</t>

<t hangText="FEC Payload ID:"> Information that identifies the contents and provides positional information of a packet
with respect to the FEC Scheme.</t>

      <t hangText="FEC Repair Packet:"> At a sender (respectively, at a receiver), a
      payload submitted to (respectively, received from) the transport
      protocol containing one or more repair symbols along with a Repair FEC
      Payload ID and possibly an RTP header.</t>

      <t hangText="FEC Scheme:"> A specification that defines the additional protocol
      aspects required to use a particular FEC code with the FEC
      Framework.</t>

      <t hangText="FEC Source Packet:"> At a sender (respectively, at a receiver), a
      payload submitted to (respectively, received from) the transport
      protocol containing an ADU along with an optional Explicit Source FEC
      Payload ID.</t>

<!--
      <t hangText="Protection Amount:"> The relative increase in data sent due to the use
      of FEC.</t>
-->

      <t hangText="Repair Flow:"> The packet flow carrying FEC data.</t>

      <t hangText="Repair FEC Payload ID:"> A FEC Payload ID specifically for use with
      repair packets.</t>

      <t hangText="Source Flow:"> The packet flow to which FEC protection is to be
      applied. A source flow consists of ADUs.</t>

      <t hangText="Source FEC Payload ID:"> A FEC Payload ID specifically for use with
      source packets.</t>

      <t hangText="Source Protocol:"> A protocol used for the source flow being protected,
      e.g., RTP.</t>

      <t hangText="Transport Protocol:"> The protocol used for the transport of the source and
      repair flows, using an unreliable datagram service such as UDP.
      <!--  and the Datagram Congestion Control Protocol (DCCP) (either DCCP-STD or DCCP-UDP <xref target="RFC6773"/>).-->
      </t>

<t hangText="Encoding Window: (ADDED)"> Set of Source Symbols available at the sender/coding node
      that are used to generate a repair symbol, with a Sliding Window FEC Code.</t>

<t hangText="Decoding Window: (ADDED)"> Set of received or decoded source and repair symbols available
      at a receiver that are used to decode erased source symbols, with a Sliding Window FEC Code.</t>

      <t hangText="Code Rate:"> The ratio between the number of source symbols and the
      number of encoding symbols. By definition, the code rate is such that 0
      &lt; code rate &lt;= 1. A code rate close to 1 indicates that a small
      number of repair symbols have been produced during the encoding
      process.</t>

      <t hangText="Encoding Symbol:"> Unit of data generated by the encoding process. With
      systematic codes, source symbols are part of the encoding symbols.</t>

      <t hangText="Packet Erasure Channel:"> A communication path where packets are either
      lost (e.g., in our case, by a congested router, or because the number of
      transmission errors exceeds the correction capabilities of the
      physical-layer code) or received. When a packet is received, it is
      assumed that this packet is not corrupted (i.e., in our case, the bit-errors,
      if any, are fixed by the physical-layer code and therefore hidden to
      the upper layers). </t>

      <t hangText="Repair Symbol:"> Encoding symbol that is not a source symbol.</t>

      <t hangText="Source Block:"> Group of ADUs that are to be FEC protected as a single
      block.
This notion is restricted to Block FEC Codes.</t>

      <t hangText="Source Symbol:"> Unit of data used during the encoding process.</t>

      <t hangText="Systematic Code:"> FEC code in which the source symbols are part of the
      encoding symbols.</t>
      </list></t>

<t>
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 <xref target="RFC2119"/> <xref target="RFC8174"/>
when, and only when, they appear in all capitals, as shown here.
</t>


    </section>

    <section anchor="ArchitectureOverview" title="Summary of Architecture Overview">
    <!-- ====================== -->

<t>
The architecture of <xref target="RFC6363"/>, Section 3, equally applies to this
FECFRAME extension and is not repeated here.
However, we provide hereafter a quick summary to facilitate the understanding of this
document to readers not familiar with the concepts and terminology.
</t>

	<figure anchor="fig_archi" title="FECFRAME architecture at a sender.">
	<artwork><![CDATA[
+----------------------+
|     Application      |
+----------------------+
           |
           | (1) Application Data Units (ADUs)
           |
           v
+----------------------+                           +----------------+
|    FEC Framework     |                           |                |
|                      |-------------------------->|   FEC Scheme   |
|(2) Construct source  |(3) Source Block           |                |
|    blocks            |                           |(4) FEC Encoding|
|(6) Construct FEC     |<--------------------------|                |
|    Source and Repair |                           |                |
|    Packets           |(5) Explicit Source FEC    |                |
+----------------------+    Payload IDs            +----------------+
           |                Repair FEC Payload IDs
           |                Repair symbols
           |
           |(7) FEC Source and Repair Packets
           v
+----------------------+
|  Transport Protocol  |
+----------------------+
]]></artwork>
	</figure>

<t>
The FECFRAME architecture is illustrated in <xref target="fig_archi"/> from the sender's
point of view, in case of a block FEC Scheme.
It shows an application generating an ADU flow (other flows, from other applications, may co-exist).
These ADUs, of variable size, must be somehow mapped to source symbols of fixed size (this fixed size
is a requirement of all FEC Schemes that comes from the way mathematical operations are applied to symbols content).
This is the goal of an ADU-to-symbols mapping process that is FEC-Scheme specific (see below).
Once the source block is built, taking into account both the FEC Scheme constraints (e.g., in terms
of maximum source block size) and the application's flow constraints (e.g., in terms of real-time constraints),
the associated source symbols are handed to the FEC Scheme in order to produce an appropriate number
of repair symbols.
FEC Source Packets (containing ADUs) and FEC Repair Packets (containing one or more repair symbols each)
are then generated and sent using an appropriate transport protocol (more precisely <xref target="RFC6363"/>, Section 7, requires a
transport protocol providing an unreliable datagram service, such as UDP<!-- or DCCP-->).
In practice FEC Source Packets may be passed to the transport layer as soon as available, without having to wait for
FEC encoding to take place.
In that case a copy of the associated source symbols needs to be kept within FECFRAME for future
FEC encoding purposes.
</t>

<t>
At a receiver (not shown), FECFRAME processing operates in a similar way, taking as input the incoming
FEC Source and Repair Packets received.
In case of FEC Source Packet losses, the FEC decoding of the associated block may recover all (in case
of successful decoding) or a subset potentially empty (otherwise) of the missing source symbols.
After source-symbol-to-ADU mapping, when lost ADUs are recovered, they are then assigned to their
respective flow (see below).
ADUs are returned to the application(s), either in their initial transmission order (in that case ADUs
received after an erased one will be delayed until FEC decoding has taken place) or not (in that case
each ADU is returned as soon as it is received or recovered), depending on the application requirements.
</t>

<t>
FECFRAME features two subtle mechanisms:
<list style="symbols">
	<t> ADUs-to-source-symbols mapping:
		in order to manage variable size ADUs, FECFRAME and FEC Schemes can use small, fixed size
		symbols and create a mapping between ADUs and symbols.
		To each ADU this mechanism prepends a length field (plus a flow identifier, see below) and
		pads the result to a multiple of the symbol size.
		A small ADU may be mapped to a single source symbol while a large one may be mapped to
		multiple symbols.
		The mapping details are FEC-Scheme-dependent and must be defined in the associated document;
		</t>
	<t> Assignment of decoded ADUs to flows in multi-flow configurations:
		when multiple flows are multiplexed over the same FECFRAME instance, a problem is to assign
		a decoded ADU to the right flow (UDP port numbers and IP addresses traditionally used to map 
		incoming ADUs to flows are not recovered during FEC decoding).
		To make it possible, at the FECFRAME sending instance, each ADU is prepended with a flow
		identifier (1 byte) during the ADU-to-source-symbols mapping (see above).
		The flow identifiers are also shared between all FECFRAME instances as part of the FEC Framework
		Configuration Information.
		This (flow identifier + length + application payload + padding), called ADUI, is then FEC protected.
		Therefore a decoded ADUI contains enough information to assign the ADU to the right flow.
		</t>
</list>
</t>

<t>
A few aspects are not covered by FECFRAME, namely:
<list style="symbols">
	<t> <xref target="RFC6363"/> section 8 does not detail any congestion control mechanism,
		but only provides high level normative requirements; </t>
	<t> the possibility of having feedbacks from receiver(s) is considered out of scope, although
		such a mechanism may exist within the application (e.g., through RTCP control messages); </t>
	<t> flow adaptation at a FECFRAME sender (e.g., how to set the FEC code rate based on transmission
		conditions) is not detailed, but it needs to comply with the congestion control normative
		requirements (see above). </t>
</list>
</t>
    </section>

    <section title="Procedural Overview">
    <!-- ====================== -->
      <section anchor="generalProceduralOverview" title="General">
      <!-- ====================== -->

<t>
The general considerations of <xref target="RFC6363"/>, Section 4.1, that
are specific to block FEC codes are not repeated here.
</t>

<t>
With a Sliding Window FEC Code, the FEC Source Packet MUST
contain information to identify the position occupied by
the ADU within the source flow, in terms specific to the
FEC Scheme.
This information is known as the Source FEC Payload ID, and
the FEC Scheme is responsible for defining and interpreting it.
<!--
	This information MAY be
        encoded into a specific field within the FEC source packet format
        defined in this specification, called the Explicit Source FEC Payload
        ID field. The exact contents and format of the Explicit Source FEC
        Payload ID field are defined by the FEC schemes. Alternatively, the
        FEC Scheme MAY define how the Source FEC Payload ID is derived from
        other fields within the source packets.
-->
</t>

<t>
With a Sliding Window FEC Code, the FEC Repair
Packets MUST contain information that identifies the relationship
between the contained repair payloads and the original source symbols
used during encoding.
This information is known as the Repair FEC Payload ID, and
the FEC Scheme is responsible for defining and interpreting it.
</t>

<t>
The Sender Operation (<xref target="RFC6363"/>, Section 4.2.)
and Receiver Operation (<xref target="RFC6363"/>, Section 4.3) are
both specific to block FEC codes and therefore omitted below.
The following two sections detail similar operations for Sliding Window
FEC codes.
</t>

      </section>


<section anchor="senderoperation-convolutional" title="Sender Operation with Sliding Window FEC Codes">
<!-- ====================== -->

<t>
With a Sliding Window FEC Scheme, the following operations, illustrated in
Figure <xref target="senderfigure-convolutional" format="counter"></xref>
for the generic case (non-RTP repair flows), and in
Figure <xref target="senderfigurertp-convolutional" format="counter"></xref>
for the case of RTP repair flows, describe a possible way to generate compliant source and repair flows:
<list style="numbers">
    <t>A new ADU is provided by the application.</t>

    <t>The FEC Framework communicates this ADU to the FEC Scheme.</t>

    <t>The sliding encoding window is updated by the  FEC Scheme.
    The ADU-to-source-symbols mapping as well as the encoding window management details
    are both the responsibility of the FEC Scheme and MUST be detailed there.
    <xref target="codingwindow-possibleManagement"></xref> provides non-normative hints about what
	FEC Scheme designers need to consider;</t>

    <t>The Source FEC Payload ID information of the source packet is
    determined by the FEC Scheme. If required by the FEC Scheme, the
    Source FEC Payload ID is encoded into the Explicit Source FEC
    Payload ID field and returned to the FEC Framework.</t> 

    <t>The FEC Framework constructs the FEC Source Packet according to
<!-- REMOVED: <xref target="sourcepackets"></xref>, -->
<xref target="RFC6363"></xref> Figure 6,
    using the Explicit Source FEC Payload ID
    provided by the FEC Scheme if applicable.</t>

    <t>The FEC Source Packet is sent using normal transport-layer procedures.
    This packet is sent using
    the same ADU flow identification information as would have been
    used for the original source packet if the FEC Framework were not
    present (e.g., the source and destination addresses and UDP port numbers on the IP datagram carrying the
    source packet will be the same whether or not the FEC Framework is applied).</t>

    <t>When the FEC Framework needs to send one or several FEC Repair Packets (e.g., according
    to the target Code Rate), it asks the FEC Scheme to create one
    or several repair packet payloads from the current sliding encoding window
    along with their Repair FEC Payload ID.</t>

    <t>The Repair FEC Payload IDs and repair packet payloads are provided back by the
    FEC Scheme to the FEC Framework.</t>

    <t>The FEC Framework constructs FEC Repair Packets
    according to <xref target="RFC6363"></xref> Figure 7, <!-- REMOVED: <xref target="repairpackets"></xref>, -->
    using the FEC Payload IDs and repair packet payloads provided by the FEC Scheme.</t>

    <t>The FEC Repair Packets are sent using normal transport-layer procedures.
    The port(s) and multicast group(s) to be used for FEC Repair Packets are defined
    in the FEC Framework Configuration Information.</t>
  </list></t>


        <figure align="center" anchor="senderfigure-convolutional" title="Sender Operation with Sliding Window FEC Codes">
          <artwork><![CDATA[
+----------------------+
|     Application      |
+----------------------+
           |
           | (1) New Application Data Unit (ADU)
           v 
+---------------------+                           +----------------+
|    FEC Framework    |                           |   FEC Scheme   |
|                     |-------------------------->|                |
|                     | (2) New ADU               |(3) Update of   |
|                     |                           |    encoding    |
|                     |<--------------------------|    window      |
|(5) Construct FEC    | (4) Explicit Source       |                |
|    Source Packet    |     FEC Payload ID(s)     |(7) FEC         |
|                     |<--------------------------|    encoding    |
|(9) Construct FEC    | (8) Repair FEC Payload ID |                |
|    Repair Packet(s) |     + Repair symbol(s)    +----------------+
+---------------------+ 
           | 
           | (6)  FEC Source Packet 
           | (10) FEC Repair Packets
           v 
+----------------------+ 
|  Transport Protocol  |
+----------------------+ 
]]></artwork>
        </figure>


        <figure align="center" anchor="senderfigurertp-convolutional" title="Sender Operation with Sliding Window FEC Codes and RTP Repair Flows">
          <artwork><![CDATA[
+----------------------+
|     Application      |
+----------------------+
           |
           | (1) New Application Data Unit (ADU)
           v 
+---------------------+                           +----------------+
|    FEC Framework    |                           |   FEC Scheme   |
|                     |-------------------------->|                |
|                     | (2) New ADU               |(3) Update of   |
|                     |                           |    encoding    |
|                     |<--------------------------|    window      |
|(5) Construct FEC    | (4) Explicit Source       |                |
|    Source Packet    |     FEC Payload ID(s)     |(7) FEC         |
|                     |<--------------------------|    encoding    |
|(9) Construct FEC    | (8) Repair FEC Payload ID |                |
|    Repair Packet(s) |     + Repair symbol(s)    +----------------+
+---------------------+
    |             |
    |(6) Source   |(10) Repair payloads
    |    packets  |
    |      + -- -- -- -- -+
    |      |     RTP      |
    |      +-- -- -- -- --+
    v             v                 
+----------------------+ 
|  Transport Protocol  |
+----------------------+ 
]]></artwork>
        </figure>

</section>

<section anchor="receiveroperation-convolutional" title="Receiver Operation with Sliding Window FEC Codes">
<!-- ====================== -->

<t>
With a Sliding Window FEC Scheme, the following operations, illustrated in
Figure <xref target="receiverfigure" format="counter"/> 
for the generic case (non-RTP repair flows), and in
Figure <xref target="receiverfigurertp" format="counter"></xref>
for the case of RTP repair flows.
The only differences with respect to block FEC codes lie in steps (4) and (5).
Therefore this section does not repeat the other steps of
<xref target="RFC6363"/>, Section 4.3, "Receiver Operation".
The new steps (4) and (5) are:
<!-- <list style="empty"> -->
<list hangIndent="4" style="hanging">
	<t hangText="4."> The FEC Scheme uses the received FEC Payload IDs (and derived
	FEC Source Payload IDs when the Explicit Source FEC Payload ID field is not used)
	to insert source and repair packets into the decoding window in the right way.
	If at least one source packet is missing and at least one repair packet
        has been received, then FEC decoding is attempted to recover missing source payloads.
	The FEC Scheme determines whether source packets have been lost and whether
	enough repair packets have been received to decode any or all of the missing
	source payloads.</t>

	<t hangText="5."> The FEC Scheme returns the received and decoded ADUs to the
	FEC Framework, along with indications of any ADUs that were missing and could
	not be decoded.</t>
</list>
</t>

        <figure align="center" anchor="receiverfigure"
                title="Receiver Operation with Sliding Window FEC Codes">
          <preamble></preamble>

          <artwork><![CDATA[
+----------------------+
|     Application      |
+----------------------+
           ^
           |(6) ADUs
           |
+----------------------+                           +----------------+
|    FEC Framework     |                           |   FEC Scheme   |
|                      |<--------------------------|                |
|(2)Extract FEC Payload|(5) ADUs                   |(4) FEC Decoding
|   IDs and pass IDs & |-------------------------->|                |
|   payloads to FEC    |(3) Explicit Source FEC    +----------------+
|   scheme             |            Payload IDs
+----------------------+    Repair FEC Payload IDs
           ^                Source payloads       
           |                Repair payloads
           |(1) FEC Source
           |    and Repair Packets
+----------------------+ 
|  Transport Protocol  |
+----------------------+
]]></artwork>
        </figure>


        <figure align="center" anchor="receiverfigurertp"
                title="Receiver Operation with Sliding Window FEC Codes and RTP Repair Flows">
          <preamble></preamble>

          <artwork><![CDATA[
+----------------------+
|     Application      |
+----------------------+
           ^
           |(6) ADUs
           |
+----------------------+                           +----------------+
|    FEC Framework     |                           |   FEC Scheme   |
|                      |<--------------------------|                |
|(2)Extract FEC Payload|(5) ADUs                   |(4) FEC Decoding|
|   IDs and pass IDs & |-------------------------->|                |
|   payloads to FEC    |(3) Explicit Source FEC    +----------------+
|   scheme             |            Payload IDs
+----------------------+    Repair FEC Payload IDs
    ^             ^         Source payloads
    |             |         Repair payloads
    |Source pkts  |Repair payloads
    |             |
+-- |- -- -- -- -- -- -+
|RTP| | RTP Processing | 
|   | +-- -- -- --|-- -+
| +-- -- -- -- -- |--+ |
| | RTP Demux        | |
+-- -- -- -- -- -- -- -+ 
           ^
           |(1) FEC Source and Repair Packets
           |         
+----------------------+ 
|  Transport Protocol  |
+----------------------+
]]></artwork>
        </figure>


</section>

    </section>

    <section title="Protocol Specification">
    <!-- ====================== -->
      <section anchor="generalProtocolSpecification" title="General">
      <!-- ====================== -->

<t>
This section discusses the protocol elements for the FEC Framework specific to Sliding Window FEC schemes.
The global formats of source data packets (i.e., <xref target="RFC6363"/>, Figure 6) and repair data packets (i.e., <xref target="RFC6363"/>, Figures 7 and 8) remain the same with Sliding Window FEC codes.
They are not repeated here.
</t>

      </section>

      <section anchor="config" title="FEC Framework Configuration Information">
      <!-- ====================== -->

<t>
The FEC Framework Configuration Information considerations of <xref target="RFC6363"/>, Section 5.5, equally applies to this
FECFRAME extension and is not repeated here.
</t>

      </section>

      <section anchor="fecscheme" title="FEC Scheme Requirements">
      <!-- ====================== -->

<t>
The FEC Scheme requirements of <xref target="RFC6363"/>, Section 5.6, mostly apply to this
FECFRAME extension and are not repeated here.
An exception though is the "full specification of the FEC code", item (4), that is specific to block FEC codes.
The following item (4-bis) applies in case of Sliding Window FEC schemes:
<list hangIndent="4" style="hanging">
	<t hangText="4-bis. A full specification of the Sliding Window FEC code"><vspace blankLines="1" />
	This specification MUST precisely define the
	valid FEC-Scheme-Specific Information values, the valid FEC
	Payload ID values, and the valid packet payload sizes (where packet
	payload refers to the space within a packet dedicated to carrying
	encoding symbols).
	<vspace blankLines="1" />
	Furthermore, given valid values of the FEC-Scheme-Specific Information, a valid
	Repair FEC Payload ID value, a valid packet payload size, and
	a valid encoding window (i.e., a set of source symbols), 
	the specification MUST uniquely define the values of the encoding
	symbol (or symbols) to be included in the repair packet payload with the given Repair FEC Payload ID value.
	<!--
	<vspace blankLines="1" />
	A common and simple way to specify the FEC code
	to the required level of detail is to provide a precise
	specification of an encoding algorithm that - given
	valid values of the FEC-Scheme-Specific Information, a
	valid Repair FEC Payload ID value, a valid packet payload size,
	and in case of a Block FEC Code a source block
	as input - produces the exact value of the encoding symbols as
	output.
	-->
	</t>
</list>
</t>

<t>
Additionally, the FEC Scheme associated to a Sliding Window FEC Code:
<list style="symbols">
	<t> MUST define the relationships between ADUs and the associated source symbols (mapping);</t>
	<t> MUST define the management of the encoding window that slides over the set of ADUs.
		<xref target="codingwindow-possibleManagement"/> provides non normative hints about what 
      		FEC Scheme designers need to consider;</t>
	<t> MUST define the management of the decoding window.
	This usually consists in managing a system of linear equations (in case of a linear FEC code);</t>
</list>
</t>

      </section>
    </section>

    <section title="Feedback">
    <!-- ====================== -->

<t>
The discussion of <xref target="RFC6363"/>, Section 6, equally applies to this
FECFRAME extension and is not repeated here.
</t>

    </section>

    <section anchor="TransportProtocols" title="Transport Protocols">
    <!-- ====================== -->

<t>
The discussion of <xref target="RFC6363"/>, Section 7, equally applies to this
FECFRAME extension and is not repeated here.
</t>

    </section>

    <section anchor="sec_congestion" title="Congestion Control">
    <!-- ====================== -->
<t>
The discussion of <xref target="RFC6363"/>, Section 8, equally applies to this
FECFRAME extension and is not repeated here.
</t>

    </section>

    <section anchor="implementationStatus" title="Implementation Status">
    <!-- ====================== -->
<t>
Editor's notes: RFC Editor, please remove this section motivated by RFC 7942 before publishing the RFC. Thanks!
</t>

<t>An implementation of FECFRAME extended to Sliding Window codes exists:
<list style="symbols">
	<t>Organisation: Inria</t>
	<t>Description: This is an implementation of FECFRAME extended to Sliding Window codes and supporting the RLC FEC Scheme <xref target="RLC-ID"/>.
	It is based on: (1) a proprietary implementation of FECFRAME, made by Inria and Expway for which interoperability tests have been conducted;
	and (2) a proprietary implementation of RLC Sliding Window FEC Codes.</t>
	<t>Maturity: the basic FECFRAME maturity is "production", the FECFRAME extension maturity is "under progress".</t>
	<t>Coverage: the software implements a subset of <xref target="RFC6363"/>, as specialized by the 3GPP eMBMS standard <xref target="MBMSTS"/>.
	This software also covers the additional features of FECFRAME extended to Sliding Window codes, in particular the RLC FEC Scheme.</t>
	<t>Licensing: proprietary.</t>
	<t>Implementation experience: maximum.</t>
	<t>Information update date: March 2018.</t>
	<t>Contact: vincent.roca@inria.fr</t>
</list>
</t>
    </section>

    <section title="Security Considerations">
    <!-- ====================== -->

<t>
This FECFRAME extension does not add any new security consideration.
All the considerations of <xref target="RFC6363"/>, Section 9, apply to this document as well.
However, for the sake of completeness, the following goal can be added to the list provided in Section 9.1 "Problem Statement" of <xref target="RFC6363"/>:
<list style="symbols">
	<t> Attacks can try to corrupt source flows in order to modify the receiver application's behavior
	(as opposed to just denying service).</t>
</list>
</t>

    </section>

    <section title="Operations and Management Considerations">
    <!-- ====================== -->
<t>
This FECFRAME extension does not add any new Operations and Management Consideration.
All the considerations of <xref target="RFC6363"/>, Section 10, apply to this document as well.
</t>

    </section>

    <section anchor="iana" title="IANA Considerations">
    <!-- ====================== -->

<t>
No IANA actions are required for this document.
</t>

<t>A FEC Scheme for use with this FEC Framework is identified via its FEC Encoding ID.
It is subject to IANA registration in the "FEC Framework (FECFRAME) FEC Encoding IDs" registry.
All the rules of <xref target="RFC6363"/>, Section 11, apply and are not repeated here.
</t>

    </section>

    <section title="Acknowledgments">
    <!-- ====================== -->

<t>
The authors would like to thank Christer Holmberg, David Black, Gorry Fairhurst, and Emmanuel Lochin, Spencer Dawkins, Ben Campbell, Benjamin Kaduk, Eric Rescorla, Adam Roach, and Greg Skinner for their valuable feedback on this document.
This document being an extension to <xref target="RFC6363"/>, the authors would also like to thank Mark Watson as the main author of that RFC.</t>

    </section>
  </middle>

  <back>
    <references title="Normative References">

      &rfc2119;
      &rfc8174;
      &rfc6363;

    </references>

    <references title="Informative References">

      &rfc5052;
      &rfc6364;
      &rfc6681;
      <!-- &rfc6773; -->
      &rfc6816;
      &rfc6865;
      &rfc8406;

      <reference anchor="MBMSTS" target="http://ftp.3gpp.org/specs/html-info/26346.htm">
        <front>
          <title>Multimedia Broadcast/Multicast Service (MBMS); Protocols and codecs</title>
          <author>
            <organization>3GPP</organization>
          </author>
          <date month="March" year="2009" />
        </front>
        <seriesInfo name="3GPP TS" value="26.346" />
      </reference>

      <reference anchor="RLC-ID" target="https://tools.ietf.org/html/draft-ietf-tsvwg-rlc-fec-scheme">
        <front>
          <title>Sliding Window Random Linear Code (RLC) Forward Erasure Correction (FEC) Scheme for FECFRAME</title>
          <author initials="V" surname="Roca" fullname="Vincent Roca"> <organization /> </author>
          <author initials="B" surname="Teibi" fullname="Belkacem Teibi"> <organization /> </author>
          <date month="September" year="2018" />
        </front>
        <seriesInfo name='Work in' value='Progress' />
        <seriesInfo name='Transport Area Working Group (TSVWG)' value='draft-ietf-tsvwg-rlc-fec-scheme (Work in Progress)' />
      </reference>

    </references>


<section anchor="codingwindow-possibleManagement" title="About Sliding Encoding Window Management (informational)">
<!-- ====================== -->

<t>
The FEC Framework does not specify the management of the sliding encoding window which is the responsibility of the FEC Scheme.
This annex only provides a few informational hints.
</t>

<t>
Source symbols are added to the sliding encoding window each time a new ADU is available at the sender, after the ADU-to-source-symbol mapping specific to the FEC Scheme.
</t>

<t>
Source symbols are removed from the sliding encoding window, for instance:
	<list style="symbols">
	<t> after a certain delay, when an "old" ADU of a real-time flow times out.
		The source symbol retention delay in the sliding encoding window should therefore be initialized according to the real-time features of incoming flow(s) when applicable; </t>
	<t> once the sliding encoding window has reached its maximum size (there is usually an upper limit to the sliding encoding window size).
		In that case the oldest symbol is removed each time a new source symbol is added. </t>
	</list>
</t>

<t>
Several considerations can impact the management of this sliding encoding window:
<list style="symbols">
	<t> at the source flows level: real-time constraints can limit the total time source symbols can remain in the encoding window; </t>
	<t> at the FEC code level: theoretical or practical limitations (e.g., because of computational complexity) can limit the number of source symbols in the encoding window; </t>
	<t> at the FEC Scheme level: signaling and window management are intrinsically related.
		For instance, an encoding window composed of a non-sequential set of source symbols requires an appropriate signaling to inform a receiver of the composition of the encoding window, and the associated transmission overhead can limit the maximum encoding window size.
		On the opposite, an encoding window always composed of a sequential set of source symbols simplifies signaling: providing the identity of the first source symbol plus their number is sufficient, which creates a fixed and relatively small transmission overhead.
	</t>
</list>
<!-- The most stringent limitation defines the maximum encoding window size, either in terms of number of source symbols or number of ADUs, whichever applies. -->
</t>
</section>

  </back>
</rfc>
