<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY rfc2119 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY rfc3031 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.3031.xml">
<!ENTITY rfc3032 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.3032.xml">
<!ENTITY rfc3985 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.3985.xml">
<!ENTITY rfc4090 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.4090.xml">
<!ENTITY rfc4385 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.4385.xml">
<!ENTITY rfc4446 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.4446.xml">
<!ENTITY rfc4447 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.4447.xml">
<!ENTITY rfc4448 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.4448.xml">
<!ENTITY rfc4553 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.4553.xml">
<!ENTITY rfc4664 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.4664.xml">
<!ENTITY rfc4817 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.4817.xml">
<!ENTITY rfc4872 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.4872.xml">
<!ENTITY rfc4873 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.4873.xml">
<!ENTITY rfc5036 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5036.xml">
<!ENTITY rfc5086 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5086.xml">
<!ENTITY rfc5087 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5087.xml">
<!ENTITY rfc5254 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5254.xml">
<!ENTITY rfc5129 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5129.xml">
<!ENTITY rfc5305 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5305.xml">
<!ENTITY rfc5331 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5331.xml">
<!ENTITY rfc5332 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5332.xml">
<!ENTITY rfc5440 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5440.xml">
<!ENTITY rfc5462 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5462.xml">
<!ENTITY rfc5586 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5586.xml">
<!ENTITY rfc5659 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5659.xml">
<!ENTITY rfc5085 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5085.xml">
<!ENTITY rfc5921 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5921.xml">
<!ENTITY rfc5960 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5960.xml">
<!ENTITY rfc6275 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6275.xml">
<!ENTITY rfc6371 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6371.xml">
<!ENTITY rfc6378 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6378.xml">
<!ENTITY rfc6387 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6387.xml">
<!ENTITY rfc6426 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6426.xml">
<!ENTITY rfc6437 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6437.xml">
<!ENTITY rfc6540 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6540.xml">
<!ENTITY rfc6564 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6564.xml">
<!ENTITY rfc6621 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6621.xml">
<!ENTITY rfc6658 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6658.xml">
<!ENTITY rfc6718 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6718.xml">
<!ENTITY rfc6733 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6733.xml">
<!ENTITY rfc6790 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6790.xml">
<!ENTITY rfc7271 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7271.xml">
<!ENTITY rfc7348 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7348.xml">
<!ENTITY rfc7426 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7426.xml">
<!ENTITY rfc7432 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7432.xml">
<!ENTITY rfc7510 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7510.xml">
<!ENTITY rfc8169 PUBLIC "" "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8169.xml">
<!ENTITY I-D.ietf-pce-pcep-extension-for-pce-controller PUBLIC "" "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-pce-pcep-extension-for-pce-controller.xml">
<!ENTITY I-D.ietf-spring-segment-routing-mpls PUBLIC "" "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-spring-segment-routing-mpls">
<!ENTITY I-D.ietf-detnet-problem-statement PUBLIC "" "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-detnet-problem-statement.xml">
<!ENTITY I-D.ietf-detnet-architecture PUBLIC "" "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-detnet-architecture.xml">
<!ENTITY I-D.ietf-detnet-flow-information-model PUBLIC "" "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-detnet-flow-information-model.xml">
<!ENTITY I-D.ietf-mpls-residence-time SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-mpls-residence-time">

]>
<!--
- From 2/25 call:
  o finish discussed split/removal of foo (IP and TSN) over MPLS (Lou) <done>
  After: All to
  o identify missing conformance language, notably WRT forwarding
    sub-layer
  o Aggregation section needs to be cleaned up
  o check conformance language in MPLS over TSN section

  Resolved in Mar 5
  - need for S-Labels to be from platform label space (Andy)
    Pattern after e-vpn where stack is provided by downstream receiver
  - Different S-Labels for same application flow (Balazs)
    clarify that service sub-layer nodes can change s-labels

