<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE rfc [
 <!ENTITY nbsp    "&#160;">
 <!ENTITY zwsp   "&#8203;">
 <!ENTITY nbhy   "&#8209;">
 <!ENTITY wj     "&#8288;">
]> 

<rfc xmlns:xi="http://www.w3.org/2001/XInclude" category="std" ipr="trust200902" docName="draft-ietf-lsr-ospf-admin-tags-29" number="9825" consensus="true" updates="" obsoletes="" submissionType="IETF" version="3" symRefs="true" sortRefs="true" xml:lang="en" tocInclude="true">
  
  <front>
    <title abbrev="OSPF Administrative Tags">Extensions to OSPF for Advertising Prefix Administrative Tags</title>
    <seriesInfo name="RFC" value="9825"/>

  <author initials='A.' surname="Lindem" fullname='Acee Lindem' role="editor">
    <organization>LabN Consulting, L.L.C.</organization>
    <address>
      <postal>
        <street>301 Midenhall Way</street>
        <city>Cary</city> <region>NC</region>
        <country>United States of America</country>
        <code>27513</code>
       </postal>
       <email>acee.ietf@gmail.com</email>
    </address>
    </author>

  <author initials='P.' surname="Psenak" fullname='Peter Psenak'>
    <organization>Cisco Systems</organization>
    <address>
      <postal>
        <street>Apollo Business Center</street>
        <street>Mlynske nivy 43</street>
        <city>Bratislava</city>
	<code>821 09</code>
        <country>Slovakia</country>
       </postal>
       <email>ppsenak@cisco.com</email>
    </address>
  </author>

  <author fullname="Yingzhen Qu" initials="Y" surname="Qu">
    <organization>Futurewei Technologies</organization>
    <address>
      <postal>
        <street>2330 Central Expressway</street>
          <city>Santa Clara</city>
          <region>CA</region>
          <code>95050</code>
          <country>United States of America</country>
        </postal>
        <email>yingzhen.ietf@gmail.com</email>
    </address>
  </author>

  <date month="July" year="2025"/>
  <area>RTG</area>
  <workgroup>lsr</workgroup>

  <abstract>
   <t>It is useful for routers in OSPFv2 and OSPFv3 routing domains to be able to
   associate tags with prefixes.
   Previously, OSPFv2 and OSPFv3 were relegated to a single tag and only for Autonomous
   System (AS) External and Not-So-Stubby-Area (NSSA) prefixes.
   With the flexible encodings provided by OSPFv2 Prefix/Link Attribute Advertisement
   and OSPFv3 Extended Link State Advertisements (LSAs), multiple administrative
   tags may be advertised for all types of prefixes. These administrative
   tags can be used for many applications including route redistribution policy, selective
   prefix prioritization, selective IP Fast Reroute (IPFRR) prefix protection, and many
   others.</t>
  </abstract>
</front>

<middle>
<section>
  <name>Introduction</name>
  <t>
    It is useful for routers in OSPFv2 <xref target="RFC2328"/>
    and OSPFv3 <xref target="RFC5340"/> routing domains to be able to associate tags with prefixes.
    Previously, OSPFv2 and OSPFv3 were relegated to a single tag and only for Autonomous System (AS)
    External and Not-So-Stubby-Area (NSSA) prefixes.
    With the flexible encodings provided by OSPFv2 Prefix/Link Attribute Advertisement
    <xref target="RFC7684"/> and OSPFv3 Extended Link State Advertisement (LSA) <xref target="RFC8362"/>,
    multiple administrative tags may be advertised for all types of prefixes. These administrative
    tags can be used in many applications including (but not limited to):
  </t>
  <ol spacing="normal">
   <li>Controlling which routes are redistributed into other protocols for
       re-advertisement.</li>
   <li>Prioritizing selected prefixes for faster convergence and installation in the
      forwarding plane.</li>
   <li>Identifying selected prefixes for Loop-Free Alternative (LFA) protection.</li>
  </ol>
  <t>Throughout this document, "OSPF" is used when the text applies to both
   OSPFv2 and OSPFv3.  "OSPFv2" or "OSPFv3" is used when the text is
   specific to one version of the OSPF protocol.</t>
  <t>The definition of the 64-bit tag was considered but discarded, given that
     there is no strong requirement or use case.</t>
  <t>The IS-IS protocol supports a similar mechanism that is described in
  <xref target="RFC5130"/>.</t>

  <section>
    <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>

<section anchor="UINT32-TAG">
  <name>Administrative Tag Sub-TLV</name>
  <t>This document creates a new Administrative Tag Sub-TLV for OSPFv2 and
   OSPFv3. This sub-TLV specifies one or
   more 32-bit unsigned integers that may be associated with an
   OSPF advertised prefix. The precise usage of these tags is beyond
   the scope of this document.</t>
    <t>
      The format of the Administrative Tag Sub-TLV is as follows:
    </t>
