<?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-prefix-extended-flags-07" number="9792" updates="" obsoletes="" consensus="true" submissionType="IETF" version="3" symRefs="true" sortRefs="true" xml:lang="en" tocInclude="true">

<front>
   <title abbrev="Prefix Flag Extension for OSPF">Prefix Flag Extension for OSPFv2 and OSPFv3</title>
    <seriesInfo name="RFC" value="9792"/>
    <author initials='R.' surname="Chen" fullname='Ran Chen'>
      <organization>ZTE Corporation</organization>
      <address>
        <postal>
          <city>Nanjing</city>
          <country>China</country>
        </postal>
        <email>chen.ran@zte.com.cn</email>
     </address>
    </author>
    <author initials='D.' surname="Zhao" fullname='Detao Zhao'>
      <organization>ZTE Corporation</organization>
      <address>
        <postal>
          <city>Nanjing</city>
          <country>China</country>
        </postal>
        <email>zhao.detao@zte.com.cn</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 initials='K.' surname="Talaulikar" fullname='Ketan Talaulikar'>
      <organization>Cisco Systems</organization>
      <address>
        <postal>
          <country>India</country>
        </postal>
        <email>ketant.ietf@gmail.com</email>
     </address>
    </author>
    <author initials='L.' surname="Gong" fullname='Liyan Gong'>
      <organization>China Mobile</organization>
      <address>
        <postal>
          <country>China</country>
        </postal>
        <email>gongliyan@chinamobile.com</email>
     </address>
    </author>
    <date year="2025" month="June"/>

    <area>RTG</area>
    <workgroup>lsr</workgroup>
   
   <abstract>
      <t>Each OSPF prefix can be advertised with an 8-bit field to indicate specific properties of that prefix. However, all the OSPFv3 Prefix Options bits have already been assigned, and only a few bits remain unassigned in the Flags field of the OSPFv2 Extended Prefix TLV.</t>
      <t>This document solves this problem by defining a variable-length Prefix Extended Flags sub-TLV for OSPF. This sub-TLV is applicable to OSPFv2 and OSPFv3.</t>
    </abstract>
  </front>
  <middle>
    <section numbered="true" toc="default">
      <name>Introduction</name>
      <t>Each OSPF prefix can be advertised with an 8-bit field to indicate specific properties of that prefix. This is done using the OSPFv3 Prefix Options (<xref section="A.4.1.1" target="RFC5340" format="default"></xref>) and the Flags field in the OSPFv2 Extended Prefix TLV (<xref target="RFC7684" sectionFormat="of" section="2.1"/>). The rest of this document refers to these 8-bit fields in both OSPFv2 and OSPFv3 as the "existing fixed-size prefix flags".</t>
      <t>However, all the OSPFv3 Prefix Options bits have already been assigned (see the "OSPFv3 Prefix Options (8 bits)" IANA registry <xref target="IANA-OSPFv3-PO"/>). Also, at the time of publication of this document, only 5 bits remain unassigned in the Flags field of the OSPFv2 Extended Prefix TLV (see the "OSPFv2 Extended Prefix TLV Flags" IANA registry <xref target="IANA-OSPFv2-EPF"/>).</t>
      <t>This document solves the problem of insufficient flag bits for the signaling of prefix properties in OSPF by defining a variable-length Prefix Extended Flags sub-TLV for OSPFv2 and OSPFv3.</t>   
     <section 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>
   <section numbered="true" toc="default" anchor="vlpafsf">
   <name>Variable-Length Prefix Extended Flags Sub-TLV</name>
   <t>This document defines a variable-length Prefix Extended Flags sub-TLV for OSPFv2 and OSPFv3. The sub-TLV specifies the variable-length Prefix Extended Flags field to advertise additional attributes associated with OSPF prefixes. The advertisement and processing of the existing fixed-size prefix flags remain unchanged.</t>
   <t>The format of the OSPFv2/OSPFv3 Prefix Extended Flags sub-TLV is shown in Figure 1.</t>
   <figure>
     <name>Format of OSPFv2/OSPFv3 Prefix Extended Flags 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             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
