<?xml version="1.0" encoding="US-ASCII"?>
<!-- edited with XMLSPY v5 rel. 3 U (http://www.xmlspy.com)
     by Daniel M Kohn (private) -->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY rfc2119 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.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-wang-lsr-bidirectional-metric-spf-00"
     ipr="trust200902">
  <front>
    <title abbrev="BM-TE">Bidirectional Metric based Shortest Path First
    Mechanism</title>

    <author fullname="Aijun Wang" initials="A" surname="Wang">
      <organization>China Telecom</organization>

      <address>
        <postal>
          <street>Beiqijia Town, Changping District</street>

          <city>Beijing</city>

          <code>102209</code>

          <country>China</country>
        </postal>

        <email>wangaj3@chinatelecom.cn</email>
      </address>
    </author>

    <date day="11" month="February" year="2025"/>

    <area>RTG Area</area>

    <workgroup>LSR Working Group</workgroup>

    <keyword>RFC</keyword>

    <abstract>
      <t>This document describes the mechanism that can be used to accomplish
      the Shortest Path First(SPF) calculation within network based on the
      bidirectional metrics of the links.</t>
    </abstract>
  </front>

  <middle>
    <section anchor="intro" title="Introduction">
      <t>IGP SPF algorithm is computed based on the link metric value in each
      direction. If the metric value of the link in each direction is
      different at the two endpoints of the link, the forward and return path
      of one service may be different. This can cause the difficult to
      identify, control or QoS assurance for the specified services. And, for
      intra-domain source address validation(SAV mechanism) deployment, if the
      operator can assure there is no asymmetric path existing within its
      network, it will be easier for them to deploy the intra-domain SAV
      mechanism.</t>

      <t>But, there is no easy way to find the inconsistent settings of the
      bidirectional metric value of one link.</t>

      <t>There are also other scenarios that described in <xref
      target="RFC8500"/> and <xref target="RFC9339"/> that the operator wants
      to set the metric value of a link in one end to influence the traffic
      from the other ends. Reverse metric mechanism is one valid solution in
      some scenarios but it is not one general solution for other similar
      situation.</t>

      <t>This document proposes one general solution that can solve the above
      problems, which utilizes the bidirectional metric values during the SPF
      calculation to make sure the bidirectional traffic of one service always
      follow the same path, regardless of the metric values setting of a link
      in each direction. It can also get the effect of setting the metric
      value in one end to influence the traffic to and from the node in both
      directions.</t>
    </section>

    <section title="Conventions used in this document">
      <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"/>
      .</t>
    </section>

    <section anchor="BM-SPF"
             title="Bidirectional Metric based SPF(BM-SPF) Overview">
      <t>IS-IS<xref target="RFC1195"/>, OSPF <xref target="RFC2328"/> and
      OSPFv3 <xref target="RFC5340"/>describes the basic process for
      calculating the shortest path between two endpoints in the IGP domain.
      The link metric is used to represent the output cost of the interface.
      Normally, such metric is set based on the link capacity and in current
      network, there is seldom situation that the bidirectional capacity of
      the link are different.</t>

      <t>It is possible to require the both endpoints of the link to set the
      same value for the metric value, but there is no easy way to assure
      this. To solve such problem, this document proposes the bidirectional
      metric based SPF calculation procedures as the followings:</t>

      <t>1) The configured link metric is advertised as the normal
      process.</t>

      <t>2) When the IGP neighbors are formed, the cost to each other are set
      to the maximum value of advertised link metric to each other.</t>

      <t>3) The calculated value is stored in the LSDB and then the normal SPF
      calculation process will be applied.</t>

      <t>After the above procedures, the bidirectional route for one any
      service will be assured to follow the same path. There are also other
      benefits that such mechanism can afford, which are described in the
      followings sections.</t>
    </section>

    <section title="Applicabilication of BM-SPF mechanism in various scenarios">
      <t>This section described the application of BM-SPF mechanism in various
      scenarios.</t>

      <section title="Consistence in Forwarding and Return Path">
        <t>Figure 1 illustrates one example that the inconsistence forwarding
        and return path will be emerged when the bidirectional metric values
        are different. Based on the value on the link metric, the traffic from
        R1 to R4 will follow R1-R2-R4 path, but the return traffic will follow
        R4-R3-R1.</t>

        <t><figure>
            <artwork align="center"><![CDATA[           15    5
       +-------+R2+-------+
       |                  | 15
    5  +                  +
       R1                 R4
    20 +                  + 5
       +-------+R3+-------+
              5    20
Figure 1: Inconsistence forwarding and return path 
]]></artwork>
          </figure></t>

        <t>Based on the BM-TE mechanism described in <xref target="BM-SPF"/>,
        the maximum value of the bidirectional link metric between each
        neighbor will be used to calculate the shortest path to each endpoint.
        The actual used values are shown in the Figure 2.</t>

        <t>It is obviously that the traffic from R1 to R4 and the return
        traffic from R4 to R1 will all follow the same path, as R1, R2,
        R4.</t>

        <t><figure>
            <artwork align="center"><![CDATA[           15      15
       +-------+R2+-------+
       |                  | 15
    15 +                  +
       R1                 R4
    20 +                  + 20
       +-------+R3+-------+
             20    20
Figure 2: Consistence forwarding and return path 
]]></artwork>
          </figure></t>
      </section>

      <section title="Control Traffic from the Reverse Direction">
        <t>Figure 3 illustrates the situation that when the interface from R1
        to R2 is in abnormal state and needs to be maintained, the operator
        can change the configured metric value on R1 for this interface to
        higher or the maximum value, and let the traffic from R1 to R2 switch
        to other link, for example, R1-R3-R2.</t>

        <t>But just doing so can't divert also the incoming traffic from R2 to
        R1 at the same time, thus the incoming traffic will be dropped during
        the maintenance period. Based on the BM-SPF mechanism, the configured
        higher value of the two directional metric will be used in the SPF
        calculation. Then the traffic from R2 to R1 will be diverted
        simultaneously when the operator increase the metric value on the
        R1.</t>

        <t><figure>
            <artwork align="center"><![CDATA[                      5
              +--------+R1+------+
              |       20+        |
              |         |        |
            5 +       20+        +
              R2+------+R3+-----+R4
                8     8
Figure 3: Control traffic from the reverse direction
]]></artwork>
          </figure></t>
      </section>

      <section anchor="section4.3" title="BM-SPF in LAN environment ">
        <t>In LAN environment described in Figure 4. If the bidirectional
        metric value are different in each side, there is no way to
        differentiate the metric for each pairs of the communication peers.
        For example, from the viewpoints of the R1, the cost 5 will be used to
        reach all of its peers on the LAN, and from the viewpoint of the R2,
        the cost 8 will be used to reach all of its peers on the LAN.</t>

        <t>Based on the BM-SPF mechanism, the cost for each pair can be
        different. For example, from the viewpoint of the R1, the cost 8 will
        be used to reach R2, the cost 10 will be used to reach R3 and the cost
        12 will be reached to reach R4. The situation will be same for R2. It
        is easy to accomplish the UCMP traffic engineering effect among their
        neighbor based on the BM value. For R4, the same value will be used to
        reach each of its communication peer, and traffic from it will be
        distributed evenly to its neighbors.</t>

        <t><figure>
            <artwork align="center"><![CDATA[                    R1
                    |5
            +---------------+
            |       |       |
            |8      |10     |12
            +       +       +
            R2      R3      R4
Figure 4: Traffic Engineering in LAN environment
]]></artwork>
          </figure></t>
      </section>
    </section>

    <section title="BM-SPF Router Capabilities Announcements">
      <t>To assure the consistence and determined behaviors within the
      network, it is necessary to assure the nodes have the same capabilities
      to support BM-SPF. The router should announce such capability within the
      IGP domain.</t>

      <t>For IS-IS, one bit(BM bit, 0x04) from the Flags field of IS-IS Router
      CAPABILITY TLV <xref target="RFC7981"/> is assigned.</t>

      <t>For OSPFv2, one bit (BM bit, 0x20) from the OSPF Option field <xref
      target="RFC2328"/> is assigned</t>

      <t>For OSPFv3, one bit(BM bit, 0x08) from the OSPF Option field <xref
      target="RFC5340"/> is assigned</t>

      <t>BM bit: When BM bit is set, it indicates that the maximum value of
      the bidirectional metrics of a link between the neighbors will be used
      to calculate the SPF path to each peer. When BM bit is clear, it
      indicates that the configured metric on each end of the link will be
      used to calculate the path.</t>
    </section>

    <section title="Deployment Considerations">
      <t>The BM-SPF mechanism can be deployed incrementally. If the neighbor
      doesn't support the BM-SPF capabilities, the metric value configured on
      the interface should be used instead.</t>
    </section>

    <section title="Security Considerations">
      <t>Security concerns for ISIS are addressed in <xref target="RFC5304"/>
      and<xref target="RFC5310"/></t>

      <t>Security concern for OSPFv3 is addressed in <xref
      target="RFC4552"/></t>

      <t>Advertisement of the additional information defined in this document
      introduces no new security concerns.</t>
    </section>

    <section anchor="section7" title="IANA Considerations">
      <t>IANA is requested to the allocation in following registries:</t>

      <t><figure>
          <artwork><![CDATA[+===========================================+==========+===========================+
| Registry                                  | Position |       Meaning             |
+===========================================+==========+===========================+
|OSPFv2 Router Properties Registry          | 0x20     |      BM bit               |
+-------------------------------------------+----------+---------------------------+
|OSPFv3 Router Properties Registry          | 0x08     |      BM bit               |
+-------------------------------------------+----------+---------------------------+
|IS-IS Flag field in Router CAPABILITIES TLV| 0x04     |      BM bit               |
+-------------------------------------------+----------+---------------------------+
   Figure 5: IANA Allocation for BM bit in OSPFv2, OSPFv3 and IS-IS
]]></artwork>
        </figure></t>
    </section>

    <section title="Acknowledgement">
      <t>TBD</t>
    </section>
  </middle>

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

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

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

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

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

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

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

      <?rfc include="reference.RFC.7981"?>
    </references>

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

      <?rfc include="reference.RFC.9339"?>
    </references>
  </back>
</rfc>