<figure>
  <name>Administrative Tag Sub-TLV</name>
  <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             |             Length            |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |             First Administrative Tag                          |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                             o                                 |
                                 o
   |                             o                                 |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |             Last Administrative Tag                           |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
</figure>

  <dl spacing="normal" newline="false">
  <dt>Type:</dt><dd><t>A 16-bit field set to:</t>
  <dl spacing="normal" newline="false">
  <dt>13:</dt><dd>"OSPFv2 Extended Prefix TLV Sub-TLVs" registry</dd>
  <dt>39:</dt><dd>"OSPFv3 Extended-LSA Sub-TLVs" registry</dd>
  <dt>6:</dt><dd>"OSPFv3 SRv6 Locator LSA Sub-TLVs" registry</dd>
</dl>
</dd>
  <dt>Length:</dt><dd>A 16-bit field that indicates the length of the value
  portion in octets and <bcp14>MUST</bcp14> be a multiple of 4 octets
  dependent on the number of administrative tags
  advertised. At least one administrative tag <bcp14>MUST</bcp14> be
  advertised.</dd>
  <dt>Value:</dt><dd>A variable length list of one or more administrative
  tags.</dd>
  </dl>

  <t>
    This sub-TLV will carry one or more 32-bit unsigned integer values
    that will be used as administrative tags. If the length is 0 or not
    a multiple of 4 octets, the sub-TLV <bcp14>MUST</bcp14> be ignored, and the reception
    <bcp14>SHOULD</bcp14> be logged for further analysis (subject to rate-limiting).
   </t>
</section>
<section anchor="APPLICABILTY">
  <name>Administrative Tag Applicability</name>
  <t>
    The Administrative Tag Sub-TLV specified herein will be valid as a sub-TLV of
    the following TLVs specified in <xref target="RFC7684"/>:
  </t>
  <ul spacing="normal">
    <li>Extended Prefix TLV advertised in the OSPFv2 Extended Prefix Opaque LSA</li>
  </ul>
  <t>
    The Administrative Tag Sub-TLV specified herein will be valid as a sub-TLV of
    the following TLVs specified in <xref target="RFC8362"/>:
  </t>
  <ul spacing="normal">
    <li>Inter-Area-Prefix TLV advertised in the E-Inter-Area-Prefix-LSA</li>
    <li>Intra-Area-Prefix TLV advertised in the E-Intra-Area-Prefix-LSA</li>
    <li>External-Prefix TLV advertised in the E-AS-External-LSA and the E-NSSA-LSA</li>
  </ul>
  <t>
    The Administrative Tag Sub-TLV specified herein will be valid as a sub-TLV of
    the following TLVs specified in <xref target="RFC9513"/>:
  </t>
  <ul spacing="normal">
    <li>SRv6 Locator TLV advertised in the SRv6 Locator LSA</li>
  </ul>
</section>
<section anchor="OSPF-OPERATION">
  <name>Protocol Operation</name>
  <t>An OSPF router supporting this specification <bcp14>MUST</bcp14> be able to advertise and interpret
  at least one tag for all types of prefixes. An OSPF router supporting this
  specification <bcp14>MAY</bcp14> be able to advertise prefixes with multiple tags and propagate prefixes
  with multiple tags between areas. The
  maximum tags that an implementation supports is a local matter depending upon supported
  applications using prefix tags.  Depending on the application, the number of tags supported
  by the OSPF routers in the OSPF routing domain may limit the deployment of that application.
  </t>
  <t>
    When tags are advertised for AS External or NSSA LSA prefixes, the existing tag in
    the OSPFv2 and OSPFv3 AS-External-LSA and NSSA-LSA encodings <bcp14>MUST</bcp14> be utilized for
    the first tag. Additional tags <bcp14>MAY</bcp14> be advertised using the Administrative Tag
    Sub-TLV specified in this document. This will facilitate backward compatibility with
    implementations that do not support this specification.
  </t>
  <t>
    An OSPF router supporting this specification <bcp14>SHOULD</bcp14> propagate administrative tags
    when acting as an Area Border Router (ABR) and when originating summary advertisements into other
    areas (unless inhibited by local policy (<xref target="MANAGE"/>)). Similarly, an OSPF
    router supporting this specification and acting as an ABR for a NSSA
    <bcp14>SHOULD</bcp14> propagate tags when translating NSSA routes to AS External
    advertisements <xref target="RFC3101"/> (also subject to local
    policy (<xref target="MANAGE"/>)).
  </t>
  <t>
    There is no implied meaning to the ordering of the tags that
    indicates a certain operation or set of operations need to be performed
    based on the order of the tags.  Each tag <bcp14>SHOULD</bcp14> be treated as an
    autonomous identifier that <bcp14>MAY</bcp14> be used in policy to perform a policy
    action.  Whether or not tag A precedes or succeeds, tag B <bcp14>SHOULD NOT</bcp14>
    change the meaning of the tags.
    The number of tags supported by an ABR <bcp14>MAY</bcp14> limit the number
    of tags that are propagated. When propagating multiple tags between areas as
    previously described, the order of the tags <bcp14>MUST</bcp14> be preserved so
    that implementations supporting fewer tags will have a consistent view
    across areas.
  </t>
  <t>
    For configured area ranges, NSSA ranges, and configured aggregation of redistributed
    routes, tags from component routes <bcp14>SHOULD NOT</bcp14> be propagated to the summary. Implementations
    <bcp14>SHOULD</bcp14> provide a mechanism to configure multiple tags for area ranges, NSSA ranges, and
    redistributed route summaries.
  </t>
