<?xml version="1.0" encoding="US-ASCII"?>
<?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"
     consensus="true"
     submissionType="IETF"
     docName="draft-chen-idr-mbinding-03"
     ipr="trust200902">
  <front>
    <title abbrev="Mirror Binding">BGP for Mirror Binding</title>

     <author initials="H" surname="Chen" fullname="Huaimo Chen">
      <organization>Futurewei</organization>
      <address>
        <postal>
          <street></street>
          <city>Boston, MA</city>
          <region></region>
          <code></code>
          <country>USA</country>
        </postal>
        <email>huaimo.chen@futurewei.com</email>
      </address>
    </author>

    <author initials="B" fullname="Bruno Decraene" 
            surname="Decraene">
      <organization> Orange </organization>
      <address>
        <postal>
          <street></street>
          <city></city>
          <region></region>
          <country>France</country>
        </postal>
        <email>bruno.decraene@orange.com</email>
      </address>
     </author>
 
    <author fullname="Gyan S. Mishra" initials="G" surname="Mishra">
      <organization>Verizon</organization>
      <address>
        <postal>
          <street>13101 Columbia Pike</street>
          <city>Silver Spring</city>
          <code>MD 20904</code>
          <country>USA</country>
        </postal>
        <phone> 301 502-1347</phone>
        <email>gyan.s.mishra@verizon.com</email>
      </address>
    </author>

   <author initials="Y" fullname="Yanhe Fan" 
            surname="Fan">
      <organization>Casa Systems</organization>
      <address>
        <postal>
          <street></street>
          <city></city>
          <region></region>
          <code></code>
          <country>USA</country>
        </postal>
        <email>yfan@casa-systems.com</email>
      </address>
    </author>

     <author initials="A" fullname="Aijun Wang" 
            surname="Wang">
      <organization>China Telecom</organization>
      <address>
        <postal>
          <street>Beiqijia Town, Changping District</street>
          <city>Beijing</city>
          <region> </region>
          <code>102209</code>
          <country>China</country>
        </postal>
        <email>wangaj3@chinatelecom.cn</email>
      </address>
    </author>
<!--
   <author initials="L" fullname="Lei Liu" 
            surname="Liu">
      <organization>Fujitsu</organization>
      <address>
        <postal>
          <street> </street>
          <city> </city>
          <region></region>
          <code></code>
          <country>USA</country>
        </postal>
        <email>liulei.kddi@gmail.com</email>
      </address>
    </author>
-->
   <author initials="X" fullname="Xufeng Liu" 
            surname="Liu">
      <organization>Alef Edge</organization>
      <address>
        <postal>
          <street> </street>
          <city> </city>
          <region> </region>
          <code></code>
          <country>USA</country>
        </postal>
        <email>xufeng.liu.ietf@gmail.com</email>
      </address>
    </author>


    <date year="2023"/>

    <abstract>
     <t>BGP is used to distribute a binding to a node. 
The binding includes a binding SID and 
a path represented by a list of SIDs. 
         
        This document describes extensions to BGP for distributing
the information about the binding to a protecting node.

        For an SR path via the node with the binding SID, 
        when the node fails,
        the protecting node such as the upstream neighbor
on the path uses the information
        to protect the binding SID of the failed node.
</t>
    </abstract>

    <note 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>
    </note>
  </front>

  <middle>
    <section title="Introduction">

	
    <t><xref target="I-D.ietf-idr-segment-routing-te-policy"/> 
specifies how BGP may be used to distribute a 
Segment Routing (SR) Policy to a node in a network.
An SR Policy may contain a binding, which includes
a binding SID and a path
represented by a list of SIDs.
</t>

     <t>After a BGP as a controller distributes the binding to the node,
the node forwards the packet with the binding SID according to
the first SID in the list.
It replaces the binding SID in the packet with the list of SIDs and 
forwards the packet using the FIB entry for the top SID 
(i.e., the first SID) in the packet.</t> 

     <t>When the node fails, 
suppose that a protecting node (e.g., the upstream neighbor as PLR)
of the node has the corresponding binding protection information
for protecting the binding SID of the node.
The information includes the binding
SID, the list of SIDs and an identifier of the node. 

