OSPF prefix flags: Prefix Flag Extension for OSPFv2 and OSPFv3
A stretchable flags field so OSPF can keep describing new prefix properties after the old 8-bit fields ran out.
Chen, R., Zhao, D., Psenak, P., Talaulikar, K., and L. Gong, "Prefix Flag Extension for OSPFv2 and OSPFv3", RFC 9792, DOI 10.17487/RFC9792, June 2025, <https://www.rfc-editor.org/info/rfc9792>.
@misc{rfc9792,
series = {Request for Comments},
number = 9792,
howpublished = {RFC 9792},
publisher = {RFC Editor},
doi = {10.17487/RFC9792},
url = {https://www.rfc-editor.org/info/rfc9792},
author = {R. Chen and D. Zhao and P. Psenak and K. Talaulikar and L. Gong},
title = {{Prefix Flag Extension for OSPFv2 and OSPFv3}},
pagetotal = 7,
year = 2025,
month = jun,
} RFC text
Contents
Internet Engineering Task Force (IETF) R. Chen
Request for Comments: 9792 D. Zhao
Category: Standards Track ZTE Corporation
ISSN: 2070-1721 P. Psenak
K. Talaulikar
Cisco Systems
L. Gong
China Mobile
June 2025
Prefix Flag Extension for OSPFv2 and OSPFv3
Abstract
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.
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.
Status of This Memo
This is an Internet Standards Track document.
This document is a product of the Internet Engineering Task Force
(IETF). It represents the consensus of the IETF community. It has
received public review and has been approved for publication by the
Internet Engineering Steering Group (IESG). Further information on
Internet Standards is available in Section 2 of RFC 7841.
Information about the current status of this document, any errata,
and how to provide feedback on it may be obtained at
https://www.rfc-editor.org/info/rfc9792.
Copyright Notice
Copyright (c) 2025 IETF Trust and the persons identified as the
document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents
(https://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must
include Revised BSD License text as described in Section 4.e of the
Trust Legal Provisions and are provided without warranty as described
in the Revised BSD License.
Table of Contents
1. Introduction
1.1. Requirements Language
2. Variable-Length Prefix Extended Flags Sub-TLV
3. Backward Compatibility
4. IANA Considerations
4.1. OSPFv2
4.1.1. OSPFv2 Prefix Extended Flags Sub-TLV
4.1.2. OSPFv2 Prefix Extended Flags Registry
4.2. OSPFv3
4.2.1. OSPFv3 Prefix Extended Flags Sub-TLV
4.2.2. OSPFv3 Prefix Extended Flags Registry
5. Security Considerations
6. References
6.1. Normative References
6.2. Informative References
Acknowledgements
Authors' Addresses
1. Introduction
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 (Appendix A.4.1.1 of [RFC5340]) and the Flags field in
the OSPFv2 Extended Prefix TLV (Section 2.1 of [RFC7684]). The rest
of this document refers to these 8-bit fields in both OSPFv2 and
OSPFv3 as the "existing fixed-size prefix flags".
However, all the OSPFv3 Prefix Options bits have already been
assigned (see the "OSPFv3 Prefix Options (8 bits)" IANA registry
[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 [IANA-OSPFv2-EPF]).
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.
1.1. Requirements Language
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 [RFC2119] [RFC8174] when, and only when, they appear in all
capitals, as shown here.
2. Variable-Length Prefix Extended Flags Sub-TLV
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.
The format of the OSPFv2/OSPFv3 Prefix Extended Flags sub-TLV is
shown in Figure 1.
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) //
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 1: Format of OSPFv2/OSPFv3 Prefix Extended Flags Sub-TLV
where:
Type (2 octets): 11 for OSPFv2 and 37 for OSPFv3
Length (2 octets): Variable, dependent on the included Prefix
Extended Flags field. This indicates the length of the Prefix
Extended Flags field in octets. The length MUST be a multiple of
4 octets. If the length is not a multiple of 4 octets, the Link
State Advertisement (LSA) is malformed and MUST be ignored.
Prefix Extended Flags (Variable): 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.
Unassigned bits MUST be set to zero on transmission and MUST be
ignored on receipt.
An implementation MUST 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 MUST be
treated as being set to 0.
The OSPFv2 Prefix Extended Flags sub-TLV is advertised as a sub-TLV
of the OSPFv2 Extended Prefix TLV defined in [RFC7684]. Additional
OSPFv2 prefix flags SHOULD 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.
The OSPFv3 Prefix Extended Flags sub-TLV is advertised as a sub-TLV
of the following OSPFv3 TLVs:
* Inter-Area-Prefix TLV (Section 3.4 of [RFC8362])
* External-Prefix TLV (Section 3.6 of [RFC8362])
* Intra-Area-Prefix TLV (Section 3.7 of [RFC8362])
* SRv6 Locator TLV [RFC9513]
When multiple instances of the OSPFv2/OSPFv3 Prefix Extended Flags
sub-TLVs are received within the same TLV, an implementation MUST use
only the first occurrence of the sub-TLV and MUST ignore all
subsequent instances of the sub-TLV. Errors SHOULD be logged subject
to rate limiting.
3. Backward Compatibility
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
Section 2.3.2 of [RFC3630] and Section 6.3 of [RFC8362]).
4. IANA Considerations
4.1. OSPFv2
4.1.1. OSPFv2 Prefix Extended Flags Sub-TLV
IANA has allocated the following codepoint in the "OSPFv2 Extended
Prefix TLV Sub-TLVs" registry:
+=======+==============================+===========+
| Value | Description | Reference |
+=======+==============================+===========+
| 11 | OSPFv2 Prefix Extended Flags | RFC 9792 |
+-------+------------------------------+-----------+
Table 1
4.1.2. OSPFv2 Prefix Extended Flags Registry
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 Section 2.
The bits are to be allocated via IETF Review [RFC8126]. Each bit
definition will include:
* Bit number (counting from bit 0 as the most significant bit of the
first block)
* Description
* Reference
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.
4.2. OSPFv3
4.2.1. OSPFv3 Prefix Extended Flags Sub-TLV
IANA has allocated the following codepoint in the "OSPFv3 Extended-
LSA Sub-TLVs" registry:
+=======+==============================+======+===========+
| Value | Description | L2BM | Reference |
+=======+==============================+======+===========+
| 37 | OSPFv3 Prefix Extended Flags | X | RFC 9792 |
+-------+------------------------------+------+-----------+
Table 2
4.2.2. OSPFv3 Prefix Extended Flags Registry
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 Section 2.
The bits are to be allocated via IETF Review [RFC8126]. Each bit
definition will include:
* Bit number (counting from bit 0 as the most significant bit of the
first block)
* Description
* Reference
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.
5. Security Considerations
Procedures and protocol extensions defined in this document do not
affect the OSPFv2 or OSPFv3 security models. See Section 5 of
[RFC7684] for a discussion of OSPFv2 TLV-encoding considerations and
Section 7 of [RFC8362] for a discussion of OSPFv3 security.
6. References
6.1. Normative References
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997,
<https://www.rfc-editor.org/info/rfc2119>.
[RFC3630] Katz, D., Kompella, K., and D. Yeung, "Traffic Engineering
(TE) Extensions to OSPF Version 2", RFC 3630,
DOI 10.17487/RFC3630, September 2003,
<https://www.rfc-editor.org/info/rfc3630>.
[RFC5340] Coltun, R., Ferguson, D., Moy, J., and A. Lindem, "OSPF
for IPv6", RFC 5340, DOI 10.17487/RFC5340, July 2008,
<https://www.rfc-editor.org/info/rfc5340>.
[RFC7684] Psenak, P., Gredler, H., Shakir, R., Henderickx, W.,
Tantsura, J., and A. Lindem, "OSPFv2 Prefix/Link Attribute
Advertisement", RFC 7684, DOI 10.17487/RFC7684, November
2015, <https://www.rfc-editor.org/info/rfc7684>.
[RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for
Writing an IANA Considerations Section in RFCs", BCP 26,
RFC 8126, DOI 10.17487/RFC8126, June 2017,
<https://www.rfc-editor.org/info/rfc8126>.
[RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
May 2017, <https://www.rfc-editor.org/info/rfc8174>.
[RFC8362] Lindem, A., Roy, A., Goethals, D., Reddy Vallem, V., and
F. Baker, "OSPFv3 Link State Advertisement (LSA)
Extensibility", RFC 8362, DOI 10.17487/RFC8362, April
2018, <https://www.rfc-editor.org/info/rfc8362>.
[RFC9513] Li, Z., Hu, Z., Talaulikar, K., Ed., and P. Psenak,
"OSPFv3 Extensions for Segment Routing over IPv6 (SRv6)",
RFC 9513, DOI 10.17487/RFC9513, December 2023,
<https://www.rfc-editor.org/info/rfc9513>.
6.2. Informative References
[IANA-OSPFv2-EPF]
IANA, "OSPFv2 Extended Prefix TLV Flags",
<https://www.iana.org/assignments/ospfv2-parameters>.
[IANA-OSPFv3-PO]
IANA, "OSPFv3 Prefix Options (8 bits)",
<https://www.iana.org/assignments/ospfv3-parameters>.
Acknowledgements
The authors would like to thank Shraddha Hegde, Changwang Lin, Tom
Petch, and many others for their suggestions and comments.
The authors would also like to thank Acee Lindem for aligning the
terminology with existing OSPF documents and for editorial
improvements.
Authors' Addresses
Ran Chen
ZTE Corporation
Nanjing
China
Email: chen.ran@zte.com.cn
Detao Zhao
ZTE Corporation
Nanjing
China
Email: zhao.detao@zte.com.cn
Peter Psenak
Cisco Systems
Apollo Business Center
Mlynske nivy 43
821 09 Bratislava
Slovakia
Email: ppsenak@cisco.com
Ketan Talaulikar
Cisco Systems
India
Email: ketant.ietf@gmail.com
Liyan Gong
China Mobile
China
Email: gongliyan@chinamobile.com
AI ELI5
On this page
§1Running Out of Prefix Flag Bits
OSPF can advertise each prefix with an 8-bit field of properties. In OSPFv3 this is the Prefix Options field from RFC 5340, and in OSPFv2 it is the Flags field of the Extended Prefix TLV from RFC 7684. The RFC calls both the "existing fixed-size prefix flags".
All the OSPFv3 Prefix Options bits are already assigned. At the time of publication, only 5 bits remained unassigned in the OSPFv2 Extended Prefix TLV Flags. The RFC solves this by defining a variable-length Prefix Extended Flags sub-TLV that applies to both OSPFv2 and OSPFv3.
The little box of switches next to each address had no free switches left, so a bigger box was invented.
§2The Prefix Extended Flags Sub-TLV
The sub-TLV has a 2-octet Type, a 2-octet Length and the variable-length Prefix Extended Flags field. The Type is 11 for OSPFv2 and 37 for OSPFv3. The Length is the size of the flags field in octets and MUST be a multiple of 4. Otherwise the Link State Advertisement (LSA) is malformed and MUST be ignored.
Flags are grouped in 4-octet blocks. Bit 0 is the most significant bit of the first 32-bit block, and numbering continues into later blocks, so the most significant bit of the fifth octet in an 8-octet field is bit 32. This document defines no bits.
Unassigned bits MUST be set to zero on transmission and ignored on receipt. A sender MUST limit the length so that it signals the bits set to 1, and defined flags beyond the transmitted length MUST be treated as 0. The existing fixed-size flags are unchanged.
The new list comes in chunks of the same size. Switches you did not send count as off, so you only send as many chunks as you need.
| Field | Name | Size | Value | Description |
|---|---|---|---|---|
TYPE | Type | 2 bytes | 11 for OSPFv2, 37 for OSPFv3. | |
LENGTH | Length | 2 bytes | Length of the flags field in octets; a multiple of 4. | |
FLAGS | Prefix Extended Flags (Variable) | 4 bytes | Flags in 4-octet blocks; the field may be longer. |
§2Where the Sub-TLV Is Carried
In OSPFv2 it is a sub-TLV of the Extended Prefix TLV defined in RFC 7684. New OSPFv2 flags SHOULD first be taken from unused bits in the existing Flags field, before using the new sub-TLV.
In OSPFv3 it is a sub-TLV of the Inter-Area-Prefix, External-Prefix and Intra-Area-Prefix TLVs from RFC 8362, and of the SRv6 Locator TLV from RFC 9513.
If several instances appear within the same TLV, an implementation MUST use only the first and ignore the rest. Errors SHOULD be logged subject to rate limiting.
The longer list is attached to the address entries that routers already send, and if it shows up twice only the first copy counts.
§3Backward Compatibility
The sub-TLV introduces no backward compatibility issues. A router that does not recognize it ignores it under normal TLV processing, as described in Section 2.3.2 of RFC 3630 and Section 6.3 of RFC 8362.
Older routers just skip the part they do not understand, so nothing breaks.
§4IANA Registries
IANA allocated Sub-TLV value 11 in the "OSPFv2 Extended Prefix TLV Sub-TLVs" registry and value 37 in the "OSPFv3 Extended-LSA Sub-TLVs" registry. It also created an "OSPFv2 Prefix Extended Flags" registry and an "OSPFv3 Prefix Extended Flags" registry.
Bits are allocated by IETF Review under RFC 8126. Each entry records the bit number, a description and a reference. Bits 0-31 start as Unassigned, and IANA will add further blocks of 32 bits when the previous one is used up. A flag may use one bit or several bits to represent a state.
Official lists were opened to record what each new switch means, starting empty.
§5Security Considerations
The extension does not affect the OSPFv2 or OSPFv3 security models. The RFC points to Section 5 of RFC 7684 for OSPFv2 TLV-encoding considerations and Section 7 of RFC 8362 for OSPFv3 security.
Adding more switches does not change how OSPF keeps itself safe.