<section anchor="ECMP">
  <name>Equal-Cost Multipath Applicability</name>
  <t>
    When multiple LSAs contribute to an OSPF route, it is possible that these
    LSAs will all have different tags. In this situation, the OSPF ABR propagating the
    route to other areas with inter-area LSAs <bcp14>MUST</bcp14> associate
    the tags from one of the LSAs contributing a path and, if the implementation supports
    multiple tags, <bcp14>MAY</bcp14> associate tags from multiple contributing LSAs up to the maximum
    number of tags supported. It is <bcp14>RECOMMENDED</bcp14> that tags from LSAs are added to the path
    in ascending order of the LSA originator Router-ID.
  </t>
</section>
</section>

<section anchor="BGP-LS">
  <name>BGP-LS Advertisement</name>
  <t>
    Border Gateway Protocol - Link State (BGP-LS) <xref target="RFC9552"/> introduced the support for advertising
    administrative tags	associated with prefixes using the BGP-LS IGP Route
    Tag TLV (TLV 1153). This BGP-LS TLV is used to advertise the OSPF
    Administrative Tags specified in this document.
  </t>
</section>
<section anchor="MANAGE">
  <name>Management Considerations</name>
  <t>
    Implementations <bcp14>MAY</bcp14> include configuration of policies to modify the advertisement of
    tags for redistributed prefixes. Implementations <bcp14>MAY</bcp14> also include configuration of
    policies to modify the propagation of administrative tags between areas
    (OSPFv2 Extended Prefix Opaque LSAs,  OSPFv3 E-Inter-Area-Prefix-LSAs, and
    translated OSPFv3 E-AS-External-LSAs).
    However, the default behavior <bcp14>SHOULD</bcp14> be to advertise or propagate
    the lesser number of all the tags associated with the prefix or the maximum number of
    tags supported by the implementation.
  </t>
  <t>
    Both the support of this specification and the number of tags supported
    by OSPF routers within an OSPF routing domain will limit the usefulness and
    deployment of applications utilizing tags.
  </t>
</section>
<section>
  <name>YANG Data Model</name>
  <t>
    YANG <xref target="RFC7950"></xref> is a data definition language
    used to define the contents of a conceptual data store
    that allows networked devices to be managed using Network Configuration Protocol (NETCONF)
    <xref target="RFC6241"/> or RESTCONF <xref target="RFC8040"/>.
  </t>
  <t>
    This section defines a YANG data model that can be used to configure
    and manage the prefix administrative tags defined in this document,
    which augments the OSPF YANG data model <xref target="RFC9129"/>,
    the OSPFv3 Extended LSA YANG data model <xref target="RFC9587"/>,
    and the Routing Management YANG data model <xref target="RFC8349"/>.
    Additionally, the YANG data models defined in <xref target="RFC6991"/>
    are imported.
  </t>

  <section>
    <name>Tree for the YANG Data Model</name>
    <t>This document uses the graphical representation of data models per
    <xref target="RFC8340"/>.</t>

    <t>The following shows the tree diagram of the module:</t>

