idnits 2.17.1 draft-ietf-lsvr-bgp-spf-15.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Using lowercase 'not' together with uppercase 'MUST', 'SHALL', 'SHOULD', or 'RECOMMENDED' is not an accepted usage according to RFC 2119. Please use uppercase 'NOT' together with RFC 2119 keywords (if that is what you mean). Found 'SHOULD not' in this paragraph: The protocol identifier specified in the Protocol-ID field [RFC7752] will represent the origin of the advertised NLRI. For Node NLRI and Link NLRI, this MUST be the direct protocol (4). Node or Link NLRI with a Protocol-ID other than direct will be considered malformed. For Prefix NLRI, the specified Protocol-ID MUST be the origin of the prefix. The local and remote node descriptors for all NLRI MUST include the BGP Identifier (TLV 516) and the AS Number (TLV 512) [RFC7752]. The BGP Confederation Member (TLV 517) [RFC7752] is not appliable and SHOULD not be included. If TLV 517 is included, it will be ignored. -- The document date (July 1, 2021) is 1028 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) ** Downref: Normative reference to an Informational RFC: RFC 4272 ** Downref: Normative reference to an Informational RFC: RFC 4593 ** Obsolete normative reference: RFC 7752 (Obsoleted by RFC 9552) == Outdated reference: A later version (-11) exists of draft-ietf-lsvr-applicability-05 == Outdated reference: A later version (-01) exists of draft-psarkar-lsvr-bgp-spf-impl-00 Summary: 3 errors (**), 0 flaws (~~), 4 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group K. Patel 3 Internet-Draft Arrcus, Inc. 4 Intended status: Standards Track A. Lindem 5 Expires: January 2, 2022 Cisco Systems 6 S. Zandi 7 LinkedIn 8 W. Henderickx 9 Nokia 10 July 1, 2021 12 BGP Link-State Shortest Path First (SPF) Routing 13 draft-ietf-lsvr-bgp-spf-15 15 Abstract 17 Many Massively Scaled Data Centers (MSDCs) have converged on 18 simplified layer 3 routing. Furthermore, requirements for 19 operational simplicity have led many of these MSDCs to converge on 20 BGP as their single routing protocol for both their fabric routing 21 and their Data Center Interconnect (DCI) routing. This document 22 describes extensions to BGP to use BGP Link-State distribution and 23 the Shortest Path First (SPF) algorithm used by Internal Gateway 24 Protocols (IGPs) such as OSPF. In doing this, it allows BGP to be 25 efficiently used as both the underlay protocol and the overlay 26 protocol in MSDCs. 28 Status of This Memo 30 This Internet-Draft is submitted in full conformance with the 31 provisions of BCP 78 and BCP 79. 33 Internet-Drafts are working documents of the Internet Engineering 34 Task Force (IETF). Note that other groups may also distribute 35 working documents as Internet-Drafts. The list of current Internet- 36 Drafts is at https://datatracker.ietf.org/drafts/current/. 38 Internet-Drafts are draft documents valid for a maximum of six months 39 and may be updated, replaced, or obsoleted by other documents at any 40 time. It is inappropriate to use Internet-Drafts as reference 41 material or to cite them other than as "work in progress." 43 This Internet-Draft will expire on January 2, 2022. 45 Copyright Notice 47 Copyright (c) 2021 IETF Trust and the persons identified as the 48 document authors. All rights reserved. 50 This document is subject to BCP 78 and the IETF Trust's Legal 51 Provisions Relating to IETF Documents 52 (https://trustee.ietf.org/license-info) in effect on the date of 53 publication of this document. Please review these documents 54 carefully, as they describe your rights and restrictions with respect 55 to this document. Code Components extracted from this document must 56 include Simplified BSD License text as described in Section 4.e of 57 the Trust Legal Provisions and are provided without warranty as 58 described in the Simplified BSD License. 60 Table of Contents 62 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 63 1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 4 64 1.2. BGP Shortest Path First (SPF) Motivation . . . . . . . . 4 65 1.3. Document Overview . . . . . . . . . . . . . . . . . . . . 6 66 1.4. Requirements Language . . . . . . . . . . . . . . . . . . 6 67 2. Base BGP Protocol Relationship . . . . . . . . . . . . . . . 6 68 3. BGP Link-State (BGP-LS) Relationship . . . . . . . . . . . . 7 69 4. BGP Peering Models . . . . . . . . . . . . . . . . . . . . . 8 70 4.1. BGP Single-Hop Peering on Network Node Connections . . . 8 71 4.2. BGP Peering Between Directly-Connected Nodes . . . . . . 8 72 4.3. BGP Peering in Route-Reflector or Controller Topology . . 8 73 5. BGP Shortest Path Routing (SPF) Protocol Extensions . . . . . 9 74 5.1. BGP-LS Shortest Path Routing (SPF) SAFI . . . . . . . . . 9 75 5.1.1. BGP-LS-SPF NLRI TLVs . . . . . . . . . . . . . . . . 9 76 5.1.2. BGP-LS Attribute . . . . . . . . . . . . . . . . . . 10 77 5.2. Extensions to BGP-LS . . . . . . . . . . . . . . . . . . 11 78 5.2.1. Node NLRI Usage . . . . . . . . . . . . . . . . . . . 11 79 5.2.1.1. BGP-LS-SPF Node NLRI Attribute SPF Capability TLV 11 80 5.2.1.2. BGP-LS-SPF Node NLRI Attribute SPF Status TLV . . 12 81 5.2.2. Link NLRI Usage . . . . . . . . . . . . . . . . . . . 13 82 5.2.2.1. BGP-LS-SPF Link NLRI Attribute Prefix-Length TLVs 14 83 5.2.2.2. BGP-LS-SPF Link NLRI Attribute SPF Status TLV . . 14 84 5.2.3. IPv4/IPv6 Prefix NLRI Usage . . . . . . . . . . . . . 15 85 5.2.3.1. BGP-LS-SPF Prefix NLRI Attribute SPF Status TLV . 16 86 5.2.4. BGP-LS Attribute Sequence-Number TLV . . . . . . . . 16 87 5.3. NEXT_HOP Manipulation . . . . . . . . . . . . . . . . . . 17 88 6. Decision Process with SPF Algorithm . . . . . . . . . . . . . 18 89 6.1. BGP NLRI Selection . . . . . . . . . . . . . . . . . . . 19 90 6.1.1. BGP Self-Originated NLRI . . . . . . . . . . . . . . 20 91 6.2. Dual Stack Support . . . . . . . . . . . . . . . . . . . 20 92 6.3. SPF Calculation based on BGP-LS-SPF NLRI . . . . . . . . 20 93 6.4. IPv4/IPv6 Unicast Address Family Interaction . . . . . . 25 94 6.5. NLRI Advertisement . . . . . . . . . . . . . . . . . . . 25 95 6.5.1. Link/Prefix Failure Convergence . . . . . . . . . . . 25 96 6.5.2. Node Failure Convergence . . . . . . . . . . . . . . 26 97 7. Error Handling . . . . . . . . . . . . . . . . . . . . . . . 27 98 7.1. Processing of BGP-LS-SPF TLVs . . . . . . . . . . . . . . 27 99 7.2. Processing of BGP-LS-SPF NLRIs . . . . . . . . . . . . . 28 100 7.3. Processing of BGP-LS Attribute . . . . . . . . . . . . . 29 101 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 30 102 9. Security Considerations . . . . . . . . . . . . . . . . . . . 30 103 10. Management Considerations . . . . . . . . . . . . . . . . . . 31 104 10.1. Configuration . . . . . . . . . . . . . . . . . . . . . 31 105 10.1.1. Link Metric Configuration . . . . . . . . . . . . . 31 106 10.1.2. backoff-config . . . . . . . . . . . . . . . . . . . 31 107 10.2. Operational Data . . . . . . . . . . . . . . . . . . . . 32 108 11. Implementation Status . . . . . . . . . . . . . . . . . . . . 32 109 12. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 33 110 13. Contributors . . . . . . . . . . . . . . . . . . . . . . . . 33 111 14. References . . . . . . . . . . . . . . . . . . . . . . . . . 33 112 14.1. Normative References . . . . . . . . . . . . . . . . . . 33 113 14.2. Informational References . . . . . . . . . . . . . . . . 35 114 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 37 116 1. Introduction 118 Many Massively Scaled Data Centers (MSDCs) have converged on 119 simplified layer 3 routing. Furthermore, requirements for 120 operational simplicity have led many of these MSDCs to converge on 121 BGP [RFC4271] as their single routing protocol for both their fabric 122 routing and their Data Center Interconnect (DCI) routing [RFC7938]. 123 This document describes an alternative solution which leverages BGP- 124 LS [RFC7752] and the Shortest Path First algorithm used by Internal 125 Gateway Protocols (IGPs) such as OSPF [RFC2328]. 127 This document leverages both the BGP protocol [RFC4271] and the BGP- 128 LS [RFC7752] protocols. The relationship, as well as the scope of 129 changes are described respectively in Section 2 and Section 3. The 130 modifications to [RFC4271] for BGP SPF described herein only apply to 131 IPv4 and IPv6 as underlay unicast Subsequent Address Families 132 Identifiers (SAFIs). Operations for any other BGP SAFIs are outside 133 the scope of this document. 135 This solution avails the benefits of both BGP and SPF-based IGPs. 136 These include TCP based flow-control, no periodic link-state refresh, 137 and completely incremental NLRI advertisement. These advantages can 138 reduce the overhead in MSDCs where there is a high degree of Equal 139 Cost Multi-Path (ECMPs) and the topology is very stable. 140 Additionally, using an SPF-based computation can support fast 141 convergence and the computation of Loop-Free Alternatives (LFAs). 142 The SPF LFA extensions defined in [RFC5286] can be similarly applied 143 to BGP SPF calculations. However, the details are a matter of 144 implementation detail. Furthermore, a BGP-based solution lends 145 itself to multiple peering models including those incorporating 146 route-reflectors [RFC4456] or controllers. 148 1.1. Terminology 150 This specification reuses terms defined in section 1.1 of [RFC4271] 151 including BGP speaker, NLRI, and Route. 153 Additionally, this document introduces the following terms: 155 BGP SPF Routing Domain: A set of BGP routers that are under a single 156 administrative domain and exchange link-state information using 157 the BGP-LS-SPF SAFI and compute routes using BGP SPF as described 158 herein. 160 BGP-LS-SPF NLRI: This refers to BGP-LS Network Layer Reachability 161 Information (NLRI) that is being advertised in the BGP-LS-SPF SAFI 162 (Section 5.1) and is being used for BGP SPF route computation. 164 Dijkstra Algorithm: An algorithm for computing the shortest path 165 from a given node in a graph to every other node in the graph. At 166 each iteration of the algorithm, there is a list of candidate 167 vertices. Paths from the root to these vertices have been found, 168 but not necessarily the shortest ones. However, the paths to the 169 candidate vertex that is closest to the root are guaranteed to be 170 shortest; this vertex is added to the shortest-path tree, removed 171 from the candidate list, and its adjacent vertices are examined 172 for possible addition to/modification of the candidate list. The 173 algorithm then iterates again. It terminates when the candidate 174 list becomes empty. [RFC2328] 176 1.2. BGP Shortest Path First (SPF) Motivation 178 Given that [RFC7938] already describes how BGP could be used as the 179 sole routing protocol in an MSDC, one might question the motivation 180 for defining an alternate BGP deployment model when a mature solution 181 exists. For both alternatives, BGP offers the operational benefits 182 of a single routing protocol as opposed to the combination of an IGP 183 for the underlay and BGP as an overlay. However, BGP SPF offers some 184 unique advantages above and beyond standard BGP distance-vector 185 routing. With BGP SPF, the standard hop-by-hop peering model is 186 relaxed. 188 A primary advantage is that all BGP SPF speakers in the BGP SPF 189 routing domain will have a complete view of the topology. This will 190 allow support for ECMP, IP fast-reroute (e.g., Loop-Free 191 Alternatives), Shared Risk Link Groups (SRLGs), and other routing 192 enhancements without advertisement of additional BGP paths [RFC7911] 193 or other extensions. In short, the advantages of an IGP such as OSPF 194 [RFC2328] are availed in BGP. 196 With the simplified BGP decision process as defined in Section 6, 197 NLRI changes can be disseminated throughout the BGP routing domain 198 much more rapidly (equivalent to IGPs with the proper 199 implementation). The added advantage of BGP using TCP for reliable 200 transport leverages TCP's inherent flow-control and guaranteed in- 201 order delivery. 203 Another primary advantage is a potential reduction in NLRI 204 advertisement. With standard BGP distance-vector routing, a single 205 link failure may impact 100s or 1000s prefixes and result in the 206 withdrawal or re-advertisement of the attendant NLRI. With BGP SPF, 207 only the BGP SPF speakers corresponding to the link NLRI need to 208 withdraw the corresponding BGP-LS-SPF Link NLRI. Additionally, the 209 changed NLRI will be advertised immediately as opposed to normal BGP 210 where it is only advertised after the best route selection. These 211 advantages will afford NLRI dissemination throughout the BGP SPF 212 routing domain with efficiencies similar to link-state protocols. 214 With controller and route-reflector peering models, BGP SPF 215 advertisement and distributed computation require a minimal number of 216 sessions and copies of the NLRI since only the latest version of the 217 NLRI from the originator is required. Given that verification of the 218 adjacencies is done outside of BGP (see Section 4), each BGP SPF 219 speaker will only need as many sessions and copies of the NLRI as 220 required for redundancy (see Section 4). Additionally, a controller 221 could inject topology that is learned outside the BGP SPF routing 222 domain. 224 Given that controllers are already consuming BGP-LS NLRI [RFC7752], 225 this functionality can be reused for BGP-LS-SPF NLRI. 227 Another advantage of BGP SPF is that both IPv6 and IPv4 can be 228 supported using the BGP-LS-SPF SAFI with the same BGP-LS-SPF NLRIs. 229 In many MSDC fabrics, the IPv4 and IPv6 topologies are congruent, 230 refer to Section 5.2.2 and Section 5.2.3. Although beyond the scope 231 of this document, multi-topology extensions could be used to support 232 separate IPv4, IPv6, unicast, and multicast topologies while sharing 233 the same NLRI. 235 Finally, the BGP SPF topology can be used as an underlay for other 236 BGP SAFIs (using the existing model) and realize all the above 237 advantages. 239 1.3. Document Overview 241 The document begins with sections defining the precise relationship 242 that BGP SPF has with both the base BGP protocol [RFC4271] 243 (Section 2) and the BGP Link-State (BGP-LS) extensions [RFC7752] 244 (Section 3). This is required to dispel the notion that BGP SPF is 245 an independent protocol. The BGP peering models, as well as the 246 their respective trade-offs are then discussed in Section 4. The 247 remaining sections, which make up the bulk of the document, define 248 the protocol enhancements necessary to support BGP SPF. The BGP-LS 249 extensions to support BGP SPF are defined in Section 5. The 250 replacement of the base BGP decision process with the SPF computation 251 is specified in Section 6. Finally, BGP SPF error handling is 252 defined in Section 7 254 1.4. Requirements Language 256 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 257 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 258 "OPTIONAL" in this document are to be interpreted as described in BCP 259 14 [RFC2119] [RFC8174] when, and only when, they appear in all 260 capitals, as shown here. 262 2. Base BGP Protocol Relationship 264 With the exception of the decision process, the BGP SPF extensions 265 leverage the BGP protocol [RFC4271] without change. This includes 266 the BGP protocol Finite State Machine, BGP messages and their 267 encodings, processing of BGP messages, BGP attributes and path 268 attributes, BGP NLRI encodings, and any error handling defined in the 269 [RFC4271] and [RFC7606]. 271 Due to the changes to the decision process, there are mechanisms and 272 encodings that are no longer applicable. While not necessarily 273 required for computation, the ORIGIN, AS_PATH, MULTI_EXIT_DISC, 274 LOCAL_PREF, and NEXT_HOP path attributes are mandatory and will be 275 validated. The ATOMIC_AGGEGATE, and AGGREGATOR are not applicable 276 within the context of BGP SPF and SHOULD NOT be advertised. However, 277 if they are advertised, they will be accepted, validated, and 278 propagated consistent with the BGP protocol. 280 Section 9 of [RFC4271] defines the decision process that is used to 281 select routes for subsequent advertisement by applying the policies 282 in the local Policy Information Base (PIB) to the routes stored in 283 its Adj-RIBs-In. The output of the Decision Process is the set of 284 routes that are announced by a BGP speaker to its peers. These 285 selected routes are stored by a BGP speaker in the speaker's Adj- 286 RIBs-Out according to policy. 288 The BGP SPF extension fundamentally changes the decision process, as 289 described herein, to be more like a link-state protocol (e.g., OSPF 290 [RFC2328]). Specifically: 292 1. BGP advertisements are readvertised to neighbors immediately 293 without waiting or dependence on the route computation as 294 specified in phase 3 of the base BGP decision process. Multiple 295 peering models are supported as specified in Section 4. 297 2. Determining the degree of preference for BGP routes for the SPF 298 calculation as described in phase 1 of the base BGP decision 299 process is replaced with the mechanisms in Section 6.1. 301 3. Phase 2 of the base BGP protocol decision process is replaced 302 with the Shortest Path First (SPF) algorithm, also known as the 303 Dijkstra algorithm Section 1.1. 305 3. BGP Link-State (BGP-LS) Relationship 307 [RFC7752] describes a mechanism by which link-state and TE 308 information can be collected from networks and shared with external 309 entities using BGP. This is achieved by defining NLRI advertised 310 using the BGP-LS AFI. The BGP-LS extensions defined in [RFC7752] 311 make use of the decision process defined in [RFC4271]. This document 312 reuses NLRI and TLVs defined in [RFC7752]. Rather than reusing the 313 BGP-LS SAFI, the BGP-LS-SPF SAFI Section 5.1 is introduced to insure 314 backward compatibility for the BGP-LS SAFI usage. 316 The BGP SPF extensions reuse the Node, Link, and Prefix NLRI defined 317 in [RFC7752]. The usage of the BGP-LS NLRI, attributes, and 318 attribute extensions is described in Section 5.2. The usage of 319 others BGP-LS attributes is not precluded and is, in fact, expected. 320 However, the details are beyond the scope of this document and will 321 be specified in future documents. 323 Support for Multiple Topology Routing (MTR) similar to the OSPF MTR 324 computation described in [RFC4915] is beyond the scope of this 325 document. Consequently, the usage of the Multi-Topology TLV as 326 described in section 3.2.1.5 of [RFC7752] is not specified. 328 The rules for setting the NLRI next-hop path attribute for the BGP- 329 LS-SPF SAFI will follow the BGP-LS SAFI as specified in section 3.4 330 of [RFC7752]. 332 4. BGP Peering Models 334 Depending on the topology, scaling, capabilities of the BGP SPF 335 speakers, and redundancy requirements, various peering models are 336 supported. The only requirements are that all BGP SPF speakers in 337 the BGP SPF routing domain exchange BGP-LS-SPF NLRI, run an SPF 338 calculation, and update their routing table appropriately. 340 4.1. BGP Single-Hop Peering on Network Node Connections 342 The simplest peering model is the one where EBGP single-hop sessions 343 are established over direct point-to-point links interconnecting the 344 nodes in the BGP SPF routing domain. Once the single-hop BGP session 345 has been established and the BGP-LS-SPF AFI/SAFI capability has been 346 exchanged [RFC4760] for the corresponding session, then the link is 347 considered up from a BGP SPF perspective and the corresponding BGP- 348 LS-SPF Link NLRI is advertised. If the session goes down, the 349 corresponding Link NLRI will be withdrawn. Topologically, this would 350 be equivalent to the peering model in [RFC7938] where there is a BGP 351 session on every link in the data center switch fabric. The content 352 of the Link NLRI is described in Section 5.2.2. 354 4.2. BGP Peering Between Directly-Connected Nodes 356 In this model, BGP SPF speakers peer with all directly-connected 357 nodes but the sessions may be between loopback addresses (i.e., two- 358 hop sessions) and the direct connection discovery and liveliness 359 detection for the interconnecting links are independent of the BGP 360 protocol. For example, liveliness detection could be done using the 361 BFD protocol [RFC5880]. Precisely how discovery and liveliness 362 detection is accomplished is outside the scope of this document. 363 Consequently, there will be a single BGP session even if there are 364 multiple direct connections between BGP SPF speakers. BGP-LS-SPF 365 Link NLRI is advertised as long as a BGP session has been 366 established, the BGP-LS-SPF AFI/SAFI capability has been exchanged 367 [RFC4760], and the link is operational as determined using liveliness 368 detection mechanisms outside the scope of this document. This is 369 much like the previous peering model only peering is between loopback 370 addresses and the interconnecting links can be unnumbered. However, 371 since there are BGP sessions between every directly-connected node in 372 the BGP SPF routing domain, there is only a reduction in BGP sessions 373 when there are parallel links between nodes. 375 4.3. BGP Peering in Route-Reflector or Controller Topology 377 In this model, BGP SPF speakers peer solely with one or more Route 378 Reflectors [RFC4456] or controllers. As in the previous model, 379 direct connection discovery and liveliness detection for those links 380 in the BGP SPF routing domain are done outside of the BGP protocol. 381 BGP-LS-SPF Link NLRI is advertised as long as the corresponding link 382 is considered up as per the chosen liveness detection mechanism. 384 This peering model, known as sparse peering, allows for fewer BGP 385 sessions and, consequently, fewer instances of the same NLRI received 386 from multiple peers. Normally, the route-reflectors or controller 387 BGP sessions would be on directly-connected links to avoid dependence 388 on another routing protocol for session connectivity. However, 389 multi-hop peering is not precluded. The number of BGP sessions is 390 dependent on the redundancy requirements and the stability of the BGP 391 sessions. This is discussed in greater detail in 392 [I-D.ietf-lsvr-applicability]. 394 5. BGP Shortest Path Routing (SPF) Protocol Extensions 396 5.1. BGP-LS Shortest Path Routing (SPF) SAFI 398 In order to replace the existing BGP decision process with an SPF- 399 based decision process in a backward compatible manner by not 400 impacting the BGP-LS SAFI, this document introduces the BGP-LS-SPF 401 SAFI. The BGP-LS-SPF (AFI 16388 / SAFI 80) [RFC4760] is allocated by 402 IANA as specified in the Section 8. In order for two BGP SPF 403 speakers to exchange BGP SPF NLRI, they MUST exchange the 404 Multiprotocol Extensions Capability [RFC5492] [RFC4760] to ensure 405 that they are both capable of properly processing such NLRI. This is 406 done with AFI 16388 / SAFI 80 for BGP-LS-SPF advertised within the 407 BGP SPF Routing Domain. The BGP-LS-SPF SAFI is used to carry IPv4 408 and IPv6 prefix information in a format facilitating an SPF-based 409 decision process. 411 5.1.1. BGP-LS-SPF NLRI TLVs 413 The NLRI format of BGP-LS-SPF SAFI uses exactly same format as the 414 BGP-LS AFI [RFC7752]. In other words, all the TLVs used in BGP-LS 415 AFI are applicable and used for the BGP-LS-SPF SAFI. These TLVs 416 within BGP-LS-SPF NLRI advertise information that describes links, 417 nodes, and prefixes comprising IGP link-state information. 419 In order to compare the NLRI efficiently, it is REQUIRED that all the 420 TLVs within the given NLRI must be ordered in ascending order by the 421 TLV type. For multiple TLVs of same type within a single NLRI, it is 422 REQUIRED that these TLVs are ordered in ascending order by the TLV 423 value field. Comparison of the value fields is performed by treating 424 the entire value field as a hexadecimal string. NLRIs having TLVs 425 which do not follow the ordering rules MUST be considered as 426 malformed and discarded with appropriate error logging. 428 [RFC7752] defines certain NLRI TLVs as a mandatory TLVs. These TLVs 429 are considered mandatory for the BGP-LS-SPF SAFI as well. All the 430 other TLVs are considered as an optional TLVs. 432 Given that there is a single BGP-LS Attribute for all the BGP-LS-SPF 433 NLRI in a BGP Update, Section 3.3, [RFC7752], a BGP Update will 434 normally contain a single BGP-LS-SPF NLRI since advertising multiple 435 NLRI would imply identical attributes. 437 5.1.2. BGP-LS Attribute 439 The BGP-LS attribute of the BGP-LS-SPF SAFI uses exactly same format 440 of the BGP-LS AFI [RFC7752]. In other words, all the TLVs used in 441 BGP-LS attribute of the BGP-LS AFI are applicable and used for the 442 BGP-LS attribute of the BGP-LS-SPF SAFI. This attribute is an 443 optional, non-transitive BGP attribute that is used to carry link, 444 node, and prefix properties and attributes. The BGP-LS attribute is 445 a set of TLVs. 447 The BGP-LS attribute may potentially grow large in size depending on 448 the amount of link-state information associated with a single Link- 449 State NLRI. The BGP specification [RFC4271] mandates a maximum BGP 450 message size of 4096 octets. It is RECOMMENDED that an 451 implementation support [RFC8654] in order to accommodate larger size 452 of information within the BGP-LS Attribute. BGP SPF speakers MUST 453 ensure that they limit the TLVs included in the BGP-LS Attribute to 454 ensure that a BGP update message for a single Link-State NLRI does 455 not cross the maximum limit for a BGP message. The determination of 456 the types of TLVs to be included by the BGP SPF speaker originating 457 the attribute is outside the scope of this document. When a BGP SPF 458 speaker finds that it is exceeding the maximum BGP message size due 459 to addition or update of some other BGP Attribute (e.g., AS_PATH), it 460 MUST consider the BGP-LS Attribute to be malformed and the attribute 461 discard handling of [RFC7606] applies. 463 In order to compare the BGP-LS attribute efficiently, it is REQUIRED 464 that all the TLVs within the given attribute must be ordered in 465 ascending order by the TLV type. For multiple TLVs of same type 466 within a single attribute, it is REQUIRED that these TLVs are ordered 467 in ascending order by the TLV value field. Comparison of the value 468 fields is performed by treating the entire value field as a 469 hexadecimal string. Attributes having TLVs which do not follow the 470 ordering rules MUST NOT be considered as malformed. 472 All TLVs within the BGP-LS Attribute are considered optional unless 473 specified otherwise. 475 5.2. Extensions to BGP-LS 477 [RFC7752] describes a mechanism by which link-state and TE 478 information can be collected from IGPs and shared with external 479 components using the BGP protocol. It describes both the definition 480 of the BGP-LS NLRI that advertise links, nodes, and prefixes 481 comprising IGP link-state information and the definition of a BGP 482 path attribute (BGP-LS attribute) that carries link, node, and prefix 483 properties and attributes, such as the link and prefix metric or 484 auxiliary Router-IDs of nodes, etc. This document extends the usage 485 of BGP-LS NLRI for the purpose of BGP SPF calculation via 486 advertisement in the BGP-LS-SPF SAFI. 488 The protocol identifier specified in the Protocol-ID field [RFC7752] 489 will represent the origin of the advertised NLRI. For Node NLRI and 490 Link NLRI, this MUST be the direct protocol (4). Node or Link NLRI 491 with a Protocol-ID other than direct will be considered malformed. 492 For Prefix NLRI, the specified Protocol-ID MUST be the origin of the 493 prefix. The local and remote node descriptors for all NLRI MUST 494 include the BGP Identifier (TLV 516) and the AS Number (TLV 512) 495 [RFC7752]. The BGP Confederation Member (TLV 517) [RFC7752] is not 496 appliable and SHOULD not be included. If TLV 517 is included, it 497 will be ignored. 499 5.2.1. Node NLRI Usage 501 The Node NLRI MUST be advertised unconditionally by all routers in 502 the BGP SPF routing domain. 504 5.2.1.1. BGP-LS-SPF Node NLRI Attribute SPF Capability TLV 506 The SPF capability is an additional Node Attribute TLV. This 507 attribute TLV MUST be included with the BGP-LS-SPF SAFI and SHOULD 508 NOT be used for other SAFIs. The TLV type 1180 will be assigned by 509 IANA. The Node Attribute TLV will contain a single-octet SPF 510 algorithm as defined in [RFC8665]. 512 0 1 2 3 513 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 514 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 515 | Type (1180) | Length - (1 Octet) | 516 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 517 | SPF Algorithm | 518 +-+-+-+-+-+-+-+-+ 520 The SPF algorithm inherits the values from the IGP Algorithm Types 521 registry [RFC8665]. Algorithm 0, (Shortest Path Algorithm (SPF) 522 based on link metric, is supported and described in Section 6.3. 523 Support for other algorithm types is beyond the scope of this 524 specification. 526 When computing the SPF for a given BGP routing domain, only BGP nodes 527 advertising the SPF capability TLV with same SPF algorithm will be 528 included in the Shortest Path Tree (SPT) Section 6.3. An 529 implementation MAY optionally log detection of a BGP node that has 530 either not advertised the SPF capability TLV or is advertising the 531 SPF capability TLV with an algorithm type other than 0. 533 5.2.1.2. BGP-LS-SPF Node NLRI Attribute SPF Status TLV 535 A BGP-LS Attribute TLV of the BGP-LS-SPF Node NLRI is defined to 536 indicate the status of the node with respect to the BGP SPF 537 calculation. This will be used to rapidly take a node out of service 538 Section 6.5.2 or to indicate the node is not to be used for transit 539 (i.e., non-local) traffic Section 6.3. If the SPF Status TLV is not 540 included with the Node NLRI, the node is considered to be up and is 541 available for transit traffic. The SPF status is acted upon with the 542 execution of the next SPF calculation Section 6.3. A single TLV type 543 will be shared by the BGP-LS-SPF Node, Link, and Prefix NLRI. The 544 TLV type 1184 will be assigned by IANA. 546 0 1 2 3 547 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 548 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 549 | Type (1184) | Length (1 Octet) | 550 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 551 | SPF Status | 552 +-+-+-+-+-+-+-+-+ 554 BGP Status Values: 0 - Reserved 555 1 - Node Unreachable with respect to BGP SPF 556 2 - Node does not support transit with respect 557 to BGP SPF 558 3-254 - Undefined 559 255 - Reserved 561 The BGP-LS-SPF Node Attribute SPF Status TLV, Link Attribute SPF 562 Status TLV, and Prefix Attribute SPF Status TLV use the same TLV Type 563 (1184). This implies that a BGP Update cannot contain multiple NLRI 564 with differing status. If the BGP-LS-SPF Status TLV is advertised 565 and the advertised value is not defined for all NLRI included in the 566 BGP update, then the SPF Status TLV is ignored and not used in SPF 567 computation but is still announced to other BGP SPF speakers. An 568 implementation MAY log an error for further analysis. 570 If a BGP SPF speaker received the Node NLRI but the SPF Status TLV is 571 not received, then any previously received information is considered 572 as implicitly withdrawn and the update is propagated to other BGP SPF 573 speakers. A BGP SPF speaker receiving a BGP Update containing a SPF 574 Status TLV in the BGP-LS attribute [RFC7752] with a value that is 575 outside the range of defined values SHOULD be processed and announced 576 to other BGP SPF speakers. However, a BGP SPF speaker MUST NOT use 577 the Status TLV in its SPF computation. An implementation MAY log 578 this condition for further analysis. 580 5.2.2. Link NLRI Usage 582 The criteria for advertisement of Link NLRI are discussed in 583 Section 4. 585 Link NLRI is advertised with unique local and remote node descriptors 586 dependent on the IP addressing. For IPv4 links, the link's local 587 IPv4 (TLV 259) and remote IPv4 (TLV 260) addresses will be used. For 588 IPv6 links, the local IPv6 (TLV 261) and remote IPv6 (TLV 262) 589 addresses will be used. For unnumbered links, the link local/remote 590 identifiers (TLV 258) will be used. For links supporting having both 591 IPv4 and IPv6 addresses, both sets of descriptors MAY be included in 592 the same Link NLRI. The link identifiers are described in table 5 of 593 [RFC7752]. 595 For a link to be used in Shortest Path Tree (SPT) for a given address 596 family, i.e., IPv4 or IPv6, both routers connecting the link MUST 597 have an address in the same subnet for that address family. However, 598 an IPv4 or IPv6 prefix associated with the link MAY be installed 599 without the corresponding address on the other side of link. 601 The link IGP metric attribute TLV (TLV 1095) MUST be advertised. If 602 a BGP SPF speaker receives a Link NLRI without an IGP metric 603 attribute TLV, then it SHOULD consider the received NLRI as a 604 malformed and the receiving BGP SPF speaker MUST handle such 605 malformed NLRI as 'Treat-as-withdraw' [RFC7606]. The BGP SPF metric 606 length is 4 octets. Like OSPF [RFC2328], a cost is associated with 607 the output side of each router interface. This cost is configurable 608 by the system administrator. The lower the cost, the more likely the 609 interface is to be used to forward data traffic. One possible 610 default for metric would be to give each interface a cost of 1 making 611 it effectively a hop count. Algorithms such as setting the metric 612 inversely to the link speed as supported in the OSPF MIB [RFC4750] 613 MAY be supported. However, this is beyond the scope of this 614 document. Refer to Section 10.1.1 for operational guidance. 616 The usage of other link attribute TLVs is beyond the scope of this 617 document. 619 5.2.2.1. BGP-LS-SPF Link NLRI Attribute Prefix-Length TLVs 621 Two BGP-LS Attribute TLVs of the BGP-LS-SPF Link NLRI are defined to 622 advertise the prefix length associated with the IPv4 and IPv6 link 623 prefixes derived from the link descriptor addresses. The prefix 624 length is used for the optional installation of prefixes 625 corresponding to Link NLRI as defined in Section 6.3. 627 0 1 2 3 628 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 629 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 630 |IPv4 (1182) or IPv6 Type (1183)| Length (1 Octet) | 631 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 632 | Prefix-Length | 633 +-+-+-+-+-+-+-+-+ 635 Prefix-length - A one-octet length restricted to 1-32 for IPv4 636 Link NLRI endpoint prefixes and 1-128 for IPv6 637 Link NLRI endpoint prefixes. 639 The Prefix-Length TLV is only relevant to Link NLRIs. The Prefix- 640 Length TLVs MUST be discarded as an error and not passed to other BGP 641 peers as specified in [RFC7606] when received with any NLRIs other 642 than Link NRLIs. An implementation MAY log an error for further 643 analysis. 645 The maximum prefix-length for IPv4 Prefix-Length TLV is 32 bits. A 646 prefix-length field indicating a larger value than 32 bits MUST be 647 discarded as an error and the received TLV is not passed to other BGP 648 peers as specified in [RFC7606]. The corresponding Link NLRI is 649 considered as malformed and MUST be handled as 'Treat-as-withdraw'. 650 An implementation MAY log an error for further analysis. 652 The maximum prefix-length for IPv6 Prefix-Length Type is 128 bits. A 653 prefix-length field indicating a larger value than 128 bits MUST be 654 discarded as an error and the received TLV is not passed to other BGP 655 peers as specified in [RFC7606]. The corresponding Link NLRI is 656 considered as malformed and MUST be handled as 'Treat-as-withdraw'. 657 An implementation MAY log an error for further analysis. 659 5.2.2.2. BGP-LS-SPF Link NLRI Attribute SPF Status TLV 661 A BGP-LS Attribute TLV of the BGP-LS-SPF Link NLRI is defined to 662 indicate the status of the link with respect to the BGP SPF 663 calculation. This will be used to expedite convergence for link 664 failures as discussed in Section 6.5.1. If the SPF Status TLV is not 665 included with the Link NLRI, the link is considered up and available. 666 The SPF status is acted upon with the execution of the next SPF 667 calculation Section 6.3. A single TLV type will be shared by the 668 Node, Link, and Prefix NLRI. The TLV type 1184 will be assigned by 669 IANA. 671 0 1 2 3 672 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 673 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 674 | Type (1184) | Length (1 Octet) | 675 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 676 | SPF Status | 677 +-+-+-+-+-+-+-+-+ 679 BGP Status Values: 0 - Reserved 680 1 - Link Unreachable with respect to BGP SPF 681 2-254 - Undefined 682 255 - Reserved 684 The BGP-LS-SPF Node Attribute SPF Status TLV, Link Attribute SPF 685 Status TLV, and Prefix Attribute SPF Status TLV use the same TLV Type 686 (1184). This implies that a BGP Update cannot contain multiple NLRI 687 with differing status. If the BGP-LS-SPF Status TLV is advertised 688 and the advertised value is not defined for all NLRI included in the 689 BGP update, then the SPF Status TLV is ignored and not used in SPF 690 computation but is still announced to other BGP SPF speakers. An 691 implementation MAY log an error for further analysis. 693 If a BGP SPF speaker received the Link NLRI but the SPF Status TLV is 694 not received, then any previously received information is considered 695 as implicitly withdrawn and the update is propagated to other BGP SPF 696 speakers. A BGP SPF speaker receiving a BGP Update containing an SPF 697 Status TLV in the BGP-LS attribute [RFC7752] with a value that is 698 outside the range of defined values SHOULD be processed and announced 699 to other BGP SPF speakers. However, a BGP SPF speaker MUST NOT use 700 the Status TLV in its SPF computation. An implementation MAY log 701 this information for further analysis. 703 5.2.3. IPv4/IPv6 Prefix NLRI Usage 705 IPv4/IPv6 Prefix NLRI is advertised with a Local Node Descriptor and 706 the prefix and length. The Prefix Descriptors field includes the IP 707 Reachability Information TLV (TLV 265) as described in [RFC7752]. 708 The Prefix Metric attribute TLV (TLV 1155) MUST be advertised. The 709 IGP Route Tag TLV (TLV 1153) MAY be advertised. The usage of other 710 attribute TLVs is beyond the scope of this document. For loopback 711 prefixes, the metric should be 0. For non-loopback prefixes, the 712 setting of the metric is a local matter and beyond the scope of this 713 document. 715 5.2.3.1. BGP-LS-SPF Prefix NLRI Attribute SPF Status TLV 717 A BGP-LS Attribute TLV to BGP-LS-SPF Prefix NLRI is defined to 718 indicate the status of the prefix with respect to the BGP SPF 719 calculation. This will be used to expedite convergence for prefix 720 unreachability as discussed in Section 6.5.1. If the SPF Status TLV 721 is not included with the Prefix NLRI, the prefix is considered 722 reachable. A single TLV type will be shared by the Node, Link, and 723 Prefix NLRI. The TLV type 1184 will be assigned by IANA. 725 0 1 2 3 726 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 727 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 728 | Type (1184) | Length (1 Octet) | 729 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 730 | SPF Status | 731 +-+-+-+-+-+-+-+-+ 733 BGP Status Values: 0 - Reserved 734 1 - Prefix Unreachable with respect to SPF 735 2-254 - Undefined 736 255 - Reserved 738 The BGP-LS-SPF Node Attribute SPF Status TLV, Link Attribute SPF 739 Status TLV, and Prefix Attribute SPF Status TLV use the same TLV Type 740 (1184). This implies that a BGP Update cannot contain multiple NLRI 741 with differing status. If the BGP-LS-SPF Status TLV is advertised 742 and the advertised value is not defined for all NLRI included in the 743 BGP update, then the SPF Status TLV is ignored and not used in SPF 744 computation but is still announced to other BGP SPF speakers. An 745 implementation MAY log an error for further analysis. 747 If a BGP SPF speaker received the Prefix NLRI but the SPF Status TLV 748 is not received, then any previously received information is 749 considered as implicitly withdrawn and the update is propagated to 750 other BGP SPF speakers. A BGP SPF speaker receiving a BGP Update 751 containing an SPF Status TLV in the BGP-LS attribute [RFC7752] with a 752 value that is outside the range of defined values SHOULD be processed 753 and announced to other BGP SPF speakers. However, a BGP SPF speaker 754 MUST NOT use the Status TLV in its SPF computation. An 755 implementation MAY log this information for further analysis. 757 5.2.4. BGP-LS Attribute Sequence-Number TLV 759 A BGP-LS Attribute TLV of the BGP-LS-SPF NLRI types is defined to 760 assure the most recent version of a given NLRI is used in the SPF 761 computation. The Sequence-Number TLV is mandatory for BGP-LS-SPF 762 NLRI. The TLV type 1181 has been assigned by IANA. The BGP-LS 763 Attribute TLV will contain an 8-octet sequence number. The usage of 764 the Sequence Number TLV is described in Section 6.1. 766 0 1 2 3 767 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 768 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 769 | Type (1181) | Length (8 Octets) | 770 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 771 | Sequence Number (High-Order 32 Bits) | 772 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 773 | Sequence Number (Low-Order 32 Bits) | 774 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 776 Sequence Number 778 The 64-bit strictly-increasing sequence number MUST be incremented 779 for every self-originated version of BGP-LS-SPF NLRI. BGP SPF 780 speakers implementing this specification MUST use available 781 mechanisms to preserve the sequence number's strictly increasing 782 property for the deployed life of the BGP SPF speaker (including cold 783 restarts). One mechanism for accomplishing this would be to use the 784 high-order 32 bits of the sequence number as a wrap/boot count that 785 is incremented any time the BGP router loses its sequence number 786 state or the low-order 32 bits wrap. 788 When incrementing the sequence number for each self-originated NLRI, 789 the sequence number should be treated as an unsigned 64-bit value. 790 If the lower-order 32-bit value wraps, the higher-order 32-bit value 791 should be incremented and saved in non-volatile storage. If a BGP 792 SPF speaker completely loses its sequence number state (e.g., the BGP 793 SPF speaker hardware is replaced or experiences a cold-start), the 794 BGP NLRI selection rules (see Section 6.1) will insure convergence, 795 albeit not immediately. 797 The Sequence-Number TLV is mandatory for BGP-LS-SPF NLRI. If the 798 Sequence-Number TLV is not received then the corresponding Link NLRI 799 is considered as malformed and MUST be handled as 'Treat-as- 800 withdraw'. An implementation MAY log an error for further analysis. 802 5.3. NEXT_HOP Manipulation 804 All BGP peers that support SPF extensions would locally compute the 805 LOC-RIB Next-Hop as a result of the SPF process. Consequently, the 806 Next-Hop is always ignored on receipt. The Next-Hop address MUST be 807 encoded as described in [RFC4760]. BGP SPF speakers MUST interpret 808 the Next-Hop address of MP_REACH_NLRI attribute as an IPv4 address 809 whenever the length of the Next-Hop address is 4 octets, and as a 810 IPv6 address whenever the length of the Next-Hop address is 16 811 octets. 813 [RFC4760] modifies the rules of NEXT_HOP attribute whenever the 814 multiprotocol extensions for BGP-4 are enabled. BGP SPF speakers 815 MUST set the NEXT_HOP attribute according to the rules specified in 816 [RFC4760] as the BGP-LS-SPF routing information is carried within the 817 multiprotocol extensions for BGP-4. 819 6. Decision Process with SPF Algorithm 821 The Decision Process described in [RFC4271] takes place in three 822 distinct phases. The Phase 1 decision function of the Decision 823 Process is responsible for calculating the degree of preference for 824 each route received from a BGP SPF speaker's peer. The Phase 2 825 decision function is invoked on completion of the Phase 1 decision 826 function and is responsible for choosing the best route out of all 827 those available for each distinct destination, and for installing 828 each chosen route into the LOC-RIB. The combination of the Phase 1 829 and 2 decision functions is characterized as a Path Vector algorithm. 831 The SPF based Decision process replaces the BGP Decision process 832 described in [RFC4271]. This process starts with selecting only 833 those Node NLRI whose SPF capability TLV matches with the local BGP 834 SPF speaker's SPF capability TLV value. Since Link-State NLRI always 835 contains the local node descriptor Section 5.2, each NLRI is uniquely 836 originated by a single BGP SPF speaker in the BGP SPF routing domain 837 (the BGP node matching the NLRI's Node Descriptors). Instances of 838 the same NLRI originated by multiple BGP SPF speakers would be 839 indicative of a configuration error or a masquerading attack 840 (Section 9). These selected Node NLRI and their Link/Prefix NLRI are 841 used to build a directed graph during the SPF computation as 842 described below. The best routes for BGP prefixes are installed in 843 the RIB as a result of the SPF process. 845 When BGP-LS-SPF NLRI is received, all that is required is to 846 determine whether it is the most recent by examining the Node-ID and 847 sequence number as described in Section 6.1. If the received NLRI 848 has changed, it will be advertised to other BGP-LS-SPF peers. If the 849 attributes have changed (other than the sequence number), a BGP SPF 850 calculation will be triggered. However, a changed NLRI MAY be 851 advertised immediately to other peers and prior to any SPF 852 calculation. Note that the BGP MinRouteAdvertisementIntervalTimer 853 and MinASOriginationIntervalTimer [RFC4271] timers are not applicable 854 to the BGP-LS-SPF SAFI. The scheduling of the SPF calculation, as 855 described in Section 6.3, is an implementation issue. Scheduling MAY 856 be dampened consistent with the SPF back-off algorithm specified in 857 [RFC8405]. 859 The Phase 3 decision function of the Decision Process [RFC4271] is 860 also simplified since under normal SPF operation, a BGP SPF speaker 861 MUST advertise the changed NLRIs to all BGP peers with the BGP-LS-SPF 862 AFI/SAFI and install the changed routes in the Global RIB. The only 863 exception are unchanged NLRIs or stale NLRIs, i.e., NLRI received 864 with a less recent (numerically smaller) sequence number. 866 6.1. BGP NLRI Selection 868 The rules for all BGP-LS-SPF NLRIs selection for phase 1 of the BGP 869 decision process, section 9.1.1 [RFC4271], no longer apply. 871 1. Routes originated by directly connected BGP SPF peers are 872 preferred. This condition can be determined by comparing the BGP 873 Identifiers in the received Local Node Descriptor and OPEN 874 message. This rule will assure that stale NLRI is updated even 875 if a BGP-LS router loses its sequence number state due to a cold- 876 start. 878 2. The NLRI with the most recent Sequence Number TLV, i.e., highest 879 sequence number is selected. 881 3. The route received from the BGP SPF speaker with the numerically 882 larger BGP Identifier is preferred. 884 When a BGP SPF speaker completely loses its sequence number state, 885 i.e., due to a cold start, or in the unlikely possibility that 64-bit 886 sequence number wraps, the BGP routing domain will still converge. 887 This is due to the fact that BGP SPF speakers adjacent to the router 888 will always accept self-originated NLRI from the associated speaker 889 as more recent (rule # 1). When a BGP SPF speaker reestablishes a 890 connection with its peers, any existing session will be taken down 891 and stale NLRI will be replaced. The adjacent BGP SPF speaker will 892 update their NLRI advertisements, hop by hop, until the BGP routing 893 domain has converged. 895 The modified SPF Decision Process performs an SPF calculation rooted 896 at the BGP SPF speaker using the metrics from the Link Attribute IGP 897 Metric TLV (1095) and the Prefix Attribute Prefix Metric TLV (1155) 898 [RFC7752]. As a result, any other BGP attributes that would 899 influence the BGP decision process defined in [RFC4271] including 900 ORIGIN, MULTI_EXIT_DISC, and LOCAL_PREF attributes are ignored by the 901 SPF algorithm. The NEXT_HOP attribute is discussed in Section 5.3. 902 The AS_PATH and AS4_PATH [RFC6793] attributes are preserved and used 903 for loop detection [RFC4271]. They are ignored during the SPF 904 computation for BGP-LS-SPF NRLIs. 906 6.1.1. BGP Self-Originated NLRI 908 Node, Link, or Prefix NLRI with Node Descriptors matching the local 909 BGP SPF speaker are considered self-originated. When self-originated 910 NLRI is received and it doesn't match the local node's NLRI content 911 (including sequence number), special processing is required. 913 o If a self-originated NLRI is received and the sequence number is 914 more recent (i.e., greater than the local node's sequence number 915 for the NLRI), the NLRI sequence number will be advanced to one 916 greater than the received sequence number and the NLRI will be 917 readvertised to all peers. 919 o If self-originated NLRI is received and the sequence number is the 920 same as the local node's sequence number but the attributes 921 differ, the NLRI sequence number will be advanced to one greater 922 than the received sequence number and the NLRI will be 923 readvertised to all peers. 925 o If self-originated Link or Prefix NLRI is received and the Link or 926 Prefix NLRI is no longer being advertised by the local node, the 927 NLRI will be withdrawn. 929 The above actions are performed immediately when the first instance 930 of a newer self-originated NLRI is received. In this case, the newer 931 instance is considered to be a stale instance that was advertised by 932 the local node prior to a restart where the NLRI state is lost. 933 However, if subsequent newer self-originated NLRI is received for the 934 same Node, Link, or Prefix NLRI, the readvertisement or withdrawal is 935 delayed by 5 seconds since it is likely being advertised by a 936 misconfigured or rogue BGP SPF speaker Section 9. 938 6.2. Dual Stack Support 940 The SPF-based decision process operates on Node, Link, and Prefix 941 NLRIs that support both IPv4 and IPv6 addresses. Whether to run a 942 single SPF computation or multiple SPF computations for separate AFs 943 is an implementation matter. Normally, IPv4 next-hops are calculated 944 for IPv4 prefixes and IPv6 next-hops are calculated for IPv6 945 prefixes. 947 6.3. SPF Calculation based on BGP-LS-SPF NLRI 949 This section details the BGP-LS-SPF local routing information base 950 (RIB) calculation. The router will use BGP-LS-SPF Node, Link, and 951 Prefix NLRI to compute routes using the following algorithm. This 952 calculation yields the set of routes associated with the BGP SPF 953 Routing Domain. A router calculates the shortest-path tree using 954 itself as the root. Optimizations to the BGP-LS-SPF algorithm are 955 possible but MUST yield the same set of routes. The algorithm below 956 supports Equal Cost Multi-Path (ECMP) routes. Weighted Unequal Cost 957 Multi-Path routes are out of scope. The organization of this section 958 owes heavily to section 16 of [RFC2328]. 960 The following abstract data structures are defined in order to 961 specify the algorithm. 963 o Local Route Information Base (LOC-RIB) - This routing table 964 contains reachability information (i.e., next hops) for all 965 prefixes (both IPv4 and IPv6) as well as BGP-LS-SPF node 966 reachability. Implementations may choose to implement this with 967 separate RIBs for each address family and/or Prefix versus Node 968 reachability. It is synonymous with the Loc-RIB specified in 969 [RFC4271]. 971 o Global Routing Information Base (GLOBAL-RIB) - This is Routing 972 Information Base (RIB) containing the current routes that are 973 installed in the router's forwarding plane. This is commonly 974 referred to in networking parlance as "the RIB". 976 o Link State NLRI Database (LSNDB) - Database of BGP-LS-SPF NLRI 977 that facilitates access to all Node, Link, and Prefix NLRI. 979 o Candidate List (CAN-LIST) - This is a list of candidate Node NLRIs 980 used during the BGP SPF calculation Section 6.3. The list is 981 sorted by the cost to reach the Node NLRI with the Node NLRI with 982 the lowest reachability cost at the head of the list. This 983 facilitates execution of the Dijkstra algorithm Section 1.1 where 984 the shortest paths between the local node and other nodes in graph 985 area computed. The CAN-LIST is typically implemented as a heap 986 but other data structures have been used. 988 The algorithm is comprised of the steps below: 990 1. The current LOC-RIB is invalidated, and the CAN-LIST is 991 initialized to empty. The LOC-RIB is rebuilt during the course 992 of the SPF computation. The existing routing entries are 993 preserved for comparison to determine changes that need to be 994 made to the GLOBAL-RIB in step 6. 996 2. The computing router's Node NLRI is updated in the LOC-RIB with a 997 cost of 0 and the Node NLRI is also added to the CAN-LIST. The 998 next-hop list is set to the internal loopback next-hop. 1000 3. The Node NLRI with the lowest cost is removed from the candidate 1001 list for processing. If the BGP-LS Node attribute doesn't 1002 include an SPF Capability TLV (Section 5.2.1.1, the Node NLRI is 1003 ignored and the next lowest cost Node NLRI is selected from 1004 candidate list. The If the BGP-LS Node attribute includes an SPF 1005 Status TLV (Section 5.2.1.1) indicating the node is unreachable, 1006 the Node NLRI is ignored and the next lowest cost Node NLRI is 1007 selected from candidate list. The Node corresponding to this 1008 NLRI will be referred to as the Current-Node. If the candidate 1009 list is empty, the SPF calculation has completed and the 1010 algorithm proceeds to step 6. 1012 4. All the Prefix NLRI with the same Node Identifiers as the 1013 Current-Node will be considered for installation. The next- 1014 hop(s) for these Prefix NLRI are inherited from the Current-Node. 1015 The cost for each prefix is the metric advertised in the Prefix 1016 Attribute Prefix Metric TLV (1155) added to the cost to reach the 1017 Current-Node. The following will be done for each Prefix NLRI 1018 (referred to as the Current-Prefix): 1020 * If the BGP-LS Prefix attribute includes an SPF Status TLV 1021 indicating the prefix is unreachable, the Current-Prefix is 1022 considered unreachable and the next Prefix NLRI is examined in 1023 Step 4. 1025 * If the Current-Prefix's corresponding prefix is in the LOC-RIB 1026 and the LOC-RIB cost is less than the Current-Prefix's metric, 1027 the Current-Prefix does not contribute to the route and the 1028 next Prefix NLRI is examined in Step 4. 1030 * If the Current-Prefix's corresponding prefix is not in the 1031 LOC-RIB, the prefix is installed with the Current-Node's next- 1032 hops installed as the LOC-RIB route's next-hops and the metric 1033 being updated. If the IGP Route Tag TLV (1153) is included in 1034 the Current-Prefix's NLRI Attribute, the tag(s) are installed 1035 in the current LOC-RIB route's tag(s). 1037 * If the Current-Prefix's corresponding prefix is in the LOC-RIB 1038 and the cost is less than the LOC-RIB route's metric, the 1039 prefix is installed with the Current-Node's next-hops 1040 replacing the LOC-RIB route's next-hops and the metric being 1041 updated and any route tags removed. If the IGP Route Tag TLV 1042 (1153) is included in the Current-Prefix's NLRI Attribute, the 1043 tag(s) are installed in the current LOC-RIB route's tag(s). 1045 * If the Current-Prefix's corresponding prefix is in the LOC-RIB 1046 and the cost is the same as the LOC-RIB route's metric, the 1047 Current-Node's next-hops will be merged with LOC-RIB route's 1048 next-hops. If the number of merged next-hops exceeds the 1049 Equal-Cost Multi-Path (ECMP) limit, the number of next-hops is 1050 reduced with next-hops on numbered links preferred over next- 1051 hops on unnumbered links. Among next-hops on numbered links, 1052 the next-hops with the highest IPv4 or IPv6 addresses are 1053 preferred. Among next-hops on unnumbered links, the next-hops 1054 with the highest Remote Identifiers are preferred [RFC5307]. 1055 If the IGP Route Tag TLV (1153) is included in the Current- 1056 Prefix's NLRI Attribute, the tag(s) are merged into the LOC- 1057 RIB route's current tags. 1059 5. All the Link NLRI with the same Node Identifiers as the Current- 1060 Node will be considered for installation. Each link will be 1061 examined and will be referred to in the following text as the 1062 Current-Link. The cost of the Current-Link is the advertised IGP 1063 Metric TLV (1095) from the Link NLRI BGP-LS attribute added to 1064 the cost to reach the Current-Node. If the Current-Node is for 1065 the local BGP Router, the next-hop for the link will be a direct 1066 next-hop pointing to the corresponding local interface. For any 1067 other Current-Node, the next-hop(s) for the Current-Link will be 1068 inherited from the Current-Node. The following will be done for 1069 each link: 1071 A. The prefix(es) associated with the Current-Link are installed 1072 into the LOC-RIB using the same rules as were used for Prefix 1073 NLRI in the previous steps. Optionally, in deployments where 1074 BGP-SPF routers have limited routing table capacity, 1075 installation of these subnets can be suppressed. Suppression 1076 will have an operational impact as the IPv4/IPv6 link 1077 endpoint addresses will not be reachable and tools such as 1078 traceroute will display addresses that are not reachable. 1080 B. If the Current-Node NLRI attributes includes the SPF status 1081 TLV (Section 5.2.1.2) and the status indicates that the Node 1082 doesn't support transit, the next link for the Current-Node 1083 is processed in Step 5. 1085 C. If the Current-Link's NLRI attribute includes an SPF Status 1086 TLV indicating the link is down, the BGP-LS-SPF Link NLRI is 1087 considered down and the next link for the Current-Node is 1088 examined in Step 5. 1090 D. The Current-Link's Remote Node NLRI is accessed (i.e., the 1091 Node NLRI with the same Node identifiers as the Current- 1092 Link's Remote Node Descriptors). If it exists, it will be 1093 referred to as the Remote-Node and the algorithm will proceed 1094 as follows: 1096 + If the Remote-Node's NLRI attribute includes an SPF Status 1097 TLV indicating the node is unreachable, the next link for 1098 the Current-Node is examined in Step 5. 1100 + All the Link NLRI corresponding the Remote-Node will be 1101 searched for a Link NLRI pointing to the Current-Node. 1102 Each Link NLRI is examined for Remote Node Descriptors 1103 matching the Current-Node and Link Descriptors matching 1104 the Current-Link. For numbered links to match, the Link 1105 Descriptors MUST share a common IPv4 or IPv6 subnet. For 1106 unnumbered links to match, the Current Link's Local 1107 Identifier MUST match the Remote Node Link's Remote 1108 Identifier and the Current Link's Remote Identifier MUST 1109 the Remote Node Link's Local Identifier [RFC5307]. If 1110 these conditions are satisfied for one of the Remote- 1111 Node's links, the bi-directional connectivity check 1112 succeeds and the Remote-Node may be processed further. 1113 The Remote-Node's Link NLRI providing bi-directional 1114 connectivity will be referred to as the Remote-Link. If 1115 no Remote-Link is found, the next link for the Current- 1116 Node is examined in Step 5. 1118 + If the Remote-Link NLRI attribute includes an SPF Status 1119 TLV indicating the link is down, the Remote-Link NLRI is 1120 considered down and the next link for the Current-Node is 1121 examined in Step 5. 1123 + If the Remote-Node is not on the CAN-LIST, it is inserted 1124 based on the cost. The Remote Node's cost is the cost of 1125 Current-Node added the Current-Link's IGP Metric TLV 1126 (1095). The next-hop(s) for the Remote-Node are inherited 1127 from the Current-Link. 1129 + If the Remote-Node NLRI is already on the CAN-LIST with a 1130 higher cost, it must be removed and reinserted with the 1131 Remote-Node cost based on the Current-Link (as calculated 1132 in the previous step). The next-hop(s) for the Remote- 1133 Node are inherited from the Current-Link. 1135 + If the Remote-Node NLRI is already on the CAN-LIST with 1136 the same cost, it need not be reinserted on the CAN-LIST. 1137 However, the Current-Link's next-hop(s) must be merged 1138 into the current set of next-hops for the Remote-Node. 1140 + If the Remote-Node NLRI is already on the CAN-LIST with a 1141 lower cost, it need not be reinserted on the CAN-LIST. 1143 E. Return to step 3 to process the next lowest cost Node NLRI on 1144 the CAN-LIST. 1146 6. The LOC-RIB is examined and changes (adds, deletes, 1147 modifications) are installed into the GLOBAL-RIB. For each route 1148 in the LOC-RIB: 1150 * If the route was added during the current BGP SPF computation, 1151 install the route into the GLOBAL-RIB. 1153 * If the route modified during the current BGP SPF computation 1154 (e.g., metric, tags, or next-hops), update the route in the 1155 GLOBAL-RIB. 1157 * If the route was not installed during the current BGP SPF 1158 computation, remove the route from both the GLOBAL-RIB and the 1159 LOC-RIB. 1161 6.4. IPv4/IPv6 Unicast Address Family Interaction 1163 While the BGP-LS-SPF address family and the IPv4/IPv6 unicast address 1164 families MAY install routes into the same device routing tables, they 1165 will operate independently much the same as OSPF and IS-IS would 1166 operate today (i.e., "Ships-in-the-Night" mode). There is no 1167 implicit route redistribution between the BGP address families. 1169 It is RECOMMENDED that BGP-LS-SPF IPv4/IPv6 route computation and 1170 installation be given scheduling priority by default over other BGP 1171 address families as these address families are considered as underlay 1172 SAFIs. Similarly, it is RECOMMENDED that the route preference or 1173 administrative distance give active route installation preference to 1174 BGP-LS-SPF IPv4/IPv6 routes over BGP routes from other AFI/SAFIs. 1175 However, this preference MAY be overridden by an operator-configured 1176 policy. 1178 6.5. NLRI Advertisement 1180 6.5.1. Link/Prefix Failure Convergence 1182 A local failure will prevent a link from being used in the SPF 1183 calculation due to the IGP bi-directional connectivity requirement. 1184 Consequently, local link failures SHOULD always be given priority 1185 over updates (e.g., withdrawing all routes learned on a session) in 1186 order to ensure the highest priority propagation and optimal 1187 convergence. 1189 An IGP such as OSPF [RFC2328] will stop using the link as soon as the 1190 Router-LSA for one side of the link is received. With a BGP 1191 advertisement, the link would continue to be used until the last copy 1192 of the BGP-LS-SPF Link NLRI is withdrawn. In order to avoid this 1193 delay, the originator of the Link NLRI SHOULD advertise a more recent 1194 version with an increased Sequence Number TLV for the BGP-LS-SPF Link 1195 NLRI including the SPF Status TLV (Section 5.2.2.2) indicating the 1196 link is down with respect to BGP SPF. The configurable 1197 LinkStatusDownAdvertise timer controls the interval that the BGP-LS- 1198 LINK NLRI is advertised with SPF Status indicating the link is down 1199 prior to withdrawal. If the link becomes available in that period, 1200 the originator of the BGP-LS-SPF LINK NLRI SHOULD advertise a more 1201 recent version of the BGP-LS-SPF Link NLRI without the SPF Status TLV 1202 in the BGP-LS Link Attributes. The suggested default value for the 1203 LinkStatusDownAdvertise timer is 2 seconds. 1205 Similarly, when a prefix becomes unreachable, a more recent version 1206 of the BGP-LS-SPF Prefix NLRI SHOULD be advertised with the SPF 1207 Status TLV (Section 5.2.3.1) indicating the prefix is unreachable in 1208 the BGP-LS Prefix Attributes and the prefix will be considered 1209 unreachable with respect to BGP SPF. The configurable 1210 PrefixStatusDownAdvertise timer controls the interval that the BGP- 1211 LS-Prefix NLRI is advertised with SPF Status indicating the prefix is 1212 unreachable prior to withdrawal. If the prefix becomes reachable in 1213 that period, the originator of the BGP-LS-SPF Prefix NLRI SHOULD 1214 advertise a more recent version of the BGP-LS-SPF Prefix NLRI without 1215 the SPF Status TLV in the BGP-LS Prefix Attributes. The suggested 1216 default value for the PrefixStatusDownAdvertise timer is 2 seconds. 1218 6.5.2. Node Failure Convergence 1220 With BGP without graceful restart [RFC4724], all the NLRI advertised 1221 by a node are implicitly withdrawn when a session failure is 1222 detected. If fast failure detection such as BFD is utilized, and the 1223 node is on the fastest converging path, the most recent versions of 1224 BGP-LS-SPF NLRI may be withdrawn. This will result into an older 1225 version of the NLRI being used until the new versions arrive and, 1226 potentially, unnecessary route flaps. For the BGP-LS-SPF SAFI, NLRI 1227 SHOULD NOT be implicitly withdrawn immediately to prevent such 1228 unnecessary route flaps. The configurable 1229 NLRIImplicitWithdrawalDelay timer controls the interval that NLRI is 1230 retained prior to implicit withdrawal after a BGP SPF speaker has 1231 transitioned out of Established state. This will not delay 1232 convergence since the adjacent nodes will detect the link failure and 1233 advertise a more recent NLRI indicating the link is down with respect 1234 to BGP SPF (Section 6.5.1) and the BGP SPF calculation will fail the 1235 bi-directional connectivity check Section 6.3. The suggested default 1236 value for the NLRIImplicitWithdrawalDelay timer is 2 seconds. 1238 7. Error Handling 1240 This section describes the Error Handling actions, as described in 1241 [RFC7606], that are specific to SAFI BGP-LS-SPF BGP Update message 1242 processing. 1244 7.1. Processing of BGP-LS-SPF TLVs 1246 When a BGP SPF speaker receives a BGP Update containing a malformed 1247 Node NLRI SPF Status TLV in the BGP-LS Attribute [RFC7752], it MUST 1248 ignore the received TLV and MUST NOT pass it to other BGP peers as 1249 specified in [RFC7606]. When discarding an associated Node NLRI with 1250 a malformed TLV, a BGP SPF speaker SHOULD log an error for further 1251 analysis. 1253 When a BGP SPF speaker receives a BGP Update containing a malformed 1254 Link NLRI SPF Status TLV in the BGP-LS Attribute [RFC7752], it MUST 1255 ignore the received TLV and MUST NOT pass it to other BGP peers as 1256 specified in [RFC7606]. When discarding an associated Link NLRI with 1257 a malformed TLV, a BGP SPF speaker SHOULD log an error for further 1258 analysis. 1260 When a BGP SPF speaker receives a BGP Update containing a malformed 1261 Prefix NLRI SPF Status TLV in the BGP-LS Attribute [RFC7752], it MUST 1262 ignore the received TLV and MUST NOT pass it to other BGP peers as 1263 specified in [RFC7606]. When discarding an associated Prefix NLRI 1264 with a malformed TLV, a BGP SPF speaker SHOULD log an error for 1265 further analysis. 1267 When a BGP SPF speaker receives a BGP Update containing a malformed 1268 SPF Capability TLV in the Node NLRI BGP-LS Attribute [RFC7752], it 1269 MUST ignore the received TLV and the Node NLRI and MUST NOT pass it 1270 to other BGP peers as specified in [RFC7606]. When discarding a Node 1271 NLRI with a malformed TLV, a BGP SPF speaker SHOULD log an error for 1272 further analysis. 1274 When a BGP SPF speaker receives a BGP Update containing a malformed 1275 IPv4 Prefix-Length TLV in the Link NLRI BGP-LS Attribute [RFC7752], 1276 it MUST ignore the received TLV and the Node NLRI and MUST NOT pass 1277 it to other BGP peers as specified in [RFC7606]. The corresponding 1278 Link NLRI is considered as malformed and MUST be handled as 'Treat- 1279 as-withdraw'. An implementation MAY log an error for further 1280 analysis. 1282 When a BGP SPF speaker receives a BGP Update containing a malformed 1283 IPv6 Prefix-Length TLV in the Link NLRI BGP-LS Attribute [RFC7752], 1284 it MUST ignore the received TLV and the Node NLRI and MUST NOT pass 1285 it to other BGP peers as specified in [RFC7606]. The corresponding 1286 Link NLRI is considered as malformed and MUST be handled as 'Treat- 1287 as-withdraw'. An implementation MAY log an error for further 1288 analysis. 1290 7.2. Processing of BGP-LS-SPF NLRIs 1292 A Link-State NLRI MUST NOT be considered as malformed or invalid 1293 based on the inclusion/exclusion of TLVs or contents of the TLV 1294 fields (i.e., semantic errors), as described in Section 5.1 and 1295 Section 5.1.1. 1297 A BGP-LS-SPF Speaker MUST perform the following syntactic validation 1298 of the BGP-LS-SPF NLRI to determine if it is malformed. 1300 1. Does the sum of all TLVs found in the BGP MP_REACH_NLRI attribute 1301 correspond to the BGP MP_REACH_NLRI length? 1303 2. Does the sum of all TLVs found in the BGP MP_UNREACH_NLRI 1304 attribute correspond to the BGP MP_UNREACH_NLRI length? 1306 3. Does the sum of all TLVs found in a BGP-LS-SPF NLRI correspond to 1307 the Total NLRI Length field of all its Descriptors? 1309 4. When an NLRI TLV is recognized, is the length of the TLV and its 1310 sub-TLVs valid? 1312 5. Has the syntactic correctness of the NLRI fields been verified as 1313 per [RFC7606]? 1315 6. Has the rule regarding ordering of TLVs been followed as 1316 described in Section 5.1.1? 1318 When the error determined allows for the router to skip the malformed 1319 NLRI(s) and continue processing of the rest of the update message 1320 (e.g., when the TLV ordering rule is violated), then it MUST handle 1321 such malformed NLRIs as 'Treat-as-withdraw'. In other cases, where 1322 the error in the NLRI encoding results in the inability to process 1323 the BGP update message (e.g., length related encoding errors), then 1324 the router SHOULD handle such malformed NLRIs as 'AFI/SAFI disable' 1325 when other AFI/SAFI besides BGP-LS are being advertised over the same 1326 session. Alternately, the router MUST perform 'session reset' when 1327 the session is only being used for BGP-LS-SPF or when its 'AFI/SAFI 1328 disable' action is not possible. 1330 7.3. Processing of BGP-LS Attribute 1332 A BGP-LS Attribute MUST NOT be considered as malformed or invalid 1333 based on the inclusion/exclusion of TLVs or contents of the TLV 1334 fields (i.e., semantic errors), as described in Section 5.1 and 1335 Section 5.1.1. 1337 A BGP-LS-SPF Speaker MUST perform the following syntactic validation 1338 of the BGP-LS Attribute to determine if it is malformed. 1340 1. Does the sum of all TLVs found in the BGP-LS-SPF Attribute 1341 correspond to the BGP-LS Attribute length? 1343 2. Has the syntactic correctness of the Attributes (including BGP-LS 1344 Attribute) been verified as per [RFC7606]? 1346 3. Is the length of each TLV and, when the TLV is recognized then, 1347 its sub-TLVs in the BGP-LS Attribute valid? 1349 When the detected error allows for the router to skip the malformed 1350 BGP-LS Attribute and continue processing of the rest of the update 1351 message (e.g., when the BGP-LS Attribute length and the total Path 1352 Attribute Length are correct but some TLV/sub-TLV length within the 1353 BGP-LS Attribute is invalid), then it MUST handle such malformed BGP- 1354 LS Attribute as 'Attribute Discard'. In other cases, when the error 1355 in the BGP-LS Attribute encoding results in the inability to process 1356 the BGP update message, then the handling is the same as described 1357 above for malformed NLRI. 1359 Note that the 'Attribute Discard' action results in the loss of all 1360 TLVs in the BGP-LS Attribute and not the removal of a specific 1361 malformed TLV. The removal of specific malformed TLVs may give a 1362 wrong indication to a BGP SPF speaker that the specific information 1363 is being deleted or is not available. 1365 When a BGP SPF speaker receives an update message with Link-State 1366 NLRI(s) in the MP_REACH_NLRI but without the BGP-LS-SPF Attribute, it 1367 is most likely an indication that a BGP SPF speaker preceding it has 1368 performed the 'Attribute Discard' fault handling. An implementation 1369 SHOULD preserve and propagate the Link-State NLRIs in such an update 1370 message so that the BGP SPF speaker can detect the loss of link-state 1371 information for that object and not assume its deletion/withdrawal. 1372 This also makes it possible for a network operator to trace back to 1373 the BGP SPF speaker which actually detected a problem with the BGP-LS 1374 Attribute. 1376 An implementation SHOULD log an error for further analysis for 1377 problems detected during syntax validation. 1379 When a BGP SPF speaker receives a BGP Update containing a malformed 1380 IGP metric TLV in the Link NLRI BGP-LS Attribute [RFC7752], it MUST 1381 ignore the received TLV and the Link NLRI and MUST NOT pass it to 1382 other BGP peers as specified in [RFC7606]. When discarding a Link 1383 NLRI with a malformed TLV, a BGP SPF speaker SHOULD log an error for 1384 further analysis. 1386 8. IANA Considerations 1388 This document defines the use of SAFI (80) for BGP SPF operation 1389 Section 5.1, and requests IANA to assign the value from the First 1390 Come First Serve (FCFS) range in the Subsequent Address Family 1391 Identifiers (SAFI) Parameters registry. 1393 This document also defines five attribute TLVs of BGP-LS-SPF NLRI. 1394 We request IANA to assign types for the SPF capability TLV, Sequence 1395 Number TLV, IPv4 Link Prefix-Length TLV, IPv6 Link Prefix-Length TLV, 1396 and SPF Status TLV from the "BGP-LS Node Descriptor, Link Descriptor, 1397 Prefix Descriptor, and Attribute TLVs" Registry. 1399 +-------------------------+-----------------+--------------------+ 1400 | Attribute TLV | Suggested Value | NLRI Applicability | 1401 +-------------------------+-----------------+--------------------+ 1402 | SPF Capability | 1180 | Node | 1403 | SPF Status | 1184 | Node, Link, Prefix | 1404 | IPv4 Link Prefix Length | 1182 | Link | 1405 | IPv6 Link Prefix Length | 1183 | Link | 1406 | Sequence Number | 1181 | Node, Link, Prefix | 1407 +-------------------------+-----------------+--------------------+ 1409 Table 1: NLRI Attribute TLVs 1411 9. Security Considerations 1413 This document defines a BGP SAFI, i.e., the BGP-LS-SPF SAFI. This 1414 document does not change the underlying security issues inherent in 1415 the BGP protocol [RFC4271]. The Security Considerations discussed in 1416 [RFC4271] apply to the BGP SPF functionality as well. The analysis 1417 of the security issues for BGP mentioned in [RFC4272] and [RFC6952] 1418 also applies to this document. The analysis of Generic Threats to 1419 Routing Protocols done in [RFC4593] is also worth noting. As the 1420 modifications described in this document for BGP SPF apply to IPv4 1421 Unicast and IPv6 Unicast as undelay SAFIs in a single BGP SPF Routing 1422 Domain, the BGP security solutions described in [RFC6811] and 1423 [RFC8205] are somewhat constricted as they are meant to apply for 1424 inter-domain BGP where multiple BGP Routing Domains are typically 1425 involved. The BGP-LS-SPF SAFI NLRI described in this document are 1426 typically advertised between EBGP or IBGP speakers under a single 1427 administrative domain. 1429 In the context of the BGP peering associated with this document, a 1430 BGP speaker MUST NOT accept updates from a peer that is not within 1431 any administrative control of an operator. That is, a participating 1432 BGP speaker SHOULD be aware of the nature of its peering 1433 relationships. Such protection can be achieved by manual 1434 configuration of peers at the BGP speaker. 1436 In order to mitigate the risk of peering with BGP speakers 1437 masquerading as legitimate authorized BGP speakers, it is recommended 1438 that the TCP Authentication Option (TCP-AO) [RFC5925] be used to 1439 authenticate BGP sessions. If an authorized BGP peer is compromised, 1440 that BGP peer could advertise modified Node, Link, or Prefix NLRI 1441 will result in misrouting, repeating origination of NLRI, and/or 1442 excessive SPF calculations. When a BGP speaker detects that its 1443 self-originated NLRI is being originated by another BGP speaker, an 1444 appropriate error should be logged so that the operator can take 1445 corrective action. 1447 10. Management Considerations 1449 This section includes unique management considerations for the BGP- 1450 LS-SPF address family. 1452 10.1. Configuration 1454 All routers in BGP SPF Routing Domain are under a single 1455 administrative domain allowing for consistent configuration. 1457 10.1.1. Link Metric Configuration 1459 Within a BGP SPF Routing Domain, the IGP metrics for all advertised 1460 links SHOULD be configured or defaulted consistently. For example, 1461 if a default metric is used for one router's links, then a similar 1462 metric should be used for all router's links. Similarly, if the link 1463 cost is derived from using the inverse of the link bandwidth on one 1464 router, then this SHOULD be done for all routers and the same 1465 reference bandwidth should be used to derive the inversely 1466 proportional metric. Failure to do so will not result in correct 1467 routing based on link metric. 1469 10.1.2. backoff-config 1471 In addition to configuration of the BGP-LS-SPF address family, 1472 implementations SHOULD support the "Shortest Path First (SPF) Back- 1473 Off Delay Algorithm for Link-State IGPs" [RFC8405]. If supported, 1474 configuration of the INITIAL_SPF_DELAY, SHORT_SPF_DELAY, 1475 LONG_SPF_DELAY, TIME_TO_LEARN, and HOLDDOWN_INTERVAL MUST be 1476 supported [RFC8405]. Section 6 of [RFC8405] recommends consistent 1477 configuration of these values throughout the IGP routing domain and 1478 this also applies to the BGP SPF Routing Domain. 1480 10.2. Operational Data 1482 In order to troubleshoot SPF issues, implementations SHOULD support 1483 an SPF log including entries for previous SPF computations. Each SPF 1484 log entry would include the BGP-LS-SPF NLRI SPF triggering the SPF, 1485 SPF scheduled time, SPF start time, SPF end time, and SPF type if 1486 different types of SPF are supported. Since the size of the log will 1487 be finite, implementations SHOULD also maintain counters for the 1488 total number of SPF computations and the total number of SPF 1489 triggering events. Additionally, to troubleshoot SPF scheduling and 1490 back-off [RFC8405], the current SPF back-off state, remaining time- 1491 to-learn, remaining holddown, last trigger event time, last SPF time, 1492 and next SPF time should be available. 1494 11. Implementation Status 1496 Note RFC Editor: Please remove this section and the associated 1497 references prior to publication. 1499 This section records the status of known implementations of the 1500 protocol defined by this specification at the time of posting of this 1501 Internet-Draft and is based on a proposal described in [RFC7942]. 1502 The description of implementations in this section is intended to 1503 assist the IETF in its decision processes in progressing drafts to 1504 RFCs. Please note that the listing of any individual implementation 1505 here does not imply endorsement by the IETF. Furthermore, no effort 1506 has been spent to verify the information presented here that was 1507 supplied by IETF contributors. This is not intended as, and must not 1508 be construed to be, a catalog of available implementations or their 1509 features. Readers are advised to note that other implementations may 1510 exist. 1512 According to RFC 7942, "this will allow reviewers and working groups 1513 to assign due consideration to documents that have the benefit of 1514 running code, which may serve as evidence of valuable experimentation 1515 and feedback that have made the implemented protocols more mature. 1516 It is up to the individual working groups to use this information as 1517 they see fit". 1519 The BGP-LS-SPF implementation status is documented in 1520 [I-D.psarkar-lsvr-bgp-spf-impl]. 1522 12. Acknowledgements 1524 The authors would like to thank Sue Hares, Jorge Rabadan, Boris 1525 Hassanov, Dan Frost, Matt Anderson, Fred Baker, Lukas Krattiger, 1526 Yingzhen Qu, and Haibo Wang for their review and comments. Thanks to 1527 Pushpasis Sarkar for discussions on preventing a BGP SPF Router from 1528 being used for non-local traffic (i.e., transit traffic). 1530 The authors extend special thanks to Eric Rosen for fruitful 1531 discussions on BGP-LS-SPF convergence as compared to IGPs. 1533 13. Contributors 1535 In addition to the authors listed on the front page, the following 1536 co-authors have contributed to the document. 1538 Derek Yeung 1539 Arrcus, Inc. 1540 derek@arrcus.com 1542 Gunter Van De Velde 1543 Nokia 1544 gunter.van_de_velde@nokia.com 1546 Abhay Roy 1547 Arrcus, Inc. 1548 abhay@arrcus.com 1550 Venu Venugopal 1551 Cisco Systems 1552 venuv@cisco.com 1554 Chaitanya Yadlapalli 1555 AT&T 1556 cy098d@att.com 1558 14. References 1560 14.1. Normative References 1562 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1563 Requirement Levels", BCP 14, RFC 2119, 1564 DOI 10.17487/RFC2119, March 1997, 1565 . 1567 [RFC4271] Rekhter, Y., Ed., Li, T., Ed., and S. Hares, Ed., "A 1568 Border Gateway Protocol 4 (BGP-4)", RFC 4271, 1569 DOI 10.17487/RFC4271, January 2006, 1570 . 1572 [RFC4272] Murphy, S., "BGP Security Vulnerabilities Analysis", 1573 RFC 4272, DOI 10.17487/RFC4272, January 2006, 1574 . 1576 [RFC4593] Barbir, A., Murphy, S., and Y. Yang, "Generic Threats to 1577 Routing Protocols", RFC 4593, DOI 10.17487/RFC4593, 1578 October 2006, . 1580 [RFC4750] Joyal, D., Ed., Galecki, P., Ed., Giacalone, S., Ed., 1581 Coltun, R., and F. Baker, "OSPF Version 2 Management 1582 Information Base", RFC 4750, DOI 10.17487/RFC4750, 1583 December 2006, . 1585 [RFC4760] Bates, T., Chandra, R., Katz, D., and Y. Rekhter, 1586 "Multiprotocol Extensions for BGP-4", RFC 4760, 1587 DOI 10.17487/RFC4760, January 2007, 1588 . 1590 [RFC5492] Scudder, J. and R. Chandra, "Capabilities Advertisement 1591 with BGP-4", RFC 5492, DOI 10.17487/RFC5492, February 1592 2009, . 1594 [RFC5925] Touch, J., Mankin, A., and R. Bonica, "The TCP 1595 Authentication Option", RFC 5925, DOI 10.17487/RFC5925, 1596 June 2010, . 1598 [RFC6793] Vohra, Q. and E. Chen, "BGP Support for Four-Octet 1599 Autonomous System (AS) Number Space", RFC 6793, 1600 DOI 10.17487/RFC6793, December 2012, 1601 . 1603 [RFC6811] Mohapatra, P., Scudder, J., Ward, D., Bush, R., and R. 1604 Austein, "BGP Prefix Origin Validation", RFC 6811, 1605 DOI 10.17487/RFC6811, January 2013, 1606 . 1608 [RFC7606] Chen, E., Ed., Scudder, J., Ed., Mohapatra, P., and K. 1609 Patel, "Revised Error Handling for BGP UPDATE Messages", 1610 RFC 7606, DOI 10.17487/RFC7606, August 2015, 1611 . 1613 [RFC7752] Gredler, H., Ed., Medved, J., Previdi, S., Farrel, A., and 1614 S. Ray, "North-Bound Distribution of Link-State and 1615 Traffic Engineering (TE) Information Using BGP", RFC 7752, 1616 DOI 10.17487/RFC7752, March 2016, 1617 . 1619 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 1620 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 1621 May 2017, . 1623 [RFC8205] Lepinski, M., Ed. and K. Sriram, Ed., "BGPsec Protocol 1624 Specification", RFC 8205, DOI 10.17487/RFC8205, September 1625 2017, . 1627 [RFC8405] Decraene, B., Litkowski, S., Gredler, H., Lindem, A., 1628 Francois, P., and C. Bowers, "Shortest Path First (SPF) 1629 Back-Off Delay Algorithm for Link-State IGPs", RFC 8405, 1630 DOI 10.17487/RFC8405, June 2018, 1631 . 1633 [RFC8654] Bush, R., Patel, K., and D. Ward, "Extended Message 1634 Support for BGP", RFC 8654, DOI 10.17487/RFC8654, October 1635 2019, . 1637 [RFC8665] Psenak, P., Ed., Previdi, S., Ed., Filsfils, C., Gredler, 1638 H., Shakir, R., Henderickx, W., and J. Tantsura, "OSPF 1639 Extensions for Segment Routing", RFC 8665, 1640 DOI 10.17487/RFC8665, December 2019, 1641 . 1643 14.2. Informational References 1645 [I-D.ietf-lsvr-applicability] 1646 Patel, K., Lindem, A., Zandi, S., and G. Dawra, "Usage and 1647 Applicability of Link State Vector Routing in Data 1648 Centers", draft-ietf-lsvr-applicability-05 (work in 1649 progress), March 2020. 1651 [I-D.psarkar-lsvr-bgp-spf-impl] 1652 Sarkar, P., Patel, K., Pallagatti, S., and s. 1653 sajibasil@gmail.com, "BGP Shortest Path Routing Extension 1654 Implementation Report", draft-psarkar-lsvr-bgp-spf-impl-00 1655 (work in progress), June 2020. 1657 [RFC2328] Moy, J., "OSPF Version 2", STD 54, RFC 2328, 1658 DOI 10.17487/RFC2328, April 1998, 1659 . 1661 [RFC4456] Bates, T., Chen, E., and R. Chandra, "BGP Route 1662 Reflection: An Alternative to Full Mesh Internal BGP 1663 (IBGP)", RFC 4456, DOI 10.17487/RFC4456, April 2006, 1664 . 1666 [RFC4724] Sangli, S., Chen, E., Fernando, R., Scudder, J., and Y. 1667 Rekhter, "Graceful Restart Mechanism for BGP", RFC 4724, 1668 DOI 10.17487/RFC4724, January 2007, 1669 . 1671 [RFC4915] Psenak, P., Mirtorabi, S., Roy, A., Nguyen, L., and P. 1672 Pillay-Esnault, "Multi-Topology (MT) Routing in OSPF", 1673 RFC 4915, DOI 10.17487/RFC4915, June 2007, 1674 . 1676 [RFC5286] Atlas, A., Ed. and A. Zinin, Ed., "Basic Specification for 1677 IP Fast Reroute: Loop-Free Alternates", RFC 5286, 1678 DOI 10.17487/RFC5286, September 2008, 1679 . 1681 [RFC5307] Kompella, K., Ed. and Y. Rekhter, Ed., "IS-IS Extensions 1682 in Support of Generalized Multi-Protocol Label Switching 1683 (GMPLS)", RFC 5307, DOI 10.17487/RFC5307, October 2008, 1684 . 1686 [RFC5880] Katz, D. and D. Ward, "Bidirectional Forwarding Detection 1687 (BFD)", RFC 5880, DOI 10.17487/RFC5880, June 2010, 1688 . 1690 [RFC6952] Jethanandani, M., Patel, K., and L. Zheng, "Analysis of 1691 BGP, LDP, PCEP, and MSDP Issues According to the Keying 1692 and Authentication for Routing Protocols (KARP) Design 1693 Guide", RFC 6952, DOI 10.17487/RFC6952, May 2013, 1694 . 1696 [RFC7911] Walton, D., Retana, A., Chen, E., and J. Scudder, 1697 "Advertisement of Multiple Paths in BGP", RFC 7911, 1698 DOI 10.17487/RFC7911, July 2016, 1699 . 1701 [RFC7938] Lapukhov, P., Premji, A., and J. Mitchell, Ed., "Use of 1702 BGP for Routing in Large-Scale Data Centers", RFC 7938, 1703 DOI 10.17487/RFC7938, August 2016, 1704 . 1706 [RFC7942] Sheffer, Y. and A. Farrel, "Improving Awareness of Running 1707 Code: The Implementation Status Section", BCP 205, 1708 RFC 7942, DOI 10.17487/RFC7942, July 2016, 1709 . 1711 Authors' Addresses 1713 Keyur Patel 1714 Arrcus, Inc. 1716 Email: keyur@arrcus.com 1718 Acee Lindem 1719 Cisco Systems 1720 301 Midenhall Way 1721 Cary, NC 27513 1722 USA 1724 Email: acee@cisco.com 1726 Shawn Zandi 1727 LinkedIn 1728 222 2nd Street 1729 San Francisco, CA 94105 1730 USA 1732 Email: szandi@linkedin.com 1734 Wim Henderickx 1735 Nokia 1736 Antwerp 1737 Belgium 1739 Email: wim.henderickx@nokia.com