<?xml version="1.0"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY RFC2119 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC8287 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8287.xml">
<!ENTITY RFC8029 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8029.xml">
<!ENTITY RFC7705 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7705.xml">
<!ENTITY RFC8690 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8690.xml">
<!ENTITY RFC8174 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8174.xml">
<!ENTITY RFC8403 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8403.xml">
<!ENTITY RFC8664 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8664.xml">
<!ENTITY RFC4271 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4271.xml">
<!ENTITY RFC5065 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5065.xml">
<!ENTITY RFC6286 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6286.xml">
<!ENTITY RFC9086 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.9086.xml">
<!ENTITY RFC9256 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.9256.xml">
<!ENTITY RFC9087 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.9087.xml">
]>
<?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-ietf-mpls-sr-epe-oam-09" ipr="trust200902">
<front>
  <title abbrev="EPE-OAM">Label Switched Path (LSP) Ping/Traceroute for Segment Routing (SR)
        Egress Peer Engineering Segment Identifiers (SIDs)
                         with MPLS Data Planes</title>

  <author initials="S." surname="Hegde" fullname="Shraddha Hegde">
    <organization>Juniper Networks Inc.</organization>
    <address>
      <postal>
        <street>Exora Business Park</street>
        <city>Bangalore</city>
        <region>KA</region>
        <code>560103</code>
        <country>India</country>
      </postal>
      <email>shraddha@juniper.net</email>
    </address>
  </author>
   <author initials="M." surname="Srivastava" fullname="Mukul Srivastava">
    <organization>Juniper Networks Inc.</organization>
    <address>
      <postal>
        <street></street>
        <city></city>
        <region></region>
        <code></code>
        <country></country>
      </postal>
      <email>msri@juniper.net</email>
    </address>
  </author>
  
  <author initials="K." surname="Arora" fullname="Kapil Arora">
    <organization>Individual Contributor</organization>
    <address>
      <postal>
        <street></street>
        <city></city>
        <region></region>
        <code></code>
        <country></country>
      </postal>
      <email>kapil.it@gmail.com</email>
    </address>
  </author>
   
    <author initials="S." surname="Ninan" fullname="Samson Ninan">
    <organization>Individual Contributor</organization>
    <address>
      <postal>
        <street></street>
        <city></city>
        <region></region>
        <code></code>
        <country></country>
      </postal>
      <email>samson.cse@gmail.com</email>
    </address>
  </author>
 <author initials="X." surname="Xu" fullname="Xiaohu Xu">
    <organization>China Mobile</organization>
    <address>
      <postal>
        <street></street>
        <city>Beijing</city>
        <region></region>
        <code></code>
        <country>China</country>
      </postal>
      <email>xuxiaohu_ietf@hotmail.com </email>
    </address>
  </author>
   <date year="2023"/>
  <area>Routing</area>
  <workgroup>Routing area</workgroup>
  <keyword>OAM</keyword>
  <keyword>EPE</keyword>
  <keyword>BGP-LS</keyword>
  <keyword>BGP</keyword>
  <keyword>SPRING</keyword>
  <keyword>SDN</keyword>
  <keyword>SID</keyword>
  
  <abstract>
 <t>Egress Peer Engineering (EPE) is an application of Segment Routing to
   solve the problem of egress peer selection.  The Segment Routing based
   BGP-EPE solution allows a centralized controller, e.g. a Software
   Defined Network (SDN) controller to program any egress peer.  The EPE
   solution requires a node to program the PeerNode Segment Identifier(SID) describing a 
   session between two nodes, the PeerAdj SID describing the link
   (one or more) that is used by sessions between peer nodes, and the PeerSet 
   SID describing an arbitrary set of sessions or links between a local
   node and its peers.  This document provides new sub-TLVs for EPE Segment
   Identifiers (SID) that would be used in
   the MPLS Target stack TLV (Type 1), in MPLS Ping and Traceroute procedures.

 </t>
  </abstract>



</front>

<middle>
<section title="Introduction" anchor='intro'>
<t> Egress Peer Engineering (EPE) as defined in
 <xref target ='RFC9087'/> is 