<sourcecode type="yangtree"><![CDATA[
module: ietf-ospf-admin-tags

  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf/ospf:areas/ospf:area
            /ospf:ranges/ospf:range:
    +--rw admin-tags
       +--rw admin-tag*   uint32
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf/ospf:areas/ospf:area
            /ospf:interfaces/ospf:interface:
    +--rw local-prefix-admin-tags
       +--rw default-admin-tag*           uint32
       +--rw specific-prefix-admin-tag* [prefix]
          +--rw prefix       inet:ip-prefix
          +--rw admin-tag*   uint32
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf/ospf:local-rib
            /ospf:route/ospf:next-hops/ospf:next-hop:
    +--ro admin-tag*   uint32
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf/ospf:areas/ospf:area
            /ospf:interfaces/ospf:interface/ospf:database
            /ospf:link-scope-lsa-type/ospf:link-scope-lsas
            /ospf:link-scope-lsa/ospf:version/ospf:ospfv2/ospf:ospfv2
            /ospf:body/ospf:opaque/ospf:extended-prefix-opaque
            /ospf:extended-prefix-tlv:
    +--ro prefix-admin-tag-sub-tlv
       +--ro admin-tag*   uint32
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf/ospf:areas/ospf:area
            /ospf:database/ospf:area-scope-lsa-type
            /ospf:area-scope-lsas/ospf:area-scope-lsa/ospf:version
            /ospf:ospfv2/ospf:ospfv2/ospf:body/ospf:opaque
            /ospf:extended-prefix-opaque/ospf:extended-prefix-tlv:
    +--ro prefix-admin-tag-sub-tlv
       +--ro admin-tag*   uint32
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf/ospf:database
            /ospf:as-scope-lsa-type/ospf:as-scope-lsas
            /ospf:as-scope-lsa/ospf:version/ospf:ospfv2/ospf:ospfv2
            /ospf:body/ospf:opaque/ospf:extended-prefix-opaque
            /ospf:extended-prefix-tlv:
    +--ro prefix-admin-tag-sub-tlv
       +--ro admin-tag*   uint32
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf/ospf:areas/ospf:area
            /ospf:database/ospf:area-scope-lsa-type
            /ospf:area-scope-lsas/ospf:area-scope-lsa/ospf:version
            /ospf:ospfv3/ospf:ospfv3/ospf:body
            /ospfv3-e-lsa:e-inter-area-prefix
            /ospfv3-e-lsa:e-inter-prefix-tlvs
            /ospfv3-e-lsa:inter-prefix-tlv:
    +--ro prefix-admin-tag-sub-tlv
       +--ro admin-tag*   uint32
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf/ospf:areas/ospf:area
            /ospf:database/ospf:area-scope-lsa-type
            /ospf:area-scope-lsas/ospf:area-scope-lsa/ospf:version
            /ospf:ospfv3/ospf:ospfv3/ospf:body
            /ospfv3-e-lsa:e-intra-area-prefix
            /ospfv3-e-lsa:e-intra-prefix-tlvs
            /ospfv3-e-lsa:intra-prefix-tlv:
    +--ro prefix-admin-tag-sub-tlv
       +--ro admin-tag*   uint32
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf/ospf:database
            /ospf:as-scope-lsa-type/ospf:as-scope-lsas
            /ospf:as-scope-lsa/ospf:version/ospf:ospfv3/ospf:ospfv3
            /ospf:body/ospfv3-e-lsa:e-as-external
            /ospfv3-e-lsa:e-external-tlvs
            /ospfv3-e-lsa:external-prefix-tlv:
    +--ro prefix-admin-tag-sub-tlv
       +--ro admin-tag*   uint32
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf/ospf:areas/ospf:area
            /ospf:database/ospf:area-scope-lsa-type
            /ospf:area-scope-lsas/ospf:area-scope-lsa/ospf:version
            /ospf:ospfv3/ospf:ospfv3/ospf:body/ospfv3-e-lsa:e-nssa
            /ospfv3-e-lsa:e-external-tlvs
            /ospfv3-e-lsa:external-prefix-tlv:
    +--ro prefix-admin-tag-sub-tlv
       +--ro admin-tag*   uint32]]></sourcecode>

</section>
<section>

  <name>YANG Data Model for OSPF Prefix Administrative Tags</name>