-->
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<?rfc toc="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc iprnotified="no"?>
<?rfc strict="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<rfc category="std"
     docName="draft-ietf-detnet-dp-sol-mpls-02"
         ipr="trust200902"
         submissionType="IETF">
  <front>
    <title abbrev="DetNet MPLS Data Plane">
     DetNet MPLS Data Plane Encapsulation</title>

  <author role="editor" fullname="Jouni Korhonen" initials="J." surname="Korhonen">
   <!--organization abbrev="Nordic">Nordic Semiconductor</organization-->
   <address>
    <email>jouni.nospam@gmail.com</email>
   </address>
  </author>

  <author role="editor" fullname="Bal&aacute;zs Varga" initials="B." surname="Varga">
	<organization>Ericsson</organization>
	<address>
	 <postal>
	  <street>Magyar Tudosok krt. 11.</street>
	  <city>Budapest</city>
	  <country>Hungary</country>
	  <code>1117</code>
	 </postal>
	 <email>balazs.a.varga@ericsson.com</email>
	</address>
	</author>

  <!--author fullname="Donald Fauntleroy Duck" initials="D. F." surname="Duck">
   <organization abbrev="Royal Bros.">Royal Bros.</organization>
   <address>
    <postal>
     <street>13 Paradise Road</street>
     <city>Duckburg</city>
     <region>Calisota</region>
     <country>USA</country>
    </postal>
   </address>
  </author-->
  <date />
  <workgroup>DetNet</workgroup>

  <abstract>
   <t>
     This document specifies the Deterministic Networking data plane
     when operating over an MPLS Packet Switched Networks.
   </t>
  </abstract>
  </front>

 <middle>
 <section title="Introduction" anchor="sec_intro">
  <t>
    Deterministic Networking (DetNet) is a service that can be offered by a
    network to DetNet flows.  DetNet provides these flows with a low packet loss
    rates and assured maximum end-to-end delivery latency.  General background
    and concepts of DetNet can be found in <xref
    target="I-D.ietf-detnet-architecture"/>.
  </t>
  <t>
    The DetNet Architecture decomposes the DetNet related data plane
    functions into two sub-layers: a service sub-layer and a forwarding sub-layer.
    The service sub-layer is used to provide DetNet service protection and
    reordering. The forwarding sub-layer is used to provides congestion
    protection (low loss, assured latency, and limited reordering)
    leveraging MPLS Traffic Engineering mechanisms.
  </t>
  <t>
    This document specifies the DetNet data plane operation and the on-wire encapsulation
    of DetNet flows over an MPLS-based Packet Switched Network (PSN). The
    specified encapsulation provides the building blocks to enable the DetNet
    service and forwarding sub-layer functions and supports flow identification as described in the
    DetNet Architecture.

   As part of the service sub-layer functions, this document describes
   DetNet node data plane operation. It also describes the
   function and operation of the Packet Replication (PRF) Packet Elimination
   (PEF) and Packet Ordering (POF) functions with an MPLS data plane.

    It also describes an MPLS-based DetNet forwarding sub-layer that eliminates (or
    reduces) contention loss  and provides bounded latency for DetNet flows.
  </t>
  <t>
    MPLS encapsulated DetNet flows can be carried over
    network technologies that can provide the DetNet required level
    of service.  This document defines examples of such, specifically
    carrying DetNet MPLS flows over IEEE 802.1 TSN sub-networks, and
    over DetNet IP PSN.
  </t>
  <t>
    The intent is for this document to support different traffic types
    being mapped over DetNet MPLS, but this is out side the scope of this
    document. An example of such can be found in <xref
    target="I-D.ietf-detnet-dp-sol-ip"/>.  This document also allows
    for, but does not define, associated controller plane
    and Operations, Administration, and Maintenance (OAM) functions.
  </t>
 </section>

 <section title="Terminology">
  <section title="Terms Used in This Document">
  <t>
   This document uses the terminology established in the DetNet architecture
   <xref target="I-D.ietf-detnet-architecture"/>, and the reader is assumed
   to be familiar with that document and its terminology.
  </t>
  <t>
   The following terminology is introduced in this document:
   <list style="hanging" hangIndent="14">

    <t hangText="F-Label">A Detnet "forwarding" label that identifies the LSP used to
    forward a DetNet flow across an MPLS PSN, e.g., a hop-by-hop
    label used between label switching routers (LSR).</t>

    <t hangText="S-Label">A DetNet "service" label that is used between DetNet
    nodes that implement also the DetNet service sub-layer functions. An S-Label is
    also used to identify a DetNet flow at DetNet service sub-layer.</t>

    <t hangText="d-CW">
	  A DetNet Control Word (d-CW) is used for sequencing and identifying duplicate packets of a DetNet flow at the DetNet service
      sub-layer. </t>
    </list>
   </t>
  </section>

  <section title="Abbreviations">
  <t>
   The following abbreviations are used in this document:
   <list style="hanging" hangIndent="14">
    <t hangText="AC">Attachment Circuit.</t>
    <t hangText="CE">Customer Edge equipment.</t>
    <t hangText="CoS">Class of Service.</t>
    <t hangText="CW">Control Word.</t>
    <t hangText="DetNet">Deterministic Networking.</t>
    <t hangText="DF">DetNet Flow.</t>
    <t hangText="DN-IWF">DetNet Inter-Working Function.</t>
    <t hangText="L2">Layer 2.</t>
    <t hangText="L2VPN">Layer 2 Virtual Private Network.</t>
    <t hangText="L3">Layer 3.</t>
    <t hangText="LSR">Label Switching Router.</t>
    <t hangText="MPLS">Multiprotocol Label Switching.</t>
    <t hangText="MPLS-TE">Multiprotocol Label Switching - Traffic Engineering.</t>
    <t hangText="MPLS-TP">Multiprotocol Label Switching - Transport Profile.</t>
    <t hangText="MS-PW">Multi-Segment PseudoWire (MS-PW).</t>
    <t hangText="NSP">Native Service Processing.</t>
    <t hangText="OAM">Operations, Administration, and Maintenance.</t>
    <t hangText="PE">Provider Edge.</t>
    <t hangText="PEF">Packet Elimination Function.</t>
    <t hangText="PRF">Packet Replication Function.</t>
    <t hangText="PREOF">Packet Replication, Elimination and Ordering Functions.</t>
    <t hangText="POF">Packet Ordering Function.</t>
    <t hangText="PSN">Packet Switched Network.</t>
    <t hangText="PW">PseudoWire.</t>
    <t hangText="QoS">Quality of Service.</t>
    <t hangText="S-PE">Switching Provider Edge.</t>
    <t hangText="T-PE">Terminating Provider Edge.</t>
    <t hangText="TSN">Time-Sensitive Network.</t>
   </list>
  </t>
  </section>
 </section>  <!-- end of terminology -->

 <section title="Requirements Language">
  <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 title="DetNet MPLS Data Plane Overview" anchor="sec_dt_dp">
  <section title="Layers of DetNet Data Plane" anchor="sec_lay_dt_dp">
  <t>
    This document describes how DetNet flows are carried over MPLS
    networks. The DetNet Architecture, <xref
    target="I-D.ietf-detnet-architecture"/>, decomposes the DetNet data
    plane into two sub-layers: a service sub-layer and a forwarding sub-layer.  The
    basic approach defined in this document supports the DetNet service
    sub-layer based on existing pseudowire (PW) encapsulations and
    mechanisms, and supports the DetNet forwarding sub-layer based on
    existing MPLS Traffic Engineering encapsulations and mechanisms.
    Background on PWs can be found in <xref target="RFC3985"/> and <xref
    target="RFC3031"/>. Background on MPLS Traffic Engineering can be
    found in <xref target="RFC3272"/> and <xref target="RFC3209"/>.
  </t>
  <figure anchor="dn_mpls_dp_approach" align="center"
          title="DetNet Adaptation to MPLS Data Plane">
    <artwork align="center"><![CDATA[
  DetNet        MPLS
    .
    .
+------------+
|  Service   | d-CW, S-Label
+------------+
| Forwarding | F-Label(s)
+------------+
    .
    .
]]></artwork>
</figure>

  <t>
    The DetNet MPLS data plane approach defined in this document is
    shown in <xref target="dn_mpls_dp_approach"/>.  The service sub-layer is
    supported by a DetNet control word (d-CW) which conforms to the
    Generic PW MPLS Control Word (PWMCW) defined in <xref
    target="RFC4385"/>.  A d-CW identifying service label (S-Label) is
    also used.
  </t>

 <t>
  A node operating on a DetNet flow in the Detnet service sub-layer, i.e. a node processing a
  DetNet packet which has the S-Label as top of stack uses the local context
  associated with that S-Label, for example a received F-Label, to
  determine what local DetNet operation(s) are
  applied to that packet. An S-Label may be unique when taken from the platform
  label space <xref target="RFC3031"/>, which would enable correct DetNet flow
  identification regardless of which input interface or LSP the packet arrives on.
 </t>

  <t>
    The DetNet MPLS data plane builds on MPLS Traffic Engineering
    encapsulations and mechanisms to provide a forwarding sub-layer that
    is responsible for providing resource allocation and explicit
    routes.  The forwarding sub-layer is supported by one or more
    forwarding labels (F-Labels).
  </t>

  </section>

  <section title="DetNet MPLS Data Plane Scenarios"
           anchor="sec_mpls_dt_dp_scen">


      <figure align="center" anchor="fig_dn_mpls_detnet"
              title="A DetNet MPLS Network">
        <artwork><![CDATA[
DetNet MPLS       Relay       Transit         Relay       DetNet MPLS
End System        Node         Node           Node        End System
   (T-PE)        (S-PE)       (LSR)          (S-PE)         (T-PE)
+----------+                                             +----------+
|   Appl.  |<------------ End to End Service ----------->|   Appl.  |
+----------+   +---------+                 +---------+   +----------+
| Service  |<--| Service |-- DetNet flow --| Service |-->| Service  |
+----------+   +---------+  +----------+   +---------+   +----------+
|Forwarding|   |Fwd| |Fwd|  |Forwarding|   |Fwd| |Fwd|   |Forwarding|
+-------.--+   +-.-+ +-.-+  +----.---.-+   +-.-+ +-.-+   +---.------+
        :  Link  :    /  ,-----.  \   : Link :    /  ,-----.  \
        +........+    +-[  Sub  ]-+   +......+    +-[  Sub  ]-+
                        [Network]                   [Network]
                         `-----'                     `-----'
        |<- LSP -->| |<-------- LSP -----------| |<--- LSP -->|

        |<----------------- DetNet MPLS --------------------->|

        ]]></artwork>
      </figure>
      <t>
        <xref target="fig_dn_mpls_detnet"/> illustrates a hypothetical
        DetNet MPLS-only network composed of DetNet aware MPLS enabled
        end systems, operating over a DetNet aware MPLS network. In this
        figure, relay nodes sit at MPLS LSP boundaries and transit nodes
        are LSRs.
      </t>
      <t>
        DetNet end system and relay nodes are DetNet service sub-layer
        aware, understand the particular needs of DetNet flows and
        provide both DetNet service and forwarding sub-layer functions.
        They add, remove and process d-CWs, S-Labels and F-labels as
        needed.  MPLS enabled end system and relay nodes can enhance the
        reliability of delivery by enabling the replication of packets
        where multiple copies, possibly over multiple paths, are
        forwarded through the DetNet domain.  They can also eliminate
        surplus previously replicated copies of DetNet packets.
        DetNet MPLS nodes provide functionality similar to T-PEs when they
        sit at the edge of an MPLS domain, and functionality similar to
        S-PEs when they are in the middle of an MPLS domain, see <xref
        target="RFC6073"/>.  End system and relay nodes also include
        DetNet forwarding sub-layer functions, support for notably
        explicit routes, and resources allocation to eliminate (or
        reduce) congestion loss and jitter.
      </t>
      <t>
        DetNet transit nodes reside wholly within a DetNet domain, and
        also provide DetNet forwarding sub-layer functions in accordance
        with the performance required by a DetNet flow carried over an
        LSP. Unlike other DetNet node types, transit nodes provide no
        service sub-layer processing.  In a DetNet MPLS network, transit
        nodes may be DetNet service aware or may be DetNet unaware
        MPLS Label Switching Routers (LSRs).  In this latter case, such
        LSRs would be unaware of the special requirements of the DetNet
        service sub-layer, but would still provide traffic engineering
        services and the QoS need to ensure that the (TE) LSPs meet the
        service requirements of the carried DetNet flows.
      </t>

      <t>
        The LSPs may be provided by any MPLS controller method. For
        example they may be provisioned via a management plane, RSVP-TE,
        MPLS-TP, or MPLS Segment Routing (when extended to support
        resource allocation).
      </t>

      <t>
        <xref target="fig_pw_detnet"/> illustrates how an end to end
        MPLS-based DetNet service is provided in a more detail.  In this
        figure, the end systems, CE1 and CE2, are able to send and
        receive MPLS encapsulated DetNet flows, and R1, R2 and R3 are
        relay nodes as they sit in the middle of a DetNet network. The
        'X' in the end systems, and relay nodes represents potential
        DetNet compound flow packet replication and elimination points.
        In this example, service protection is supported over four
        DetNet member flows and TE LSPs. For a unidirectional flow, R1
        supports PRF, R2 supports PREOF and R3 supports PEF and POF.
        Note that the relay nodes may change the underlying forwarding
        sub-layer, for example tunneling MPLS over IEEE 802.1 TSN <xref
        target="mpls-over-tsn"/>, or simply over interconnect network
        links.
      </t>
      <figure align="center" anchor="fig_pw_detnet"
              title="MPLS-Based Native DetNet">
        <artwork><![CDATA[
      DetNet                                           DetNet
MPLS  Service          Transit          Transit       Service MPLS
DetNet  |             |<-Tnl->|        |<-Tnl->|            | DetNet
End     |             V   1   V        V   2   V            | End
System  |    +--------+       +--------+       +--------+   | System
+---+   |    |   R1   |=======|   R2   |=======|   R3   |   |  +---+
|  X...DFa...|._X_....|..DF1..|.__ ___.|..DF3..|...._X_.|.DFa..|.X |
|CE1|========|    \   |       |   X    |       |   /    |======|CE2|
|   |   |    |     \_.|..DF2..|._/ \__.|..DF4..|._/     |   |  |   |
+---+        |        |=======|        |=======|        |      +---+
    ^        +--------+       +--------+       +--------+      ^
    |        Relay Node       Relay Node       Relay Node      |
    |          (S-PE)           (S-PE)           (S-PE)        |
    |                                                          |
    |<---------------------- DetNet MPLS --------------------->|
    |                                                          |
    |<--------------- End to End DetNet Service -------------->|

   -------------------------- Data Flow ------------------------->

    X   = Optional service protection (none, PRF, PREOF, PEF/POF)
    DFx = DetNet member flow x over a TE LSP
]]></artwork>
</figure>

    <t>
      As previously mentioned, this document specifies how MPLS is used
      to support DetNet flows using an MPLS data plane as well as how
      such can be mapped to IEEE 802.1 TSN and IP DetNet PSNs. An
      equally import scenario is when IP is supported over DetNet MPLS
      and this is covered in <xref
      target="I-D.ietf-detnet-dp-sol-ip"/>.  Another important scenario
      is where an Ethernet Layer 2 service is supported over DetNet MPLS
      and this is covered in [TBD-TSN-OVER-DETNET].
    </t>

    <section title="IP Over DetNet MPLS Data Plane Scenarios"
             anchor="sec_ip_mpls_dt_dp_scen">
      <t>
        [Author's note: this section to be moved to IP sol draft]
      </t>
      <figure align="center" anchor="fig_dn_ip_mpls_detnet"
              title="DetNet IP Over MPLS Network">
        <artwork><![CDATA[
IP  DetNet        Relay       Transit         Relay       IP DetNet
End System        Node         Node           Node        End System
                  (T-PE)       (LSR)          (T-PE)
+----------+                                             +----------+
|   Appl.  |<------------ End to End Service ----------->|   Appl.  |
+----------+   .....-----+                 +-----.....   +----------+
| Service  |<--: Service |-- DetNet flow --| Service :-->| Service  |
+----------+   +---------+  +----------+   +---------+   +----------+
|Forwarding|   |Fwd| |Fwd|  |Forwarding|   |Fwd| |Fwd|   |Forwarding|
+-------.--+   +-.-+ +-.-+  +----.---.-+   +-.-+ +-.-+   +---.------+
        :  Link  :    /  ,-----.  \   : Link :    /  ,-----.  \
        +........+    +-[  Sub  ]-+   +......+    +-[  Sub  ]-+
                        [Network]                   [Network]
                         `-----'                     `-----'

        |<- DN IP->| |<---- DetNet MPLS ---->| |< -DN IP ->|
        ]]></artwork>
      </figure>
      <t>
        <xref target="fig_dn_ip_mpls_detnet"/> illustrates DetNet
        enabled End Systems (hosts), connected to DetNet (DN) enabled IP
        networks, operating over a DetNet aware MPLS network. In this
        figure, Relay nodes sit at the boundary of the MPLS domain since
        the non-MPLS domain is DetNet aware.  This figure is very
        similar to <xref target="fig_dn_mpls_detnet"/>.  The primary
        difference is that the Relay nodes are at the edges of the MPLS
        domain and therefore function as T-PEs, and that service
        sub-layer functions are not provided over the DetNet IP network.
        There is no difference in transit node function.
      </t>

      <t>
        <xref target="fig_ip_pw_detnet"/> illustrates how relay nodes
        can provide service protection over the MPLS domain.  In this
        case, CE1 and CE2 are IP DetNet end systems which are
        interconnected via a MPLS domain such as previously shown in
        <xref target="fig_pw_detnet"/>.  Note that R1 and R3 sit at the
        edges of an MPLS domain and therefore are similar to T-PEs,
        while R2 sits in the middle of the domain and is therefore
        similar to an S-PE.
      </t>

      <figure align="center" anchor="fig_ip_pw_detnet"
              title="DetNet IP Over DetNet MPLS Network">
        <artwork><![CDATA[
      DetNet                                         DetNet
IP    Service         Transit          Transit       Service  IP
DetNet               |<-Tnl->|        |<-Tnl->|               DetNet
End     |            V   1   V        V   2   V            |  End
System  |   +--------+       +--------+       +--------+   |  System
+---+   |   |   R1   |=======|   R2   |=======|   R3   |   |   +---+
|   |-------|._X_....|..DF1..|.__ ___.|..DF3..|...._X_.|-------|   |
|CE1|   |   |    \   |       |   X    |       |   /    |   |   |CE2|
|   |   |   |     \_.|..DF2..|._/ \__.|..DF4..|._/     |   |   |   |
+---+       |        |=======|        |=======|        |       +---+
    ^       +--------+       +--------+       +--------+       ^
    |        Relay Node       Relay Node       Relay Node      |
    |          (T-PE)           (S-PE)          (T-PE)         |
    |                                                          |
    |<-DN IP-> <-------- DetNet MPLS ---------------> <-DN IP->|
    |                                                          |
    |<-------------- End to End DetNet Service --------------->|

   -------------------------- Data Flow ------------------------->

    X   = Service protection (PRF, PREOF, PEF/POF)
    DFx = DetNet member flow x over a TE LSP
    ]]></artwork>
      </figure>

      <figure align="center" anchor="fig_ip_mpls_detnet"
              title="Non-DetNet Aware IP Over DetNet MPLS Network">
        <artwork><![CDATA[
 IP               Edge                        Edge        IP
 End System       Node                        Node        End System
                 (T-PE)       (LSR)          (T-PE)
+----------+   +....-----+                 +-----....+   +----------+
|   Appl.  |<--:Svc Proxy|-- E2E Service --|Svc Proxy:-->|   Appl.  |
+----------+   +.....+---+                 +---+.....+   +----------+
|    IP    |<--:IP : |Svc|-- IP/DN Flow ---|Svc| :IP :-->|    IP    |
+----------+   +---+ +---+  +----------+   +---+ +---+   +----------+
|Forwarding|   |Fwd| |Fwd|  |Forwarding|   |Fwd| |Fwd|   |Forwarding|
+-------.--+   +-.-+ +-.-+  +----.---.-+   +-.-+ +-.-+   +---.------+
        :  Link  :    /  ,-----.  \   : Link :    /  ,-----.  \
        +........+    +-[  Sub  ]-+   +......+    +-[  Sub  ]-+
                        [Network]                   [Network]
                         `-----'                     `-----'

      |<--- IP --->| |<----- DetNet MPLS ----->| |<--- IP --->|
      ]]></artwork>
      </figure>
      <t>
        <xref target="fig_ip_mpls_detnet"/> illustrates non-DetNet
        enabled End Systems (hosts), connected to DetNet (DN) enabled
        MPLS network. It differs from <xref
        target="fig_dn_ip_mpls_detnet"/> in that the hosts and edge IP
        networks are not DetNet aware.  In this case, edge nodes sit at
        the boundary of the MPLS domain since it is also a DetNet domain
        boundary.  The edge nodes provide DetNet service proxies for the
        end applications by initiating and terminating DetNet service
        for the application's IP flows. See <xref
        target="I-D.ietf-detnet-dp-sol-ip"/> for more information.
      </t>

      <t>
        <xref target="fig_pw_detnet2"/> illustrates how it is still
        possible to provided DetNet service protection for
        non-DetNet aware end systems.  This figures is basically the
        same as <xref target="fig_ip_pw_detnet"/>, with the exception
        that CE1 and CE2 are non-DetNet aware end systems and E1 and E3
        are edge nodes that replace the relay nodes R1 and R3.
      </t>

      <figure align="center" anchor="fig_pw_detnet2"
              title="MPLS-Based DetNet (non-MPLS End System)">
<artwork><![CDATA[
      IP                                              IP
Non   Service          Transit          Transit       Service Non
DetNet                |<-Tnl->|        |<-Tnl->|              DetNet
End     |             V   1   V        V   2   V            | End
System  |    +--------+       +--------+       +--------+   | System
+---+   |    |   E1   |=======|   R2   |=======|   E3   |   |  +---+
|   |--------|._X_....|..DF1..|.__ ___.|..DF3..|...._X_.|------|   |
|CE1|   |    |    \   |       |   X    |       |   /    |   |  |CE2|
|   |   |    |     \_.|..DF2..|._/ \__.|..DF4..|._/     |   |  |   |
+---+        |        |=======|        |=======|        |      +---+
             +--------+       +--------+       +--------+
             ^ Edge Node      Relay Node       Edge Node^
             | (T-PE)           (S-PE)          (T-PE)  |
             |                                          |
     <--IP-->| <-------- IP Over DetNet MPLS ---------> |<--IP-->
             |                                          |
             |<------ End to End DetNet Service ------->|

    X   = Optional service protection (none, PRF, PREOF, PEF/POF)
    DFx = DetNet member flow x over a TE LSP
]]></artwork>
</figure>
  </section>
  <section title="IEEE 802.1 TSN Over DetNet MPLS Data Plane Scenario"
             anchor="sec_tsn_mpls_dt_dp_scen">
      <t>
        [Author's note: this section to be moved to TSN over mpls sol
        draft - TBD-TSN-OVER-DETNET]
      </t>


<figure anchor="fig_tsn_mpls_detnet" align="center"
title="A TSN over DetNet MPLS Enabled Network">
<artwork align="center"><![CDATA[
 TSN             Edge          Transit        Edge        TSN
 End System      Node           Node          Node        End System
                (T-PE)         (LSR)          (T-PE)

+----------+  +.........+                   +.........+  +----------+
|   Appl.  |<-:Svc Proxy:--End to End Svc.--:Svc Proxy:->|   Appl.  |
+----------+  +---------+                   +---------+  +----------+
|    TSN   |  |TSN| |Svc|<-- DetNet flow -->|Svc| |TSN|  |    TSN   |
+----------+  +---+ +---+    +----------+   +---+ +---+  +----------+
|Forwarding|  |Fwd| |Fwd|    |Forwarding|   |Fwd| |Fwd|  |Forwarding|
+------.---+  +--.+ +-.-+    +---.----.-+   +--.+ +-.-+  +----.-----+
       :   Link  :    /  ,-----.  \   :  Link  :   /  ,-----.  \
       +.........+    +-[  Sub  ]-+   +........+   +-[  Sub  ]-+
                        [Network]                    [Network]
                         `-----'                      `-----'

        |<- TSN ->| |<------ DetNet MPLS ------>| |<-- TSN --->|
]]></artwork>
</figure>

  <t>
   <xref target="fig_tsn_mpls_detnet"/> shows IEEE 802.1 TSN end
   stations operating over a TSN aware DetNet service running over an
   MPLS network.  DetNet Edge Nodes sit at the boundary of a DetNet
   domain. They are responsible for mapping non-DetNet aware L2 traffic to
   DetNet services.  They also support the imposition and disposition of
   the required DetNet encapsulation.  These are functionally similar to
   pseudowire (PW) Terminating Provider Edge (T-PE) nodes which use
   MPLS-TE LSPs.  In this example they understand and support IEEE 802.1
   TSN and are able to map TSN flows into DetNet flows.  The specific of
   this operation are discussed in [TBD-TSN-OVER-DETNET].
  </t>
  <t>
	Native TSN flow and DetNet MPLS flow differ not only by the additional MPLS specific encapsulation, but DetNet MPLS flows have
	on each DetNet node an associated DetNet specific data structure, what defines flow related characteristics and required
	forwarding functions. In this example, edge Nodes provide a
        service proxy function that "associates" the DetNet flows and native flows
	at the edge of the DetNet domain. This ensures that the DN Flow is properly served at the Edge node (and inside the domain).
  </t>


  <t>
   <xref target="fig_8021_detnet"/> illustrates how DetNet can provide services for IEEE 802.1TSN
   end systems, CE1 and CE2, over a DetNet enabled MPLS network.
   Similar to <xref target="fig_ip_mpls_detnet"/>, the edge nodes, E1 and E2, insert and remove required DetNet data
   plane encapsulation.  The 'X' in the edge nodes and relay node, R1, represent a potential DetNet compound flow
   packet replication and elimination point.  This conceptually parallels L2VPN services, and could
   leverage existing related solutions as discussed below.
  </t>

  <figure align="center" anchor="fig_8021_detnet"
  title="IEEE 802.1TSN Over DetNet">
  <artwork><![CDATA[
     TSN    |<------- End to End DetNet Service ------>|  TSN
    Service |         Transit          Transit         | Service
TSN  (AC)   |        |<-Tnl->|        |<-Tnl->|        |  (AC)  TSN
End    |    V        V    1  V        V   2   V        V   |    End
System |    +--------+       +--------+       +--------+   |  System
+---+  |    |   E1   |=======|   R1   |=======|   E2   |   |   +---+
|   |--|----|._X_....|..DF1..|.._ _...|..DF3..|...._X_.|---|---|   |
|CE1|  |    |    \   |       |   X    |       |   /    |   |   |CE2|
|   |       |     \_.|..DF2..|._/ \_..|..DF4..|._/     |       |   |
+---+       |        |=======|        |=======|        |       +---+
    ^       +--------+       +--------+       +--------+       ^
    |        Edge Node       Relay Node        Edge Node       |
    |          (T-PE)           (S-PE)          (T-PE)         |
    |                                                          |
    |<- TSN -> <------- TSN Over DetNet MPLS -------> <- TSN ->|
    |                                                          |
    |<--- Emulated Time Sensitive Networking (TSN) Service --->|

    X   = Service protection
    DFx = DetNet member flow x over a TE LSP
]]>
</artwork>
</figure>
  </section>
  </section>

  <section title="Packet Flow Example with Service Protection">

 <t>
   An example DetNet MPLS network fragment and packet flow is
   illustrated in <xref target="fig_mpls_example"/>.
 </t>

 <figure align="center" anchor="fig_mpls_example"
  title="Example Packet Flow in DetNet Enabled MPLS Network">
 <artwork><![CDATA[
   1      1.1       1.1      1.2.1    1.2.1      1.2.2
CE1----EN1--------R1-------R2-------R3--------EN2-----CE2
         \           1.2.1 /                   /
          \1.2     /-----+                   /
           +------R4------------------------+
                     1.2.2
 ]]></artwork>
 </figure>

 <t>
  In <xref target="fig_mpls_example"/> the numbers are used
  to identify the instance of a packet. Packet 1 is the original packet,
  and packets 1.1, and 1.2 are two first generation copies of packet 1.
  Packet 1.2.1 is a second generation copy of packet 1.2 etc.
  Note that these numbers never appear in the packet, and are not
  to be confused with sequence numbers, labels or any other
  identifier that appears in the packet. They simply indicate the
  generation number of the original packet so that its passage
  through the network fragment can be identified to the reader.
 </t>
 <t>
  Customer Equipment CE1 sends a packet into the DetNet enabled MPLS
  network. This is packet (1).  Edge Node EN1 encapsulates the
  packet as a DetNet Packet and sends it to Relay node R1 (packet 1.1).
  EN1 makes a copy of the packet (1.2), encapsulates it and
  sends this copy to Relay node R4.
 </t>
 <t>
  Note that along the MPLS path from EN1 to R1 there may be
  zero or more LSRs which, for clarity, are not shown. The same is true
  for any other path between two DetNet entities shown in
  <xref target="fig_mpls_example"/>.
 </t>
 <t>
  Relay node R4 has been configured to send one copy of the packet to
  Relay Node R2 (packet 1.2.1) and one copy to Edge Node EN2
  (packet 1.2.2).
 </t>
 <t>
  R2 receives packet copy 1.2.1 before packet copy 1.1 arrives, and, having
  been configured to perform packet elimination on this DetNet flow,
  forwards packet 1.2.1 to Relay Node R3.
  Packet copy 1.1 is of no further use and so is discarded by R2.
 </t>
 <t>
  Edge Node EN2 receives packet copy 1.2.2 from R4 before it receives
  packet copy 1.2.1 from R2 via relay Node R3. EN2 therefore strips
  any DetNet encapsulation from packet copy 1.2.2 and forwards the
  packet to CE2. When EN2 receives the later packet copy 1.2.1 this
  is discarded.
 </t>
 <t>
   The above is of course illustrative of many network scenarios that
   can be configured.  Between a pair of relay nodes there may be one or
   more transit nodes that simply forward the DetNet traffic, but
   these are omitted for clarity.
 </t>
  </section>
</section>  <!-- end of data plane overview -->

<!-- ================================================================= -->
<!-- =================== General Encap considerations ================ -->
<!-- ================================================================= -->

<section title="DetNet MPLS Data Plane Considerations" anchor="dn-gen-encap-solution">
  <t>
    This section provides informative considerations related to
    providing DetNet service to flows which are identified
    based on their header information. At a high level, the
    following are provided on a per flow basis:
    <list style="hanging">
      <t hangText="Eliminating contention loss and jitter reduction:">
        <vspace blankLines="1"/>
        Use of allocated resources (queuing, policing, shaping) to ensure
        that the congestion-related loss and latency/jitter requirements of
        a DetNet flow are met.
      </t>
      <t hangText="Explicit routes:">
        <vspace blankLines="1"/>
        Use of a specific path for a flow.  This limits
        misordering and bounds latency.
      </t>

      <t hangText="Service protection:">
        <vspace blankLines="1"/>
        Which in the case of this document primarily relates to
        replication and elimination. Changing the explicit path after a
        failure is detected in order to restore delivery of the required
        DetNet service characteristics is also possible. Path changes,
        even in the case of failure recovery, can lead to the out of
        order delivery of data.
      </t>
      <t hangText="Load sharing:">
        <vspace blankLines="1"/>
        Generally, distributing packets of the same DetNet flow over
        multiple paths is not recommended. Such load sharing,
        e.g., via ECMP or UCMP, impacts ordering and possibly jitter.
      </t>
      <t hangText="Troubleshooting:"> <vspace blankLines="1"/>
      For example, to support identification of misbehaving flows.
      </t>
      <t hangText="Recognize flow(s) for analytics:"><vspace blankLines="1"/>
      For example, increase counters.
      </t>
      <t hangText="Correlate events with flows:"><vspace blankLines="1"/>
      For example, unexpected loss.
      </t>
    </list>
  </t>

  <t>
  The DetNet data plane also allows for the aggregation of DetNet flows, e.g., via MPLS hierarchical
  LSPs, to improved scaling.  When DetNet flows are aggregated, transit
  nodes provide service to the aggregate and not on a per-DetNet flow
  basis.  In this case, nodes performing aggregation will ensure that
  per-flow service requirements are achieved.
 </t>

 <section title="End-System Specific Considerations">
  <t>
   Data-flows requiring DetNet service are generated and terminated on
   end-systems. Encapsulation depends on application and its
   preferences. In a DetNet MPLS domain the DN functions use the d-CWs,
   S-Labels and F-Labels to provide DetNet services. However, an
   application may exchange further flow related parameters (e.g.,
   time-stamp), which are not provided by DN functions.
  </t>

  <t>
    Specifics related to non-MPLS DetNet end station behavior are out
    side the scope of this document.  For example, details on support
    for DetNet IP data flows can be found in <xref
    target="I-D.ietf-detnet-dp-sol-ip"/>. This document is also useful
    for end stations that map IP flows to DetNet flows.
  </t>
  <t>
   As a general rule, DetNet MPLS domains are capable of forwarding any
   DetNet MPLS flows and the DetNet domain does not mandate the
   end-system or edge system encapsulation format. Unless there is a
   proxy of some form present, end-systems peer with similar end-systems
   using the same application encapsulation format.  For example, as
   shown in <xref target="fig_es_connect"/>, IP applications peer with
   IP applications and Ethernet L2VPN applications peer with Ethernet
   L2VPN applications.
  </t>

  <figure title="End-Systems and The DetNet MPLS Domain" anchor="fig_es_connect">
  <artwork align="center"><![CDATA[
+-----+
|  X  |                               +-----+
+-----+                               |  X  |
| Eth |               ________        +-----+
+-----+     _____    /        \       | Eth |
       \   /     \__/          \___   +-----+
        \ /                        \ /
         0======== tunnel-1 ========0_
         |                             \
          \                             |
          0========= tunnel-2 =========0
         / \                        __/ \
  +-----+   \__ DetNet MPLS domain /     \
  |  X  |      \         __       /       +-----+
  +-----+       \_______/  \_____/        |  X  |
  |  IP |                                 +-----+
  +-----+                                 |  IP |
                                          +-----+
  ]]>
    </artwork></figure>

 </section>
 <section title="Sub-Network Considerations">
   <t>
     As shown in <xref target="fig_dn_mpls_detnet"/>, MPLS nodes are
     interconnected by different sub-network technologies, which may
     include point-to-point links. Each of these need to provide
     appropriate service to DetNet flows.  In some cases, e.g., on
     dedicated point-to-point links or TDM technologies, all that is
     required is for a DetNet node to appropriately queue its output
     traffic.  In other cases, DetNet nodes will need to map DetNet
     flows to the flow semantics (i.e., identifiers) and mechanisms used
     by an underlying sub-network technology.  <xref
     target="fig_dn_mpls_sn_ex"/> shows several examples of header
     formats that can be used to carry DetNet MPLS flows over different
     sub-network technologies.  L2 represent a generic layer-2
     encapsulation that might be used on a point-to-point link.  TSN
     represents the encapsulation used on an IEEE 802.1 TSN network, as
     described in <xref target="mpls-over-tsn"/>.  UDP/IP represents the
     encapsulation used on a DetNet IP PSN, as described in <xref
     target="mpls-over-ip"/> .     
   </t>
   

  <figure title="Example DetNet MPLS Sub-Network Formats" anchor="fig_dn_mpls_sn_ex">
  <artwork align="center"><![CDATA[

                   +------+  +------+  +------+
App-Flow           |  X   |  |  X   |  |  X   |
             +-----+======+--+======+--+======+-----+
DetNet-MPLS        | d-CW |  | d-CW |  | d-CW |
                   +------+  +------+  +------+
                   |Labels|  |Labels|  |Labels|
             +-----+======+--+======+--+======+-----+
Sub-Network        |  L2  |  | TSN  |  | UDP  |
                   +------+  +------+  +------+
                                       |  IP  |
                                       +------+
                                       |  L2  |
                                       +------+
    ]]>
  </artwork></figure>
 </section>
</section>

<!-- ================================================================= -->

<section title="MPLS-Based DetNet Data Plane Solution" anchor="dn-dt-solution">

 <section title="DetNet Over MPLS Encapsulation Components" anchor="dn-MPLS-en-comps">
  <t>
   To carry DetNet over MPLS the following is required:

  <list style="numbers">
   <t>A method of identifying the MPLS payload type.</t>
   <t>A method of identifying the DetNet flow group to the processing element.</t>
   <t>A method of distinguishing DetNet OAM packets from DetNet data packets.</t>
   <t>A method of carrying the DetNet sequence number.</t>
   <t>A suitable LSP to deliver the packet to the egress PE.</t>
   <t>A method of carrying queuing and forwarding indication.</t>
  </list>
  </t>
  <t>
   In this design an MPLS service label (the S-Label), similar to a pseudowire
   (PW) label <xref target="RFC3985"/>,
   is used to identify both the DetNet flow identity and the payload MPLS payload type satisfying
   (1) and (2) in the list above.  OAM traffic discrimination happens through the use of the
   Associated Channel method described in <xref target="RFC4385"/>.  The DetNet sequence number is carried in the DetNet
   Control word which carries the Data/OAM discriminator.
   To simplify implementation and to maximize interoperability two sequence number sizes are
   supported: a 16 bit sequence number and a 28 bit sequence number.
   The 16 bit sequence number is needed to support some types of legacy clients. The 28 bit sequence
   number is used in situations where it is necessary ensure that in high speed networks the
   sequence number space does not wrap whilst packets are in flight.
  </t>
  <t>
   The LSP used to forward the DetNet
   packet may be of any type (MPLS-LDP, MPLS-TE, MPLS-TP <xref
   target="RFC5921"/>, or
   MPLS-SR <xref target="I-D.ietf-spring-segment-routing-mpls"/>).  The LSP (F-Label) label and/or the S-Label may
   be used to indicate the queue processing as well as the forwarding parameters.
   Note that the possible use of Penultimate
   Hop Popping (PHP) means that the only label in a received label stack may be the S-Label.
  </t>
 </section>

  <section title="MPLS Data Plane Encapsulation" anchor="pwSolution">
   <t>
    <xref target="fig_pw_mpls"/> illustrates a DetNet data plane MPLS encapsulation.  The MPLS-based
    encapsulation of the DetNet flows is a good fit for the scenarios
    described in <xref target="sec_ip_mpls_dt_dp_scen"/> and <xref
    target="sec_tsn_mpls_dt_dp_scen"/>.  Furthermore, end to end DetNet
    service i.e., native 
    DetNet deployment (see <xref target="sec_mpls_dt_dp_scen"/>) is also possible if DetNet end systems
    are capable of initiating and termination MPLS encapsulated packets.
   </t>
   <t>
    The MPLS-based DetNet data plane encapsulation consists of:
    <list style="symbols">
     <t>
      DetNet control word (d-CW) containing sequencing information for packet replication and
      duplicate elimination purposes, and the OAM indicator.</t>
     <t>
      DetNet service Label (S-Label) that identifies a DetNet flow at
      the receiving DetNet service sub-layer processing node.
     </t>
     <t>
      Zero or more Detnet MPLS  Forwarding label(s) (F-Label) used to direct the packet along the label
      switched path (LSP) to the next service sub-layer processing node along the path.  When Penultimate Hop Popping is in
      use there may be no label F-Label in the protocol stack on the final hop.
     </t>
     <t>
      The necessary data-link encapsulation is then applied prior to transmission over the physical
      media.
     </t>
    </list>
   </t>

  <figure title="Encapsulation of a DetNet App-Flow in an MPLS(-TP) PSN" anchor="fig_pw_mpls">
  <artwork align="center"><![CDATA[
  DetNet MPLS-based encapsulation

+---------------------------------+
|                                 |
|         DetNet App-Flow         |
|         Payload  Packet         |
|                                 |
+---------------------------------+ <--\
|       DetNet Control Word       |    |
+---------------------------------+    +--> DetNet data plane
|           S-Label               |    |    MPLS encapsulation
+---------------------------------+    |
|           F-Label(s)            |    |
+---------------------------------+ <--/
|           Data-Link             |
+---------------------------------+
|           Physical              |
+---------------------------------+
]]>
    </artwork></figure>

  <section title="DetNet Control Word and the DetNet Sequence Number"
           anchor="dn-sn">
  <t>
   A DetNet control word (d-CW) conforms to the Generic PW MPLS Control
   Word (PWMCW) defined in <xref target="RFC4385"/>. The d-CW formatted
   as shown in <xref target="fig_detnet_cw"/> MUST be present in all
   DetNet packets containing app-flow data.
  </t>
    <figure title="DetNet Control Word" anchor="fig_detnet_cw">
    <artwork align="center"><![CDATA[
 0                   1                   2                   3
 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|0 0 0 0|                Sequence Number                        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]>
    </artwork></figure>

  <t>
    <list style="hanging">
      <t hangText="(bits 0 to 3)">
        <vspace blankLines="1"/>
        Per <xref target="RFC4385"/>, MUST be set to zero (0).
      </t>
      <t hangText="Sequence Number (bits 4 to 31)">
        <vspace blankLines="1"/>
        An unsigned value implementing the DetNet sequence number.
      </t>
    </list>
  </t>
  <t>
   A separate sequence number space MUST be maintained by the 
   the node that adds the d-CW for each DetNet app-flow.
   The following sequence number field lengths MUST be supported:
   <list style="bullets">
     <t>0 bits</t>
     <t>16 bits</t>
     <t>28 bits</t>
   </list>
   The sequence number length MUST be provisioned (configured) on a per
   app-flow basis via
   configuration, e.g., the controller plane described in <xref
   target="cp_considerations"/>.
  </t>
  <t>
    A 0 bit sequence number field length indicates that there is no
    DetNet sequence number used for the flow.  When the length is zero,
    the sequence number field MUST be set to zero (0) on all packets
    sent for the flow.
  </t>

  <t>
    When the sequence number field length is 16 or 28 bits for a flow,
    the sequence number MUST be incremented by one for each new app-flow
    packet sent. When the field length is 16 bits, d-CW bits 4 to 15
    MUST be set to zero (0). This values carried in this field can wrap
    and it is important to note that zero (0) is a valid field value.
    For example, were the sequence number size is 16 bits, the sequence
    will contain: 65535, 0, 1. In this case, zero (0) is an ordinary
    sequence number. This differs from <xref target="RFC4448"/> where a
    sequence number of zero (0) does not indicate that no sequence
    number field value is in use.
  </t>
  <t>
    The sequence number is optionally used during receive processing as
    described below in <xref target="pef-requirements"/> and <xref
    target="pof-requirements"/>.
  </t>
  </section>
  <section anchor="flow-identification" title="S-Labels">
   <t>
    App-flow identification at a DetNet service sub-layer is realized by
    an S-Label.  Each app-flow MUST be sent by the node that adds a d-CW
    with a single specific S-Label value.  MPLS-aware DetNet end systems
    and edge nodes, which are by definition MPLS ingress and egress
    nodes, MUST add and remove the d-CW and S-Label.  Relay nodes MAY
    swap S-Label values when processing an app-flow.
   </t>
   <t>
    The S-Label value MUST be provisioned per app-flow via
    configuration, e.g., via
    the controller plane described in <xref target="cp_considerations"/>.
    Note that S-Labels provide app-flow identification at the downstream
    DetNet service sub-layer receiver, not the sender.  As such,
    S-Labels MUST be allocated by the entity that controls the service
    sub-layer receiving node's label space, and MAY be allocated from
    the platform label space <xref target="RFC3031"/>.
   </t>
   <t>
   The S-Label will normally be at the bottom of the label stack, immediately preceding the d-CW.
   To support service sub-layer level OAM, an OAM Associated Channel Header (ACH) <xref target="RFC4385"/>
   together with a Generic Associated Channel Label (GAL) <xref
   target="RFC5586"/> MAY be used in place of a d-CW.
   </t>
   <t>
   Similarly, an Entropy Label Indicator/Entropy Label (ELI/EL)
   <xref target="RFC6790"/> MAY be carried below the S-Label in the
   label stack in networks where DetNet flows would otherwise received ECMP treatment.
   When ELs are used, the same EL value SHOULD be used for
   all of the packets sent using a specific S-Label to force the flow to follow the
   same path.   However, as previously stated in <xref
   target="dn-gen-encap-solution"/>, the use of ECMP for DetNet flows is
   NOT RECOMMENDED. ECMP MAY be used for non-DetNet flows within a
   DetNet domain.
   </t>
   <t>
     When receiving a DetNet MPLS flow, an implementation MUST identify
     the app-flow associated with the incoming packet based on the
     S-Label.  When a node is using platform labels for S-Labels, no
     additional information is needed as the S-label uniquely identifies
     the app-flow.  In the case where platform labels are not used, one
     or more F-Labels proceeding the S-Label MUST be used together with
     the S-Label to uniquely identify the incoming app-flows. When PHP
     is used, the incoming interface MAY also be used to together with
     any present F-Label(s) and the S-Label to uniquely identify an
     incoming app-flows.  Note that choice to use platform label space
     for S-Label or S-Label plus one or more F-Labels to identify app
     flows is a local implementation choice, with one caveat.  When one
     or more F-labels, or incoming interface, is needed together with an
     S-Label to uniquely identify, the controller plane MUST ensure that
     incoming DetNet MPLS packets arrive with the needed information
     (F-label(s) and/or incoming interface); the details of such are
     outside the scope of this document.
   </t>
   <t>
     While NOT REQUIRED, the use of platform labels for S-Labels matches
     other pseudowire encapsulations.  This implementation choice also
     impacts PEF and POF processing as described in the next section.
   </t>
   <section anchor="pef-requirements" title="Packet Elimination Function
                                             Processing">
     <t>
       Implementations MAY support the Packet Elimination Function (PEF)
       for received DetNet MPLS flows.  When supported, use of the PEF
       for a particular app-flow MUST be provisioned via configuration,
       e.g., via the controller plane described in <xref target="cp_considerations"/>.
     </t>
     <t>
       After an app-flow is identified for a received DetNet MPLS
       packet, as described above, an implementation MUST check if PEF
       is configured for that app-flow.  When configured the
       implementation MUST track the sequence number contained in
       received d-CWs and MUST ensure that duplicate (replicated)
       instances of a particular sequence number are discarded.  The
       specific mechanisms used for an implementation to identify which
       received packets are duplicates and which are new is an
       implementation choice.  Note that per <xref target="dn-sn"/>
       the sequence number field length may be 16 or 28 bits, and the
       field value can wrap.
     </t>
     <t>
       Note that an implementation MAY wish to constrain the maximum
       number sequence numbers that are tracked, on platform-wide or per
       flow basis.  Some implementations MAY support the provisioning of
       the maximum number sequence numbers that are tracked number on
       either a platform-wide or per flow basis.
     </t>
   </section>
   <section anchor="pof-requirements" title="Packet Ordering Function
                                             Processing">
     <t>
       A function that is related to PEF is the Packet Ordering Function
       (POF).  Implementations MAY support POF. When
       supported, use of the POF for a particular app-flow MUST be
       provisioned via configuration, e.g., via the controller plane
       described by <xref
       target="cp_considerations"/>.  Implementations MAY required that
       PEF and POF be used in combination.  There is no requirement
       related to the order of execution of the Packet Elimination and
       Ordering Functions in an implementation.
     </t>
     <t>
       After an app-flow is identified for a received DetNet MPLS
       packet, as described above, an implementation MUST check if POF
       is configured for that app-flow.  When configured the
       implementation MUST track the sequence number contained in
       received d-CWs and MUST ensure that packets are processed in the
       order indicated in the received d-CW sequence number field, which
       may not be in the order the packets are received. As defined in
       <xref target="dn-sn"/> the sequence number field length may be 16
       or 28 bits, is incremened by one (1) for each new app-flow packet
       sent, and the field value can wrap.  The specific mechanisms used
       for an implementation to identify the order of received packets
       is an implementation choice.
     </t>
     <t>
       Note that an implementation MAY wish to constrain the maximum
       number of out of order packets that can be processed, on
       platform-wide or per flow basis.  Some implementations MAY
       support the provisioning of this number on either a platform-wide
       or per flow basis.  The number of out of order packets that can
       be processed also impacts the latency of a flow.
     </t>
   </section>
  </section>
  <section anchor="f-labels" title="F-Labels">
     <t>
       F-Labels are support the DetNet forwarding sub-layer. F-Labels
       are used to provide LSP-based connectivity between DetNet service
       sub-layer processing nodes.
     </t>
     <section anchor="f-labels-ssl"
              title="Service Sub-Layer and Packet Replication Function Processing">
       
       <t>
         DetNet MPLS end systems, edge nodes and relay nodes may operate
         at the DetNet service sub-layer with understand of app-flows
         and their requirements. As mentioned above, when operating at
         this layer such nodes can push, pop or swap (pop then push)
         S-Labels. In all cases, the F-Labels used for the app-flow are
         always replaced and this section applies. 
       </t>
       <t>
         When sending a DetNet flow, Zero or more F-Labels MAY be added
         on top of an S-Label by the node pushing an S-Label. The
         F-Labels to be pushed when sending a particular app-flow MUST
         be provisioned per app-flow via configuration, e.g., via the
         controller plane discussed in <xref target="cp_considerations"/>.  To
         allow for the omission of F-Labels, an implementation SHOULD
         also allow an outgoing interface to be provisioned.
     </t>
     <t>
       The Packet Replication Function (PRF) function MAY be supported
       by an implementation for outgoing DetNet flows. When supported,
       the same app-flow data will be sent over multiple outgoing
       forwarding sub-layer LSPs.  To support PRF an implementation MUST
       support the setting of different sets of F-Labels.  Hereto, to
       allow for the omission of F-Labels, an implementation SHOULD also
       allow multiple outgoing interfaces to be provisioned. PRF MUST
       NOT be used with app-flows configured with a d-CW sequence number
       field length of 0 bits.
     </t>
     <t>
       When a single set of F-Labels is provisioned for a particular
       outgoing app-flow, that set of F-labels MUST be pushed after the
       S-Label is pushed.  The outgoing packet is then forwarded as
       described below in <xref target="f-labels-all"/>. When a single
       outgoing interface is provisioned, the outgoing packet is then
       forwarded as described below in <xref target="f-labels-all"/>.
     </t>
     <t>
       When multiple sets of F-Labels or interfaces are provisioned for
       a particular outgoing app-flow, a copy of the outgoing packet, including
       the pushed S-Label, MUST be made per F-label set and outgoing
       interface. Each set of provisioned F-Labels are then pushed onto
       a copy of the packet.  Each copy is then forwarded as described
       below in <xref target="f-labels-all"/>.
     </t>
     <t>
       As described in the previous section, when receiving a DetNet MPLS flow, an implementation
       identifies the app-flow associated with the incoming packet based
       on the S-Label.  When a node is using platform labels for
       S-Labels, any F-Labels can be popped and the S-label uniquely
       identifies the app-flow.  In the case where platform labels are
       not used, F-Label(s) MUST also be provisioned for incoming
       app-flows. When PHP is used, incoming interface MUST be
       provisioned.  The provisioned information MUST then be used to
       identify incoming app-flows based on the combination of S-Label
       and F-Label(s) or incoming interface.
     </t>
     </section>
     <section anchor="f-labels-all"
              title="Common F-Label Processing">
       <t>
         All DetNet aware MPLS nodes process F-Labels as needed to meet
         the service requirements of the DetNet flow or flows carried in
         the LSPs represented by the F-Labels.  This includes normal
         push, pop and swap operations.  Such processing is essentially
         the same type of processing enabled for TE LSPs, although the
         specific service parameters, or traffic specification, can
         differ.  When the DetNet service parameters of the app-flow or
         flows carried in an LSP represented by an F-Label can be met by
         an exiting TE mechanism, the forwarding sub-layer processing
         node MAY be a DetNet unaware, i.e., standard, MPLS LSR.  Such
         TE LSPs may provide LSP forwarding service as defined in, but
         not limited to, <xref target="RFC3209"/>, <xref
         target="RFC3270"/>, <xref target="RFC3272"/>, <xref
         target="RFC3473"/>, <xref target="RFC4875"/>, <xref
         target="RFC5440"/>, and <xref target="RFC6006"/>.
       </t>
       <t>
         More specifically, as mentioned above, the DetNet forwarding
         sub-layer provides explicit routes and allocated resources, and
         F-Labels are used to map to each.  Explicit routes are
         supported based on the topmost (outermost) F-Label that is
         pushed or swapped and the LSP that corresponds to this label.
         This topmost (outgoing) label MUST be associated with a
         provisioned outgoing interface and, for non-point-to-point
         outgoing interfaces, a next hop LSR.  Note that this
         information MUST be provisioned via configuration or the
         controller plane.  In the previously mentioned special case
         where there is no added F-labels and the outgoing interface is
         not a point-to-point interface, the outgoing interface MUST
         also be associated with a next hop LSR.
       </t>
       <t>
         Resources may be allocated in a hierarchical fashion per LSP
         that is represented by each F-Label. Each LSP MAY be
         provisioned with a service parameters that dictates the
         specific traffic treatment to be received by the traffic
         carried over that LSP.  Implementations of this document MUST
         ensure that traffic carried over each LSP represented by an
         F-Label receives the traffic treatment provisioned for that
         LSP.  Typical mechanisms used to provide different treatment to
         different flows includes the allocation of system resources
         (such as queues and buffers) and provisioning or related
         parameters (such as shaping, and policing). Support can also be
         provided via an underlying network technology such IEEE802.1
         TSN <xref target="mpls-over-tsn"/>. Other than in the TSN case,
         the specific mechanisms used by a DetNet node to ensure DetNet
         service delivery requirements are met for supported DetNet
         flows is outside the scope of this document.
       </t>
       <t>
         Packets that are marked in a way that does not correspond to
         allocated resources, e.g., lack a provisioned F-Label, can disrupt the QoS offered to properly
         reserved DetNet flows by using resources allocated to the reserved flows.  Therefore,
         the network nodes of a DetNet network:
         <list style="symbols">
           <t>
             MUST defend the DetNet QoS by discarding or remarking (to an
             allocated DetNet flow or non-competing non-DetNet flow)
             packets received that are not the subject of a completed resource allocation.
           </t>
           <t>
             MUST NOT use a DetNet allocated resource, e.g. a queue or shaper reserved for
             DetNet flows, for any packet that does match the corresponding
             DetNet flow.
           </t>
           <t>
             MUST ensure a QoS flow does not exceed its allocated resources or
             provisioned service level,
           </t>
           <t>
             MUST ensure a CoS flow or  service class does
             not impact the service delivered to other flows.  This requirement is similar to
             requirement for MPLS LSRs to that CoS LSPs do not impact the
             resources allocated to TE LSPs, e.g.,  via <xref target="RFC3473"/>.
           </t>
         </list>
       </t>
       <t>
         Subsequent sections provide additional considerations related
         to CoS (<xref target="CoS"/>), QoS (<xref target="QoS"/>) and
         aggregation (<xref target="Aggregation"/>).
       </t>
     </section>
   </section>

   </section>

   <!-- This is now out of scope of the document 
   <section title="Indication of the DetNet Payload Type" anchor="PTI-section">
   <t>
    The only nodes that needs to know the payload type of a flow are the
    MPLS ingress node and the MPLS egress nodes.  The ingress node
    has to know how to process the packet it receives from the ingress
    AC or IP flow, and the egress edge node has to know how to prepare the
    packet for transmission to the next hop.
   </t>
   <t>
    On ingress a DetNet edge node has to classify the packets into those
    that are for transmission as Detnet packets and those that are for
    transmission as "normal" packets at one of more lower priorities.
    The packet type is indicated to the egress edge node through the
    value of the S-Label.  Thus, when the egress edge node looks up the
    S-Label one of the parameters returned is the packet type which in
    turn tells the egress edge node how to prepare the packet for
    transmission to a next hop.
   </t>
   <t>
    The consequence of this approach is that if multiple packet
    encapsulations are processed on a node pair, each encapsulation will need its own
    S-Label.  That is not generally a problems, since it is anticipated
    that only one encapsulation type will be present for each DetNet flow.
    Of course, if for some reason the multiple encapsulations are needed
    to support a single DetNet service, multiple S-Labels will be
    required for that service.  Note that in the unlikely case that IPv4
    and IPv6 will map to the same DetNet flow, different S-Labels will be
    needed to differentiate between the versions of IP.
   </t>
  </section>
   -->
   <section anchor="oam-indication" title="OAM Indication">
     <!-- LB: why only type 1, if keep it, need conformance language -->
   <t>
    OAM follows the procedures set out in <xref target="RFC5085"/> with the
    restriction that only Virtual Circuit Connectivity Verification
    (VCCV) type 1 is supported.</t>

   <t>As shown in Figure 3 of <xref target="RFC5085"/> when the first nibble of
    the d-CW is 0x0 the payload following the d-CW is normal user
    data. However, when the first nibble of the d-CW is 0X1, the
    payload that follows the d-DW is an OAM payload with the OAM
    type indicated by the value in the d-CW Channel Type field.</t>

   <t>The reader is referred to <xref target="RFC5085"/> for a more detailed
    description of the Associated Channel mechanism, and to the
    DetNet work on OAM for more information DetNet OAM.
   </t>
  </section>

  <section anchor="FAG" title="Flow Aggregation">
    <t>
      [Author's note: need to revisit this section and ensure that we
      cover (and fully specify) desired types of aggregation.]
    </t>
   <t>
    <list style="numbers">
     <t>Aggregate at the LSP (Forwarding)</t>
     <t>Aggregating DetNet flows as a new DetNet flow</t>
     <t>Simple Aggregation at the DetNet layer</t>
    </list>
   </t>
   <t>
    The resource control and
    management aspects of aggregation (including the queuing/shaping/
    policing implications) will be covered in other documents.
   </t>
   <t>
    The ability to aggregate individual flows, and their associated
    resource control, into a larger aggregate is an important technique
    for improving scaling of control in the data, management and control
    planes.  The DetNet data plane allows for the aggregation of DetNet flows,
    to improved scaling. There are three methods of introducing flow aggregation:
   </t>
   <t>
     [Editor's note:]
   </t>
   <t>
     The following review comments were received when this section
    was committed to github.
   </t>
   <t>
    General comment: We should points to the major issue of aggregation,
    namely the Seq.Num related problem. The aggregated flows have their
    own Seq.Num and those are independent. We should consider to
    group the aggregation techniques as per their impact on what DetNet
    functions they allow on a DetNet flow. (E.g., aggregation without
    new Aggregate.Seq.Num would prohibit usage of FR, EF and in-order-delivery
    function on the aggregate flow).
   </t>
   <t>
    SR based aggregation can be treated as a form of H-LSP aggregation.
    Should we differentiate them? What are the differences?
   </t>
   <t>
    What are the issues when aggregating of different payload types? Should we
    add an editor note on this?
   </t>
   <t>
    Simple-aggregation-at-the-detnet-layer: is this not the same as H-LSP?
    The A-label can be treated just as an additional F-Label.
   </t>
   <t>
     [Editor's note: End of review comment.]
   </t>
   <section anchor="aggregation-at-the-lsp" title="Aggregation at the LSP">
    <t>
     DetNet flows forwarded via MPLS can leverage MPLS-TE's existing
     support for hierarchical LSPs (H-LSPs), see <xref target="RFC4206"/>.  H-LSPs are
     typically used to aggregate control and resources, they may also be
     used to provide OAM or protection for the aggregated LSPs.  Arbitrary
     levels of aggregation naturally falls out of the definition for
     hierarchy and the MPLS label stack <xref target="RFC3032"/>.  DetNet nodes which
     support aggregation (LSP hierarchy) map one or more LSPs (labels)
     into and from an H-LSP.  Both carried LSPs and H-LSPs may or may not
     use the TC field, i.e., L-LSPs or E-LSPs.  Such nodes will need to
     ensure that traffic from aggregated LSPs are placed (shaped/policed/
     enqueued) onto the H-LSPs in a fashion that ensures the required
     DetNet service is preserved.
    </t>
    <t>
     Additional details of the traffic
     control capabilities needed at a DetNet-aware node may be covered in
     the new service descriptions mentioned above or in separate future
     documents.  Management and control plane mechanisms will also need to
     ensure that the service required on the aggregate flow (H-LSP or
     DSCP) are provided, which may include the discarding or remarking
     mentioned in the previous sections.
    </t>
    </section>
    <section anchor="aggregating-detnet-flows-as-a-new-detnet-flow" title="Aggregating DetNet Flows as a new DetNet flow">
    <t>
     An aggregate can be built by layering DetNet flows as shown below:
    </t>

<figure><artwork><![CDATA[
+---------------------------------+
|                                 |
|           DetNet Flow           |
|         Payload  Packet         |
|                                 |
+---------------------------------+ <--\
|       DetNet Control Word       |    |
+=================================+    |
|            S-Label              |    |
+---------------------------------+    +----DetNet data plane
|       DetNet Control Word       |    |    MPLS encapsulation
+=================================+    |
|            A-Label              |    |
+---------------------------------+    |
|           F-Label(s)            | <--/
+---------------------------------+
|           Data-Link             |
+---------------------------------+
|           Physical              |
+---------------------------------+
]]></artwork></figure>

    <t>
     Both the Aggregation (A) label and the S-Label have their MPLS S bit
     set indicating bottom of stack, and the d-CW allows the PREOF
     to work.
    </t>
    <t>
     It is a property of the A-label that what follows is d-CW followed
     by an S-Label. A relay node processing the A-label would not know
     the underlying payload type. This would only be known to a node
     that was a peer of the node imposing the S-Label. However there
     is no real need for it to know the payload type during aggregation processing.
    </t>
   </section>

   <section anchor="simple-aggregation-at-the-detnet-layer" title="Simple Aggregation at the DetNet Layer">
    <t>
    Another approach would be not to include a d-CW for the aggregated flow.
    This would be functionally similar to aggregation at the forwarding sub-layer
    using H-LSPs, but would confine knowledge of the aggregation to the
    DetNet layer. Such an approach shares the disadvantage that PREOF
    operations would not be possible. OAM operation in this mode is
    for further study.
   </t>

   <figure><artwork><![CDATA[
 +---------------------------------+
 |                                 |
 |           DetNet Flow           |
 |         Payload  Packet         |
 |                                 |
 +---------------------------------+ <--\
 |       DetNet Control Word       |    |
 +=================================+    |
 |            S-Label              |    +----DetNet data plane
 +---------------------------------+    |    MPLS encapsulation
 |            A-Label              |    |
 +---------------------------------+    |
 |           F-Label(s)            | <--/
 +---------------------------------+
 |           Data-Link             |
 +---------------------------------+
 |           Physical              |
 +---------------------------------+
]]></artwork></figure>

  </section>
 </section>

 <section title="Service Sub-Layer Considerations">
    <!-- maybe move this to be under section 5? -->
   <t>
    The edge and relay node internal procedures related to PREOF are implementation specific.  The order
    of a packet elimination or replication is out of scope in this specification.
    <!-- LB: I'm not sure why the following text belongs in this
         document, propose dropping as I think it will just lead to confusion -->
    However, care
    should be taken that the replication function does not actually loopback packets as "replicas".
    Looped back packets include artificial delay when the node that originally initiated the packet
    receives it again. Also, looped back packets may make the network condition to look healthier
    than it actually is (in some cases link failures are not reflected properly because looped back
    packets make the situation appear better than it actually is).
   </t>
   <t>
    It is important that the DetNet layer is configured such that a DetNet node never
    receives its own replicated packets. If it were to receive such packets the replication
    function would make the loop more destructive of bandwidth than a conventional unicast loop.
    Ultimately the TTL in the S-Label will cause the packet to die during a transient, but
    given the sensitivity of applications to packet latency the impact on the  DetNet application
    would be severe.
   </t>

   <section title="Edge Node Processing" anchor="sec_t_pe">
    <t>
     An edge node is resposable for matching ingress packets to the service they require and
     encapsulating them accordingly.An edge node may participate in the packet replication and
     duplication elimination.
    </t>
    <t>
     The DetNet-aware forwarder selects the egress DetNet member flow segment based on the flow identification.
     The mapping of ingress DetNet member flow segment to egress DetNet member flow segment may be
     statically or dynamically configured. Additionally the DetNet-aware
     forwarder does duplicate frame elimination based on the flow identification and
     the sequence number combination. The packet replication is
     also done within the DetNet-aware forwarder. During elimination and the
     replication process the sequence number of the DetNet member flow MUST
     be preserved and copied to the egress DetNet member flow.
    </t>
    <t>
     The internal design of a relay node is out of scope of this document. However
     the reader's attention is drawn to the need to make any PREOF state
     available to the packet processor(s) dealing with packets to which the
     PREOF functions must be applied, and to maintain that state is such as
     way that it is available to the packet processor operation on the next
     packet in the DetNet flow (which may be a duplicate, a late packet, or
     the next packet in sequence.
    </t>
    <t>
      [Editor's note: I think the rest of this section belongs in a new "802.1 TSN
      (island Interconnect) over DetNet MPLS" section.]
    </t>
    <t>
     This may be done in the DetNet layer, or where the native service
     processing (NSP) <xref target="RFC3985"/> is IEEE 802.1CB <xref target="IEEE8021CB"/> capable,
     the packet replication and duplicate elimination MAY entirely be done in the NSP, bypassing
     the DetNet flow encapsulation and logic entirely. This enables operating over unmodified
     implementations and deployments. The NSP approach works only between edge nodes and cannot
     make use of relay nodes.
    </t>
    <t>
     The NSP approach is useful end to end tunnel and for for "island interconnect"
     scenarios. However, when there is a need to do PREOF in a middle of the network,
     such plain edge to edge operation is not sufficient.
    </t>
    <t>
      The extended forwarder MAY copy the sequencing information from the native DetNet packet into
      the DetNet sequence number field and vice versa. If there is no existing sequencing
      information available in the native packet or the forwarder chose not to copy it from the
      native packet, then the extended forwarder MUST maintain a sequence number counter for each
      DetNet flow (indexed by the DetNet flow identification).
    </t>
   </section>


   <section title="Relay Node Processing" anchor="sec_s_pe">
    <t>
     A DetNet Relay node operates in the DetNet forwarding sub-layer . This processing is done within an
     extended forwarder function. Whether an ingress DetNet member flow receives DetNet specific
     processing depends on how the forwarding is programmed.  Some
     relay nodes may be DetNet service aware, while others may be
     unmodified LSRs that only understand how to swicth MPLS-TE LSPs.
     </t>
     <t> It is also possible to
     treat the relay node as a transit node, see <xref target="Aggregation"/>.
     Again, this is
     entirely up to how the forwarding has been programmed.
    </t>
    </section>
   </section>

<section title="Forwarding Sub-Layer Considerations">
  <!-- maybe move this to be under section 5? -->
  <section title="Class of Service" anchor="CoS">
   <t>
     Class and quality of service, i.e., CoS and QoS, are terms that are
     often used interchangeably and confused with each other. In the context of DetNet,
     CoS is used to refer to mechanisms that provide traffic forwarding
     treatment based on aggregate group basis and QoS is used to refer
     to mechanisms that provide traffic forwarding treatment based on a
     specific DetNet flow basis.  Examples of existing network level CoS
     mechanisms include DiffServ which is enabled by IP header
     differentiated services code point (DSCP) field <xref
     target="RFC2474"/> and MPLS label traffic class field <xref
     target="RFC5462"/>, and at Layer-2, by IEEE 802.1p priority code
     point (PCP).
   </t>
   <t>
     CoS for DetNet flows carried in PWs and MPLS is provided using the
     existing MPLS Differentiated Services (DiffServ) architecture <xref
     target="RFC3270"/>.  Both E-LSP and L-LSP MPLS DiffServ modes MAY
     be used to support DetNet flows.  The Traffic Class field (formerly
     the EXP field) of an MPLS label follows the definition of <xref
     target="RFC5462"/> and <xref target="RFC3270"/>.  The Uniform,
     Pipe, and Short Pipe DiffServ tunneling and TTL processing models
     are described in <xref target="RFC3270"/> and <xref
     target="RFC3443"/> and MAY be used for MPLS LSPs supporting DetNet
     flows. MPLS ECN MAY also be used as defined in ECN <xref
     target="RFC5129"/> and updated by <xref target="RFC5462"/>.
  </t>
 </section>

 <section title="Quality of Service" anchor="QoS">
  <t>
   In addition to explicit routes, and packet replication and elimination, described in <xref
   target="dn-dt-solution"/> above, DetNet provides zero congestion loss and bounded latency and
   jitter.  As described in <xref target="I-D.ietf-detnet-architecture"/>, there are different
   mechanisms that maybe used separately or in combination to deliver a zero congestion loss
   service.  This includes Quality of Service (QoS) mechanisms at the MPLS layer, that may be
   combined with the mechanisms defined by the underlying network layer such as 802.1TSN.
  </t>
  <t>
   Quality of Service (QoS) mechanisms for flow specific traffic treatment typically includes a
   guarantee/agreement for the service, and allocation of resources to support the service.
   Example QoS mechanisms include discrete resource allocation, admission control, flow
   identification and isolation, and sometimes path control, traffic protection, shaping, policing
   and remarking. Example protocols that support QoS control include <xref
   target="RFC2205">Resource ReSerVation Protocol (RSVP)</xref> (RSVP) and RSVP-TE <xref
   target="RFC3209"/> and <xref target="RFC3473"/>.  The existing MPLS mechanisms defined to
   support CoS <xref target="RFC3270"/> can also be used to reserve resources for specific traffic
   classes.
  </t>
  <t>
   A baseline set of QoS capabilities for DetNet flows carried in PWs
   and MPLS can provided by MPLS with Traffic Engineering (MPLS-TE)
   <xref target="RFC3209"/> and <xref target="RFC3473"/>.  TE LSPs can
   also support explicit routes (path pinning).  Current service
   definitions for packet TE LSPs can be found in "Specification of
   the Controlled Load Quality of Service", <xref target="RFC2211"/>,
   "Specification of Guaranteed Quality of Service", <xref
   target="RFC2212"/>, and "Ethernet Traffic Parameters", <xref
   target="RFC6003"/>. Additional service definitions are expected in
   future documents to support the full range of DetNet services.
   In all cases, the existing label-based marking mechanisms defined
   for TE-LSPs and even E-LSPs are use to support the identification
   of flows requiring DetNet QoS.
  </t>
 </section>

 <section title="Cross-DetNet Flow Resource Aggregation" anchor="Aggregation">
  <t> [Editor's NOTE: Isn't this section the same as "Aggregation at the
  LSP". -- Address as part of aggregation section cleanup.]
  </t>
   <t>
     The ability to aggregate individual flows, and their associated
     resource control, into a larger aggregate is an important technique
     for improving scaling of control in the data, management and
     control planes.  This document identifies the traffic identification
     related aspects of aggregation of DetNet flows.  The resource
     control and management aspects of aggregation (including the
     queuing/shaping/policing implications) will be covered in other
     documents.  The data plane implications of aggregation are
     independent for PW/MPLS and IP encapsulated DetNet flows.
   </t>
   <t>
     DetNet flows forwarded via MPLS can leverage MPLS-TE's existing
     support for hierarchical LSPs (H-LSPs), see <xref
     target="RFC4206"/>.  H-LSPs are typically used to aggregate control
     and resources, they may also be used to provide OAM or protection
     for the aggregated LSPs.  Arbitrary levels of aggregation naturally
     falls out of the definition for hierarchy and the MPLS label stack
     <xref target="RFC3032"/>.  DetNet nodes which support aggregation
     (LSP hierarchy) map one or more LSPs (labels) into and from an
     H-LSP.  Both carried LSPs and H-LSPs may or may not use the TC
     field, i.e., L-LSPs or E-LSPs.  Such nodes will need to ensure that
     traffic from aggregated LSPs are placed (shaped/policed/enqueued)
     onto the H-LSPs in a fashion that ensures the required DetNet
     service is preserved.
   </t>
   <t>
     [NOTE: This needs to be revised:]

     Additional details of the traffic control
     capabilities needed at a DetNet-aware node may be covered in the
     new service descriptions mentioned above or in separate future
     documents.  Management and control plane mechanisms will also need
     to ensure that the service required on the aggregate flow (H-LSP or
     DSCP) are provided, which may include the  discarding or remarking
     mentioned in the previous sections.
   </t>
 </section>

 <section title="Layer 2 Addressing and QoS Considerations">
  <t> [Editor's NOTE: review and simplify this section. Doesn't this
  belong in the TSN section? Alternatively, describe in generic/non
  sub-network technology specific terms.]
  </t>
    <t>
        The Time-Sensitive Networking (TSN) Task Group of the IEEE 802.1 Working Group have
        defined (and are defining) a number of amendments to <xref target="IEEE8021Q">IEEE 802.1Q</xref>
        that provide zero congestion loss and bounded latency in bridged networks.
        <xref target="IEEE8021CB">IEEE 802.1CB</xref> defines packet replication and elimination
        functions that should prove both compatible with and useful to, DetNet networks.
    </t><t>
        As is the case for DetNet, a Layer 2 network node such as a bridge may need to
        identify the specific DetNet flow to which a packet belongs in order to provide the
        TSN/DetNet QoS for that packet.  It also will likely need a CoS marking, such as the
        priority field of an IEEE Std 802.1Q VLAN tag, to give the packet proper service.
    </t><t>
        Although the flow identification methods described in <xref target="IEEE8021CB">IEEE 802.1CB</xref>
        are flexible, and in fact, include IP 5-tuple identification methods, the baseline
        TSN standards assume that every Ethernet frame belonging to a TSN stream
        (i.e. DetNet flow) carries a multicast destination MAC address that is unique to that
        flow within the bridged network over which it is carried.  Furthermore,
        <xref target="IEEE8021CB">IEEE 802.1CB</xref> describes three methods by which a packet
        sequence number can be encoded in an Ethernet frame.
    </t><t>
        Ensuring that the proper Ethernet VLAN tag priority and destination MAC address
        are used on a DetNet/TSN packet may require further clarification of the customary
        L2/L3 transformations carried out by routers and edge label switches.  Edge nodes
        may also have to move sequence number fields among Layer 2, PW, and IP encapsulations.
    </t>
 </section>

 <section title="Time Synchronization">
  <t>
   [Editor's Note: A detailed discussion of time synchronization is outside the
   scope of this document, and the production of a specialist
   text discussing this topic is encouraged. This section will be
   updated/removed
   if such a document is available before publication of this text.]
  </t>
  <t>
   Time synchronization is important both from the perspective of
   operating the DetNet network itself and from the perspective of
   transferring time across the network between client applications.
   Some clients may be able to use the DetNet as their provider
   of time and frequency, others may require the DetNet to
   transfer time between a client clock source and a client
   clock user.
  </t>
  <t>
   For example, <xref target="RFC8169"/> describes a method of recording
   the packet queuing time in an MPLS LSR on a packet by per packet
   basis and forwarding this information to the egress edge system.
   This allows compensation for any variable packet queuing delay to be
   applied at the packet receiver. Other mechanisms for IP/MPLS networks
   are defined based on IEEE Standard 1588 <xref target="IEEE1588"/>,
   such as ITU-T <xref target="G.8275.1"/> and <xref
   target="G.8275.2"/>.
  </t>
  <t>
   A more detailed discussion of time synchronization is outside
   the scope of this document.
  </t>
 </section>
 </section>
</section>

<!-- ===================================================================== -->

<section title="Controller Plane (Management and Control)
                Considerations" anchor="cp_considerations">
  <t>
    While management plane and control planes are traditionally
    considered separately, from the Data Plane perspective there is no
    practical difference based on the origin of flow provisioning
    information, and the DetNet architecture <xref
    target="I-D.ietf-detnet-architecture"/> refers to these collectively
    as the 'Controller Plane'.  This document therefore does not distinguish between
    information provided by distributed control plane protocols, e.g., RSVP-TE <xref
    target="RFC3209"/> and <xref target="RFC3473"/>, or by centralized network
    management mechanisms, e.g., RestConf <xref target="RFC8040"/>,
    YANG <xref target="RFC7950"/>, and
    the Path Computation Element Communication Protocol (PCEP) <xref
    target="I-D.ietf-pce-pcep-extension-for-pce-controller"/> or any
    combination thereof. Specific considerations and requirements for
    the DetNet Controller Plane are discussed in <xref
    target="control-management-requirements"/>.
 </t>
  <section title="S-Label and F-Label Assignment and Distribution">
   <t>
[Editor's note - we may need additional text on resource allocation in this section.]
   </t>
   <t>
    DetNet S-Labels (see <xref target="flow-identification"/> for their
    definition) are similar to other MPLS service labels that denote the
    contents of the MPLS packet payload such as a layer 2 pseudowire, an IP packet that is
   routed in a VPN context with a private address, or an Ethernet
   virtual private network (EVPN) service.
   </t>
   <t>
     S-Labels are expected to be allocated in the same manner as any other service
     labels. S-Labels uniquely identify a particular DetNet flow, and
     are local to the node on which the label is allocated. In the
     DetNet service sub-layer the explicit route consists of the set of
     Relay Nodes that the DetNet flow must traverse.  They can be used
     to identify the DetNet flow that a packet belongs to as it
     traverses a particular node in a DetNet domain. Because labels are
     local to each node rather than being a global identifier within a
     domain, they must be advertised to their upstream DetNet
     service-aware peer nodes (e.g., a DetNet MPLS End System as shown
     in <xref target="fig_pw_detnet"/>, or a DetNet Relay or Edge Node
     as shown in <xref target="fig_pw_detnet2"/>) and interpreted in the
     context of their received F-Label.
   </t>
   <t>
     As discussed in <xref target="sec_dt_dp"/>, the forwarding sub-layer
     uses one or more F-Labels to forward DetNet packets between
     DetNet service-aware nodes along explicitly defined routes at the
     DetNet forwarding sub-layer, which in the context of this document is
     the MPLS layer.  F-Labels can also provide context for an S-Label.
     In the DetNet Forwarding (MPLS) sub-layer the explicit
     route consists of the set of DetNet nodes which are LSRs, links,
     and possibly link bundle members and queues that the DetNet packets
     of a flow must traverse between nodes in the DetNet service sub-layer
     (i.e. between a specific Edge Node and the next hop Relay Node,
     between specific Relay Nodes, and between a specific Relay node and
     the egress Edge Node. Resource allocation corresponding to the set
     of Services supported over the forwarding sub-layer, which may or may
     not include aggregation, is required at this sub-layer. Explicit
     routes are used to ensure that packets are routed through the
     resources that have been reserved for them, and hence provide the
     DetNet application with the required service.  Multiple F-Labels
     may be pushed after an S-Label and there is no requirement for all
     F-Labels to be controlled via the same controller mechanisms. For
     example in EVPN, some labels are distributed using BGP while others
     are distributed using LDP or RSVP. 
   </t>
   <t>
    Whether configuring, calculating and instantiating these routes is a
    single-stage or multi-stage process, or in a centralized or
    distributed manner, is out of scope of this document.
   </t>
   <t>
    There are a number of approaches that could be used to provide
    explicit routes and resource allocation in the MPLS layer:
    <list style="symbols">
     <t>
      The path could be explicitly set up by a controller which
      calculates the path and
      explicitly configures each node along that path with the
      appropriate forwarding and resource allocation information.
     </t>
     <t>
      The path could be set up using RSVP-TE signaling.
     </t>
     <t>
      The path could be implemented using
      MPLS-based segment routing when extended to support resource
      allocation.
     </t>
    </list>
   See <xref target="control-management-requirements"/> for further discussion of these alternatives.
   </t>
    <t>
    Much like other MPLS labels, there are a number of alternatives available for DetNet S-Label and F-Label advertisement to an upstream peer node. These include distributed signaling protocols such as RSVP-TE, centralized label distribution via a controller that manages both the sender and the
   receiver using NETCONF/YANG, BGP, PCEP, etc., and hybrid combinations of the two.
   The details of
    the controller plane solution required for the label distribution and the management of the
    label number space are out of scope of this document, but as mentioned above, there are particular DetNet considerations and requirements that are discussed in <xref target="control-management-requirements"/>.
   </t>
 </section>
 <section title="Packet Replication, Elimination, and Ordering (PREOF)">
  <t>
   The controller plane protocol solution required for managing the PREOF processing
   is outside the scope of this document. That said, it should be noted
   that the ability to determine, for a particular flow, optimal packet
   replication and elimination points in the DetNet domain requires
   explicit support. There are be capabilities that can be used, or
   extended, for example GMPLS end-to-end recovery <xref target="RFC4872"/> and GMPLS segment recovery <xref target="RFC4873"/>.
  </t>
 </section>
 <section title="Contention Loss and Jitter Reduction">
     <t>
       As discussed in <xref target="sec_intro"/>, this document does
       not specify the mechanisms needed to eliminate contention loss or
       reduce jitter for DetNet flows at the DetNet forwarding sub-layer.
       The ability to manage node and link resources to be able to
       provide these functions will be a necessary part of the DetNet
       controller plane. It will also be necessary to be able to control
       the required queuing mechanisms used to provide these functions
       along a flow's path through the network. See <xref
       target="control-management-requirements"/> for further discussion
       of these requirements.
     </t>
 </section>
 <section title="Bidirectional Traffic">
  <t>
    Some DetNet applications generate bidirectional traffic.  Using MPLS
    definitions <xref target="RFC5654"/> there are associated bidirectional
    flows, and co-routed bidirectional flows.  MPLS defines a point-to-point
    associated bidirectional LSP as consisting of two unidirectional
    point-to-point LSPs, one from A to B and the other from B to A, which are
    regarded as providing a single logical bidirectional forwarding path.  This
    would be analogous of standard IP routing, or PWs running over two
    reciprocal unidirection LSPs.  MPLS defines a point-to-point co-routed
    bidirectional LSP as an associated bidirectional LSP which satisfies the
    additional constraint that its two unidirectional component LSPs follow the
    same path (in terms of both nodes and links) in both directions.  An
    important property of co-routed bidirectional LSPs is that their
    unidirectional component LSPs share fate.  In both types of bidirectional
    LSPs, resource reservations may differ in each direction.  The concepts of
    associated bidirectional flows and co-routed bidirectional flows can be
    applied to DetNet flows.
  </t>
  <t>
    While the MPLS data plane must support bidirectional DetNet flows,
    there are no special bidirectional features with respect to the data plane
    other than the need for the two directions of a co-routed
    bidirectional flow to take the same path.  Fate sharing
    and associated vs co-routed bidirectional flows can be managed at the
    control level.  Note that there is no stated requirement for bidirectional
    DetNet flows to be supported using the same MPLS Labels
    in each direction.
     </t>
     <t>
    DetNet's use of PREOF may increase the complexity of using co-routing bidirectional flows, since if PREOF is used, then the replication points in one direction would have to match the elimination points in the other direction, and vice versa, and the optimal points for these functions in one direction may not match the optimal points in the other.
     </t>
     <t>
    Control and management mechanisms will need to support
    bidirectional flows, but the specification of such mechanisms are out of
    scope of this document. Related control plan mechanisms have been
    defined in <xref target="RFC3473"/>, <xref target="RFC6387"/> and <xref target="RFC7551"/>.
     </t>
     <t>
    This is further discussed in <xref target="control-management-requirements"/>.
  </t>
 </section>
 <section title="Flow Aggregation Control">
     <t>
      <xref target="FAG"/> discusses the use of flow aggregation in DetNet. It includes flow aggregation accomplished through the use of hierarchical LSPs, aggregating multiple DetNet flows into a single new DetNet flow, and simple aggregation at the DetNet layer. It will be the responsibility of the DetNet controller plane to be able to properly provision the use of these mechanisms. These requirements are included in the next section.
     </t>
 </section>
 <section anchor="control-management-requirements" title="DetNet
                                                          Controller (Control and Management) Plane Requirements">
     <t>
         While the definition of controller plane for DetNet is out of the scope of this document, there are particular considerations and requirements for such that result from the unique characteristics of the DetNet architecture <xref target="I-D.ietf-detnet-architecture"/> and data plane as defined herein.
     </t>
     <t>
         The primary requirements of the DetNet controller plane are that it must be able to:
        <list style="symbols">
   <t>Instantiate DetNet flows in a DetNet domain (which may include some or all of explicit path and PREOF replication and elimination node determination, link bandwidth reservations, node buffer and other resource reservations, specification of required queuing disciplines along the path, ability to manage bidirectional flows, etc.) as needed for a flow.</t>
   <t>Manage DetNet S-Label and F-Label allocation and distribution, when the DetNet MPLS encapsulation is in use</t>
   <t>The ability to support DetNet flow aggregation</t>
   <t>Advertise static and dynamic node and link resources such as capabilities and adjacencies to other network nodes (for dynamic signaling approaches) or to network controllers (for centralized approaches)</t>
   <t>Scale to handle the number of DetNet flows expected in a domain (which may require per-flow signaling or provisioning)</t>
   <t>Provision flow identification information at each of the nodes along the path, and it may differ depending on the location in the network and the DetNet functionality (e.g. transit node vs. relay node).</t>
  </list> </t>
  <t>
  These requirements, as stated earlier, could be satisfied using distributed control protocol signaling (such as RSVP-TE), centralized network management provisioning mechanisms (such as BGP, PCEP, YANG <xref target="I-D.ietf-detnet-flow-information-model"/>, etc.) or hybrid combinations of the two, and could also make use of MPLS-based segment routing.
  </t>
  <t>
  In the abstract, the results of either distributed signaling or centralized provisioning are equivalent from a DetNet data plane perspective - flows are instantiated, explicit routes are determined, resources are reserved, and packets are forwarded through the domain using the MPLS data plane.
  </t>
  <t>
  However, from a practical and implementation standpoint, they are not equivalent at all. Some approaches are more scalable than others in terms of signaling load on the network. Some can take advantage of global tracking of resources in the DetNet domain for better overall network resource optimization. Some are more resilient than others if link, node, or management equipment failures occur. While a detailed analysis of the control plane alternatives is out of the scope of this document, the requirements from this document can be used as the basis of a later analysis of the alternatives.
    </t>
 </section>
</section>


<!-- ===================================================================== -->

<section anchor="mpls-over-tsn"
         title="DetNet MPLS Operation Over IEEE 802.1 TSN Sub-Networks">
  <t>
  [Editor's note: this is a place holder section.  A standalone section on MPLS over IEEE
  802.1 TSN.  Includes RFC2119 Language.]
  </t>

      <t>
      This section covers how DetNet MPLS flows operate over an IEEE 802.1 TSN sub-network.
      <xref target="fig_mpls_detnet_to_tsn"/> illustrates such a scenario, where two MPLS (DetNet)
	  nodes are interconnected by a TSN sub-network. Node-1 is single homed and Node-2 is dual-homed.
	  MPLS nodes can be (1) DetNet MPLS End System, (2) DetNet MPLS Edge or Relay node or (3) MPLS Transit node.
      </t>
      <t>
	  Note: in case of MPLS Transit node there is no DetNet Service sub-layer processing.</t>

<figure align="center" anchor="fig_mpls_detnet_to_tsn"
              title="DetNet Enabled MPLS Network Over a TSN Sub-Network">
<artwork><![CDATA[
   MPLS (DetNet)                 MPLS (DetNet)
      Node-1                        Node-2

   +----------+                  +----------+
<--| Service* |-- DetNet flow ---| Service* |-->
   +----------+                  +----------+
   |Forwarding|                  |Forwarding|
   +--------.-+    <-TSN Str->   +-.-----.--+
             \      ,-------.     /     /
              +----[ TSN-Sub ]---+     /
                   [ Network ]--------+
                    `-------'
<---------------- DetNet MPLS --------------->

Note: * no service sub-layer required for transit nodes
]]></artwork>
      </figure>

		<t>
          The Time-Sensitive Networking (TSN) Task Group of the IEEE 802.1 Working Group have
          defined (and are defining) a number of amendments to <xref target="IEEE8021Q">IEEE 802.1Q</xref>
          that provide zero congestion loss and bounded latency in bridged networks. Furthermore
          <xref target="IEEE8021CB">IEEE 802.1CB</xref> defines frame replication and elimination
          functions for reliability that should prove both compatible with and useful to, DetNet networks.
		  All these functions have to identify flows those require TSN treatment.
          </t><t>
          As is the case for DetNet, a Layer 2 network node such as a bridge may need to
          identify the specific DetNet flow to which a packet belongs in order to provide the
          TSN/DetNet QoS for that packet.  It also may need a CoS marking, such as the
          priority field of an IEEE Std 802.1Q VLAN tag, to give the packet proper service.
          </t>
		<t>
		The challange for MPLS DeNet flows is that the protocol interworking function defined in
		<xref target="IEEE8021CB">IEEE 802.1CB</xref> works only for IP flows. The aim of the protocol
		interworking function is to convert an ingress flow to use a specific multicast destination
		MAC address and VLAN, for example to direct the packets through a specific path inside the bridged
		network. A similar interworking pair at the other end of the TSN sub-network would restore the
		packet to its original destination MAC address and VLAN.
		</t>
		<t>
		As protocol interworking function defined in <xref target="IEEE8021CB"></xref> does not
		work for MPLS labeled flows, the DetNet MPLS nodes MUST ensure proper TSN sub-network specific
		Ethernet encapsulation of the DetNet MPLS packets. For a given TSN Stream (i.e., DetNet flow)
		an MPLS (DetNet) node MUST behave as a TSN-aware Talker or a Listener inside the TSN sub-network.
        </t>

      <section title="Mapping of TSN Stream ID and Sequence Number">
		<t>
		TSN capable MPLS (DetNet) nodes are TSN-aware Talker/Listener as shown in
		<xref target="fig_mpls_with_tsn"/>.
		MPLS (DetNet) node MUST provide the TSN sub-network specific Ethernet encapsulation over the link(s)
		towards the sub-network. An TSN-aware MPLS (DetNet) node MUST support the following TSN components:

        <list style="numbers">
          <t>For recognizing flows:
			<list style="symbols">
			<t>Stream Identification (MPLS-flow-aware)</t>
			</list>
		  </t>
          <t>For FRER used inside the TSN domain, additonaly:
			<list style="symbols">
			<t>Sequencing function (MPLS-flow-aware)</t>
			<t>Sequence encode/decode function</t>
			</list>
		  </t>
          <t>For FRER when the node is a TSN replication or elimination point, additionally:
			<list style="symbols">
			<t>Stream splitting function</t>
			<t>Individual recovery function</t>
			</list>
		  </t>
        </list>
        </t>

        <t>
          [Editor's note: Should we added here requirements regarding IEEE 802.1Q C-VLAN component?]
        </t>

        <t>
          The Stream Identification and The Sequencing functions are slightly modified for frames passed
		  down the protocol stack from the upper layers.
        </t>
        <!-- LB: this isn't specific enough for me to understand what is to
             be done -->
		<t>
		  Stream Identification MUST pair MPLS flows and TSN Streams and encode that in data plane formats as well.
		  The packet's stream_handle subparameter (see <xref target="IEEE8021CB">IEEE 802.1CB</xref>) inside the Talker/Listener
		  is defined based on the Flow-ID used in the upper DetNet MPLS layer.
		  Stream Identification function MUST encode Ethernet header fields namely (1) the destination MAC-address,
		  (2) the VLAN-ID and (3) priority parameters with TSN sub-network specific values. Encoding is provided
		  for the frame passed down the stack from the upper layers.
        </t>
		<t>
		  The sequence generation function resides in the Sequencing function. It generates a sequence_number subparameter
		  for each packet of a Stream passed down to the lower layers.
		  Sequencing function MUST copy sequence information from the MPLS d-CW of the packet to the sequence_number subparameter for the
		  frame passed down the stack from the upper layers.
		</t>

<figure align="center" anchor="fig_mpls_with_tsn"
              title="MPLS (DetNet) Node with TSN Functions">
<artwork><![CDATA[
   MPLS (DetNet)
      Node-1
   <---------->

   +----------+
<--| Service  |-- DetNet flow ------------------
   +----------+
   |Forwarding|
   +----------+    +---------------+
   | L2 with  |<---| L2 Relay with |---- TSN ----
   |   TSN    |    | TSN function  |    Stream
   +-----.----+    +--.---------.--+
          \__________/           \______

    TSN-aware
     Talker /          TSN-Bridge
     Listener             Relay

         <--------- TSN sub-network ------------
]]></artwork>
      </figure>


        <t>
		The Sequence encode/decode function MUST support the Redundancy tag (R-TAG) format as per Clause 7.8 of
		<xref target="IEEE8021CB">IEEE 802.1CB</xref>.
        </t>
      </section>
      <section title="TSN Usage of FRER">
        <t>
          TSN Streams supporting DetNet flows may use Frame
          Replication and Elimination for Redundancy (FRER) [802.1CB] based on
          the loss service requirements of the TSN Stream, which is derived from
          the DetNet service requirements of the DetNet mapped flow.  The
          specific operation of FRER is not modified by the use of DetNet and
          follows  <xref target="IEEE8021CB">IEEE 802.1CB</xref>.
        </t>
        <t>
          FRER function and the provided service recovery is available only within the TSN
		  sub-network however as the Stream-ID and the TSN sequence number are paired with the MPLS flow
		  parameters they can be combined with PREOF functions.
		</t>
      </section>
      <section title="Management and Control Implications">
        <t>
          [Editor's note: This section is TBD
          Covers Creation, mapping, removal of TSN Stream IDs, related
          parameters and,when needed, configuration of FRER. Supported
          by management/control plane.]
        </t>
      </section>

  </section>

<!-- ===================================================================== -->

<section anchor="mpls-over-ip" title="DetNet MPLS Operation over DetNet
                                      IP PSNs">
 <t>
  This section specifies the DetNet encapsulation over an IP network.
  The approach is modeled on the operation of MPLS and PseudoWires (PW) over
  an IP Packet Switched Network (PSN) <xref target="RFC3985"/><xref target="RFC4385"/><xref target="RFC7510"/>.
  It maps the MPLS data plane encapsulation described in <xref
  target="pwSolution"/> to the DetNet IP data plane define in <xref
  target="I-D.ietf-detnet-dp-sol-ip"/>.
 </t>
 <t>
  To carry DetNet with full functionality at the DetNet layer over an IP network, the
  following components are required (these are a subset of the requirements for MPLS encapsulation
  listed in <xref target="dn-MPLS-en-comps"/>):
  </t>
  <t>
   <list style="numbers">
    <t>A method of identifying the DetNet flow group to the processing element.</t>
    <t>A method of carrying the DetNet sequence number.</t>
    <t>A method of distinguishing DetNet OAM packets from DetNet data packets.</t>
    <t>A method of carrying queuing and forwarding indication.</t>
   </list>
  </t>
 <t>
  These requirements are satisfied by the DetNet over MPLS Encapsulation
  described in <xref target="pwSolution"/>.
 </t>
 <t>
  This document builds on the 
  the specification of MPLS over UDP and IP defined in <xref
  target="RFC7510"/>.  It replaces the 
  the F-Label(s) used in <xref target="pwSolution"/>
  with UDP and IP headers.  The UDP and IP header information is used to
  identify DetNet flows, including member flows, per <xref
  target="I-D.ietf-detnet-dp-sol-ip"/>. The resulting encapsulation is
  shown in  <xref target="IP-encap-dn"/>.
 </t>

 <t>
   Note that this encapsulation works equally well with IPv4 and IPv6.
 </t>
 
 <figure title="IP Encapsulation of DetNet MPLS" anchor="IP-encap-dn">
 <artwork align="center"><![CDATA[
+---------------------------------+
|                                 |
|         DetNet App-Flow         |
|         Payload  Packet         |
|                                 |
+---------------------------------+ <--\
|       DetNet Control Word       |    |
+---------------------------------+    +--> DetNet data plane
|             S-Label             |    |    MPLS encapsulation
+---------------------------------+ <--X.
|           UDP Header            |    |
+---------------------------------+    +--> DetNet data plane
|           IP Header             |    |    IP encapsulation
+---------------------------------+ <--/
|           Data-Link             |
+---------------------------------+
|           Physical              |
+---------------------------------+
]]>
 </artwork></figure>

  <t>
    d-CW and and S-Labels are used as defined in <xref
    target="pwSolution"/> and are not modified by this section.
  </t>
  <t>
    To support outgoing DetNet MPLS over IP, an implementation MUST support the
    provisioning of IP/UDP header information in place of sets of
    F-Labels.  Note that multiple sets of F-Labels can be provisioned to
    support PRF on transmitted DetNet flows and therefore, when PRF is
    supported, multiple IP/UDP headers MAY be provisioned. When multiple
    IP/UDP headers are provisioned for a particular outgoing app-flow, a
    copy of the outgoing packet, including the pushed S-Label, MUST be
    made for each. The headers for each outgoing packet MUST be based on
    the configuration information and as defined in <xref
    target="RFC7510"/>, with one exception.  The one exceptions is that
    the UDP Source Port value MUST be set to uniquely identify the
    DetNet (forwarding sub-layer) flow.  The packet MUST then be handed
    as a DetNet IP packet, per <xref target="I-D.ietf-detnet-dp-sol-ip"/>.
  </t>

  <t>
    To support receive processing an implementation MUST also support
    the provisioning of received IP/UDP header information.  When
    S-Labels are taken from platform label space, all that is required
    is to provision that receiving IP/UDP encapsulated DetNet MPLS
    packets is permitted.  Once the IP/UDP header is stripped, the
    S-label uniquely identifies the app-flow.  When S-Labels are not
    taken from platform label space, IP/UDP header information MUST be
    provisioned.  The provisioned information MUST then be used to
    identify incoming app-flows based on the combination of S-Label and
    incoming IP/UDP header.  Normal receive processing, including PEOF
    can then take place.
  </t>
    
 <!-- LB: I thought we agreed to pick one MPLS over IP encap.
      Also SR support can fall out of DetNet IP SR support once defined -->

</section>

<!-- ===================================================================== -->


<section title="Security Considerations">
  <t>
   The security considerations of DetNet in general are discussed in
   <xref target="I-D.ietf-detnet-architecture"/>
   and <xref target="I-D.sdt-detnet-security"/>. Other security
   considerations will be added in a future version of
   this draft.
  </t>
</section>


<section anchor="iana" title="IANA Considerations">
  <t>
   This document makes no IANA requests.
  </t>
</section>

<section anchor="Contributors" title="Contributors">
 <t>RFC7322 limits the number of authors listed on the front page of a draft to a maximum of 5,
  far fewer than the many individuals below who made important contributions to this draft. The
  editor wishes to thank and acknowledge each of the following authors for contributing text to
  this draft. See also <xref target="acks"/>.
 </t>
 <figure> <artwork><![CDATA[
   Loa Andersson
   Huawei
   Email: loa@pi.nu

   Yuanlong Jiang
   Huawei
   Email: jiangyuanlong@huawei.com

   Norman Finn
   Huawei
   3101 Rio Way
   Spring Valley, CA  91977
   USA
   Email: norman.finn@mail01.huawei.com

   Janos Farkas
   Ericsson
   Magyar Tudosok krt. 11.
   Budapest  1117
   Hungary
   Email: janos.farkas@ericsson.com

   Carlos J. Bernardos
   Universidad Carlos III de Madrid
   Av. Universidad, 30
   Leganes, Madrid  28911
   Spain
   Email: cjbc@it.uc3m.es

   Tal Mizrahi
   Marvell
   6 Hamada st.
   Yokneam
   Israel
   Email: talmi@marvell.com

   Lou Berger
   LabN Consulting, L.L.C.
   Email: lberger@labn.net

   Stewart Bryant
   Huawei Technologies
   Email: stewart.bryant@gmail.com

   Mach Chen
   Huawei Technologies
   Email: mach.chen@huawei.com

   Andrew G. Malis
   Huawei Technologies
   Email: agmalis@gmail.com
   ]]></artwork>
 </figure>

</section>


<section anchor="acks" title="Acknowledgements">
  <t>The author(s) ACK and NACK.
  </t>
  <t> The following people were part of the DetNet Data Plane Solution Design Team:
  <list style="bullets">
   <t>Jouni Korhonen</t>
   <t>J&aacute;nos Farkas</t>
   <t>Norman Finn</t>
   <t>Bal&aacute;zs Varga</t>
   <t>Loa Andersson</t>
   <t>Tal Mizrahi</t>
   <t>David Mozes</t>
   <t>Yuanlong Jiang</t>
   <t>Andrew Malis</t>
   <t>Carlos J. Bernardos</t>
  </list></t>
  <t>
   The DetNet chairs serving during the DetNet Data Plane Solution Design Team:
   <list style="bullets">
    <t>Lou Berger</t>
    <t>Pat Thaler</t>
   </list></t>
   <t>
    Thanks for Stewart Bryant for his extensive review of the previous
    versions of the document.
   </t>
</section>
</middle>

<back>
  <references title="Normative References">
   &rfc2119;
   <?rfc include="reference.RFC.2211"?>
   <?rfc include="reference.RFC.2212"?>
   <?rfc include="reference.RFC.3031"?>
   <?rfc include="reference.RFC.3032"?>
   <?rfc include="reference.RFC.3209"?>
   <?rfc include="reference.RFC.3270"?>
   <?rfc include="reference.RFC.3443"?>
   <?rfc include="reference.RFC.3473"?>
   <?rfc include="reference.RFC.4206"?>
   <?rfc include="reference.RFC.5129"?>
   <?rfc include="reference.RFC.5085"?>
   <?rfc include="reference.RFC.5462"?>
   &rfc4385;
   &rfc7510;
   <?rfc include="reference.RFC.8174"?>
  </references>
  <references title="Informative References">
   <?rfc include="reference.RFC.2205"?>
   <?rfc include="reference.RFC.2474"?>
   <?rfc include="reference.RFC.3272"?>
   &rfc3985;
   &rfc4448;
   &rfc4872;
   &rfc4873;
   <?rfc include="reference.RFC.4875"?>
   <?rfc include="reference.RFC.5440"?>
   <?rfc include="reference.RFC.5586"?>
   <?rfc include="reference.RFC.5654"?>
   <?rfc include="reference.RFC.5921"?>
   <?rfc include="reference.RFC.6073"?>
   <?rfc include="reference.RFC.6003"?>
   <?rfc include="reference.RFC.6006"?>
  &rfc6387;
    <?rfc include="reference.RFC.6790"?>
   <?rfc include="reference.RFC.7950"?>
   <?rfc include="reference.RFC.7551"?>
   <?rfc include="reference.RFC.8040"?>
   &I-D.ietf-pce-pcep-extension-for-pce-controller;
&I-D.ietf-detnet-architecture;
&I-D.ietf-detnet-flow-information-model;
   &I-D.ietf-spring-segment-routing-mpls;
   <reference anchor='I-D.ietf-detnet-dp-sol-ip'>
     <front>
       <title>DetNet IP Data Plane Encapsulation
       </title>
       <author>
         <organization>Korhonen, J., Varga, B.</organization>
       </author>
       <date year='2018' />
     </front>
   </reference>
   &rfc8169;

   <reference anchor='I-D.sdt-detnet-security'>
    <front>
     <title>Deterministic Networking (DetNet) Security Considerations,
		draft-sdt-detnet-security, work in progress
     </title>
     <author>
      <organization>Mizrahi, T., Grossman, E., Hacker, A., Das, S.</organization>
     </author>
     <date year='2017' />
    </front>
   </reference>

   <reference anchor='IEEE1588'>
     <front>
       <title>IEEE 1588 Standard for a Precision Clock Synchronization
       Protocol for Networked Measurement and Control Systems Version 2
       </title>
       <author>
         <organization>IEEE</organization>
       </author>
       <date year='2008' />
     </front>
   </reference>

   <reference anchor="IEEE8021Q"
     target="http://standards.ieee.org/about/get/">
    <front>
     <title>Standard for Local and metropolitan area networks--Bridges and Bridged Networks (IEEE Std 802.1Q-2014)</title>
     <author>
      <organization>IEEE 802.1</organization>
     </author>
     <date year="2014"/>
    </front>
    <format type="PDF" target="http://standards.ieee.org/about/get/"/>
   </reference>

   <reference anchor="IEEE8021CB"
    target="http://www.ieee802.org/1/files/private/cb-drafts/d2/802-1CB-d2-1.pdf">
    <front>
        <title>Draft Standard for Local and metropolitan area networks - Seamless Redundancy</title>
        <author initials="N. F." surname="Finn" fullname="Norman Finn">
            <organization>IEEE 802.1</organization>
        </author>
        <date month="December" year="2015"/>
    </front>
    <seriesInfo name="IEEE P802.1CB /D2.1" value="P802.1CB"/>
    <format type="PDF" target="http://www.ieee802.org/1/files/private/cb-drafts/d2/802-1CB-d2-1.pdf"/>
   </reference>

   <reference anchor="G.8275.1"
              target="https://www.itu.int/rec/T-REC-G.8275.1/en">
     <front>
       <title>Precision time protocol telecom profile for phase/time synchronization with full timing support from the network</title>
       <author>
         <organization>International Telecommunication Union</organization>
       </author>
       <date month="June" year="2016"/>
     </front>
     <seriesInfo name="ITU-T G.8275.1/Y.1369.1" value="G.8275.1"/>
   </reference>

   <reference anchor="G.8275.2"
              target="https://www.itu.int/rec/T-REC-G.8275.2/en">
     <front>
       <title>Precision time protocol telecom profile for phase/time synchronization with partial timing support from the network</title>
       <author>
         <organization>International Telecommunication Union</organization>
       </author>
       <date month="June" year="2016"/>
     </front>
     <seriesInfo name="ITU-T G.8275.2/Y.1369.2" value="G.8275.2"/>
   </reference>

  </references>
 <section title="Example of DetNet Data Plane Operation" anchor="sec_comb">
  <t>
   [Editor's note: Add a simplified example of DetNet data plane and how labels etc
   work in the case of MPLS-based PSN and utilizing PREOF. The figure is subject
   to change depending on the further DT decisions on the label handling..]
  </t>
 </section>

 </back>
</rfc>