After the upstream neighbor as PLR detects the failure of the node,
for a packet with the node SID of the failed node received,
it protects the binding SID of the failed node.
It replaces the binding SID in the packet with the list of SIDs,
forwards the packet without going through the failed node 
towards the top SID (i.e., the first SID, assuming it is a node SID
for simplicity here).

    The requirement for distributing the binding protection 
information to a protecting node 

and how a protecting node protect the binding SID of the failed node
are 
out of scope of this document and
described in
<xref target="I-D.ietf-spring-segment-protection-sr-te-paths"/> 
and <xref target="I-D.hu-spring-segment-routing-proxy-forwarding"/>.
(Note: the second
   reference will be removed after the first one includes enough text
   for protecting binding SIDs of a node).
</t>

<t>
This document specifies some procedures and extensions 
         to BGP for distributing the information 
to a protecting node that may protect the failed node.
</t> 

    </section> <!-- Introduction -->

<!--
    <section title="Terminologies">
    <t>The following terminologies are used in this document.
      <list style="hanging" hangIndent="6">
       <t hangText="BGP:">Border Gateway Protocol</t>
      </list>
     </t>
    </section> 
-->
<!-- Terminologies -->


    <section title="Extensions to BGP">
     <t>This section defines a new Binding Protection sub-TLV  
         under a Tunnel Encapsulation Attribute TLV of type 15 
        (i.e., SR Policy TLV). 
       A Tunnel Encapsulation Attribute contains a Tunnel Encapsulation 
       Attribute TLV.
       
      The structure containing a Binding Protection 
         sub-TLV is shown below.
        <figure>
            <artwork><![CDATA[
    Attributes:
        Tunnel Encapsulation Attribute (23)
            Tunnel Type (15): SR Policy TLV
                Preference sub-TLV
                Binding SID sub-TLV 
                SRv6 Binding SID sub-TLV
                Explicit NULL Label Policy (ENLP) sub-TLV
                Priority sub-TLV
                Policy Candidate Path Name sub-TLV
                Policy Name sub-TLV
                Binding Protection sub-TLV
                Segment List sub-TLV
                    Weight sub-TLV
                    Segment sub-TLV
                    Segment sub-TLV
                    ...
                ...]]></artwork>
          </figure>
</t>


<!-- 
   A Binding Protection sub-TLV contains the information
   about a binding SID of a node in a network.
   BGP distributes the information to the neighbors of 
   the node and other nodes.

   For an SR path via the node with the binding SID, 
   when the node fails,
   the upstream node of the failed node on the path uses the information 
   to protect the binding SID of the failed node 
   (refer to 
<xref target="I-D.ietf-spring-segment-protection-sr-te-paths"/>).
-->
<!-- or
<xref target="I-D.hu-spring-segment-routing-proxy-forwarding"/>). 
-->

<t>
The format of a Binding Protection sub-TLV is
   illustrated below.

<figure anchor="binding-bsid-sub-tlv-formet" 
        title="Binding Protection sub-TLV Format">