<t>The following is the YANG module:</t>
<sourcecode name="ietf-ospf-admin-tags@2025-07-31.yang" type="yang" markers="true"><![CDATA[
module ietf-ospf-admin-tags {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:ietf-ospf-admin-tags";
  prefix ospf-admin-tags;

  import ietf-routing {
    prefix rt;
    reference
      "RFC 8349: A YANG Data Model for Routing
       Management (NMDA Version)";
  }
  import ietf-ospf {
    prefix ospf;
    reference
      "RFC 9129: YANG Data Model for the OSPF Protocol";
  }
  import ietf-inet-types {
    prefix inet;
    reference
      "RFC 6991: Common YANG Data Types";
  }
  import ietf-ospfv3-extended-lsa {
    prefix ospfv3-e-lsa;
    reference
      "RFC 9587: YANG Data Model for OSPFv3 Extended Link
                 State Advertisements (LSAs)";
  }

  organization
    "IETF LSR - Link State Routing Working Group";
  contact
    "WG Web:   <https://datatracker.ietf.org/wg/lsr/>
     WG List:  <mailto:lsr@ietf.org>

     Author:   Yingzhen Qu
               <mailto:yingzhen.ietf@gmail.com>
     Author:   Acee Lindem
               <mailto:acee.ietf@gmail.com>
     Author:   Peter Psenak
               <mailto:ppsenak@cisco.com>";
  description
    "This YANG module defines the configuration
     and operational state for OSPF administrative tags.

     This YANG data model conforms to the Network Management
     Datastore Architecture (NMDA) as described in RFC 8342.

     Copyright (c) 2025 IETF Trust and the persons identified as
     authors of the code.  All rights reserved.

     Redistribution and use in source and binary forms, with or
     without modification, is permitted pursuant to, and subject to
     the license terms contained in, the Revised BSD License set
     forth in Section 4.c of the IETF Trust's Legal Provisions
     Relating to IETF Documents
     (https://trustee.ietf.org/license-info).

     This version of this YANG module is part of RFC 9825;
     see the RFC itself for full legal notices.";
  reference
    "RFC 9825: Extensions to OSPF for Advertising Prefix
               Administrative Tags.";

  revision 2025-07-31 {
    description
      "Initial revision.";
    reference
      "RFC 9825: Extensions to OSPF for Advertising Prefix
                 Administrative Tags.";
  }

  grouping prefix-admin-tag-sub-tlv {
    description
      "Prefix Administrative Tag Sub-TLVs.";
    container prefix-admin-tag-sub-tlv {
      config false;
      description
        "Prefix Administrative Tag Sub-TLV.";
      leaf-list admin-tag {
        type uint32;
        description
          "Administrative tags.";
      }
    }
  }

  /* Configuration */

  augment "/rt:routing/rt:control-plane-protocols"
        + "/rt:control-plane-protocol/ospf:ospf"
        + "/ospf:areas/ospf:area/ospf:ranges/ospf:range" {
    when "derived-from-or-self(../../../../.."
       + "/rt:type, 'ospf:ospf')" {
      description
        "This augments the OSPF routing protocol area range
         configuration.";
    }
    description
      "This augments the OSPF protocol area range configuration
       with administrative tags.  The configured tags will be
       advertised with summary prefix when it is active.";
    container admin-tags {
      when "../ospf:advertise = 'true'";
      leaf-list admin-tag {
        type uint32;
        description
          "Administrative tags.";
      }
      description
        "OSPF prefix administrative tags.";
    }
  }

  augment "/rt:routing/rt:control-plane-protocols"
        + "/rt:control-plane-protocol/ospf:ospf"
        + "/ospf:areas/ospf:area/ospf:interfaces/ospf:interface" {
    when "derived-from-or-self(../../../../.."
       + "/rt:type, 'ospf:ospf')" {
      description
        "This augments the OSPF routing protocol interface
         configuration.";
    }
    description
      "This augments the OSPF protocol interface configuration
       with Administrative Tags.  The configured tags will be
       advertised with local prefixes configured for the interface.";
    container local-prefix-admin-tags {
      leaf-list default-admin-tag {
        type uint32;
        description
          "Administrative tags that will be associated with
           local prefixes if the prefix is not specified explicitly.
           If omitted, no administrative tags are associated with
           local prefixes by default.";
      }
      list specific-prefix-admin-tag {
        key "prefix";
        leaf prefix {
          type inet:ip-prefix;
          description
            "IPv4 or IPv6 prefix.";
        }
        leaf-list admin-tag {
          type uint32;
          description
            "Administrative tags that will be associated with
             the specified local prefix.  If omitted, no
             administrative tags are associated with the specified
             local prefix.";
        }
        description
          "Administrative tags that are explicitly associated with
           the specified prefix.";
      }
      description
        "List of administrative tags that are to be advertised
         with interface local prefixes.";
    }
  }

  /* Local-RIB */
  
  augment "/rt:routing"
        + "/rt:control-plane-protocols/rt:control-plane-protocol"
        + "/ospf:ospf/ospf:local-rib/ospf:route/ospf:next-hops"
        + "/ospf:next-hop" {
    description
      "This augments local-rib next-hop with administrative tags.";
    leaf-list admin-tag {
      type uint32;
      description
        "Administrative tags.";
    }
  }

  /* Database */

  augment "/rt:routing"
        + "/rt:control-plane-protocols/rt:control-plane-protocol"
        + "/ospf:ospf/ospf:areas/ospf:area"
        + "/ospf:interfaces/ospf:interface/ospf:database"
        + "/ospf:link-scope-lsa-type/ospf:link-scope-lsas"
        + "/ospf:link-scope-lsa/ospf:version/ospf:ospfv2"
        + "/ospf:ospfv2/ospf:body/ospf:opaque"
        + "/ospf:extended-prefix-opaque/ospf:extended-prefix-tlv" {
    when "derived-from-or-self(../../../../../../../../../.."
       + "/../../../../rt:type, 'ospf:ospfv2')" {
      description
        "This augmentation is only valid for OSPFv2.";
    }
    description
      "Prefix Administrative Tag Sub-TLVs for OSPFv2 extended prefix
       TLV in type 9 opaque LSA.";
    uses prefix-admin-tag-sub-tlv;
  }

  augment "/rt:routing"
        + "/rt:control-plane-protocols/rt:control-plane-protocol"
        + "/ospf:ospf/ospf:areas"
        + "/ospf:area/ospf:database"
        + "/ospf:area-scope-lsa-type/ospf:area-scope-lsas"
        + "/ospf:area-scope-lsa/ospf:version/ospf:ospfv2"
        + "/ospf:ospfv2/ospf:body/ospf:opaque"
        + "/ospf:extended-prefix-opaque/ospf:extended-prefix-tlv" {
    when "derived-from-or-self(../../../../../../../../../.."
       + "/../../rt:type, 'ospf:ospfv2')" {
      description
        "This augmentation is only valid for OSPFv2.";
    }
    description
      "Prefix Administrative Tag Sub-TLVs for OSPFv2 extended prefix
       TLV in type 10 opaque LSA.";
    uses prefix-admin-tag-sub-tlv;
  }

  augment "/rt:routing"
        + "/rt:control-plane-protocols/rt:control-plane-protocol"
        + "/ospf:ospf/ospf:database"
        + "/ospf:as-scope-lsa-type/ospf:as-scope-lsas"
        + "/ospf:as-scope-lsa/ospf:version/ospf:ospfv2"
        + "/ospf:ospfv2/ospf:body/ospf:opaque"
        + "/ospf:extended-prefix-opaque/ospf:extended-prefix-tlv" {
    when "derived-from-or-self(../../../../../../../.."
       + "/../../rt:type, 'ospf:ospfv2')" {
      description
        "This augmentation is only valid for OSPFv2.";
    }
    description
      "Prefix Administrative Tag Sub-TLVs for OSPFv2 extended prefix
       TLV in type 11 opaque LSA.";
    uses prefix-admin-tag-sub-tlv;
  }

  augment "/rt:routing"
        + "/rt:control-plane-protocols/rt:control-plane-protocol"
        + "/ospf:ospf/ospf:areas/ospf:area/ospf:database"
        + "/ospf:area-scope-lsa-type/ospf:area-scope-lsas"
        + "/ospf:area-scope-lsa/ospf:version/ospf:ospfv3"
        + "/ospf:ospfv3/ospf:body/ospfv3-e-lsa:e-inter-area-prefix"
        + "/ospfv3-e-lsa:e-inter-prefix-tlvs"
        + "/ospfv3-e-lsa:inter-prefix-tlv" {
    when "derived-from-or-self(../../../../../../../../../.."
       + "/../../rt:type, 'ospf:ospfv3')" {
      description
        "This augmentation is only valid for OSPFv3.";
    }
    description
      "Augment OSPFv3 Inter-Area-Prefix TLV in the
       E-Inter-Area-Prefix-LSA.";
    uses prefix-admin-tag-sub-tlv;
  }

  augment "/rt:routing"
        + "/rt:control-plane-protocols/rt:control-plane-protocol"
        + "/ospf:ospf/ospf:areas/ospf:area/ospf:database"
        + "/ospf:area-scope-lsa-type/ospf:area-scope-lsas"
        + "/ospf:area-scope-lsa/ospf:version/ospf:ospfv3"
        + "/ospf:ospfv3/ospf:body/ospfv3-e-lsa:e-intra-area-prefix"
        + "/ospfv3-e-lsa:e-intra-prefix-tlvs"
        + "/ospfv3-e-lsa:intra-prefix-tlv" {
    when "/rt:routing/rt:control-plane-protocols"
       + "/rt:control-plane-protocol/rt:type = 'ospf:ospfv3'" {
      description
        "This augmentation is only valid for OSPFv3.";
    }
    description
      "Augment OSPFv3 Intra-Area-Prefix TLV in the
       E-Intra-Area-Prefix-LSA.";
    uses prefix-admin-tag-sub-tlv;
  }

  augment "/rt:routing"
        + "/rt:control-plane-protocols/rt:control-plane-protocol"
        + "/ospf:ospf/ospf:database"
        + "/ospf:as-scope-lsa-type/ospf:as-scope-lsas"
        + "/ospf:as-scope-lsa/ospf:version/ospf:ospfv3"
        + "/ospf:ospfv3/ospf:body/ospfv3-e-lsa:e-as-external"
        + "/ospfv3-e-lsa:e-external-tlvs"
        + "/ospfv3-e-lsa:external-prefix-tlv" {
    when "derived-from-or-self(../../../../../../../.."
       + "/../../rt:type, 'ospf:ospfv3')" {
      description
        "This augmentation is only valid for OSPFv3.";
    }
    description
      "Augment OSPFv3 External-Prefix TLV in the E-AS-External-LSA.";
    uses prefix-admin-tag-sub-tlv;
  }

  augment "/rt:routing"
        + "/rt:control-plane-protocols/rt:control-plane-protocol"
        + "/ospf:ospf/ospf:areas/ospf:area/ospf:database"
        + "/ospf:area-scope-lsa-type/ospf:area-scope-lsas"
        + "/ospf:area-scope-lsa/ospf:version/ospf:ospfv3"
        + "/ospf:ospfv3/ospf:body/ospfv3-e-lsa:e-nssa"
        + "/ospfv3-e-lsa:e-external-tlvs"
        + "/ospfv3-e-lsa:external-prefix-tlv" {
    when "/rt:routing/rt:control-plane-protocols"
       + "/rt:control-plane-protocol/rt:type = 'ospf:ospfv3'" {
      description
        "This augmentation is only valid for OSPFv3.";
    }
    description
      "Augment OSPFv3 External-Prefix TLV in the E-NSSA-LSA.";
    uses prefix-admin-tag-sub-tlv;
  }
}]]></sourcecode>
</section>
</section>

<section>
  <name>Security Considerations</name>
  <t>
    This document describes a generic mechanism for advertising
    administrative tags for OSPF prefixes.
    The administrative tags are generally less critical
    than the topology information currently advertised by the base
    OSPF protocol.
    The security considerations for the generic mechanism are dependent
    on their application. One such application is to control leaking of OSPF
    routes to other protocols (e.g., BGP <xref target="RFC4271"/>). If an attacker
    were able to modify
    the administrative tags associated with OSPF routes, and they were being used for this
    application, such routes could be prevented from being advertised in routing
    domains where they are required (subtle denial of service) or they could be
    advertised into routing domains where they shouldn't be advertised (routing
    vulnerability).
    Security considerations for the base OSPF protocol are covered
    in <xref target="RFC2328"/> and <xref target="RFC5340"/>.
   </t>
   <t>
     The "ietf-ospf-admin-tag" YANG module defines a data model that is
     designed to be accessed via YANG-based management protocols, such as
     NETCONF <xref target="RFC6241"/> and RESTCONF <xref target="RFC8040"/>.
     These YANG-based management protocols (1) have to use a secure transport layer (e.g., SSH
     <xref target="RFC4252"/>, TLS <xref target="RFC8446"/>, and
     QUIC <xref target="RFC9000"/>) and (2) have to use mutual authentication.  
   </t>

   <t>
     The Network Configuration Access Control Model (NACM) <xref target="RFC8341"/> provides the
     means to restrict access for particular NETCONF or RESTCONF users to a
     preconfigured subset of all available NETCONF or RESTCONF protocol
     operations and content.
   </t>

   <t>
