idnits 2.17.1 draft-ietf-bess-nsh-bgp-control-plane-16.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 -- The document date (August 19, 2020) is 1318 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) == Missing Reference: 'SPI' is mentioned on line 632, but not defined == Missing Reference: 'SI' is mentioned on line 632, but not defined == Missing Reference: 'I-D.darwa' is mentioned on line 2842, but not defined == Outdated reference: A later version (-27) exists of draft-ietf-idr-rfc5575bis-26 == Outdated reference: A later version (-22) exists of draft-ietf-idr-tunnel-encaps-17 ** Downref: Normative reference to an Informational RFC: RFC 7665 ** Downref: Normative reference to an Informational RFC: RFC 8596 == Outdated reference: A later version (-06) exists of draft-dawra-idr-bgp-ls-sr-service-segments-04 Summary: 2 errors (**), 0 flaws (~~), 7 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 BESS Working Group A. Farrel 3 Internet-Draft Old Dog Consulting 4 Intended status: Standards Track J. Drake 5 Expires: February 20, 2021 E. Rosen 6 Juniper Networks 7 J. Uttaro 8 AT&T 9 L. Jalil 10 Verizon 11 August 19, 2020 13 BGP Control Plane for the Network Service Header in Service Function 14 Chaining 15 draft-ietf-bess-nsh-bgp-control-plane-16 17 Abstract 19 This document describes the use of BGP as a control plane for 20 networks that support Service Function Chaining (SFC). The document 21 introduces a new BGP address family called the SFC Address Family 22 Identifier / Subsequent Address Family Identifier (SFC AFI/SAFI) with 23 two route types. One route type is originated by a node to advertise 24 that it hosts a particular instance of a specified service function. 25 This route type also provides "instructions" on how to send a packet 26 to the hosting node in a way that indicates that the service function 27 has to be applied to the packet. The other route type is used by a 28 Controller to advertise the paths of "chains" of service functions, 29 and to give a unique designator to each such path so that they can be 30 used in conjunction with the Network Service Header defined in RFC 31 8300. 33 This document adopts the SFC architecture described in RFC 7665. 35 Status of This Memo 37 This Internet-Draft is submitted in full conformance with the 38 provisions of BCP 78 and BCP 79. 40 Internet-Drafts are working documents of the Internet Engineering 41 Task Force (IETF). Note that other groups may also distribute 42 working documents as Internet-Drafts. The list of current Internet- 43 Drafts is at https://datatracker.ietf.org/drafts/current/. 45 Internet-Drafts are draft documents valid for a maximum of six months 46 and may be updated, replaced, or obsoleted by other documents at any 47 time. It is inappropriate to use Internet-Drafts as reference 48 material or to cite them other than as "work in progress." 49 This Internet-Draft will expire on February 20, 2021. 51 Copyright Notice 53 Copyright (c) 2020 IETF Trust and the persons identified as the 54 document authors. All rights reserved. 56 This document is subject to BCP 78 and the IETF Trust's Legal 57 Provisions Relating to IETF Documents 58 (https://trustee.ietf.org/license-info) in effect on the date of 59 publication of this document. Please review these documents 60 carefully, as they describe your rights and restrictions with respect 61 to this document. Code Components extracted from this document must 62 include Simplified BSD License text as described in Section 4.e of 63 the Trust Legal Provisions and are provided without warranty as 64 described in the Simplified BSD License. 66 Table of Contents 68 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 69 1.1. Requirements Language . . . . . . . . . . . . . . . . . . 5 70 1.2. Terminology . . . . . . . . . . . . . . . . . . . . . . . 5 71 2. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 6 72 2.1. Overview of Service Function Chaining . . . . . . . . . . 6 73 2.2. Control Plane Overview . . . . . . . . . . . . . . . . . 8 74 3. BGP SFC Routes . . . . . . . . . . . . . . . . . . . . . . . 12 75 3.1. Service Function Instance Route (SFIR) . . . . . . . . . 13 76 3.1.1. SFIR Pool Identifier Extended Community . . . . . . . 14 77 3.1.2. MPLS Mixed Swapping/Stacking Extended Community . . . 15 78 3.2. Service Function Path Route (SFPR) . . . . . . . . . . . 16 79 3.2.1. The SFP Attribute . . . . . . . . . . . . . . . . . . 17 80 3.2.2. General Rules For The SFP Attribute . . . . . . . . . 22 81 4. Mode of Operation . . . . . . . . . . . . . . . . . . . . . . 23 82 4.1. Route Targets . . . . . . . . . . . . . . . . . . . . . . 23 83 4.2. Service Function Instance Routes . . . . . . . . . . . . 24 84 4.3. Service Function Path Routes . . . . . . . . . . . . . . 24 85 4.4. Classifier Operation . . . . . . . . . . . . . . . . . . 26 86 4.5. Service Function Forwarder Operation . . . . . . . . . . 27 87 4.5.1. Processing With 'Gaps' in the SI Sequence . . . . . . 28 88 5. Selection within Service Function Paths . . . . . . . . . . . 29 89 6. Looping, Jumping, and Branching . . . . . . . . . . . . . . . 31 90 6.1. Protocol Control of Looping, Jumping, and Branching . . . 32 91 6.2. Implications for Forwarding State . . . . . . . . . . . . 33 92 7. Advanced Topics . . . . . . . . . . . . . . . . . . . . . . . 33 93 7.1. Correlating Service Function Path Instances . . . . . . . 33 94 7.2. Considerations for Stateful Service Functions . . . . . . 34 95 7.3. VPN Considerations and Private Service Functions . . . . 35 96 7.4. Flow Specification for SFC Classifiers . . . . . . . . . 35 97 7.5. Choice of Data Plane SPI/SI Representation . . . . . . . 37 98 7.5.1. MPLS Representation of the SPI/SI . . . . . . . . . . 38 99 7.6. MPLS Label Swapping/Stacking Operation . . . . . . . . . 38 100 7.7. Support for MPLS-Encapsulated NSH Packets . . . . . . . . 39 101 8. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 39 102 8.1. Example Explicit SFP With No Choices . . . . . . . . . . 41 103 8.2. Example SFP With Choice of SFIs . . . . . . . . . . . . . 42 104 8.3. Example SFP With Open Choice of SFIs . . . . . . . . . . 42 105 8.4. Example SFP With Choice of SFTs . . . . . . . . . . . . . 43 106 8.5. Example Correlated Bidirectional SFPs . . . . . . . . . . 43 107 8.6. Example Correlated Asymmetrical Bidirectional SFPs . . . 44 108 8.7. Example Looping in an SFP . . . . . . . . . . . . . . . . 44 109 8.8. Example Branching in an SFP . . . . . . . . . . . . . . . 45 110 8.9. Examples of SFPs with Stateful Service Functions . . . . 46 111 8.9.1. Forward and Reverse Choice Made at the SFF . . . . . 46 112 8.9.2. Parallel End-to-End SFPs with Shared SFF . . . . . . 48 113 8.9.3. Parallel End-to-End SFPs with Separate SFFs . . . . . 49 114 8.9.4. Parallel SFPs Downstream of the Choice . . . . . . . 51 115 8.10. Examples Using IPv6 Addressing . . . . . . . . . . . . . 54 116 8.10.1. Example Explicit SFP With No Choices . . . . . . . . 56 117 8.10.2. Example SFP With Choice of SFIs . . . . . . . . . . 57 118 8.10.3. Example SFP With Open Choice of SFIs . . . . . . . . 57 119 8.10.4. Example SFP With Choice of SFTs . . . . . . . . . . 58 120 9. Security Considerations . . . . . . . . . . . . . . . . . . . 59 121 10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 61 122 10.1. New BGP AF/SAFI . . . . . . . . . . . . . . . . . . . . 61 123 10.2. New BGP Path Attribute . . . . . . . . . . . . . . . . . 61 124 10.3. New SFP Attribute TLVs Type Registry . . . . . . . . . . 61 125 10.4. New SFP Association Type Registry . . . . . . . . . . . 62 126 10.5. New Service Function Type Registry . . . . . . . . . . . 63 127 10.6. New Generic Transitive Experimental Use Extended 128 Community Sub-Types . . . . . . . . . . . . . . . . . . 65 129 10.7. New BGP Transitive Extended Community Type . . . . . . . 65 130 10.8. New SFC Extended Community Sub-Types Registry . . . . . 65 131 10.9. SPI/SI Representation . . . . . . . . . . . . . . . . . 66 132 10.10. SFC SPI/SI Representation Flags Registry . . . . . . . . 66 133 11. Contributors . . . . . . . . . . . . . . . . . . . . . . . . 66 134 12. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 67 135 13. References . . . . . . . . . . . . . . . . . . . . . . . . . 67 136 13.1. Normative References . . . . . . . . . . . . . . . . . . 67 137 13.2. Informative References . . . . . . . . . . . . . . . . . 69 138 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 70 140 1. Introduction 142 As described in [RFC7498], the delivery of end-to-end services can 143 require a packet to pass through a series of Service Functions (SFs) 144 (e.g., WAN and application accelerators, Deep Packet Inspection (DPI) 145 engines, firewalls, TCP optimizers, and server load balancers) in a 146 specified order: this is termed "Service Function Chaining" (SFC). 147 There are a number of issues associated with deploying and 148 maintaining service function chaining in production networks, which 149 are described below. 151 Historically, if a packet needed to travel through a particular 152 service chain, the nodes hosting the service functions of that chain 153 were placed in the network topology in such a way that the packet 154 could not reach its ultimate destination without first passing 155 through all the service functions in the proper order. This need to 156 place the service functions at particular topological locations 157 limited the ability to adapt a service function chain to changes in 158 network topology (e.g., link or node failures), network utilization, 159 or offered service load. These topological restrictions on where the 160 service functions can be placed raised the following issues: 162 1. The process of configuring or modifying a service function chain 163 is operationally complex and may require changes to the network 164 topology. 166 2. Alternate or redundant service functions may need to be co- 167 located with the primary service functions. 169 3. When there is more than one path between source and destination, 170 forwarding may be asymmetric and it may be difficult to support 171 bidirectional service function chains using simple routing 172 methodologies and protocols without adding mechanisms for traffic 173 steering or traffic engineering. 175 In order to address these issues, the SFC architecture describes 176 Service Function Chains that are built in their own overlay network 177 (the service function overlay network), coexisting with other overlay 178 networks, over a common underlay network [RFC7665]. A Service 179 Function Chain is a sequence of Service Functions through which 180 packet flows that satisfy specified criteria will pass. 182 This document describes the use of BGP as a control plane for 183 networks that support Service Function Chaining (SFC). The document 184 introduces a new BGP address family called the SFC Address Family 185 Identifier / Subsequent Address Family Identifier (AFI/SAFI) with two 186 route types. One route type is originated by a node to advertise 187 that it hosts a particular instance of a specified service function. 188 This route type also provides "instructions" on how to send a packet 189 to the hosting node in a way that indicates that the service function 190 has to be applied to the packet. The other route type is used by a 191 Controller (a centralized network component responsible for planning 192 and coordinating Service Function Chaining within the network) to 193 advertise the paths of "chains" of service functions, and to give a 194 unique designator to each such path so that they can be used in 195 conjunction with the Network Service Header [RFC8300]. 197 This document adopts the SFC architecture described in [RFC7665]. 199 1.1. Requirements Language 201 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 202 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 203 "OPTIONAL" in this document are to be interpreted as described in BCP 204 14 [RFC2119] [RFC8174] when, and only when, they appear in all 205 capitals, as shown here. 207 1.2. Terminology 209 This document uses the following terms from [RFC7665]: 211 o Bidirectional Service Function Chain 213 o Classifier 215 o Service Function (SF) 217 o Service Function Chain (SFC) 219 o Service Function Forwarder (SFF) 221 o Service Function Instance (SFI) 223 o Service Function Path (SFP) 225 o SFC branching 227 Additionally, this document uses the following terms from [RFC8300]: 229 o Network Service Header (NSH) 231 o Service Index (SI) 233 o Service Path Identifier (SPI) 235 This document introduces the following terms: 237 o Service Function Instance Route (SFIR). A new BGP Route Type 238 advertised by the node that hosts an SFI to describe the SFI and 239 to announce the way to forward a packet to the node through the 240 underlay network. 242 o Service Function Overlay Network. The logical network comprised 243 of Classifiers, SFFs, and SFIs that are connected by paths or 244 tunnels through underlay transport networks. 246 o Service Function Path Route (SFPR). A new BGP Route Type 247 originated by Controllers to advertise the details of each SFP. 249 o Service Function Type (SFT). An indication of the function and 250 features of an SFI. 252 2. Overview 254 This section provides an overview of Service Function Chaining in 255 general, and the control plane defined in this document. After 256 reading this section, readers may find it helpful to look through 257 Section 8 for some simple worked examples. 259 2.1. Overview of Service Function Chaining 261 In [RFC8300] a Service Function Chain (SFC) is an ordered list of 262 Service Functions (SFs). A Service Function Path (SFP) is an 263 indication of which instances of SFs are acceptable to be traversed 264 in an instantiation of an SFC in a service function overlay network. 265 The Service Path Identifier (SPI) is a 24-bit number that identifies 266 a specific SFP, and a Service Index (SI) is an 8-bit number that 267 identifies a specific point in that path. In the context of a 268 particular SFP (identified by an SPI), an SI represents a particular 269 Service Function, and indicates the order of that SF in the SFP. 271 Within the context of a specific SFP, an SI references a set of one 272 or more SFs. Each of those SFs may be supported by one or more 273 Service Function Instances (SFIs). Thus an SI may represent a choice 274 of SFIs of one or more Service Function Types. By deploying multiple 275 SFIs for a single SF, one can provide load balancing and redundancy. 277 A special functional element, called a Classifier, is located at each 278 ingress point to a service function overlay network. It assigns the 279 packets of a given packet flow to a specific Service Function Path. 280 This may be done by comparing specific fields in a packet's header 281 with local policy, which may be customer/network/service specific. 282 The Classifier picks an SFP and sets the SPI accordingly, it then 283 sets the SI to the value of the SI for the first hop in the SFP, and 284 then prepends a Network Services Header (NSH) [RFC8300] containing 285 the assigned SPI/SI to that packet. Note that the Classifier and the 286 node that hosts the first Service Function in a Service Function Path 287 need not be located at the same point in the service function overlay 288 network. 290 Note that the presence of the NSH can make it difficult for nodes in 291 the underlay network to locate the fields in the original packet that 292 would normally be used to constrain equal cost multipath (ECMP) 293 forwarding. Therefore, it is recommended that the node prepending 294 the NSH also provide some form of entropy indicator that can be used 295 in the underlay network. How this indicator is generated and 296 supplied, and how an SFF generates a new entropy indicator when it 297 forwards a packet to the next SFF, are out of scope of this document. 299 The Service Function Forwarder (SFF) receives a packet from the 300 previous node in a Service Function Path, removes the packet's link 301 layer or tunnel encapsulation and hands the packet and the NSH to the 302 Service Function Instance for processing. The SFI has no knowledge 303 of the SFP. 305 When the SFF receives the packet and the NSH back from the SFI it 306 must select the next SFI along the path using the SPI and SI in the 307 NSH and potentially choosing between multiple SFIs (possibly of 308 different Service Function Types) as described in Section 5. In the 309 normal case the SPI remains unchanged and the SI will have been 310 decremented to indicate the next SF along the path. But other 311 possibilities exist if the SF makes other changes to the NSH through 312 a process of re-classification: 314 o The SI in the NSH may indicate: 316 * A previous SF in the path: known as "looping" (see Section 6). 318 * An SF further down the path: known as "jumping" (see also 319 Section 6). 321 o The SPI and the SI may point to an SF on a different SFP: known as 322 "branching" (see also Section 6). 324 Such modifications are limited to within the same service function 325 overlay network. That is, an SPI is known within the scope of 326 service function overlay network. Furthermore, the new SI value is 327 interpreted in the context of the SFP identified by the SPI. 329 As described in [RFC8300], an unknown or invalid SPI is treated as an 330 error and the SFF drops the packet: such errors should be logged, and 331 such logs are subject to rate limits. 333 Also, as described in [RFC8300], an SFF receiving an SI that is 334 unknown in the context of the SPI can reduce the value to the next 335 meaningful SI value in the SFP indicated by the SPI. If no such 336 value exists or if the SFF does not support reducing the SI, the SFF 337 drops the packet and should log the event: such logs are also subject 338 to rate limits. 340 The SFF then selects an SFI that provides the SF denoted by the SPI/ 341 SI, and forwards the packet to the SFF that supports that SFI. 343 [RFC8300] makes it clear that the intended scope is for use within a 344 single provider's operational domain. 346 This document adopts the SFC architecture described in [RFC7665] and 347 adds a control plane to support the functions as described in 348 Section 2.2. An essential component of this solution is the 349 Controller. This is a network component responsible for planning 350 SFPs within the network. It gathers information about the 351 availability of SFIs and SFFs, instructs the control plane about the 352 SFPs to be programmed, and instructs the Classifiers how to assign 353 traffic flows to individual SFPs. 355 2.2. Control Plane Overview 357 To accomplish the function described in Section 2.1, this document 358 introduces the Service Function Type (SFT) that is the category of SF 359 that is supported by an SFF (such as "firewall"). An IANA registry 360 of Service Function Types is introduced in Section 10.5 and is 361 consistent with types used in other work such as 362 [I-D.dawra-idr-bgp-ls-sr-service-segments]. An SFF may support SFs 363 of multiple different SFTs, and may support multiple SFIs of each SF. 365 The registry of SFT values (see Section 10.5) is split into three 366 ranges with assignment policies per [RFC8126]: 368 o The Special Purpose SFT values range is assigned through Standards 369 Action. Values in that range are used for special SFC operations 370 and do not apply to the types of SF that may form part of the SFP. 372 o The First Come First Served range tracks assignments of STF values 373 made by any party that defines an SF type. Reference through an 374 Internet-Draft is desirable, but not required. 376 o The Private Use range is not tracked by IANA and is primarily 377 intended for use in private networks where the meaning of the SFT 378 values is locally tracked and under the control of a local 379 administrator. 381 It is envisaged that the majority of SFT values used will be assigned 382 from the First Come First Served space in the registry. This will 383 ensure interoperability especially in situations where software and 384 hardware from different vendors is deployed in the same networks, or 385 when networks are merged. However, operators of private networks may 386 choose to develop their own SFs and manage the configuration and 387 operation of their network through their own list of SFT values. 389 This document also introduces a new BGP AFI/SAFI (values to be 390 assigned by IANA) for "SFC Routes". Two SFC Route Types are defined 391 by this document: the Service Function Instance Route (SFIR), and the 392 Service Function Path Route (SFPR). As detailed in Section 3, the 393 route type is indicated by a sub-field in the Network Layer 394 Reachability Information (NLRI). 396 o The SFIR is advertised by the node that provides access to the 397 service function instance (i.e., the SFF). The SFIR describes a 398 particular instance of a particular Service Function (i.e., an 399 SFI) and the way to forward a packet to it through the underlay 400 network, i.e., IP address and encapsulation information. 402 o The SFPRs are originated by Controllers. One SFPR is originated 403 for each Service Function Path. The SFPR specifies: 405 A. the SPI of the path 407 B. the sequence of SFTs and/or SFIs of which the path consists 409 C. for each such SFT or SFI, the SI that represents it in the 410 identified path. 412 This approach assumes that there is an underlay network that provides 413 connectivity between SFFs and Controllers, and that the SFFs are 414 grouped to form one or more service function overlay networks through 415 which SFPs are built. We assume that the Controllers have BGP 416 connectivity to all SFFs and all Classifiers within each service 417 function overlay network. 419 When choosing the next SFI in a path, the SFF uses the SPI and SI as 420 well as the SFT to choose among the SFIs, applying, for example, a 421 load balancing algorithm or direct knowledge of the underlay network 422 topology as described in Section 4. 424 The SFF then encapsulates the packet using the encapsulation 425 specified by the SFIR of the selected SFI and forwards the packet. 426 See Figure 1. 428 Thus the SFF can be seen as a portal in the underlay network through 429 which a particular SFI is reached. 431 Figure 1 shows a reference model for the SFC architecture. There are 432 four SFFs (SFF-1 through SFF-4) connected by tunnels across the 433 underlay network. Packets arrive at a Classifier and are channeled 434 along SFPs to destinations reachable through SFF-4. 436 SFF-1 and SFF-4 each have one instance of one SF attached (SFa and 437 SFe). SFF-2 has two types of SF attached: there is one instance of 438 one (SFc), and three instances of the other (SFb). SFF-3 has just 439 one instance of an SF (SFd), but it in this case the type of SFd is 440 the same type as SFb (SFTx). 442 This figure demonstrates how load balancing can be achieved by 443 creating several SFPs that satisfy the same SFC. Suppose an SFC 444 needs to include SFa, an SF of type SFTx, and SFc. A number of SFPs 445 can be constructed using any instance of SFb or using SFd. Load 446 balancing may be applied at two places: 448 o The Classifier may distribute different flows onto different SFPs 449 to share the load in the network and across SFIs. 451 o SFF-2 may distribute different flows (on the same SFP) to 452 different instances of SFb to share the processing load. 454 Note that, for convenience and clarity, Figure 1 shows only a few 455 tunnels between SFFs. There could be a full mesh of such tunnels, or 456 more likely, a selection of tunnels connecting key SFFs to enable the 457 construction of SFPs and to balance load and traffic in the network. 458 Further, the figure does not show any controllers: these would each 459 have BGP connectivity to the Classifier and all of the SFFs. 461 Packets 462 | | | 463 ------------ 464 | | 465 | Classifier | 466 | | 467 ------+----- 468 | 469 ---+--- --------- ------- 470 | | Tunnel | | | | 471 | SFF-1 |===============| SFF-2 |=========| SFF-4 | 472 | | | | | | 473 | | -+-----+- | | 474 | | ,,,,,,,,,,,,,,/,, \ | | 475 | | ' .........../. ' ..\...... | | 476 | | ' : SFb / : ' : \ SFc : | | 477 | | ' : ---+- : ' : --+-- : | | 478 | | ' : -| SFI | : ' : | SFI | : | | 479 | | ' : -| ----- : ' : ----- : | | 480 | | ' : | ----- : ' ......... | | 481 | | ' : ----- : ' | | 482 | | ' ............. ' | |--- Dests 483 | | ' ' | |--- Dests 484 | | ' ......... ' | | 485 | | ' : ----- : ' | | 486 | | ' : | SFI | : ' | | 487 | | ' : --+-- : ' | | 488 | | ' :SFd | : ' | | 489 | | ' ....|.... ' | | 490 | | ' | ' | | 491 | | ' SFTx | ' | | 492 | | ',,,,,,,,|,,,,,,,,' | | 493 | | | | | 494 | | ---+--- | | 495 | | | | | | 496 | |======| SFF-3 |====================| | 497 ---+--- | | ---+--- 498 | ------- | 499 ....|.... ....|.... 500 : | SFa: : | SFe: 501 : --+-- : : --+-- : 502 : | SFI | : : | SFI | : 503 : ----- : : ----- : 504 ......... ......... 506 Figure 1: The SFC Architecture Reference Model 508 As previously noted, [RFC8300] makes it clear that the mechanisms it 509 defines are intended for use within a single provider's operational 510 domain. This reduces the requirements on the control plane function. 512 [RFC7665] sets out the functions provided by a control plane for an 513 SFC network in Section 5.2. The functions are broken down into six 514 items the first four of which are completely covered by the 515 mechanisms described in this document: 517 1. Visibility of all SFs and the SFFs through which they are 518 reached. 520 2. Computation of SFPs and programming into the network. 522 3. Selection of SFIs explicitly in the SFP or dynamically within the 523 network. 525 4. Programming of SFFs with forwarding path information. 527 The fifth and six items in the list in RFC 7665 concern the use of 528 metadata. These are more peripheral to the control plane mechanisms 529 defined in this document, but are discussed in Section 4.4. 531 3. BGP SFC Routes 533 This document defines a new AFI/SAFI for BGP, known as "SFC", with an 534 NLRI that is described in this section. 536 The format of the SFC NLRI is shown in Figure 2. 538 +---------------------------------------+ 539 | Route Type (2 octets) | 540 +---------------------------------------+ 541 | Length (2 octets) | 542 +---------------------------------------+ 543 | Route Type specific (variable) | 544 +---------------------------------------+ 546 Figure 2: The Format of the SFC NLRI 548 The Route Type field determines the encoding of the rest of the route 549 type specific SFC NLRI. 551 The Length field indicates the length in octets of the route type 552 specific field of the SFC NLRI. 554 This document defines the following Route Types: 556 1. Service Function Instance Route (SFIR) 558 2. Service Function Path Route (SFPR) 560 A Service Function Instance Route (SFIR) is used to identify an SFI. 561 A Service Function Path Route (SFPR) defines a sequence of Service 562 Functions (each of which has at least one instance advertised in an 563 SFIR) that form an SFP. 565 The detailed encoding and procedures for these Route Types are 566 described in subsequent sections. 568 The SFC NLRI is carried in BGP [RFC4271] using BGP Multiprotocol 569 Extensions [RFC4760] with an Address Family Identifier (AFI) of TBD1 570 and a Subsequent Address Family Identifier (SAFI) of TBD2. The NLRI 571 field in the MP_REACH_NLRI/MP_UNREACH_NLRI attribute contains the SFC 572 NLRI, encoded as specified above. 574 In order for two BGP speakers to exchange SFC NLRIs, they MUST use 575 BGP Capabilities Advertisements to ensure that they both are capable 576 of properly processing such NLRIs. This is done as specified in 577 [RFC4760], by using capability code 1 (Multiprotocol BGP) with an AFI 578 of TBD1 and a SAFI of TBD2. 580 The nexthop field of the MP_REACH_NLRI attribute of the SFC NLRI MUST 581 be set to a loopback address of the advertising SFF. 583 3.1. Service Function Instance Route (SFIR) 585 Figure 3 shows the Route Type specific NLRI of the SFIR. 587 +--------------------------------------------+ 588 | Route Distinguisher (RD) (8 octets) | 589 +--------------------------------------------+ 590 | Service Function Type (2 octets) | 591 +--------------------------------------------+ 593 Figure 3: SFIR Route Type specific NLRI 595 Per [RFC4364] the RD field comprises a two byte Type field and a six 596 byte Value field. If two SFIRs are originated from different 597 administrative domains (within the same provier's operational 598 domain), they MUST have different RDs. In particular, SFIRs from 599 different VPNs (for different service function overlay networks) MUST 600 have different RDs, and those RDs MUST be different from any non-VPN 601 SFIRs. 603 The Service Function Type identifies the functions/features a service 604 function can offer, e.g., Classifier, firewall, load balancer. There 605 may be several SFIs that can perform a given Service Function. Each 606 node hosting an SFI MUST originate an SFIR for each type of SF that 607 it hosts (as indicated by the SFT value), and it MAY advertise an 608 SFIR for each instance of each type of SF. The minimal advertisement 609 allows construction of valid SFPs and leaves the selection of SFIs to 610 the local SFF; the detailed advertisement may have scaling concerns, 611 but allows a Controller that constructs an SFP to make an explicit 612 choice of SFI. 614 Note that a node may advertise all its SFIs of one SFT in one shot 615 using normal BGP Update packing. That is, all of the SFIRs in an 616 Update share a common Tunnel Encapsulation and Route Target (RT) 617 attribute. See also Section 3.2.1. 619 The SFIR representing a given SFI will contain an NLRI with RD field 620 set to an RD as specified above, and with SFT field set to identify 621 that SFI's Service Function Type. The values for the SFT field are 622 taken from a registry administered by IANA (see Section 10). A BGP 623 Update containing one or more SFIRs MUST also include a Tunnel 624 Encapsulation attribute [I-D.ietf-idr-tunnel-encaps]. If a data 625 packet needs to be sent to an SFI identified in one of the SFIRs, it 626 will be encapsulated as specified by the Tunnel Encapsulation 627 attribute, and then transmitted through the underlay network. 629 Note that the Tunnel Encapsulation attribute MUST contain sufficient 630 information to allow the advertising SFF to identify the overlay or 631 VPN network which a received packet is transiting. This is because 632 the [SPI, SI] in a received packet is specific to a particular 633 overlay or VPN network. 635 3.1.1. SFIR Pool Identifier Extended Community 637 This document defines a new transitive extended community [RFC4360] 638 of type TBD6 called the SFC extended community. When used with Sub- 639 Type 1, this is called the SFIR Pool Identifier extended community. 640 It MAY be included in SFIR advertisements, and is used to indicate 641 the identity of a pool of SFIRs to which an SFIR belongs. Since an 642 SFIR may be a member of multiple pools, multiple of these extended 643 communities may be present on a single SFIR advertisement. 645 SFIR pools allow SFIRs to be grouped for any purpose. Possible uses 646 include control plane scalability and stability. A pool identifier 647 may be included in an SFPR to indicate a set of SFIs that are 648 acceptable at a specific point on an SFP (see Section 3.2.1.3 and 649 Section 4.3). 651 The SFIR Pool Identifier extended community is encoded in 8 octets as 652 shown in Figure 4. 654 +--------------------------------------------+ 655 | Type = TBD6 (1 octet) | 656 +--------------------------------------------+ 657 | Sub-Type = 1 (1 octet) | 658 +--------------------------------------------+ 659 | SFIR Pool Identifier Value (6 octets) | 660 +--------------------------------------------+ 662 Figure 4: The SFIR Pool Identifier Extended Community 664 The SFIR Pool Identifier Value is encoded in a 6 octet field in 665 network byte order, and the value is unique within the scope of an 666 overlay network. This means that pool identifiers need to be 667 centrally managed, which is consistent with the assignment of SFIs to 668 pools. 670 3.1.2. MPLS Mixed Swapping/Stacking Extended Community 672 As noted in Section 3.1.1, this document defines a new transitive 673 extended community of type TBD6 called the SFC extended community. 674 When used with Sub-Type 2, this is called the MPLS Mixed Swapping/ 675 Stacking Labels extended community. The community is encoded as 676 shown in Figure 5. It contains a pair of MPLS labels: an SFC Context 677 Label and an SF Label as described in [RFC8595]. Each label is 20 678 bits encoded in a 3-octet (24 bit) field with 4 trailing bits that 679 MUST be set to zero. 681 +--------------------------------------------+ 682 | Type = TBD6 (1 octet) | 683 +--------------------------------------------| 684 | Sub-Type = 2 (1 octet) | 685 +--------------------------------------------| 686 | SFC Context Label (3 octets) | 687 +--------------------------------------------| 688 | SF Label (3 octets) | 689 +--------------------------------------------+ 691 Figure 5: The MPLS Mixed Swapping/Stacking Extended Community 693 Note that it is assumed that each SFF has one or more globally unique 694 SFC Context Labels and that the context label space and the SPI 695 address space are disjoint (i.e., a label value cannot be used both 696 to indicate an SFC context and an SPI, and it can be determined from 697 knowledge of the label spaces whether a label indicates an SFC 698 context or an SPI). 700 If an SFF supports SFP Traversal with an MPLS Label Stack it MUST 701 include this extended community with the SFIRs that it advertises. 703 See Section 7.6 for a description of how this extended community is 704 used. 706 3.2. Service Function Path Route (SFPR) 708 Figure 6 shows the Route Type specific NLRI of the SFPR. 710 +-----------------------------------------------+ 711 | Route Distinguisher (RD) (8 octets) | 712 +-----------------------------------------------+ 713 | Service Path Identifier (SPI) (3 octets) | 714 +-----------------------------------------------+ 716 Figure 6: SFPR Route Type Specific NLRI 718 Per [RFC4364] the RD field comprises a two byte Type field and a six 719 byte Value field. All SFPs MUST be associated with an RD. The 720 association of an SFP with an RD is determined by provisioning. If 721 two SFPRs are originated from different Controllers they MUST have 722 different RDs. Additionally, SFPRs from different VPNs (i.e., in 723 different service function overlay networks) MUST have different RDs, 724 and those RDs MUST be different from any non-VPN SFPRs. 726 The Service Path Identifier is defined in [RFC8300] and is the value 727 to be placed in the Service Path Identifier field of the NSH header 728 of any packet sent on this Service Function Path. It is expected 729 that one or more Controllers will originate these routes in order to 730 configure a service function overlay network. 732 The SFP is described in a new BGP Path attribute, the SFP attribute. 733 Section 3.2.1 shows the format of that attribute. 735 3.2.1. The SFP Attribute 737 [RFC4271] defines BGP Path attributes. This document introduces a 738 new Optional Transitive Path attribute called the SFP attribute with 739 value TBD3 to be assigned by IANA. The first SFP attribute MUST be 740 processed and subsequent instances MUST be ignored. 742 The common fields of the SFP attribute are set as follows: 744 o Optional bit is set to 1 to indicate that this is an optional 745 attribute. 747 o The Transitive bit is set to 1 to indicate that this is a 748 transitive attribute. 750 o The Extended Length bit is set if the length of the SFP attribute 751 is encoded in one octet (set to 0) or two octets (set to 1) as 752 described in [RFC4271]. 754 o The Attribute Type Code is set to TBD3. 756 The content of the SFP attribute is a series of Type-Length-Value 757 (TLV) constructs. Some TLVs may include sub-TLVs. All TLVs and sub- 758 TLVs have a common format that is: 760 o Type: A single octet indicating the type of the SFP attribute TLV. 761 Values are taken from the registry described in Section 10.3. 763 o Length: A two octet field indicating the length of the data 764 following the Length field counted in octets. 766 o Value: The contents of the TLV. 768 The formats of the TLVs defined in this document are shown in the 769 following sections. The presence rules and meanings are as follows. 771 o The SFP attribute contains a sequence of zero or more Association 772 TLVs. That is, the Association TLV is OPTIONAL. Each Association 773 TLV provides an association between this SFPR and another SFPR. 774 Each associated SFPR is indicated using the RD with which it is 775 advertised (we say the SFPR-RD to avoid ambiguity). 777 o The SFP attribute contains a sequence of one or more Hop TLVs. 778 Each Hop TLV contains all of the information about a single hop in 779 the SFP. 781 o Each Hop TLV contains an SI value and a sequence of one or more 782 SFT TLVs. Each SFT TLV contains an SFI reference for each 783 instance of an SF that is allowed at this hop of the SFP for the 784 specific SFT. Each SFI is indicated using the RD with which it is 785 advertised (we say the SFIR-RD to avoid ambiguity). 787 Section 6 of [RFC4271] describes the handling of malformed BGP 788 attributes, or those that are in error in some way. [RFC7606] 789 revises BGP error handling specifically for the UPDATE message, 790 provides guidelines for the authors of documents defining new 791 attributes, and revises the error handling procedures for a number of 792 existing attributes. This document introduces the SFP attribute and 793 so defines error handling as follows: 795 o When parsing a message, an unknown Attribute Type code or a length 796 that suggests that the attribute is longer than the remaining 797 message is treated as a malformed message and the "treat-as- 798 withdraw" approach used as per [RFC7606]. 800 o When parsing a message that contains an SFP attribute, the 801 following cases constitute errors: 803 1. Optional bit is set to 0 in SFP attribute. 805 2. Transitive bit is set to 0 in SFP attribute. 807 3. Unknown TLV type field found in SFP attribute. 809 4. TLV length that suggests the TLV extends beyond the end of the 810 SFP attribute. 812 5. Association TLV contains an unknown SFPR-RD. 814 6. No Hop TLV found in the SFP attribute. 816 7. No sub-TLV found in a Hop TLV. 818 8. Unknown SFIR-RD found in an SFT TLV. 820 o The errors listed above are treated as follows: 822 1., 2., 4., 6., 7.: The attribute MUST be treated as malformed 823 and the "treat-as-withdraw" approach used as per [RFC7606]. 825 3.: Unknown TLVs MUST be ignored, and message processing MUST 826 continue. 828 5., 8.: The absence of an RD with which to correlate is nothing 829 more than a soft error. The receiver SHOULD store the 830 information from the SFP attribute until a corresponding 831 advertisement is received. 833 3.2.1.1. The Association TLV 835 The Association TLV is an optional TLV in the SFP attribute. It MAY 836 be present multiple times. Each occurrence provides an association 837 with another SFP as advertised in another SFPR. The format of the 838 Association TLV is shown in Figure 7 840 +--------------------------------------------+ 841 | Type = 1 (1 octet) | 842 +--------------------------------------------| 843 | Length (2 octets) | 844 +--------------------------------------------| 845 | Association Type (1 octet) | 846 +--------------------------------------------| 847 | Associated SFPR-RD (8 octets) | 848 +--------------------------------------------| 849 | Associated SPI (3 octets) | 850 +--------------------------------------------+ 852 Figure 7: The Format of the Association TLV 854 The fields are as follows: 856 Type is set to 1 to indicate an Association TLV. 858 Length indicates the length in octets of the Association Type and 859 Associated SFPR-RD fields. The value of the Length field is 12. 861 The Association Type field indicate the type of association. The 862 values are tracked in an IANA registry (see Section 10.4). Only 863 one value is defined in this document: type 1 indicates 864 association of two unidirectional SFPs to form a bidirectional 865 SFP. An SFP attribute SHOULD NOT contain more than one 866 Association TLV with Association Type 1: if more than one is 867 present, the first one MUST be processed and subsequent instances 868 MUST be ignored. Note that documents that define new Association 869 Types must also define the presence rules for Association TLVs of 870 the new type. 872 The Associated SFPR-RD contains the RD of the associated SFP as 873 advertised in an SFPR. 875 The Associated SPI contains the SPI of the associated SFP as 876 advertised in an SFPR. 878 Association TLVs with unknown Association Type values SHOULD be 879 ignored. Association TLVs that contain an Associated SFPR-RD value 880 equal to the RD of the SFPR in which they are contained SHOULD be 881 ignored. If the Associated SPI is not equal to the SPI advertised in 882 the SFPR indicated by the Associated SFPR-RD then the Association TLV 883 SHOULD be ignored. In all three of these cases an implementation MAY 884 reject the SFP attribute as malformed and use the "treat-as-withdraw" 885 approach per [RFC7606], however implementers are cautioned that such 886 an approach may make an implementation less flexible in the event of 887 future extensions to this protocol. 889 Note that when two SFPRs reference each other using the Association 890 TLV, one SFPR advertisement will be received before the other. 891 Therefore, processing of an association MUST NOT be rejected simply 892 because the Associated SFPR-RD is unknown. 894 Further discussion of correlation of SFPRs is provided in 895 Section 7.1. 897 3.2.1.2. The Hop TLV 899 There is one Hop TLV in the SFP attribute for each hop in the SFP. 900 The format of the Hop TLV is shown in Figure 8. At least one Hop TLV 901 MUST be present in an SFP attribute. 903 +--------------------------------------------+ 904 | Type = 2 (1 octet) | 905 +--------------------------------------------| 906 | Length (2 octets) | 907 +--------------------------------------------| 908 | Service Index (1 octet) | 909 +--------------------------------------------| 910 | Hop Details (variable) | 911 +--------------------------------------------+ 913 Figure 8: The Format of the Hop TLV 915 The fields are as follows: 917 Type is set to 2 to indicate a Hop TLV. 919 Length indicates the length in octets of the Service Index and Hop 920 Details fields. 922 The Service Index is defined in [RFC8300] and is the value found 923 in the Service Index field of the NSH header that an SFF will use 924 to lookup to which next SFI a packet is to be sent. 926 The Hop Details field consists of a sequence of one or more sub- 927 TLVs. 929 Each hop of the SFP may demand that a specific type of SF is 930 executed, and that type is indicated in sub-TLVs of the Hop TLV. At 931 least one sub-TLV MUST be present. This document defines the SFT 932 Sub-TLV (see Section 3.2.1.3 and the MPLS Swapping/Stacking Sub-TLV 933 (see Section Section 3.2.1.4: other sub-TLVs may be defined in 934 future. This provides a list of which types of SF are acceptable at 935 a specific hop, and for each type it allows a degree of control to be 936 imposed on the choice of SFIs of that particular type. 938 If no Hop TLV is present in an SFP Attribute, it is a malformed 939 attribute 941 3.2.1.3. The SFT Sub-TLV 943 The SFT Sub-TLV MAY be included in the list of sub-TLVs of the Hop 944 TLV. The format of the SFT Sub-TLV is shown in Figure 9. The Sub- 945 TLV contains a list of SFIR-RD values each taken from the 946 advertisement of an SFI. Together they form a list of acceptable 947 SFIs of the indicated type. 949 +--------------------------------------------+ 950 | Type = 3 (1 octet) | 951 +--------------------------------------------| 952 | Length (2 octets) | 953 +--------------------------------------------| 954 | Service Function Type (2 octets) | 955 +--------------------------------------------| 956 | SFIR-RD List (variable) | 957 +--------------------------------------------+ 959 Figure 9: The Format of the SFT Sub-TLV 961 The fields are as follows: 963 Type is set to 3 to indicate an SFT Sub-TLV. 965 Length indicates the length in octets of the Service Function Type 966 and SFIR-RD List fields. 968 The Service Function Type value indicates the category (type) of 969 SF that is to be executed at this hop. The types are as 970 advertised for the SFs supported by the SFFs. SFT values in the 971 range 1-31 are Special Purpose SFT values and have meanings 972 defined by the documents that describe them - the value 'Change 973 Sequence' is defined in Section 6.1 of this document. 975 The hop description is further qualified beyond the specification 976 of the SFTs by listing, for each SFT in each hop, the SFIs that 977 may be used at the hop. The SFIs are identified using the SFIR- 978 RDs from the advertisements of the SFIs in the SFIRs. Note that 979 if the list contains one or more SFIR Pool Identifiers, then for 980 each the SFIR-RD list is effectively expanded to include the SFIR- 981 RD of each SFIR advertised with that SFIR Pool Identifier. An 982 SFIR-RD of value zero has special meaning as described in 983 Section 5. Each entry in the list is eight octets long, and the 984 number of entries in the list can be deduced from the value of the 985 Length field. 987 Note that an SFIR-RD can be distinguished from an SFIR Pool 988 Identifier because they are both BGP Extended Communities but they 989 have different extended community types. 991 3.2.1.4. MPLS Swapping/Stacking Sub-TLV 993 The MPLS Swapping/Stacking Sub-TLV (Type value 4) is a zero length 994 sub-TLV that is OPTIONAL in the Hop TLV and is used when the data 995 representation is MPLS (see Section 7.5). When present it indicates 996 to the Classifier imposing an MPLS label stack that the current hop 997 is to use an {SFC Context Label, SF label} rather than an {SPI, SF} 998 label pair. See Section 7.6 for more details. 1000 3.2.1.5. SFP Traversal With MPLS Label Stack TLV 1002 The SFP Traversal With MPLS Label Stack TLV (Type value 5) is a zero 1003 length TLV that can be carried in the SFP Attribute and indicates to 1004 the Classifier and the SFFs on the SFP that an MPLS label stack with 1005 label swapping/stacking is to be used for packets traversing the SFP. 1006 All of the SFFs specified at each of the SFP's hops MUST have 1007 advertised an MPLS Mixed Swapping/Stacking Extended Community (see 1008 Section 3.1.2) for the SFP to be considered usable. 1010 3.2.2. General Rules For The SFP Attribute 1012 It is possible for the same SFI, as described by an SFIR, to be used 1013 in multiple SFPRs. 1015 When two SFPRs have the same SPI but different SFPR-RDs there can be 1016 three cases: 1018 o Two or more Controllers are originating SFPRs for the same SFP. 1019 In this case the content of the SFPRs is identical and the 1020 duplication is to ensure receipt and to provide Controller 1021 redundancy. 1023 o There is a transition in content of the advertised SFP and the 1024 advertisements may originate from one or more Controllers. In 1025 this case the content of the SFPRs will be different. 1027 o The reuse of an SPI may result from a configuration error. 1029 In all cases, there is no way for the receiving SFF to know which 1030 SFPR to process, and the SFPRs could be received in any order. At 1031 any point in time, when multiple SFPRs have the same SPI but 1032 different SFPR-RDs, the SFF MUST use the SFPR with the numerically 1033 lowest SFPR-RD when interpreting the RDs as 8-octet integers in 1034 network byte order. The SFF SHOULD log this occurrence to assist 1035 with debugging. 1037 Furthermore, a Controller that wants to change the content of an SFP 1038 is RECOMMENDED to use a new SPI and so create a new SFP onto which 1039 the Classifiers can transition packet flows before the SFPR for the 1040 old SFP is withdrawn. This avoids any race conditions with SFPR 1041 advertisements. 1043 Additionally, a Controller SHOULD NOT re-use an SPI after it has 1044 withdrawn the SFPR that used it until at least a configurable amount 1045 of time has passed. This timer SHOULD have a default of one hour. 1047 4. Mode of Operation 1049 This document describes the use of BGP as a control plane to create 1050 and manage a service function overlay network. 1052 4.1. Route Targets 1054 The main feature introduced by this document is the ability to create 1055 multiple service function overlay networks through the use of Route 1056 Targets (RTs) [RFC4364]. 1058 Every BGP UPDATE containing an SFIR or SFPR carries one or more RTs. 1059 The RT carried by a particular SFIR or SFPR is determined by the 1060 provisioning of the route's originator. 1062 Every node in a service function overlay network is configured with 1063 one or more import RTs. Thus, each SFF will import only the SFPRs 1064 with matching RTs allowing the construction of multiple service 1065 function overlay networks or the instantiation of Service Function 1066 Chains within an Layer 3 Virtual Private Network (L3VPN) or Ethernet 1067 VPN (EVPN) instance (see Section 7.3). An SFF that has a presence in 1068 multiple service function overlay networks (i.e., imports more than 1069 one RT) will usually maintain separate forwarding state for each 1070 overlay network. 1072 4.2. Service Function Instance Routes 1074 The SFIR (see Section 3.1) is used to advertise the existence and 1075 location of a specific Service Function Instance and consists of: 1077 o The RT as just described. 1079 o A Service Function Type (SFT) that is the type of service function 1080 that is provided (such as "firewall"). 1082 o A Route Distinguisher (RD) that is unique to a specific overlay. 1084 4.3. Service Function Path Routes 1086 The SFPR (see Section 3.2) describes a specific path of a Service 1087 Function Chain. The SFPR contains the Service Path Identifier (SPI) 1088 used to identify the SFP in the NSH in the data plane. It also 1089 contains a sequence of Service Indexes (SIs). Each SI identifies a 1090 hop in the SFP, and each hop is a choice between one of more SFIs. 1092 As described in this document, each Service Function Path Route is 1093 identified in the service function overlay network by an RD and an 1094 SPI. The SPI is unique within a single VPN instance supported by the 1095 underlay network. 1097 The SFPR advertisement comprises: 1099 o An RT as described in Section 4.1. 1101 o A tuple that identifies the SFPR 1103 * An RD that identifies an advertisement of an SFPR. 1105 * The SPI that uniquely identifies this path within the VPN 1106 instance distinguished by the RD. This SPI also appears in the 1107 NSH. 1109 o A series of Service Indexes. Each SI is used in the context of a 1110 particular SPI and identifies one or more SFs (distinguished by 1111 their SFTs) and for each SF a set of SFIs that instantiate the SF. 1112 The values of the SI indicate the order in which the SFs are to be 1113 executed in the SFP that is represented by the SPI. 1115 o The SI is used in the NSH to identify the entries in the SFP. 1116 Note that the SI values have meaning only relative to a specific 1117 path. They have no semantic other than to indicate the order of 1118 Service Functions within the path and are assumed to be 1119 monotonically decreasing from the start to the end of the path 1120 [RFC8300]. 1122 o Each Service Index is associated with a set of one or more Service 1123 Function Instances that can be used to provide the indexed Service 1124 Function within the path. Each member of the set comprises: 1126 * The RD used in an SFIR advertisement of the SFI. 1128 * The SFT that indicates the type of function as used in the same 1129 SFIR advertisement of the SFI. 1131 This may be summarized as follows where the notations "SFPR-RD" and 1132 "SFIR-RD" are used to distinguish the two different RDs, and where 1133 "*" indicates a multiplier: 1135 RT, {SFPR-RD, SPI}, m * {SI, {n * {SFT, p * SFIR-RD} } } 1137 Where: 1139 RT: Route Target 1141 SFPR-RD: The Route Descriptor of the Service Function Path Route 1142 advertisement 1144 SPI: Service Path Identifier used in the NSH 1146 m: The number of hops in the Service Function Path 1148 n: The number of choices of Service Function Type for a specific 1149 hop 1151 p: The number of choices of Service Function Instance for given 1152 Service Function Type in a specific hop 1154 SI: Service Index used in the NSH to indicate a specific hop 1155 SFT: The Service Function Type used in the same advertisement of 1156 the Service Function Instance Route 1158 SFIR-RD: The Route Descriptor used in an advertisement of the 1159 Service Function Instance Route 1161 That is, there can be multiple SFTs at a given hop as described in 1162 Section 5. 1164 Note that the values of SI are from the set {255, ..., 1} and are 1165 monotonically decreasing within the SFP. SIs MUST appear in order 1166 within the SFPR (i.e., monotonically decreasing) and MUST NOT appear 1167 more than once. Gaps MAY appear in the sequence as described in 1168 Section 4.5.1. Malformed SFPRs MUST be discarded and MUST cause any 1169 previous instance of the SFPR (same SFPR-RD and SPI) to be discarded. 1171 Note that if the SFIR-RD list in an SFT TLV contains one or more SFIR 1172 Pool identifiers, then in the above expression, 'p' is the sum of the 1173 number of individual SFIR-RD values and the sum for each SFIR Pool 1174 Identifier of the number of SFIRs advertised with that SFIR Pool 1175 Identifier. I.e., the list of SFIR-RD values is effectively expanded 1176 to include the SFIR-RD of each SFIR advertised with each SFIR Pool 1177 Identifier in the SFIR-RD list. 1179 The choice of SFI is explained further in Section 5. Note that an 1180 SFIR-RD value of zero has special meaning as described in that 1181 Section. 1183 4.4. Classifier Operation 1185 As shown in Figure 1, the Classifier is a component that is used to 1186 assign packets to an SFP. 1188 The Classifier is responsible for determining to which packet flow a 1189 packet belongs. The mechanism it uses to achieve that classification 1190 is out of scope of this document, but might include inspection of the 1191 packet header. The Classifier has been instructed (by the Controller 1192 or through some other configuration mechanism - see Section 7.4) 1193 which flows are to be assigned to which SFPs, and so it can impose an 1194 NSH on each packet and initialize the NSH with the SPI of the 1195 selected SFP and the SI of its first hop. 1197 Note that instructions delivered to the Classifier may include 1198 information about the metadata to encode (and the format for that 1199 encoding) on packets that are classified by the Classifier to a 1200 particular SFP. As mentioned in Section 2.2, this corresponds to the 1201 fifth element of control plane functionality described in [RFC7665]. 1202 Such instructions fall outside the scope of this specification 1203 (although, see Section 7.4), as do instructions to other SFC elements 1204 on how to interpret metadata (as described in the sixth element of 1205 control plane functionality described in [RFC7665]. 1207 4.5. Service Function Forwarder Operation 1209 Each packet sent to an SFF is transmitted encapsulated in an NSH. 1210 The NSH includes an SPI and SI: the SPI indicates the SFPR 1211 advertisement that announced the Service Function Path; the tuple 1212 SPI/SI indicates a specific hop in a specific path and maps to the 1213 RD/SFT of a particular SFIR advertisement. 1215 When an SFF gets an SFPR advertisement it will first determine 1216 whether to import the route by examining the RT. If the SFPR is 1217 imported the SFF then determines whether it is on the SFP by looking 1218 for its own SFIR-RDs or any SFIR-RD with value zero in the SFPR. For 1219 each occurrence in the SFP, the SFF creates forwarding state for 1220 incoming packets and forwarding state for outgoing packets that have 1221 been processed by the specified SFI. 1223 The SFF creates local forwarding state for packets that it receives 1224 from other SFFs. This state makes the association between the SPI/SI 1225 in the NSH of the received packet and one or more specific local SFIs 1226 as identified by the SFIR-RD/SFT. If there are multiple local SFIs 1227 that match this is because a single advertisement was made for a set 1228 of equivalent SFIs and the SFF may use local policy (such as load 1229 balancing) to determine to which SFI to forward a received packet. 1231 The SFF also creates next hop forwarding state for packets received 1232 back from the local SFI that need to be forwarded to the next hop in 1233 the SFP. There may be a choice of next hops as described in 1234 Section 4.3. The SFF could install forwarding state for all 1235 potential next hops, or it could choose to only install forwarding 1236 state to a subset of the potential next hops. If a choice is made 1237 then it will be as described in Section 5. 1239 The installed forwarding state may change over time reacting to 1240 changes in the underlay network and the availability of particular 1241 SFIs. Note that the forwarding state describes how one SFF send 1242 packets to another SFF, but not how those packets are routed through 1243 the underlay network. SFFs may be connected by tunnels across the 1244 underlay, or packets may be sent addressed to the next SFF and routed 1245 through the underlay. In any case, transmission across the underlay 1246 requires encapsulation of packets with a header for transport in the 1247 underlay network. 1249 Note that SFFs only create and store forwarding state for the SFPs on 1250 which they are included. They do not retain state for all SFPs 1251 advertised. 1253 An SFF may also install forwarding state to support looping, jumping, 1254 and branching. The protocol mechanism for explicit control of 1255 looping, jumping, and branching uses a specific reserved SFT value at 1256 a given hop of an SFPR and is described in Section 6.1. 1258 4.5.1. Processing With 'Gaps' in the SI Sequence 1260 The behavior of an SF as described in [RFC8300] is to decrement the 1261 value of the SI field in the NSH by one before returning a packet to 1262 the local SFF for further processing. This means that there is a 1263 good reason to assume that the SFP is composed of a series of SFs 1264 each indicated by an SI value one less than the previous. 1266 However, there is an advantage to having non-successive SIs in an 1267 SPI. Consider the case where an SPI needs to be modified by the 1268 insertion or removal of an SF. In the latter case this would lead to 1269 a "gap" in the sequence of SIs, and in the former case, this could 1270 only be achieved if a gap already existed into which the new SF with 1271 its new SI value could be inserted. Otherwise, all "downstream" SFs 1272 would need to be renumbered. 1274 Now, of course, such renumbering could be performed, but would lead 1275 to a significant disruption to the SFC as all the SFFs along the SFP 1276 were "reprogrammed". Thus, to achieve dynamic modification of an SFP 1277 (and even, in-service modification) it is desirable to be able to 1278 make these modifications without changing the SIs of the elements 1279 that were present before the modification. This will produce much 1280 more consistent/predictable behavior during the convergence period 1281 where otherwise the change would need to be fully propagated. 1283 Another approach says that any change to an SFP simply creates a new 1284 SFP that can be assigned a new SPI. All that would be needed would 1285 be to give a new instruction to the Classifier and traffic would be 1286 switched to the new SFP that contains the new set of SFs. This 1287 approach is practical, but neglects to consider that the SFP may be 1288 referenced by other SFPs (through "branch" instructions) and used by 1289 many Classifiers. In those cases the corresponding configuration 1290 resulting from a change in SPI may have wide ripples and give scope 1291 for errors that are hard to trace. 1293 Therefore, while this document requires that the SI values in an SFP 1294 are monotonic decreasing, it makes no assumption that the SI values 1295 are sequential. Configuration tools may apply that rule, but they 1296 are not required to. To support this, an SFF SHOULD process as 1297 follows when it receives a packet: 1299 o If the SI indicates a known entry in the SFP, the SFF MUST process 1300 the packet as normal, looking up the SI and determining to which 1301 local SFI to deliver the packet. 1303 o If the SI does not match an entry in the SFP, the SFF MUST reduce 1304 the SI value to the next (smaller) value present in the SFP and 1305 process the packet using that SI. 1307 o If there is no smaller SI (i.e., if the end of the SFP has been 1308 reached) the SFF MUST treat the SI value as invalid as described 1309 in [RFC8300]. 1311 This makes the behavior described in this document a superset of the 1312 function in [RFC8300]. That is, an implementation that strictly 1313 follows RFC 8300 in performing SI decrements in units of one, is 1314 perfectly in line with the mechanisms defined in this document. 1316 SFF implementations MAY choose to only support contiguous SI values 1317 in an SFP. Such an implementation will not support receiving an SI 1318 value that is not present in the SFP and will discard the packets as 1319 described in [RFC8300]. 1321 5. Selection within Service Function Paths 1323 As described in Section 2 the SPI/SI in the NSH passed back from an 1324 SFI to the SFF may leave the SFF with a choice of next hop SFTs, and 1325 a choice of SFIs for each SFT. That is, the SPI indicates an SFPR, 1326 and the SI indicates an entry in that SFPR. Each entry in an SFPR is 1327 a set of one or more SFT/SFIR-RD pairs. The SFF MUST choose one of 1328 these, identify the SFF that supports the chosen SFI, and send the 1329 packet to that next hop SFF. 1331 The choice be may offered for load balancing across multiple SFIs, or 1332 for discrimination between different actions necessary at a specific 1333 hop in the SFP. Different SFT values may exist at a given hop in an 1334 SFP to support several cases: 1336 o There may be multiple instances of similar service functions that 1337 are distinguished by different SFT values. For example, firewalls 1338 made by vendor A and vendor B may need to be identified by 1339 different SFT values because, while they have similar 1340 functionality, their behavior is not identical. Then, some SFPs 1341 may limit the choice of SF at a given hop by specifying the SFT 1342 for vendor A, but other SFPs might not need to control which 1343 vendor's SF is used and so can indicate that either SFT can be 1344 used. 1346 o There may be an obvious branch needed in an SFP such as the 1347 processing after a firewall where admitted packets continue along 1348 the SFP, but suspect packets are diverted to a "penalty box". In 1349 this case, the next hop in the SFP will be indicated with two 1350 different SFT values. 1352 In the typical case, the SFF chooses a next hop SFF by looking at the 1353 set of all SFFs that support the SFs identified by the SI (that set 1354 having been advertised in individual SFIR advertisements), finding 1355 the one or more that are "nearest" in the underlay network, and 1356 choosing between next hop SFFs using its own load-balancing 1357 algorithm. 1359 An SFI may influence this choice process by passing additional 1360 information back along with the packet and NSH. This information may 1361 influence local policy at the SFF to cause it to favor a next hop SFF 1362 (perhaps selecting one that is not nearest in the underlay), or to 1363 influence the load-balancing algorithm. 1365 This selection applies to the normal case, but also applies in the 1366 case of looping, jumping, and branching (see Section 6). 1368 Suppose an SFF in a particular service overlay network (identified by 1369 a particular import RT, RT-z) needs to forward an NSH-encapsulated 1370 packet whose SPI is SPI-x and whose SI is SI-y. It does the 1371 following: 1373 1. It looks for an installed SFPR that carries RT-z and that has 1374 SPI-x in its NLRI. If there is none, then such packets cannot be 1375 forwarded. 1377 2. From the SFP attribute of that SFPR, it finds the Hop TLV with SI 1378 value set to SI-y. If there is no such Hop TLV, then such 1379 packets cannot be forwarded. 1381 3. It then finds the "relevant" set of SFIRs by going through the 1382 list of SFT TLVs contained in the Hop TLV as follows: 1384 A. An SFIR is relevant if it carries RT-z, the SFT in its NLRI 1385 matches the SFT value in one of the SFT TLVs, and the RD 1386 value in its NLRI matches an entry in the list of SFIR-RDs in 1387 that SFT TLV. 1389 B. If an entry in the SFIR-RD list of an SFT TLV contains the 1390 value zero, then an SFIR is relevant if it carries RT-z and 1391 the SFT in its NLRI matches the SFT value in that SFT TLV. 1392 I.e., any SFIR in the service function overlay network 1393 defined by RT-z and with the correct SFT is relevant. 1395 C. If a pool identifier is in use then an SFIR is relevant if it 1396 is a member of the pool. 1398 Each of the relevant SFIRs identifies a single SFI, and contains a 1399 Tunnel Encapsulation attribute that specifies how to send a packet to 1400 that SFI. For a particular packet, the SFF chooses a particular SFI 1401 from the set of relevant SFIRs. This choice is made according to 1402 local policy. 1404 A typical policy might be to figure out the set of SFIs that are 1405 closest, and to load balance among them. But this is not the only 1406 possible policy. 1408 Thus, at any point in time when an SFF selects its next hop, it 1409 chooses from the intersection of the set of next hop RDs contained in 1410 the SFPR and the RDs contained in the SFF's local set of SFIRs (i.e., 1411 according to the determination of "relevance", above). If the 1412 intersection is null, the SFPR is unusable. Similarly, when this 1413 condition applies on the Controller that originated the SFPR, it 1414 SHOULD either withdraw the SFPR or re-advertise it with a new set of 1415 RDs for the affected hop. 1417 6. Looping, Jumping, and Branching 1419 As described in Section 2 an SFI or an SFF may cause a packet to 1420 "loop back" to a previous SF on a path in order that a sequence of 1421 functions may be re-executed. This is simply achieved by replacing 1422 the SI in the NSH with a higher value instead of decreasing it as 1423 would normally be the case to determine the next hop in the path. 1425 Section 2 also describes how an SFI or an SFF may cause a packets to 1426 "jump forward" to an SF on a path that is not the immediate next SF 1427 in the SFP. This is simply achieved by replacing the SI in the NSH 1428 with a lower value than would be achieved by decreasing it by the 1429 normal amount. 1431 A more complex option to move packets from one SFP to another is 1432 described in [RFC8300] and Section 2 where it is termed "branching". 1433 This mechanism allows an SFI or SFF to make a choice of downstream 1434 treatments for packets based on local policy and output of the local 1435 SF. Branching is achieved by changing the SPI in the NSH to indicate 1436 the new path and setting the SI to indicate the point in the path at 1437 which the packets enter. 1439 Note that the NSH does not include a marker to indicate whether a 1440 specific packet has been around a loop before. Therefore, the use of 1441 NSH metadata ([RFC8300]) may be required in order to prevent infinite 1442 loops. 1444 6.1. Protocol Control of Looping, Jumping, and Branching 1446 If the SFT value in an SFT TLV in an SFPR has the Special Purpose SFT 1447 value "Change Sequence" (see Section 10) then this is an indication 1448 that the SFF may make a loop, jump, or branch according to local 1449 policy and information returned by the local SFI. 1451 In this case, the SPI and SI of the next hop are encoded in the eight 1452 bytes of an entry in the SFIR-RD list as follows: 1454 3 bytes SPI 1456 1 bytes SI 1458 4 bytes Reserved (SHOULD be set to zero and ignored) 1460 If the SI in this encoding is not part of the SFPR indicated by the 1461 SPI in this encoding, then this is an explicit error that SHOULD be 1462 detected by the SFF when it parses the SFPR. The SFPR SHOULD NOT 1463 cause any forwarding state to be installed in the SFF and packets 1464 received with the SPI that indicates this SFPR SHOULD be silently 1465 discarded. 1467 If the SPI in this encoding is unknown, the SFF SHOULD NOT install 1468 any forwarding state for this SFPR, but MAY hold the SFPR pending 1469 receipt of another SFPR that does use the encoded SPI. 1471 If the SPI matches the current SPI for the path, this is a loop or 1472 jump. In this case, if the SI is greater than to the current SI it 1473 is a loop. If the SPI matches and the SI is less than the next SI, 1474 it is a jump. 1476 If the SPI indicates another path, this is a branch and the SI 1477 indicates the point at which to enter that path. 1479 The Change Sequence SFT is just another SFT that may appear in a set 1480 of SFI/SFT tuples within an SI and is selected as described in 1481 Section 5. 1483 Note that Special Purpose SFTs MUST NOT be advertised in SFIRs. If 1484 such an SFIR is received it SHOULD be ignored. 1486 6.2. Implications for Forwarding State 1488 Support for looping and jumping requires that the SFF has forwarding 1489 state established to an SFF that provides access to an instance of 1490 the appropriate SF. This means that the SFF must have seen the 1491 relevant SFIR advertisements and known that it needed to create the 1492 forwarding state. This is a matter of local configuration and 1493 implementation: for example, an implementation could be configured to 1494 install forwarding state for specific looping/jumping. 1496 Support for branching requires that the SFF has forwarding state 1497 established to an SFF that provides access to an instance of the 1498 appropriate entry SF on the other SFP. This means that the SFF must 1499 have seen the relevant SFIR and SFPR advertisements and known that it 1500 needed to create the forwarding state. This is a matter of local 1501 configuration and implementation: for example, an implementation 1502 could be configured to install forwarding state for specific 1503 branching (identified by SPI and SI). 1505 7. Advanced Topics 1507 This section highlights several advanced topics introduced elsewhere 1508 in this document. 1510 7.1. Correlating Service Function Path Instances 1512 It is often useful to create bidirectional SFPs to enable packet 1513 flows to traverse the same set of SFs, but in the reverse order. 1514 However, packets on SFPs in the data plane (per [RFC8300]) do not 1515 contain a direction indicator, so each direction must use a different 1516 SPI. 1518 As described in Section 3.2.1.1 an SFPR can contain one or more 1519 correlators encoded in Association TLVs. If the Association Type 1520 indicates "Bidirectional SFP" then the SFP advertised in the SFPR is 1521 one direction of a bidirectional pair of SFPs where the other in the 1522 pair is advertised in the SFPR with RD as carried in the Associated 1523 SFPR-RD field of the Association TLV. The SPI carried in the 1524 Associated SPI field of the Association TLV provides a cross-check 1525 against the SPI advertised in the SFPR with RD as carried in the 1526 Associated SFPR-RD field of the Association TLV. 1528 As noted in Section 3.2.1.1, when SFPRs reference each other, one 1529 SFPR advertisement will be received before the other. Therefore, 1530 processing of an association will require that the first SFPR is not 1531 rejected simply because the Associated SFPR-RD it carries is unknown. 1532 However, the SFP defined by the first SFPR is valid and SHOULD be 1533 available for use as a unidirectional SFP even in the absence of an 1534 advertisement of its partner. 1536 Furthermore, in error cases where SFPR-a associates with SFPR-b, but 1537 SFPR-b associates with SFPR-c such that a bidirectional pair of SFPs 1538 cannot be formed, the individual SFPs are still valid and SHOULD be 1539 available for use as unidirectional SFPs. An implementation SHOULD 1540 log this situation because it represents a Controller error. 1542 Usage of a bidirectional SFP may be programmed into the Classifiers 1543 by the Controller. Alternatively, a Classifier may look at incoming 1544 packets on a bidirectional packet flow, extract the SPI from the 1545 received NSH, and look up the SFPR to find the reverse direction SFP 1546 to use when it sends packets. 1548 See Section 8 for an example of how this works. 1550 7.2. Considerations for Stateful Service Functions 1552 Some service functions are stateful. That means that they build and 1553 maintain state derived from configuration or from the packet flows 1554 that they handle. In such cases it can be important or necessary 1555 that all packets from a flow continue to traverse the same instance 1556 of a service function so that the state can be leveraged and does not 1557 need to be regenerated. 1559 In the case of bidirectional SFPs, it may be necessary to traverse 1560 the same instances of a stateful service function in both directions. 1561 A firewall is a good example of such a service function. 1563 This issue becomes a concern where there are multiple parallel 1564 instances of a service function and a determination of which one to 1565 use could normally be left to the SFF as a load-balancing or local 1566 policy choice. 1568 For the forward direction SFP, the concern is that the same choice of 1569 service function is made for all packets of a flow under normal 1570 network conditions. It may be possible to guarantee that the load 1571 balancing functions applied in the SFFs are stable and repeatable, 1572 but a Controller that constructs SFPs might not want to trust to 1573 this. The Controller can, in these cases, build a number of more 1574 specific SFPs each traversing a specific instance of the stateful 1575 SFs. In this case, the load balancing choice can be left up to the 1576 Classifier. Thus the Classifier selects which instance of a stateful 1577 SF is used by a particular flow by selecting the SFP that the flow 1578 uses. 1580 For bidirectional SFPs where the same instance of a stateful SF must 1581 be traversed in both directions, it is not enough to leave the choice 1582 of service function instance as a local choice even if the load 1583 balancing is stable because coordination would be required between 1584 the decision points in the forward and reverse directions and this 1585 may be hard to achieve in all cases except where it is the same SFF 1586 that makes the choice in both directions. 1588 Note that this approach necessarily increases the amount of SFP state 1589 in the network (i.e., there are more SFPs). It is possible to 1590 mitigate this effect by careful construction of SFPs built from a 1591 concatenation of other SFPs. 1593 Section 8.9 includes some simple examples of SFPs for stateful 1594 service functions. 1596 7.3. VPN Considerations and Private Service Functions 1598 Likely deployments include reserving specific instances of Service 1599 Functions for specific customers or allowing customers to deploy 1600 their own Service Functions within the network. Building Service 1601 Functions in such environments requires that suitable identifiers are 1602 used to ensure that SFFs distinguish which SFIs can be used and which 1603 cannot. 1605 This problem is similar to how VPNs are supported and is solved in a 1606 similar way. The RT field is used to indicate a set of Service 1607 Functions from which all choices must be made. 1609 7.4. Flow Specification for SFC Classifiers 1611 [I-D.ietf-idr-rfc5575bis] defines a set of BGP routes that can be 1612 used to identify the packets in a given flow using fields in the 1613 header of each packet, and a set of actions, encoded as extended 1614 communities, that can be used to disposition those packets. This 1615 document enables the use of these mechanisms by SFC Classifiers by 1616 defining a new action extended community called "Flow Specification 1617 for SFC Classifiers" identified by the value TBD4. Note that 1618 implementation of this section of this specification will be 1619 Controllers or Classifiers communicating with each other directly for 1620 the purpose of instructing the Classifier how to place packets onto 1621 an SFP. In order that the implementation of Classifiers can be kept 1622 simple and to avoid the confusion between the purpose of different 1623 extended communities, a Controller MUST NOT include other action 1624 extended communities at the same time as a "Flow Specification for 1625 SFC Classifiers" extended community: a "Flow Specification for SFC 1626 Classifiers" Traffic Filtering Action Extended Community advertised 1627 with any other Traffic Filtering Action Extended Community MUST be 1628 treated as malformed in line with [I-D.ietf-idr-rfc5575bis] and 1629 result in the Flow Specification UPDATE message being handled as 1630 treat-as-withdraw according to [RFC7606] Section 2. 1632 To put the Flow Specification into context when multiple SFC overlays 1633 are present in one network, each FlowSpec update MUST be tagged with 1634 the route target of the overlay or VPN network for which it is 1635 intended. 1637 This extended community is encoded as an 8-octet value, as shown in 1638 Figure 10. 1640 1 2 3 1641 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 1642 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1643 | Type=0x80 | Sub-Type=TBD4 | SPI | 1644 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1645 | SPI (cont.) | SI | SFT | 1646 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1648 Figure 10: The Format of the Flow Specification for SFC Classifiers 1649 Extended Community 1651 The extended community contains the Service Path Identifier (SPI), 1652 Service Index (SI), and Service Function Type (SFT) as defined 1653 elsewhere in this document. Thus, each action extended community 1654 defines the entry point (not necessarily the first hop) into a 1655 specific service function path. This allows, for example, different 1656 flows to enter the same service function path at different points. 1658 Note that according to [I-D.ietf-idr-rfc5575bis] a given Flow 1659 Specification update may include multiple of these action extended 1660 communities. If a given action extended community does not contain 1661 an installed SFPR with the specified {SPI, SI, SFT} it MUST NOT be 1662 used for dispositioning the packets of the specified flow. 1664 The normal case of packet classification for SFC will see a packet 1665 enter the SFP at its first hop. In this case the SI in the extended 1666 community is superfluous and the SFT may also be unnecessary. To 1667 allow these cases to be handled, a special meaning is assigned to a 1668 Service Index of zero (not a valid value) and an SFT of zero (a 1669 reserved value in the registry - see Section 10.5). 1671 o If an SFC Classifiers Extended Community is received with SI = 0 1672 then it means that the first hop of the SFP indicated by the SPI 1673 MUST be used. 1675 o If an SFC Classifiers Extended Community is received with SFT = 0 1676 then there are two sub-cases: 1678 * If there is a choice of SFT in the hop indicated by the value 1679 of the SI (including SI = 0) then SFT = 0 means there is a free 1680 choice according to local policy of which SFT to use). 1682 * If there is no choice of SFT in the hop indicated by the value 1683 of SI, then SFT = 0 means that the value of the SFT at that hop 1684 as indicated in the SFPR for the indicated SPI MUST be used. 1686 One of the filters that the Flow Specification may describe is the 1687 VPN to which the traffic belongs. Additionally, as noted above, to 1688 put the indicated SPI into context when multiple SFC overlays are 1689 present in one network, each FlowSpec update MUST be tagged with the 1690 route target of the overlay or VPN network for which it is intended. 1692 Note that future extensions might be made to the Flow Specification 1693 for SFC Classifiers Extended Community to provide instruction to the 1694 Classifier about what metadata to add to packets that it classifies 1695 for forwarding on a specific SFP, but that is outside the scope of 1696 this document. 1698 7.5. Choice of Data Plane SPI/SI Representation 1700 This document ties together the control and data planes of an SFC 1701 overlay network through the use of the SPI/SI which is nominally 1702 carried in the NSH of a given packet. However, in order to handle 1703 situations in which the NSH is not ubiquitously deployed, it is also 1704 possible to use alternative data plane representations of the SPI/SI 1705 by carrying the identical semantics in other protocol fields such as 1706 MPLS labels [RFC8595]. 1708 This document defines a new sub-TLV for the Tunnel Encapsulation 1709 attribute [I-D.ietf-idr-tunnel-encaps], the SPI/SI Representation 1710 sub-TLV of type TBD5. This sub-TLV MAY be present in each Tunnel TLV 1711 contained in a Tunnel Encapsulation attribute when the attribute is 1712 carried by an SFIR. The value field of this sub-TLV is a two octet 1713 field of flags numbered counting from the the most significant bit, 1714 each of which describes how the originating SFF expects to see the 1715 SPI/SI represented in the data plane for packets carried in the 1716 tunnels described by the Tunnel TLV. 1718 The following bits are defined by this document and are tracked in an 1719 IANA registry described in Section 10.10: 1721 Bit TBD9: If this bit is set the NSH is to be used to carry the SPI/ 1722 SI in the data plane. 1724 Bit TBD10: If this bit is set two labels in an MPLS label stack are 1725 to be used as described in Section 7.5.1. 1727 If a given Tunnel TLV does not contain an SPI/SI Representation sub- 1728 TLV then it MUST be processed as if such a sub-TLV is present with 1729 Bit TBD9 set and no other bits set. That is, the absence of the sub- 1730 TLV SHALL be interpreted to mean that the NSH is to be used. 1732 If a given Tunnel TLV contains an SPI/SI Representation sub-TLV with 1733 value field that has no flag set then the tunnel indicated by the 1734 Tunnel TLV MUST NOT be used for forwarding SFC packets. If a given 1735 Tunnel TLV contains an SPI/SI Representation sub-TLV with both bit 1736 TBD9 and bit TBD10 set then the tunnel indicated by the Tunnel TLV 1737 MUST NOT be used for forwarding SFC packets. The meaning and rules 1738 for presence of other bits is to be defined in future documents, but 1739 implementations of this specification MUST set other bits to zero and 1740 ignore them on receipt. 1742 If a given Tunnel TLV contains more than one SPI/SI Representation 1743 sub-TLV then the first one MUST be considered and subsequent 1744 instances MUST be ignored. 1746 Note that the MPLS representation of the logical NSH may be used even 1747 if the tunnel is not an MPLS tunnel. Conversely, MPLS tunnels may be 1748 used to carry other encodings of the logical NSH (specifically, the 1749 NSH itself). It is a requirement that both ends of a tunnel over the 1750 underlay network know that the tunnel is used for SFC and know what 1751 form of NSH representation is used. The signaling mechanism 1752 described here allows coordination of this information. 1754 7.5.1. MPLS Representation of the SPI/SI 1756 If bit TBD10 is set in the in the SPI/SI Representation sub-TLV then 1757 labels in the MPLS label stack are used to indicate SFC forwarding 1758 and processing instructions to achieve the semantics of a logical 1759 NSH. The label stack is encoded as shown in [RFC8595]. 1761 7.6. MPLS Label Swapping/Stacking Operation 1763 When a Classifier constructs an MPLS label stack for an SFP it starts 1764 with that SFP's last hop. If the last hop requires an {SPI, SI} 1765 label pair for label swapping, it pushes the SI (set to the SI value 1766 of the last hop) and the SFP's SPI onto the MPLS label stack. If the 1767 last hop requires a {context label, SFI label} label pair for label 1768 stacking it selects a specific SFIR and pushes that SFIR's SFI label 1769 and context label onto the MPLS label stack. 1771 The Classifier then moves sequentially back through the SFP one hop 1772 at a time. For each hop, if the hop requires an {SPI, SI]} and there 1773 is an {SPI, SI} at the top of the MPLS label stack, the SI is set to 1774 the SI value of the current hop. If there is not an {SPI, SI} at the 1775 top of the MPLS label stack, it pushes the SI (set to the SI value of 1776 the current hop) and the SFP's SPI onto the MPLS label stack. 1778 If the hop requires a {context label, SFI label}, it selects a 1779 specific SFIR and pushes that SFIR's SFI label and context label onto 1780 the MPLS label stack. 1782 7.7. Support for MPLS-Encapsulated NSH Packets 1784 [RFC8596] describes how to transport SFC packets using the NSH over 1785 an MPLS transport network. Signaling MPLS encapsulation of SFC 1786 packets using the NSH is also supported by this document by using the 1787 "BGP Tunnel Encapsulation Attribute Sub-TLV" with the codepoint 10 1788 (representing "MPLS Label Stack") from the "BGP Tunnel Encapsulation 1789 Attribute Sub-TLVs" registry defined in [I-D.ietf-idr-tunnel-encaps], 1790 and also using the "SFP Traversal With MPLS Label Stack TLV" and the 1791 "SPI/SI Representation sub-TLV" with bit TBD9 set and bit TBD10 1792 cleared. 1794 In this case the MPLS label stack constructed by the SFF to forward a 1795 packet to the next SFF on the SFP will consist of the labels needed 1796 to reach that SFF, and if label stacking is used it will also include 1797 the labels advertised in the MPLS Label Stack sub-TLV and the labels 1798 remaining in the stack needed to traverse the remainder of the SFP. 1800 8. Examples 1802 Most of the examples in this section use IPv4 addressing. But there 1803 is nothing special about IPv4 in the mechanisms described in this 1804 document, and they are equally applicable to IPv6. A few examples 1805 using IPv6 addressing are provided in Section 8.10. 1807 Assume we have a service function overlay network with four SFFs 1808 (SFF1, SFF3, SFF3, and SFF4). The SFFs have addresses in the 1809 underlay network as follows: 1811 SFF1 192.0.2.1 1812 SFF2 192.0.2.2 1813 SFF3 192.0.2.3 1814 SFF4 192.0.2.4 1816 Each SFF provides access to some SFIs from the four Service Function 1817 Types SFT=41, SFT=42, SFT=43, and SFT=44 as follows: 1819 SFF1 SFT=41 and SFT=42 1820 SFF2 SFT=41 and SFT=43 1821 SFF3 SFT=42 and SFT=44 1822 SFF4 SFT=43 and SFT=44 1824 The service function network also contains a Controller with address 1825 198.51.100.1. 1827 This example service function overlay network is shown in Figure 11. 1829 -------------- 1830 | Controller | 1831 | 198.51.100.1 | ------ ------ ------ ------ 1832 -------------- | SFI | | SFI | | SFI | | SFI | 1833 |SFT=41| |SFT=42| |SFT=41| |SFT=43| 1834 ------ ------ ------ ------ 1835 \ / \ / 1836 --------- --------- 1837 ---------- | SFF1 | | SFF2 | 1838 Packet --> | | |192.0.2.1| |192.0.2.2| 1839 Flows --> |Classifier| --------- --------- -->Dest 1840 | | --> 1841 ---------- --------- --------- 1842 | SFF3 | | SFF4 | 1843 |192.0.2.3| |192.0.2.4| 1844 --------- --------- 1845 / \ / \ 1846 ------ ------ ------ ------ 1847 | SFI | | SFI | | SFI | | SFI | 1848 |SFT=42| |SFT=44| |SFT=43| |SFT=44| 1849 ------ ------ ------ ------ 1851 Figure 11: Example Service Function Overlay Network 1853 The SFFs advertise routes to the SFIs they support. These 1854 advertisements contain Route Distinguishers that are set according to 1855 the network operator's configuration model. In all of these IPv4 1856 examples we use RDs of type 2 such that the available six octets are 1857 partitioned as four octets for the IPv4 address of the advertising 1858 SFF, and two octets that are a local index of the SFI. This scheme 1859 is chosen purely for convenience of documentation, and an operator is 1860 totally free to use any other scheme so long as it conforms to the 1861 definitions of SFIR and SFPR in Section 3.1 and Section 3.2. 1863 Thus we see the following SFIRs advertised: 1865 RD = 192.0.2.1/1, SFT = 41 1866 RD = 192.0.2.1/2, SFT = 42 1867 RD = 192.0.2.2/1, SFT = 41 1868 RD = 192.0.2.2/2, SFT = 43 1869 RD = 192.0.2.3/7, SFT = 42 1870 RD = 192.0.2.3/8, SFT = 44 1871 RD = 192.0.2.4/5, SFT = 43 1872 RD = 192.0.2.4/6, SFT = 44 1874 Note that the addressing used for communicating between SFFs is taken 1875 from the Tunnel Encapsulation attribute of the SFIR and not from the 1876 SFIR-RD. 1878 8.1. Example Explicit SFP With No Choices 1880 Consider the following SFPR. 1882 SFP1: RD = 198.51.100.1/101, SPI = 15, 1883 [SI = 255, SFT = 41, RD = 192.0.2.1/1], 1884 [SI = 250, SFT = 43, RD = 192.0.2.2/2] 1886 The Service Function Path consists of an SF of type 41 located at 1887 SFF1 followed by an SF of type 43 located at SFF2. This path is 1888 fully explicit and each SFF is offered no choice in forwarding 1889 packets along the path. 1891 SFF1 will receive packets on the path from the Classifier and will 1892 identify the path from the SPI (15). The initial SI will be 255 and 1893 so SFF1 will deliver the packets to the SFI for SFT 41. 1895 When the packets are returned to SFF1 by the SFI the SI will be 1896 decreased to 250 for the next hop. SFF1 has no flexibility in the 1897 choice of SFF to support the next hop SFI and will forward the packet 1898 to SFF2 which will send the packets to the SFI that supports SFT 43 1899 before forwarding the packets to their destinations. 1901 8.2. Example SFP With Choice of SFIs 1903 SFP2: RD = 198.51.100.1/102, SPI = 16, 1904 [SI = 255, SFT = 41, RD = 192.0.2.1/1], 1905 [SI = 250, SFT = 43, {RD = 192.0.2.2/2, 1906 RD = 192.0.2.4/5 } ] 1908 In this example the path also consists of an SF of type 41 located at 1909 SFF1 and this is followed by an SF of type 43, but in this case the 1910 SI = 250 contains a choice between the SFI located at SFF2 and the 1911 SFI located at SFF4. 1913 SFF1 will receive packets on the path from the Classifier and will 1914 identify the path from the SPI (16). The initial SI will be 255 and 1915 so SFF1 will deliver the packets to the SFI for SFT 41. 1917 When the packets are returned to SFF1 by the SFI the SI will be 1918 decreased to 250 for the next hop. SFF1 now has a choice of next hop 1919 SFF to execute the next hop in the path. It can either forward 1920 packets to SFF2 or SFF4 to execute a function of type 43. It uses 1921 its local load balancing algorithm to make this choice. The chosen 1922 SFF will send the packets to the SFI that supports SFT 43 before 1923 forwarding the packets to their destinations. 1925 8.3. Example SFP With Open Choice of SFIs 1927 SFP3: RD = 198.51.100.1/103, SPI = 17, 1928 [SI = 255, SFT = 41, RD = 192.0.2.1/1], 1929 [SI = 250, SFT = 44, RD = 0] 1931 In this example the path also consists of an SF of type 41 located at 1932 SFF1 and this is followed by an SI with an RD of zero and SF of type 1933 44. This means that a choice can be made between any SFF that 1934 supports an SFI of type 44. 1936 SFF1 will receive packets on the path from the Classifier and will 1937 identify the path from the SPI (17). The initial SI will be 255 and 1938 so SFF1 will deliver the packets to the SFI for SFT 41. 1940 When the packets are returned to SFF1 by the SFI the SI will be 1941 decreased to 250 for the next hop. SFF1 now has a free choice of 1942 next hop SFF to execute the next hop in the path selecting between 1943 all SFFs that support SFs of type 44. Looking at the SFIRs it has 1944 received, SFF1 knows that SF type 44 is supported by SFF3 and SFF4. 1946 SFF1 uses its local load balancing algorithm to make this choice. 1947 The chosen SFF will send the packets to the SFI that supports SFT 44 1948 before forwarding the packets to their destinations. 1950 8.4. Example SFP With Choice of SFTs 1952 SFP4: RD = 198.51.100.1/104, SPI = 18, 1953 [SI = 255, SFT = 41, RD = 192.0.2.1/1], 1954 [SI = 250, {SFT = 43, RD = 192.0.2.2/2, 1955 SFT = 44, RD = 192.0.2.3/8 } ] 1957 This example provides a choice of SF type in the second hop in the 1958 path. The SI of 250 indicates a choice between SF type 43 located at 1959 SF2 and SF type 44 located at SF3. 1961 SFF1 will receive packets on the path from the Classifier and will 1962 identify the path from the SPI (18). The initial SI will be 255 and 1963 so SFF1 will deliver the packets to the SFI for SFT 41. 1965 When the packets are returned to SFF1 by the SFI the SI will be 1966 decreased to 250 for the next hop. SFF1 now has a free choice of 1967 next hop SFF to execute the next hop in the path selecting between 1968 all SFFs that support an SF of type 43 and SFF3 that supports an SF 1969 of type 44. These may be completely different functions that are to 1970 be executed dependent on specific conditions, or may be similar 1971 functions identified with different type identifiers (such as 1972 firewalls from different vendors). SFF1 uses its local policy and 1973 load balancing algorithm to make this choice, and may use additional 1974 information passed back from the local SFI to help inform its 1975 selection. The chosen SFF will send the packets to the SFI that 1976 supports the chose SFT before forwarding the packets to their 1977 destinations. 1979 8.5. Example Correlated Bidirectional SFPs 1981 SFP5: RD = 198.51.100.1/105, SPI = 19, 1982 Assoc-Type = 1, Assoc-RD = 198.51.100.1/106, Assoc-SPI = 20, 1983 [SI = 255, SFT = 41, RD = 192.0.2.1/1], 1984 [SI = 250, SFT = 43, RD = 192.0.2.2/2] 1986 SFP6: RD = 198.51.100.1/106, SPI = 20, 1987 Assoc-Type = 1, Assoc-RD = 198.51.100.1/105, Assoc-SPI = 19, 1988 [SI = 254, SFT = 43, RD = 192.0.2.2/2], 1989 [SI = 249, SFT = 41, RD = 192.0.2.1/1] 1991 This example demonstrates correlation of two SFPs to form a 1992 bidirectional SFP as described in Section 7.1. 1994 Two SFPRs are advertised by the Controller. They have different SPIs 1995 (19 and 20) so they are known to be separate SFPs, but they both have 1996 Association TLVs with Association Type set to 1 indicating 1997 bidirectional SFPs. Each has an Associated SFPR-RD field containing 1998 the value of the other SFPR-RD to correlated the two SFPs as a 1999 bidirectional pair. 2001 As can be seen from the SFPRs in this example, the paths are 2002 symmetric: the hops in SFP5 appear in the reverse order in SFP6. 2004 8.6. Example Correlated Asymmetrical Bidirectional SFPs 2006 SFP7: RD = 198.51.100.1/107, SPI = 21, 2007 Assoc-Type = 1, Assoc-RD = 198.51.100.1/108, Assoc-SPI = 22, 2008 [SI = 255, SFT = 41, RD = 192.0.2.1/1], 2009 [SI = 250, SFT = 43, RD = 192.0.2.2/2] 2011 SFP8: RD = 198.51.100.1/108, SPI = 22, 2012 Assoc-Type = 1, Assoc-RD = 198.51.100.1/107, Assoc-SPI = 21, 2013 [SI = 254, SFT = 44, RD = 192.0.2.4/6], 2014 [SI = 249, SFT = 41, RD = 192.0.2.1/1] 2016 Asymmetric bidirectional SFPs can also be created. This example 2017 shows a pair of SFPs with distinct SPIs (21 and 22) that are 2018 correlated in the same way as in the example in Section 8.5. 2020 However, unlike in that example, the SFPs are different in each 2021 direction. Both paths include a hop of SF type 41, but SFP7 includes 2022 a hop of SF type 43 supported at SFF2 while SFP8 includes a hop of SF 2023 type 44 supported at SFF4. 2025 8.7. Example Looping in an SFP 2027 SFP9: RD = 198.51.100.1/109, SPI = 23, 2028 [SI = 255, SFT = 41, RD = 192.0.2.1/1], 2029 [SI = 250, SFT = 44, RD = 192.0.2.4/5], 2030 [SI = 245, {SFT = 1, RD = {SPI=23, SI=255, Rsv=0}, 2031 SFT = 42, RD = 192.0.2.3/7 } ] 2033 Looping and jumping are described in Section 6. This example shows 2034 an SFP that contains an explicit loop-back instruction that is 2035 presented as a choice within an SFP hop. 2037 The first two hops in the path (SI = 255 and SI = 250) are normal. 2038 That is, the packets will be delivered to SFF1 and SFF4 in turn for 2039 execution of SFs of type 41 and 44 respectively. 2041 The third hop (SI = 245) presents SFF4 with a choice of next hop. It 2042 can either forward the packets to SFF3 for an SF of type 42 (the 2043 second choice), or it can loop back. 2045 The loop-back entry in the SFPR for SI = 245 is indicated by the 2046 special purpose SFT value 1 ("Change Sequence"). Within this hop, 2047 the RD is interpreted as encoding the SPI and SI of the next hop (see 2048 Section 6.1. In this case the SPI is 23 which indicates that this is 2049 loop or branch: i.e., the next hop is on the same SFP. The SI is set 2050 to 255: this is a higher number than the current SI (245) indicating 2051 a loop. 2053 SFF4 must make a choice between these two next hops. Either the 2054 packets will be forwarded to SFF3 with the NSH SI decreased to 245 or 2055 looped back to SFF1 with the NSH SI reset to 255. This choice will 2056 be made according to local policy, information passed back by the 2057 local SFI, and details in the packets' metadata that are used to 2058 prevent infinite looping. 2060 8.8. Example Branching in an SFP 2062 SFP10: RD = 198.51.100.1/110, SPI = 24, 2063 [SI = 254, SFT = 42, RD = 192.0.2.3/7], 2064 [SI = 249, SFT = 43, RD = 192.0.2.2/2] 2066 SFP11: RD = 198.51.100.1/111, SPI = 25, 2067 [SI = 255, SFT = 41, RD = 192.0.2.1/1], 2068 [SI = 250, SFT = 1, RD = {SPI=24, SI=254, Rsv=0}] 2070 Branching follows a similar procedure to that for looping (and 2071 jumping) as shown in Section 8.7 however there are two SFPs involved. 2073 SFP10 shows a normal path with packets forwarded to SFF3 and SFF2 for 2074 execution of service functions of type 42 and 43 respectively. 2076 SFP11 starts as normal (SFF1 for an SF of type 41), but then SFF1 2077 processes the next hop in the path and finds a "Change Sequence" 2078 Special Purpose SFT. The SFIR-RD field includes an SPI of 24 which 2079 indicates SFP10, not the current SFP. The SI in the SFIR-RD is 254, 2080 so SFF1 knows that it must set the SPI/SI in the NSH to 24/254 and 2081 send the packets to the appropriate SFF as advertised in the SFPR for 2082 SFP10 (that is, SFF3). 2084 8.9. Examples of SFPs with Stateful Service Functions 2086 This section provides some examples to demonstrate establishing SFPs 2087 when there is a choice of service functions at a particular hop, and 2088 where consistency of choice is required in both directions. The 2089 scenarios that give rise to this requirement are discussed in 2090 Section 7.2. 2092 8.9.1. Forward and Reverse Choice Made at the SFF 2094 Consider the topology shown in Figure 12. There are three SFFs 2095 arranged neatly in a line, and the middle one (SFF2) supports three 2096 SFIs all of SFT 42. These three instances can be used by SFF2 to 2097 load balance so that no one instance is swamped. 2099 ------ ------ ------ ------ ------ 2100 | SFI | | SFIa | | SFIb | | SFIc | | SFI | 2101 |SFT=41| |SFT=42| |SFT=42| |SFT=42| |SFT=43| 2102 ------ ------\ ------ /------ ------ 2103 \ \ | / / 2104 --------- --------- --------- 2105 ---------- | SFF1 | | SFF2 | | SFF3 | 2106 --> | |..|192.0.2.1|...|192.0.2.2|...|192.0.2.3|--> 2107 --> |Classifier| --------- --------- --------- 2108 | | 2109 ---------- 2111 Figure 12: Example Where Choice is Made at the SFF 2113 This leads to the following SFIRs being advertised. 2115 RD = 192.0.2.1/11, SFT = 41 2116 RD = 192.0.2.2/11, SFT = 42 (for SFIa) 2117 RD = 192.0.2.2/12, SFT = 42 (for SFIb) 2118 RD = 192.0.2.2/13, SFT = 42 (for SFIc) 2119 RD = 192.0.2.3/11, SFT = 43 2121 The controller can create a single forward SFP (SFP12) giving SFF2 2122 the choice of which SFI to use to provide function of SFT 42 as 2123 follows. The load-balancing choice between the three available SFIs 2124 is assumed to be within the capabilities of the SFF and if the SFs 2125 are stateful it is assumed that the SFF knows this and arranges load 2126 balancing in a stable, flow-dependent way. 2128 SFP12: RD = 198.51.100.1/112, SPI = 26, 2129 Assoc-Type = 1, Assoc-RD = 198.51.100.1/113, Assoc-SPI = 27, 2130 [SI = 255, SFT = 41, RD = 192.0.2.1/11], 2131 [SI = 254, SFT = 42, {RD = 192.0.2.2/11, 2132 192.0.2.2/12, 2133 192.0.2.2/13 }], 2134 [SI = 253, SFT = 43, RD = 192.0.2.3/11] 2136 The reverse SFP (SFP13) in this case may also be created as shown 2137 below using association with the forward SFP and giving the load- 2138 balancing choice to SFF2. This is safe, even in the case that the 2139 SFs of type 42 are stateful because SFF2 is doing the load balancing 2140 in both directions and can apply the same algorithm to ensure that 2141 packets associated with the same flow use the same SFI regardless of 2142 the direction of travel. 2144 SFP13: RD = 198.51.100.1/113, SPI = 27, 2145 Assoc-Type = 1, Assoc-RD = 198.51.100.1/112, Assoc-SPI = 26, 2146 [SI = 255, SFT = 43, RD = 192.0.2.3/11], 2147 [SI = 254, SFT = 42, {RD = 192.0.2.2/11, 2148 192.0.2.2/12, 2149 192.0.2.2/13 }], 2150 [SI = 253, SFT = 41, RD = 192.0.2.1/11] 2152 How an SFF knows that an attached SFI is stateful is out of scope of 2153 this document. It is assumed that this will form part of the process 2154 by which SFIs are registered as local to SFFs. Section 7.2 provides 2155 additional observations about the coordination of the use of stateful 2156 SFIs in the case of bidirectional SFPs. 2158 In general, the problems of load balancing and the selection of the 2159 same SFIs in both directions of a bidirectional SFP can be addressed 2160 by using sufficiently precisely specified SFPs (specifying the exact 2161 SFIs to use) and suitable programming of the Classifiers at each end 2162 of the SFPs to make sure that the matching pair of SFPs are used. 2164 8.9.2. Parallel End-to-End SFPs with Shared SFF 2166 The mechanism described in Section 8.9.1 might not be desirable 2167 because of the functional assumptions it places on SFF2 to be able to 2168 load balance with suitable flow identification, stability, and 2169 equality in both directions. Instead, it may be desirable to place 2170 the responsibility for flow classification in the Classifier and let 2171 it determine load balancing with the implied choice of SFIs. 2173 Consider the network graph as shown in Figure 12 and with the same 2174 set of SFIRs as listed in Section 8.9.1. In this case the controller 2175 could specify three forward SFPs with their corresponding associated 2176 reverse SFPs. Each bidirectional pair of SFPs uses a different SFI 2177 for the SF of type 42. The controller can instruct the Classifier 2178 how to place traffic on the three bidirectional SFPs, or can treat 2179 them as a group leaving the Classifier responsible for balancing the 2180 load. 2182 SFP14: RD = 198.51.100.1/114, SPI = 28, 2183 Assoc-Type = 1, Assoc-RD = 198.51.100.1/117, Assoc-SPI = 31, 2184 [SI = 255, SFT = 41, RD = 192.0.2.1/11], 2185 [SI = 254, SFT = 42, RD = 192.0.2.2/11], 2186 [SI = 253, SFT = 43, RD = 192.0.2.3/11] 2188 SFP15: RD = 198.51.100.1/115, SPI = 29, 2189 Assoc-Type = 1, Assoc-RD = 198.51.100.1/118, Assoc-SPI = 32, 2190 [SI = 255, SFT = 41, RD = 192.0.2.1/11], 2191 [SI = 254, SFT = 42, RD = 192.0.2.2/12], 2192 [SI = 253, SFT = 43, RD = 192.0.2.3/11] 2194 SFP16: RD = 198.51.100.1/116, SPI = 30, 2195 Assoc-Type = 1, Assoc-RD = 198.51.100.1/119, Assoc-SPI = 33, 2196 [SI = 255, SFT = 41, RD = 192.0.2.1/11], 2197 [SI = 254, SFT = 42, RD = 192.0.2.2/13], 2198 [SI = 253, SFT = 43, RD = 192.0.2.3/11] 2200 SFP17: RD = 198.51.100.1/117, SPI = 31, 2201 Assoc-Type = 1, Assoc-RD = 198.51.100.1/114, Assoc-SPI = 28, 2202 [SI = 255, SFT = 43, RD = 192.0.2.3/11], 2203 [SI = 254, SFT = 42, RD = 192.0.2.2/11], 2204 [SI = 253, SFT = 41, RD = 192.0.2.1/11] 2206 SFP18: RD = 198.51.100.1/118, SPI = 32, 2207 Assoc-Type = 1, Assoc-RD = 198.51.100.1/115, Assoc-SPI = 29, 2208 [SI = 255, SFT = 43, RD = 192.0.2.3/11], 2209 [SI = 254, SFT = 42, RD = 192.0.2.2/12], 2210 [SI = 253, SFT = 41, RD = 192.0.2.1/11] 2212 SFP19: RD = 198.51.100.1/119, SPI = 33, 2213 Assoc-Type = 1, Assoc-RD = 198.51.100.1/116, Assoc-SPI = 30, 2214 [SI = 255, SFT = 43, RD = 192.0.2.3/11], 2215 [SI = 254, SFT = 42, RD = 192.0.2.2/13], 2216 [SI = 253, SFT = 41, RD = 192.0.2.1/11] 2218 8.9.3. Parallel End-to-End SFPs with Separate SFFs 2220 While the examples in Section 8.9.1 and Section 8.9.2 place the 2221 choice of SFI as subtended from the same SFF, it is also possible 2222 that the SFIs are each subtended from a different SFF as shown in 2223 Figure 13. In this case it is harder to coordinate the choices for 2224 forward and reverse paths without some form of coordination between 2225 SFF1 and SFF3. Therefore it would be normal to consider end-to-end 2226 parallel SFPs as described in Section 8.9.2. 2228 ------ 2229 | SFIa | 2230 |SFT=42| 2231 ------ 2232 ------ | 2233 | SFI | --------- 2234 |SFT=41| | SFF5 | 2235 ------ ..|192.0.2.5|.. 2236 | ..: --------- :.. 2237 ---------.: :.--------- 2238 ---------- | SFF1 | --------- | SFF3 | 2239 --> | |..|192.0.2.1|....| SFF6 |....|192.0.2.3| --> 2240 --> |Classifier| ---------: |192.0.2.6| :--------- 2241 | | : --------- : | 2242 ---------- : | : ------ 2243 : ------ : | SFI | 2244 :.. | SFIb | ..: |SFT=43| 2245 :.. |SFT=42| ..: ------ 2246 : ------ : 2247 :.---------.: 2248 | SFF7 | 2249 |192.0.2.7| 2250 --------- 2251 | 2252 ------ 2253 | SFIc | 2254 |SFT=42| 2255 ------ 2257 Figure 13: Second Example With Parallel End-to-End SFPs 2259 In this case, five SFIRs are advertised as follows: 2261 RD = 192.0.2.1/11, SFT = 41 2262 RD = 192.0.2.5/11, SFT = 42 (for SFIa) 2263 RD = 192.0.2.6/11, SFT = 42 (for SFIb) 2264 RD = 192.0.2.7/11, SFT = 42 (for SFIc) 2265 RD = 192.0.2.3/11, SFT = 43 2267 In this case the controller could specify three forward SFPs with 2268 their corresponding associated reverse SFPs. Each bidirectional pair 2269 of SFPs uses a different SFF and SFI for middle hop (for an SF of 2270 type 42). The controller can instruct the Classifier how to place 2271 traffic on the three bidirectional SFPs, or can treat them as a group 2272 leaving the Classifier responsible for balancing the load. 2274 SFP20: RD = 198.51.100.1/120, SPI = 34, 2275 Assoc-Type = 1, Assoc-RD = 198.51.100.1/123, Assoc-SPI = 37, 2276 [SI = 255, SFT = 41, RD = 192.0.2.1/11], 2277 [SI = 254, SFT = 42, RD = 192.0.2.5/11], 2278 [SI = 253, SFT = 43, RD = 192.0.2.3/11] 2280 SFP21: RD = 198.51.100.1/121, SPI = 35, 2281 Assoc-Type = 1, Assoc-RD = 198.51.100.1/124, Assoc-SPI = 38, 2282 [SI = 255, SFT = 41, RD = 192.0.2.1/11], 2283 [SI = 254, SFT = 42, RD = 192.0.2.6/11], 2284 [SI = 253, SFT = 43, RD = 192.0.2.3/11] 2286 SFP22: RD = 198.51.100.1/122, SPI = 36, 2287 Assoc-Type = 1, Assoc-RD = 198.51.100.1/125, Assoc-SPI = 39, 2288 [SI = 255, SFT = 41, RD = 192.0.2.1/11], 2289 [SI = 254, SFT = 42, RD = 192.0.2.7/11], 2290 [SI = 253, SFT = 43, RD = 192.0.2.3/11] 2292 SFP23: RD = 198.51.100.1/123, SPI = 37, 2293 Assoc-Type = 1, Assoc-RD = 198.51.100.1/120, Assoc-SPI = 34, 2294 [SI = 255, SFT = 43, RD = 192.0.2.3/11], 2295 [SI = 254, SFT = 42, RD = 192.0.2.5/11], 2296 [SI = 253, SFT = 41, RD = 192.0.2.1/11] 2298 SFP24: RD = 198.51.100.1/124, SPI = 38, 2299 Assoc-Type = 1, Assoc-RD = 198.51.100.1/121, Assoc-SPI = 35, 2300 [SI = 255, SFT = 43, RD = 192.0.2.3/11], 2301 [SI = 254, SFT = 42, RD = 192.0.2.6/11], 2302 [SI = 253, SFT = 41, RD = 192.0.2.1/11] 2304 SFP25: RD = 198.51.100.1/125, SPI = 39, 2305 Assoc-Type = 1, Assoc-RD = 198.51.100.1/122, Assoc-SPI = 36, 2306 [SI = 255, SFT = 43, RD = 192.0.2.3/11], 2307 [SI = 254, SFT = 42, RD = 192.0.2.7/11], 2308 [SI = 253, SFT = 41, RD = 192.0.2.1/11] 2310 8.9.4. Parallel SFPs Downstream of the Choice 2312 The mechanism of parallel SFPs demonstrated in Section 8.9.3 is 2313 perfectly functional and may be practical in many environments. 2314 However, there may be scaling concerns because of the large amount of 2315 state (knowledge of SFPs, i.e., SFPR advertisements retained) if 2316 there is a very large amount of choice of SFIs (for example, tens of 2317 instances of the same stateful SF), or if there are multiple choices 2318 of stateful SF along a path. This situation may be mitigated using 2319 SFP fragments that are combined to form the end to end SFPs. 2321 The example presented here is necessarily simplistic, but should 2322 convey the basic principle. The example presented in Figure 14 is 2323 similar to that in Section 8.9.3 but with an additional first hop. 2325 ------ 2326 | SFIa | 2327 |SFT=43| 2328 ------ 2329 ------ ------ | 2330 | SFI | | SFI | --------- 2331 |SFT=41| |SFT=42| | SFF5 | 2332 ------ ------ ..|192.0.2.5|.. 2333 | | ..: --------- :.. 2334 --------- ---------.: :.--------- 2335 ------ | SFF1 | | SFF2 | --------- | SFF3 | 2336 -->|Class-|.|192.0.2.1|.|192.0.2.2|....| SFF6 |....|192.0.2.3|--> 2337 -->| ifier| --------- ---------: |192.0.2.6| :--------- 2338 ------ : --------- : | 2339 : | : ------ 2340 : ------ : | SFI | 2341 :.. | SFIb | ..: |SFT=44| 2342 :.. |SFT=43| ..: ------ 2343 : ------ : 2344 :.---------.: 2345 | SFF7 | 2346 |192.0.2.7| 2347 --------- 2348 | 2349 ------ 2350 | SFIc | 2351 |SFT=43| 2352 ------ 2354 Figure 14: Example With Parallel SFPs Downstream of Choice 2356 The six SFIs are advertised as follows: 2358 RD = 192.0.2.1/11, SFT = 41 2359 RD = 192.0.2.2/11, SFT = 42 2360 RD = 192.0.2.5/11, SFT = 43 (for SFIa) 2361 RD = 192.0.2.6/11, SFT = 43 (for SFIb) 2362 RD = 192.0.2.7/11, SFT = 43 (for SFIc) 2363 RD = 192.0.2.3/11, SFT = 44 2365 SFF2 is the point at which a load balancing choice must be made. So 2366 "tail-end" SFPs are constructed as follows. Each takes in a 2367 different SFF that provides access to an SF of type 43. 2369 SFP26: RD = 198.51.100.1/126, SPI = 40, 2370 Assoc-Type = 1, Assoc-RD = 198.51.100.1/130, Assoc-SPI = 44, 2371 [SI = 255, SFT = 43, RD = 192.0.2.5/11], 2372 [SI = 254, SFT = 44, RD = 192.0.2.3/11] 2374 SFP27: RD = 198.51.100.1/127, SPI = 41, 2375 Assoc-Type = 1, Assoc-RD = 198.51.100.1/131, Assoc-SPI = 45, 2376 [SI = 255, SFT = 43, RD = 192.0.2.6/11], 2377 [SI = 254, SFT = 44, RD = 192.0.2.3/11] 2379 SFP28: RD = 198.51.100.1/128, SPI = 42, 2380 Assoc-Type = 1, Assoc-RD = 198.51.100.1/132, Assoc-SPI = 46, 2381 [SI = 255, SFT = 43, RD = 192.0.2.7/11], 2382 [SI = 254, SFT = 44, RD = 192.0.2.3/11] 2384 Now an end-to-end SFP with load balancing choice can be constructed 2385 as follows. The choice made by SFF2 is expressed in terms of 2386 entering one of the three "tail end" SFPs. 2388 SFP29: RD = 198.51.100.1/129, SPI = 43, 2389 [SI = 255, SFT = 41, RD = 192.0.2.1/11], 2390 [SI = 254, SFT = 42, RD = 192.0.2.2/11], 2391 [SI = 253, {SFT = 1, RD = {SPI=40, SI=255, Rsv=0}, 2392 RD = {SPI=41, SI=255, Rsv=0}, 2393 RD = {SPI=42, SI=255, Rsv=0} } ] 2395 Now, despite the load balancing choice being made other than at the 2396 initial Classifier, it is possible for the reverse SFPs to be well- 2397 constructed without any ambiguity. The three reverse paths appear as 2398 follows. 2400 SFP30: RD = 198.51.100.1/130, SPI = 44, 2401 Assoc-Type = 1, Assoc-RD = 198.51.100.1/126, Assoc-SPI = 40, 2402 [SI = 255, SFT = 44, RD = 192.0.2.4/11], 2403 [SI = 254, SFT = 43, RD = 192.0.2.5/11], 2404 [SI = 253, SFT = 42, RD = 192.0.2.2/11], 2405 [SI = 252, SFT = 41, RD = 192.0.2.1/11] 2407 SFP31: RD = 198.51.100.1/131, SPI = 45, 2408 Assoc-Type = 1, Assoc-RD = 198.51.100.1/127, Assoc-SPI = 41, 2409 [SI = 255, SFT = 44, RD = 192.0.2.4/11], 2410 [SI = 254, SFT = 43, RD = 192.0.2.6/11], 2411 [SI = 253, SFT = 42, RD = 192.0.2.2/11], 2412 [SI = 252, SFT = 41, RD = 192.0.2.1/11] 2414 SFP32: RD = 198.51.100.1/132, SPI = 46, 2415 Assoc-Type = 1, Assoc-RD = 198.51.100.1/128, Assoc-SPI = 42, 2416 [SI = 255, SFT = 44, RD = 192.0.2.4/11], 2417 [SI = 254, SFT = 43, RD = 192.0.2.7/11], 2418 [SI = 253, SFT = 42, RD = 192.0.2.2/11], 2419 [SI = 252, SFT = 41, RD = 192.0.2.1/11] 2421 8.10. Examples Using IPv6 Addressing 2423 This section provides several examples using IPv6 addressing. As 2424 will be seen from the examples, there is nothing special or clever 2425 about using IPv6 addressing rather than IPv4 addressing. 2427 The reference network for these IPv6 examples is based on that 2428 described at the top of Section 8 and shown in Figure 11. 2430 Assume we have a service function overlay network with four SFFs 2431 (SFF1, SFF3, SFF3, and SFF4). The SFFs have addresses in the 2432 underlay network as follows: 2434 SFF1 2001:db8::192:0:2:1 2435 SFF2 2001:db8::192:0:2:2 2436 SFF3 2001:db8::192:0:2:3 2437 SFF4 2001:db8::192:0:2:4 2439 Each SFF provides access to some SFIs from the four Service Function 2440 Types SFT=41, SFT=42, SFT=43, and SFT=44 just as before: 2442 SFF1 SFT=41 and SFT=42 2443 SFF2 SFT=41 and SFT=43 2444 SFF3 SFT=42 and SFT=44 2445 SFF4 SFT=43 and SFT=44 2447 The service function network also contains a Controller with address 2448 2001:db8::198:51:100:1. 2450 This example service function overlay network is shown in Figure 15. 2452 ------------------------ 2453 | Controller | 2454 | 2001:db8::198:51:100:1 | 2455 ------------------------ 2456 ------ ------ ------ ------ 2457 | SFI | | SFI | | SFI | | SFI | 2458 |SFT=41| |SFT=42| |SFT=41| |SFT=43| 2459 ------ ------ ------ ------ 2460 \ / \ / 2461 ------------------- ------------------- 2462 | SFF1 | | SFF2 | 2463 |2001:db8::192:0:2:1| |2001:db8::192:0:2:2| 2464 ------------------- ------------------- 2465 ---------- 2466 Packet --> | | --> 2467 Flows --> |Classifier| -->Dest 2468 | | --> 2469 ---------- 2470 ------------------- ------------------- 2471 | SFF3 | | SFF4 | 2472 |2001:db8::192:0:2:3| |2001:db8::192:0:2:4| 2473 ------------------- ------------------- 2474 / \ / \ 2475 ------ ------ ------ ------ 2476 | SFI | | SFI | | SFI | | SFI | 2477 |SFT=42| |SFT=44| |SFT=43| |SFT=44| 2478 ------ ------ ------ ------ 2480 Figure 15: Example Service Function Overlay Network 2482 The SFFs advertise routes to the SFIs they support. These 2483 advertisements contain Route Distinguishers that are set according to 2484 the network operator's configuration model. Note that in an IPv6 2485 network, the RD is not large enough to contain the full IPv6 address 2486 as only six octets are available so, in all of these IPv6 examples, 2487 we use RDs of type 2 such that the available six octets are 2488 partitioned as four octets for an IPv4 address of the advertising 2489 SFF, and two octets that are a local index of the SFI. Furthermore, 2490 we have chosen an IPv6 addressing scheme so that the low order four 2491 octets of the IPv6 address match an IPv4 address of the advertising 2492 node. This scheme is chosen purely for convenience of documentation, 2493 and an operator is totally free to use any other scheme so long as it 2494 conforms to the definitions of SFIR and SFPR in Section 3.1 and 2495 Section 3.2. 2497 Observant readers will notice that this makes the BGP advertisements 2498 shown in these examples exactly the same as in the previous examples. 2499 All that is different is that the advertising SFFs and Controller 2500 have IPv6 addresses. 2502 Thus we see the following SFIRs advertised: 2504 The SFFs advertise routes to the SFIs they support. So we see the 2505 following SFIRs: 2507 RD = 192.0.2.1/1, SFT = 41 2508 RD = 192.0.2.1/2, SFT = 42 2509 RD = 192.0.2.2/1, SFT = 41 2510 RD = 192.0.2.2/2, SFT = 43 2511 RD = 192.0.2.3/7, SFT = 42 2512 RD = 192.0.2.3/8, SFT = 44 2513 RD = 192.0.2.4/5, SFT = 43 2514 RD = 192.0.2.4/6, SFT = 44 2516 Note that the addressing used for communicating between SFFs is taken 2517 from the Tunnel Encapsulation attribute of the SFIR and not from the 2518 SFIR-RD. 2520 8.10.1. Example Explicit SFP With No Choices 2522 Consider the following SFPR similar to that in Section 8.1. 2524 SFP1: RD = 198.51.100.1/101, SPI = 15, 2525 [SI = 255, SFT = 41, RD = 192.0.2.1/1], 2526 [SI = 250, SFT = 43, RD = 192.0.2.2/2] 2528 The Service Function Path consists of an SF of type 41 located at 2529 SFF1 followed by an SF of type 43 located at SFF2. This path is 2530 fully explicit and each SFF is offered no choice in forwarding packet 2531 along the path. 2533 SFF1 will receive packets on the path from the Classifier and will 2534 identify the path from the SPI (15). The initial SI will be 255 and 2535 so SFF1 will deliver the packets to the SFI for SFT 41. 2537 When the packets are returned to SFF1 by the SFI the SI will be 2538 decreased to 250 for the next hop. SFF1 has no flexibility in the 2539 choice of SFF to support the next hop SFI and will forward the packet 2540 to SFF2 which will send the packets to the SFI that supports SFT 43 2541 before forwarding the packets to their destinations. 2543 8.10.2. Example SFP With Choice of SFIs 2545 SFP2: RD = 198.51.100.1/102, SPI = 16, 2546 [SI = 255, SFT = 41, RD = 192.0.2.1/1], 2547 [SI = 250, SFT = 43, {RD = 192.0.2.2/2, 2548 RD = 192.0.2.4/5 } ] 2550 In this example, like that in Section 8.2, the path also consists of 2551 an SF of type 41 located at SFF1 and this is followed by an SF of 2552 type 43, but in this case the SI = 250 contains a choice between the 2553 SFI located at SFF2 and the SFI located at SFF4. 2555 SFF1 will receive packets on the path from the Classifier and will 2556 identify the path from the SPI (16). The initial SI will be 255 and 2557 so SFF1 will deliver the packets to the SFI for SFT 41. 2559 When the packets are returned to SFF1 by the SFI the SI will be 2560 decreased to 250 for the next hop. SFF1 now has a choice of next hop 2561 SFF to execute the next hop in the path. It can either forward 2562 packets to SFF2 or SFF4 to execute a function of type 43. It uses 2563 its local load balancing algorithm to make this choice. The chosen 2564 SFF will send the packets to the SFI that supports SFT 43 before 2565 forwarding the packets to their destinations. 2567 8.10.3. Example SFP With Open Choice of SFIs 2569 SFP3: RD = 198.51.100.1/103, SPI = 17, 2570 [SI = 255, SFT = 41, RD = 192.0.2.1/1], 2571 [SI = 250, SFT = 44, RD = 0] 2573 In this example, like that in Section 8.3 the path also consists of 2574 an SF of type 41 located at SFF1 and this is followed by an SI with 2575 an RD of zero and SF of type 44. This means that a choice can be 2576 made between any SFF that supports an SFI of type 44. 2578 SFF1 will receive packets on the path from the Classifier and will 2579 identify the path from the SPI (17). The initial SI will be 255 and 2580 so SFF1 will deliver the packets to the SFI for SFT 41. 2582 When the packets are returned to SFF1 by the SFI the SI will be 2583 decreased to 250 for the next hop. SFF1 now has a free choice of 2584 next hop SFF to execute the next hop in the path selecting between 2585 all SFFs that support SFs of type 44. Looking at the SFIRs it has 2586 received, SFF1 knows that SF type 44 is supported by SFF3 and SFF4. 2587 SFF1 uses its local load balancing algorithm to make this choice. 2588 The chosen SFF will send the packets to the SFI that supports SFT 44 2589 before forwarding the packets to their destinations. 2591 8.10.4. Example SFP With Choice of SFTs 2593 SFP4: RD = 198.51.100.1/104, SPI = 18, 2594 [SI = 255, SFT = 41, RD = 192.0.2.1/1], 2595 [SI = 250, {SFT = 43, RD = 192.0.2.2/2, 2596 SFT = 44, RD = 192.0.2.3/8 } ] 2598 This example, similar to that in Section 8.4 provides a choice of SF 2599 type in the second hop in the path. The SI of 250 indicates a choice 2600 between SF type 43 located through SF2 and SF type 44 located at SF3. 2602 SFF1 will receive packets on the path from the Classifier and will 2603 identify the path from the SPI (18). The initial SI will be 255 and 2604 so SFF1 will deliver the packets to the SFI for SFT 41. 2606 When the packets are returned to SFF1 by the SFI the SI will be 2607 decreased to 250 for the next hop. SFF1 now has a free choice of 2608 next hop SFF to execute the next hop in the path selecting between 2609 all SFFs that support an SF of type 43 and SFF3 that supports an SF 2610 of type 44. These may be completely different functions that are to 2611 be executed dependent on specific conditions, or may be similar 2612 functions identified with different type identifiers (such as 2613 firewalls from different vendors). SFF1 uses its local policy and 2614 load balancing algorithm to make this choice, and may use additional 2615 information passed back from the local SFI to help inform its 2616 selection. The chosen SFF will send the packets to the SFI that 2617 supports the chose SFT before forwarding the packets to their 2618 destinations. 2620 9. Security Considerations 2622 The mechanisms in this document use BGP for the control plane. 2623 Hence, techniques such as those discussed in [RFC5925]] can be used 2624 to help authenticate BGP sessions and thus the messages between BGP 2625 peers, making it harder to spoof updates (which could be used to 2626 install bogus SFPs or to advertise false SIs) or withdrawals. 2628 Further discussion of security considerations for BGP may be found in 2629 the BGP specification itself [RFC4271] and in the security analysis 2630 for BGP [RFC4272]. The original discussion of the use of the TCP MD5 2631 signature option to protect BGP sessions is found in [RFC5925], while 2632 [RFC6952] includes an analysis of BGP keying and authentication 2633 issues. 2635 Additionally, this document depends on other documents that specify 2636 BGP Multiprotocol Extensions and the documents that define the 2637 attributes that are carried by BGP UPDATEs of the SFC AFI/SAFI. 2638 [RFC4760] observes that the use of AFI/SAFI does not change the 2639 underlying security issues inherent in the existing BGP. Relevant 2640 additional security measures are considered in 2641 [I-D.ietf-idr-tunnel-encaps]. 2643 This document does not fundamentally change the security behavior of 2644 BGP deployments, which depend considerably on the network operator's 2645 perception of risk in their network. It may be observed that the 2646 application of the mechanisms described in this document are scoped 2647 to a single domain as implied by [RFC8300] noted in Section 2.1 of 2648 this document. Applicability of BGP within a single domain may 2649 enable a network operator to make easier and more consistent 2650 decisions about what security measures to apply, and the domain 2651 boundary, which BGP enforces by definition, provides a safeguard that 2652 prevents leakage of SFC programming in either direction at the 2653 boundary. 2655 Service Function Chaining provides a significant attack opportunity: 2656 packets can be diverted from their normal paths through the network, 2657 packets can be made to execute unexpected functions, and the 2658 functions that are instantiated in software can be subverted. 2659 However, this specification does not change the existence of Service 2660 Function Chaining and security issues specific to Service Function 2661 Chaining are covered in [RFC7665] and [RFC8300]. 2663 This document defines a control plane for Service Function Chaining. 2664 Clearly, this provides an attack vector for a Service Function 2665 Chaining system as an attack on this control plane could be used to 2666 make the system misbehave. Thus, the security of the BGP system is 2667 critically important to the security of the whole Service Function 2668 Chaining system. The control plane mechanisms are very similar to 2669 those used for BGP/MPLS IP VPNs as described in [RFC4364], and so the 2670 security considerations in that document (Section 13) provide good 2671 guidance for securing SFC systems reliant on this specification. Of 2672 particular relevance is the need to securely distinguish between 2673 messages intended for the control of different SFC overlays which is 2674 similar to the need to distinguish between different VPNs. 2675 Section 19 of [RFC7432] also provides useful guidance on the use of 2676 BGP in a similar environment. 2678 Note that a component of an SFC system that uses the procedures 2679 described in this document also requires communications between a 2680 Controller and the SFC network elements (specifically the SFFs and 2681 Classifiers). This communication covers instructing the Classifiers 2682 using BGP mechanisms (see Section 7.4), thus the use of BGP security 2683 is strongly recommended. But it also covers other mechanisms for 2684 programming the Classifier and instructing the SFFs and SFs (for 2685 example, to bind SFs to an SFF, and to cause the establishment of 2686 tunnels between SFFs). This document does not cover these latter 2687 mechanisms and so their security is out of scope, but it should be 2688 noted that these communications provide an attack vector on the SFC 2689 system and so attention must be paid to ensuring that they are 2690 secure. 2692 There is an intrinsic assumption in SFC systems that nodes that 2693 announce support for specific SFs actually offer those functions, and 2694 that SFs are not, themselves, attacked or subverted. This is 2695 particularly important when the SFs are implemented as software that 2696 can be updated. Protection against this sort of concern forms part 2697 of the security of any SFC system and so is outside the scope of the 2698 control plane mechanisms described in this document. 2700 Similarly, there is a vulnerability if a rogue or subverted 2701 Controller announces SFPs especially if that controller "takes over" 2702 an existing SFP and changes its contents. This is corresponds to a 2703 rogue BGP speaker entering a routing system, or even to a Route 2704 Reflector becoming subverted. Protection mechanisms, as above, 2705 include securing BGP sessions and protecting software loads on the 2706 controllers. 2708 In an environment where there is concern that rogue Controllers might 2709 be introduced to the network and inject false SFPRs or take over and 2710 change existing SFPRs, it is RECOMMENDED that each SFF and Classifier 2711 be configured with the identities of authorized Controllers. Thus, 2712 the announcement of an SFPR by any other BGP peer would be rejected. 2714 Lastly, note that Section 3.2.2 makes two operational suggestions 2715 that have implications for the stability and security of the 2716 mechanisms described in this document: 2718 o That modifications to active SFPs not be made. 2720 o That SPIs not be immediately re-used. 2722 10. IANA Considerations 2724 10.1. New BGP AF/SAFI 2726 IANA maintains a registry of "Address Family Numbers". IANA is 2727 requested to assign a new Address Family Number from the "Standards 2728 Action" range called "BGP SFC" (TBD1 in this document) with this 2729 document as a reference. 2731 IANA maintains a registry of "Subsequent Address Family Identifiers 2732 (SAFI) Parameters". IANA is requested to assign a new SAFI value 2733 from the "Standards Action" range called "BGP SFC" (TBD2 in this 2734 document) with this document as a reference. 2736 10.2. New BGP Path Attribute 2738 IANA maintains a registry of "Border Gateway Protocol (BGP) 2739 Parameters" with a subregistry of "BGP Path Attributes". IANA is 2740 requested to assign a new Path attribute called "SFP attribute" (TBD3 2741 in this document) with this document as a reference. 2743 10.3. New SFP Attribute TLVs Type Registry 2745 IANA maintains a registry of "Border Gateway Protocol (BGP) 2746 Parameters". IANA is request to create a new subregistry called the 2747 "SFP Attribute TLVs" registry. 2749 Valid values are in the range 0 to 65535. 2751 o Values 0 and 65535 are to be marked "Reserved, not to be 2752 allocated". 2754 o Values 1 through 65534 are to be assigned according to the "First 2755 Come First Served" policy [RFC8126]. 2757 This document should be given as a reference for this registry. 2759 The new registry should track: 2761 o Type 2762 o Name 2764 o Reference Document or Contact 2766 o Registration Date 2768 The registry should initially be populated as follows: 2770 Type | Name | Reference | Date 2771 ------+-------------------------+---------------+--------------- 2772 1 | Association TLV | [This.I-D] | Date-to-be-set 2773 2 | Hop TLV | [This.I-D] | Date-to-be-set 2774 3 | SFT TLV | [This.I-D] | Date-to-be-set 2775 4 | MPLS Swapping/Stacking | [This.I-D] | Date-to-be-set 2776 5 | SFP Traversal With MPLS | [This.I-D] | Date-to-be-set 2778 10.4. New SFP Association Type Registry 2780 IANA maintains a registry of "Border Gateway Protocol (BGP) 2781 Parameters". IANA is request to create a new subregistry called the 2782 "SFP Association Type" registry. 2784 Valid values are in the range 0 to 65535. 2786 o Values 0 and 65535 are to be marked "Reserved, not to be 2787 allocated". 2789 o Values 1 through 65534 are to be assigned according to the "First 2790 Come First Served" policy [RFC8126]. 2792 This document should be given as a reference for this registry. 2794 The new registry should track: 2796 o Association Type 2798 o Name 2800 o Reference Document or Contact 2802 o Registration Date 2804 The registry should initially be populated as follows: 2806 Association Type | Name | Reference | Date 2807 -----------------+--------------------+------------+--------------- 2808 1 | Bidirectional SFP | [This.I-D] | Date-to-be-set 2810 10.5. New Service Function Type Registry 2812 IANA is request to create a new top-level registry called "Service 2813 Function Chaining Service Function Types". 2815 Valid values are in the range 0 to 65535. 2817 o Values 0 and 65535 are to be marked "Reserved, not to be 2818 allocated". 2820 o Values 1 through 31 are to be assigned by "Standards Action" 2821 [RFC8126] and are referred to as the Special Purpose SFT values. 2823 o Values 32 through 64495 are to be assigned according to the "First 2824 Come First Served" policy [RFC8126]. 2826 o Values 64496 through 65534 are for Private Use and are not to be 2827 recorded by IANA. 2829 This document should be given as a reference for this registry. 2831 The new registry should track: 2833 o Value 2835 o Name 2837 o Reference Document or Contact 2839 o Registration Date 2841 The registry should initially be populated as follows where 2842 [I-D.darwa] should be expanded to 2843 [I-D.dawra-idr-bgp-ls-sr-service-segments]. 2845 Value | Name | Reference | Date 2846 ------+-------------------------+------------+--------------- 2847 0 | Reserved, not to be | [This.I-D] | Date-to-be-set 2848 | allocated | | 2849 1 | Change Sequence | [This.I-D] | Date-to-be-set 2850 2-31 | Unassigned | | 2851 32 | Classifier | [This.I-D] | Date-to-be-set 2852 | | [I-D.dawra]| 2853 33 | Firewall | [This.I-D] | Date-to-be-set 2854 | | [I-D.dawra]| 2855 34 | Load balancer | [This.I-D] | Date-to-be-set 2856 | | [I-D.dawra]| 2857 35 | Deep packet inspection | [This.I-D] | Date-to-be-set 2858 | engine | [I-D.dawra]| 2859 36 | Penalty box | [This.I-D] | Date-to-be-set 2860 | | [RFC8300] | 2861 37 | WAN accelerator | [This.I-D] | Date-to-be-set 2862 | | [RFC7665] | 2863 | | [RFC8300] | 2864 38 | Application accelerator | [This.I-D] | Date-to-be-set 2865 | | [RFC7665] | 2866 39 | TCP optimizer | [This.I-D] | Date-to-be-set 2867 | | [RFC7665] | 2868 40 | Network Address | [This.I-D] | Date-to-be-set 2869 | Translator | [RFC7665] | 2870 41 | NAT44 | [This.I-D] | Date-to-be-set 2871 | | [RFC7665] | 2872 | | [RFC3022] | 2873 42 | NAT64 | [This.I-D] | Date-to-be-set 2874 | | [RFC7665] | 2875 | | [RFC6146] | 2876 43 | NPTv6 | [This.I-D] | Date-to-be-set 2877 | | [RFC7665] | 2878 | | [RFC6296] | 2879 44 | Lawful intercept | [This.I-D] | Date-to-be-set 2880 | | [RFC7665] | 2881 45 | HOST_ID injection | [This.I-D] | Date-to-be-set 2882 | | [RFC7665] | 2883 46 | HTTP header enrichment | [This.I-D] | Date-to-be-set 2884 | | [RFC7665] | 2885 47 | Caching engine | [This.I-D] | Date-to-be-set 2886 | | [RFC7665] | 2887 48- | | | 2888 -65534|Unassigned | | 2889 65535 | Reserved, not to be | | 2890 | allocated | [This.I-D] | Date-to-be-set 2892 10.6. New Generic Transitive Experimental Use Extended Community Sub- 2893 Types 2895 IANA maintains a registry of "Border Gateway Protocol (BGP) 2896 Parameters" with a subregistry of "Generic Transitive Experimental 2897 Use Extended Community Sub-Type". IANA is requested to assign a new 2898 sub-type as follows: 2900 "Flow Specification for SFC Classifiers" (TBD4 in this document) 2901 with this document as the reference. 2903 10.7. New BGP Transitive Extended Community Type 2905 IANA maintains a registry of "Border Gateway Protocol (BGP) 2906 Parameters" with a subregistry of "BGP Transitive Extended Community 2907 Types". IANA is requested to assign a new type as follows: 2909 o SFC (Sub-Types are defined in the "SFC Extended Community Sub- 2910 Types" registry) (TBD6 in this document) with this document as the 2911 reference. 2913 10.8. New SFC Extended Community Sub-Types Registry 2915 IANA maintains a registry of "Border Gateway Protocol (BGP) 2916 Parameters". IANA is requested to create a new sub-registry called 2917 the "SFC Extended Community Sub-Types Registry". 2919 IANA should include the following note replacing the string "TBD6" 2920 with the value assigned for Section 10.7: 2922 This registry contains values of the second octet (the "Sub-Type" 2923 field) of an extended community when the value of the first octet 2924 (the "Type" field) is set to TBD6. 2926 The allocation policy for this registry should be First Come First 2927 Served. 2929 Valid values are 0 to 255. The value 0 is reserved and should not be 2930 allocated. 2932 IANA is requested to populate this registry with the following 2933 entries: 2935 Sub-Type | | | 2936 Value | Name | Reference | Date 2937 ---------+----------------------+-------------+--------------- 2938 0 | Reserved, not to be | | 2939 | allocated | | 2940 1 | SFIR Pool Identifier | [This.I-D] | Date-to-be-set 2941 2 | MPLS Label Stack | [This.I-D] | Date-to-be-set 2942 | Mixed Swapping/ | | 2943 | Stacking Labels | | 2944 3-255 | Unassigned | | 2946 All other values should be marked "Unassigned". 2948 10.9. SPI/SI Representation 2950 IANA is requested to assign a codepoint from the "BGP Tunnel 2951 Encapsulation Attribute Sub-TLVs" registry for the "SPI/SI 2952 Representation Sub-TLV" (TBD5 in this document) with this document 2953 being the reference. 2955 10.10. SFC SPI/SI Representation Flags Registry 2957 IANA maintains the "BGP Tunnel Encapsulation Attribute Sub-TLVs" 2958 registry and is requested to create an associated registry called the 2959 "SFC SPI/SI Representation Flags" registry. 2961 Bits are to be assigned by Standards Action. The field is 16 bits 2962 long, and bits are counted from the the most significant bit as bit 2963 zero. 2965 IANA is requested to populate the registry as follows: 2967 Bit number | Name | Reference 2968 -----------+----------------------+----------- 2969 TBD9 | NSH data plane | [This.I-D] 2970 TBD10 | MPLS data plane | [This.I-D] 2972 11. Contributors 2973 Stuart Mackie 2974 Juniper Networks 2976 Email: wsmackie@juinper.net 2978 Keyur Patel 2979 Arrcus, Inc. 2981 Email: keyur@arrcus.com 2983 Avinash Lingala 2984 AT&T 2986 Email: ar977m@att.com 2988 12. Acknowledgements 2990 Thanks to Tony Przygienda, Jeff Haas, and Andy Malis for helpful 2991 comments, and to Joel Halpern for discussions that improved this 2992 document. Yuanlong Jiang provided a useful review and caught some 2993 important issues. Stephane Litkowski did an exceptionally good and 2994 detailed document shepherd review. 2996 Andy Malis contributed text that formed the basis of Section 7.7. 2998 Brian Carpenter and Martin Vigoureux provided useful reviews during 2999 IETF last call. Thanks also to Sheng Jiang, Med Boucadair, Ravi 3000 Singh, Benjamin Kaduk, Roman Danyliw, Adam Roach, Alvaro Retana, 3001 Barry Leiba, and Murray Kucherawy for review comments. Ketan 3002 Talaulikar provided helpful discussion of the SFT code point 3003 registry, and Ron Bonica kept us honest on the difference between an 3004 RD and RT. 3006 13. References 3008 13.1. Normative References 3010 [I-D.ietf-idr-rfc5575bis] 3011 Loibl, C., Hares, S., Raszuk, R., McPherson, D., and M. 3012 Bacher, "Dissemination of Flow Specification Rules", 3013 draft-ietf-idr-rfc5575bis-26 (work in progress), August 3014 2020. 3016 [I-D.ietf-idr-tunnel-encaps] 3017 Patel, K., Velde, G., Sangli, S., and J. Scudder, "The BGP 3018 Tunnel Encapsulation Attribute", draft-ietf-idr-tunnel- 3019 encaps-17 (work in progress), July 2020. 3021 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 3022 Requirement Levels", BCP 14, RFC 2119, 3023 DOI 10.17487/RFC2119, March 1997, 3024 . 3026 [RFC4271] Rekhter, Y., Ed., Li, T., Ed., and S. Hares, Ed., "A 3027 Border Gateway Protocol 4 (BGP-4)", RFC 4271, 3028 DOI 10.17487/RFC4271, January 2006, 3029 . 3031 [RFC4360] Sangli, S., Tappan, D., and Y. Rekhter, "BGP Extended 3032 Communities Attribute", RFC 4360, DOI 10.17487/RFC4360, 3033 February 2006, . 3035 [RFC4364] Rosen, E. and Y. Rekhter, "BGP/MPLS IP Virtual Private 3036 Networks (VPNs)", RFC 4364, DOI 10.17487/RFC4364, February 3037 2006, . 3039 [RFC4760] Bates, T., Chandra, R., Katz, D., and Y. Rekhter, 3040 "Multiprotocol Extensions for BGP-4", RFC 4760, 3041 DOI 10.17487/RFC4760, January 2007, 3042 . 3044 [RFC7432] Sajassi, A., Ed., Aggarwal, R., Bitar, N., Isaac, A., 3045 Uttaro, J., Drake, J., and W. Henderickx, "BGP MPLS-Based 3046 Ethernet VPN", RFC 7432, DOI 10.17487/RFC7432, February 3047 2015, . 3049 [RFC7606] Chen, E., Ed., Scudder, J., Ed., Mohapatra, P., and K. 3050 Patel, "Revised Error Handling for BGP UPDATE Messages", 3051 RFC 7606, DOI 10.17487/RFC7606, August 2015, 3052 . 3054 [RFC7665] Halpern, J., Ed. and C. Pignataro, Ed., "Service Function 3055 Chaining (SFC) Architecture", RFC 7665, 3056 DOI 10.17487/RFC7665, October 2015, 3057 . 3059 [RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for 3060 Writing an IANA Considerations Section in RFCs", BCP 26, 3061 RFC 8126, DOI 10.17487/RFC8126, June 2017, 3062 . 3064 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 3065 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 3066 May 2017, . 3068 [RFC8300] Quinn, P., Ed., Elzur, U., Ed., and C. Pignataro, Ed., 3069 "Network Service Header (NSH)", RFC 8300, 3070 DOI 10.17487/RFC8300, January 2018, 3071 . 3073 [RFC8595] Farrel, A., Bryant, S., and J. Drake, "An MPLS-Based 3074 Forwarding Plane for Service Function Chaining", RFC 8595, 3075 DOI 10.17487/RFC8595, June 2019, 3076 . 3078 [RFC8596] Malis, A., Bryant, S., Halpern, J., and W. Henderickx, 3079 "MPLS Transport Encapsulation for the Service Function 3080 Chaining (SFC) Network Service Header (NSH)", RFC 8596, 3081 DOI 10.17487/RFC8596, June 2019, 3082 . 3084 13.2. Informative References 3086 [I-D.dawra-idr-bgp-ls-sr-service-segments] 3087 Dawra, G., Filsfils, C., Talaulikar, K., Clad, F., 3088 daniel.bernier@bell.ca, d., Uttaro, J., Decraene, B., 3089 Elmalky, H., Xu, X., Guichard, J., and C. Li, "BGP-LS 3090 Advertisement of Segment Routing Service Segments", draft- 3091 dawra-idr-bgp-ls-sr-service-segments-04 (work in 3092 progress), August 2020. 3094 [RFC3022] Srisuresh, P. and K. Egevang, "Traditional IP Network 3095 Address Translator (Traditional NAT)", RFC 3022, 3096 DOI 10.17487/RFC3022, January 2001, 3097 . 3099 [RFC4272] Murphy, S., "BGP Security Vulnerabilities Analysis", 3100 RFC 4272, DOI 10.17487/RFC4272, January 2006, 3101 . 3103 [RFC5925] Touch, J., Mankin, A., and R. Bonica, "The TCP 3104 Authentication Option", RFC 5925, DOI 10.17487/RFC5925, 3105 June 2010, . 3107 [RFC6146] Bagnulo, M., Matthews, P., and I. van Beijnum, "Stateful 3108 NAT64: Network Address and Protocol Translation from IPv6 3109 Clients to IPv4 Servers", RFC 6146, DOI 10.17487/RFC6146, 3110 April 2011, . 3112 [RFC6296] Wasserman, M. and F. Baker, "IPv6-to-IPv6 Network Prefix 3113 Translation", RFC 6296, DOI 10.17487/RFC6296, June 2011, 3114 . 3116 [RFC6952] Jethanandani, M., Patel, K., and L. Zheng, "Analysis of 3117 BGP, LDP, PCEP, and MSDP Issues According to the Keying 3118 and Authentication for Routing Protocols (KARP) Design 3119 Guide", RFC 6952, DOI 10.17487/RFC6952, May 2013, 3120 . 3122 [RFC7498] Quinn, P., Ed. and T. Nadeau, Ed., "Problem Statement for 3123 Service Function Chaining", RFC 7498, 3124 DOI 10.17487/RFC7498, April 2015, 3125 . 3127 Authors' Addresses 3129 Adrian Farrel 3130 Old Dog Consulting 3132 Email: adrian@olddog.co.uk 3134 John Drake 3135 Juniper Networks 3137 Email: jdrake@juniper.net 3139 Eric Rosen 3140 Juniper Networks 3142 Email: erosen52@gmail.com 3144 Jim Uttaro 3145 AT&T 3147 Email: ju1738@att.com 3149 Luay Jalil 3150 Verizon 3152 Email: luay.jalil@verizon.com