<artwork> <![CDATA[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     |     Flags     |   RESERVED    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                           sub-TLVs                            |
~                                                               ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
</figure>

     <list style="hanging">
       <t hangText="Type:"> Its value (TBD1) is to be assigned by IANA.</t>
       <t hangText="Length:">It is variable.</t>
       <t hangText="Flags:">1 octet of flags.  No flags is defined now.
          MUST be set to zero by the sender 
          and MUST be ignored by the receiver.</t>
      <t hangText="sub-TLVs:"> This field contains 
         the sub-TLV below to indicate the node to be protected 
         (i.e., the protected node).

         <list style="hanging">
            <t hangText="o "> Protected Node ID sub-TLV 
               indicating the ID of the Protected Node.</t>
         </list>
       </t>
      </list>
</t>

<t>When an SR Policy (i.e., SR Policy TLV) contains a binding SID and a
   path with a protected node, the SR policy is for distributing the
   binding protection information.  The binding
   SID is encoded by a Binding SID sub-TLV or SRv6 Binding SID sub-TLV,
   the path is encoded by a Segment List Sub-TLV, and the node is
   encoded by a Binding Protection sub-TLV.
</t>

<t>When an SR Policy contains a binding SID and a path without a
   protected node, the SR policy is for replacing the Binding SID with
   the path (i.e., the list of SIDs) when the node receives a packet
   with the Binding SID.
</t>

<!--
<t>A Mirror Binding SID sub-TLV or Mirror SRv6 Binding SID sub-TLV
contains the information 
about a binding SID of a network node for a neighbor of the node
to protect the Binding SID of the node 
when the neighbor detects the failure of the node.
</t>

      <t>
         The format of a Mirror Binding SID sub-TLV 
is illustrated below.

<figure anchor="mirror-bsid-sub-tlv-formet" 
        title="Mirror Binding SID sub-TLV Format">
<artwork> <![CDATA[
 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     |     Flags     |   RESERVED    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                          Binding SID                          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                           sub-TLVs                            |
~                                                               ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
</figure>

     <list style="hanging">
       <t hangText="Type:"> Its value (TBD1) is to be assigned by IANA.</t>
       <t hangText="Length:">It is variable.</t>
       <t hangText="Flags:">1 octet of flags.  No flags is defined now.
          MUST be set to zero by the sender 
          and MUST be ignored by the receiver.</t>

       <t hangText="Binding SID:"> It contains a 4-octet SID.</t>

      <t hangText="sub-TLVs:"> This field contains 
         the sub-TLV below to indicate the node to be protected 
         (i.e., the protected node).

         <list style="hanging">
            <t hangText="o "> Protected Node BGP ID sub-TLV 
               indicating the BGP ID of the Protected Node.</t>
         </list>
       </t>
      </list>
</t>


      <t>
         The format of a Mirror SRv6 Binding SID sub-TLV 
is illustrated below.</t>
<t>
<figure anchor="mirror-srv6-bsid-sub-tlv-formet" 
        title="Mirror SRv6 Binding SID sub-TLV Format">
<artwork> <![CDATA[
 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     |     Flags     |   RESERVED    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                 SRv6 Binding SID (16 octets)                  |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|            SRv6 Endpoint Behavior and SID Structure           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                           sub-TLVs                            |
~                                                               ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
</figure>
</t>
<t>
     <list style="hanging">
       <t hangText="Type:"> Its value (TBD2) is to be assigned by IANA.</t>
       <t hangText="Length:">It is variable.</t>
       <t hangText="Flags:">1 octet of flags.  No flags is defined now.
          MUST be set to zero by the sender 
          and MUST be ignored by the receiver.</t>
       <t hangText="SRv6 Binding SID:">It contains a 16-octet SRv6 SID.</t>
       <t hangText="SRv6 Endpoint Behavior and SID Structure:">
          It contains SRv6 Endpoint Behavior and SID Structure.</t>
      <t hangText="sub-TLVs:"> This field contains 
         the sub-TLV below to indicate the node to be protected 
         (i.e., the protected node).

         <list style="hanging">
            <t hangText="o "> Protected Node BGP ID sub-TLV 
               indicating the BGP ID of the Protected Node.</t>
         </list>
       </t>
      </list>
</t>


<t>When a SR Policy (i.e., SR Policy TLV) contains a mirror binding SID and 
a path, the SR policy is for distributing 
the binding information of the node for protecting the binding 
SID of the node when the node fails (binding protection for short). 
The binding SID is encoded by a Binding SID sub-TLV or 
SRv6 Binding SID sub-TLV, the path is encoded by a Segment List 
Sub-TLV, and the node is encoded by a Distributing Binding Protection 
sub-TLV.
</t>

<t>When a SR Policy contains a binding SID and a path without 
a protected node, the SR policy is for replacing the Binding SID 
with the path (i.e., the list of SIDs) when the node receives 
a packet with the Binding SID (binding for short).
</t>
-->


      <t>
         The format of Protected Node ID sub-TLV 
         is illustrated below.</t>
<t>
<figure anchor="bgp-node-sub-tlv-formet" 
        title="Protected Node ID sub-TLV Format">
<artwork> <![CDATA[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 (1)   |  Length (4)   |           
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                  Protected Node ID (4 octets)                 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
</figure>
</t>

<t>
     <list style="hanging">
       <t hangText="Type:"> Its value (1) indicates the type of 
          Protected Node ID sub-TLV.</t>
       <t hangText="Length:">Its value (4) indicates the length 
          of the value field of the sub-TLV is 4.</t>
       <t hangText="Protected Node ID:"> 4-octet field 
          contains the identifier (ID) of
          the Protected Node.</t>
      </list>
</t>
    </section> <!-- Extensions to BGP -->

    <section anchor="procedure" title="Procedure for Updating Information">
      <t>When a BGP sends a binding 
<!--
(i.e., a binding SID and a SID list associated with the binding SID) 
-->
to node N
for a SR path going through node N, 
the BGP distributes the corresponding binding 
protection information to the possible protecting nodes.
The upstream neighbor of node N along the SR path
is a protecting node. 

If node N is a loose hop in the SR path with N's node ID, 

the upstream node having its node SID next to N's node ID in the SR path 
 and
the neighbors of node N are the possible protecting nodes.

</t>

      <t>After sending the binding to node N and
distributing the corresponding binding protection information 
to the protecting nodes, 
if BGP removes the binding from node N,
it removes the corresponding binding protection information 
from the protecting nodes.
If BGP changes the binding in node N,
it changes the corresponding binding protection information 
in the protecting nodes.
 </t>

<!--
      <t>After a BGP sends the binding information to node N, 
if BGP removes the binding information from node N through sending 
a third Update message to node N, BGP removes the corresponding 
binding protection information from the other nodes through 
sending a fourth Update message to the neighbor. The third message 
contains a third SR Policy carried in MP_UNREACH_NLRI. 
The third SR Policy includes the binding SID and the path 
but does not include node N as a protected node. The fourth message 
contains a fourth SR Policy carried in MP_UNREACH_NLRI. 
The fourth SR Policy includes the binding SID, the path and 
node N as a protected node. 
 </t>

      <t>After a BGP sends the binding information to node N, 
if the BGP changes the binding information in node N through 
sending a fifth Update message to node N, BGP changes the 
corresponding binding protection information in the other nodes
through sending a sixth Update message to them. 
The fifth message contains a fifth SR Policy carried in MP_REACH_NLRI. 
The fifth SR Policy includes the binding SID and a (changed) 
path but does not include node N as a protected node. 
The sixth message contains a sixth SR Policy carried in 
MP_REACH_NLRI. The sixth SR Policy includes the binding SID, 
the (changed) path and node N as a protected node. 
 </t>
-->
    </section>

    <section anchor="Security" title="Security Considerations">
      <t>Protocol extensions defined in this document do not 
      affect the BGP security other than those as discussed 
      in the Security Considerations section of 
      <xref target="RFC9012"/>.</t>
    </section>

    <section anchor="IANA" title="IANA Considerations">
      <t>This document requests assigning a new sub-TLV 
         in the registry "BGP Tunnel Encapsulation Attribute sub-TLVs"
         as follows:
        <figure>
            <artwork align="center"><![CDATA[
   +------------+--------------------+-------------+
   | Code Point | Description        | Reference   |
   +------------+--------------------+-------------+
   | TBD1       | Binding Protection |This document|
   +------------+--------------------+-------------+
]]></artwork>
          </figure>
</t>
    </section>


  </middle>

  <back>
    <references title="Normative References">
      <?rfc include="reference.RFC.2119"?>
      <?rfc include="reference.RFC.8174"?>
      <?rfc include="reference.RFC.9012"?>
      <?rfc include="reference.I-D.ietf-spring-segment-protection-sr-te-paths"?>
    </references>

    <references title="Informative References">
      <?rfc include="reference.I-D.ietf-idr-segment-routing-te-policy"?>
      <?rfc include="reference.I-D.hu-spring-segment-routing-proxy-forwarding"?>
    </references>

    <section numbered="false" toc="include" removeInRFC="false" pn="section-appendix.a">
      <name slugifiedName="name-acknowledgments">Acknowledgments</name>
      <t>The authors would like to thank 
         Andrew Stone, Robert Raszuk, Ketan Talaulikar, Donald Eastlake,
         Zhibo Hu, Haibo Wang, Yao Liu, Changwang Lin, Jie Dong and Zhenqiang Li
      for their comments to this work.</t>
    </section>

  </back>

</rfc>