There are a number of data nodes defined in this YANG module that are writable/creatable/deletable (i.e., "config true", which is the default). All writable data nodes are likely to be sensitive or vulnerable in some network environments. Write operations (e.g., edit-config) and delete operations to these data nodes without proper protection or authentication can have a negative effect on network operations. The following subtrees and data nodes have particular sensitivities/vulnerabilities:</t>
   <ul spacing="normal">
     <li>/ospf:ospf/ospf:areas/ospf:area/ospf:interfaces/ospf:interface/local-prefix-admin-tags</li>
     <li>/ospf:ospf/ospf:areas/ospf:area/ospf:ranges/ospf:range/admin-tags</li>
   </ul>

   <t>Some of the readable data nodes in this YANG module may be considered
sensitive or vulnerable in some network environments.  Thus, it is
important to control read access (e.g., via get, get-config, or
notification) to these data nodes. Exposure of the OSPF link state
database may be useful in mounting a Denial-of-Service (DoS) attack.
Specifically, the following subtrees and data nodes have particular
sensitivities:</t>

   <ul spacing="normal">
     <li>/ospf:ospf/ospf:areas/ospf:area/ospf:interfaces/ospf:interface/local-prefix-admin-tags</li>
     <li>/ospf:ospf/ospf:areas/ospf:area/ospf:ranges/ospf:range/admin-tags</li>
     <li>/prefix-admin-tag-sub-tlv</li>
   </ul>

