<?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-xl-bess-source-segment-00"
     ipr="trust200902">
  <front>
    <title abbrev="Source Segment for SRv6 based Multicast VPN">Source Segment for SRv6 based 
    Multicast VPN</title>

    <author fullname="Jingrong Xie" initials="J." surname="Xie">
      <organization>Huawei Technologies</organization>

      <address>
        <postal>
          <street/>

          <city/>

          <code/>

          <country/>
        </postal>

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

    <author fullname="Xuesong Geng" initials="X." surname="Geng">
      <organization>Huawei Technologies</organization>

      <address>
        <postal>
          <street/>
        </postal>

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

    <author fullname="Yisong Liu" initials="Y." surname="Liu">
      <organization>China Mobile</organization>

      <address>
        <postal>
          <street/>

          <city/>

          <region/>

          <code/>

          <country/>
        </postal>

        <phone/>

        <facsimile/>

        <email>liuyisong@chinamobile.com</email>

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

    <author fullname="Mengxiao Chen" initials="M." surname="Chen">
      <organization>New H3C Technologies</organization>

      <address>
        <postal>
          <street/>

          <city/>

          <region/>

          <code/>

          <country/>
        </postal>

        <phone/>

        <facsimile/>

        <email>chen.mengxiao@h3c.com</email>

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

    <date day="7" month="March" year="2023"/>

    <abstract>
      <t>This document defines the general concept of source segment which is
      used as the IPv6 source address in an IPv6 packet. Source segment for
      multicast VPN service is introduced in this document.</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 (<xref target="RFC8402"/>) leverages the mechanism of
      source routing. An ingress node steers a packet through an ordered list
      of instructions, called "segments". Each one of these instructions
      represents a function to be implemented at a specific location in the
      network. A function is locally defined on the node where it is executed.
      Network Programming combines Segment Routing functions to achieve a
      networking objective that goes beyond mere packet routing. <xref
      target="RFC8986"/> defines the SRv6 Network Programming concept and
      specifies the main Segment Routing behaviors and network programming
      functions.</t>

      <t>Previous segments defined in SRv6 can be used as the destination
      address of an IPv6 packet. This document introduces the new segments,
      source segments, which can be used as the IPv6 source address of an IPv6
      packet. This document defines the general concept of source segment and
      the source segment used for multicast VPN service. Protocol extensions on
      the control plane are not in the scope of this document.</t>

      <t>This document defines the general concept of source segment and the
      source segment used for multicast service. Protocol extensions on the
      control plane are not in the scope of this document.</t>
    </section>

    <section title="Terminologies">
      <t>The following new terms are used throughout this document:</t>

      <t>SRv6: Source Routing over IPv6;</t>

      <t>MVPN: Multicast VPN;</t>
    </section>

    <section title="Source Segment Definition">
      <t>Source segment is different from the existing SID defined in RFC8402
      from the following aspects:</t>

      <t><list style="symbols">
          <t>Source segment is unchanged along the SRv6 multicast path.</t>

          <t>Source segment is distributed by the ingress node but indicates
          functions in other nodes along the path, e.g., egress node.
          Forwarding table should be maintained in the nodes where the
          instruction takes place.</t>

          <t>When the source segment is encapsulated in an SRv6 packet, it is
          activated by other instructions in the data plane because source
          address is not parsed in existing forwarding process of a unicast
          packet</t>
        </list></t>

      <t>Using source segment for SRv6 Network Programming have several
      benefits including:</t>

      <t><list style="symbols">
          <t>Enhance network programming capability for more SRv6 functions
          and extend the programming space in IPv6 header;</t>

          <t>Provide sematic for source address with similar IPv6 address
          allocation and management method as SRv6;</t>

          <t>Facilitates security management inside the limited domain;</t>
        </list>Source segment should be avoided to process hop by hop. Per-hop
      process of source segment which will degrade forwarding performance and
      bring compatibility issues.</t>
    </section>

    <section title="SID Format">
      <t>Source segment leverages the format of SID defined in SRv6 network
      programming.</t>

      <t>Source segment consists of LOC:FUNCT:ARG, where a locator (LOC) is
      encoded in the L most significant bits of the SID, followed by F bits of
      function (FUNCT) and A bits of arguments (ARG).</t>

      <t>A locator may be represented as B:N where B is the SRv6 SID block
      (IPv6 prefix allocated for SRv6 SIDs by the operator) and N is the
      identifier of the ingress node .</t>

      <t>The FUNCT is an opaque identification of the behavior bound to the
      SID. The behavior could be executed in other nodes except ingress
      node.</t>

      <t>The behavior indicated by FUNCT may require additional information
      for its processing. This information may be encoded in the ARG bits of
      the SID.</t>
    </section>

    <section title="Source Segment for MVPN">
      <t>In the multicast VPN (MVPN) service, packet is replicated along a point-to-multipoint path (multicast path) towards
      a set of leaf nodes. MVPN routing and the corresponding information
      could be encapsulated in the source segment carried in the IPv6 source
      address. Source Segment for MVPN is distributed by the multicast source
      node and the function is executed by the multicast leaf nodes.As
      described in section 3, Source Segment for MVPN is not changed when the
      packet is replicated and forwarded along the P2MP path.</t>

      <t>This section defines the source segment for MVPN.</t>

      <section title="Behaviors ">
        <t>The following is a set of behaviors that can be associated with a
        source segment for MVPN.</t>

        <t><figure>
            <artwork><![CDATA[
+------------+------------------------------------------------------+                    
|  Src.DT4   |Source address for decapsulation and IPv4 table lookup|                                          
|------------|------------------------------------------------------+                    
|  Src.DT6   |Source address for decapsulation and IPv6 table lookup|                                             
|------------|------------------------------------------------------+  
|  Src.DT46  |Source address for decapsulation and IP table lookup  | 
|------------|------------------------------------------------------+ 
|  Src.DT2   |Source address for decapsulation and L2 table lookup  | 
|------------|------------------------------------------------------+ 
]]></artwork>
          </figure></t>
      </section>

      <section title=" SRC.DT4 ">
        <t>The "Source address for decapsulation and IPv4 table lookup"
        behavior ("Src.DT4" for short) is used in MVPNv4 use case where an
        MFIB lookup in a specific VRF table T at the egress node is required.
        The Src.DT4 SID is an SID associated with an IPv4 MFIB table T on the
        egress PE, either through a control-plane message advertised by the
        ingress PE, or through a local configuration on the egress PE. When an
        IPv6 encapsulated packet with IPv6 source address being S is received
        on an egress PE, and S is associated with an Src.DT4 SID on the egress
        PE, the egress PE does the following behavior:</t>

        <t><figure>
            <artwork><![CDATA[
   S01. If (Upper-Layer header type == 4(IPv4) ) {
   S02.    Remove the outer IPv6 header with all its extension headers
   S03.    Set the packet's associated MFIB table to T
   S04.    Submit the packet to the egress IPv4 MFIB lookup for
              transmission to the new multicast downstreams
   S05. } Else {
   S06.    Drop the packet;
   S07. } 

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

      <section title=" SRC.DT6 ">
        <t>SRC.DT6 behavior could be used in MVPNv6 use case where a MFIB
        lookup in a specific VRF table at the egress node is required.</t>

        <t><figure>
            <artwork><![CDATA[
   S01. If (Upper-Layer header type == 41(IPv6) ) {
   S02.    Remove the outer IPv6 header with all its extension headers
   S03.    Set the packet's associated IPv6 MFIB table to T
   S04.    Submit the packet to the egress IPv6 MFIB lookup for
              transmission to the new multicast downstreams
   S05. } Else {
   S06.    Drop the packet;
   S07. } 

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

      <section title=" SRC.DT46 ">
        <t>SRC.DT46 behavior could be used in MVPN use case where a MFIB
        lookup in a specific VRF table at the egress node is required.</t>

        <t><figure>
            <artwork><![CDATA[
   S01. If (Upper-Layer header type == 4(IPv4) ) {
   S02.    Remove the outer IPv6 header with all its extension headers
   S03.    Set the packet's associated MFIB table to T
   S04.    Submit the packet to the egress IPv4 MFIB lookup for
              transmission to the new destination
   S05. } Else if (Upper-Layer header type == 41(IPv6) ) {
   S06.    Remove the outer IPv6 header with all its extension headers
   S07.    Set the packet's associated MFIB table to T
   S08.    Submit the packet to the egress IPv6 MFIB lookup for
              transmission to the new destination
   S09. } Else {
   S10.    Drop the packet;
   S11. }
]]></artwork>
          </figure></t>

        <t/>
      </section>

      <section title=" Src.DT2 ">
        <t>SRC.DT2 behavior could be used in MVPN use case where a L2 table
        lookup in a specific Layer-2 Multicast forwarding table at the egress
        node is required.</t>

        <t><figure>
            <artwork><![CDATA[
   S01. If (Upper-Layer header type == 143(Ethernet) ) {
   S02.    Remove the outer IPv6 header with all its extension headers
   S03.    Set the packet's associated Layer-2 Multicast forwarding table to T
   S04.    Submit the packet to the egress Layer-2 Multicast forwarding table
              lookup for transmission to the new multicast downstreams
   S05. } Else {
   S06.    Send an ICMP Parameter Problem to the Source Address
             with Code 4 (SR Upper-layer Header Error)
             and Pointer set to the offset of the Upper-Layer header,
             interrupt packet processing, and discard the packet
   S07. } 
]]></artwork>
          </figure></t>
      </section>
    </section>

    <section title="Exception Handling">
      <t>Once a source segment is used in an SRv6 encapsulated multicast data packet as source
      address, it is expected to receive an ICMPv6 error message with the
      source segment being the Destination address, and such a packet is
      expected to be processed by Ingress PE.</t>

      <t>Additionally, there are cases where a source segment may appear as
      destination address of an packet that is not an ICMPv6 message. This
      could be a packet without SRH, or a packet with SRH and the active
      segment is the source segment. Such a packet is expected to be
      dropped.</t>

      <t>The following pseudo-code describes how a packet with a source
      segment as destination address is handled: <t>
          <figure>
            <artwork align="left"><![CDATA[
    1. IF Upper Layer Protocol = ICMPv6   ;;Ref1: ICMPv6 packet
    2.   Send to CPU in limited rate.
    3. ELSE
    4.   Drop the packet.
 ]]></artwork>
          </figure>
        </t></t>
    </section>

    <section title="Use Case">
      <t>The source segment could be applied in SRv6-based Multicast cases.</t>

      <t><list style="numbers">
          <t>MSR6: MSR6 <xref target="I-D.lx-msr6-rgb-segment"/> is considered 
          to be one of the SRv6-based Multicast solutions,
          and MVPN is one of the typical services intended to be running over MSR6.
          The source segment defined in this document can be used in this solution
          as source address for identifying a VRF.</t>

          <t>Tree SID over SRv6: MVPN service can use Tree SID over SRv6 <xref
          target="I-D.ietf-bess-mvpn-evpn-sr-p2mp"/> for point-to-multipoint
          transport of a packet. When a Tree SID over SRv6 P-tunnel is shared
          across different MVPNs, an IPv6 address in IPv6 source address for
          identifying a VRF is possible.</t>

          <t>MVPN service can use Ingress Replication(IR) <xref
          target="RFC6513"/> to simulate a point-to-multipoint P-tunnel. In an
          IPv6 environment, Ingress Replication can use IPv6 encapsulation for
          each branch. When the egress PE of an Ingress Replication P-tunnel
          branch receives a packet, it gets to know the VRF of the packet
          through the Destination address in the IPv6 header. This means that,
          every egress PE of the IR P-tunnel branch need to allocate an IPv6
          address to identify a VRF. If the source segment is used for the
          IPv6 source address, only one IPv6 address of the Ingress PE is
          needed for identifying a VRF, and thus save the IPv6 addresses and
          their operation costs.</t>
        </list></t>
    </section>

    <section anchor="IANA" title="IANA Considerations">
      <t>TBD</t>
    </section>

    <section anchor="Security" title="Security Considerations">
      <t>TBD</t>
    </section>
  </middle>

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

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

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

      <?rfc include='reference.RFC.8402'?>
    </references>

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

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

      <?rfc include='reference.I-D.ietf-bess-mvpn-evpn-sr-p2mp'?>
      <?rfc include='reference.I-D.lx-msr6-rgb-segment'?>
    </references>
  </back>
</rfc>
