idnits 2.17.1 draft-ietf-bess-nsh-bgp-control-plane-11.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 (May 30, 2019) is 1791 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-15 == Outdated reference: A later version (-22) exists of draft-ietf-idr-tunnel-encaps-12 ** Downref: Normative reference to an Informational draft: draft-ietf-mpls-sfc-encapsulation (ref. 'I-D.ietf-mpls-sfc-encapsulation') ** Obsolete normative reference: RFC 5575 (Obsoleted by RFC 8955) ** Downref: Normative reference to an Informational RFC: RFC 7665 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: December 1, 2019 E. Rosen 6 Juniper Networks 7 J. Uttaro 8 AT&T 9 L. Jalil 10 Verizon 11 May 30, 2019 13 BGP Control Plane for NSH SFC 14 draft-ietf-bess-nsh-bgp-control-plane-11 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 December 1, 2019. 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 in 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 . . . . . . . . . . . . . . . . . . . . . . . 30 92 7.1. Correlating Service Function Path Instances . . . . . . . 30 93 7.2. Considerations for Stateful Service Functions . . . . . . 31 94 7.3. VPN Considerations and Private Service Functions . . . . 32 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 . . . . . . . . . . 35 99 7.6. MPLS Label Swapping/Stacking Operation . . . . . . . . . 35 100 7.7. Support for MPLS-Encapsulated NSH Packets . . . . . . . . 36 101 8. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 36 102 8.1. Example Explicit SFP With No Choices . . . . . . . . . . 38 103 8.2. Example SFP With Choice of SFIs . . . . . . . . . . . . . 38 104 8.3. Example SFP With Open Choice of SFIs . . . . . . . . . . 39 105 8.4. Example SFP With Choice of SFTs . . . . . . . . . . . . . 39 106 8.5. Example Correlated Bidirectional SFPs . . . . . . . . . . 40 107 8.6. Example Correlated Asymmetrical Bidirectional SFPs . . . 41 108 8.7. Example Looping in an SFP . . . . . . . . . . . . . . . . 41 109 8.8. Example Branching in an SFP . . . . . . . . . . . . . . . 42 110 8.9. Examples of SFPs with Stateful Service Functions . . . . 43 111 8.9.1. Forward and Reverse Choice Made at the SFF . . . . . 43 112 8.9.2. Parallel End-to-End SFPs with Shared SFF . . . . . . 44 113 8.9.3. Parallel End-to-End SFPs with Separate SFFs . . . . . 46 114 8.9.4. Parallel SFPs Downstream of the Choice . . . . . . . 48 115 9. Security Considerations . . . . . . . . . . . . . . . . . . . 51 116 10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 52 117 10.1. New BGP AF/SAFI . . . . . . . . . . . . . . . . . . . . 52 118 10.2. New BGP Path Attribute . . . . . . . . . . . . . . . . . 52 119 10.3. New SFP Attribute TLVs Type Registry . . . . . . . . . . 52 120 10.4. New SFP Association Type Registry . . . . . . . . . . . 53 121 10.5. New Service Function Type Registry . . . . . . . . . . . 54 122 10.6. New Generic Transitive Experimental Use Extended 123 Community Sub-Types . . . . . . . . . . . . . . . . . . 55 124 10.7. New BGP Transitive Extended Community Types . . . . . . 55 125 10.8. SPI/SI Representation . . . . . . . . . . . . . . . . . 55 126 11. Contributors . . . . . . . . . . . . . . . . . . . . . . . . 55 127 12. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 56 128 13. References . . . . . . . . . . . . . . . . . . . . . . . . . 56 129 13.1. Normative References . . . . . . . . . . . . . . . . . . 56 130 13.2. Informative References . . . . . . . . . . . . . . . . . 57 131 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 58 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 [I-D.ietf-mpls-sfc]. Each label is 20 bits encoded in a 599 3-octet (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. An implementation MAY time-out such 751 stored SFP attributes to avoid becoming over-loaded. The time- 752 out value should be configurable and measured in minutes; a 753 default value of 30 minutes is suggested. Whenever an 754 implementation removes a stored SFP attribute, it SHOULD 755 generate a notification to the network operator. 757 3.2.1.1. The Association TLV 759 The Association TLV is an optional TLV in the SFP attribute. It MAY 760 be present multiple times. Each occurrence provides an association 761 with another SFP as advertised in another SFPR. The format of the 762 Association TLV is shown in Figure 7 764 +--------------------------------------------+ 765 | Type = 1 (1 octet) | 766 +--------------------------------------------| 767 | Length (2 octets) | 768 +--------------------------------------------| 769 | Association Type (1 octet) | 770 +--------------------------------------------| 771 | Associated SFPR-RD (8 octets) | 772 +--------------------------------------------| 773 | Associated SPI (3 octets) | 774 +--------------------------------------------+ 776 Figure 7: The Format of the Association TLV 778 The fields are as follows: 780 Type is set to 1 to indicate an Association TLV. 782 Length indicates the length in octets of the Association Type and 783 Associated SFPR-RD fields. The value of the Length field is 12. 785 The Association Type field indicate the type of association. The 786 values are tracked in an IANA registry (see Section 10.4). Only 787 one value is defined in this document: type 1 indicates 788 association of two unidirectional SFPs to form a bidirectional 789 SFP. An SFP attribute SHOULD NOT contain more than one 790 Association TLV with Association Type 1: if more than one is 791 present, the first one MUST be processed and subsequent instances 792 MUST be ignored. Note that documents that define new Association 793 Types must also define the presence rules for Association TLVs of 794 the new type. 796 The Associated SFPR-RD contains the RD of the associated SFP as 797 advertised in an SFPR. 799 The Associated SPI contains the SPI of the associated SFP as 800 advertised in an SFPR. 802 Association TLVs with unknown Association Type values SHOULD be 803 ignored. Association TLVs that contain an Associated SFPR-RD value 804 equal to the RD of the SFPR in which they are contained SHOULD be 805 ignored. If the Associated SPI is not equal to the SPI advertised in 806 the SFPR indicated by the Associated SFPR-RD then the Association TLV 807 SHOULD be ignored. 809 Note that when two SFPRs reference each other using the Association 810 TLV, one SFPR advertisement will be received before the other. 811 Therefore, processing of an association MUST NOT be rejected simply 812 because the Associated SFPR-RD is unknown. 814 Further discussion of correlation of SFPRs is provided in 815 Section 7.1. 817 3.2.1.2. The Hop TLV 819 There is one Hop TLV in the SFP attribute for each hop in the SFP. 820 The format of the Hop TLV is shown in Figure 8. At least one Hop TLV 821 MUST be present in an SFP attribute. 823 +--------------------------------------------+ 824 | Type = 2 (1 octet) | 825 +--------------------------------------------| 826 | Length (2 octets) | 827 +--------------------------------------------| 828 | Service Index (1 octet) | 829 +--------------------------------------------| 830 | Hop Details (variable) | 831 +--------------------------------------------+ 833 Figure 8: The Format of the Hop TLV 835 The fields are as follows: 837 Type is set to 2 to indicate a Hop TLV. 839 Length indicates the length in octets of the Service Index and Hop 840 Details fields. 842 The Service Index is defined in [RFC8300] and is the value found 843 in the Service Index field of the NSH header that an SFF will use 844 to lookup to which next SFI a packet should be sent. 846 The Hop Details field consists of a sequence of one or more sub- 847 TLVs. 849 Each hop of the SFP may demand that a specific type of SF is 850 executed, and that type is indicated in sub-TLVs of the Hop TLV. At 851 least one sub-TLV MUST be present. This provides a list of which 852 types of SF are acceptable at a specific hop, and for each type it 853 allows a degree of control to be imposed on the choice of SFIs of 854 that particular type. 856 If no Hop TLV is present in an SFP Attribute, it is a malformed 857 attribute 859 3.2.1.3. The SFT TLV 861 The SFT TLV MAY be included in the list of sub-TLVs of the Hop TLV. 862 The format of the SFT TLV is shown in Figure 9. The TLV contains a 863 list of SFIR-RD values each taken from the advertisement of an SFI. 864 Together they form a list of acceptable SFIs of the indicated type. 866 +--------------------------------------------+ 867 | Type = 3 (1 octet) | 868 +--------------------------------------------| 869 | Length (2 octets) | 870 +--------------------------------------------| 871 | Service Function Type (2 octets) | 872 +--------------------------------------------| 873 | SFIR-RD List (variable) | 874 +--------------------------------------------+ 876 Figure 9: The Format of the SFT TLV 878 The fields are as follows: 880 Type is set to 3 to indicate an SFT TLV. 882 Length indicates the length in octets of the Service Function Type 883 and SFIR-RD List fields. 885 The Service Function Type value indicates the category (type) of 886 SF that is to be executed at this hop. The types are as 887 advertised for the SFs supported by the SFFs SFT values in the 888 range 1-31 are Special Purpose SFT values and have meanings 889 defined by the documents that describe them - the value 'Change 890 Sequence' is defined in Section 6.1 of this document. 892 The hop description is further qualified beyond the specification 893 of the SFTs by listing, for each SFT in each hop, the SFIs that 894 may be used at the hop. The SFIs are identified using the SFIR- 895 RDs from the advertisements of the SFIs in the SFIRs. Note that 896 if the list contains one or more SFI Pool Identifiers, then for 897 each the SFIR-RD list is effectively expanded to include the SFIR- 898 RD of each SFIR advertised with that SFI Pool Identifier. An 899 SFIR-RD of value zero has special meaning as described in 900 Section 5. Each entry in the list is eight octets long, and the 901 number of entries in the list can be deduced from the value of the 902 Length field. 904 3.2.1.4. MPLS Swapping/Stacking TLV 906 The MPLS Swapping/Stacking TLV (Type value 4) is a zero length sub- 907 TLV that is OPTIONAL in the Hop TLV and is used when the data 908 representation is MPLS (see Section 7.5). When present it indicates 909 to the Classifier imposing an MPLS label stack that the current hop 910 is to use an {SFC Context Label, SF label} rather than an {SPI, SF} 911 label pair. See Section 7.6 for more details. 913 3.2.1.5. SFP Traversal With MPLS Label Stack TLV 915 The SFP Traversal With MPLS Label Stack TLV (Type value 5) is a zero 916 length sub-TLV that can be carried in the SFP Attribute and indicates 917 to the Classifier and the SFFs on the SFP that an MPLS labels stack 918 with label swapping/stacking is to be used for packets traversing the 919 SFP. All of the SFF specified at each the SFP's hops MUST have 920 advertised an MPLS Mixed Swapping/Stacking Extended Community (see 921 Section 3.1.2) for the SFP to be considered usable. 923 3.2.2. General Rules For The SFP Attribute 925 It is possible for the same SFI, as described by an SFIR, to be used 926 in multiple SFPRs. 928 When two SFPRs have the same SPI but different SFPR-RDs there can be 929 three cases: 931 o Two or more Controllers are originating SFPRs for the same SFP. 932 In this case the content of the SFPRs is identical and the 933 duplication is to ensure receipt and to provide Controller 934 redundancy. 936 o There is a transition in content of the advertised SFP and the 937 advertisements may originate from one or more Controllers. In 938 this case the content of the SFPRs will be different. 940 o The reuse of an SPI may result from a configuration error. 942 In all cases, there is no way for the receiving SFF to know which 943 SFPR to process, and the SFPRs could be received in any order. At 944 any point in time, when multiple SFPRs have the same SPI but 945 different SFPR-RDs, the SFF MUST use the SFPR with the numerically 946 lowest SFPR-RD. The SFF SHOULD log this occurrence to assist with 947 debugging. 949 Furthermore, a Controller that wants to change the content of an SFP 950 is RECOMMENDED to use a new SPI and so create a new SFP onto which 951 the Classifiers can transition packet flows before the SFPR for the 952 old SFP is withdrawn. This avoids any race conditions with SFPR 953 advertisements. 955 Additionally, a Controller SHOULD NOT re-use an SPI after it has 956 withdrawn the SFPR that used it until at least a configurable amount 957 of time has passed. This timer SHOULD have a default of one hour. 959 4. Mode of Operation 961 This document describes the use of BGP as a control plane to create 962 and manage a service function overlay network. 964 4.1. Route Targets 966 The main feature introduced by this document is the ability to create 967 multiple service function overlay networks through the use of Route 968 Targets (RTs) [RFC4364]. 970 Every BGP UPDATE containing an SFIR or SFPR carries one or more RTs. 971 The RT carried by a particular SFIR or SFPR is determined by the 972 provisioning of the route's originator. 974 Every node in a service function overlay network is configured with 975 one or more import RTs. Thus, each SFF will import only the SFPRs 976 with matching RTs allowing the construction of multiple service 977 function overlay networks or the instantiation of Service Function 978 Chains within an L3VPN or EVPN instance (see Section 7.3). An SFF 979 that has a presence in multiple service function overlay networks 980 (i.e., imports more than one RT) will usually maintain separate 981 forwarding state for each overlay network. 983 4.2. Service Function Instance Routes 985 The SFIR (see Section 3.1) is used to advertise the existence and 986 location of a specific Service Function Instance and consists of: 988 o The RT as just described. 990 o A Service Function Type (SFT) that is the type of service function 991 that is provided (such as "firewall"). 993 o A Route Distinguisher (RD) that is unique to a specific instance 994 of a service function. 996 4.3. Service Function Path Routes 998 The SFPR (see Section 3.2) describes a specific path of a Service 999 Function Chain. The SFPR contains the Service Path Identifier (SPI) 1000 used to identify the SFP in the NSH in the data plane. It also 1001 contains a sequence of Service Indexes (SIs). Each SI identifies a 1002 hop in the SFP, and each hop is a choice between one of more SFIs. 1004 As described in this document, each Service Function Path Route is 1005 identified in the service function overlay network by an RD and an 1006 SPI. The SPI is unique within a single VPN instance supported by the 1007 underlay network. 1009 The SFPR advertisement comprises: 1011 o An RT as described in Section 4.1. 1013 o A tuple that identifies the SFPR 1015 * An RD that identifies an advertisement of an SFPR. 1017 * The SPI that uniquely identifies this path within the VPN 1018 instance distinguished by the RD. This SPI also appears in the 1019 NSH. 1021 o A series of Service Indexes. Each SI is used in the context of a 1022 particular SPI and identifies one or more SFs (distinguished by 1023 their SFTs) and for each SF a set of SFIs that instantiate the SF. 1024 The values of the SI indicate the order in which the SFs are to be 1025 executed in the SFP that is represented by the SPI. 1027 o The SI is used in the NSH to identify the entries in the SFP. 1028 Note that the SI values have meaning only relative to a specific 1029 path. They have no semantic other than to indicate the order of 1030 Service Functions within the path and are assumed to be 1031 monotonically decreasing from the start to the end of the path 1032 [RFC8300]. 1034 o Each Service Index is associated with a set of one or more Service 1035 Function Instances that can be used to provide the indexed Service 1036 Function within the path. Each member of the set comprises: 1038 * The RD used in an SFIR advertisement of the SFI. 1040 * The SFT that indicates the type of function as used in the same 1041 SFIR advertisement of the SFI. 1043 This may be summarized as follows where the notations "SFPR-RD" and 1044 "SFIR-RD" are used to distinguish the two different RDs: 1046 RT, {SFPR-RD, SPI}, m * {SI, {n * {SFT, p * SFIR-RD} } } 1048 Where: 1050 RT: Route Target 1052 SFPR-RD: The Route Descriptor of the Service Function Path Route 1053 advertisement 1054 SPI: Service Path Identifier used in the NSH 1056 m: The number of hops in the Service Function Path 1058 n: The number of choices of Service Function Type for a specific 1059 hop 1061 p: The number of choices of Service Function Instance for given 1062 Service Function Type in a specific hop 1064 SI: Service Index used in the NSH to indicate a specific hop 1066 SFT: The Service Function Type used in the same advertisement of 1067 the Service Function Instance Route 1069 SFIR-RD: The Route Descriptor used in an advertisement of the 1070 Service Function Instance Route 1072 Note that the values of SI are from the set {255, ..., 1} and are 1073 monotonically decreasing within the SFP. SIs MUST appear in order 1074 within the SFPR (i.e., monotonically decreasing) and MUST NOT appear 1075 more than once. Gaps MAY appear in the sequence as described in 1076 Section 4.5.1. Malformed SFPRs MUST be discarded and MUST cause any 1077 previous instance of the SFPR (same SFPR-RD and SPI) to be discarded. 1079 Note that if the SFIR-RD list in an SFT TLV contains one or more SFI 1080 Pool identifiers, then in the above expression, 'p' is the sum of the 1081 number of individual SFIR-RD values and the sum for each SFI Pool 1082 Identifier of the number of SFIRs advertised with that SFI Pool 1083 Identifier. I.e., the list of SFIR-RD values is effectively expanded 1084 to include the SFIR-RD of each SFIR advertised with each SFI Pool 1085 Identifier in the SFIR-RD list. 1087 The choice of SFI is explained further in Section 5. Note that an 1088 SFIR-RD value of zero has special meaning as described in that 1089 Section. 1091 4.4. Classifier Operation 1093 As shown in Figure 1, the Classifier is a component that is used to 1094 assign packets to an SFP. 1096 The Classifier is responsible for determining to which packet flow a 1097 packet belongs (usually by inspecting the packet header), imposing an 1098 NSH, and initializing the NSH with the SPI of the selected SFP and 1099 the SI of its first hop. 1101 4.5. Service Function Forwarder Operation 1103 Each packet sent to an SFF is transmitted encapsulated in an NSH. 1104 The NSH includes an SPI and SI: the SPI indicates the SFPR 1105 advertisement that announced the Service Function Path; the tuple 1106 SPI/SI indicates a specific hop in a specific path and maps to the 1107 RD/SFT of a particular SFIR advertisement. 1109 When an SFF gets an SFPR advertisement it will first determine 1110 whether to import the route by examining the RT. If the SFPR is 1111 imported the SFF then determines whether it is on the SFP by looking 1112 for its own SFIR-RDs in the SFPR. For each occurrence in the SFP, 1113 the SFF creates forwarding state for incoming packets and forwarding 1114 state for outgoing packets that have been processed by the specified 1115 SFI. 1117 The SFF creates local forwarding state for packets that it receives 1118 from other SFFs. This state makes the association between the SPI/SI 1119 in the NSH of the received packet and one or more specific local SFIs 1120 as identified by the SFIR-RD/SFT. If there are multiple local SFIs 1121 that match this is because a single advertisement was made for a set 1122 of equivalent SFIs and the SFF may use local policy (such as load 1123 balancing) to determine to which SFI to forward a received packet. 1125 The SFF also creates next hop forwarding state for packets received 1126 back from the local SFI that need to be forwarded to the next hop in 1127 the SFP. There may be a choice of next hops as described in 1128 Section 4.3. The SFF could install forwarding state for all 1129 potential next hops, or it could choose to only install forwarding 1130 state to a subset of the potential next hops. If a choice is made 1131 then it will be as described in Section 5. 1133 The installed forwarding state may change over time reacting to 1134 changes in the underlay network and the availability of particular 1135 SFIs. 1137 Note that SFFs only create and store forwarding state for the SFPs on 1138 which they are included. They do not retain state for all SFPs 1139 advertised. 1141 An SFF may also install forwarding state to support looping, jumping, 1142 and branching. The protocol mechanism for explicit control of 1143 looping, jumping, and branching uses a specific reserved SFT value at 1144 a given hop of an SFPR and is described in Section 6.1. 1146 4.5.1. Processing With 'Gaps' in the SI Sequence 1148 The behavior of an SF as described in [RFC8300] is to decrement the 1149 value of the SI field in the NSH by one before returning a packet to 1150 the local SFF for further processing. This means that there is a 1151 good reason to assume that the SFP is composed of a series of SFs 1152 each indicated by an SI value one less than the previous. 1154 However, there is an advantage to having non-successive SIs in an 1155 SPI. Consider the case where an SPI needs to be modified by the 1156 insertion or removal of an SF. In the latter case this would lead to 1157 a "gap" in the sequence of SIs, and in the former case, this could 1158 only be achieved if a gap already existed into which the new SF with 1159 its new SI value could be inserted. Otherwise, all "downstream" SFs 1160 would need to be renumbered. 1162 Now, of course, such renumbering could be performed, but would lead 1163 to a significant disruption to the SFC as all the SFFs along the SFP 1164 were "reprogrammed". Thus, to achieve dynamic modification of an SFP 1165 (and even, in-service modification) it is desirable to be able to 1166 make these modifications without changing the SIs of the elements 1167 that were present before the modification. This will produce much 1168 more consistent/predictable behavior during the convergence period 1169 where otherwise the change would need to be fully propagated. 1171 Another approach says that any change to an SFP simply creates a new 1172 SFP that can be assigned a new SPI. All that would be needed would 1173 be to give a new instruction to the Classifier and traffic would be 1174 switched to the new SFP that contains the new set of SFs. This 1175 approach is practical, but neglects to consider that the SFP may be 1176 referenced by other SFPs (through "branch" instructions) and used by 1177 many Classifiers. In those cases the corresponding configuration 1178 resulting from a change in SPI may have wide ripples and give scope 1179 for errors that are hard to trace. 1181 Therefore, while this document requires that the SI values in an SFP 1182 are monotonic decreasing, it makes no assumption that the SI values 1183 are sequential. Configuration tools may apply that rule, but they 1184 are not required to. To support this, an SFF SHOULD process as 1185 follows when it receives a packet: 1187 o If the SI indicates a known entry in the SFP, the SFF MUST process 1188 the packet as normal, looking up the SI and determining to which 1189 local SFI to deliver the packet. 1191 o If the SI does not match an entry in the SFP, the SFF MUST reduce 1192 the SI value to the next (smaller) value present in the SFP and 1193 process the packet using that SI. 1195 o If there is no smaller SI (i.e., if the end of the SFP has been 1196 reached) the SFF MUST treat the SI value as invalid as described 1197 in [RFC8300]. 1199 SFF implementations MAY choose to only support contiguous SI values 1200 in an SFP. Such an implementation will not support receiving an SI 1201 value that is not present in the SFP and will discard the packets as 1202 described in [RFC8300]. 1204 5. Selection in Service Function Paths 1206 As described in Section 2 the SPI/SI in the NSH passed back from an 1207 SFI to the SFF may leave the SFF with a choice of next hop SFTs, and 1208 a choice of SFIs for each SFT. That is, the SPI indicates an SFPR, 1209 and the SI indicates an entry in that SFPR. Each entry in an SFPR is 1210 a set of one or more SFT/SFIR-RD pairs. The SFF MUST choose one of 1211 these, identify the SFF that supports the chosen SFI, and send the 1212 packet to that next hop SFF. 1214 The choice be may offered for load balancing across multiple SFIs, or 1215 for discrimination between different actions necessary at a specific 1216 hop in the SFP. Different SFT values may exist at a given hop in an 1217 SFP to support several cases: 1219 o There may be multiple instances of similar service functions that 1220 are distinguished by different SFT values. For example, firewalls 1221 made by vendor A and vendor B may need to be identified by 1222 different SFT values because, while they have similar 1223 functionality, their behavior is not identical. Then, some SFPs 1224 may limit the choice of SF at a given hop by specifying the SFT 1225 for vendor A, but other SFPs might not need to control which 1226 vendor's SF is used and so can indicate that either SFT can be 1227 used. 1229 o There may be an obvious branch needed in an SFP such as the 1230 processing after a firewall where admitted packets continue along 1231 the SFP, but suspect packets are diverted to a "penalty box". In 1232 this case, the next hop in the SFP will be indicated with two 1233 different SFT values. 1235 In the typical case, the SFF chooses a next hop SFF by looking at the 1236 set of all SFFs that support the SFs identified by the SI (that set 1237 having been advertised in individual SFIR advertisements), finding 1238 the one or more that are "nearest" in the underlay network, and 1239 choosing between next hop SFFs using its own load-balancing 1240 algorithm. 1242 An SFI may influence this choice process by passing additional 1243 information back along with the packet and NSH. This information may 1244 influence local policy at the SFF to cause it to favor a next hop SFF 1245 (perhaps selecting one that is not nearest in the underlay), or to 1246 influence the load-balancing algorithm. 1248 This selection applies to the normal case, but also applies in the 1249 case of looping, jumping, and branching (see Section 6). 1251 Suppose an SFF in a particular service overlay network (identified by 1252 a particular import RT, RT-z) needs to forward an NSH-encapsulated 1253 packet whose SPI is SPI-x and whose SI is SI-y. It does the 1254 following: 1256 1. It looks for an installed SFPR that carries RT-z and that has 1257 SPI-x in its NLRI. If there is none, then such packets cannot be 1258 forwarded. 1260 2. From the SFP attribute of that SFPR, it finds the Hop TLV with SI 1261 value set to SI-y. If there is no such Hop TLV, then such 1262 packets cannot be forwarded. 1264 3. It then finds the "relevant" set of SFIRs by going through the 1265 list of SFT TLVs contained in the Hop TLV as follows: 1267 A. An SFIR is relevant if it carries RT-z, the SFT in its NLRI 1268 matches the SFT value in one of the SFT TLVs, and the RD 1269 value in its NLRI matches an entry in the list of SFIR-RDs in 1270 that SFT TLV. 1272 B. If an entry in the SFIR-RD list of an SFT TLV contains the 1273 value zero, then an SFIR is relevant if it carries RT-z and 1274 the SFT in its NLRI matches the SFT value in that SFT TLV. 1275 I.e., any SFIR in the service function overlay network 1276 defined by RT-z and with the correct SFT is relevant. 1278 Each of the relevant SFIRs identifies a single SFI, and contains a 1279 Tunnel Encapsulation attribute that specifies how to send a packet to 1280 that SFI. For a particular packet, the SFF chooses a particular SFI 1281 from the set of relevant SFIRs. This choice is made according to 1282 local policy. 1284 A typical policy might be to figure out the set of SFIs that are 1285 closest, and to load balance among them. But this is not the only 1286 possible policy. 1288 6. Looping, Jumping, and Branching 1290 As described in Section 2 an SFI or an SFF may cause a packet to 1291 "loop back" to a previous SF on a path in order that a sequence of 1292 functions may be re-executed. This is simply achieved by replacing 1293 the SI in the NSH with a higher value instead of decreasing it as 1294 would normally be the case to determine the next hop in the path. 1296 Section 2 also describes how an SFI or an SFF may cause a packets to 1297 "jump forward" to an SF on a path that is not the immediate next SF 1298 in the SFP. This is simply achieved by replacing the SI in the NSH 1299 with a lower value than would be achieved by decreasing it by the 1300 normal amount. 1302 A more complex option to move packets from one SFP to another is 1303 described in [RFC8300] and Section 2 where it is termed "branching". 1304 This mechanism allows an SFI or SFF to make a choice of downstream 1305 treatments for packets based on local policy and output of the local 1306 SF. Branching is achieved by changing the SPI in the NSH to indicate 1307 the new path and setting the SI to indicate the point in the path at 1308 which the packets should enter. 1310 Note that the NSH does not include a marker to indicate whether a 1311 specific packet has been around a loop before. Therefore, the use of 1312 NSH metadata may be required in order to prevent infinite loops. 1314 6.1. Protocol Control of Looping, Jumping, and Branching 1316 If the SFT value in an SFT TLV in an SFPR has the Special Purpose SFT 1317 value "Change Sequence" (see Section 10) then this is an indication 1318 that the SFF may make a loop, jump, or branch according to local 1319 policy and information returned by the local SFI. 1321 In this case, the SPI and SI of the next hop is encoded in the eight 1322 bytes of an entry in the SFIR-RD list as follows: 1324 3 bytes SPI 1326 2 bytes SI 1328 3 bytes Reserved (SHOULD be set to zero and ignored) 1330 If the SI in this encoding is not part of the SFPR indicated by the 1331 SPI in this encoding, then this is an explicit error that SHOULD be 1332 detected by the SFF when it parses the SFPR. The SFPR SHOULD NOT 1333 cause any forwarding state to be installed in the SFF and packets 1334 received with the SPI that indicates this SFPR SHOULD be silently 1335 discarded. 1337 If the SPI in this encoding is unknown, the SFF SHOULD NOT install 1338 any forwarding state for this SFPR, but MAY hold the SFPR pending 1339 receipt of another SFPR that does use the encoded SPI. 1341 If the SPI matches the current SPI for the path, this is a loop or 1342 jump. In this case, if the SI is greater than to the current SI it 1343 is a loop. If the SPI matches and the SI is less than the next SI, 1344 it is a jump. 1346 If the SPI indicates anther path, this is a branch and the SI 1347 indicates the point at which to enter that path. 1349 The Change Sequence SFT is just another SFT that may appear in a set 1350 of SFI/SFT tuples within an SI and is selected as described in 1351 Section 5. 1353 Note that Special Purpose SFTs MUST NOT be advertised in SFIRs. 1355 6.2. Implications for Forwarding State 1357 Support for looping and jumping requires that the SFF has forwarding 1358 state established to an SFF that provides access to an instance of 1359 the appropriate SF. This means that the SFF must have seen the 1360 relevant SFIR advertisements and known that it needed to create the 1361 forwarding state. This is a matter of local configuration and 1362 implementation: for example, an implementation could be configured to 1363 install forwarding state for specific looping/jumping. 1365 Support for branching requires that the SFF has forwarding state 1366 established to an SFF that provides access to an instance of the 1367 appropriate entry SF on the other SFP. This means that the SFF must 1368 have seen the relevant SFIR and SFPR advertisements and known that it 1369 needed to create the forwarding state. This is a matter of local 1370 configuration and implementation: for example, an implementation 1371 could be configured to install forwarding state for specific 1372 branching (identified by SPI and SI). 1374 7. Advanced Topics 1376 This section highlights several advanced topics introduced elsewhere 1377 in this document. 1379 7.1. Correlating Service Function Path Instances 1381 It is often useful to create bidirectional SFPs to enable packet 1382 flows to traverse the same set of SFs, but in the reverse order. 1383 However, packets on SFPs in the data plane (per [RFC8300]) do not 1384 contain a direction indicator, so each direction must use a different 1385 SPI. 1387 As described in Section 3.2.1.1 an SFPR can contain one or more 1388 correlators encoded in Association TLVs. If the Association Type 1389 indicates "Bidirectional SFP" then the SFP advertised in the SFPR is 1390 one direction of a bidirectional pair of SFPs where the other in the 1391 pair is advertised in the SFPR with RD as carried in the Associated 1392 SFPR-RD field of the Association TLV. The SPI carried in the 1393 Associated SPI field of the Association TLV provides a cross-check 1394 and should match the SPI advertised in the SFPR with RD as carried in 1395 the Associated SFPR-RD field of the Association TLV. 1397 As noted in Section 3.2.1.1 SFPRs reference each other one SFPR 1398 advertisement will be received before the other. Therefore 1399 processing of an association will require that the first SFPR is not 1400 rejected simply because the Associated SFPR-RD it carries is unknown. 1401 However, the SFP defined by the first SFPR is valid and SHOULD be 1402 available for use as a unidirectional SFP even in the absence of an 1403 advertisement of its partner. 1405 Furthermore, in error cases where SFPR-a associates with SFPR-b, but 1406 SFPR-b associates with SFPR-c such that a bidirectional pair of SFPs 1407 cannot be formed, the individual SFPs are still valid and SHOULD be 1408 available for use as unidirectional SFPs. An implementation SHOULD 1409 log this situation because it represents a Controller error. 1411 Usage of a bidirectional SFP may be programmed into the Classifiers 1412 by the Controller. Alternatively, a Classifier may look at incoming 1413 packets on a bidirectional packet flow, extract the SPI from the 1414 received NSH, and look up the SFPR to find the reverse direction SFP 1415 to use when it sends packets. 1417 See Section 8 for an example of how this works. 1419 7.2. Considerations for Stateful Service Functions 1421 Some service functions are stateful. That means that they build and 1422 maintain state derived from configuration or from the packet flows 1423 that they handle. In such cases it can be important or necessary 1424 that all packets from a flow continue to traverse the same instance 1425 of a service function so that the state can be leveraged and does not 1426 need to be regenerated. 1428 In the case of bidirectional SFPs, it may be necessary to traverse 1429 the same instances of a stateful service function in both directions. 1430 A firewall is a good example of such a service function. 1432 This issue becomes a concern where there are multiple parallel 1433 instances of a service function and a determination of which one to 1434 use could normally be left to the SFF as a load-balancing or local 1435 policy choice. 1437 For the forward direction SFP, the concern is that the same choice of 1438 service function is made for all packets of a flow under normal 1439 network conditions. It may be possible to guarantee that the load 1440 balancing functions applied in the SFFs are stable and repeatable, 1441 but a controller that constructs SFPs might not want to trust to 1442 this. The controller can, in these cases, build a number of more 1443 specific SFPs each traversing a specific instance of the stateful 1444 SFs. In this case, the load balancing choice can be left up to the 1445 Classifier. Thus the Classifier selects which instance of a stateful 1446 SF is used by a particular flow by selecting the SFP that the flow 1447 uses. 1449 For bidirectional SFPs where the same instance of a stateful SF must 1450 be traversed in both directions, it is not enough to leave the choice 1451 of service function instance as a local choice even if the load 1452 balancing is stable because coordination would be required between 1453 the decision points in the forward and reverse directions and this 1454 may be hard to achieve in all cases except where it is the same SFF 1455 that makes the choice in both directions. 1457 Note that this approach necessarily increases the amount of SFP state 1458 in the network (i.e., there are more SFPs). It is possible to 1459 mitigate this effect by careful construction of SFPs built from a 1460 concatenation of other SFPs. 1462 Section 8.9 includes some simple examples of SFPs for stateful 1463 service functions. 1465 7.3. VPN Considerations and Private Service Functions 1467 Likely deployments include reserving specific instances of Service 1468 Functions for specific customers or allowing customers to deploy 1469 their own Service Functions within the network. Building Service 1470 Functions in such environments requires that suitable identifiers are 1471 used to ensure that SFFs distinguish which SFIs can be used and which 1472 cannot. 1474 This problem is similar to how VPNs are supported and is solved in a 1475 similar way. The RT field is used to indicate a set of Service 1476 Functions from which all choices must be made. 1478 7.4. Flow Spec for SFC Classifiers 1480 [RFC5575] and [I-D.ietf-idr-rfc5575bis] define a set of BGP routes 1481 that can be used to identify the packets in a given flow using fields 1482 in the header of each packet, and a set of actions, encoded as 1483 extended communities, that can be used to disposition those packets. 1484 This document enables the use of these mechanisms by SFC Classifiers 1485 by defining a new action extended community called "Flow Spec for SFC 1486 Classifiers" identified by the value TBD4. Note that other action 1487 extended communities MUST NOT be present at the same time: the 1488 inclusion of the "Flow Spec for SFC Classifiers" action extended 1489 community along with any other action MUST be treated as an error 1490 which SHOULD result in the Flow Specification UPDATE message being 1491 handled as Treat-as-withdraw according to [RFC7606] Section 2. 1493 This extended community is encoded as an 8-octet value, as shown in 1494 Figure 10. 1496 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 1497 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1498 | Type=0x80 | Sub-Type=TBD4 | SPI | 1499 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1500 | SPI (cont.) | SI | SFT | 1501 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1503 Figure 10: The Format of the Flow Spec for SFC Classifiers Extended 1504 Community 1506 The extended community contains the Service Path Identifier (SPI), 1507 Service Index (SI), and Service Function Type (SFT) as defined 1508 elsewhere in this document. Thus, each action extended community 1509 defines the entry point (not necessarily the first hop) into a 1510 specific service function path. This allows, for example, different 1511 flows to enter the same service function path at different points. 1513 Note that a given Flow Spec update according to [RFC5575] and 1514 [I-D.ietf-idr-rfc5575bis] may include multiple of these action 1515 extended communities, and that if a given action extended community 1516 does not contain an installed SFPR with the specified {SPI, SI, SFT} 1517 it MUST NOT be used for dispositioning the packets of the specified 1518 flow. 1520 The normal case of packet classification for SFC will see a packet 1521 enter the SFP at its first hop. In this case the SI in the extended 1522 community is superfluous and the SFT may also be unnecessary. To 1523 allow these cases to be handled, a special meaning is assigned to a 1524 Service Index of zero (not a valid value) and an SFT of zero (a 1525 reserved value in the registry - see Section 10.5). 1527 o If an SFC Classifiers Extended Community is received with SI = 0 1528 then it means that the first hop of the SFP indicated by the SPI 1529 MUST be used. 1531 o If an SFC Classifiers Extended Community is received with SFT = 0 1532 then there are two sub-cases: 1534 * If there is a choice of SFT in the hop indicated by the value 1535 of the SI (including SI = 0) then SFT = 0 means there is a free 1536 choice according to local policy of which SFT to use). 1538 * If there is no choice of SFT in the hop indicated by the value 1539 of SI, then SFT = 0 means that the value of the SFT at that hop 1540 as indicated in the SPFR for the indicated SPI MUST be used. 1542 One of the filters that the Flow Spec may describe is the VPN to 1543 which the traffic belongs. Additionally, note that to put the 1544 indicated SPI into context when multiple SFC overlays are present in 1545 one network, each FlowSpec update MUST be tagged with the route 1546 target of the overlay or VPN network for which it is intended. 1548 7.5. Choice of Data Plane SPI/SI Representation 1550 This document ties together the control and data planes of an SFC 1551 overlay network through the use of the SPI/SI which is nominally 1552 carried in the NSH of a given packet. However, in order to handle 1553 situations in which the NSH is not ubiquitously deployed, it is also 1554 possible to use alternative data plane representations of the SPI/SI 1555 by carrying the identical semantics in other protocol fields such as 1556 MPLS labels [I-D.ietf-mpls-sfc]. 1558 This document defines a new sub-TLV for the Tunnel Encapsulation 1559 attribute, the SPI/SI Representation sub-TLV of type TBD5. This sub- 1560 TLV MAY be present in each Tunnel TLV contained in a Tunnel 1561 Encapsulation attribute when the attribute is carried by an SFIR. 1562 The value field of this sub-TLV is a two octet field of flags, each 1563 of which describes how the originating SFF expects to see the SPI/SI 1564 represented in the data plane for packets carried in the tunnels 1565 described by the Tunnel TLV. 1567 The following bits are defined by this document: 1569 Bit 0: If this bit is set the NSH is to be used to carry the SPI/SI 1570 in the data plane. 1572 Bit 1: If this bit is set two labels in an MPLS label stack are to 1573 be used as described in Section 7.5.1. 1575 If a given Tunnel TLV does not contain an SPI/SI Representation sub- 1576 TLV then it MUST be processed as if such a sub-TLV is present with 1577 Bit 0 set and no other bits set. That is, the absence of the sub-TLV 1578 SHALL be interpreted to mean that the NSH is to be used. 1580 If a given Tunnel TLV contains an SPI/SI Representation sub-TLV with 1581 value field that has no flag set then the tunnel indicated by the 1582 Tunnel TLV MUST NOT be used for forwarding SFC packets. If a given 1583 Tunnel TLV contains an SPI/SI Representation sub-TLV with both bit 0 1584 and bit 1 set then the tunnel indicated by the Tunnel TLV MUST NOT be 1585 used for forwarding SFC packets. The meaning and rules for presence 1586 of other bits is to be defined in future documents, but 1587 implementations of this specification MUST set other bits to zero and 1588 ignore them on receipt. 1590 If a given Tunnel TLV contains more than one SPI/SI Representation 1591 sub-TLV then the first one MUST be considered and subsequent 1592 instances MUST be ignored. 1594 Note that the MPLS representation of the logical NSH may be used even 1595 if the tunnel is not an MPLS tunnel. Conversely, MPLS tunnels may be 1596 used to carry other encodings of the logical NSH (specifically, the 1597 NSH itself). It is a requirement that both ends of a tunnel over the 1598 underlay network know that the tunnel is used for SFC and know what 1599 form of NSH representation is used. The signaling mechanism 1600 described here allows coordination of this information. 1602 7.5.1. MPLS Representation of the SPI/SI 1604 If bit 1 is set in the in the SPI/SI Representation sub-TLV then 1605 labels in the MPLS label stack are used to indicate SFC forwarding 1606 and processing instructions to achieve the semantics of a logical 1607 NSH. The label stack is encoded as shown in [I-D.ietf-mpls-sfc]. 1609 7.6. MPLS Label Swapping/Stacking Operation 1611 When a classifier constructs an MPLS label stack for an SFP it starts 1612 with that SFP' last hop. If the last hop requires an {SPI, SI} label 1613 pair for label swapping, it pushes the SI (set to the SI value of the 1614 last hop) and the SFP's SPI onto the MPLS label stack. If the last 1615 hop requires a {context label, SFI label} label pair for label 1616 stacking it selects a specific SFIR and pushes that SFIR's SFI label 1617 and context label onto the MPLS label stack. 1619 The classifier then moves sequentially back through the SFP one hop 1620 at a time. For each hop, if the hop requires an {SPI, SI]} and there 1621 is an {SPI, SI} at the top of the MPLS label stack, the SI is set to 1622 the SI value of the current hop. If there is not an {SPI, SI} at the 1623 top of the MPLS label stack, it pushes the SI (set to the SI value of 1624 the current hop) and the SFP's SPI onto the MPLS label stack. 1626 If the hop requires a {context label, SFI label}, it selects a 1627 specific SFIR and pushes that SFIR's SFI label and context label onto 1628 the MPLS label stack. 1630 7.7. Support for MPLS-Encapsulated NSH Packets 1632 [I-D.ietf-mpls-sfc-encapsulation] describes how to transport SFC 1633 packets using the NSH over an MPLS transport network. Signaling MPLS 1634 encapsulation of SFC packets using the NSH is also supported by this 1635 document by using the "BGP Tunnel Encapsulation Attribute Sub-TLV" 1636 with the codepoint 10 (representing "MPLS Label Stack") from the "BGP 1637 Tunnel Encapsulation Attribute Sub-TLVs" registry defined in 1638 [I-D.ietf-idr-tunnel-encaps], and also using the "SFP Traversal With 1639 MPLS Label Stack TLV" and the "SPI/SI Representation sub-TLV" with 1640 bit 0 set and bit 1 cleared. 1642 In this case the MPLS label stack constructed by the SFF to forward a 1643 packet to the next SFF on the SFP will consist of the labels needed 1644 to reach that SFF, and if label stacking is used it will also include 1645 the labels advertised in the MPLS Label Stack sub-TLV and the labels 1646 remaining in the stack needed to traverse the remainder of the SFP. 1648 8. Examples 1650 Assume we have a service function overlay network with four SFFs 1651 (SFF1, SFF3, SFF3, and SFF4). The SFFs have addresses in the 1652 underlay network as follows: 1654 SFF1 192.0.2.1 1655 SFF2 192.0.2.2 1656 SFF3 192.0.2.3 1657 SFF4 192.0.2.4 1659 Each SFF provides access to some SFIs from the four Service Function 1660 Types SFT=41, SFT=42, SFT=43, and SFT=44 as follows: 1662 SFF1 SFT=41 and SFT=42 1663 SFF2 SFT=41 and SFT=43 1664 SFF3 SFT=42 and SFT=44 1665 SFF4 SFT=43 and SFT=44 1667 The service function network also contains a Controller with address 1668 198.51.100.1. 1670 This example service function overlay network is shown in Figure 11. 1672 -------------- 1673 | Controller | 1674 | 198.51.100.1 | ------ ------ ------ ------ 1675 -------------- | SFI | | SFI | | SFI | | SFI | 1676 |SFT=41| |SFT=42| |SFT=41| |SFT=43| 1677 ------ ------ ------ ------ 1678 \ / \ / 1679 --------- --------- 1680 ---------- | SFF1 | | SFF2 | 1681 Packet --> | | |192.0.2.1| |192.0.2.2| 1682 Flows --> |Classifier| --------- --------- -->Dest 1683 | | --> 1684 ---------- --------- --------- 1685 | SFF3 | | SFF4 | 1686 |192.0.2.3| |192.0.2.4| 1687 --------- --------- 1688 / \ / \ 1689 ------ ------ ------ ------ 1690 | SFI | | SFI | | SFI | | SFI | 1691 |SFT=42| |SFT=44| |SFT=43| |SFT=44| 1692 ------ ------ ------ ------ 1694 Figure 11: Example Service Function Overlay Network 1696 The SFFs advertise routes to the SFIs they support. So we see the 1697 following SFIRs: 1699 RD = 192.0.2.1:1, SFT = 41 1700 RD = 192.0.2.1:2, SFT = 42 1701 RD = 192.0.2.2:1, SFT = 41 1702 RD = 192.0.2.2:2, SFT = 43 1703 RD = 192.0.2.3:7, SFT = 42 1704 RD = 192.0.2.3:8, SFT = 44 1705 RD = 192.0.2.4:5, SFT = 43 1706 RD = 192.0.2.4:6, SFT = 44 1708 Note that the addressing used for communicating between SFFs is taken 1709 from the Tunnel Encapsulation attribute of the SFIR and not from the 1710 SFIR-RD. 1712 8.1. Example Explicit SFP With No Choices 1714 Consider the following SFPR. 1716 SFP1: RD = 198.51.100.1:101, SPI = 15, 1717 [SI = 255, SFT = 41, RD = 192.0.2.1:1], 1718 [SI = 250, SFT = 43, RD = 192.0.2.2:2] 1720 The Service Function Path consists of an SF of type 41 located at 1721 SFF1 followed by an SF of type 43 located at SFF2. This path is 1722 fully explicit and each SFF is offered no choice in forwarding packet 1723 along the path. 1725 SFF1 will receive packets on the path from the Classifier and will 1726 identify the path from the SPI (15). The initial SI will be 255 and 1727 so SFF1 will deliver the packets to the SFI for SFT 41. 1729 When the packets are returned to SFF1 by the SFI the SI will be 1730 decreased to 250 for the next hop. SFF1 has no flexibility in the 1731 choice of SFF to support the next hop SFI and will forward the packet 1732 to SFF2 which will send the packets to the SFI that supports SFT 43 1733 before forwarding the packets to their destinations. 1735 8.2. Example SFP With Choice of SFIs 1737 SFP2: RD = 198.51.100.1:102, SPI = 16, 1738 [SI = 255, SFT = 41, RD = 192.0.2.1:1], 1739 [SI = 250, SFT = 43, {RD = 192.0.2.2:2, 1740 RD = 192.0.2.4:5 } ] 1742 In this example the path also consists of an SF of type 41 located at 1743 SFF1 and this is followed by an SF of type 43, but in this case the 1744 SI = 250 contains a choice between the SFI located at SFF2 and the 1745 SFI located at SFF4. 1747 SFF1 will receive packets on the path from the Classifier and will 1748 identify the path from the SPI (16). The initial SI will be 255 and 1749 so SFF1 will deliver the packets to the SFI for SFT 41. 1751 When the packets are returned to SFF1 by the SFI the SI will be 1752 decreased to 250 for the next hop. SFF1 now has a choice of next hop 1753 SFF to execute the next hop in the path. It can either forward 1754 packets to SFF2 or SFF4 to execute a function of type 43. It uses 1755 its local load balancing algorithm to make this choice. The chosen 1756 SFF will send the packets to the SFI that supports SFT 43 before 1757 forwarding the packets to their destinations. 1759 8.3. Example SFP With Open Choice of SFIs 1761 SFP3: RD = 198.51.100.1:103, SPI = 17, 1762 [SI = 255, SFT = 41, RD = 192.0.2.1:1], 1763 [SI = 250, SFT = 44, RD = 0] 1765 In this example the path also consists of an SF of type 41 located at 1766 SFF1 and this is followed by an SI with an RD of zero and SF of type 1767 44. This means that a choice can be made between any SFF that 1768 supports an SFI of type 44. 1770 SFF1 will receive packets on the path from the Classifier and will 1771 identify the path from the SPI (17). The initial SI will be 255 and 1772 so SFF1 will deliver the packets to the SFI for SFT 41. 1774 When the packets are returned to SFF1 by the SFI the SI will be 1775 decreased to 250 for the next hop. SFF1 now has a free choice of 1776 next hop SFF to execute the next hop in the path selecting between 1777 all SFFs that support SFs of type 44. Looking at the SFIRs it has 1778 received, SFF1 knows that SF type 44 is supported by SFF3 and SFF4. 1779 SFF1 uses its local load balancing algorithm to make this choice. 1780 The chosen SFF will send the packets to the SFI that supports SFT 44 1781 before forwarding the packets to their destinations. 1783 8.4. Example SFP With Choice of SFTs 1784 SFP4: RD = 198.51.100.1:104, SPI = 18, 1785 [SI = 255, SFT = 41, RD = 192.0.2.1:1], 1786 [SI = 250, {SFT = 43, RD = 192.0.2.2:2, 1787 SFT = 44, RD = 192.0.2.3:8 } ] 1789 This example provides a choice of SF type in the second hop in the 1790 path. The SI of 250 indicates a choice between SF type 43 located 1791 through SF2 and SF type 44 located at SF3. 1793 SFF1 will receive packets on the path from the Classifier and will 1794 identify the path from the SPI (18). The initial SI will be 255 and 1795 so SFF1 will deliver the packets to the SFI for SFT 41. 1797 When the packets are returned to SFF1 by the SFI the SI will be 1798 decreased to 250 for the next hop. SFF1 now has a free choice of 1799 next hop SFF to execute the next hop in the path selecting between 1800 all SFF2 that support an SF of type 43 and SFF3 that supports an SF 1801 of type 44. These may be completely different functions that are to 1802 be executed dependent on specific conditions, or may be similar 1803 functions identified with different type identifiers (such as 1804 firewalls from different vendors). SFF1 uses its local policy and 1805 load balancing algorithm to make this choice, and may use additional 1806 information passed back from the local SFI to help inform its 1807 selection. The chosen SFF will send the packets to the SFI that 1808 supports the chose SFT before forwarding the packets to their 1809 destinations. 1811 8.5. Example Correlated Bidirectional SFPs 1813 SFP5: RD = 198.51.100.1:105, SPI = 19, 1814 Assoc-Type = 1, Assoc-RD = 198.51.100.1:106, Assoc-SPI = 20, 1815 [SI = 255, SFT = 41, RD = 192.0.2.1:1], 1816 [SI = 250, SFT = 43, RD = 192.0.2.2:2] 1818 SFP6: RD = 198.51.100.1:106, SPI = 20, 1819 Assoc-Type = 1, Assoc-RD = 198.51.100.1:105, Assoc-SPI = 19, 1820 [SI = 254, SFT = 43, RD = 192.0.2.2:2], 1821 [SI = 249, SFT = 41, RD = 192.0.2.1:1] 1823 This example demonstrates correlation of two SFPs to form a 1824 bidirectional SFP as described in Section 7.1. 1826 Two SFPRs are advertised by the Controller. They have different SPIs 1827 (19 and 20) so they are known to be separate SFPs, but they both have 1828 Association TLVs with Association Type set to 1 indicating 1829 bidirectional SFPs. Each has an Associated SFPR-RD fields containing 1830 the value of the other SFPR-RD to correlated the two SFPs as a 1831 bidirectional pair. 1833 As can be seen from the SFPRs in this example, the paths are 1834 symmetric: the hops in SFP5 appear in the reverse order in SFP6. 1836 8.6. Example Correlated Asymmetrical Bidirectional SFPs 1838 SFP7: RD = 198.51.100.1:107, SPI = 21, 1839 Assoc-Type = 1, Assoc-RD = 198.51.100.1:108, Assoc-SPI = 22, 1840 [SI = 255, SFT = 41, RD = 192.0.2.1:1], 1841 [SI = 250, SFT = 43, RD = 192.0.2.2:2] 1843 SFP8: RD = 198.51.100.1:108, SPI = 22, 1844 Assoc-Type = 1, Assoc-RD = 198.51.100.1:107, Assoc-SPI = 21, 1845 [SI = 254, SFT = 44, RD = 192.0.2.4:6], 1846 [SI = 249, SFT = 41, RD = 192.0.2.1:1] 1848 Asymmetric bidirectional SFPs can also be created. This example 1849 shows a pair of SFPs with distinct SPIs (21 and 22) that are 1850 correlated in the same way as in the example in Section 8.5. 1852 However, unlike in that example, the SFPs are different in each 1853 direction. Both paths include a hop of SF type 41, but SFP7 includes 1854 a hop of SF type 43 supported at SFF2 while SFP8 includes a hop of SF 1855 type 44 supported at SFF4. 1857 8.7. Example Looping in an SFP 1859 SFP9: RD = 198.51.100.1:109: SPI = 23, 1860 [SI = 255, SFT = 41, RD = 192.0.2.1:1], 1861 [SI = 250, SFT = 44, RD = 192.0.2.4:5], 1862 [SI = 245, SFT = 1, RD = {SPI=23, SI=255, Rsv=0}], 1863 [SI = 245, SFT = 42, RD = 192.0.2.3:7] 1865 Looping and jumping are described in Section 6. This example shows 1866 an SFP that contains an explicit loop-back instruction that is 1867 presented as a choice within an SFP hop. 1869 The first two hops in the path (SI = 255 and SI = 250) are normal. 1870 That is, the packets will be delivered to SFF1 and SFF4 in turn for 1871 execution of SFs of type 41 and 44 respectively. 1873 The third hop (SI = 245) presents SFF4 with a choice of next hop. It 1874 can either forward the packets to SFF3 for an SF of type 42 (the 1875 second choice), or it can loop back. 1877 The loop-back entry in the SFPR for SI = 245 is indicated by the 1878 special purpose SFT value 1 ("Change Sequence"). Within this hop, 1879 the RD is interpreted as encoding the SPI and SI of the next hop (see 1880 Section 6.1. In this case the SPI is 23 which indicates that this is 1881 loop or branch: i.e., the next hop is on the same SFP. The SI is set 1882 to 255: this is a higher number than the current SI (245) indicating 1883 a loop. 1885 SFF4 must make a choice between these two next hops. Either the 1886 packets will be forwarded to SFF3 with the NSH SI decreased to 245 or 1887 looped back to SFF1 with the NSH SI reset to 255. This choice will 1888 be made according to local policy, information passed back by the 1889 local SFI, and details in the packets' metadata that are used to 1890 prevent infinite looping. 1892 8.8. Example Branching in an SFP 1894 SFP10: RD = 198.51.100.1:110, SPI = 24, 1895 [SI = 254, SFT = 42, RD = 192.0.2.3:7], 1896 [SI = 249, SFT = 43, RD = 192.0.2.2:2] 1898 SFP11: RD = 198.51.100.1:111, SPI = 25, 1899 [SI = 255, SFT = 41, RD = 192.0.2.1:1], 1900 [SI = 250, SFT = 1, RD = {SPI=24, SI=254, Rsv=0}] 1902 Branching follows a similar procedure to that for looping (and 1903 jumping) as shown in Section 8.7 however there are two SFPs involved. 1905 SFP10 shows a normal path with packets forwarded to SFF3 and SFF2 for 1906 execution of service functions of type 42 and 43 respectively. 1908 SFP11 starts as normal (SFF1 for an SF of type 41), but then SFF1 1909 processes the next hop in the path and finds a "Change Sequence" 1910 Special Purpose SFT. The SFIR-RD field includes an SPI of 24 which 1911 indicates SFP10, not the current SFP. The SI in the SFIR-RD is 254, 1912 so SFF1 knows that it must set the SPI/SI in the NSH to 24/254 and 1913 send the packets to the appropriate SFF as advertised in the SFPR for 1914 SFP10 (that is, SFF3). 1916 8.9. Examples of SFPs with Stateful Service Functions 1918 This section provides some examples to demonstrate establishing SFPs 1919 when there is a choice of service functions at a particular hop, and 1920 where consistency of choice is required in both directions. The 1921 scenarios that give rise to this requirement are discussed in 1922 Section 7.2. 1924 8.9.1. Forward and Reverse Choice Made at the SFF 1926 Consider the topology shown in Figure 12. There are three SFFs 1927 arranged neatly in a line, and the middle one (SFF2) supports three 1928 SFIs all of SFT 42. These three instances can be used by SFF2 to 1929 load balance so that no one instance is swamped. 1931 ------ ------ ------ ------ ------ 1932 | SFI | | SFIa | | SFIb | | SFIc | | SFI | 1933 |SFT=41| |SFT=42| |SFT=42| |SFT=42| |SFT=43| 1934 ------ ------\ ------ /------ ------ 1935 \ \ | / / 1936 --------- --------- --------- 1937 ---------- | SFF1 | | SFF2 | | SFF3 | 1938 --> | |..|192.0.2.1|...|192.0.2.2|...|192.0.2.3|--> 1939 --> |Classifier| --------- --------- --------- 1940 | | 1941 ---------- 1943 Figure 12: Example Where Choice is Made at the SFF 1945 This leads to the following SFIRs being advertised. 1947 RD = 192.0.2.1:11, SFT = 41 1948 RD = 192.0.2.2:11, SFT = 42 (for SFIa) 1949 RD = 192.0.2.2:12, SFT = 42 (for SFIb) 1950 RD = 192.0.2.2:13, SFT = 42 (for SFIc) 1951 RD = 192.0.2.3:11, SFT = 43 1953 The controller can create a single forward SFP giving SFF2 the choice 1954 of which SFI to use to provide function of SFT 42 as follows. The 1955 load-balancing choice between the three available SFIs is assumed to 1956 be within the capabilities of the SFF and if the SFs are stateful it 1957 is assumed that the SFF knows this and arranges load balancing in a 1958 stable, flow-dependent way. 1960 SFP12: RD = 198.51.100.1:112, SPI = 26, 1961 Assoc-Type = 1, Assoc-RD = 198.51.100.1:113, Assoc-SPI = 27, 1962 [SI = 255, SFT = 41, RD = 192.0.2.1:11], 1963 [SI = 254, SFT = 42, {RD = 192.0.2.2:11, 1964 192.0.2.2:12, 1965 192.0.2.2:13 }], 1966 [SI = 253, SFT = 43, RD = 192.0.2.3:11] 1968 The reverse SFP in this case may also be created as shown below using 1969 association with the forward SFP and giving the load-balancing choice 1970 to SFF2. This is safe, even in the case that the SFs of type 42 are 1971 stateful because SFF2 is doing the load balancing in both directions 1972 and can apply the same algorithm to ensure that packets associated 1973 with the same flow use the same SFI regardless of the direction of 1974 travel. 1976 How an SFF knows that an attached SFI is stateful is is out of scope 1977 of this document. It is assumed that this will form part of the 1978 process by which SFIs are registered as local to SFFs. Section 7.2 1979 provides additional observations about the coordination of the use of 1980 stateful SFIs in the case of bidirectional SFPs. 1982 In general, the problems of load balancing and the selection of the 1983 same SFIs in both directions of a bidirectional SPF can be addressed 1984 by using sufficiently precisely specified SFPs (specifying the exact 1985 SFIs to use) and suitable programming of the Classifiers at each end 1986 of the SFPs to make sure that the matching pair of SFPs are used. 1988 SFP13: RD = 198.51.100.1:113, SPI = 27, 1989 Assoc-Type = 1, Assoc-RD = 198.51.100.1:112, Assoc-SPI = 26, 1990 [SI = 255, SFT = 43, RD = 192.0.2.3:11], 1991 [SI = 254, SFT = 42, {RD = 192.0.2.2:11, 1992 192.0.2.2:12, 1993 192.0.2.2:13 }], 1994 [SI = 253, SFT = 41, RD = 192.0.2.1:11] 1996 8.9.2. Parallel End-to-End SFPs with Shared SFF 1998 The mechanism described in Section 8.9.1 might not be desirable 1999 because of the functional assumptions it places on SFF2 to be able to 2000 load balance with suitable flow identification, stability, and 2001 equality in both directions. Instead, it may be desirable to place 2002 the responsibility for flow classification in the Classifier and let 2003 it determine load balancing with the implied choice of SFIs. 2005 Consider the network graph as shown in Figure 12 and with the same 2006 set of SFIRs as listed in Section 8.9.1. In this case the controller 2007 could specify three forward SFPs with their corresponding associated 2008 reverse SFPs. Each bidirectional pair of SFPs uses a different SFI 2009 for the SF of type 42. The controller can instruct the Classifier 2010 how to place traffic on the three bidirectional SFPs, or can treat 2011 them as a group leaving the Classifier responsible for balancing the 2012 load. 2014 SFP14: RD = 198.51.100.1:114, SPI = 28, 2015 Assoc-Type = 1, Assoc-RD = 198.51.100.1:117, Assoc-SPI = 31, 2016 [SI = 255, SFT = 41, RD = 192.0.2.1:11], 2017 [SI = 254, SFT = 42, RD = 192.0.2.2:11], 2018 [SI = 253, SFT = 43, RD = 192.0.2.3:11] 2020 SFP15: RD = 198.51.100.1:115, SPI = 29, 2021 Assoc-Type = 1, Assoc-RD = 198.51.100.1:118, Assoc-SPI = 32, 2022 [SI = 255, SFT = 41, RD = 192.0.2.1:11], 2023 [SI = 254, SFT = 42, RD = 192.0.2.2:12], 2024 [SI = 253, SFT = 43, RD = 192.0.2.3:11] 2026 SFP16: RD = 198.51.100.1:116, SPI = 30, 2027 Assoc-Type = 1, Assoc-RD = 198.51.100.1:119, Assoc-SPI = 33, 2028 [SI = 255, SFT = 41, RD = 192.0.2.1:11], 2029 [SI = 254, SFT = 42, RD = 192.0.2.2:13], 2030 [SI = 253, SFT = 43, RD = 192.0.2.3:11] 2032 SFP17: RD = 198.51.100.1:117, SPI = 31, 2033 Assoc-Type = 1, Assoc-RD = 198.51.100.1:114, Assoc-SPI = 28, 2034 [SI = 255, SFT = 43, RD = 192.0.2.3:11], 2035 [SI = 254, SFT = 42, RD = 192.0.2.2:11], 2036 [SI = 253, SFT = 41, RD = 192.0.2.1:11] 2038 SFP18: RD = 198.51.100.1:118, SPI = 32, 2039 Assoc-Type = 1, Assoc-RD = 198.51.100.1:115, Assoc-SPI = 29, 2040 [SI = 255, SFT = 43, RD = 192.0.2.3:11], 2041 [SI = 254, SFT = 42, RD = 192.0.2.2:12], 2042 [SI = 253, SFT = 41, RD = 192.0.2.1:11] 2044 SFP19: RD = 198.51.100.1:119, SPI = 33, 2045 Assoc-Type = 1, Assoc-RD = 198.51.100.1:116, Assoc-SPI = 30, 2046 [SI = 255, SFT = 43, RD = 192.0.2.3:11], 2047 [SI = 254, SFT = 42, RD = 192.0.2.2:13], 2048 [SI = 253, SFT = 41, RD = 192.0.2.1:11] 2050 8.9.3. Parallel End-to-End SFPs with Separate SFFs 2052 While the examples in Section 8.9.1 and Section 8.9.2 place the 2053 choice of SFI as subtended from the same SFF, it is also possible 2054 that the SFIs are each subtended from a different SFF as shown in 2055 Figure 13. In this case it is harder to coordinate the choices for 2056 forward and reverse paths without some form of coordination between 2057 SFF1 and SFF3. Therefore it would be normal to consider end-to-end 2058 parallel SFPs as described in Section 8.9.2. 2060 ------ 2061 | SFIa | 2062 |SFT=42| 2063 ------ 2064 ------ | 2065 | SFI | --------- 2066 |SFT=41| | SFF5 | 2067 ------ ..|192.0.2.5|.. 2068 | ..: --------- :.. 2069 ---------.: :.--------- 2070 ---------- | SFF1 | --------- | SFF3 | 2071 --> | |..|192.0.2.1|....| SFF6 |....|192.0.2.3| --> 2072 --> |Classifier| ---------: |192.0.2.6| :--------- 2073 | | : --------- : | 2074 ---------- : | : ------ 2075 : ------ : | SFI | 2076 :.. | SFIb | ..: |SFT=43| 2077 :.. |SFT=42| ..: ------ 2078 : ------ : 2079 :.---------.: 2080 | SFF7 | 2081 |192.0.2.7| 2082 --------- 2083 | 2084 ------ 2085 | SFIc | 2086 |SFT=42| 2087 ------ 2089 Figure 13: Second Example With Parallel End-to-End SFPs 2091 In this case, five SFIRs are advertised as follows: 2093 RD = 192.0.2.1:11, SFT = 41 2094 RD = 192.0.2.5:11, SFT = 42 (for SFIa) 2095 RD = 192.0.2.6:11, SFT = 42 (for SFIb) 2096 RD = 192.0.2.7:11, SFT = 42 (for SFIc) 2097 RD = 192.0.2.3:11, SFT = 43 2099 In this case the controller could specify three forward SFPs with 2100 their corresponding associated reverse SFPs. Each bidirectional pair 2101 of SFPs uses a different SFF and SFI for middle hop (for an SF of 2102 type 42). The controller can instruct the Classifier how to place 2103 traffic on the three bidirectional SFPs, or can treat them as a group 2104 leaving the Classifier responsible for balancing the load. 2106 SFP20: RD = 198.51.100.1:120, SPI = 34, 2107 Assoc-Type = 1, Assoc-RD = 198.51.100.1:123, Assoc-SPI = 37, 2108 [SI = 255, SFT = 41, RD = 192.0.2.1:11], 2109 [SI = 254, SFT = 42, RD = 192.0.2.5:11], 2110 [SI = 253, SFT = 43, RD = 192.0.2.3:11] 2112 SFP21: RD = 198.51.100.1:121, SPI = 35, 2113 Assoc-Type = 1, Assoc-RD = 198.51.100.1:124, Assoc-SPI = 38, 2114 [SI = 255, SFT = 41, RD = 192.0.2.1:11], 2115 [SI = 254, SFT = 42, RD = 192.0.2.6:11], 2116 [SI = 253, SFT = 43, RD = 192.0.2.3:11] 2118 SFP22: RD = 198.51.100.1:122, SPI = 36, 2119 Assoc-Type = 1, Assoc-RD = 198.51.100.1:125, Assoc-SPI = 39, 2120 [SI = 255, SFT = 41, RD = 192.0.2.1:11], 2121 [SI = 254, SFT = 42, RD = 192.0.2.7:11], 2122 [SI = 253, SFT = 43, RD = 192.0.2.3:11] 2124 SFP23: RD = 198.51.100.1:123, SPI = 37, 2125 Assoc-Type = 1, Assoc-RD = 198.51.100.1:120, Assoc-SPI = 34, 2126 [SI = 255, SFT = 43, RD = 192.0.2.3:11], 2127 [SI = 254, SFT = 42, RD = 192.0.2.5:11], 2128 [SI = 253, SFT = 41, RD = 192.0.2.1:11] 2130 SFP24: RD = 198.51.100.1:124, SPI = 38, 2131 Assoc-Type = 1, Assoc-RD = 198.51.100.1:121, Assoc-SPI = 35, 2132 [SI = 255, SFT = 43, RD = 192.0.2.3:11], 2133 [SI = 254, SFT = 42, RD = 192.0.2.6:11], 2134 [SI = 253, SFT = 41, RD = 192.0.2.1:11] 2136 SFP25: RD = 198.51.100.1:125, SPI = 39, 2137 Assoc-Type = 1, Assoc-RD = 198.51.100.1:122, Assoc-SPI = 36, 2138 [SI = 255, SFT = 43, RD = 192.0.2.3:11], 2139 [SI = 254, SFT = 42, RD = 192.0.2.7:11], 2140 [SI = 253, SFT = 41, RD = 192.0.2.1:11] 2142 8.9.4. Parallel SFPs Downstream of the Choice 2144 The mechanism of parallel SFPs demonstrated in Section 8.9.3 is 2145 perfectly functional and may be practical in many environments. 2146 However, there may be scaling concerns because of the large amount of 2147 state (knowledge of SFPs, i.e., SFPR advertisements retained) if 2148 there is a very large amount of choice of SFIs (for example, tens of 2149 instances of the same stateful SF), or if there are multiple choices 2150 of stateful SF along a path. This situation may be mitigated using 2151 SFP fragments that are combined to form the end to end SFPs. 2153 The example presented here is necessarily simplistic, but should 2154 convey the basic principle. The example presented in Figure 14 is 2155 similar to that in Section 8.9.3 but with an additional first hop. 2157 ------ 2158 | SFIa | 2159 |SFT=43| 2160 ------ 2161 ------ ------ | 2162 | SFI | | SFI | --------- 2163 |SFT=41| |SFT=42| | SFF5 | 2164 ------ ------ ..|192.0.2.5|.. 2165 | | ..: --------- :.. 2166 --------- ---------.: :.--------- 2167 ------ | SFF1 | | SFF2 | --------- | SFF3 | 2168 -->|Class-|.|192.0.2.1|.|192.0.2.2|....| SFF6 |....|192.0.2.3|--> 2169 -->| ifier| --------- ---------: |192.0.2.6| :--------- 2170 ------ : --------- : | 2171 : | : ------ 2172 : ------ : | SFI | 2173 :.. | SFIb | ..: |SFT=44| 2174 :.. |SFT=43| ..: ------ 2175 : ------ : 2176 :.---------.: 2177 | SFF7 | 2178 |192.0.2.7| 2179 --------- 2180 | 2181 ------ 2182 | SFIc | 2183 |SFT=43| 2184 ------ 2186 Figure 14: Example With Parallel SFPs Downstream of Choice 2188 The six SFIs are advertised as follows: 2190 RD = 192.0.2.1:11, SFT = 41 2191 RD = 192.0.2.2:11, SFT = 42 2192 RD = 192.0.2.5:11, SFT = 43 (for SFIa) 2193 RD = 192.0.2.6:11, SFT = 43 (for SFIb) 2194 RD = 192.0.2.7:11, SFT = 43 (for SFIc) 2195 RD = 192.0.2.3:11, SFT = 44 2197 SFF2 is the point at which a load balancing choice must be made. So 2198 "tail-end" SFPs are constructed as follows. Each takes in a 2199 different SFF that provides access to an SF of type 43. 2201 SFP26: RD = 198.51.100.1:126, SPI = 40, 2202 Assoc-Type = 1, Assoc-RD = 198.51.100.1:130, Assoc-SPI = 44, 2203 [SI = 255, SFT = 43, RD = 192.0.2.5:11], 2204 [SI = 254, SFT = 44, RD = 192.0.2.3:11] 2206 SFP27: RD = 198.51.100.1:127, SPI = 41, 2207 Assoc-Type = 1, Assoc-RD = 198.51.100.1:131, Assoc-SPI = 45, 2208 [SI = 255, SFT = 43, RD = 192.0.2.6:11], 2209 [SI = 254, SFT = 44, RD = 192.0.2.3:11] 2211 SFP28: RD = 198.51.100.1:128, SPI = 42, 2212 Assoc-Type = 1, Assoc-RD = 198.51.100.1:132, Assoc-SPI = 46, 2213 [SI = 255, SFT = 43, RD = 192.0.2.7:11], 2214 [SI = 254, SFT = 44, RD = 192.0.2.3:11] 2216 Now an end-to-end SFP with load balancing choice can be constructed 2217 as follows. The choice made by SFF2 is expressed in terms of 2218 entering one of the three "tail end" SFPs. 2220 SFP29: RD = 198.51.100.1:129, SPI = 43, 2221 [SI = 255, SFT = 41, RD = 192.0.2.1:11], 2222 [SI = 254, SFT = 42, RD = 192.0.2.2:11], 2223 [SI = 253, {SFT = 1, RD = {SPI=40, SI=255, Rsv=0}, 2224 RD = {SPI=41, SI=255, Rsv=0}, 2225 RD = {SPI=42, SI=255, Rsv=0} } ] 2227 Now, despite the load balancing choice being made other than at the 2228 initial classifier, it is possible for the reverse SFPs to be well- 2229 constructed without any ambiguity. The three reverse paths appear as 2230 follows. 2232 SFP30: RD = 198.51.100.1:130, SPI = 44, 2233 Assoc-Type = 1, Assoc-RD = 198.51.100.1:126, Assoc-SPI = 40, 2234 [SI = 255, SFT = 44, RD = 192.0.2.4:11], 2235 [SI = 254, SFT = 43, RD = 192.0.2.5:11], 2236 [SI = 253, SFT = 42, RD = 192.0.2.2:11], 2237 [SI = 252, SFT = 41, RD = 192.0.2.1:11] 2239 SFP31: RD = 198.51.100.1:131, SPI = 45, 2240 Assoc-Type = 1, Assoc-RD = 198.51.100.1:127, Assoc-SPI = 41, 2241 [SI = 255, SFT = 44, RD = 192.0.2.4:11], 2242 [SI = 254, SFT = 43, RD = 192.0.2.6:11], 2243 [SI = 253, SFT = 42, RD = 192.0.2.2:11], 2244 [SI = 252, SFT = 41, RD = 192.0.2.1:11] 2246 SFP32: RD = 198.51.100.1:132, SPI = 46, 2247 Assoc-Type = 1, Assoc-RD = 198.51.100.1:128, Assoc-SPI = 42, 2248 [SI = 255, SFT = 44, RD = 192.0.2.4:11], 2249 [SI = 254, SFT = 43, RD = 192.0.2.7:11], 2250 [SI = 253, SFT = 42, RD = 192.0.2.2:11], 2251 [SI = 252, SFT = 41, RD = 192.0.2.1:11] 2253 9. Security Considerations 2255 This document inherits all the security considerations discussed in 2256 the documents that specify BGP, the documents that specify BGP 2257 Multiprotocol Extensions, and the documents that define the 2258 attributes that are carried by BGP UPDATEs of the SFC AFI/SAFI. For 2259 more information look in [RFC4271], [RFC4760], and 2260 [I-D.ietf-idr-tunnel-encaps]. 2262 Service Function Chaining provides a significant attack opportunity: 2263 packets can be diverted from their normal paths through the network, 2264 can be made to execute unexpected functions, and the functions that 2265 are instantiated in software can be subverted. However, this 2266 specification does not change the existence of Service Function 2267 Chaining and security issues specific to Service Function Chaining 2268 are covered in [RFC7665] and [RFC8300]. 2270 This document defines a control plane for Service Function Chaining. 2271 Clearly, this provides an attack vector for a Service Function 2272 Chaining system as an attack on this control plane could be used to 2273 make the system misbehave. Thus, the security of the BGP system is 2274 critically important to the security of the whole Service Function 2275 Chaining system. The control plane mechanisms are very similar to 2276 those used for BGP/MPLS IP VPNs as described in [RFC4364], and so the 2277 security considerations in that document (Section 23) provide good 2278 guidance for securing SFC systems reliant on this specification. 2279 Section 19 of [RFC7432] also provides useful guidance on the use of 2280 BGP in a similar environment. 2282 Note that a component of an SFC system that uses the procedures 2283 described in this document also requires communications between a 2284 controller and the SFC network elements. This communication covers 2285 instructing the Classifiers using BGP mechanisms (see Section 7.4) 2286 which is covered by BGP security. But it also covers other 2287 mechanisms for programming the Classifier and instructing the SFFs 2288 and SFs (for example, to bind SFs to an SFF, and to cause the 2289 establishment of tunnels between SFFs). This document does not cover 2290 these latter mechanisms and so their security is out of scope, but it 2291 should be noted that these communications provide an attack vector on 2292 the SFC system and so attention must be paid to ensuring that they 2293 are secure. 2295 10. IANA Considerations 2297 10.1. New BGP AF/SAFI 2299 IANA maintains a registry of "Address Family Numbers". IANA is 2300 requested to assign a new Address Family Number from the "Standards 2301 Action" range called "BGP SFC" (TBD1 in this document) with this 2302 document as a reference. 2304 IANA maintains a registry of "Subsequent Address Family Identifiers 2305 (SAFI) Parameters". IANA is requested to assign a new SAFI value 2306 from the "Standards Action" range called "BGP SFC" (TBD2 in this 2307 document) with this document as a reference. 2309 10.2. New BGP Path Attribute 2311 IANA maintains a registry of "Border Gateway Protocol (BGP) 2312 Parameters" with a subregistry of "BGP Path Attributes". IANA is 2313 requested to assign a new Path attribute called "SFP attribute" (TBD3 2314 in this document) with this document as a reference. 2316 10.3. New SFP Attribute TLVs Type Registry 2318 IANA maintains a registry of "Border Gateway Protocol (BGP) 2319 Parameters". IANA is request to create a new subregistry called the 2320 "SFP Attribute TLVs" registry. 2322 Valid values are in the range 0 to 65535. 2324 o Values 0 and 65535 are to be marked "Reserved, not to be 2325 allocated". 2327 o Values 1 through 65524 are to be assigned according to the "First 2328 Come First Served" policy [RFC8126]. 2330 This document should be given as a reference for this registry. 2332 The new registry should track: 2334 o Type 2336 o Name 2338 o Reference Document or Contact 2340 o Registration Date 2342 The registry should initially be populated as follows: 2344 Type | Name | Reference | Date 2345 ------+-------------------------+---------------+--------------- 2346 1 | Association TLV | [This.I-D] | Date-to-be-set 2347 2 | Hop TLV | [This.I-D] | Date-to-be-set 2348 3 | SFT TLV | [This.I-D] | Date-to-be-set 2349 4 | MPLS Swapping/Stacking | [This.I-D] | Date-to-be-set 2350 5 | SFP Traversal With MPLS | [This.I-D] | Date-to-be-set 2352 10.4. New SFP Association Type Registry 2354 IANA maintains a registry of "Border Gateway Protocol (BGP) 2355 Parameters". IANA is request to create a new subregistry called the 2356 "SFP Association Type" registry. 2358 Valid values are in the range 0 to 65535. 2360 o Values 0 and 65535 are to be marked "Reserved, not to be 2361 allocated". 2363 o Values 1 through 65524 are to be assigned according to the "First 2364 Come First Served" policy [RFC8126]. 2366 This document should be given as a reference for this registry. 2368 The new registry should track: 2370 o Association Type 2372 o Name 2373 o Reference Document or Contact 2375 o Registration Date 2377 The registry should initially be populated as follows: 2379 Association Type | Name | Reference | Date 2380 -----------------+--------------------+------------+--------------- 2381 1 | Bidirectional SFP | [This.I-D] | Date-to-be-set 2383 10.5. New Service Function Type Registry 2385 IANA is request to create a new top-level registry called "Service 2386 Function Chaining Service Function Types". 2388 Valid values are in the range 0 to 65535. 2390 o Values 0 and 65535 are to be marked "Reserved, not to be 2391 allocated". 2393 o Values 1 through 31 are to be assigned by "Standards Action" 2394 [RFC8126] and are referred to as the Special Purpose SFT values. 2396 o Other values (32 through 65534) are to be assigned according to 2397 the "First Come First Served" policy [RFC8126]. 2399 This document should be given as a reference for this registry. 2401 The new registry should track: 2403 o Value 2405 o Name 2407 o Reference Document or Contact 2409 o Registration Date 2411 The registry should initially be populated as follows: 2413 Value | Name | Reference | Date 2414 ------+-----------------------+---------------+--------------- 2415 1 | Change Sequence | [This.I-D] | Date-to-be-set 2417 10.6. New Generic Transitive Experimental Use Extended Community Sub- 2418 Types 2420 IANA maintains a registry of "Border Gateway Protocol (BGP) 2421 Parameters" with a subregistry of "Generic Transitive Experimental 2422 Use Extended Community Sub-Type". IANA is requested to assign a new 2423 sub-type as follows: 2425 "Flow Spec for SFC Classifiers" (TBD4 in this document) with this 2426 document as the reference. 2428 10.7. New BGP Transitive Extended Community Types 2430 IANA maintains a registry of "Border Gateway Protocol (BGP) 2431 Parameters" with a subregistry of "BGP Transitive Extended Community 2432 Types". IANA is requested to assign new types as follows: 2434 "SFI Pool Identifier" (TBD6 in this document) with this document 2435 as the reference. 2437 "MPLS Label Stack Mixed Swapping/Stacking Labels" (TBD7 in this 2438 document) with this document as the reference. 2440 10.8. SPI/SI Representation 2442 IANA is requested to assign a codepoint from the "BGP Tunnel 2443 Encapsulation Attribute Sub-TLVs" registry for the "SPI/SI 2444 Representation Sub-TLV" (TBD5 in this document) with this document 2445 being the reference. 2447 11. Contributors 2449 Stuart Mackie 2450 Juniper Networks 2452 Email: wsmackie@juinper.net 2454 Keyur Patel 2455 Arrcus, Inc. 2457 Email: keyur@arrcus.com 2459 Avinash Lingala 2460 AT&T 2462 Email: ar977m@att.com 2464 12. Acknowledgements 2466 Thanks to Tony Przygienda, Jeff Haas, and Andy Malis for helpful 2467 comments, and to Joel Halpern for discussions that improved this 2468 document. Yuanlong Jiang provided a useful review and caught some 2469 important issues. Stephane Litkowski did an exceptionally good and 2470 detailed document shepherd review. 2472 Andy Malis contributed text that formed the basis of Section 7.7. 2474 13. References 2476 13.1. Normative References 2478 [I-D.ietf-idr-rfc5575bis] 2479 Loibl, C., Hares, S., Raszuk, R., McPherson, D., and M. 2480 Bacher, "Dissemination of Flow Specification Rules", 2481 draft-ietf-idr-rfc5575bis-15 (work in progress), May 2019. 2483 [I-D.ietf-idr-tunnel-encaps] 2484 Patel, K., Velde, G., Ramachandra, S., and E. Rosen, "The 2485 BGP Tunnel Encapsulation Attribute", draft-ietf-idr- 2486 tunnel-encaps-12 (work in progress), May 2019. 2488 [I-D.ietf-mpls-sfc] 2489 Farrel, A., Bryant, S., and J. Drake, "An MPLS-Based 2490 Forwarding Plane for Service Function Chaining", draft- 2491 ietf-mpls-sfc-07 (work in progress), March 2019. 2493 [I-D.ietf-mpls-sfc-encapsulation] 2494 Malis, A., Bryant, S., Halpern, J., and W. Henderickx, 2495 "MPLS Transport Encapsulation For The SFC NSH", draft- 2496 ietf-mpls-sfc-encapsulation-04 (work in progress), March 2497 2019. 2499 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2500 Requirement Levels", BCP 14, RFC 2119, 2501 DOI 10.17487/RFC2119, March 1997, 2502 . 2504 [RFC4271] Rekhter, Y., Ed., Li, T., Ed., and S. Hares, Ed., "A 2505 Border Gateway Protocol 4 (BGP-4)", RFC 4271, 2506 DOI 10.17487/RFC4271, January 2006, 2507 . 2509 [RFC4364] Rosen, E. and Y. Rekhter, "BGP/MPLS IP Virtual Private 2510 Networks (VPNs)", RFC 4364, DOI 10.17487/RFC4364, February 2511 2006, . 2513 [RFC4760] Bates, T., Chandra, R., Katz, D., and Y. Rekhter, 2514 "Multiprotocol Extensions for BGP-4", RFC 4760, 2515 DOI 10.17487/RFC4760, January 2007, 2516 . 2518 [RFC5575] Marques, P., Sheth, N., Raszuk, R., Greene, B., Mauch, J., 2519 and D. McPherson, "Dissemination of Flow Specification 2520 Rules", RFC 5575, DOI 10.17487/RFC5575, August 2009, 2521 . 2523 [RFC7432] Sajassi, A., Ed., Aggarwal, R., Bitar, N., Isaac, A., 2524 Uttaro, J., Drake, J., and W. Henderickx, "BGP MPLS-Based 2525 Ethernet VPN", RFC 7432, DOI 10.17487/RFC7432, February 2526 2015, . 2528 [RFC7606] Chen, E., Ed., Scudder, J., Ed., Mohapatra, P., and K. 2529 Patel, "Revised Error Handling for BGP UPDATE Messages", 2530 RFC 7606, DOI 10.17487/RFC7606, August 2015, 2531 . 2533 [RFC7665] Halpern, J., Ed. and C. Pignataro, Ed., "Service Function 2534 Chaining (SFC) Architecture", RFC 7665, 2535 DOI 10.17487/RFC7665, October 2015, 2536 . 2538 [RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for 2539 Writing an IANA Considerations Section in RFCs", BCP 26, 2540 RFC 8126, DOI 10.17487/RFC8126, June 2017, 2541 . 2543 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2544 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 2545 May 2017, . 2547 [RFC8300] Quinn, P., Ed., Elzur, U., Ed., and C. Pignataro, Ed., 2548 "Network Service Header (NSH)", RFC 8300, 2549 DOI 10.17487/RFC8300, January 2018, 2550 . 2552 13.2. Informative References 2554 [RFC7498] Quinn, P., Ed. and T. Nadeau, Ed., "Problem Statement for 2555 Service Function Chaining", RFC 7498, 2556 DOI 10.17487/RFC7498, April 2015, 2557 . 2559 Authors' Addresses 2561 Adrian Farrel 2562 Old Dog Consulting 2564 Email: adrian@olddog.co.uk 2566 John Drake 2567 Juniper Networks 2569 Email: jdrake@juniper.net 2571 Eric Rosen 2572 Juniper Networks 2574 Email: erosen52@gmail.com 2576 Jim Uttaro 2577 AT&T 2579 Email: ju1738@att.com 2581 Luay Jalil 2582 Verizon 2584 Email: luay.jalil@verizon.com