an effective mechanism to select the egress peer link based on different criteria. 
In this scenario, egress peers may belong to a completely different administration.
The EPE-SIDs provide means to represent egress peer nodes, links set of links and set of nodes.

 Many network 
deployments have built their networks consisting of multiple Autonomous
Systems, either for the ease of operations or as a result of network mergers and acquisitons.
The inter-AS links connecting any two Autonomous Systems could be traffic
engineered using EPE-SIDs in this case, where there is single ownership but different AS
numbers.
 It is important to be able to validate
the control plane to forwarding plane synchronization for these SIDs so 
that any anomaly can be detected easily by the operator.
 </t> 
 <t>
 <figure anchor="reference_diagram" title="Reference Diagram">
      <artwork>
        

   +---------+      +------+
   |         |      |      |
   |    H    B------D      G
   |         | +---/| AS 2 |\  +------+
   |         |/     +------+ \ |      |---L/8
   A   AS1   C---+            \|      |
   |         |\\  \  +------+ /| AS 4 |---M/8
   |         | \\  +-E      |/ +------+
   |    X    |  \\   |      K
   |         |   +===F AS 3 |
   +---------+       +------+
   
    </artwork>
    </figure>
    In this reference diagram, EPE-SIDs are advertised from AS1 to AS2 and AS3. 
    In certain cases the EPE-SIDs advertised by the control plane may not be in
    synchronization with the label programmed in the data-plane.  For example,
    on C a PeerAdj SID could be advertised to indicate it is for the link C->D.  
    Due to some software anomaly the actual data forwarding on this PeerAdj SID
    could be happening over the C->E link.  If E had relevant data paths for further 
    forwarding the packet, this kind of anomalies will go unnoticed by the operator.  
    A FEC definition for the EPE-SIDs will define the details of the control
    plane association of the SID.  The data plane validation of the SID will
    be done during the MPLS trace route procedure.  When there is a multi-hop EBGP 
    session between the ASBRs, PeerNode SID is advertised and the traffic MAY be
    load-balanced between the interfaces connecting the two nodes.  In the reference
    diagram C and F could have a PeerNode-SID advertised.  When the OAM packet is
    received on F, it needs to validate that the packet came on one of 
    the two interfaces connected to C.
    </t>
 <t> This document provides Target Forwarding Equivalence Class (FEC) 
 stack TLV definitions for EPE-SIDs.  Other procedures for MPLS Ping and Traceroute
as defined in  <xref target="RFC8287"/> section 7 and  clarified by <xref target="RFC8690"/> 
are applicable for EPE-SIDs as well.</t>

</section>

<section title="Theory of Operation" anchor='operation'>
<t><xref target ='RFC9086'/>  provides 
mechanisms to advertise the EPE-SIDs in BGP-LS.  These EPE-SIDs 
may be used to build Segment Routing paths as 
described in
<xref target ='I-D.ietf-idr-segment-routing-te-policy'/> or 
using Path Computation Element Protocol (PCEP) extensions as defined
in <xref target="RFC8664"/>.  Data plane monitoring for such paths which
consist of EPE-SIDs will use extensions defined in this document to 
build the Target FEC stack TLV.  The MPLS Ping and Traceroute procedures
MAY be initiated by the head-end of the Segment Routing path or a centralized
topology-aware data plane monitoring system as described in 
<xref target="RFC8403"/>.  The extensions in 
<xref target ='I-D.ietf-idr-segment-routing-te-policy'/> and 
<xref target="RFC8664"/> do not define how to carry the details
of the SID that can be used to construct the FEC.  Such
 extensions are out of scope for this document. 
 The node initiating the data plane monitoring
may acquire the  details of EPE-SIDs through BGP-LS advertisements as 
described in <xref target ='RFC9086'/>.  There may be other
 possible mechanisms to learn the definition of the SID 
from controller.  Details of such mechanisms are
out of scope for this document.</t>
<t>The EPE-SIDs are advertised for inter-AS links which run EBGP sessions. 
<xref target ='RFC9086'/>
does not define the detailed procedures to operate EBGP sessions in a scenario with
   unnumbered interfaces. Therefore, these scenarios are
   out of scope for this document.

 During AS migration scenario procedures 
