<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc SYSTEM "rfc2629-xhtml.ent">
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" submissionType="IETF"
     consensus="true" docName="draft-ietf-ospf-ospfv2-hbit-12" number="8770" category="std" updates="6987" ipr="trust200902" obsoletes="" xml:lang="en" sortRefs="true" symRefs="true" tocInclude="true" version="3">
  <!-- xml2rfc v2v3 conversion 2.39.0 -->
  <!-- Generated by id2xml 1.5.0 on 2020-02-12T16:52:09Z -->
   <front>
    <title>Host Router Support for OSPFv2</title>
    <seriesInfo name="RFC" value="8770"/>
    <author fullname="Keyur Patel" initials="K." surname="Patel">
      <organization>Arrcus</organization>
      <address>
        <email>keyur@arrcus.com</email>
      </address>
    </author>
    <author fullname="Padma Pillay-Esnault" initials="P." surname="Pillay-Esnault">
      <organization>PPE Consulting</organization>
      <address>
        <email>padma.ietf@gmail.com</email>
      </address>
    </author>
    <author fullname="Manish Bhardwaj" initials="M." surname="Bhardwaj">
      <organization>Cisco Systems</organization>
      <address>
        <postal>
          <street>170 W. Tasman Drive</street>
          <city>San Jose</city>
          <region>CA</region>
          <code>95134</code>
          <country>United States of America</country>
        </postal>
        <email>manbhard@cisco.com</email>
      </address>
    </author>
    <author fullname="Serpil Bayraktar" initials="S." surname="Bayraktar">
      <organization>Cisco Systems</organization>
      <address>
        <postal>
          <street>170 W. Tasman Drive</street>
          <city>San Jose</city>
          <region>CA</region>
          <code>95134</code>
          <country>United States of America</country>
        </postal>
        <email>serpil@cisco.com</email>
      </address>
    </author>
    <date month="April" year="2020"/>

