idnits 2.17.1 draft-ietf-bess-nsh-bgp-control-plane-12.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 : ---------------------------------------------------------------------------- -- The document has examples using IPv4 documentation addresses according to RFC6890, but does not use any IPv6 documentation addresses. Maybe there should be IPv6 examples, too? Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (August 20, 2019) is 1704 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 556, but not defined == Missing Reference: 'SI' is mentioned on line 556, but not defined == Outdated reference: A later version (-27) exists of draft-ietf-idr-rfc5575bis-17 == Outdated reference: A later version (-22) exists of draft-ietf-idr-tunnel-encaps-13 ** Obsolete normative reference: RFC 5575 (Obsoleted by RFC 8955) ** Downref: Normative reference to an Informational RFC: RFC 7665 ** Downref: Normative reference to an Informational RFC: RFC 8596 Summary: 3 errors (**), 0 flaws (~~), 5 warnings (==), 2 comments (--). 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 21, 2020 E. Rosen 6 Juniper Networks 7 J. Uttaro 8 AT&T 9 L. Jalil 10 Verizon 11 August 20, 2019 13 BGP Control Plane for NSH SFC 14 draft-ietf-bess-nsh-bgp-control-plane-12 16 Abstract 18 This document describes the use of BGP as a control plane for 19 networks that support Service Function Chaining (SFC). The document 20 introduces a new BGP address family called the SFC AFI/SAFI with two 21 route types. One route type is originated by a node to advertise 22 that it hosts a particular instance of a specified service function. 23 This route type also provides "instructions" on how to send a packet 24 to the hosting node in a way that indicates that the service function 25 has to be applied to the packet. The other route type is used by a 26 Controller to advertise the paths of "chains" of service functions, 27 and to give a unique designator to each such path so that they can be 28 used in conjunction with the Network Service Header defined in RFC 29 8300. 31 This document adopts the SFC architecture described in RFC 7665. 33 Status of This Memo 35 This Internet-Draft is submitted in full conformance with the 36 provisions of BCP 78 and BCP 79. 38 Internet-Drafts are working documents of the Internet Engineering 39 Task Force (IETF). Note that other groups may also distribute 40 working documents as Internet-Drafts. The list of current Internet- 41 Drafts is at https://datatracker.ietf.org/drafts/current/. 43 Internet-Drafts are draft documents valid for a maximum of six months 44 and may be updated, replaced, or obsoleted by other documents at any 45 time. It is inappropriate to use Internet-Drafts as reference 46 material or to cite them other than as "work in progress." 48 This Internet-Draft will expire on February 21, 2020. 50 Copyright Notice 52 Copyright (c) 2019 IETF Trust and the persons identified as the 53 document authors. All rights reserved. 55 This document is subject to BCP 78 and the IETF Trust's Legal 56 Provisions Relating to IETF Documents 57 (https://trustee.ietf.org/license-info) in effect on the date of 58 publication of this document. Please review these documents 59 carefully, as they describe your rights and restrictions with respect 60 to this document. Code Components extracted from this document must 61 include Simplified BSD License text as described in Section 4.e of 62 the Trust Legal Provisions and are provided without warranty as 63 described in the Simplified BSD License. 65 Table of Contents 67 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 68 1.1. Requirements Language . . . . . . . . . . . . . . . . . . 4 69 1.2. Terminology . . . . . . . . . . . . . . . . . . . . . . . 5 70 2. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 6 71 2.1. Overview of Service Function Chaining . . . . . . . . . . 6 72 2.2. Control Plane Overview . . . . . . . . . . . . . . . . . 7 73 3. BGP SFC Routes . . . . . . . . . . . . . . . . . . . . . . . 11 74 3.1. Service Function Instance Route (SFIR) . . . . . . . . . 12 75 3.1.1. SFI Pool Identifier Extended Community . . . . . . . 13 76 3.1.2. MPLS Mixed Swapping/Stacking Extended Community . . . 14 77 3.2. Service Function Path Route (SFPR) . . . . . . . . . . . 14 78 3.2.1. The SFP Attribute . . . . . . . . . . . . . . . . . . 15 79 3.2.2. General Rules For The SFP Attribute . . . . . . . . . 21 80 4. Mode of Operation . . . . . . . . . . . . . . . . . . . . . . 22 81 4.1. Route Targets . . . . . . . . . . . . . . . . . . . . . . 22 82 4.2. Service Function Instance Routes . . . . . . . . . . . . 22 83 4.3. Service Function Path Routes . . . . . . . . . . . . . . 22 84 4.4. Classifier Operation . . . . . . . . . . . . . . . . . . 24 85 4.5. Service Function Forwarder Operation . . . . . . . . . . 25 86 4.5.1. Processing With 'Gaps' in the SI Sequence . . . . . . 26 87 5. Selection within Service Function Paths . . . . . . . . . . . 27 88 6. Looping, Jumping, and Branching . . . . . . . . . . . . . . . 29 89 6.1. Protocol Control of Looping, Jumping, and Branching . . . 29 90 6.2. Implications for Forwarding State . . . . . . . . . . . . 30 91 7. Advanced Topics . . . . . . . . . . . . . . . . . . . . . . . 31 92 7.1. Correlating Service Function Path Instances . . . . . . . 31 93 7.2. Considerations for Stateful Service Functions . . . . . . 32 94 7.3. VPN Considerations and Private Service Functions . . . . 33 95 7.4. Flow Spec for SFC Classifiers . . . . . . . . . . . . . . 33 96 7.5. Choice of Data Plane SPI/SI Representation . . . . . . . 34 97 7.5.1. MPLS Representation of the SPI/SI . . . . . . . . . . 36 99 7.6. MPLS Label Swapping/Stacking Operation . . . . . . . . . 36 100 7.7. Support for MPLS-Encapsulated NSH Packets . . . . . . . . 36 101 8. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 37 102 8.1. Example Explicit SFP With No Choices . . . . . . . . . . 38 103 8.2. Example SFP With Choice of SFIs . . . . . . . . . . . . . 39 104 8.3. Example SFP With Open Choice of SFIs . . . . . . . . . . 40 105 8.4. Example SFP With Choice of SFTs . . . . . . . . . . . . . 40 106 8.5. Example Correlated Bidirectional SFPs . . . . . . . . . . 41 107 8.6. Example Correlated Asymmetrical Bidirectional SFPs . . . 41 108 8.7. Example Looping in an SFP . . . . . . . . . . . . . . . . 42 109 8.8. Example Branching in an SFP . . . . . . . . . . . . . . . 43 110 8.9. Examples of SFPs with Stateful Service Functions . . . . 43 111 8.9.1. Forward and Reverse Choice Made at the SFF . . . . . 44 112 8.9.2. Parallel End-to-End SFPs with Shared SFF . . . . . . 45 113 8.9.3. Parallel End-to-End SFPs with Separate SFFs . . . . . 47 114 8.9.4. Parallel SFPs Downstream of the Choice . . . . . . . 49 115 9. Security Considerations . . . . . . . . . . . . . . . . . . . 52 116 10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 53 117 10.1. New BGP AF/SAFI . . . . . . . . . . . . . . . . . . . . 53 118 10.2. New BGP Path Attribute . . . . . . . . . . . . . . . . . 53 119 10.3. New SFP Attribute TLVs Type Registry . . . . . . . . . . 53 120 10.4. New SFP Association Type Registry . . . . . . . . . . . 54 121 10.5. New Service Function Type Registry . . . . . . . . . . . 55 122 10.6. New Generic Transitive Experimental Use Extended 123 Community Sub-Types . . . . . . . . . . . . . . . . . . 56 124 10.7. New BGP Transitive Extended Community Types . . . . . . 56 125 10.8. SPI/SI Representation . . . . . . . . . . . . . . . . . 56 126 11. Contributors . . . . . . . . . . . . . . . . . . . . . . . . 56 127 12. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 57 128 13. References . . . . . . . . . . . . . . . . . . . . . . . . . 57 129 13.1. Normative References . . . . . . . . . . . . . . . . . . 57 130 13.2. Informative References . . . . . . . . . . . . . . . . . 58 131 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 59 133 1. Introduction 135 As described in [RFC7498], the delivery of end-to-end services can 136 require a packet to pass through a series of Service Functions (SFs) 137 (e.g., WAN and application accelerators, Deep Packet Inspection (DPI) 138 engines, firewalls, TCP optimizers, and server load balancers) in a 139 specified order: this is termed "Service Function Chaining" (SFC). 140 There are a number of issues associated with deploying and 141 maintaining service function chaining in production networks, which 142 are described below. 144 Historically, if a packet needed to travel through a particular 145 service chain, the nodes hosting the service functions of that chain 146 were placed in the network topology in such a way that the packet 147 could not reach its ultimate destination without first passing 148 through all the service functions in the proper order. This need to 149 place the service functions at particular topological locations 150 limited the ability to adapt a service function chain to changes in 151 network topology (e.g., link or node failures), network utilization, 152 or offered service load. These topological restrictions on where the 153 service functions can be placed raised the following issues: 155 1. The process of configuring or modifying a service function chain 156 is operationally complex and may require changes to the network 157 topology. 159 2. Alternate or redundant service functions may need to be co- 160 located with the primary service functions. 162 3. When there is more than one path between source and destination, 163 forwarding may be asymmetric and it may be difficult to support 164 bidirectional service function chains using simple routing 165 methodologies and protocols without adding mechanisms for traffic 166 steering or traffic engineering. 168 In order to address these issues, the SFC architecture describes 169 Service Function Chains that are built in their own overlay network 170 (the service function overlay network), coexisting with other overlay 171 networks, over a common underlay network [RFC7665]. A Service 172 Function Chain is a sequence of Service Functions through which 173 packet flows that satisfy specified criteria will pass. 175 This document describes the use of BGP as a control plane for 176 networks that support Service Function Chaining (SFC). The document 177 introduces a new BGP address family called the SFC AFI/SAFI with two 178 route types. One route type is originated by a node to advertise 179 that it hosts a particular instance of a specified service function. 180 This route type also provides "instructions" on how to send a packet 181 to the hosting node in a way that indicates that the service function 182 has to be applied to the packet. The other route type is used by a 183 Controller to advertise the paths of "chains" of service functions, 184 and to give a unique designator to each such path so that they can be 185 used in conjunction with the Network Service Header [RFC8300]. 187 This document adopts the SFC architecture described in [RFC7665]. 189 1.1. Requirements Language 191 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 192 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 193 "OPTIONAL" in this document are to be interpreted as described in BCP 194 14 [RFC2119] [RFC8174] when, and only when, they appear in all 195 capitals, as shown here. 197 1.2. Terminology 199 This document uses the following terms from [RFC7665]: 201 o Bidirectional Service Function Chain 203 o Classifier 205 o Service Function (SF) 207 o Service Function Chain (SFC) 209 o Service Function Forwarder (SFF) 211 o Service Function Instance (SFI) 213 o Service Function Path (SFP) 215 o SFC branching 217 Additionally, this document uses the following terms from [RFC8300]: 219 o Network Service Header (NSH) 221 o Service Index (SI) 223 o Service Path Identifier (SPI) 225 This document introduces the following terms: 227 o Service Function Instance Route (SFIR). A new BGP Route Type 228 advertised by the node that hosts an SFI to describe the SFI and 229 to announce the way to forward a packet to the node through the 230 underlay network. 232 o Service Function Overlay Network. The logical network comprised 233 of Classifiers, SFFs, and SFIs that are connected by paths or 234 tunnels through underlay transport networks. 236 o Service Function Path Route (SFPR). A new BGP Route Type 237 originated by Controllers to advertise the details of each SFP. 239 o Service Function Type (SFT). An indication of the function and 240 features of an SFI. 242 2. Overview 244 2.1. Overview of Service Function Chaining 246 In [RFC8300] a Service Function Chain (SFC) is an ordered list of 247 Service Functions (SFs). A Service Function Path (SFP) is an 248 indication of which instances of SFs are acceptable to be traversed 249 in an instantiation of an SFC in a service function overlay network. 250 The Service Path Identifier (SPI) is a 24-bit number that identifies 251 a specific SFP, and a Service Index (SI) is an 8-bit number that 252 identifies a specific point in that path. In the context of a 253 particular SFP (identified by an SPI), an SI represents a particular 254 Service Function, and indicates the order of that SF in the SFP. 256 In fact, each SI is mapped to one or more SFs that are implemented by 257 one or more Service Function Instances (SFIs) that support those 258 specified SFs. Thus an SI may represent a choice of SFIs of one or 259 more Service Function Types. By deploying multiple SFIs for a single 260 SF, one can provide load balancing and redundancy. 262 A special functional element, called a Classifier, is located at each 263 ingress point to a service function overlay network. It assigns the 264 packets of a given packet flow to a specific Service Function Path. 265 This may be done by comparing specific fields in a packet's header 266 with local policy, which may be customer/network/service specific. 267 The classifier picks an SFP and sets the SPI accordingly, it then 268 sets the SI to the value of the SI for the first hop in the SFP, and 269 then prepends a Network Services Header (NSH) [RFC8300] containing 270 the assigned SPI/SI to that packet. Note that the Classifier and the 271 node that hosts the first Service Function in a Service Function Path 272 need not be located at the same point in the service function overlay 273 network. 275 Note that the presence of the NSH can make it difficult for nodes in 276 the underlay network to locate the fields in the original packet that 277 would normally be used to constrain equal cost multipath (ECMP) 278 forwarding. Therefore, it is recommended that the node prepending 279 the NSH also provide some form of entropy indicator that can be used 280 in the underlay network. How this indicator is generated and 281 supplied, and how an SFF generates a new entropy indicator when it 282 forwards a packet to the next SFF are out of scope of this document. 284 The Service Function Forwarder (SFF) receives a packet from the 285 previous node in a Service Function Path, removes the packet's link 286 layer or tunnel encapsulation and hands the packet and the NSH to the 287 Service Function Instance for processing. The SFI has no knowledge 288 of the SFP. 290 When the SFF receives the packet and the NSH back from the SFI it 291 must select the next SFI along the path using the SPI and SI in the 292 NSH and potentially choosing between multiple SFIs (possibly of 293 different Service Function Types) as described in Section 5. In the 294 normal case the SPI remains unchanged and the SI will have been 295 decremented to indicate the next SF along the path. But other 296 possibilities exist if the SF makes other changes to the NSH through 297 a process of re-classification: 299 o The SI in the NSH may indicate: 301 * A previous SF in the path: known as "looping" (see Section 6). 303 * An SF further down the path: known as "jumping" (see also 304 Section 6). 306 o The SPI and the SI may point to an SF on a different SFP: known as 307 "branching" (see also Section 6). 309 Such modifications are limited to within the same service function 310 overlay network. That is, an SPI is known within the scope of 311 service function overlay network. Furthermore, the new SI value is 312 interpreted in the context of the SFP identified by the SPI. 314 As described in [RFC8300], an unknown or invalid SPI is treated as an 315 error and the SFF drops the packet. Such errors should be logged, 316 and such logs are subject to rate limits. 318 An SFF receiving an SI that is unknown in the context of the SPI can 319 reduce the value to the next meaningful SI value in the SFP indicated 320 by the SPI. If no such value exists or if the SFF does not support 321 this function, the SFF drops the packet and should log the event: 322 such logs are also subject to rate limits. 324 The SFF then selects an SFI that provides the SF denoted by the SPI/ 325 SI, and forwards the packet to the SFF that supports that SFI. 327 [RFC8300] makes it clear that the intended scope is for use within a 328 single provider's operational domain. 330 2.2. Control Plane Overview 332 To accomplish the function described in Section 2.1, this document 333 introduces the Service Function Type (SFT) that is the category of SF 334 that is supported by an SFF (such as "firewall"). An IANA registry 335 of Service Function Types is introduced in Section 10. An SFF may 336 support SFs of multiple different SFTs, and may support multiple SFIs 337 of each SF. 339 This document also introduces a new BGP AFI/SAFI (values to be 340 assigned by IANA) for "SFC Routes". Two SFC Route Types are defined 341 by this document: the Service Function Instance Route (SFIR), and the 342 Service Function Path Route (SFPR). As detailed in Section 3, the 343 route type is indicated by a sub-field in the NLRI. 345 o The SFIR is advertised by the node hosting the service function 346 instance. The SFIR describes a particular instance of a 347 particular Service Function (i.e., an SFI) and the way to forward 348 a packet to it through the underlay network, i.e., IP address and 349 encapsulation information. 351 o The SFPRs are originated by Controllers. One SFPR is originated 352 for each Service Function Path. The SFPR specifies: 354 A. the SPI of the path 356 B. the sequence of SFTs and/or SFIs of which the path consists 358 C. for each such SFT or SFI, the SI that represents it in the 359 identified path. 361 This approach assumes that there is an underlay network that provides 362 connectivity between SFFs and Controllers, and that the SFFs are 363 grouped to form one or more service function overlay networks through 364 which SFPs are built. We assume BGP connectivity between the 365 Controllers and all SFFs within each service function overlay 366 network. 368 When choosing the next SFI in a path, the SFF uses the SPI and SI as 369 well as the SFT to choose among the SFIs, applying, for example, a 370 load balancing algorithm or direct knowledge of the underlay network 371 topology as described in Section 4. 373 The SFF then encapsulates the packet using the encapsulation 374 specified by the SFIR of the selected SFI and forwards the packet. 375 See Figure 1. 377 Thus the SFF can be seen as a portal in the underlay network through 378 which a particular SFI is reached. 380 Figure 1 shows a reference model for the SFC architecture. There are 381 four SFFs (SFF-1 through SFF-4) connected by tunnels across the 382 underlay network. Packets arrive at a Classifier and are channelled 383 along SFPs to destinations reachable through SFF-4. 385 SFF-1 and SFF-4 each have one instance of one SF attached (SFa and 386 SFe). SFF-2 has two types of SF attached: there is one instance of 387 one (SFc), and three instances of the other (SFb). SFF-3 has just 388 one instance of an SF (SFd), but it in this case the type of SFd is 389 the same type as SFb (SFTx). 391 This figure demonstrates how load balancing can be achieved by 392 creating several SFPs that satisfy the same SFC. Suppose an SFC 393 needs to include SFa, an SF of type SFTx, and SFc. A number of SFPs 394 can be constructed using any instance of SFb or using SFd. Load 395 balancing may be applied at two places: 397 o The Classifier may distribute different flows onto different SFPs 398 to share the load in the network and across SFIs. 400 o SFF-2 may distribute different flows (on the same SFP) to 401 different instances of SFb to share the processing load. 403 Note that, for convenience and clarity, Figure 1 shows only a few 404 tunnels between SFFs. There could be a full mesh of such tunnels, or 405 more likely, a selection of tunnels connecting key SFFs to enable the 406 construction of SFPs and to balance load and traffic in the network. 408 Packets 409 | | | 410 ------------ 411 | | 412 | Classifier | 413 | | 414 ------+----- 415 | 416 ---+--- --------- ------- 417 | | Tunnel | | | | 418 | SFF-1 |===============| SFF-2 |=========| SFF-4 | 419 | | | | | | 420 | | -+-----+- | | 421 | | ,,,,,,,,,,,,,,/,, \ | | 422 | | ' .........../. ' ..\...... | | 423 | | ' : SFb / : ' : \ SFc : | | 424 | | ' : ---+- : ' : --+-- : | | 425 | | ' : -| SFI | : ' : | SFI | : | | 426 | | ' : -| ----- : ' : ----- : | | 427 | | ' : | ----- : ' ......... | | 428 | | ' : ----- : ' | | 429 | | ' ............. ' | |--- Dests 430 | | ' ' | |--- Dests 431 | | ' ......... ' | | 432 | | ' : ----- : ' | | 433 | | ' : | SFI | : ' | | 434 | | ' : --+-- : ' | | 435 | | ' :SFd | : ' | | 436 | | ' ....|.... ' | | 437 | | ' | ' | | 438 | | ' SFTx | ' | | 439 | | ',,,,,,,,|,,,,,,,,' | | 440 | | | | | 441 | | ---+--- | | 442 | | | | | | 443 | |======| SFF-3 |====================| | 444 ---+--- | | ---+--- 445 | ------- | 446 ....|.... ....|.... 447 : | SFa: : | SFe: 448 : --+-- : : --+-- : 449 : | SFI | : : | SFI | : 450 : ----- : : ----- : 451 ......... ......... 453 Figure 1: The SFC Architecture Reference Model 455 As previously noted, [RFC8300] makes it clear that the mechanisms it 456 defines are intended for use within a single provider's operational 457 domain. This reduces the requirements on the control plane function. 459 3. BGP SFC Routes 461 This document defines a new AFI/SAFI for BGP, known as "SFC", with an 462 NLRI that is described in this section. 464 The format of the SFC NLRI is shown in Figure 2. 466 +---------------------------------------+ 467 | Route Type (2 octets) | 468 +---------------------------------------+ 469 | Length (2 octets) | 470 +---------------------------------------+ 471 | Route Type specific (variable) | 472 +---------------------------------------+ 474 Figure 2: The Format of the SFC NLRI 476 The Route Type field determines the encoding of the rest of the route 477 type specific SFC NLRI. 479 The Length field indicates the length in octets of the route type 480 specific field of the SFC NLRI. 482 This document defines the following Route Types: 484 1. Service Function Instance Route (SFIR) 486 2. Service Function Path Route (SFPR) 488 A Service Function Instance Route (SFIR) is used to identify an SFI. 489 A Service Function Path Route (SFPR) defines a sequence of Service 490 Functions (each of which has at least one instance advertised in an 491 SFIR) that form an SFP. 493 The detailed encoding and procedures for these Route Types are 494 described in subsequent sections. 496 The SFC NLRI is carried in BGP [RFC4271] using BGP Multiprotocol 497 Extensions [RFC4760] with an Address Family Identifier (AFI) of TBD1 498 and a Subsequent Address Family Identifier (SAFI) of TBD2. The NLRI 499 field in the MP_REACH_NLRI/MP_UNREACH_NLRI attribute contains the SFC 500 NLRI, encoded as specified above. 502 In order for two BGP speakers to exchange SFC NLRIs, they MUST use 503 BGP Capabilities Advertisements to ensure that they both are capable 504 of properly processing such NLRIs. This is done as specified in 505 [RFC4760], by using capability code 1 (Multiprotocol BGP) with an AFI 506 of TBD1 and a SAFI of TBD2. 508 The nexthop field of the MP_REACH_NLRI attribute of the SFC NLRI MUST 509 be set to loopback address of the advertising SFF. 511 3.1. Service Function Instance Route (SFIR) 513 Figure 3 shows the Route Type specific NLRI of the SFIR. 515 +--------------------------------------------+ 516 | Route Distinguisher (RD) (8 octets) | 517 +--------------------------------------------+ 518 | Service Function Type (2 octets) | 519 +--------------------------------------------+ 521 Figure 3: SFIR Route Type specific NLRI 523 Per [RFC4364] the RD field comprises a two byte Type field and a six 524 byte Value field. Two SFIs of the same SFT MUST be associated with 525 different RDs, where the association of an SFI with an RD is 526 determined by provisioning. If two SFIRs are originated from 527 different administrative domains, they MUST have different RDs. In 528 particular, SFIRs from different VPNs (for different service function 529 overlay networks) MUST have different RDs, and those RDs MUST be 530 different from any non-VPN SFIRs. 532 The Service Function Type identifies the functions/features of 533 service function can offer, e.g., classifier, firewall, load 534 balancer, etc. There may be several SFIs that can perform a given 535 Service Function. Each node hosting an SFI MUST originate an SFIR 536 for each type of SF that it hosts, and it may advertise an SFIR for 537 each instance of each type of SF. The minimal advertisement allows 538 construction of valid SFPs and leaves the selection of SFIs to the 539 local SFF; the detailed advertisement may have scaling concerns, but 540 allows a Controller that constructs an SFP to make an explicit choice 541 of SFI. 543 The SFIR representing a given SFI will contain an NLRI with RD field 544 set to an RD as specified above, and with SFT field set to identify 545 that SFI's Service Function Type. The values for the SFT field are 546 taken from a registry administered by IANA (see Section 10). A BGP 547 Update containing one or more SFIRs MUST also include a Tunnel 548 Encapsulation attribute [I-D.ietf-idr-tunnel-encaps]. If a data 549 packet needs to be sent to an SFI identified in one of the SFIRs, it 550 will be encapsulated as specified by the Tunnel Encapsulation 551 attribute, and then transmitted through the underlay network. 553 Note that the Tunnel Encapsulation attribute MUST contain sufficient 554 information to allow the advertising SFF to identify the overlay or 555 VPN network which a received packet is transiting. This is because 556 the [SPI, SI] in a received packet is specific to a particular 557 overlay or VPN network. 559 3.1.1. SFI Pool Identifier Extended Community 561 This document defines a new transitive extended community of type 562 TBD6 with Sub-Type 0x00 called the SFI Pool Identifier extended 563 community. It MAY be included in SFIR advertisements, and is used to 564 indicate the identity of a pool of SFIRs to which an SFIR belongs. 565 Since an SFIR may be a member of multiple pools, multiple of these 566 extended communities may be present on a single SFIR advertisement. 568 SFIR pools allow SFIRs to be grouped for any purpose. Possible uses 569 include control plane scalability and stability. A pool identifier 570 may be included in an SFPR to indicate a set of SFIs that are 571 acceptable at a specific point on an SFP (see Section 3.2.1.3 and 572 Section 4.3). 574 The SFI Pool Identifier extended community is encoded in 8 octets as 575 shown in Figure 4. 577 +--------------------------------------------+ 578 | Type = TBD6 (1 octet) | 579 +--------------------------------------------+ 580 | Sub-Type = 0x00 (1 octet) | 581 +--------------------------------------------+ 582 | SFI Pool Identifier Value (6 octets) | 583 +--------------------------------------------+ 585 Figure 4: The SFI Pool Identifier Extended Community 587 The SFI Pool Identifier Value is encoded in a 6 octet field in 588 network byte order, and is a globally unique value. This means that 589 pool identifiers need to be centrally managed, which is consistent 590 with the assignment of SFIs to pools. 592 3.1.2. MPLS Mixed Swapping/Stacking Extended Community 594 This document defines a new transitive extended community of type 595 TBD7 with Sub-Type 0x00 called the MPLS Mixed Swapping/Stacking 596 Labels. The community is encoded as shown in Figure 5. It contains 597 a pair of MPLS labels: an SFC Context Label and an SF Label as 598 described in [RFC8595]. Each label is 20 bits encoded in a 3-octet 599 (24 bit) field with 4 trailing bits that MUST be set to zero. 601 +--------------------------------------------+ 602 | Type = TBD7 (1 octet) | 603 +--------------------------------------------| 604 | Sub-Type = 0x00 (1 octet) | 605 +--------------------------------------------| 606 | SFC Context Label (3 octets) | 607 +--------------------------------------------| 608 | SF Label (3 octets) | 609 +--------------------------------------------+ 611 Figure 5: The MPLS Mixed Swapping/Stacking Extended Community 613 Note that it is assumed that each SFF has one or more globally unique 614 SFC Context Labels and that the context label space and the SPI 615 address space are disjoint. 617 If an SFF supports SFP Traversal with an MPLS Label Stack it MUST 618 include this extended community with the SFIRs that it advertises. 620 See Section 7.6 for a description of how this extended community is 621 used. 623 3.2. Service Function Path Route (SFPR) 625 Figure 6 shows the Route Type specific NLRI of the SFPR. 627 +-----------------------------------------------+ 628 | Route Distinguisher (RD) (8 octets) | 629 +-----------------------------------------------+ 630 | Service Path Identifier (SPI) (3 octets) | 631 +-----------------------------------------------+ 633 Figure 6: SFPR Route Type Specific NLRI 635 Per [RFC4364] the RD field comprises a two byte Type field and a six 636 byte Value field. All SFPs MUST be associated with different RDs. 637 The association of an SFP with an RD is determined by provisioning. 638 If two SFPRs are originated from different Controllers they MUST have 639 different RDs. Additionally, SFPRs from different VPNs (i.e., in 640 different service function overlay networks) MUST have different RDs, 641 and those RDs MUST be different from any non-VPN SFPRs. 643 The Service Path Identifier is defined in [RFC8300] and is the value 644 to be placed in the Service Path Identifier field of the NSH header 645 of any packet sent on this Service Function Path. It is expected 646 that one or more Controllers will originate these routes in order to 647 configure a service function overlay network. 649 The SFP is described in a new BGP Path attribute, the SFP attribute. 650 Section 3.2.1 shows the format of that attribute. 652 3.2.1. The SFP Attribute 654 [RFC4271] defines the BGP Path attribute. This document introduces a 655 new Optional Transitive Path attribute called the SFP attribute with 656 value TBD3 to be assigned by IANA. The first SFP attribute MUST be 657 processed and subsequent instances MUST be ignored. 659 The common fields of the SFP attribute are set as follows: 661 o Optional bit is set to 1 to indicate that this is an optional 662 attribute. 664 o The Transitive bit is set to 1 to indicate that this is a 665 transitive attribute. 667 o The Extended Length bit is set according to the length of the SFP 668 attribute as defined in [RFC4271]. 670 o The Attribute Type Code is set to TBD3. 672 The content of the SFP attribute is a series of Type-Length-Variable 673 (TLV) constructs. Each TLV may include sub-TLVs. All TLVs and sub- 674 TLVs have a common format that is: 676 o Type: A single octet indicating the type of the SFP attribute TLV. 677 Values are taken from the registry described in Section 10.3. 679 o Length: A two octet field indicating the length of the data 680 following the Length field counted in octets. 682 o Value: The contents of the TLV. 684 The formats of the TLVs defined in this document are shown in the 685 following sections. The presence rules and meanings are as follows. 687 o The SFP attribute contains a sequence of zero or more Association 688 TLVs. That is, the Association TLV is OPTIONAL. Each Association 689 TLV provides an association between this SFPR and another SFPR. 690 Each associated SFPR is indicated using the RD with which it is 691 advertised (we say the SFPR-RD to avoid ambiguity). 693 o The SFP attribute contains a sequence of one or more Hop TLVs. 694 Each Hop TLV contains all of the information about a single hop in 695 the SFP. 697 o Each Hop TLV contains an SI value and a sequence of one or more 698 SFT TLVs. Each SFT TLV contains an SFI reference for each 699 instance of an SF that is allowed at this hop of the SFP for the 700 specific SFT. Each SFI is indicated using the RD with which it is 701 advertised (we say the SFIR-RD to avoid ambiguity). 703 Section 6 of [RFC4271] describes the handling of malformed BGP 704 attributes, or those that are in error in some way. [RFC7606] 705 revises BGP error handling specifically for the for UPDATE message, 706 provides guidelines for the authors of documents defining new 707 attributes, and revises the error handling procedures for a number of 708 existing attributes. This document introduces the SFP attribute and 709 so defines error handling as follows: 711 o When parsing a message, an unknown Attribute Type code or a length 712 that suggests that the attribute is longer than the remaining 713 message is treated as a malformed message and the "treat-as- 714 withdraw" approach used as per [RFC7606]. 716 o When parsing a message that contains an SFP attribute, the 717 following cases constitute errors: 719 1. Optional bit is set to 0 in SFP attribute. 721 2. Transitive bit is set to 0 in SFP attribute. 723 3. Unknown TLV type field found in SFP attribute. 725 4. TLV length that suggests the TLV extends beyond the end of the 726 SFP attribute. 728 5. Association TLV contains an unknown SFPR-RD. 730 6. No Hop TLV found in the SFP attribute. 732 7. No sub-TLV found in a Hop TLV. 734 8. Unknown SFIR-RD found in a Hop TLV. 736 o The errors listed above are treated as follows: 738 1., 2., 6., 7.: The attribute MUST be treated as malformed and 739 the "treat-as-withdraw" approach used as per [RFC7606]. 741 3.: Unknown TLVs SHOULD be ignored, and message processing SHOULD 742 continue. 744 4.: Treated as a malformed message and the "treat-as-withdraw" 745 approach used as per [RFC7606] 747 5., 8.: The absence of an RD with which to correlate is nothing 748 more than a soft error. The receiver SHOULD store the 749 information from the SFP attribute until a corresponding 750 advertisement is received. 752 3.2.1.1. The Association TLV 754 The Association TLV is an optional TLV in the SFP attribute. It MAY 755 be present multiple times. Each occurrence provides an association 756 with another SFP as advertised in another SFPR. The format of the 757 Association TLV is shown in Figure 7 759 +--------------------------------------------+ 760 | Type = 1 (1 octet) | 761 +--------------------------------------------| 762 | Length (2 octets) | 763 +--------------------------------------------| 764 | Association Type (1 octet) | 765 +--------------------------------------------| 766 | Associated SFPR-RD (8 octets) | 767 +--------------------------------------------| 768 | Associated SPI (3 octets) | 769 +--------------------------------------------+ 771 Figure 7: The Format of the Association TLV 773 The fields are as follows: 775 Type is set to 1 to indicate an Association TLV. 777 Length indicates the length in octets of the Association Type and 778 Associated SFPR-RD fields. The value of the Length field is 12. 780 The Association Type field indicate the type of association. The 781 values are tracked in an IANA registry (see Section 10.4). Only 782 one value is defined in this document: type 1 indicates 783 association of two unidirectional SFPs to form a bidirectional 784 SFP. An SFP attribute SHOULD NOT contain more than one 785 Association TLV with Association Type 1: if more than one is 786 present, the first one MUST be processed and subsequent instances 787 MUST be ignored. Note that documents that define new Association 788 Types must also define the presence rules for Association TLVs of 789 the new type. 791 The Associated SFPR-RD contains the RD of the associated SFP as 792 advertised in an SFPR. 794 The Associated SPI contains the SPI of the associated SFP as 795 advertised in an SFPR. 797 Association TLVs with unknown Association Type values SHOULD be 798 ignored. Association TLVs that contain an Associated SFPR-RD value 799 equal to the RD of the SFPR in which they are contained SHOULD be 800 ignored. If the Associated SPI is not equal to the SPI advertised in 801 the SFPR indicated by the Associated SFPR-RD then the Association TLV 802 SHOULD be ignored. 804 Note that when two SFPRs reference each other using the Association 805 TLV, one SFPR advertisement will be received before the other. 806 Therefore, processing of an association MUST NOT be rejected simply 807 because the Associated SFPR-RD is unknown. 809 Further discussion of correlation of SFPRs is provided in 810 Section 7.1. 812 3.2.1.2. The Hop TLV 814 There is one Hop TLV in the SFP attribute for each hop in the SFP. 815 The format of the Hop TLV is shown in Figure 8. At least one Hop TLV 816 MUST be present in an SFP attribute. 818 +--------------------------------------------+ 819 | Type = 2 (1 octet) | 820 +--------------------------------------------| 821 | Length (2 octets) | 822 +--------------------------------------------| 823 | Service Index (1 octet) | 824 +--------------------------------------------| 825 | Hop Details (variable) | 826 +--------------------------------------------+ 828 Figure 8: The Format of the Hop TLV 830 The fields are as follows: 832 Type is set to 2 to indicate a Hop TLV. 834 Length indicates the length in octets of the Service Index and Hop 835 Details fields. 837 The Service Index is defined in [RFC8300] and is the value found 838 in the Service Index field of the NSH header that an SFF will use 839 to lookup to which next SFI a packet should be sent. 841 The Hop Details field consists of a sequence of one or more sub- 842 TLVs. 844 Each hop of the SFP may demand that a specific type of SF is 845 executed, and that type is indicated in sub-TLVs of the Hop TLV. At 846 least one sub-TLV MUST be present. This provides a list of which 847 types of SF are acceptable at a specific hop, and for each type it 848 allows a degree of control to be imposed on the choice of SFIs of 849 that particular type. 851 If no Hop TLV is present in an SFP Attribute, it is a malformed 852 attribute 854 3.2.1.3. The SFT TLV 856 The SFT TLV MAY be included in the list of sub-TLVs of the Hop TLV. 857 The format of the SFT TLV is shown in Figure 9. The TLV contains a 858 list of SFIR-RD values each taken from the advertisement of an SFI. 859 Together they form a list of acceptable SFIs of the indicated type. 861 +--------------------------------------------+ 862 | Type = 3 (1 octet) | 863 +--------------------------------------------| 864 | Length (2 octets) | 865 +--------------------------------------------| 866 | Service Function Type (2 octets) | 867 +--------------------------------------------| 868 | SFIR-RD List (variable) | 869 +--------------------------------------------+ 871 Figure 9: The Format of the SFT TLV 873 The fields are as follows: 875 Type is set to 3 to indicate an SFT TLV. 877 Length indicates the length in octets of the Service Function Type 878 and SFIR-RD List fields. 880 The Service Function Type value indicates the category (type) of 881 SF that is to be executed at this hop. The types are as 882 advertised for the SFs supported by the SFFs SFT values in the 883 range 1-31 are Special Purpose SFT values and have meanings 884 defined by the documents that describe them - the value 'Change 885 Sequence' is defined in Section 6.1 of this document. 887 The hop description is further qualified beyond the specification 888 of the SFTs by listing, for each SFT in each hop, the SFIs that 889 may be used at the hop. The SFIs are identified using the SFIR- 890 RDs from the advertisements of the SFIs in the SFIRs. Note that 891 if the list contains one or more SFI Pool Identifiers, then for 892 each the SFIR-RD list is effectively expanded to include the SFIR- 893 RD of each SFIR advertised with that SFI Pool Identifier. An 894 SFIR-RD of value zero has special meaning as described in 895 Section 5. Each entry in the list is eight octets long, and the 896 number of entries in the list can be deduced from the value of the 897 Length field. 899 3.2.1.4. MPLS Swapping/Stacking TLV 901 The MPLS Swapping/Stacking TLV (Type value 4) is a zero length sub- 902 TLV that is OPTIONAL in the Hop TLV and is used when the data 903 representation is MPLS (see Section 7.5). When present it indicates 904 to the Classifier imposing an MPLS label stack that the current hop 905 is to use an {SFC Context Label, SF label} rather than an {SPI, SF} 906 label pair. See Section 7.6 for more details. 908 3.2.1.5. SFP Traversal With MPLS Label Stack TLV 910 The SFP Traversal With MPLS Label Stack TLV (Type value 5) is a zero 911 length sub-TLV that can be carried in the SFP Attribute and indicates 912 to the Classifier and the SFFs on the SFP that an MPLS labels stack 913 with label swapping/stacking is to be used for packets traversing the 914 SFP. All of the SFF specified at each the SFP's hops MUST have 915 advertised an MPLS Mixed Swapping/Stacking Extended Community (see 916 Section 3.1.2) for the SFP to be considered usable. 918 3.2.2. General Rules For The SFP Attribute 920 It is possible for the same SFI, as described by an SFIR, to be used 921 in multiple SFPRs. 923 When two SFPRs have the same SPI but different SFPR-RDs there can be 924 three cases: 926 o Two or more Controllers are originating SFPRs for the same SFP. 927 In this case the content of the SFPRs is identical and the 928 duplication is to ensure receipt and to provide Controller 929 redundancy. 931 o There is a transition in content of the advertised SFP and the 932 advertisements may originate from one or more Controllers. In 933 this case the content of the SFPRs will be different. 935 o The reuse of an SPI may result from a configuration error. 937 In all cases, there is no way for the receiving SFF to know which 938 SFPR to process, and the SFPRs could be received in any order. At 939 any point in time, when multiple SFPRs have the same SPI but 940 different SFPR-RDs, the SFF MUST use the SFPR with the numerically 941 lowest SFPR-RD. The SFF SHOULD log this occurrence to assist with 942 debugging. 944 Furthermore, a Controller that wants to change the content of an SFP 945 is RECOMMENDED to use a new SPI and so create a new SFP onto which 946 the Classifiers can transition packet flows before the SFPR for the 947 old SFP is withdrawn. This avoids any race conditions with SFPR 948 advertisements. 950 Additionally, a Controller SHOULD NOT re-use an SPI after it has 951 withdrawn the SFPR that used it until at least a configurable amount 952 of time has passed. This timer SHOULD have a default of one hour. 954 4. Mode of Operation 956 This document describes the use of BGP as a control plane to create 957 and manage a service function overlay network. 959 4.1. Route Targets 961 The main feature introduced by this document is the ability to create 962 multiple service function overlay networks through the use of Route 963 Targets (RTs) [RFC4364]. 965 Every BGP UPDATE containing an SFIR or SFPR carries one or more RTs. 966 The RT carried by a particular SFIR or SFPR is determined by the 967 provisioning of the route's originator. 969 Every node in a service function overlay network is configured with 970 one or more import RTs. Thus, each SFF will import only the SFPRs 971 with matching RTs allowing the construction of multiple service 972 function overlay networks or the instantiation of Service Function 973 Chains within an L3VPN or EVPN instance (see Section 7.3). An SFF 974 that has a presence in multiple service function overlay networks 975 (i.e., imports more than one RT) will usually maintain separate 976 forwarding state for each overlay network. 978 4.2. Service Function Instance Routes 980 The SFIR (see Section 3.1) is used to advertise the existence and 981 location of a specific Service Function Instance and consists of: 983 o The RT as just described. 985 o A Service Function Type (SFT) that is the type of service function 986 that is provided (such as "firewall"). 988 o A Route Distinguisher (RD) that is unique to a specific instance 989 of a service function. 991 4.3. Service Function Path Routes 993 The SFPR (see Section 3.2) describes a specific path of a Service 994 Function Chain. The SFPR contains the Service Path Identifier (SPI) 995 used to identify the SFP in the NSH in the data plane. It also 996 contains a sequence of Service Indexes (SIs). Each SI identifies a 997 hop in the SFP, and each hop is a choice between one of more SFIs. 999 As described in this document, each Service Function Path Route is 1000 identified in the service function overlay network by an RD and an 1001 SPI. The SPI is unique within a single VPN instance supported by the 1002 underlay network. 1004 The SFPR advertisement comprises: 1006 o An RT as described in Section 4.1. 1008 o A tuple that identifies the SFPR 1010 * An RD that identifies an advertisement of an SFPR. 1012 * The SPI that uniquely identifies this path within the VPN 1013 instance distinguished by the RD. This SPI also appears in the 1014 NSH. 1016 o A series of Service Indexes. Each SI is used in the context of a 1017 particular SPI and identifies one or more SFs (distinguished by 1018 their SFTs) and for each SF a set of SFIs that instantiate the SF. 1019 The values of the SI indicate the order in which the SFs are to be 1020 executed in the SFP that is represented by the SPI. 1022 o The SI is used in the NSH to identify the entries in the SFP. 1023 Note that the SI values have meaning only relative to a specific 1024 path. They have no semantic other than to indicate the order of 1025 Service Functions within the path and are assumed to be 1026 monotonically decreasing from the start to the end of the path 1027 [RFC8300]. 1029 o Each Service Index is associated with a set of one or more Service 1030 Function Instances that can be used to provide the indexed Service 1031 Function within the path. Each member of the set comprises: 1033 * The RD used in an SFIR advertisement of the SFI. 1035 * The SFT that indicates the type of function as used in the same 1036 SFIR advertisement of the SFI. 1038 This may be summarized as follows where the notations "SFPR-RD" and 1039 "SFIR-RD" are used to distinguish the two different RDs: 1041 RT, {SFPR-RD, SPI}, m * {SI, {n * {SFT, p * SFIR-RD} } } 1043 Where: 1045 RT: Route Target 1047 SFPR-RD: The Route Descriptor of the Service Function Path Route 1048 advertisement 1049 SPI: Service Path Identifier used in the NSH 1051 m: The number of hops in the Service Function Path 1053 n: The number of choices of Service Function Type for a specific 1054 hop 1056 p: The number of choices of Service Function Instance for given 1057 Service Function Type in a specific hop 1059 SI: Service Index used in the NSH to indicate a specific hop 1061 SFT: The Service Function Type used in the same advertisement of 1062 the Service Function Instance Route 1064 SFIR-RD: The Route Descriptor used in an advertisement of the 1065 Service Function Instance Route 1067 Note that the values of SI are from the set {255, ..., 1} and are 1068 monotonically decreasing within the SFP. SIs MUST appear in order 1069 within the SFPR (i.e., monotonically decreasing) and MUST NOT appear 1070 more than once. Gaps MAY appear in the sequence as described in 1071 Section 4.5.1. Malformed SFPRs MUST be discarded and MUST cause any 1072 previous instance of the SFPR (same SFPR-RD and SPI) to be discarded. 1074 Note that if the SFIR-RD list in an SFT TLV contains one or more SFI 1075 Pool identifiers, then in the above expression, 'p' is the sum of the 1076 number of individual SFIR-RD values and the sum for each SFI Pool 1077 Identifier of the number of SFIRs advertised with that SFI Pool 1078 Identifier. I.e., the list of SFIR-RD values is effectively expanded 1079 to include the SFIR-RD of each SFIR advertised with each SFI Pool 1080 Identifier in the SFIR-RD list. 1082 The choice of SFI is explained further in Section 5. Note that an 1083 SFIR-RD value of zero has special meaning as described in that 1084 Section. 1086 4.4. Classifier Operation 1088 As shown in Figure 1, the Classifier is a component that is used to 1089 assign packets to an SFP. 1091 The Classifier is responsible for determining to which packet flow a 1092 packet belongs (usually by inspecting the packet header), imposing an 1093 NSH, and initializing the NSH with the SPI of the selected SFP and 1094 the SI of its first hop. 1096 4.5. Service Function Forwarder Operation 1098 Each packet sent to an SFF is transmitted encapsulated in an NSH. 1099 The NSH includes an SPI and SI: the SPI indicates the SFPR 1100 advertisement that announced the Service Function Path; the tuple 1101 SPI/SI indicates a specific hop in a specific path and maps to the 1102 RD/SFT of a particular SFIR advertisement. 1104 When an SFF gets an SFPR advertisement it will first determine 1105 whether to import the route by examining the RT. If the SFPR is 1106 imported the SFF then determines whether it is on the SFP by looking 1107 for its own SFIR-RDs in the SFPR. For each occurrence in the SFP, 1108 the SFF creates forwarding state for incoming packets and forwarding 1109 state for outgoing packets that have been processed by the specified 1110 SFI. 1112 The SFF creates local forwarding state for packets that it receives 1113 from other SFFs. This state makes the association between the SPI/SI 1114 in the NSH of the received packet and one or more specific local SFIs 1115 as identified by the SFIR-RD/SFT. If there are multiple local SFIs 1116 that match this is because a single advertisement was made for a set 1117 of equivalent SFIs and the SFF may use local policy (such as load 1118 balancing) to determine to which SFI to forward a received packet. 1120 The SFF also creates next hop forwarding state for packets received 1121 back from the local SFI that need to be forwarded to the next hop in 1122 the SFP. There may be a choice of next hops as described in 1123 Section 4.3. The SFF could install forwarding state for all 1124 potential next hops, or it could choose to only install forwarding 1125 state to a subset of the potential next hops. If a choice is made 1126 then it will be as described in Section 5. 1128 The installed forwarding state may change over time reacting to 1129 changes in the underlay network and the availability of particular 1130 SFIs. 1132 Note that SFFs only create and store forwarding state for the SFPs on 1133 which they are included. They do not retain state for all SFPs 1134 advertised. 1136 An SFF may also install forwarding state to support looping, jumping, 1137 and branching. The protocol mechanism for explicit control of 1138 looping, jumping, and branching uses a specific reserved SFT value at 1139 a given hop of an SFPR and is described in Section 6.1. 1141 4.5.1. Processing With 'Gaps' in the SI Sequence 1143 The behavior of an SF as described in [RFC8300] is to decrement the 1144 value of the SI field in the NSH by one before returning a packet to 1145 the local SFF for further processing. This means that there is a 1146 good reason to assume that the SFP is composed of a series of SFs 1147 each indicated by an SI value one less than the previous. 1149 However, there is an advantage to having non-successive SIs in an 1150 SPI. Consider the case where an SPI needs to be modified by the 1151 insertion or removal of an SF. In the latter case this would lead to 1152 a "gap" in the sequence of SIs, and in the former case, this could 1153 only be achieved if a gap already existed into which the new SF with 1154 its new SI value could be inserted. Otherwise, all "downstream" SFs 1155 would need to be renumbered. 1157 Now, of course, such renumbering could be performed, but would lead 1158 to a significant disruption to the SFC as all the SFFs along the SFP 1159 were "reprogrammed". Thus, to achieve dynamic modification of an SFP 1160 (and even, in-service modification) it is desirable to be able to 1161 make these modifications without changing the SIs of the elements 1162 that were present before the modification. This will produce much 1163 more consistent/predictable behavior during the convergence period 1164 where otherwise the change would need to be fully propagated. 1166 Another approach says that any change to an SFP simply creates a new 1167 SFP that can be assigned a new SPI. All that would be needed would 1168 be to give a new instruction to the Classifier and traffic would be 1169 switched to the new SFP that contains the new set of SFs. This 1170 approach is practical, but neglects to consider that the SFP may be 1171 referenced by other SFPs (through "branch" instructions) and used by 1172 many Classifiers. In those cases the corresponding configuration 1173 resulting from a change in SPI may have wide ripples and give scope 1174 for errors that are hard to trace. 1176 Therefore, while this document requires that the SI values in an SFP 1177 are monotonic decreasing, it makes no assumption that the SI values 1178 are sequential. Configuration tools may apply that rule, but they 1179 are not required to. To support this, an SFF SHOULD process as 1180 follows when it receives a packet: 1182 o If the SI indicates a known entry in the SFP, the SFF MUST process 1183 the packet as normal, looking up the SI and determining to which 1184 local SFI to deliver the packet. 1186 o If the SI does not match an entry in the SFP, the SFF MUST reduce 1187 the SI value to the next (smaller) value present in the SFP and 1188 process the packet using that SI. 1190 o If there is no smaller SI (i.e., if the end of the SFP has been 1191 reached) the SFF MUST treat the SI value as invalid as described 1192 in [RFC8300]. 1194 SFF implementations MAY choose to only support contiguous SI values 1195 in an SFP. Such an implementation will not support receiving an SI 1196 value that is not present in the SFP and will discard the packets as 1197 described in [RFC8300]. 1199 5. Selection within Service Function Paths 1201 As described in Section 2 the SPI/SI in the NSH passed back from an 1202 SFI to the SFF may leave the SFF with a choice of next hop SFTs, and 1203 a choice of SFIs for each SFT. That is, the SPI indicates an SFPR, 1204 and the SI indicates an entry in that SFPR. Each entry in an SFPR is 1205 a set of one or more SFT/SFIR-RD pairs. The SFF MUST choose one of 1206 these, identify the SFF that supports the chosen SFI, and send the 1207 packet to that next hop SFF. 1209 The choice be may offered for load balancing across multiple SFIs, or 1210 for discrimination between different actions necessary at a specific 1211 hop in the SFP. Different SFT values may exist at a given hop in an 1212 SFP to support several cases: 1214 o There may be multiple instances of similar service functions that 1215 are distinguished by different SFT values. For example, firewalls 1216 made by vendor A and vendor B may need to be identified by 1217 different SFT values because, while they have similar 1218 functionality, their behavior is not identical. Then, some SFPs 1219 may limit the choice of SF at a given hop by specifying the SFT 1220 for vendor A, but other SFPs might not need to control which 1221 vendor's SF is used and so can indicate that either SFT can be 1222 used. 1224 o There may be an obvious branch needed in an SFP such as the 1225 processing after a firewall where admitted packets continue along 1226 the SFP, but suspect packets are diverted to a "penalty box". In 1227 this case, the next hop in the SFP will be indicated with two 1228 different SFT values. 1230 In the typical case, the SFF chooses a next hop SFF by looking at the 1231 set of all SFFs that support the SFs identified by the SI (that set 1232 having been advertised in individual SFIR advertisements), finding 1233 the one or more that are "nearest" in the underlay network, and 1234 choosing between next hop SFFs using its own load-balancing 1235 algorithm. 1237 An SFI may influence this choice process by passing additional 1238 information back along with the packet and NSH. This information may 1239 influence local policy at the SFF to cause it to favor a next hop SFF 1240 (perhaps selecting one that is not nearest in the underlay), or to 1241 influence the load-balancing algorithm. 1243 This selection applies to the normal case, but also applies in the 1244 case of looping, jumping, and branching (see Section 6). 1246 Suppose an SFF in a particular service overlay network (identified by 1247 a particular import RT, RT-z) needs to forward an NSH-encapsulated 1248 packet whose SPI is SPI-x and whose SI is SI-y. It does the 1249 following: 1251 1. It looks for an installed SFPR that carries RT-z and that has 1252 SPI-x in its NLRI. If there is none, then such packets cannot be 1253 forwarded. 1255 2. From the SFP attribute of that SFPR, it finds the Hop TLV with SI 1256 value set to SI-y. If there is no such Hop TLV, then such 1257 packets cannot be forwarded. 1259 3. It then finds the "relevant" set of SFIRs by going through the 1260 list of SFT TLVs contained in the Hop TLV as follows: 1262 A. An SFIR is relevant if it carries RT-z, the SFT in its NLRI 1263 matches the SFT value in one of the SFT TLVs, and the RD 1264 value in its NLRI matches an entry in the list of SFIR-RDs in 1265 that SFT TLV. 1267 B. If an entry in the SFIR-RD list of an SFT TLV contains the 1268 value zero, then an SFIR is relevant if it carries RT-z and 1269 the SFT in its NLRI matches the SFT value in that SFT TLV. 1270 I.e., any SFIR in the service function overlay network 1271 defined by RT-z and with the correct SFT is relevant. 1273 Each of the relevant SFIRs identifies a single SFI, and contains a 1274 Tunnel Encapsulation attribute that specifies how to send a packet to 1275 that SFI. For a particular packet, the SFF chooses a particular SFI 1276 from the set of relevant SFIRs. This choice is made according to 1277 local policy. 1279 A typical policy might be to figure out the set of SFIs that are 1280 closest, and to load balance among them. But this is not the only 1281 possible policy. 1283 Thus, at any point in time when an SFF selects its next hop, it 1284 chooses from the intersection of the set of next hop RDs contained in 1285 the SFPR and the RDs contained in its local set of SFIRs. If the 1286 intersection is null, the SFPR is unusable. Similarly, when this 1287 condition obtains the originator of the SFPR should either withdraw 1288 the SFPR or re-advertise it with a new set of RDs for the affected 1289 hop. 1291 6. Looping, Jumping, and Branching 1293 As described in Section 2 an SFI or an SFF may cause a packet to 1294 "loop back" to a previous SF on a path in order that a sequence of 1295 functions may be re-executed. This is simply achieved by replacing 1296 the SI in the NSH with a higher value instead of decreasing it as 1297 would normally be the case to determine the next hop in the path. 1299 Section 2 also describes how an SFI or an SFF may cause a packets to 1300 "jump forward" to an SF on a path that is not the immediate next SF 1301 in the SFP. This is simply achieved by replacing the SI in the NSH 1302 with a lower value than would be achieved by decreasing it by the 1303 normal amount. 1305 A more complex option to move packets from one SFP to another is 1306 described in [RFC8300] and Section 2 where it is termed "branching". 1307 This mechanism allows an SFI or SFF to make a choice of downstream 1308 treatments for packets based on local policy and output of the local 1309 SF. Branching is achieved by changing the SPI in the NSH to indicate 1310 the new path and setting the SI to indicate the point in the path at 1311 which the packets should enter. 1313 Note that the NSH does not include a marker to indicate whether a 1314 specific packet has been around a loop before. Therefore, the use of 1315 NSH metadata may be required in order to prevent infinite loops. 1317 6.1. Protocol Control of Looping, Jumping, and Branching 1319 If the SFT value in an SFT TLV in an SFPR has the Special Purpose SFT 1320 value "Change Sequence" (see Section 10) then this is an indication 1321 that the SFF may make a loop, jump, or branch according to local 1322 policy and information returned by the local SFI. 1324 In this case, the SPI and SI of the next hop is encoded in the eight 1325 bytes of an entry in the SFIR-RD list as follows: 1327 3 bytes SPI 1329 2 bytes SI 1331 3 bytes Reserved (SHOULD be set to zero and ignored) 1333 If the SI in this encoding is not part of the SFPR indicated by the 1334 SPI in this encoding, then this is an explicit error that SHOULD be 1335 detected by the SFF when it parses the SFPR. The SFPR SHOULD NOT 1336 cause any forwarding state to be installed in the SFF and packets 1337 received with the SPI that indicates this SFPR SHOULD be silently 1338 discarded. 1340 If the SPI in this encoding is unknown, the SFF SHOULD NOT install 1341 any forwarding state for this SFPR, but MAY hold the SFPR pending 1342 receipt of another SFPR that does use the encoded SPI. 1344 If the SPI matches the current SPI for the path, this is a loop or 1345 jump. In this case, if the SI is greater than to the current SI it 1346 is a loop. If the SPI matches and the SI is less than the next SI, 1347 it is a jump. 1349 If the SPI indicates anther path, this is a branch and the SI 1350 indicates the point at which to enter that path. 1352 The Change Sequence SFT is just another SFT that may appear in a set 1353 of SFI/SFT tuples within an SI and is selected as described in 1354 Section 5. 1356 Note that Special Purpose SFTs MUST NOT be advertised in SFIRs. 1358 6.2. Implications for Forwarding State 1360 Support for looping and jumping requires that the SFF has forwarding 1361 state established to an SFF that provides access to an instance of 1362 the appropriate SF. This means that the SFF must have seen the 1363 relevant SFIR advertisements and known that it needed to create the 1364 forwarding state. This is a matter of local configuration and 1365 implementation: for example, an implementation could be configured to 1366 install forwarding state for specific looping/jumping. 1368 Support for branching requires that the SFF has forwarding state 1369 established to an SFF that provides access to an instance of the 1370 appropriate entry SF on the other SFP. This means that the SFF must 1371 have seen the relevant SFIR and SFPR advertisements and known that it 1372 needed to create the forwarding state. This is a matter of local 1373 configuration and implementation: for example, an implementation 1374 could be configured to install forwarding state for specific 1375 branching (identified by SPI and SI). 1377 7. Advanced Topics 1379 This section highlights several advanced topics introduced elsewhere 1380 in this document. 1382 7.1. Correlating Service Function Path Instances 1384 It is often useful to create bidirectional SFPs to enable packet 1385 flows to traverse the same set of SFs, but in the reverse order. 1386 However, packets on SFPs in the data plane (per [RFC8300]) do not 1387 contain a direction indicator, so each direction must use a different 1388 SPI. 1390 As described in Section 3.2.1.1 an SFPR can contain one or more 1391 correlators encoded in Association TLVs. If the Association Type 1392 indicates "Bidirectional SFP" then the SFP advertised in the SFPR is 1393 one direction of a bidirectional pair of SFPs where the other in the 1394 pair is advertised in the SFPR with RD as carried in the Associated 1395 SFPR-RD field of the Association TLV. The SPI carried in the 1396 Associated SPI field of the Association TLV provides a cross-check 1397 and should match the SPI advertised in the SFPR with RD as carried in 1398 the Associated SFPR-RD field of the Association TLV. 1400 As noted in Section 3.2.1.1 SFPRs reference each other one SFPR 1401 advertisement will be received before the other. Therefore 1402 processing of an association will require that the first SFPR is not 1403 rejected simply because the Associated SFPR-RD it carries is unknown. 1404 However, the SFP defined by the first SFPR is valid and SHOULD be 1405 available for use as a unidirectional SFP even in the absence of an 1406 advertisement of its partner. 1408 Furthermore, in error cases where SFPR-a associates with SFPR-b, but 1409 SFPR-b associates with SFPR-c such that a bidirectional pair of SFPs 1410 cannot be formed, the individual SFPs are still valid and SHOULD be 1411 available for use as unidirectional SFPs. An implementation SHOULD 1412 log this situation because it represents a Controller error. 1414 Usage of a bidirectional SFP may be programmed into the Classifiers 1415 by the Controller. Alternatively, a Classifier may look at incoming 1416 packets on a bidirectional packet flow, extract the SPI from the 1417 received NSH, and look up the SFPR to find the reverse direction SFP 1418 to use when it sends packets. 1420 See Section 8 for an example of how this works. 1422 7.2. Considerations for Stateful Service Functions 1424 Some service functions are stateful. That means that they build and 1425 maintain state derived from configuration or from the packet flows 1426 that they handle. In such cases it can be important or necessary 1427 that all packets from a flow continue to traverse the same instance 1428 of a service function so that the state can be leveraged and does not 1429 need to be regenerated. 1431 In the case of bidirectional SFPs, it may be necessary to traverse 1432 the same instances of a stateful service function in both directions. 1433 A firewall is a good example of such a service function. 1435 This issue becomes a concern where there are multiple parallel 1436 instances of a service function and a determination of which one to 1437 use could normally be left to the SFF as a load-balancing or local 1438 policy choice. 1440 For the forward direction SFP, the concern is that the same choice of 1441 service function is made for all packets of a flow under normal 1442 network conditions. It may be possible to guarantee that the load 1443 balancing functions applied in the SFFs are stable and repeatable, 1444 but a controller that constructs SFPs might not want to trust to 1445 this. The controller can, in these cases, build a number of more 1446 specific SFPs each traversing a specific instance of the stateful 1447 SFs. In this case, the load balancing choice can be left up to the 1448 Classifier. Thus the Classifier selects which instance of a stateful 1449 SF is used by a particular flow by selecting the SFP that the flow 1450 uses. 1452 For bidirectional SFPs where the same instance of a stateful SF must 1453 be traversed in both directions, it is not enough to leave the choice 1454 of service function instance as a local choice even if the load 1455 balancing is stable because coordination would be required between 1456 the decision points in the forward and reverse directions and this 1457 may be hard to achieve in all cases except where it is the same SFF 1458 that makes the choice in both directions. 1460 Note that this approach necessarily increases the amount of SFP state 1461 in the network (i.e., there are more SFPs). It is possible to 1462 mitigate this effect by careful construction of SFPs built from a 1463 concatenation of other SFPs. 1465 Section 8.9 includes some simple examples of SFPs for stateful 1466 service functions. 1468 7.3. VPN Considerations and Private Service Functions 1470 Likely deployments include reserving specific instances of Service 1471 Functions for specific customers or allowing customers to deploy 1472 their own Service Functions within the network. Building Service 1473 Functions in such environments requires that suitable identifiers are 1474 used to ensure that SFFs distinguish which SFIs can be used and which 1475 cannot. 1477 This problem is similar to how VPNs are supported and is solved in a 1478 similar way. The RT field is used to indicate a set of Service 1479 Functions from which all choices must be made. 1481 7.4. Flow Spec for SFC Classifiers 1483 [RFC5575] and [I-D.ietf-idr-rfc5575bis] define a set of BGP routes 1484 that can be used to identify the packets in a given flow using fields 1485 in the header of each packet, and a set of actions, encoded as 1486 extended communities, that can be used to disposition those packets. 1487 This document enables the use of these mechanisms by SFC Classifiers 1488 by defining a new action extended community called "Flow Spec for SFC 1489 Classifiers" identified by the value TBD4. Note that other action 1490 extended communities MUST NOT be present at the same time: the 1491 inclusion of the "Flow Spec for SFC Classifiers" action extended 1492 community along with any other action MUST be treated as an error 1493 which SHOULD result in the Flow Specification UPDATE message being 1494 handled as Treat-as-withdraw according to [RFC7606] Section 2. 1496 This extended community is encoded as an 8-octet value, as shown in 1497 Figure 10. 1499 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 1500 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1501 | Type=0x80 | Sub-Type=TBD4 | SPI | 1502 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1503 | SPI (cont.) | SI | SFT | 1504 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1506 Figure 10: The Format of the Flow Spec for SFC Classifiers Extended 1507 Community 1509 The extended community contains the Service Path Identifier (SPI), 1510 Service Index (SI), and Service Function Type (SFT) as defined 1511 elsewhere in this document. Thus, each action extended community 1512 defines the entry point (not necessarily the first hop) into a 1513 specific service function path. This allows, for example, different 1514 flows to enter the same service function path at different points. 1516 Note that a given Flow Spec update according to [RFC5575] and 1517 [I-D.ietf-idr-rfc5575bis] may include multiple of these action 1518 extended communities, and that if a given action extended community 1519 does not contain an installed SFPR with the specified {SPI, SI, SFT} 1520 it MUST NOT be used for dispositioning the packets of the specified 1521 flow. 1523 The normal case of packet classification for SFC will see a packet 1524 enter the SFP at its first hop. In this case the SI in the extended 1525 community is superfluous and the SFT may also be unnecessary. To 1526 allow these cases to be handled, a special meaning is assigned to a 1527 Service Index of zero (not a valid value) and an SFT of zero (a 1528 reserved value in the registry - see Section 10.5). 1530 o If an SFC Classifiers Extended Community is received with SI = 0 1531 then it means that the first hop of the SFP indicated by the SPI 1532 MUST be used. 1534 o If an SFC Classifiers Extended Community is received with SFT = 0 1535 then there are two sub-cases: 1537 * If there is a choice of SFT in the hop indicated by the value 1538 of the SI (including SI = 0) then SFT = 0 means there is a free 1539 choice according to local policy of which SFT to use). 1541 * If there is no choice of SFT in the hop indicated by the value 1542 of SI, then SFT = 0 means that the value of the SFT at that hop 1543 as indicated in the SPFR for the indicated SPI MUST be used. 1545 One of the filters that the Flow Spec may describe is the VPN to 1546 which the traffic belongs. Additionally, note that to put the 1547 indicated SPI into context when multiple SFC overlays are present in 1548 one network, each FlowSpec update MUST be tagged with the route 1549 target of the overlay or VPN network for which it is intended. 1551 7.5. Choice of Data Plane SPI/SI Representation 1553 This document ties together the control and data planes of an SFC 1554 overlay network through the use of the SPI/SI which is nominally 1555 carried in the NSH of a given packet. However, in order to handle 1556 situations in which the NSH is not ubiquitously deployed, it is also 1557 possible to use alternative data plane representations of the SPI/SI 1558 by carrying the identical semantics in other protocol fields such as 1559 MPLS labels [RFC8595]. 1561 This document defines a new sub-TLV for the Tunnel Encapsulation 1562 attribute, the SPI/SI Representation sub-TLV of type TBD5. This sub- 1563 TLV MAY be present in each Tunnel TLV contained in a Tunnel 1564 Encapsulation attribute when the attribute is carried by an SFIR. 1565 The value field of this sub-TLV is a two octet field of flags, each 1566 of which describes how the originating SFF expects to see the SPI/SI 1567 represented in the data plane for packets carried in the tunnels 1568 described by the Tunnel TLV. 1570 The following bits are defined by this document: 1572 Bit 0: If this bit is set the NSH is to be used to carry the SPI/SI 1573 in the data plane. 1575 Bit 1: If this bit is set two labels in an MPLS label stack are to 1576 be used as described in Section 7.5.1. 1578 If a given Tunnel TLV does not contain an SPI/SI Representation sub- 1579 TLV then it MUST be processed as if such a sub-TLV is present with 1580 Bit 0 set and no other bits set. That is, the absence of the sub-TLV 1581 SHALL be interpreted to mean that the NSH is to be used. 1583 If a given Tunnel TLV contains an SPI/SI Representation sub-TLV with 1584 value field that has no flag set then the tunnel indicated by the 1585 Tunnel TLV MUST NOT be used for forwarding SFC packets. If a given 1586 Tunnel TLV contains an SPI/SI Representation sub-TLV with both bit 0 1587 and bit 1 set then the tunnel indicated by the Tunnel TLV MUST NOT be 1588 used for forwarding SFC packets. The meaning and rules for presence 1589 of other bits is to be defined in future documents, but 1590 implementations of this specification MUST set other bits to zero and 1591 ignore them on receipt. 1593 If a given Tunnel TLV contains more than one SPI/SI Representation 1594 sub-TLV then the first one MUST be considered and subsequent 1595 instances MUST be ignored. 1597 Note that the MPLS representation of the logical NSH may be used even 1598 if the tunnel is not an MPLS tunnel. Conversely, MPLS tunnels may be 1599 used to carry other encodings of the logical NSH (specifically, the 1600 NSH itself). It is a requirement that both ends of a tunnel over the 1601 underlay network know that the tunnel is used for SFC and know what 1602 form of NSH representation is used. The signaling mechanism 1603 described here allows coordination of this information. 1605 7.5.1. MPLS Representation of the SPI/SI 1607 If bit 1 is set in the in the SPI/SI Representation sub-TLV then 1608 labels in the MPLS label stack are used to indicate SFC forwarding 1609 and processing instructions to achieve the semantics of a logical 1610 NSH. The label stack is encoded as shown in [RFC8595]. 1612 7.6. MPLS Label Swapping/Stacking Operation 1614 When a classifier constructs an MPLS label stack for an SFP it starts 1615 with that SFP' last hop. If the last hop requires an {SPI, SI} label 1616 pair for label swapping, it pushes the SI (set to the SI value of the 1617 last hop) and the SFP's SPI onto the MPLS label stack. If the last 1618 hop requires a {context label, SFI label} label pair for label 1619 stacking it selects a specific SFIR and pushes that SFIR's SFI label 1620 and context label onto the MPLS label stack. 1622 The classifier then moves sequentially back through the SFP one hop 1623 at a time. For each hop, if the hop requires an {SPI, SI]} and there 1624 is an {SPI, SI} at the top of the MPLS label stack, the SI is set to 1625 the SI value of the current hop. If there is not an {SPI, SI} at the 1626 top of the MPLS label stack, it pushes the SI (set to the SI value of 1627 the current hop) and the SFP's SPI onto the MPLS label stack. 1629 If the hop requires a {context label, SFI label}, it selects a 1630 specific SFIR and pushes that SFIR's SFI label and context label onto 1631 the MPLS label stack. 1633 7.7. Support for MPLS-Encapsulated NSH Packets 1635 [RFC8596] describes how to transport SFC packets using the NSH over 1636 an MPLS transport network. Signaling MPLS encapsulation of SFC 1637 packets using the NSH is also supported by this document by using the 1638 "BGP Tunnel Encapsulation Attribute Sub-TLV" with the codepoint 10 1639 (representing "MPLS Label Stack") from the "BGP Tunnel Encapsulation 1640 Attribute Sub-TLVs" registry defined in [I-D.ietf-idr-tunnel-encaps], 1641 and also using the "SFP Traversal With MPLS Label Stack TLV" and the 1642 "SPI/SI Representation sub-TLV" with bit 0 set and bit 1 cleared. 1644 In this case the MPLS label stack constructed by the SFF to forward a 1645 packet to the next SFF on the SFP will consist of the labels needed 1646 to reach that SFF, and if label stacking is used it will also include 1647 the labels advertised in the MPLS Label Stack sub-TLV and the labels 1648 remaining in the stack needed to traverse the remainder of the SFP. 1650 8. Examples 1652 Assume we have a service function overlay network with four SFFs 1653 (SFF1, SFF3, SFF3, and SFF4). The SFFs have addresses in the 1654 underlay network as follows: 1656 SFF1 192.0.2.1 1657 SFF2 192.0.2.2 1658 SFF3 192.0.2.3 1659 SFF4 192.0.2.4 1661 Each SFF provides access to some SFIs from the four Service Function 1662 Types SFT=41, SFT=42, SFT=43, and SFT=44 as follows: 1664 SFF1 SFT=41 and SFT=42 1665 SFF2 SFT=41 and SFT=43 1666 SFF3 SFT=42 and SFT=44 1667 SFF4 SFT=43 and SFT=44 1669 The service function network also contains a Controller with address 1670 198.51.100.1. 1672 This example service function overlay network is shown in Figure 11. 1674 -------------- 1675 | Controller | 1676 | 198.51.100.1 | ------ ------ ------ ------ 1677 -------------- | SFI | | SFI | | SFI | | SFI | 1678 |SFT=41| |SFT=42| |SFT=41| |SFT=43| 1679 ------ ------ ------ ------ 1680 \ / \ / 1681 --------- --------- 1682 ---------- | SFF1 | | SFF2 | 1683 Packet --> | | |192.0.2.1| |192.0.2.2| 1684 Flows --> |Classifier| --------- --------- -->Dest 1685 | | --> 1686 ---------- --------- --------- 1687 | SFF3 | | SFF4 | 1688 |192.0.2.3| |192.0.2.4| 1689 --------- --------- 1690 / \ / \ 1691 ------ ------ ------ ------ 1692 | SFI | | SFI | | SFI | | SFI | 1693 |SFT=42| |SFT=44| |SFT=43| |SFT=44| 1694 ------ ------ ------ ------ 1696 Figure 11: Example Service Function Overlay Network 1698 The SFFs advertise routes to the SFIs they support. So we see the 1699 following SFIRs: 1701 RD = 192.0.2.1:1, SFT = 41 1702 RD = 192.0.2.1:2, SFT = 42 1703 RD = 192.0.2.2:1, SFT = 41 1704 RD = 192.0.2.2:2, SFT = 43 1705 RD = 192.0.2.3:7, SFT = 42 1706 RD = 192.0.2.3:8, SFT = 44 1707 RD = 192.0.2.4:5, SFT = 43 1708 RD = 192.0.2.4:6, SFT = 44 1710 Note that the addressing used for communicating between SFFs is taken 1711 from the Tunnel Encapsulation attribute of the SFIR and not from the 1712 SFIR-RD. 1714 8.1. Example Explicit SFP With No Choices 1716 Consider the following SFPR. 1718 SFP1: RD = 198.51.100.1:101, SPI = 15, 1719 [SI = 255, SFT = 41, RD = 192.0.2.1:1], 1720 [SI = 250, SFT = 43, RD = 192.0.2.2:2] 1722 The Service Function Path consists of an SF of type 41 located at 1723 SFF1 followed by an SF of type 43 located at SFF2. This path is 1724 fully explicit and each SFF is offered no choice in forwarding packet 1725 along the path. 1727 SFF1 will receive packets on the path from the Classifier and will 1728 identify the path from the SPI (15). The initial SI will be 255 and 1729 so SFF1 will deliver the packets to the SFI for SFT 41. 1731 When the packets are returned to SFF1 by the SFI the SI will be 1732 decreased to 250 for the next hop. SFF1 has no flexibility in the 1733 choice of SFF to support the next hop SFI and will forward the packet 1734 to SFF2 which will send the packets to the SFI that supports SFT 43 1735 before forwarding the packets to their destinations. 1737 8.2. Example SFP With Choice of SFIs 1739 SFP2: RD = 198.51.100.1:102, SPI = 16, 1740 [SI = 255, SFT = 41, RD = 192.0.2.1:1], 1741 [SI = 250, SFT = 43, {RD = 192.0.2.2:2, 1742 RD = 192.0.2.4:5 } ] 1744 In this example the path also consists of an SF of type 41 located at 1745 SFF1 and this is followed by an SF of type 43, but in this case the 1746 SI = 250 contains a choice between the SFI located at SFF2 and the 1747 SFI located at SFF4. 1749 SFF1 will receive packets on the path from the Classifier and will 1750 identify the path from the SPI (16). The initial SI will be 255 and 1751 so SFF1 will deliver the packets to the SFI for SFT 41. 1753 When the packets are returned to SFF1 by the SFI the SI will be 1754 decreased to 250 for the next hop. SFF1 now has a choice of next hop 1755 SFF to execute the next hop in the path. It can either forward 1756 packets to SFF2 or SFF4 to execute a function of type 43. It uses 1757 its local load balancing algorithm to make this choice. The chosen 1758 SFF will send the packets to the SFI that supports SFT 43 before 1759 forwarding the packets to their destinations. 1761 8.3. Example SFP With Open Choice of SFIs 1763 SFP3: RD = 198.51.100.1:103, SPI = 17, 1764 [SI = 255, SFT = 41, RD = 192.0.2.1:1], 1765 [SI = 250, SFT = 44, RD = 0] 1767 In this example the path also consists of an SF of type 41 located at 1768 SFF1 and this is followed by an SI with an RD of zero and SF of type 1769 44. This means that a choice can be made between any SFF that 1770 supports an SFI of type 44. 1772 SFF1 will receive packets on the path from the Classifier and will 1773 identify the path from the SPI (17). The initial SI will be 255 and 1774 so SFF1 will deliver the packets to the SFI for SFT 41. 1776 When the packets are returned to SFF1 by the SFI the SI will be 1777 decreased to 250 for the next hop. SFF1 now has a free choice of 1778 next hop SFF to execute the next hop in the path selecting between 1779 all SFFs that support SFs of type 44. Looking at the SFIRs it has 1780 received, SFF1 knows that SF type 44 is supported by SFF3 and SFF4. 1781 SFF1 uses its local load balancing algorithm to make this choice. 1782 The chosen SFF will send the packets to the SFI that supports SFT 44 1783 before forwarding the packets to their destinations. 1785 8.4. Example SFP With Choice of SFTs 1787 SFP4: RD = 198.51.100.1:104, SPI = 18, 1788 [SI = 255, SFT = 41, RD = 192.0.2.1:1], 1789 [SI = 250, {SFT = 43, RD = 192.0.2.2:2, 1790 SFT = 44, RD = 192.0.2.3:8 } ] 1792 This example provides a choice of SF type in the second hop in the 1793 path. The SI of 250 indicates a choice between SF type 43 located 1794 through SF2 and SF type 44 located at SF3. 1796 SFF1 will receive packets on the path from the Classifier and will 1797 identify the path from the SPI (18). The initial SI will be 255 and 1798 so SFF1 will deliver the packets to the SFI for SFT 41. 1800 When the packets are returned to SFF1 by the SFI the SI will be 1801 decreased to 250 for the next hop. SFF1 now has a free choice of 1802 next hop SFF to execute the next hop in the path selecting between 1803 all SFF2 that support an SF of type 43 and SFF3 that supports an SF 1804 of type 44. These may be completely different functions that are to 1805 be executed dependent on specific conditions, or may be similar 1806 functions identified with different type identifiers (such as 1807 firewalls from different vendors). SFF1 uses its local policy and 1808 load balancing algorithm to make this choice, and may use additional 1809 information passed back from the local SFI to help inform its 1810 selection. The chosen SFF will send the packets to the SFI that 1811 supports the chose SFT before forwarding the packets to their 1812 destinations. 1814 8.5. Example Correlated Bidirectional SFPs 1816 SFP5: RD = 198.51.100.1:105, SPI = 19, 1817 Assoc-Type = 1, Assoc-RD = 198.51.100.1:106, Assoc-SPI = 20, 1818 [SI = 255, SFT = 41, RD = 192.0.2.1:1], 1819 [SI = 250, SFT = 43, RD = 192.0.2.2:2] 1821 SFP6: RD = 198.51.100.1:106, SPI = 20, 1822 Assoc-Type = 1, Assoc-RD = 198.51.100.1:105, Assoc-SPI = 19, 1823 [SI = 254, SFT = 43, RD = 192.0.2.2:2], 1824 [SI = 249, SFT = 41, RD = 192.0.2.1:1] 1826 This example demonstrates correlation of two SFPs to form a 1827 bidirectional SFP as described in Section 7.1. 1829 Two SFPRs are advertised by the Controller. They have different SPIs 1830 (19 and 20) so they are known to be separate SFPs, but they both have 1831 Association TLVs with Association Type set to 1 indicating 1832 bidirectional SFPs. Each has an Associated SFPR-RD fields containing 1833 the value of the other SFPR-RD to correlated the two SFPs as a 1834 bidirectional pair. 1836 As can be seen from the SFPRs in this example, the paths are 1837 symmetric: the hops in SFP5 appear in the reverse order in SFP6. 1839 8.6. Example Correlated Asymmetrical Bidirectional SFPs 1840 SFP7: RD = 198.51.100.1:107, SPI = 21, 1841 Assoc-Type = 1, Assoc-RD = 198.51.100.1:108, Assoc-SPI = 22, 1842 [SI = 255, SFT = 41, RD = 192.0.2.1:1], 1843 [SI = 250, SFT = 43, RD = 192.0.2.2:2] 1845 SFP8: RD = 198.51.100.1:108, SPI = 22, 1846 Assoc-Type = 1, Assoc-RD = 198.51.100.1:107, Assoc-SPI = 21, 1847 [SI = 254, SFT = 44, RD = 192.0.2.4:6], 1848 [SI = 249, SFT = 41, RD = 192.0.2.1:1] 1850 Asymmetric bidirectional SFPs can also be created. This example 1851 shows a pair of SFPs with distinct SPIs (21 and 22) that are 1852 correlated in the same way as in the example in Section 8.5. 1854 However, unlike in that example, the SFPs are different in each 1855 direction. Both paths include a hop of SF type 41, but SFP7 includes 1856 a hop of SF type 43 supported at SFF2 while SFP8 includes a hop of SF 1857 type 44 supported at SFF4. 1859 8.7. Example Looping in an SFP 1861 SFP9: RD = 198.51.100.1:109: SPI = 23, 1862 [SI = 255, SFT = 41, RD = 192.0.2.1:1], 1863 [SI = 250, SFT = 44, RD = 192.0.2.4:5], 1864 [SI = 245, SFT = 1, RD = {SPI=23, SI=255, Rsv=0}], 1865 [SI = 245, SFT = 42, RD = 192.0.2.3:7] 1867 Looping and jumping are described in Section 6. This example shows 1868 an SFP that contains an explicit loop-back instruction that is 1869 presented as a choice within an SFP hop. 1871 The first two hops in the path (SI = 255 and SI = 250) are normal. 1872 That is, the packets will be delivered to SFF1 and SFF4 in turn for 1873 execution of SFs of type 41 and 44 respectively. 1875 The third hop (SI = 245) presents SFF4 with a choice of next hop. It 1876 can either forward the packets to SFF3 for an SF of type 42 (the 1877 second choice), or it can loop back. 1879 The loop-back entry in the SFPR for SI = 245 is indicated by the 1880 special purpose SFT value 1 ("Change Sequence"). Within this hop, 1881 the RD is interpreted as encoding the SPI and SI of the next hop (see 1882 Section 6.1. In this case the SPI is 23 which indicates that this is 1883 loop or branch: i.e., the next hop is on the same SFP. The SI is set 1884 to 255: this is a higher number than the current SI (245) indicating 1885 a loop. 1887 SFF4 must make a choice between these two next hops. Either the 1888 packets will be forwarded to SFF3 with the NSH SI decreased to 245 or 1889 looped back to SFF1 with the NSH SI reset to 255. This choice will 1890 be made according to local policy, information passed back by the 1891 local SFI, and details in the packets' metadata that are used to 1892 prevent infinite looping. 1894 8.8. Example Branching in an SFP 1896 SFP10: RD = 198.51.100.1:110, SPI = 24, 1897 [SI = 254, SFT = 42, RD = 192.0.2.3:7], 1898 [SI = 249, SFT = 43, RD = 192.0.2.2:2] 1900 SFP11: RD = 198.51.100.1:111, SPI = 25, 1901 [SI = 255, SFT = 41, RD = 192.0.2.1:1], 1902 [SI = 250, SFT = 1, RD = {SPI=24, SI=254, Rsv=0}] 1904 Branching follows a similar procedure to that for looping (and 1905 jumping) as shown in Section 8.7 however there are two SFPs involved. 1907 SFP10 shows a normal path with packets forwarded to SFF3 and SFF2 for 1908 execution of service functions of type 42 and 43 respectively. 1910 SFP11 starts as normal (SFF1 for an SF of type 41), but then SFF1 1911 processes the next hop in the path and finds a "Change Sequence" 1912 Special Purpose SFT. The SFIR-RD field includes an SPI of 24 which 1913 indicates SFP10, not the current SFP. The SI in the SFIR-RD is 254, 1914 so SFF1 knows that it must set the SPI/SI in the NSH to 24/254 and 1915 send the packets to the appropriate SFF as advertised in the SFPR for 1916 SFP10 (that is, SFF3). 1918 8.9. Examples of SFPs with Stateful Service Functions 1920 This section provides some examples to demonstrate establishing SFPs 1921 when there is a choice of service functions at a particular hop, and 1922 where consistency of choice is required in both directions. The 1923 scenarios that give rise to this requirement are discussed in 1924 Section 7.2. 1926 8.9.1. Forward and Reverse Choice Made at the SFF 1928 Consider the topology shown in Figure 12. There are three SFFs 1929 arranged neatly in a line, and the middle one (SFF2) supports three 1930 SFIs all of SFT 42. These three instances can be used by SFF2 to 1931 load balance so that no one instance is swamped. 1933 ------ ------ ------ ------ ------ 1934 | SFI | | SFIa | | SFIb | | SFIc | | SFI | 1935 |SFT=41| |SFT=42| |SFT=42| |SFT=42| |SFT=43| 1936 ------ ------\ ------ /------ ------ 1937 \ \ | / / 1938 --------- --------- --------- 1939 ---------- | SFF1 | | SFF2 | | SFF3 | 1940 --> | |..|192.0.2.1|...|192.0.2.2|...|192.0.2.3|--> 1941 --> |Classifier| --------- --------- --------- 1942 | | 1943 ---------- 1945 Figure 12: Example Where Choice is Made at the SFF 1947 This leads to the following SFIRs being advertised. 1949 RD = 192.0.2.1:11, SFT = 41 1950 RD = 192.0.2.2:11, SFT = 42 (for SFIa) 1951 RD = 192.0.2.2:12, SFT = 42 (for SFIb) 1952 RD = 192.0.2.2:13, SFT = 42 (for SFIc) 1953 RD = 192.0.2.3:11, SFT = 43 1955 The controller can create a single forward SFP giving SFF2 the choice 1956 of which SFI to use to provide function of SFT 42 as follows. The 1957 load-balancing choice between the three available SFIs is assumed to 1958 be within the capabilities of the SFF and if the SFs are stateful it 1959 is assumed that the SFF knows this and arranges load balancing in a 1960 stable, flow-dependent way. 1962 SFP12: RD = 198.51.100.1:112, SPI = 26, 1963 Assoc-Type = 1, Assoc-RD = 198.51.100.1:113, Assoc-SPI = 27, 1964 [SI = 255, SFT = 41, RD = 192.0.2.1:11], 1965 [SI = 254, SFT = 42, {RD = 192.0.2.2:11, 1966 192.0.2.2:12, 1967 192.0.2.2:13 }], 1968 [SI = 253, SFT = 43, RD = 192.0.2.3:11] 1970 The reverse SFP in this case may also be created as shown below using 1971 association with the forward SFP and giving the load-balancing choice 1972 to SFF2. This is safe, even in the case that the SFs of type 42 are 1973 stateful because SFF2 is doing the load balancing in both directions 1974 and can apply the same algorithm to ensure that packets associated 1975 with the same flow use the same SFI regardless of the direction of 1976 travel. 1978 How an SFF knows that an attached SFI is stateful is is out of scope 1979 of this document. It is assumed that this will form part of the 1980 process by which SFIs are registered as local to SFFs. Section 7.2 1981 provides additional observations about the coordination of the use of 1982 stateful SFIs in the case of bidirectional SFPs. 1984 In general, the problems of load balancing and the selection of the 1985 same SFIs in both directions of a bidirectional SPF can be addressed 1986 by using sufficiently precisely specified SFPs (specifying the exact 1987 SFIs to use) and suitable programming of the Classifiers at each end 1988 of the SFPs to make sure that the matching pair of SFPs are used. 1990 SFP13: RD = 198.51.100.1:113, SPI = 27, 1991 Assoc-Type = 1, Assoc-RD = 198.51.100.1:112, Assoc-SPI = 26, 1992 [SI = 255, SFT = 43, RD = 192.0.2.3:11], 1993 [SI = 254, SFT = 42, {RD = 192.0.2.2:11, 1994 192.0.2.2:12, 1995 192.0.2.2:13 }], 1996 [SI = 253, SFT = 41, RD = 192.0.2.1:11] 1998 8.9.2. Parallel End-to-End SFPs with Shared SFF 2000 The mechanism described in Section 8.9.1 might not be desirable 2001 because of the functional assumptions it places on SFF2 to be able to 2002 load balance with suitable flow identification, stability, and 2003 equality in both directions. Instead, it may be desirable to place 2004 the responsibility for flow classification in the Classifier and let 2005 it determine load balancing with the implied choice of SFIs. 2007 Consider the network graph as shown in Figure 12 and with the same 2008 set of SFIRs as listed in Section 8.9.1. In this case the controller 2009 could specify three forward SFPs with their corresponding associated 2010 reverse SFPs. Each bidirectional pair of SFPs uses a different SFI 2011 for the SF of type 42. The controller can instruct the Classifier 2012 how to place traffic on the three bidirectional SFPs, or can treat 2013 them as a group leaving the Classifier responsible for balancing the 2014 load. 2016 SFP14: RD = 198.51.100.1:114, SPI = 28, 2017 Assoc-Type = 1, Assoc-RD = 198.51.100.1:117, Assoc-SPI = 31, 2018 [SI = 255, SFT = 41, RD = 192.0.2.1:11], 2019 [SI = 254, SFT = 42, RD = 192.0.2.2:11], 2020 [SI = 253, SFT = 43, RD = 192.0.2.3:11] 2022 SFP15: RD = 198.51.100.1:115, SPI = 29, 2023 Assoc-Type = 1, Assoc-RD = 198.51.100.1:118, Assoc-SPI = 32, 2024 [SI = 255, SFT = 41, RD = 192.0.2.1:11], 2025 [SI = 254, SFT = 42, RD = 192.0.2.2:12], 2026 [SI = 253, SFT = 43, RD = 192.0.2.3:11] 2028 SFP16: RD = 198.51.100.1:116, SPI = 30, 2029 Assoc-Type = 1, Assoc-RD = 198.51.100.1:119, Assoc-SPI = 33, 2030 [SI = 255, SFT = 41, RD = 192.0.2.1:11], 2031 [SI = 254, SFT = 42, RD = 192.0.2.2:13], 2032 [SI = 253, SFT = 43, RD = 192.0.2.3:11] 2034 SFP17: RD = 198.51.100.1:117, SPI = 31, 2035 Assoc-Type = 1, Assoc-RD = 198.51.100.1:114, Assoc-SPI = 28, 2036 [SI = 255, SFT = 43, RD = 192.0.2.3:11], 2037 [SI = 254, SFT = 42, RD = 192.0.2.2:11], 2038 [SI = 253, SFT = 41, RD = 192.0.2.1:11] 2040 SFP18: RD = 198.51.100.1:118, SPI = 32, 2041 Assoc-Type = 1, Assoc-RD = 198.51.100.1:115, Assoc-SPI = 29, 2042 [SI = 255, SFT = 43, RD = 192.0.2.3:11], 2043 [SI = 254, SFT = 42, RD = 192.0.2.2:12], 2044 [SI = 253, SFT = 41, RD = 192.0.2.1:11] 2046 SFP19: RD = 198.51.100.1:119, SPI = 33, 2047 Assoc-Type = 1, Assoc-RD = 198.51.100.1:116, Assoc-SPI = 30, 2048 [SI = 255, SFT = 43, RD = 192.0.2.3:11], 2049 [SI = 254, SFT = 42, RD = 192.0.2.2:13], 2050 [SI = 253, SFT = 41, RD = 192.0.2.1:11] 2052 8.9.3. Parallel End-to-End SFPs with Separate SFFs 2054 While the examples in Section 8.9.1 and Section 8.9.2 place the 2055 choice of SFI as subtended from the same SFF, it is also possible 2056 that the SFIs are each subtended from a different SFF as shown in 2057 Figure 13. In this case it is harder to coordinate the choices for 2058 forward and reverse paths without some form of coordination between 2059 SFF1 and SFF3. Therefore it would be normal to consider end-to-end 2060 parallel SFPs as described in Section 8.9.2. 2062 ------ 2063 | SFIa | 2064 |SFT=42| 2065 ------ 2066 ------ | 2067 | SFI | --------- 2068 |SFT=41| | SFF5 | 2069 ------ ..|192.0.2.5|.. 2070 | ..: --------- :.. 2071 ---------.: :.--------- 2072 ---------- | SFF1 | --------- | SFF3 | 2073 --> | |..|192.0.2.1|....| SFF6 |....|192.0.2.3| --> 2074 --> |Classifier| ---------: |192.0.2.6| :--------- 2075 | | : --------- : | 2076 ---------- : | : ------ 2077 : ------ : | SFI | 2078 :.. | SFIb | ..: |SFT=43| 2079 :.. |SFT=42| ..: ------ 2080 : ------ : 2081 :.---------.: 2082 | SFF7 | 2083 |192.0.2.7| 2084 --------- 2085 | 2086 ------ 2087 | SFIc | 2088 |SFT=42| 2089 ------ 2091 Figure 13: Second Example With Parallel End-to-End SFPs 2093 In this case, five SFIRs are advertised as follows: 2095 RD = 192.0.2.1:11, SFT = 41 2096 RD = 192.0.2.5:11, SFT = 42 (for SFIa) 2097 RD = 192.0.2.6:11, SFT = 42 (for SFIb) 2098 RD = 192.0.2.7:11, SFT = 42 (for SFIc) 2099 RD = 192.0.2.3:11, SFT = 43 2101 In this case the controller could specify three forward SFPs with 2102 their corresponding associated reverse SFPs. Each bidirectional pair 2103 of SFPs uses a different SFF and SFI for middle hop (for an SF of 2104 type 42). The controller can instruct the Classifier how to place 2105 traffic on the three bidirectional SFPs, or can treat them as a group 2106 leaving the Classifier responsible for balancing the load. 2108 SFP20: RD = 198.51.100.1:120, SPI = 34, 2109 Assoc-Type = 1, Assoc-RD = 198.51.100.1:123, Assoc-SPI = 37, 2110 [SI = 255, SFT = 41, RD = 192.0.2.1:11], 2111 [SI = 254, SFT = 42, RD = 192.0.2.5:11], 2112 [SI = 253, SFT = 43, RD = 192.0.2.3:11] 2114 SFP21: RD = 198.51.100.1:121, SPI = 35, 2115 Assoc-Type = 1, Assoc-RD = 198.51.100.1:124, Assoc-SPI = 38, 2116 [SI = 255, SFT = 41, RD = 192.0.2.1:11], 2117 [SI = 254, SFT = 42, RD = 192.0.2.6:11], 2118 [SI = 253, SFT = 43, RD = 192.0.2.3:11] 2120 SFP22: RD = 198.51.100.1:122, SPI = 36, 2121 Assoc-Type = 1, Assoc-RD = 198.51.100.1:125, Assoc-SPI = 39, 2122 [SI = 255, SFT = 41, RD = 192.0.2.1:11], 2123 [SI = 254, SFT = 42, RD = 192.0.2.7:11], 2124 [SI = 253, SFT = 43, RD = 192.0.2.3:11] 2126 SFP23: RD = 198.51.100.1:123, SPI = 37, 2127 Assoc-Type = 1, Assoc-RD = 198.51.100.1:120, Assoc-SPI = 34, 2128 [SI = 255, SFT = 43, RD = 192.0.2.3:11], 2129 [SI = 254, SFT = 42, RD = 192.0.2.5:11], 2130 [SI = 253, SFT = 41, RD = 192.0.2.1:11] 2132 SFP24: RD = 198.51.100.1:124, SPI = 38, 2133 Assoc-Type = 1, Assoc-RD = 198.51.100.1:121, Assoc-SPI = 35, 2134 [SI = 255, SFT = 43, RD = 192.0.2.3:11], 2135 [SI = 254, SFT = 42, RD = 192.0.2.6:11], 2136 [SI = 253, SFT = 41, RD = 192.0.2.1:11] 2138 SFP25: RD = 198.51.100.1:125, SPI = 39, 2139 Assoc-Type = 1, Assoc-RD = 198.51.100.1:122, Assoc-SPI = 36, 2140 [SI = 255, SFT = 43, RD = 192.0.2.3:11], 2141 [SI = 254, SFT = 42, RD = 192.0.2.7:11], 2142 [SI = 253, SFT = 41, RD = 192.0.2.1:11] 2144 8.9.4. Parallel SFPs Downstream of the Choice 2146 The mechanism of parallel SFPs demonstrated in Section 8.9.3 is 2147 perfectly functional and may be practical in many environments. 2148 However, there may be scaling concerns because of the large amount of 2149 state (knowledge of SFPs, i.e., SFPR advertisements retained) if 2150 there is a very large amount of choice of SFIs (for example, tens of 2151 instances of the same stateful SF), or if there are multiple choices 2152 of stateful SF along a path. This situation may be mitigated using 2153 SFP fragments that are combined to form the end to end SFPs. 2155 The example presented here is necessarily simplistic, but should 2156 convey the basic principle. The example presented in Figure 14 is 2157 similar to that in Section 8.9.3 but with an additional first hop. 2159 ------ 2160 | SFIa | 2161 |SFT=43| 2162 ------ 2163 ------ ------ | 2164 | SFI | | SFI | --------- 2165 |SFT=41| |SFT=42| | SFF5 | 2166 ------ ------ ..|192.0.2.5|.. 2167 | | ..: --------- :.. 2168 --------- ---------.: :.--------- 2169 ------ | SFF1 | | SFF2 | --------- | SFF3 | 2170 -->|Class-|.|192.0.2.1|.|192.0.2.2|....| SFF6 |....|192.0.2.3|--> 2171 -->| ifier| --------- ---------: |192.0.2.6| :--------- 2172 ------ : --------- : | 2173 : | : ------ 2174 : ------ : | SFI | 2175 :.. | SFIb | ..: |SFT=44| 2176 :.. |SFT=43| ..: ------ 2177 : ------ : 2178 :.---------.: 2179 | SFF7 | 2180 |192.0.2.7| 2181 --------- 2182 | 2183 ------ 2184 | SFIc | 2185 |SFT=43| 2186 ------ 2188 Figure 14: Example With Parallel SFPs Downstream of Choice 2190 The six SFIs are advertised as follows: 2192 RD = 192.0.2.1:11, SFT = 41 2193 RD = 192.0.2.2:11, SFT = 42 2194 RD = 192.0.2.5:11, SFT = 43 (for SFIa) 2195 RD = 192.0.2.6:11, SFT = 43 (for SFIb) 2196 RD = 192.0.2.7:11, SFT = 43 (for SFIc) 2197 RD = 192.0.2.3:11, SFT = 44 2199 SFF2 is the point at which a load balancing choice must be made. So 2200 "tail-end" SFPs are constructed as follows. Each takes in a 2201 different SFF that provides access to an SF of type 43. 2203 SFP26: RD = 198.51.100.1:126, SPI = 40, 2204 Assoc-Type = 1, Assoc-RD = 198.51.100.1:130, Assoc-SPI = 44, 2205 [SI = 255, SFT = 43, RD = 192.0.2.5:11], 2206 [SI = 254, SFT = 44, RD = 192.0.2.3:11] 2208 SFP27: RD = 198.51.100.1:127, SPI = 41, 2209 Assoc-Type = 1, Assoc-RD = 198.51.100.1:131, Assoc-SPI = 45, 2210 [SI = 255, SFT = 43, RD = 192.0.2.6:11], 2211 [SI = 254, SFT = 44, RD = 192.0.2.3:11] 2213 SFP28: RD = 198.51.100.1:128, SPI = 42, 2214 Assoc-Type = 1, Assoc-RD = 198.51.100.1:132, Assoc-SPI = 46, 2215 [SI = 255, SFT = 43, RD = 192.0.2.7:11], 2216 [SI = 254, SFT = 44, RD = 192.0.2.3:11] 2218 Now an end-to-end SFP with load balancing choice can be constructed 2219 as follows. The choice made by SFF2 is expressed in terms of 2220 entering one of the three "tail end" SFPs. 2222 SFP29: RD = 198.51.100.1:129, SPI = 43, 2223 [SI = 255, SFT = 41, RD = 192.0.2.1:11], 2224 [SI = 254, SFT = 42, RD = 192.0.2.2:11], 2225 [SI = 253, {SFT = 1, RD = {SPI=40, SI=255, Rsv=0}, 2226 RD = {SPI=41, SI=255, Rsv=0}, 2227 RD = {SPI=42, SI=255, Rsv=0} } ] 2229 Now, despite the load balancing choice being made other than at the 2230 initial classifier, it is possible for the reverse SFPs to be well- 2231 constructed without any ambiguity. The three reverse paths appear as 2232 follows. 2234 SFP30: RD = 198.51.100.1:130, SPI = 44, 2235 Assoc-Type = 1, Assoc-RD = 198.51.100.1:126, Assoc-SPI = 40, 2236 [SI = 255, SFT = 44, RD = 192.0.2.4:11], 2237 [SI = 254, SFT = 43, RD = 192.0.2.5:11], 2238 [SI = 253, SFT = 42, RD = 192.0.2.2:11], 2239 [SI = 252, SFT = 41, RD = 192.0.2.1:11] 2241 SFP31: RD = 198.51.100.1:131, SPI = 45, 2242 Assoc-Type = 1, Assoc-RD = 198.51.100.1:127, Assoc-SPI = 41, 2243 [SI = 255, SFT = 44, RD = 192.0.2.4:11], 2244 [SI = 254, SFT = 43, RD = 192.0.2.6:11], 2245 [SI = 253, SFT = 42, RD = 192.0.2.2:11], 2246 [SI = 252, SFT = 41, RD = 192.0.2.1:11] 2248 SFP32: RD = 198.51.100.1:132, SPI = 46, 2249 Assoc-Type = 1, Assoc-RD = 198.51.100.1:128, Assoc-SPI = 42, 2250 [SI = 255, SFT = 44, RD = 192.0.2.4:11], 2251 [SI = 254, SFT = 43, RD = 192.0.2.7:11], 2252 [SI = 253, SFT = 42, RD = 192.0.2.2:11], 2253 [SI = 252, SFT = 41, RD = 192.0.2.1:11] 2255 9. Security Considerations 2257 This document inherits all the security considerations discussed in 2258 the documents that specify BGP, the documents that specify BGP 2259 Multiprotocol Extensions, and the documents that define the 2260 attributes that are carried by BGP UPDATEs of the SFC AFI/SAFI. For 2261 more information look in [RFC4271], [RFC4760], and 2262 [I-D.ietf-idr-tunnel-encaps]. 2264 Service Function Chaining provides a significant attack opportunity: 2265 packets can be diverted from their normal paths through the network, 2266 can be made to execute unexpected functions, and the functions that 2267 are instantiated in software can be subverted. However, this 2268 specification does not change the existence of Service Function 2269 Chaining and security issues specific to Service Function Chaining 2270 are covered in [RFC7665] and [RFC8300]. 2272 This document defines a control plane for Service Function Chaining. 2273 Clearly, this provides an attack vector for a Service Function 2274 Chaining system as an attack on this control plane could be used to 2275 make the system misbehave. Thus, the security of the BGP system is 2276 critically important to the security of the whole Service Function 2277 Chaining system. The control plane mechanisms are very similar to 2278 those used for BGP/MPLS IP VPNs as described in [RFC4364], and so the 2279 security considerations in that document (Section 23) provide good 2280 guidance for securing SFC systems reliant on this specification. 2281 Section 19 of [RFC7432] also provides useful guidance on the use of 2282 BGP in a similar environment. 2284 Note that a component of an SFC system that uses the procedures 2285 described in this document also requires communications between a 2286 controller and the SFC network elements. This communication covers 2287 instructing the Classifiers using BGP mechanisms (see Section 7.4) 2288 which is covered by BGP security. But it also covers other 2289 mechanisms for programming the Classifier and instructing the SFFs 2290 and SFs (for example, to bind SFs to an SFF, and to cause the 2291 establishment of tunnels between SFFs). This document does not cover 2292 these latter mechanisms and so their security is out of scope, but it 2293 should be noted that these communications provide an attack vector on 2294 the SFC system and so attention must be paid to ensuring that they 2295 are secure. 2297 10. IANA Considerations 2299 10.1. New BGP AF/SAFI 2301 IANA maintains a registry of "Address Family Numbers". IANA is 2302 requested to assign a new Address Family Number from the "Standards 2303 Action" range called "BGP SFC" (TBD1 in this document) with this 2304 document as a reference. 2306 IANA maintains a registry of "Subsequent Address Family Identifiers 2307 (SAFI) Parameters". IANA is requested to assign a new SAFI value 2308 from the "Standards Action" range called "BGP SFC" (TBD2 in this 2309 document) with this document as a reference. 2311 10.2. New BGP Path Attribute 2313 IANA maintains a registry of "Border Gateway Protocol (BGP) 2314 Parameters" with a subregistry of "BGP Path Attributes". IANA is 2315 requested to assign a new Path attribute called "SFP attribute" (TBD3 2316 in this document) with this document as a reference. 2318 10.3. New SFP Attribute TLVs Type Registry 2320 IANA maintains a registry of "Border Gateway Protocol (BGP) 2321 Parameters". IANA is request to create a new subregistry called the 2322 "SFP Attribute TLVs" registry. 2324 Valid values are in the range 0 to 65535. 2326 o Values 0 and 65535 are to be marked "Reserved, not to be 2327 allocated". 2329 o Values 1 through 65524 are to be assigned according to the "First 2330 Come First Served" policy [RFC8126]. 2332 This document should be given as a reference for this registry. 2334 The new registry should track: 2336 o Type 2338 o Name 2340 o Reference Document or Contact 2342 o Registration Date 2344 The registry should initially be populated as follows: 2346 Type | Name | Reference | Date 2347 ------+-------------------------+---------------+--------------- 2348 1 | Association TLV | [This.I-D] | Date-to-be-set 2349 2 | Hop TLV | [This.I-D] | Date-to-be-set 2350 3 | SFT TLV | [This.I-D] | Date-to-be-set 2351 4 | MPLS Swapping/Stacking | [This.I-D] | Date-to-be-set 2352 5 | SFP Traversal With MPLS | [This.I-D] | Date-to-be-set 2354 10.4. New SFP Association Type Registry 2356 IANA maintains a registry of "Border Gateway Protocol (BGP) 2357 Parameters". IANA is request to create a new subregistry called the 2358 "SFP Association Type" registry. 2360 Valid values are in the range 0 to 65535. 2362 o Values 0 and 65535 are to be marked "Reserved, not to be 2363 allocated". 2365 o Values 1 through 65524 are to be assigned according to the "First 2366 Come First Served" policy [RFC8126]. 2368 This document should be given as a reference for this registry. 2370 The new registry should track: 2372 o Association Type 2374 o Name 2375 o Reference Document or Contact 2377 o Registration Date 2379 The registry should initially be populated as follows: 2381 Association Type | Name | Reference | Date 2382 -----------------+--------------------+------------+--------------- 2383 1 | Bidirectional SFP | [This.I-D] | Date-to-be-set 2385 10.5. New Service Function Type Registry 2387 IANA is request to create a new top-level registry called "Service 2388 Function Chaining Service Function Types". 2390 Valid values are in the range 0 to 65535. 2392 o Values 0 and 65535 are to be marked "Reserved, not to be 2393 allocated". 2395 o Values 1 through 31 are to be assigned by "Standards Action" 2396 [RFC8126] and are referred to as the Special Purpose SFT values. 2398 o Other values (32 through 65534) are to be assigned according to 2399 the "First Come First Served" policy [RFC8126]. 2401 This document should be given as a reference for this registry. 2403 The new registry should track: 2405 o Value 2407 o Name 2409 o Reference Document or Contact 2411 o Registration Date 2413 The registry should initially be populated as follows: 2415 Value | Name | Reference | Date 2416 ------+-----------------------+---------------+--------------- 2417 1 | Change Sequence | [This.I-D] | Date-to-be-set 2419 10.6. New Generic Transitive Experimental Use Extended Community Sub- 2420 Types 2422 IANA maintains a registry of "Border Gateway Protocol (BGP) 2423 Parameters" with a subregistry of "Generic Transitive Experimental 2424 Use Extended Community Sub-Type". IANA is requested to assign a new 2425 sub-type as follows: 2427 "Flow Spec for SFC Classifiers" (TBD4 in this document) with this 2428 document as the reference. 2430 10.7. New BGP Transitive Extended Community Types 2432 IANA maintains a registry of "Border Gateway Protocol (BGP) 2433 Parameters" with a subregistry of "BGP Transitive Extended Community 2434 Types". IANA is requested to assign new types as follows: 2436 "SFI Pool Identifier" (TBD6 in this document) with this document 2437 as the reference. 2439 "MPLS Label Stack Mixed Swapping/Stacking Labels" (TBD7 in this 2440 document) with this document as the reference. 2442 10.8. SPI/SI Representation 2444 IANA is requested to assign a codepoint from the "BGP Tunnel 2445 Encapsulation Attribute Sub-TLVs" registry for the "SPI/SI 2446 Representation Sub-TLV" (TBD5 in this document) with this document 2447 being the reference. 2449 11. Contributors 2451 Stuart Mackie 2452 Juniper Networks 2454 Email: wsmackie@juinper.net 2456 Keyur Patel 2457 Arrcus, Inc. 2459 Email: keyur@arrcus.com 2461 Avinash Lingala 2462 AT&T 2464 Email: ar977m@att.com 2466 12. Acknowledgements 2468 Thanks to Tony Przygienda, Jeff Haas, and Andy Malis for helpful 2469 comments, and to Joel Halpern for discussions that improved this 2470 document. Yuanlong Jiang provided a useful review and caught some 2471 important issues. Stephane Litkowski did an exceptionally good and 2472 detailed document shepherd review. 2474 Andy Malis contributed text that formed the basis of Section 7.7. 2476 13. References 2478 13.1. Normative References 2480 [I-D.ietf-idr-rfc5575bis] 2481 Loibl, C., Hares, S., Raszuk, R., McPherson, D., and M. 2482 Bacher, "Dissemination of Flow Specification Rules", 2483 draft-ietf-idr-rfc5575bis-17 (work in progress), June 2484 2019. 2486 [I-D.ietf-idr-tunnel-encaps] 2487 Patel, K., Velde, G., Ramachandra, S., and E. Rosen, "The 2488 BGP Tunnel Encapsulation Attribute", draft-ietf-idr- 2489 tunnel-encaps-13 (work in progress), July 2019. 2491 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2492 Requirement Levels", BCP 14, RFC 2119, 2493 DOI 10.17487/RFC2119, March 1997, 2494 . 2496 [RFC4271] Rekhter, Y., Ed., Li, T., Ed., and S. Hares, Ed., "A 2497 Border Gateway Protocol 4 (BGP-4)", RFC 4271, 2498 DOI 10.17487/RFC4271, January 2006, 2499 . 2501 [RFC4364] Rosen, E. and Y. Rekhter, "BGP/MPLS IP Virtual Private 2502 Networks (VPNs)", RFC 4364, DOI 10.17487/RFC4364, February 2503 2006, . 2505 [RFC4760] Bates, T., Chandra, R., Katz, D., and Y. Rekhter, 2506 "Multiprotocol Extensions for BGP-4", RFC 4760, 2507 DOI 10.17487/RFC4760, January 2007, 2508 . 2510 [RFC5575] Marques, P., Sheth, N., Raszuk, R., Greene, B., Mauch, J., 2511 and D. McPherson, "Dissemination of Flow Specification 2512 Rules", RFC 5575, DOI 10.17487/RFC5575, August 2009, 2513 . 2515 [RFC7432] Sajassi, A., Ed., Aggarwal, R., Bitar, N., Isaac, A., 2516 Uttaro, J., Drake, J., and W. Henderickx, "BGP MPLS-Based 2517 Ethernet VPN", RFC 7432, DOI 10.17487/RFC7432, February 2518 2015, . 2520 [RFC7606] Chen, E., Ed., Scudder, J., Ed., Mohapatra, P., and K. 2521 Patel, "Revised Error Handling for BGP UPDATE Messages", 2522 RFC 7606, DOI 10.17487/RFC7606, August 2015, 2523 . 2525 [RFC7665] Halpern, J., Ed. and C. Pignataro, Ed., "Service Function 2526 Chaining (SFC) Architecture", RFC 7665, 2527 DOI 10.17487/RFC7665, October 2015, 2528 . 2530 [RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for 2531 Writing an IANA Considerations Section in RFCs", BCP 26, 2532 RFC 8126, DOI 10.17487/RFC8126, June 2017, 2533 . 2535 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2536 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 2537 May 2017, . 2539 [RFC8300] Quinn, P., Ed., Elzur, U., Ed., and C. Pignataro, Ed., 2540 "Network Service Header (NSH)", RFC 8300, 2541 DOI 10.17487/RFC8300, January 2018, 2542 . 2544 [RFC8595] Farrel, A., Bryant, S., and J. Drake, "An MPLS-Based 2545 Forwarding Plane for Service Function Chaining", RFC 8595, 2546 DOI 10.17487/RFC8595, June 2019, 2547 . 2549 [RFC8596] Malis, A., Bryant, S., Halpern, J., and W. Henderickx, 2550 "MPLS Transport Encapsulation for the Service Function 2551 Chaining (SFC) Network Service Header (NSH)", RFC 8596, 2552 DOI 10.17487/RFC8596, June 2019, 2553 . 2555 13.2. Informative References 2557 [RFC7498] Quinn, P., Ed. and T. Nadeau, Ed., "Problem Statement for 2558 Service Function Chaining", RFC 7498, 2559 DOI 10.17487/RFC7498, April 2015, 2560 . 2562 Authors' Addresses 2564 Adrian Farrel 2565 Old Dog Consulting 2567 Email: adrian@olddog.co.uk 2569 John Drake 2570 Juniper Networks 2572 Email: jdrake@juniper.net 2574 Eric Rosen 2575 Juniper Networks 2577 Email: erosen52@gmail.com 2579 Jim Uttaro 2580 AT&T 2582 Email: ju1738@att.com 2584 Luay Jalil 2585 Verizon 2587 Email: luay.jalil@verizon.com