described in <xref target="RFC7705"/> may be in force.  In these scenarios, 
if the local and remote AS fields in the FEC 
as described in <xref target="FEC_definitions"/> carries the
globally configured ASN and not the "local AS" as defined in <xref target="RFC7705"/>,
the FEC validation procedures may fail. </t>

</section>
  <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 anchor='FEC_definitions' title='FEC Definitions'>

<t>
   Three new sub-TLVs are defined for the Target FEC Stack TLV (Type 1),
   the Reverse-Path Target FEC Stack TLV (Type 16), and the Reply Path
   TLV (Type 21).</t> 
   <figure anchor="sub_tlv" title="New sub-TLV types">
    <artwork>
            Sub-Type    Sub-TLV Name
            --------  ---------------
             TBD1      PeerAdj SID Sub-TLV
             TBD2      PeerNode SID Sub-TLV
             TBD3      PeerSet SID Sub-TLV
             
    </artwork>
    </figure>
  

<section anchor='peer_adj_sid' title='PeerAdj SID Sub-TLV'>

<figure anchor="peer_adj_sid_tlv" title="PeerAdj SID Sub-TLV">

      <artwork>
   
        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
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |Type = TBD1                    |          Length               |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+       
       |               Local AS Number (4  octets)                     |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |              Remote AS Number (4 octets)                      |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |              Local BGP router ID (4 octets)                   |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |              Remote BGP Router ID (4 octets)                  |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |              Local Interface address (4/16 octets)            |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |              Remote Interface address (4/16 octets)           |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      


      </artwork>
      </figure>
        <t>Type             : TBD1</t>
      
        <t>Length           : variable based on IPV4/IPV6 interface address.  
                              Length excludes the length of Type and Length 
                              field.For IPV4 interface addresses length will
                              be 24.  In case of IPV6 address length will be
                              48.</t>
        
        <t>Local AS Number : </t> 
            <t>4 octet unsigned integer representing the Member-AS Number
            inside the Confederation <xref target ='RFC5065'/>.  The AS number corresponds 
            to the AS to which PeerAdj SID advertising node belongs to.</t>
        <t>Remote AS Number : </t>
            <t>4 octet unsigned integer representing the Member-AS Number
               inside the Confederation <xref target ='RFC5065'/>.  The AS number corresponds 
               to the AS of the remote node for which the PeerAdj SID
               is advertised.</t>
        <t>Local BGP Router ID :  </t> 
            <t>4 octet unsigned integer of the advertising node representing 
            the BGP Identifier
               as defined in <xref target ='RFC4271'/> and <xref target ='RFC6286'/>. </t> 
        <t>Remote BGP Router ID :  </t> 
            <t>4 octet unsigned integer of the receiving node representing 
            the BGP Identifier
               as defined in <xref target ='RFC4271'/> and <xref target ='RFC6286'/>. </t> 
        <t>Local Interface Address :</t>
            <t>In case of PeerAdj SID, Local interface address corresponding 
            to the PeerAdj SID should be specified in this field.
             For IPV4,this field is 4 octets; for IPV6, this field is 16
             octets. Link Local IPV6 addresses are for further study.</t>
         
         <t>Remote Interface Address :</t>
            <t>In case of PeerAdj SID Remote interface address corresponding
            to the PeerAdj SID should be apecified in this field.  For IPV4, 
            this field is 4 octets;  for IPV6, this field is 16
             octets.  Link Local IPv6 addresses are for further study.</t>
             
        <t><xref target ='RFC9086'/> mandates sending
        local interface ID and remote interface ID in the Link Descriptors and allows 
        a value of 0 in the remote descriptors.  It is useful to validate the 
        incoming interface for a OAM packet and if the remote descriptor is 0 
        this validation is not possible. 
        <xref target ='RFC9086'/> allows optional
        link descriptors of local and remote interface addresses as 
        described in section 4.2.  This document RECOMMENDs sending these optional
        descriptors and using them to validate incoming interface.  When these 
        local and remote interface addresses are not available, an ingress
        node can send 0 in the local and/or remote interface address field.
        The receiver SHOULD skip the validation for the incoming interface
        if the address field contains 0.</t>
        
 </section>

<section anchor='peer_node_sid' title='PeerNode SID Sub-TLV'>

