<?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="info"
     docName="draft-li-spring-sr-sfc-control-plane-framework-06"
     ipr="trust200902">
  <front>
    <title abbrev="SR based SFC Control Plane">A Framework for Constructing
    Service Function Chaining Systems Based on Segment Routing</title>

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

      <address>
        <postal>
          <street/>

          <city/>

          <region/>

          <code/>

          <country/>
        </postal>

        <phone/>

        <facsimile/>

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

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

    <author fullname="Ahmed El Sawaf" initials="A." surname="Sawaf">
      <organization>Saudi Telecom Company</organization>

      <address>
        <postal>
          <street/>

          <city>Riyadh</city>

          <region/>

          <code/>

          <country>Saudi Arabia</country>
        </postal>

        <phone/>

        <facsimile/>

        <email>aelsawaf.c@stc.com.sa</email>

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

    <author fullname="Ruizhao Hu" initials="R." surname="Hu">
      <organization>Huawei Technologies</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>huruizhao@huawei.com</email>

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

    <author fullname="Zhenbin Li" initials="Z." surname="Li">
      <organization>Huawei Technologies</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>lizhenbin@huawei.com</email>

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

    <date day="22" month="April" year="2022"/>

    <workgroup>SPRING Working Group</workgroup>

    <abstract>
      <t>Segment Routing (SR) allows for a flexible definition of end-to-end
      paths by encoding paths as sequences of topological sub-paths, called
      "segments". Segment routing architecture can be implemented over an MPLS
      data plane as well as an IPv6 data plane.</t>

      <t>Service Function Chaining (SFC) provides support for the creation of
      composite services that consist of an ordered set of Service Functions
      (SF) that are to be applied to packets and/or frames selected as a
      result of classification.</t>

      <t>SFC can be implemented based on several technologies, such as Network
      Service Header (NSH) and SR. This document describes a framework for
      constructing SFC based on Segment Routing. The document reviews the
      control plane solutions for route distribution of service function
      instance and service function path, and steering packets into a service
      function chain.</t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction">
      <t>Segment routing (SR) <xref target="RFC8402"/> is a source routing
      paradigm that explicitly indicates the forwarding path for packets at
      the ingress node by inserting an ordered list of instructions, called
      segments. When segment routing is deployed on MPLS data plane, it is
      called SR- MPLS <xref target="RFC8660"/>. When segment routing is
      deployed on IPv6 data plane, it is called SRv6 <xref
      target="RFC8754"/>.</t>

      <t>Service Function Chaining (SFC) <xref target="RFC7665"/> provides an
      architecture that supports the creation of composite service that
      consist of an ordered set of Service Functions (SF) that are to be
      applied to packets and/or frames selected as a result of
      classification.</t>

      <t/>

      <t>SFC can be implemented based on Network Service Header <xref
      target="RFC8300"/>. In NSH-based SFC, per-SFC state, such as a mapping
      between Service Path Identifier (SPI) and Service Index (SI) to next-hop
      forwarding, needs to be maintained on nodes along the Service Function
      Path(SFP), and it can therefore, be termed as "stateful SFC". <xref
      target="I-D.ietf-bess-nsh-bgp-control-plane"/> defines the use of BGP as
      a control plane for networks that support SFC based on NSH and MPLS. The
      document introduces a new BGP address family called the SFC AFI/SAFI
      with two route types: Service Function Instance Route (SFIR) and Service
      Function Path Route (SFPR). An NSH or MPLS based SFC can be constructed
      based on the information of SFIR and SFPR.</t>

      <t/>

      <t>SFC can also be instantiated based on SR. In SR, the forwarding path
      is explicitly encoded into the packets on the SR source node. In
      SR-based SFC, an SFC can be represented by a SID list explicitly
      indicated by the source SR node. The SID in SID list may need to be
      associated with service information in order to indicate network
      service, such as Deep Packet Inspection (DPI). Therefore, no per-SFC
      state needs to be maintained along with the SFP, and it can therefore be
      termed &ldquo;stateless SFC&rdquo;.</t>

      <t/>

      <t>In order to construct SR-based SFC, several mechanisms are proposed,
      including the mechanisms of SFIR and SFPR distribution, as well as the
      mechanism of steering packets into an SFP. This document reviews these
      solutions to describe a framework for the construction of an SFC system
      based on Segment Routing.</t>

      <t/>

      <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="Terminology">
        <t>MPLS: Multiprotocol Label Switching.</t>

        <t>SID: Segment Identifier.</t>

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

        <t>SR-MPLS: Segment Routing with MPLS data plane.</t>

        <t>SRH: Segment Routing Header.</t>

        <t>SFIR: Service Function Instance Route</t>

        <t>SFPR: Service Function Path Route</t>

        <t>Further, this document makes use of the terms defined in <xref
        target="RFC7665"/> and <xref
        target="I-D.ietf-spring-sr-service-programming"/>.</t>
      </section>
    </section>

    <section title="Overview of SR Based SFC Control Plane">
      <t/>

      <t>As per <xref target="RFC7665"/>, the architecture of SFC consists of
      classifiers, Service Function Forwarders (SFFs), Service Functions (SFs)
      and SFC Proxies. This is illustrated in Figure 1.</t>

      <t/>

      <t><figure>
          <artwork><![CDATA[                                      +-----+         +-----+   +-----+
                                      |     |         | SFC |   |     |
                                      | SF1 |         |Proxy|---| SF2 |
                                      +-----+         +-----+   +-----+
                                         |               |
    +--------------+                     |               |
    |   Service    |       SFC        +------+        +------+
    |Classification|  Encapsulation   | SFF1 |        | SFF2 |
--->|   Function   |+---------------->|      |--------|      |------->
    |              |                  |      |        |      |
    +--------------+                  +------+        +------+
     
         SFC-enabled Domain


                      Figure 1. SFC Architecture

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

      <t>In order to construct an SFC, SFIR and SFPR should be distributed to
      classifiers and SFFs. Also, the rules of steering packets into specific
      SFPs should be configured at the classifier. <xref
      target="I-D.ietf-bess-nsh-bgp-control-plane"/>.</t>

      <t>In SR, a source node can explicitly indicate the forwarding path for
      packets by inserting an ordered list of instructions. These packet
      steering policies, known as SR policy, can be installed by a central
      controller via BGP <xref
      target="I-D.ietf-idr-segment-routing-te-policy"/> or other
      mechanisms.</t>

      <t>When SFC is constructed based on SR, SFPR and packet steering rules
      can be installed by SR policy at the ingress node, which plays the role
      of classifier in the SFC architecture. In other words, SFPR does not
      need to be distributed to all the nodes along the SFP. The architecture
      of SR based SFC is illustrated in Figure 2.</t>

      <t><figure>
          <artwork><![CDATA[        +-----+                       +-----+         +-----+   +-----+
        |     |                       |     |         | SR  |   |     |
        |SR-C |                       | SF1 |         |Proxy|---| SF2 |
        +-----+                       +-----+         +-----+   +-----+
           |                             |               |
           |                             |               |
    +--------------+                  +------+        +------+
    |              |   SFC Encap/SR   | SFF1/|        | SFF2/|
--->|CF/SR ingress |+---------------->|  SR  |--------|  SR  |------->
    |              |                  |      |        |      |
    +--------------+                  +------+        +------+
     
         SFC-enabled Domain

                    Figure 2. SR based SFC architecture.
]]></artwork>
        </figure></t>

      <t><list style="symbols">
          <t>CF/SR ingress: an SR ingress node plays the role of Classifier in
          the SFC architecture, and it connects to an SR controller, where the
          SR policies originate.</t>

          <t>SR-C: SR Controller (SR-C) is connected to the SR ingress node,
          and may be attached to any node in the network. SR-C is capable of
          discovering topology, and calculating constrained paths for
          SFCs.</t>

          <t>SFF/SR nodes: the SFF component in SFC architecture, which
          enables SR to steer packets to SFs.</t>

          <t>SFn: Service Functions, can be SR-aware or SR-unaware. If an SF
          is SR-unaware then SR proxy is needed.</t>

          <t>SR proxy: A proxy between SFF/SR nodes and SR-unaware SF.</t>
        </list></t>

      <t/>

      <t>There are two solutions to encode SFC in the SR data plane. <xref
      target="I-D.ietf-spring-sr-service-programming"/> defines data plane
      functionality required to implement service segments and achieve service
      programming in SR-enabled MPLS and IP networks. It can be termed
      "Stateless SFC" since no per-SFC state is maintained on the SR nodes
      along the SFP.</t>

      <t/>

      <t/>

      <t>The second solution can be termed "Stateful SFC" <xref
      target="I-D.ietf-spring-nsh-sr"/>, since it still maintains per-SFC
      state on nodes. <xref target="I-D.ietf-spring-nsh-sr"/>describes two
      modes of operation:</t>

      <t/>

      <t><list style="symbols">
          <t>NSH-based SFC with SR-based transport tunnel: SR is used as the
          transport tunnel to route packets between classifier and SFF or
          SFFs. Service plane routing relies on NSH.</t>

          <t>SR-based SFC with Integrated NSH Service Plane: The SFP is
          encoded within the SR segment-list, while the NSH only maintains the
          service plane context information, which will be used at NSH-aware
          SFs, and at SFFs as a pointer to cache SR segment-lists.</t>
        </list></t>

      <t>In order to support these data plane encodings, control plane
      mechanisms are required. The existing control plane mechanisms are shown
      in table 1.</t>

      <t><figure>
          <artwork><![CDATA[ +------------------------------------------------------------+
 | SR based SFC      |   SFIR    |    SFPR   | Steering policy|
 +-------------------+-----------+-----------+----------------+
 |                   |   BGP     |    BGP    |      BGP       |
 |Stateless          |   BGP-LS  |    PCEP   |      PCEP      |
 |                   |   IGP     |           |                |
 +-------------------+-----------+-----------+----------------+
 |NSH-based SFC      |   BGP     |    BGP    |      BGP       |  
 |with SR-based      |           |    PCEP   |                |
 |transport tunnel   |           |           |                |
 |                   |           |           |                |
 |                   |           |           |                |    
 +-------------------+-----------+-----------+----------------+                      
 |SR-based SFC       |   BGP     |    BGP    |      BGP       |
 |with Integrated    |   BGP-LS  |    PCEP   |      PCEP      |
 |NSH Service Plane  |   IGP     |           |                |  
 |                   |           |           |                |
 +-------------------+-----------+-----------+----------------+       
          Table 1. SR based SFC Control Plane Solutions
]]></artwork>
        </figure></t>
    </section>

    <section title="Stateless SR Based SFC">
      <t>As describe in <xref
      target="I-D.ietf-spring-sr-service-programming"/>, service instances are
      associated with a segment, called a service SID. These service SIDs are
      leveraged as part of a SID-list to steer packets through the
      corresponding services</t>

      <section title="Service Function Instance Route Distribution">
        <t>To associate a segment with a service, service information, such as
        Service Function Type (SFT), should be included in segment
        distribution. <xref
        target="I-D.dawra-idr-bgp-ls-sr-service-segments"/> specifies the
        extensions to BGP-LS for discovery and advertisement of service
        segments to enable setup of service programming paths using Segment
        Routing. <xref target="I-D.dawra-idr-bgp-ls-sr-service-segments"/>
        extends SRv6 Node SID TLV <xref target="I-D.ietf-idr-bgpls-srv6-ext"/>
        and SR-MPLS SID/ Label TLV <xref
        target="I-D.ietf-idr-bgp-ls-segment-routing-ext"/> to associate the
        Service SID Value with Service-related Information using Service
        Chaining Sub-TLV. The Service Chaining Sub-TLV contains information of
        Service SID value, Function Identifier (Static Proxy, Dynamic Proxy,
        Shared Memory Proxy, Masquerading Proxy, SR Aware Service Etc.),
        Service Type (DPI, Firewall, Classifier, LB etc.), Traffic Type (IPv4
        OR IPv6 OR Ethernet) and Opaque Data (such as brand and version, other
        extra information). This extension works for both SR- MPLS and
        SRv6.</t>

        <t><xref target="I-D.ietf-bess-nsh-bgp-control-plane"/> proposes a
        BGP-based SFC control plane solution, and it works for SR-MPLS as
        well. Service function instance route distribution can use SFIR in SFC
        AFI/SAFI. SFPR and steering rules for the classifier can be
        distributed by SR policy, which is defined in <xref
        target="I-D.ietf-idr-segment-routing-te-policy"/>. BGP control plane
        of SRv6-based SFC still needs to be defined.</t>

        <t>IGP extensions are proposed by <xref
        target="I-D.xu-isis-service-function-adv"/> and <xref
        target="I-D.xu-ospf-service-function-adv"/>. In IS-IS solution, SFFs
        within the SFC domain need to advertise each SF they are offering by
        using a new sub-TLV of the IS-IS Router CAPABILITY TLV <xref
        target="RFC4971"/>. This new sub-TLV is called Service Function
        sub-TLV, and it can appear multiple times within a given IS-IS Router
        CAPABILITY TLV or when more than one SF needs to be advertised. OSPF
        extensions are similar, and use the OSPF Router Information (RI)
        Opaque LSA <xref target="RFC4970"/> to carry Service Function
        sub-TLV.</t>

        <t>However, due to IGP flooding issues, IGP extensions are not very
        appropriate, and the drafts have expired for a long time.</t>
      </section>

      <section title="Service Function Path Route Distribution">
        <t>With SR, the SFPR does not need to be distributed to nodes along
        the SFP but only to the ingress node. SFPR and steering rules for the
        classifier can be distributed by SR policy. The BGP extension is
        defined in <xref target="I-D.ietf-idr-segment-routing-te-policy"/>.
        The PCEP extension is defined in <xref
        target="I-D.ietf-pce-segment-routing-policy-cp"/>.</t>
      </section>

      <section title="Steer Packets into SFC">
        <t>In SR, packet steering rules are learned through SR policy. Thus,
        there is no need to install other rules in the classifier, which is
        the SR source node.</t>
      </section>
    </section>

    <section title="Stateful SR Based SFC">
      <t/>

      <t>"Stateful SFC" <xref target="I-D.ietf-spring-nsh-sr"/> proposes two
      modes of SR based SFC:</t>

      <t><list style="symbols">
          <t>NSH-based SFC with SR-based transport tunnel</t>

          <t>SR-based SFC with Integrated NSH Service Plane</t>
        </list></t>

      <section title="Service Function Route Distribution">
        <t>For NSH-based SFC with SR-based transport tunnel, service
        information is maintained by NSH while SR is only used for transport
        between SFFs, so <xref target="I-D.ietf-bess-nsh-bgp-control-plane"/>
        can be used for this mode.</t>

        <t>To indicate NSH, an SFF label <xref
        target="I-D.ietf-mpls-sfc-encapsulation"/> should be inserted as the
        last label in the label stack in SR-MPLS. The control plane of SFF is
        also described in <xref
        target="I-D.ietf-bess-nsh-bgp-control-plane"/>. For
        choosing/configuring SR as the transport tunnel, BGP route of SFF's
        BGP Tunnel Encapsulation Attribute Type should be "SR TE Policy Type"
        <xref target="I-D.ietf-idr-segment-routing-te-policy"/>. For SR-based
        SFC with Integrated NSH Service Plane, there is no control plane
        solution as yet defined.</t>

        <t/>

        <t/>
      </section>

      <section title="Service Function Path Route Distribution">
        <t>Same as SFIR distribution, SFPR BGP distribution in NSH-based SFC
        with SR-based transport tunnel is identical to the mechanism defined
        in <xref target="I-D.ietf-bess-nsh-bgp-control-plane"/>. PCEP
        extension for SFPR distribution can reuse the NSH based SFC extension
        defined in <xref target="I-D.wu-pce-traffic-steering-sfc"/>. For
        SR-based SFC with Integrated NSH Service Plane, control plane solution
        is to be added in other documents.</t>
      </section>

      <section title="Steer Packets into SFC">
        <t>For NSH-based SFC with SR-based transport tunnel, it is the same
        with the NSH based SFC. The Classifier is responsible for determining
        to which packet flow a packet belongs (usually by inspecting the
        packet header), imposing an NSH, and initializing the NSH with the SPI
        of the selected SFP and the SI of its first hop <xref
        target="I-D.ietf-bess-nsh-bgp-control-plane"/>. For SR-based SFC with
        Integrated NSH Service Plane, control plane solution is to be added in
        other document.</t>

        <t/>
      </section>
    </section>

    <section anchor="IANA" title="IANA Considerations">
      <t>This document does not require any IANA actions.</t>
    </section>

    <section anchor="Security" title="Security Considerations">
      <t>This document does not introduce additional security requirements and
      mechanisms.</t>
    </section>

    <section anchor="Acknowledgements" title="Acknowledgements">
      <t>TBA</t>
    </section>
  </middle>

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

      <?rfc include="reference.RFC.8174"?>

      <?rfc ?>

      <?rfc ?>

      <?rfc ?>
    </references>

    <references title="Informative References">
      <?rfc include="reference.RFC.8402"?>

      <?rfc include='reference.RFC.8660'?>

      <?rfc ?>

      <?rfc ?>

      <?rfc ?>

      <?rfc include="reference.RFC.7665"?>

      <?rfc include="reference.RFC.8300"?>

      <?rfc include="reference.I-D.ietf-spring-sr-service-programming"?>

      <?rfc include="reference.I-D.ietf-idr-segment-routing-te-policy"?>

      <?rfc include="reference.I-D.ietf-bess-nsh-bgp-control-plane"
?>

      <?rfc include="reference.I-D.ietf-spring-nsh-sr"?>

      <?rfc include="reference.I-D.dawra-idr-bgp-ls-sr-service-segments"?>

      <?rfc include="reference.I-D.ietf-idr-bgpls-srv6-ext"?>

      <?rfc include="reference.I-D.ietf-idr-bgp-ls-segment-routing-ext"?>

      <?rfc include="reference.I-D.xu-isis-service-function-adv"
?>

      <?rfc include="reference.I-D.xu-ospf-service-function-adv"?>

      <?rfc include="reference.RFC.4970"?>

      <?rfc include="reference.RFC.4971"
?>

      <?rfc include="reference.RFC.8754"?>

      <?rfc include="reference.I-D.ietf-pce-segment-routing-policy-cp"
?>

      <?rfc include="reference.I-D.ietf-mpls-sfc-encapsulation"?>

      <?rfc include="reference.I-D.wu-pce-traffic-steering-sfc"
?>
    </references>
  </back>
</rfc>