//                 Prefix Extended Flags (Variable)            //
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+]]></artwork>
</figure>
      <t>where:</t>
      <dl spacing="normal" newline="false">
	<dt>Type (2 octets):</dt>
	<dd>11 for OSPFv2 and 37 for OSPFv3</dd>
	<dt>Length (2 octets):</dt>
	<dd>Variable, dependent on the included Prefix Extended Flags field. This
	indicates the length of the Prefix Extended Flags field in octets. The
	length <bcp14>MUST</bcp14> be a multiple of 4 octets. If the length is
	not a multiple of 4 octets, the Link State Advertisement (LSA) is
	malformed and <bcp14>MUST</bcp14> be ignored.</dd>
	<dt>Prefix Extended Flags (Variable):</dt>
	<dd>The extended flag field. This field contains a variable number of
	flags, grouped in 4-octet blocks. The bits are numbered starting from
	bit 0 as the most significant bit of the first 32-bit block. If the length of the
	Prefix Extended Flags field exceeds 4 octets, numbering for
	the additional bits picks up where the previous 4-octet block left
	off. For example, the most significant bit in the fifth octet of an
	8-octet Prefix Extended Flags field is referred to as bit 32. Currently, no
	bits are defined in this document.</dd>
      </dl>
      <t>Unassigned bits <bcp14>MUST</bcp14> be set to zero on transmission and <bcp14>MUST</bcp14> be ignored on receipt.</t>
      <t>An implementation <bcp14>MUST</bcp14> limit the length of the sub-TLV so as to signal the bits that are set to 1. Defined prefix flags that are not transmitted due to being beyond the transmitted length <bcp14>MUST</bcp14> be treated as being set to 0.</t>
      <t>The OSPFv2 Prefix Extended Flags sub-TLV is advertised as a sub-TLV of the OSPFv2 Extended Prefix TLV defined in <xref target="RFC7684"/>. Additional OSPFv2 prefix flags <bcp14>SHOULD</bcp14> be allocated from the unused bits in the Flags field of the OSPFv2 Extended Prefix TLV prior to allocating flags in the OSPFv2 Prefix Extended Flags sub-TLV.</t>
      <t>The OSPFv3 Prefix Extended Flags sub-TLV is advertised as a sub-TLV of the following OSPFv3 TLVs:</t>
      <ul spacing="normal">
        <li>Inter-Area-Prefix TLV (<xref target="RFC8362" sectionFormat="of" section="3.4"/>)</li>
        <li>External-Prefix TLV (<xref target="RFC8362" sectionFormat="of" section="3.6"/>)</li>
        <li>Intra-Area-Prefix TLV (<xref target="RFC8362" sectionFormat="of" section="3.7"/>)</li>
        <li>SRv6 Locator TLV <xref target="RFC9513"/></li>
         </ul>
     <t>When multiple instances of the OSPFv2/OSPFv3 Prefix Extended Flags sub-TLVs are received within the same TLV, an implementation <bcp14>MUST</bcp14> use only the first occurrence of the sub-TLV and <bcp14>MUST</bcp14> ignore all subsequent instances of the sub-TLV. Errors <bcp14>SHOULD</bcp14> be logged subject to rate limiting.</t>
      </section>
     
     <section numbered="true" toc="default">
        <name>Backward Compatibility</name> 
        <t>The OSPFv2/OSPFv3 Prefix Extended Flags sub-TLV does not introduce any backward compatibility issues. An implementation that does not recognize the OSPFv2/OSPFv3 Prefix Extended Flags sub-TLV would ignore the sub-TLV as per normal TLV processing operations (refer to <xref target="RFC3630" sectionFormat="of" section="2.3.2"/> and <xref target="RFC8362" sectionFormat="of" section="6.3"/>).</t>
     </section>
     

   <section anchor="IANA" numbered="true" toc="default">
      <name>IANA Considerations</name>
     <section numbered="true" toc="default">
        <name>OSPFv2</name>
	<section numbered="true" toc="default">
        <name>OSPFv2 Prefix Extended Flags Sub-TLV</name>
   <t>IANA has allocated the following codepoint in the "OSPFv2 Extended Prefix TLV Sub-TLVs" registry:</t>

   <table>
     <thead>
       <tr><th>Value</th><th>Description</th><th>Reference</th></tr>
     </thead>
     <tbody>
       <tr><td>11</td><td>OSPFv2 Prefix Extended Flags</td><td>RFC 9792</td></tr>
     </tbody>
   </table>
     </section> 
      <section numbered="true" toc="default">
        <name>OSPFv2 Prefix Extended Flags Registry</name>
      <t>IANA has created the "OSPFv2 Prefix Extended Flags" registry within the "Open Shortest Path First v2 (OSPFv2) Parameters" registry group. The registry defines the bits in the Prefix Extended Flags field in the OSPFv2 Prefix Extended Flags sub-TLV as specified in <xref target="vlpafsf"/>. The bits are to be allocated via IETF Review <xref target="RFC8126"/>. Each bit definition will include:</t>
      <ul spacing="normal">
	<li>Bit number (counting from bit 0 as the most significant bit of the first block)</li>
	<li>Description</li>
	<li>Reference</li>
      </ul>

       <t>No bits are currently defined. Bits 0-31 are to be initially marked as "Unassigned". The flags defined in this document may use either a single bit or multiple bits to represent a state, as determined by the specific requirements of the document defining them. IANA will add subsequent blocks of 32 bits upon exhaustion of the preceding 32-bit block.</t> 
        </section> 
          </section> 
        <section numbered="true" toc="default">
        <name>OSPFv3</name>
      <section numbered="true" toc="default">
        <name>OSPFv3 Prefix Extended Flags Sub-TLV</name>
        <t>IANA has allocated the following codepoint in the "OSPFv3 Extended-LSA Sub-TLVs" registry:</t>

	<table>
	  <thead><tr><th>Value</th>
	  <th>Description</th>
	  <th>L2BM</th>
	  <th>Reference</th></tr></thead>
	  <tbody><tr>
	  <td>37</td>
	  <td>OSPFv3 Prefix Extended Flags</td>
	  <td align="center">X</td>
	  <td>RFC 9792</td></tr></tbody>
	</table>
      </section>   
       <section numbered="true" toc="default">
        <name>OSPFv3 Prefix Extended Flags Registry</name>
      <t>IANA has created the "OSPFv3 Prefix Extended Flags" registry within the "Open Shortest Path First v3 (OSPFv3) Parameters" registry group. The registry defines the bits in the Prefix Extended Flags field in the OSPFv2 Prefix Extended Flags sub-TLV as specified in <xref target="vlpafsf"/>. The bits are to be allocated via IETF Review <xref target="RFC8126"/>. Each bit definition will include:</t>
      <ul spacing="normal">
	<li>Bit number (counting from bit 0 as the most significant bit of the first block)</li>
	<li>Description</li>
	<li>Reference</li>
      </ul>
       <t>No bits are currently defined. Bits 0-31 are to be initially marked as "Unassigned". The flags defined in this document may use either a single bit or multiple bits to represent a state, as determined by the specific requirements of the document defining them. IANA will add subsequent blocks of 32 bits upon exhaustion of the preceding 32-bit block. </t>
       </section>  
        </section> 
     </section> 
    
    <section anchor="Security" numbered="true" toc="default">
      <name>Security Considerations</name>
     <t>Procedures and protocol extensions defined in this document do not affect the OSPFv2 or OSPFv3 security models. See  <xref target="RFC7684" sectionFormat="of" section="5"/> for a discussion of OSPFv2 TLV-encoding considerations and <xref target="RFC8362" sectionFormat="of" section="7"/> for a discussion of OSPFv3 security.</t>
    </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.3630.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.7684.xml"/>
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8126.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.8362.xml"/>
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9513.xml"/>
    </references>
    <references>
      <name>Informative References</name>

    
         <reference anchor="IANA-OSPFv2-EPF" target="https://www.iana.org/assignments/ospfv2-parameters">
                <front>
                    <title>OSPFv2 Extended Prefix TLV Flags</title>
                    <author>
                        <organization>IANA</organization>
                    </author>
                </front>
            </reference>    

         <reference anchor="IANA-OSPFv3-PO" target="https://www.iana.org/assignments/ospfv3-parameters">
                <front>
                    <title>OSPFv3 Prefix Options (8 bits)</title>
                    <author>
                        <organization>IANA</organization>
                    </author>
                </front>
            </reference>                    
        </references>
      </references>
    <section anchor="Acknowledgements" numbered="false" toc="default">
      <name>Acknowledgements</name>
      <t>The authors would like to thank <contact fullname="Shraddha Hegde"/>, <contact fullname="Changwang Lin"/>, <contact fullname="Tom Petch"/>, and many others for their suggestions and comments.</t>
      <t>The authors would also like to thank <contact fullname="Acee Lindem"/> for aligning the terminology with existing OSPF documents and for editorial improvements.</t>
    </section>
 </back>
</rfc>