<figure anchor="peer_node_sid_tlv" title="PeerNode SID Sub-TLV">

      <artwork>
   
        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
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |Type = TBD2                    |          Length               |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+              
       |               Local AS Number (4  octets)                     |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |              Remote AS Number (4 octets)                      |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |              Local BGP router ID (4 octets)                   |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |              Remote BGP Router ID (4 octets)                  |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      
      
    
     


      </artwork>
      </figure>
        <t>Type                     : TBD2</t>     
        <t>Length                   : 16
                                      </t>
        
        
        <t>Local AS Number : </t> 
            <t>4 octet unsigned integer representing the Member-AS Number
            inside the Confederation <xref target ='RFC5065'/>.  The AS number corresponds
            to the AS to which PeerNode SID advertising node belongs to.</t>
        <t>Remote AS Number : </t>
            <t>4 octet unsigned integer representing the Member-AS Number
               inside the Confederation <xref target ='RFC5065'/>.  The AS number 
               corresponds to the AS of the remote
               node for which the PeerNode SID is advertised.</t>
        <t>Local BGP Router ID :  </t> 
            <t>4 octet unsigned integer of the advertising node
            representing the BGP Identifier
               as defined in <xref target ='RFC4271'/> and <xref target ='RFC6286'/>. </t> 
        <t>Remote BGP Router ID :  </t> 
            <t>4 octet unsigned integer of the receiving node representing
            the BGP Identifier as defined in <xref target ='RFC4271'/> and <xref target ='RFC6286'/>. </t> 
        
     
    <t>When there is a multi-hop EBGP session between two ASBRs,  PeerNode SID is 
    advertised for this session and traffic can be 
    load balanced across these interfaces.
    An EPE controller that does bandiwdth management for these links should be
    aware of the links on which the traffic will be load-balanced.  As per 
    <xref target ='RFC8029'/>, the node advertising the EPE SIDs will send
    Downstream Detailed Mapping TLV (DDMAP TLV) specifying the details of nexthop
    interfaces, the OAM packet will be sent out. Based on this information
    controller MAY choose to verify the actual forwarding state with the topology
    information controller has.  On the router, the validation procedures will include,
    received DDMAP validation as specified in <xref target ='RFC8029'/> to verify the
    control and forwarding state synchronization on the two routers. Any descrepancies
    between controller's state and forwarding state will not be detected by the 
    procedures described in the document.</t>

</section>
<section anchor='peer_set_sid' title='PeerSet SID Sub-TLV'>
<figure anchor="peer_set_sid_tlv" title="PeerSet SID Sub-TLV">

      <artwork>
   
        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
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |Type = TBD3                    |          Length               |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+      
       |              Local AS Number (4  octets)                      |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |              Local BGP router ID (4 octets)                   |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |   No.of elements in set       |          Reserved             |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |              Remote AS Number (4 octets)                      |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+      
       |              Remote BGP Router ID (4 octets)                  |
       ++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-++
     
      
        One element in set consists of below details
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |              Remote AS Number (4 octets)                      |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+      
       |              Remote BGP Router ID (4 octets)                  |
       ++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-++
      
    
    
      
      
      
      
    

      </artwork>
       </figure>
      <t>Type                  : TBD3</t>
      <t>Length                : variable based on the number of 
                                 elements in the set.  The length field 
                                 does not include the length of 
                                 Type and Length fields.</t>
    
        <t>Local AS Number : </t> 
            <t>4 octet unsigned integer representing the Member-AS Number
            inside the Confederation.<xref target ='RFC5065'/>.  The AS number corresponds
            to the AS to which PeerSet SID advertising node belongs to.</t>
        <t>Remote AS Number : </t>
            <t>4 octet unsigned integer representing the Member-AS Number
               inside the Confederation <xref target ='RFC5065'/>.  The AS number
               corresponds to the AS of the remote
               node for which the PeerSet SID is advertised.</t>
        <t>Advertising BGP Router ID :  </t> 
            <t>4 octet unsigned integer of the advertising node representing
            the BGP Identifier as defined in <xref target ='RFC4271'/> and <xref target ='RFC6286'/>. </t> 
        <t>Receiving BGP Router ID :  </t> 
            <t>4 octet unsigned integer of the receiving node representing
            the BGP Identifier as defined in <xref target ='RFC4271'/> and <xref target ='RFC6286'/>. </t> 
       
         <t>No.of elements in set:</t>
         <t> Number of remote ASes, the set SID load-balances on.</t>
        <t>PeerSet SID may be associated with a number of PeerNode 
        SIDs and PeerAdj SIDs.  The remote AS number and the Router ID of each of these PeerNode SIDs
        PeerAdj SIDs MUST be included in the FEC.</t>
        
        
   