</section>
<section>
  <name>IANA Considerations</name>
  <t>
    The following value has been allocated in the "OSPFv2 Extended Prefix TLV
    Sub-TLVs" registry <xref target="RFC7684"/> in the "Open Shortest Path First v2 (OSPFv2)
    Parameters" registry group:
  </t>
  <dl spacing="normal" newline="false">
    <dt>13:</dt><dd>Administrative Tag</dd>
  </dl>
  <t>
    The following value has been allocated in the "OSPFv3 Extended-LSA Sub-TLVs"
    registry <xref target="RFC8362"/> in the "Open Shortest Path First v3 (OSPFv3) Parameters"
    registry group:
  </t>
  <dl spacing="normal" newline="false">
    <dt>39:</dt><dd><t>Administrative Tag</t>
    <t>Since this sub-TLV only applies to prefixes and not links, the value of
    the Layer-2 Bundle Member (L2BM) field will be "X".</t></dd>
  </dl>
  <t>
    The following value has been allocated in the "OSPFv3 SRv6 Locator LSA
    Sub-TLVs" registry <xref target="RFC9513"/> in the "Open Shortest Path First v3 (OSPFv3)
    Parameters" registry group:
  </t>
  <dl spacing="normal" newline="false">
    <dt>6:</dt><dd>Administrative Tag</dd>
  </dl>

  <t>IANA has assigned one new URI in the "IETF XML Registry"
  <xref target="RFC3688" format="default"/>:</t>

  <dl spacing="compact" newline="false">
    <dt>URI:</dt><dd>urn:ietf:params:xml:ns:yang:ietf-ospf-admin-tags</dd>
    <dt>Registrant Contact:</dt><dd>The IESG.</dd>
    <dt>XML:</dt><dd>N/A; the requested URI is an XML namespace.</dd>
  </dl>

  <t> This document also registers one new YANG module name in the "YANG Module
  Names" registry <xref target="RFC6020" format="default"/> with the
  following:</t>

  <dl spacing="compact" newline="false">
    <dt>Name:</dt><dd>ietf-ospf-admin-tags</dd>
    <dt>Namespace:</dt><dd>urn:ietf:params:xml:ns:yang:ietf-ospf-admin-tags</dd>
    <dt>Prefix:</dt><dd>ospf-admin-tags</dd>
    <dt>Reference:</dt><dd>RFC 9825</dd>
  </dl>

