<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<rfc category="std" docName="draft-ietf-bess-bgp-srv6-args-01"
     ipr="trust200902" updates="9252">
  <?xml-stylesheet 3type='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" ?>

  <front>
    <title abbrev="SRv6 Argument Signaling for BGP Services">SRv6 Argument
    Signaling for BGP Services</title>

    <author fullname="Ketan Talaulikar" initials="K" surname="Talaulikar">
      <organization>Cisco Systems</organization>

      <address>
        <postal>
          <street/>

          <country>India</country>
        </postal>

        <email>ketant.ietf@gmail.com</email>
      </address>
    </author>

    <author fullname="Kamran Raza" initials="K" surname="Raza">
      <organization>Cisco Systems</organization>

      <address>
        <postal>
          <street/>

          <country>Canada</country>
        </postal>

        <email>skraza@cisco.com</email>
      </address>
    </author>

    <author fullname="Jorge Rabadan" initials="J" surname="Rabadan">
      <organization>Nokia</organization>

      <address>
        <postal>
          <street/>

          <country>USA</country>
        </postal>

        <email>jorge.rabadan@nokia.com</email>
      </address>
    </author>

    <author fullname="Wen Lin" initials="W" surname="Lin">
      <organization>Juniper Networks</organization>

      <address>
        <postal>
          <street/>

          <country>USA</country>
        </postal>

        <email>wlin@juniper.net</email>
      </address>
    </author>

    <date year=""/>

    <area>Routing</area>

    <workgroup>BESS Working Group</workgroup>

    <keyword>BGP</keyword>

    <keyword>SRv6</keyword>

    <abstract>
      <t>RFC9252 defines procedures and messages for SRv6-based BGP services
      including L3VPN, EVPN, and Internet services. This document updates
      RFC9252 and provides more detailed specifications for the signaling and
      processing of SRv6 SID advertisements for BGP Service routes associated
      with SRv6 Endpoint Behaviors that support arguments.</t>
    </abstract>
  </front>

  <middle>
    <section anchor="INTRO" title="Introduction">
      <t>SRv6 refers to Segment Routing instantiated on the IPv6 data plane
      <xref target="RFC8402"/>. SRv6 Service SID refers to an SRv6 SID <xref
      target="RFC8402"/> associated with one of the service specific SRv6
      Endpoint behaviors on the advertising Provider Edge (PE) router for
      Layer-3 Virtual Private Network (L3VPN), Global Internet Routing, and
      Ethernet Virtual Private Network (EVPN) services as defined in <xref
      target="RFC8986"/>. <xref target="RFC9252"/> defines the procedures and
      messages for the signaling of BGP services including L3VPN, EVPN, and
      Internet services using SRv6 as data plane.</t>

      <t>For some of the EVPN services, <xref target="RFC8986"/> introduced
      the End.DT2M SRv6 Endpoint Behavior that takes arguments (i.e.,
      Arg.FE2). <xref target="RFC9252"/> specified the encoding and procedures
      for signaling of the SRv6 SID and its argument via EVPN Route Type 3 and
      EVPN Route Type 1 respectively. During the implementation and
      interoperability testing, it was identified that the specifications in
      <xref target="RFC9252"/> were not detailed adequately.</t>

      <t>This document updates <xref target="RFC9252"/> to provide the
      necessary details and clarifications related to the signaling of SRv6
      Service SIDs corresponding to SRv6 Endpoint Behaviors that use
      arguments. While the document refers more specifically to the signaling
      of the End.DT2M SRv6 Endpoint Behavior via EVPN Route Types 1 and 3, the
      procedures can be applied to the signaling of other similar endpoint
      behaviors with arguments that may be signaled via BGP.</t>

      <section anchor="REQ" 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>

    <section anchor="SIDANDARGS"
             title="Advertisement of SRv6 SID and Arguments">
      <t>As defined in <xref target="RFC8986"/>, an SRv6 SID consists of three
      parts: Locator (LOC), Function (FUNC), and Argument (ARG). SRv6 SIDs
      corresponding to SRv6 Endpoint Behaviors that do not support argument do
      not have the ARG part, hence all the bits after FUNC MUST be zero and
      have zero argument length.</t>

      <t>Certain SRv6 Endpoint Behaviors (e.g., End.DT2M), support arguments.
      As indicated in section 3.2.1 of <xref target="RFC9252"/>, the SRv6 SID
      Structure sub-sub-TLV MUST be signaled along with SRv6 SID corresponding
      to behaviors that support argument to enable the receiving router to
      perform consistency checking for the argument and to perform correct
      encoding of ARG value within the SRv6 SID.</t>

      <t>While for some use cases, the SRv6 SID can be signaled as
      LOC:FUNC:ARG all encoded within the SID, there are use cases where the
      SRv6 SID (i.e., LOC:FUNC part) is signaled without the ARG via one
      advertisement and its ARG value is signaled via another advertisement or
      learnt via some other mechanism. It is the SRv6 Source Node that needs
      to encode the ARG after the LOC:FUNC part to form the complete SRv6 SID
      (LOC:FUNC:ARG) that can be used in the data path and encoded in either
      the packet's IPv6 destination address or as a segment in the Segment
      Routing Header (SRH) <xref target="RFC8754"/>, as required.</t>

      <t>Since arguments may be optional, the SRv6 Endpoint Node that owns the
      SID indicates the SRv6 SID Structure along with the advertisement of the
      LOC:FUNC part of the SRv6 SID to indicate its support for ARGs for that
      specific SID. Using a zero Argument Length (AL) indicates that the node
      does not accept ARG for the given SRv6 SID. Using a non-zero AL
      indicates the size of the ARG that is supported by the node along with
      the Locator Block Length (LBL), Locator Node Length (LNL), and Function
      Length (FL) indicating the offset at which the node expects the ARG
      value to be encoded.</t>

      <t>The advertisement of the ARG value may be done by the same node that
      owns the SRv6 SID and is doing the advertisement of the LOC:FUNC parts
      of that SID, or it may be done by some other node/mechanism. The
      advertisement of the ARG value needs to indicate the size of the ARG
      along with the value and the associated SRv6 Endpoint Behavior of the
      SID. There also needs to be some mechanism to associate the
      advertisement of the ARG with the SID(s) for which that ARG may be
      used.</t>
    </section>

    <section anchor="EVPNESI"
             title="End.DT2M Signaling for EVPN ESI Filtering">
      <t>As specified in <xref target="RFC9252"/>, the LOC:FUNC part of the
      SRv6 SID with End.DT2M behavior is signaled via EVPN Route Type 3
      (Inclusive Multicast Ethernet Tag Route) while the ESI Filtering ARG
      (the Arg.FE2 notation introduced in <xref target="RFC8986"/>) part of
      the SRv6 SID is signaled via EVPN Route Type 1 (Ethernet A-D per ES
      Route). The subsections below specify the signaling and processing in
      more detail as compared to <xref target="RFC9252"/>.</t>

      <t>ESI Filtering is a split-horizon method that is used for Multi-Homing
      <xref target="RFC7432"/> or E-Tree procedures <xref target="RFC8317"/>.
      ESI Filtering is not used where there is no E-Tree leaf Broadcast,
      Unknown Unicast, or Multicast (BUM) traffic, no multi-homing, no
      split-horizon method used, or where "local-bias" method (refer <xref
      target="RFC8365"/>) is used. In this document we generically refer to
      "ESI Filtering" as the procedure carried out by the disposition PE to
      avoid forwarding BUM traffic to local Ethernet Segments or local leaf
      attachment circuits, based on the presence of the ESI Filtering ARG.</t>

      <t>The description and the examples in this section do not use the
      Transposition Scheme. Hence, the Transposition Offset (TPOS-O) and
      Transposition Length (TPOS-L) are both shown to be 0 and the various
      MPLS label fields into which the FUNC or ARG portions may be transposed
      into are also not described. The same examples could use the
      Transposition Scheme. This document does not introduce any change with
      respect to the use of the Transposition Scheme in the signaling of EVPN
      Routes and implementations need to follow the procedures and
      recommendations related to the Transposition Schemed as specified in
      <xref target="RFC9252"/>.</t>

      <section anchor="RT1" title="Advertisement of Ethernet A-D per ES Route">
        <t>Ethernet Auto-Discovery (A-D) per ES Routes (EVPN Route Type 1)
        defined in <xref target="RFC7432"/> are used to achieve split-horizon
        filtering and fast convergence, in case of multi-homing. A-D per ES
        routes are also used to enable egress filtering of BUM traffic
        originated from a Leaf, as specified in <xref target="RFC8317"/>.</t>

        <t>When ESI Filtering is not in use, there is no ESI Filtering ARG to
        be conveyed. However, the advertisement of this route SHOULD include
        the BGP Prefix-SID Attribute with an SRv6 L2 Service TLV carrying an
        SRv6 Service SID with the value ::0 is carried in the SRv6 SID
        Information sub-TLV with the SRv6 Endpoint Behavior set to End.DT2M.
        The presence of BGP Prefix-SID Attribute carrying an SRv6 L2 Service
        TLV indicates support for SRv6 as specified in <xref
        target="RFC9252"/>. Since the End.DT2M behavior supports the use of
        ARG, an SRv6 SID Structure sub-sub-TLV MUST be included, and as no ARG
        value needs to be signaled, the AL MUST be set to 0.</t>

        <t>Following is an example representation of the BGP Prefix-SID
        Attribute encoding in this case:</t>

        <figure anchor="RT1NOARG"
                title="EVPN Route Type 1 without ARG for ESI Filtering">
          <artwork><![CDATA[
BGP Prefix SID Attr:
    SRv6 L2 Service TLV:
        SRv6 SID Information sub-TLV:
            SID: ::0
            Behavior: End.DT2M 
            SRv6 SID Structure sub-sub-TLV:
                LBL: 32, LNL: 16, FL: 16, AL: 0, TPOS-L: 0, TPOS-O: 0

]]></artwork>
        </figure>

        <t>When ESI Filtering is in use, the advertisement of this route MUST
        include the BGP Prefix-SID Attribute with an SRv6 L2 Service TLV
        carrying the SRv6 Service SID containing the ESI Filtering ARG value
        in the SRv6 SID Information sub-TLV (when not using the Transposition
        Scheme) with the SRv6 Endpoint Behavior set to End.DT2M. Since the
        End.DT2M behavior supports the use of ARG, an SRv6 SID Structure
        sub-sub-TLV MUST be included. Also, as there is a non-zero ARG value
        being signaled, the AL MUST be set to the size of the ARG and the size
        SHOULD be a multiple of 8. The SRv6 SID Structure sub-sub-TLV has the
        LBL, LNL, and FL set with values that indicate the offset at which the
        ARG value is encoded in the 128-bit SID.</t>

        <t>Following is an example representation of the BGP Prefix-SID
        Attribute encoding in this case for a 16-bit argument value
        'aaaa':</t>

        <figure anchor="RT1ARG"
                title="EVPN Route Type 1 with ARG for ESI Filtering">
          <artwork><![CDATA[
BGP Prefix SID Attr:
    SRv6 L2 Service TLV:
        SRv6 SID Information sub-TLV:
            SID: 0:0:0:0:aaaa::
            Behavior: End.DT2M 
            SRv6 SID Structure sub-sub-TLV:
                LBL: 32, LNL: 16, FL: 16, AL: 16, TPOS-L: 0, TPOS-O: 0

]]></artwork>
        </figure>

        <t>In the above examples, it would have been possible to set the LBL,
        LNL, and FL values to 0 and to set the SID value as either ::0 or
        aaaa::. However, such an encoding would not be backwards compatible
        with <xref target="RFC9252"/> as described further in <xref
        target="BACKWARD"/> and hence it is REQUIRED that the LBL, LNL, and FL
        values be set as indicated via the SID Structure for the End.DT2M SRv6
        Service SIDs.</t>
      </section>

      <section anchor="RT3"
               title="Advertisement of Inclusive Multicast Ethernet Tag Route">
        <t>Inclusive Multicast Ethernet Tag Route (EVPN Route Type 3) defined
        in <xref target="RFC7432"/> is used to advertise multicast traffic
        reachability information through MP-BGP to all other PEs in a given
        EVPN instance. When using the SRv6 transport, the advertisement of
        this route MUST include the BGP Prefix-SID Attribute with an SRv6 L2
        Service TLV to indicate the use of SRv6.</t>

        <t>Irrespective of whether ESI Filtering is in use, an SRv6 Service
        SID with the LOC:FUNC part alone is carried in the SRv6 SID
        Information sub-TLV (when not using the Transposition Scheme) with the
        SRv6 Endpoint Behavior set to End.DT2M. Since the End.DT2M behavior
        supports the use of ARG, an SRv6 SID Structure sub-sub-TLV MUST be
        included. The LBL, LNL, and FL MUST be set to indicate the structure
        of the Service SID being signaled.</t>

        <t>When ESI Filtering is not in use, no ARG is expected to be received
        by the router along with the signaled Service SID and hence the AL
        MUST be set to 0.</t>

        <t>Following is an example representation of the BGP Prefix-SID
        Attribute encoding in this case:</t>

        <figure anchor="RT3NOARG"
                title="EVPN Route Type 3 without ESI Filtering">
          <artwork><![CDATA[
BGP Prefix SID Attr:
    SRv6 L2 Service TLV:
        SRv6 SID Information sub-TLV:
            SID: 2001:db8:1:fbd1::
            Behavior: End.DT2M 
            SRv6 SID Structure sub-sub-TLV:
                LBL: 32, LNL: 16, FL: 16, AL: 0, TPOS-L: 0, TPOS-O: 0

]]></artwork>
        </figure>

        <t>When ESI Filtering is in use, an ARG is expected to be received by
        the router along with the signaled Service SID and hence the AL MUST
        be set to the size of the ARG supported by the advertising router for
        the specific Service SID. The AL is unique per End.DT2M behavior
        signaled by the egress PE and, therefore, the egress PE MUST use the
        same AL for all the local Ethernet Segments with Attachment Circuits
        in the same Broadcast Domain.</t>

        <t>Following is an example representation of the BGP Prefix-SID
        Attribute encoding in this case for a 16-bit argument:</t>

        <figure anchor="RT3ARG" title="EVPN Route Type 3 with ESI Filtering">
          <artwork><![CDATA[
BGP Prefix SID Attr:
    SRv6 L2 Service TLV:
        SRv6 SID Information sub-TLV:
            SID: 2001:db8:1:fbd1::
            Behavior: End.DT2M 
            SRv6 SID Structure sub-sub-TLV:
                LBL: 32, LNL: 16, FL: 16, AL: 16, TPOS-L: 0, TPOS-O: 0

]]></artwork>
        </figure>

        <t>When ESI Filtering is in use, the advertising router MUST ensure
        that the size of argument (i.e., AL) signaled in the Route Type 3 and
        its corresponding Route Type 1 are equal.</t>
      </section>

      <section anchor="PROC" title="Processing at Ingress PE">
        <t>An ingress PE receives the LOC:FUNC parts of the SRv6 Service SID
        to be used for Broadcast, Unknown Unicast, or Multicast (BUM) traffic
        along with the EVPN Route Type 3 advertisements.</t>

        <t>In the case where ESI Filtering is not used, the SRv6 Service SID
        to be used is all what is received via the EVPN Route Type 3 (i.e.,
        LOC:FUNC parts alone).</t>

        <t>When ESI filtering is used, the ESI Filtering ARG of the SRv6
        Service SID is signaled along with EVPN Route Type 1 (Ethernet A-D per
        ES Route). This ARG along with the LOC:FUNC parts advertised via the
        EVPN Route Type 3 forms the SRv6 Service SID to be used.</t>

        <t>Following are the processing steps to be used at the ingress
        PE:</t>

        <t><list style="numbers">
            <t>When AL=0 is signaled via Route Type 3, then the egress PE does
            not support or does not require ESI Filtering ARG for the specific
            SID. The SRv6 Service SID is formed with the LOC:FUNC parts alone
            and all bits after LBL+LNL+FL MUST be set to zero for encoding on
            the data path. In this case, the router MUST ignore the SID value
            and its SID structure advertised in the corresponding Route Type
            1.</t>

            <t>When a non-zero AL is signaled via Route Type 3, then the
            matching Route Type 1 for the Ethernet Segment is found and
            checked for the presence of an SRv6 SID advertisement with the
            End.DT2M behavior.<list style="letters">
                <t>If the AL=0 in the Route Type 1, then there is no usable
                ARG value. In such cases, the SRv6 Service SID to be used is
                formed as in (1) above.</t>

                <t>If the AL values in Route Type 1 and 3 are both non-zero
                and not equal, then there is no usable ARG value. It also
                indicates an inconsistency in signaling from the egress PE. To
                avoid looping, the BUM traffic MUST NOT be forwarded for such
                routes from the specific Ethernet Segment and implementations
                SHOULD log an error message.</t>

                <t>The ARG value from Route Type 1 is usable only when its AL
                is equal to the AL of the SID structure advertised via Route
                Type 3. Once the usable ARG value is obtained, it MUST be
                encoded within the rest of the SRv6 SID (LOC:FUNC parts) at
                the offset of the ARG as indicated by the SID structure (i.e.,
                LBL+LNL+FL) in Route Type 3 and the bits after LBL+LNL+FL+AL
                set to zero.</t>
              </list></t>
          </list></t>

        <t>Since the LOC:FUNC and the ARG portions of the SRv6 Service SID are
        signaled via different route advertisements, there can be conditions
        where the ingress PE gets inconsistent ALs from the two route types.
        If the ingress PE expected ESI filtering to be in use (i.e., when
        forwarding BUM traffic to other PEs attached to a shared Ethernet
        Segment) but does not find a usable ARG value during the above
        processing, it SHOULD log a message to help with troubleshooting.</t>

        <t>Based on the above procedures, the SRv6 Service SID encoding for
        the data plane without an ESI Filtering ARG, based on the examples in
        <xref target="RT1NOARG"/> and <xref target="RT3NOARG"/>, is as
        follows:</t>

        <figure anchor="SIDPACKET"
                title="SRv6 Service SID Encoding for Data Plane without ARG">
          <artwork><![CDATA[
Route Type 3:
 SID: 2001:db8:1:fbd1::
 Structure: LBL: 32, LNL: 16, FL: 16, AL: 0

SRv6 Service SID Encoded for Datapath: 2001:db8:1:fbd1::

]]></artwork>
        </figure>

        <t>Based on the above procedures, the SRv6 Service SID encoding for
        the data plane along with an ESI Filtering ARG, based on the examples
        in <xref target="RT1ARG"/> and <xref target="RT3ARG"/>, is as
        follows:</t>

        <figure anchor="SIDPACKETARG"
                title="SRv6 Service SID Encoding for Data Plane with ARG">
          <artwork><![CDATA[Route Type 1:
 SID: 0:0:0:0:aaaa::
 Structure: LBL: 32, LNL: 16, FL: 16, AL: 16 

Route Type 3:
 SID: 2001:db8:1:fbd1::
 Structure: LBL: 32, LNL: 16, FL: 16, AL: 16

SRv6 Service SID Encoded for Datapath: 2001:db8:1:fbd1:aaaa::

]]></artwork>
        </figure>

        <t><xref target="MULTIBD"/> below provides another example that
        illustrates the signaling and processing of multiple bridge domains in
        a deployment design.</t>

        <t><figure anchor="MULTIBD"
            title="Example with Multiple Bridge Domains">
            <artwork><![CDATA[
                     +--------------------------------+
                     |                                |
                 PE1 |                                |
                 +---------+                          |
  BUM on BD1     | +-----+ |                          |
+----------------> | BD1 |-------------+              |
|                | +-----+ |           |              |
|  BUM on BD2    | +-----+ |           v          PE3 |
| +--------------> | BD2 |-------+             +---------+
| |        +-----| +-----+ |     |             | +-----+ |
+----+     |     +---------+     v     ^       | | BD1 |-----CE31
|    |     |         |                 |       | +-----+ |
|CE12|-----+ ESI-1   |           ^     |       | +-----+ |
|    |-----+         |           |     |       | | BD2 |-----CE32
+----+     |     +---------+ ^   RT3   RT3     | +-----+ |
           +-----| +-----+ | |   dt2m  dt2m    +---------+
                 | | BD1 | | |   BD2   BD1            |
                 | +-----+ | |   FL:16 FL:32          |
                 | +-----+ | RT1                      |
                 | | BD2 | | ESI-1                    |
                 | +-----+ | AL:16                    |
                 +---------+                          |
                  PE2 |                               |
                      |                               |
                      |                               |
                      +-------------------------------+
 
 Route Type 1 ESI-1:
  SID: 0:0:0:0:aaaa::
  Structure: LBL: 32, LNL: 16, FL: 16, AL: 16
 
 Route Type 3 from BD1:
  SID: 2001:db8:1:fbd1:fbd1:
  Structure: LBL: 32, LNL: 16, FL: 32, AL: 16
 
 Route Type 3 from BD2:
  SID: 2001:db8:1:fbd1::
  Structure: LBL: 32, LNL: 16, FL: 16, AL: 16
 
 SRv6 Service SID for datapath from ingress PE1 to egress PE on BD1:
  2001:db8:1:fbd1:fbd1:aaaa::
 SRv6 Service SID for datapath from ingress PE1 to egress PE on BD2: 
  2001:db8:1:fbd1:aaaa::

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

    <section anchor="BACKWARD" title="Backward Compatibility">
      <t><xref target="RFC9252"/> section 6.3 specifies the use of a bitwise
      logical-OR operation between the SID with ARG signaled via Route Type 1
      and the SID with LOC:FUNC parts signaled via Route Type 3 to form the
      SRv6 Service SID to be used in the data path. However, this assumes that
      the same uniform SID structure is used and signaled for all SIDs
      advertised via Route Type 3 and the Route Type 1. Such an assumption may
      not always be correct and the procedures in this document remove this
      restriction.</t>

      <t>Backward compatibility with implementations doing the bitwise
      logical-OR operation is preserved thanks to the advertisement of SIDs in
      Route Type 3 and its corresponding Route Type 1 with the same SID
      structure as described in <xref target="RT1"/> and <xref target="RT3"/>.
      As an extension, the bitwise logical-OR operation specified in <xref
      target="RFC9252"/> cannot be used when the SID structures of the two
      route types are not identical.</t>
    </section>

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

    <section anchor="SEC" title="Security Considerations">
      <t>This document only provides a more detailed specification related to
      the signaling and processing of SRv6 SID advertisements for SRv6
      Endpoint Behaviors with arguments. As such, it does not introduce any
      new security considerations over and above what is already covered by
      <xref target="RFC9252"/>.</t>
    </section>

    <section anchor="ACK" title="Acknowledgments">
      <t>The authors would like to acknowledge Jayshree Subramanian, Sonal
      Agarwal, Swadesh Agrawal, Dongling Duan, Luc Andre Burdet, Patrice
      Brissette, Senthil Sathappan, Erel Ortacdag, Neil Hart, Will Lockhart,
      and Vinod Prabhu for their inputs on aspects related to the signaling of
      the End.DT2M SRv6 Endpoint behavior that required clarification as also
      for their review of this document.</t>
    </section>
  </middle>

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

      <?rfc include='reference.RFC.9252.xml'?>

      <?rfc include='reference.RFC.8754.xml'?>

      <?rfc include='reference.RFC.7432.xml'?>

      <?rfc include='reference.RFC.2119.xml'?>

      <?rfc include='reference.RFC.8402.xml'?>

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

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

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