</section>
  
</section>

 <section anchor="validation" title="EPE-SID FEC validation">
 <t> 
When a remote ASBR of the EPE-SID advertisement receives the MPLS
OAM packet with top FEC being the EPE-SID, 
it SHOULD perform validity checks on the
 content of the EPE-SID FEC sub-TLV. 
 The basic length check should be performed on the received FEC.
 
 <figure anchor="length_check" title="Length Validation">

      <artwork>
 PeerAdj SID
 -----------
 Length = 24 or 48
 
 Peer Node SID
 -------------
 Length = 20 + No.of IPv4 interface pairs * 8 +
          No.of IPv6 interface pairs * 32
 
 PeerSet SID
 -----------
 Length = 9 + no.of elements in the set *
          (8 + No.of IPv4 interface pairs * 8 +
           No.of IPv6 interface pairs * 32)
           
           </artwork>
    </figure>
 </t>
 <t>
 If a malformed FEC sub-TLV 
 is received, then a return code of
1, "Malformed echo request received" as defined in <xref target="RFC8029"/>
 SHOULD be sent.  The below section augments the section 7.4 of
 <xref target="RFC8287"/> 
 </t>
 <section anchor="fec_validation" title="EPE-SID FEC validiation">
   <t> 
      
     <t> 4a. Segment Routing IGP-Prefix, IGP-Adjacency SID and  EPE-SID  Validation :</t>

    <t>If the Label-stack-depth is 0 and the Target FEC Stack sub-TLV
         at FEC-stack-depth is TBD1 (PeerAdj SID sub-TLV)</t>

            <t>Set the Best-return-code to 10, "Mapping for this FEC is not
            the given label at stack-depth  if any below
            conditions fail:</t>
            
              
            <list>
            <t>
               o  Validate that the Receiving Node BGP Local AS matches
                  with the remote AS field in the received PeerAdj SID
                  FEC sub-TLV.
            </t>
            <t>
               o  Validate that the Receiving Node BGP Router-ID matches
                  with the Remote Router ID field in the received  
                  PeerAdj SID FEC.
            </t>
            <t>         
               o  Validate that there is a EBGP session with a peer
                  having local AS number and BGP Router-ID as
                  specified in the Local AS number and Local Router-ID
                  field in the received PeerAdj SID FEC sub-TLV.
            </t>
            </list>
            <t>      
            If the Remote interface address is not zero, validate the 
            incoming interface.
            Set the Best-return-code to 35 "Mapping for this FEC is not 
            associated with the incoming interface"  <xref target ='RFC8287'/> if any below
            conditions fail:
            </t>
            <list>
            <t>
               o  Validate the incoming interface on which the OAM packet
                  was receieved, matches with the remote interface
                  specified in the PeerAdj SID FEC sub-TLV
            </t>
            </list>
            <t>
            If all above validations have passed, set the return code to 3 
            "Replying router is an egress for the FEC at stack-depth"
            </t>
    <t>
    Else, if the Target FEC sub-TLV at FEC-stack-depth is TBD2
         (PeerNode SID sub-TLV), 
    </t>
    <t>
            Set the Best-return-code to 10, "Mapping for this FEC is not
            the given label at stack-depth  if any below
            conditions fail:
    </t>
              
             <list>
             <t>
               o  Validate that the Receiving Node BGP Local AS matches with 
                  the remote AS field in the
                  received PeerNode SID FEC sub-TLV.
             </t>
             <t>
               o  Validate that the Receiving Node BGP Router-ID matches
                  with the Remote Router ID field in the received
                  PeerNode SID FEC.
            </t>
            <t>         
               o  Validate that there is a EBGP session with a peer
                  having local AS number and BGP Router-ID as
                  specified in the Local AS number and Local Router-ID
                  field in the received PeerNode SID FEC sub-TLV.
            </t>
            
            </list>
            <t>           
            If all above validations have passed, set the return code to 3 
            "Replying router is an egress for the FEC at stack-depth".
            </t>
    <t>
 
    Else, if the Target FEC sub-TLV at FEC-stack-depth is TBD3
         (PeerSet SID sub-TLV), 
    </t>
    <t>
    
            Set the Best-return-code to 10, "Mapping for this FEC is not
            the given label at stack-depth"  if any below
            conditions fail:
    </t>
              
            <list>
            <t>
               o  Validate that the Receiving Node BGP Local AS matches
                  with one of the remote AS field in the received PeerSet
                  SID FEC sub-TLV.
            </t>
            <t>

               o  Validate that the Receiving Node BGP Router-ID matches
                  with one of the  Remote Router ID field in the received
                  PeerSet SID FEC sub-TLV.
            </t>
                  
            <t>
               o  Validate that there is a EBGP session with a peer having
                  local AS number and BGP Router-ID as
                  specified in the Local AS number and Local Router-ID
                  field in the received PeerSet SID FEC sub-TLV.
            </t>
            </list>
            <t>               
            If all above validations have passed, set the return code to 3 
            "Replying router is an egress for the FEC at stack-depth" 
            </t>
