<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="3"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<rfc category="std" docName="draft-li-spring-tunnel-segment-02"
     ipr="trust200902">
  <front>
    <title abbrev="Tunnel Segment in SR">Tunnel Segment in Segment
    Routing</title>

    <author fullname="Zhenbin Li" initials="Z." surname="Li">
      <organization>Huawei</organization>

      <address>
        <postal>
          <street>Huawei Bld., No.156 Beiqing Rd.</street>

          <city>Beijing</city>

          <code>100095</code>

          <country>China</country>
        </postal>

        <email>lizhenbin@huawei.com</email>
      </address>
    </author>

    <author fullname="Cheng Li" initials="C." surname="Li">
      <organization>Huawei</organization>

      <address>
        <postal>
          <street>Huawei Campus, No. 156 Beiqing Rd.</street>

          <city>Beijing</city>

          <region/>

          <code>100095</code>

          <country>China</country>
        </postal>

        <phone/>

        <facsimile/>

        <email>c.l@huawei.com</email>

        <uri/>
      </address>
    </author>

    <author fullname="Nan Wu" initials="N." surname="Wu">
      <organization>Huawei</organization>

      <address>
        <postal>
          <street>Huawei Bld., No.156 Beiqing Rd.</street>

          <city>Beijing</city>

          <code>100095</code>

          <country>China</country>
        </postal>

        <email>eric.wu@huawei.com</email>
      </address>
    </author>

    <date day="14" month="April" year="2021"/>

    <abstract>
      <t>This document introduces a new type of segment, Tunnel Segment, for
      the segment routing (SR). Tunnel segment can be used to reduce SID stack
      depth of SR path, span the non-SR domain or provide differentiated
      services. </t>

      <t>Forwarding mechanisms and requirements of control plane and data
      models for tunnel segments are also defined.</t>
    </abstract>

    <note title="Requirements Language">
      <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
      "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
      document are to be interpreted as described in <xref
      target="RFC2119">RFC 2119</xref>.</t>
    </note>
  </front>

  <middle>
    <section title="Introduction">
      <t>Segment Routing (SR), introduced by <xref target="RFC8402"/>,
      leverages the source routing paradigm. A packet can be steered through
      an ordered list of instructions, which are also called segments. The
      node segment, adjacency segment, etc. have been proposed for different
      usecases. </t>

      <t>This document introduces a new type of segment, Tunnel Segment, for
      the segment routing. Tunnel segment can be used to reduce SID stack
      depth of SR path, span the non-SR domain or provide differentiated
      services. Forwarding mechanisms and requirements of control plane and
      data models for tunnel segments are also defined.</t>

      <t/>
    </section>

    <section title="Terminology">
      <t><list style="symbols">
          <t>SID: Segment ID</t>

          <t>SR: Segment Routing</t>

          <t>SR Path: Segment Routing Path</t>

          <t>SR-TE Path: Segment Routing Traffic Engineering Path</t>

          <t>MSD: Maximally SID Depth</t>
        </list>The terms "Tunnel Segment" and "Tunnel SID" are the generic
      names for a segment attached to a specific tunnel. A tunnel segment can
      be used to steer traffic into the corresponding tunnel along the SR
      path.</t>

      <t/>
    </section>

    <section title="Usecases">
      <t/>

      <section title="Reducing SID Stack Depth">
        <t>It is possible that a SR path has to take an explicit path with
        multiple hops instead of the shortest path for the purpose of traffic
        engineering. As a result, the ingress node has to push lots of
        segments to steer the packet, which could be a challenge for the
        forwarding plane, since the depth of this segment stack may be beyond
        the capability of their forwarding engines. The tunnel segment
        introduced in this document will be helpful to mitigate the pain in
        these scenarios.</t>

        <t>Taking Figure 1 below as an example, the SR-TE path is created from
        SR-Node-1(ingress) to SR-Node-2(egress). The original SID stack, {A,
        B, X, E, F, G, H, Y, J, K}, is too overwhelming for the path MSD. With
        help of the tunnel segment, the tunnel from Gateway-Node-1 to
        Gateway-Node-2 can be represented by a dedicated SID, saying Z. So the
        SR-TE path can be represented as {A, B, X, Z, J, K}. Comparing with
        the original SR-TE path, the SID stack depth is reduced.</t>

        <t>The SR-TE tunnel can be created through two ways: <list
            style="numbers">
            <t>Manually configure on ingress node (Gateway-Node-1) and
            designate the SID binding to it. This binding relationship needs
            to be propagated to PCE/controller or advertised to other nodes in
            the network.</t>

            <t>With the knowledge of all MSD along the path, a PCE/controller
            can calculate SR-TE tunnels using for reduce SID stack depth and
            determine ingress/egress gateway nodes dynamically. Those SR-TE
            tunnels can be created through PCE initiated style. The
            corresponding tunnel segment and the binding relationship can be
            propagated to ingress nodes and other nodes if necessary. As shown
            in Figure 1, ingress (SR-Node-1) can receive update messages from
            PCE/controller about the binding relationship. And SR-Node-1 can
            calculate the SR-TE path with the SR-TE tunnel segment without the
            help of PCE/controller in a centralized manner.</t>
          </list></t>

        <t/>

        <figure>
          <artwork><![CDATA[
  SID stack       +------------+
{A, B, X, Z, J, K}|    PCE/    |
   +--------------| Controller |
   |              +------------+
   |                 ^ Tunnel Binding
   |                 | SID (Z)
   |                 |          .-----.
   |                 |         (       )
   V                 V     .--(         )--.
+------+       +-------+  (                 )  +-------+        +------+
|  SR  |_(...)_|Gateway|_(     SR Network    )_|Gateway|_(...)_ |  SR  |
|Node 1| (...) |Node-1 | ( ================> ) |Node-2 | (...)  |Node 2|
+------+       +-------+  (   SR-TE Tunnel  )  +-------+        +------+
                           '--(         )--'
                               (       )
                                '-----'

         {A,B}    {X}         {E, F, G, H}        {Y}    {J,K}

             Figure 1 Usecase for Reducing SID Stack Depth



]]></artwork>
        </figure>
      </section>

      <section title="Passing through Non-SR Domain">
        <t>The tunnel segment can also be used in those scenarios that traffic
        has to pass through non-SR domains. In another word, tunnel segment
        can be used to connect SR islands.</t>

        <t>As shown in Figure 2, traffic from SR-Node-1 to SR-Node-2 has to
        pass through a traditional IP/MPLS network. Usually a RSVP-TE tunnel
        or IP tunnel will be created between two gateway nodes. By allocating
        SID for this tunnel, saying Z, the SR path from SR-Node-1 to SR-Node-2
        can be represented as {A, B, X, Z, J, K}.</t>

        <t>In this scenario, the RSVP-TE tunnel or IP tunnel can be involved
        into SR networks through two ways:<list style="numbers">
            <t>Manually configure on ingress node (Gateway-Node-1) and
            designate the SID binding to it. This binding relationship needs
            to be propagated to PCE/controller or advertised to other nodes in
            the network.</t>

            <t>With the knowledge of topology of non-SR domain, a
            PCE/controller can calculate RSVP-TE tunnels or IP tunnels and
            determine ingress/egress gateway nodes dynamically. Those RSVP-TE
            tunnels or IP tunnels can be created through PCE initiated style.
            The corresponding tunnel segment and the binding relationship can
            be propagated to ingress nodes and other nodes if necessary. As
            shown in Figure 2, ingress (SR-Node-1) can receive update messages
            from PCE/controller about the binding relationship. And SR-Node-1
            can calculate the SR-TE path which can pass through non-SR domain
            without the help of PCE/controller in a centralized manner.</t>
          </list></t>

        <t/>

        <figure>
          <artwork><![CDATA[
  SID stack       +------------+
{A, B, X, Z, J, K}|    PCE/    |
   +--------------| Controller |
   |              +------------+
   |                 ^ Tunnel Binding
   |                 | SID (Z)
   |                 |          .-----.
   |                 |         (       )
   V                 V     .--(         )--.
+------+       +-------+  (                 )  +-------+        +------+
|  SR  |_(...)_|Gateway|_(  IP/MPLS Network  )_|Gateway|_(...)_ |  SR  |
|Node 1| (...) |Node-1 | ( ================> ) |Node-2 | (...)  |Node 2|
+------+       +-------+  (MPLS TE/IP Tunnel)  +-------+        +------+
                           '--(         )--'
                               (       )
                                '-----'

         {A,B}    {X}         {E, F, G, H}        {Y}    {J,K}

        Figure 2 Usecase for Passing through Non-SR Domain

]]></artwork>
        </figure>
      </section>

      <section title="Differentiated Services">
        <t>It is necessary to create multiple tunnels between the same pair of
        gateway nodes to support different services, since different tunnels
        can have different attributes. As a result, different SIDs have to be
        assigned per tunnel. Then an End-to-End SR path can choose different
        SIDs at ingress according to the service requirement when passing
        through the network between gateway nodes.</t>

        <t>As depicted in Figure 3, two RSVP-TE tunnels, say RSVP-TE-tunnel1
        and RSVP-TE-tunnel2, are created in MPLS network to provide different
        bandwidth guarantee services. And two SIDs, Z1 and Z2, are allocated
        and mapped to these two tunnels separately. These two SIDs can be
        utilized by a PCE/controller when defining the SR path at ingress.
        Since different traffic will transport through different tunnels,
        differentiated services can be guaranteed.</t>

        <t><figure>
            <artwork><![CDATA[
  SID stack
{A, B, X, Z1, J, K}+------------+
{A, B, X, Z2, J, K}|    PCE/    |
   +---------------| Controller |
   |               +------------+
   |                 ^ Tunnel Binding
   |                 | SID (Z)
   |                 |          .-----.
   |                 |         (       )
   V                 V     .--(         )--.
+------+       +-------+  (MPLS TE Tunnel 1 )  +-------+        +------+
|  SR  |_(...)_|Gateway|_( ================> )_|Gateway|_(...)_ |  SR  |
|Node 1| (...) |Node-1 | ( ================> ) |Node-2 | (...)  |Node 2|
+------+       +-------+  (MPLS TE Tunnel 2 )  +-------+        +------+
                           '--(         )--'
                               (       )
                                '-----'

         {A,B}    {X}         {E, F, G, H}        {Y}    {J,K}

        Figure 3 Usecase for Differentiated Services

]]></artwork>
          </figure></t>
      </section>
    </section>

    <section title="Comparison with Agency Segment">
      <t>As described in <xref target="RFC8402"/>, a tunnel can be represented
      by an Adj-SID or as a Forwarding Adjacency. One obvious benefit of the
      method is to unify the process. But it may be necessary to differentiate
      a tunnel segment from other adjacency segment in some scenarios since
      there are more attributes attached to a tunnel.</t>

      <t>By introducing the tunnel segment, this document expects not only to
      inform the binding relationship between a tunnel and a SID but also to
      learn tunnel information as much as possible. For example, it will be
      helpful for SR-capable nodes to know the detail of an explicit path that
      passes through non-SR networks.</t>

      <t>In addition, one tunnel will need an IP address if handled as an
      adjacency (a borrowed IP address at least). While a tunnel binding to a
      Tunnel-SID does not have to contain an IP address, only an ingress node
      and an egress node is enough.</t>

      <t/>
    </section>

    <section title="Forwarding Mechanisms">
      <t>In the gateway node, when received the packet with the tunnel segment
      SID as the topmost SID, it will use the forwarding mechanism shown in
      the following figure to steering the traffic to the corresponding
      tunnel.</t>

      <t><figure align="left">
          <artwork><![CDATA[+--------+    +------------------------+
|   SID  |--->| Tunnel Forwarding Info |
+--------+    +------------------------+

  SID: Segment ID

Figure 4 Forwarding Mechanisms for Tunnel Segment
]]></artwork>
        </figure></t>

      <t/>
    </section>

    <section title="Requirement of Control Plane and Yang Models">
      <t>According to the procedures of the above usecases, following
      requirements of control plane and Yang models for Tunnel Segment are
      proposed:</t>

      <t><list style="symbols">
          <t>REQ 01: IGP extensions SHOULD be introduced to advertise the
          binding relationship between a SID/label and the corresponding
          tunnel. Attributes of the tunnel MAY be carried optionally. </t>

          <t>REQ 02: BGP Link-State extension SHOULD be introduced to
          advertise the binding relationship between a label and the
          corresponding tunnel. Attributes of the tunnel MAY be carried
          optionally. </t>

          <t>REQ 03: PCEP extensions SHOULD be introduced to advertise the
          binding relationship between a SID/label and the corresponding
          tunnel from a PCC to a PCE. Attributes of the tunnel MAY be carried
          optionally.</t>

          <t>REQ 04: PCE SHOULD support initiated IP tunnel.</t>

          <t>REQ 05: PCE SHOULD support to allocate SID/label for the
          corresponding tunnel dynamically.</t>

          <t>REQ 06: PCEP extensions SHOULD be introduced to distribute the
          binding relationship between a SID/label and the corresponding
          tunnel from a PCE to a PCC. Attributes of the tunnel MAY be carried
          optionally. </t>

          <t>REQ 07: An I2RS interface SHOULD be available for allocating SID/
          label to the corresponding tunnel. And augmentation on segment
          routing YANG models SHOULD be introduced.</t>
        </list></t>
    </section>

    <section anchor="IANA" title="IANA Considerations">
      <t>This document makes no request of IANA.</t>
    </section>

    <section anchor="Security" title="Security Considerations">
      <t>This document does not introduce new security threat.</t>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      <?rfc include="reference.RFC.8402"?>
    </references>

    <references title="Informative References">
      <?rfc include="reference.RFC.2119"?>
    </references>
  </back>
</rfc>