</section>
</middle>

<back>
<references>
  <name>References</name>
  <references>
    <name>Normative References</name>

    <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
    <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2328.xml"/>
    <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.3688.xml"/>
    <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5340.xml"/>
    <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6020.xml"/>
    <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6991.xml"/>
    <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7684.xml"/>
    <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7950.xml"/>
    <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
    <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8341.xml"/>
    <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8349.xml"/>
    <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8362.xml"/>
    <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9129.xml"/>
    <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9513.xml"/>
    <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9552.xml"/>
    <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9587.xml"/>
  </references>
  
  <references>
    <name>Informative References</name>
    <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.3101.xml"/>
    <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.4252.xml"/>
    <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.4271.xml"/>
    <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5130.xml"/>
    <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6241.xml"/>
    <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8040.xml"/>
    <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8340.xml"/>
    <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8446.xml"/>
    <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9000.xml"/>    
  </references>
</references>

  <section numbered="false">
    <name>Acknowledgments</name>
    <t>The authors of <xref target="RFC5130"/> are acknowledged, since this
    document draws upon both the IS-IS specification and deployment
    experience. The text in <xref target="OSPF-OPERATION"/> is adopted from
    <xref target="RFC5130"/>.</t>
    <t>Thanks to <contact fullname="Donnie Savage"/> for his comments and
    questions.</t>
    <t>Thanks to <contact fullname="Ketan Talaulikar"/> for his comments and
    providing the BGP-LS text.</t>
    <t>Thanks to <contact fullname="Tony Przygienda"/> and <contact
    fullname="Les Ginsberg"/> for discussions on tag selection.</t>
    <t>Thanks to <contact fullname="Russ White"/> for his Routing Directorate
    review.</t>
    <t>Thanks to <contact fullname="Bruno Decraene"/> and <contact
    fullname="Changwang Lin"/> for working group last call comments.</t>
    <t>Thanks to <contact fullname="Gunter Van de Velde"/> for has AD review
    and comments.</t>
    <t>Thanks to <contact fullname="David Dong"/> for IANA review and
    comments.</t>
    <t>Thanks to <contact fullname="Deb Cooley"/>, <contact fullname="Roman
    Danyliw"/>, and <contact fullname="John Scudder"/> for IESG review and
    comments.</t>
    <t>Thanks to <contact fullname="Mahesh Jethanandani"/> for an extensive
    IESG review of the YANG data model.</t>
   </section>

</back>

</rfc>