<keyword>non-transit</keyword>

    <abstract>
      <t>
   The Open Shortest Path First Version 2 (OSPFv2) protocol does not
   have a mechanism for a node to repel transit traffic if it is on the
   shortest path.  This document defines a bit called the Host-bit (H-bit). This bit enables a
   router to advertise that it is a non-transit router.  This document also
   describes the changes needed to support the H-bit in the domain.  In
   addition, this document updates RFC 6987 to advertise Type 2 External
   and Not-So-Stubby Area (NSSA) Link State Advertisements (LSAs) 
   (RFC 3101) with a high cost in order to repel traffic effectively.</t>
    </abstract>
  </front>
  <middle>
    <section anchor="sect-1" numbered="true" toc="default">
      <name>Introduction</name>
      <t>
   The OSPFv2 protocol specifies a Shortest Path First (SPF) algorithm
   that identifies transit vertices based on their adjacencies.
   Therefore, OSPFv2 does not have a mechanism to prevent traffic
   transiting a participating node if it is a transit vertex in the only
   existing or shortest path to the destination.  The use of metrics to
   make the node undesirable can help to repel traffic only if an
   alternative better route exists.</t>
      <t>
   A mechanism to move traffic away from the shortest path is
   particularly useful for a number of use cases:</t>
      <ol spacing="normal" type="1">
        <li>Graceful isolation of a router, to avoid blackhole scenarios when
       there is a reload and possible long reconvergence times.</li>
        <li>Closet switches that are not usually used for transit traffic but need
       to participate in the topology.</li>
        <li>Overloaded routers that could use such a capability to temporarily
       repel traffic until they stabilize.</li>
        <li>BGP route reflectors, known as virtual Route Reflectors,
       that are not in the forwarding path but are in central locations
       such as data centers.  Such route reflectors are typically used
       for route distribution and are not capable of forwarding transit
       traffic.  However, they need to learn the OSPF topology to
       perform SPF computation for optimal routes and reachability
       resolution for their clients
       <xref target="BGP-ORR" format="default"/>.</li>
      </ol>
      <t>
   This document describes the functionality provided by the Host-bit (H-bit);
   this functionality prevents other OSPFv2 routers from using the host router by excluding
   it in path calculations for transit traffic in OSPFv2 routing
   domains.  If the H-bit is set, then the calculation of the
   shortest-path tree for an area, as described in <xref target="RFC2328" sectionFormat="of" section="16.1"/>, is
   modified by including a check to verify that transit vertices DO NOT
   have the H-bit set (see <xref target="sect-4" format="default"/>).  Furthermore, in order to repel
   traffic effectively, this document updates <xref target="RFC6987"
   format="default"/> so that Type&nbsp;2 External and Not-So-Stubby Area (NSSA)
   Link State Advertisements (LSAs) <xref target="RFC3101"/>
   are advertised with a high cost (see <xref target="sect-6" format="default"/>).  OSPFv3 <xref target="RFC5340"/> defines an
   option bit, known as the R-bit, for router-LSAs; the H-bit supports similar functionality.</t>
    </section>
    <section anchor="sect-2" numbered="true" toc="default">
      <name>Requirements Language</name>
       <t>The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>",
       "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>",
       "<bcp14>SHALL NOT</bcp14>", "<bcp14>SHOULD</bcp14>",
       "<bcp14>SHOULD NOT</bcp14>",
       "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
       "<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document
       are to be interpreted as described in BCP&nbsp;14
       <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only
       when, they appear in all capitals, as shown here.</t>
    </section>
    <section anchor="sect-3" numbered="true" toc="default">
      <name>Host-Bit Support</name>
      <t>
   This document defines a new router-LSA bit, known as the Host-bit or
   the H-bit.  An OSPFv2 router advertising a router-LSA with the H-bit
   set indicates that it <bcp14>MUST NOT</bcp14> be used as a transit router (see
   <xref target="sect-4" format="default"/>) by other OSPFv2 routers in the
   area that support the H-bit functionality.</t>
      <t>
   If the H-bit is not set, then backward compatibility is achieved, as
   the behavior will be the same as in <xref target="RFC2328" format="default"/>.</t>
      <figure anchor="ure-ospf-router-lsa">
        <name>OSPF Router-LSA</name>
        <artwork name="" type="" align="left" alt=""><![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
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |            LS age             |     Options   |       1       |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                        Link State ID                          |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                     Advertising Router                        |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                     LS sequence number                        |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |         LS checksum           |             length            |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |H|0|0|N|W|V|E|B|        0      |            # links            |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                          Link ID                              |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                         Link Data                             |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |     Type      |     # TOS     |            metric             |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                              ...                              |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |      TOS      |        0      |          TOS metric           |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                          Link ID                              |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                         Link Data                             |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                              ...                              |]]></artwork>
      </figure>

        <t>Bit H is the high-order bit of the OSPF flags, as shown below.</t>
      <figure anchor="ure-ospf-router-lsa-option-bits">
        <name>OSPF Router-LSA Option Bits</name>
        <artwork name="" type="" align="left" alt=""><![CDATA[
                            0 1 2 3 4 5 6 7
                            +-+-+-+-+-+-+-+-+
                            |H|0|0|N|W|V|E|B|
                            +-+-+-+-+-+-+-+-+]]></artwork>
      </figure>
      <t>
   When the H-bit is set, the OSPFv2 router is a host (non-transit)
   router and is incapable of forwarding transit traffic.  In this mode,
   the other OSPFv2 routers in the area <bcp14>MUST NOT</bcp14> use the host router for
   transit traffic but may send traffic to its local destinations.</t>
      <t>
   An OSPFv2 router originating a router-LSA with the H-bit set <bcp14>MUST</bcp14>
   advertise all its non-stub links with a link cost of MaxLinkMetric
   <xref target="RFC6987" format="default"/>.</t>
      <t>
   When the H-bit is set, an Area Border Router (ABR) <bcp14>MUST</bcp14> advertise the
   same H-bit setting in its self-originated router-LSAs for all
   attached areas.  The consistency of the setting will prevent
   inter&nbhy;area traffic transiting through the router by suppressing
   advertisements of prefixes from other routers in the area in its
   summary-LSAs.  Only IPv4 prefixes associated with its local
   interfaces <bcp14>MUST</bcp14> be advertised in summary-LSAs to provide reachability
   to end hosts attached to a router with the H-bit set.</t>
      <t>
   When the H-bit is set, the host router cannot act as an Autonomous System
   Border Router (ASBR).  Indeed, ASBRs are transit routers to prefixes that are
   typically imported through redistribution of prefixes from other
   routing protocols.  Therefore, non-local IPv4 prefixes, e.g., those
   imported from other routing protocols, <bcp14>SHOULD NOT</bcp14> be advertised in
   AS-external-LSAs if the H-bit is set.  Some use cases, such as an
   overloaded router or a router being gracefully isolated, may benefit
   from continued advertisements of non-local prefixes.  In these cases,
   the Type&nbsp;2 metric in AS-external-LSAs <bcp14>MUST</bcp14> be set to
   LSInfinity <xref target="RFC2328"/> to
   repel traffic (see <xref target="sect-6"/> of this document).</t>
    </section>
    <section anchor="sect-4" numbered="true" toc="default">
      <name>SPF Modifications</name>
      <t>
   The SPF calculation described in <xref target="RFC2328" sectionFormat="of"
   section="16.1"/> is
   modified to ensure that the routers originating router-LSAs with the
   H-bit set will not be used for transit traffic.  Step (2) is
   modified to include a check on the H-bit, as shown below.  (Please note
   that all of the sub-procedures of Step (2) remain unchanged and are not included in
   the excerpt below.)</t>
      <ul empty="true" spacing="normal">
        <li>
          <dl newline="false" spacing="normal" indent="5">
            <dt>(2)</dt><dd>Call the vertex just added to the
            tree "vertex V".  Examine the LSA
            associated with vertex V.  This is
            a lookup in Area&nbsp;A's link state
            database based on the Vertex ID. If
            this is a router-LSA, and the H-bit
            of the router-LSA is set, and
            vertex V is not the root, then the
            router should not be used for transit
            and Step (3) should be executed
            immediately. If this is a router-LSA
            and bit V of the router-LSA (see
            Appendix A.4.2) is set, set Area A's
            TransitCapability to TRUE. In any case,
            each link described by the LSA gives
            the cost to an adjacent vertex.  For
            each described link (say it joins
            vertex V to vertex W):</dd>
          </dl>
        </li>
      </ul>
    </section>
    <section anchor="sect-5" numbered="true" toc="default">
      <name>Autodiscovery and Backward Compatibility</name>
      <t>
   To reduce the possibility of any routing loops due to partial
   deployment, this document defines an OSPF Router Information (RI) LSA
   capability bit <xref target="RFC7770" format="default"/>.  See
   <xref target="sect-7"/> (<xref target="tab-2"/>).
      </t>

   <t>The RI LSA <bcp14>MUST</bcp14> be area-scoped.</t>
      <t>
   Autodiscovery via announcement of the OSPF Host Router capability
   (<xref target="sect-7"/>)
   ensures that the H-bit functionality and its associated SPF changes
   <bcp14>MUST</bcp14> only take effect if all the routers in a given OSPF area support
   this functionality.</t>
      <t>
   In normal operation, it is possible that the RI LSA will fail to
   reach all routers in an area in a timely manner.  For example, if a
   new router without H-bit support joins an area that previously had
   only H-bit-capable routers with the H-bit set, then it may take some time
   for the RI LSA to propagate to all routers.  While it is propagating, the
   routers in the area will gradually detect the presence of a router
   that does not support the capability and will revert back to the normal SPF
   calculation.  During the propagation time, the area as a whole is
   unsure of the status of the new router; this type of situation can cause temporary
   transient loops.</t>
      <t>
   The following recommendations will mitigate transient routing loops:</t>
      <ul spacing="normal">
        <li>Implementations are <bcp14>RECOMMENDED</bcp14> to provide a configuration
      parameter to manually override enforcement of the H-bit
      functionality in partial deployments where the topology guarantees
      that OSPFv2 routers not supporting the H-bit do not compute routes
      resulting in routing loops.</li>
        <li>All routers with the H-bit set <bcp14>MUST</bcp14> advertise all of the router's
      non-stub links with a metric equal to MaxLinkMetric <xref target="RFC6987" format="default"/> in
      its LSAs in order to prevent OSPFv2 routers (unless a last-resort path)
      that do not support the H-bit from attempting to use the non-stub links for transit
      traffic.</li>
        <li>All routers supporting the H-bit <bcp14>MUST</bcp14> check the RI LSAs of all
      nodes in the area to verify that all nodes support the H-bit
      before actively using the H-bit feature.  If any router does not
      advertise the OSPF Host Router capability (<xref target="sect-7"/>), then the SPF
      modifications described in <xref target="sect-4" format="default"/> <bcp14>MUST NOT</bcp14> be used in the area.</li>
      </ul>
    </section>
    <section anchor="sect-6" numbered="true" toc="default">
      <name>OSPF AS-External-LSAs / NSSA-LSAs with Type 2 Metrics</name>
      <t>
   When calculating the path to a prefix in an OSPF AS-external-LSA or
   NSSA-LSA <xref target="RFC3101" format="default"/> with a Type&nbsp;2 metric, the advertised Type&nbsp;2 metric
   is taken as more significant than the OSPF intra-area or inter-area
   path.  Hence, advertising the links with MaxLinkMetric as specified
   in <xref target="RFC6987" format="default"/> does not discourage transit
   traffic when calculating AS-external or NSSA routes with Type&nbsp;2 metrics.</t>
      <t>
   Consequently, this document updates <xref target="RFC6987" format="default"/> so that the Type&nbsp;2 metric in any
   self-originated AS-external-LSAs or NSSA-LSAs is advertised as
   LSInfinity-1 <xref target="RFC2328" format="default"/>.
  If the H-bit is set, then the Type&nbsp;2 metric
   <bcp14>MUST</bcp14> be set to LSInfinity.</t>
    </section>
    <section anchor="sect-7" numbered="true" toc="default">
      <name>IANA Considerations</name>
      <t>
   IANA has registered the following value in the 
   "OSPFv2 Router Properties Registry".</t>

<table anchor="tab-1">
  <name>H-Bit</name>
  <thead>
    <tr>
      <th>Value</th>
      <th>Description</th>
      <th>Reference</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>0x80</td>
      <td>Host (H-bit)</td>
      <td>RFC 8770</td>
    </tr>
  </tbody>
</table>

      <t>
   IANA has registered the following in the "OSPF Router
   Informational Capability Bits" registry.</t>

<table anchor="tab-2">
  <name>OSPF Host Router Capability Bit</name>
  <thead>
    <tr>
      <th>Bit Number</th>
      <th>Capability Name</th>
      <th>Reference</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td align="center">7</td>
      <td>OSPF Host Router</td>
      <td>RFC 8770</td>
    </tr>
  </tbody>
</table>

    </section>
    <section anchor="sect-8" numbered="true" toc="default">
      <name>Security Considerations</name>
      <t>
   This document introduces the H-bit, which is a capability feature that
   restricts the use of a router for transit, while only its local
   destinations are reachable.  This is a subset of the operations of a
   normal router and therefore should not introduce new security
   considerations beyond those already known in OSPFv2 <xref target="RFC2328" format="default"/>.  The
   feature introduces the advertisement of host router capability
   information to all OSPFv2 routers in an area.  This information can
   be leveraged for discovery and verification that all routers in the
   area support the capability before the feature is turned on.  In the
   event that a rogue or buggy router incorrectly advertises its
   capability, possible scenarios are as follows:</t>
      <ul spacing="normal">
        <li>The router does not have the capability but sends the H-bit set in
      its LSAs. In this case, a routing loop is possible.
      However, this is mitigated by the fact that this router should be
      avoided anyway.  Moreover, the link metrics cost (MaxLinkMetric)
      of this router will mitigate this situation.  In any case, a
      router advertising the H-bit capability without its link metrics cost
      equal to MaxLinkMetric could be a rogue
      router and should be avoided.</li>
        <li>The router has the capability but sends the H-bit clear in its
      LSAs. In this case, the router merely prevents the support of other
      H-bit routers in the area and prevents all the routers from running the modified
      SPF.  Any impacts are also mitigated in this scenario, as other H-bit routers in the
      area also advertise the MaxLinkMetric cost, so they will still be
      avoided unless they are the last&nbhy;resort path.</li>
        <li>The rogue router is on the only transit path for some destinations
      and sends the H-bit set (for no good/valid reason) in its LSAs, and
      effectively partitions the network.  This case is indistinguishable
      from the normal case where an operator may consciously decide to
      set the H-bit to perform maintenance on a router that is on the
      only transit path.  The OSPF protocol will continue to function
      within the partitioned domains.</li>
      </ul>
    </section>
  </middle>
  <back>
    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2328.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6987.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7770.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
      </references>
      <references>
        <name>Informative References</name>

<!-- draft-ietf-idr-bgp-optimal-route-reflection (I-D Exists) -->
<!-- Repository file missing "editor" entry, so have to do "long way" -->
        <reference anchor="BGP-ORR" 
target="https://tools.ietf.org/html/draft-ietf-idr-bgp-optimal-route-reflection-20">
          <front>
            <title>BGP Optimal Route Reflection (BGP-ORR)</title>
            <seriesInfo name="Work in Progress, Internet-Draft," value="draft-ietf-idr-bgp-optimal-route-reflection-20"/>
            <author initials="R" surname="Raszuk" fullname="Robert Raszuk" role="editor">
              <organization/>
            </author>
            <author initials="C" surname="Cassar" fullname="Christian Cassar">
              <organization/>
            </author>
            <author initials="E" surname="Aman" fullname="Erik Aman">
              <organization/>
            </author>
            <author initials="B" surname="Decraene" fullname="Bruno Decraene">
              <organization/>
            </author>
            <author initials="K" surname="Wang" fullname="Kevin Wang">
              <organization/>
            </author>
            <date month="January" day="8" year="2020"/>
          </front>
        </reference>

<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3101.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5340.xml"/>
      </references>
    </references>
    <section anchor="acknowledgements" numbered="false" toc="default">
      <name>Acknowledgements</name>
      <t>
   The authors would like to acknowledge <contact fullname="Hasmit Grover"/> for discovering
   the limitation in <xref target="RFC6987" format="default"/>, and <contact
   fullname="Acee Lindem"/>, <contact fullname="Abhay Roy"/>, <contact
   fullname="David Ward"/>, <contact fullname="Burjiz Pithawala"/>, and <contact fullname="Michael Barnes"/> for their comments.</t>
    </section>
  </back>
</rfc>