</t>
</section>

 </section>
  <section anchor="IANA" title="IANA Considerations">
    <t>IANA is requested to allocated three new Target FEC stack sub-TLVs
    from the "Sub-TLVs for TLV types 1,16 and 21" subregistry in the
    "TLVs" registry of the "Multi-Protocol Label switching (MPLS)
    Label Switched Paths (LSPs) Ping parameters" namespace.

        <list>
        <t>PeerAdj SID Sub-TLV : TBD1</t>
        <t>PeerNode SID Sub-TLV: TBD2</t>      
        <t>PeerSet SID Sub-TLV : TBD3</t>
        </list>
    The three lowest free values from the Standard Tracks range should be
    allocated if possible.

       </t>

  </section>
  <section title='Security Considerations' anchor='sec-con'>
    <t>The EPE-SIDs are advertised for egress links for Egress Peer Engineering
       purposes or for inter-AS links between co-operating ASes.  
       When co-operating domains are involved, they can allow the packets
       arriving on trusted interfaces to reach the control plane
       and get processed.  When EPE-SIDs which are created for egress
       TE links where the neighbor AS is an independent entity, it may
       not allow packets arriving from external world to reach the 
       control plane.  In such deployments MPLS OAM packets will be 
       dropped by the neighboring AS that receives the MPLS OAM packet.  
       In MPLS traceroute applications, when the AS boundary is 
       crossed with the EPE-SIDs, the FEC stack is changed.
       <xref target="RFC8287"/> does not mandate that the initiator
       upon receiving an MPLS Echo Reply message that includes the
       FEC Stack Change TLV with one or more of the original 
       segments being popped remove a corresponding FEC(s) from
       the Target FEC Stack TLV in the next (TTL+1) traceroute
       request. If an initiator does not remove the FECs belonging
       to the previous AS that has traversed, it MAY expose the 
       internal AS information to the following AS being traversed in 
       traceroute.
       </t>
  </section>
  
  <section title='Acknowledgments'>
    <t>Thanks to Loa Andersson, Dhruv Dhody, Ketan Talaulikar,
    Italo Busi and Alexander Vainshtein, Deepti Rathi  for 
    careful review and comments.  </t>
  </section>
</middle>

<back>
  <references title='Normative References'>
    &RFC8287;
    &RFC8029; 
    &RFC9086;   
    &RFC2119;
    &RFC8174;
    &RFC8690;
  </references>
  <references title='Informative References'>  
    &RFC9087;   
    &RFC7705;  
    &RFC8403;
    &RFC8664;
    &RFC4271;
    &RFC5065;
    &RFC6286;
    &RFC9256;   
    <?rfc include="reference.I-D.ietf-idr-segment-routing-te-policy"?> 

  </references>
</back>
</rfc>
