idnits 2.17.1 draft-ietf-spring-sr-policy-yang-01.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: ---------------------------------------------------------------------------- == The page length should not exceed 58 lines per page, but there was 1 longer page, the longest (page 1) being 59 lines Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** There are 102 instances of too long lines in the document, the longest one being 138 characters in excess of 72. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Line 363 has weird spacing: '...w index uin...' == Line 507 has weird spacing: '...o label rt-...' == Line 510 has weird spacing: '...-ro sid srv...' == The document seems to lack the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords -- however, there's a paragraph with a matching beginning. Boilerplate error? (The document does seem to have the reference to RFC 2119 which the ID-Checklist requires). -- The document date (April 7, 2021) is 1114 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) == Outdated reference: A later version (-22) exists of draft-ietf-spring-segment-routing-policy-09 == Outdated reference: A later version (-26) exists of draft-ietf-idr-segment-routing-te-policy-11 Summary: 1 error (**), 0 flaws (~~), 8 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 1 SPRING Working Group K. Raza, Ed. 2 Internet-Draft R. Sawaya 3 Intended status: Standards Track Cisco Systems 4 Expires: October 9, 2021 5 Z. Shunwan 6 Huawei Technologies 8 D. Voyer 9 Bell Canada 11 M. Durrani 12 Equinix 14 S. Matsushima 15 SoftBank 17 V. Beeram 18 Juniper Networks 20 April 7, 2021 22 YANG Data Model for Segment Routing Policy 23 draft-ietf-spring-sr-policy-yang-01 25 Abstract 27 This document defines a YANG data model for Segment Routing (SR) 28 Policy that can be used for configuring, instantiating, and managing 29 SR policies. The model is generic and apply equally to the MPLS and 30 SRv6 instantiations of SR policies. 32 Status of This Memo 34 This Internet-Draft is submitted in full conformance with the 35 provisions of BCP 78 and BCP 79. 37 Internet-Drafts are working documents of the Internet Engineering 38 Task Force (IETF). Note that other groups may also distribute 39 working documents as Internet-Drafts. The list of current Internet- 40 Drafts is at https://datatracker.ietf.org/drafts/current/. 42 Internet-Drafts are draft documents valid for a maximum of six months 43 and may be updated, replaced, or obsoleted by other documents at any 44 time. It is inappropriate to use Internet-Drafts as reference 45 material or to cite them other than as "work in progress." 47 This Internet-Draft will expire on October 9, 2021. 49 Copyright Notice 51 Copyright (c) 2021 IETF Trust and the persons identified as the 52 document authors. All rights reserved. 54 This document is subject to BCP 78 and the IETF Trust's Legal 55 Provisions Relating to IETF Documents 56 (https://trustee.ietf.org/license-info) in effect on the date of 57 publication of this document. Please review these documents 58 carefully, as they describe your rights and restrictions with respect 59 to this document. Code Components extracted from this document must 60 include Simplified BSD License text as described in Section 4.e of 61 the Trust Legal Provisions and are provided without warranty as 62 described in the Simplified BSD License. 64 Table of Contents 66 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 67 2. Specification of Requirements . . . . . . . . . . . . . . . . 3 68 3. Building Blocks . . . . . . . . . . . . . . . . . . . . . . . 3 69 4. YANG Model . . . . . . . . . . . . . . . . . . . . . . . . . 4 70 4.1. Types and Definitions . . . . . . . . . . . . . . . . . . 5 71 4.2. SR Policy . . . . . . . . . . . . . . . . . . . . . . . . 6 72 4.2.1. Configuration . . . . . . . . . . . . . . . . . . . . 6 73 4.2.2. State . . . . . . . . . . . . . . . . . . . . . . . . 10 74 4.2.3. Notification . . . . . . . . . . . . . . . . . . . . 12 75 5. Pending Items . . . . . . . . . . . . . . . . . . . . . . . . 13 76 6. YANG Specification . . . . . . . . . . . . . . . . . . . . . 14 77 6.1. Types . . . . . . . . . . . . . . . . . . . . . . . . . . 14 78 6.2. SR Policy . . . . . . . . . . . . . . . . . . . . . . . . 22 79 7. Security Considerations . . . . . . . . . . . . . . . . . . . 44 80 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 44 81 9. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 45 82 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 45 83 10.1. Normative References . . . . . . . . . . . . . . . . . . 45 84 10.2. Informative References . . . . . . . . . . . . . . . . . 46 85 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 46 87 1. Introduction 89 The Network Configuration Protocol (NETCONF) [RFC6241] defines 90 mechanisms to manage network devices. YANG [RFC6020] is a modular 91 language that represents data structures in an XML tree format, and 92 is used as a data modeling language for the NETCONF. 94 Segment Routing (SR), as defined in [RFC8402], allows a headend node 95 to steer a packet flow along any topological path and/or service 96 chain. The headend node is said to steer a flow into a Segment 97 Routing Policy (SR Policy). An SR policy is a framework 98 [I-D.ietf-spring-segment-routing-policy] that enables instantiation 99 of an ordered list of segments on a node for implementing a policy. 101 This document introduces a YANG data model for SR policy framework 102 for instantiating, configuring and managing SR policies along with 103 its attributes. It is also expected that other companion models, 104 such as BGP SR Policy [I-D.ietf-idr-segment-routing-te-policy], will 105 be defined and/or augmented accordingly in their respective areas. 107 This model defines the following constructs for managing an SR 108 policy: 110 o Configuration 112 o Operational State 114 o Notifications 116 o Executables (Actions) 118 This document expects and requires the reader to be well familiar 119 with the concepts and constructs of an SR policy 120 [I-D.ietf-spring-segment-routing-policy] as well as the YANG modeling 121 language and its presentation [RFC6020]. 123 2. Specification of Requirements 125 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 126 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 127 document are to be interpreted as described in BCP 14 [RFC2119] 128 [RFC8174] when, and only when, they appear in all capitals, as shown 129 here. 131 3. Building Blocks 133 Before looking into the YANG model for SR policy, it is important to 134 recall and highlight the major building blocks and constructs that 135 constitute and contribute to an SR policy, as described in 136 [I-D.ietf-spring-segment-routing-policy]. 138 o policy: specifies constructs to allow a headend node to setup SR 139 path(s) as an ordered list of segments for a given color and 140 endpoint. The endpoint and the color are used to automate the 141 steering of service or transport routes on an SR Policy. For a 142 given headend, the key for an SR policy is (color, endpoint) where 143 endpoint is an IP address that could be also NULL. 145 o candidate-path: is the unit for signalling of an SR Policy to a 146 headend via protocols (such as PCEP, BGP, CLI etc.). A candidate 147 path is either dynamic or explicit type, where an explicit 148 candidate path is associated with one or more segment-lists and 149 dynamic candidate path expresses optimization objectives and set 150 of constraints. An SR Policy is associated with one or more 151 candidate paths and the preference of the candidate path is used 152 to select the best candidate path for an SR Policy. A candidate 153 path is valid if it is usable (e.g. when its constituents SIDs are 154 reachable). An "active" candidate path is the selected path (for 155 forwarding) that is valid and determined to be the best path of 156 the SR Policy. A candidate path is keyed by (protocol-origin, 157 originator, discriminator). 159 o segment-list: specifies ordered list of segments to traverse, 160 where a segment can be specified in various forms (refer section 4 161 of [I-D.ietf-spring-segment-routing-policy]). The list is sorted 162 by the index of the segment. A segment-list is used and referred 163 by an explicit type of candidate-path. A segment-list is keyed by 164 its name. 166 o binding-sid: An SR policy is associated with a BSID to provide 167 benefits of scaling, network opacity and service independence. 169 4. YANG Model 171 The modeling in this document complies with the Network Management 172 Datastore Architecture (NMDA) [RFC8342]. The operational state data 173 is combined with the associated configuration data in the same 174 hierarchy [RFC8407]. When protocol states are retrieved from the 175 NMDA operational state datastore, the returned states cover all 176 "config true" (rw) and "config false" (ro) nodes defined in the 177 schema. 179 For SR policy YANG specification, this document defines following new 180 YANG modules: 182 +----------------------+--------------------------------------------+ 183 | Module Name | Purpose | 184 +----------------------+--------------------------------------------+ 185 | ietf-sr-policy-types | defines common and basic types related to | 186 | | an SR policy and related constructs | 187 | | | 188 | ietf-sr-policy | defines the model for SR policy | 189 | | instantiation, configuration, and | 190 | | management | 191 +----------------------+--------------------------------------------+ 193 4.1. Types and Definitions 195 SR policy common types and definitions are defined in the new module 196 "ietf-sr-policy-types". The main types defined in this module 197 include: 199 o dataplane-type: A union to specify MPLS or IPv6 as the dataplane 200 type for SR. 202 o sid-value-type: A Union to specify SID value for SR-MPLS or SRv6 203 type. 205 o binding-sid-alloc-mode: Enum to define explicit or dynamic alloc 206 mode types for a BSID. 208 o protocol-origin-type: Enum to specify protocol origin (e.g. PCEP) 209 for an SR policy. 211 o explicit-binding-sid-rule-type: Enum to specify BSID alloc 212 enforcement/rule when doing explicit alloc request. 214 o binding-sid-oper-state: An Enum representing various operational 215 states for a BSID. 217 o policy-admin-state: An Enum for admin state of an SR policy. 219 o policy-oper-state: An Enum for operational state of an SR policy. 221 o segment-type: An Enum that defines various types for a "segment" 222 of a Segment list. 224 o candidate-path-non-selection-reason: The base identity along with 225 its children to specify reason for not selecting a candidate path 226 as the best/active path. 228 o path-disjointness: The base identity for disjoint path 229 computation. The disjointness types include link, node, srlg, 230 srlg-node etc. 232 o policy-down-reason: The base identity along with its children to 233 specify reason for a policy becoming (or remaining) operationally 234 down. 236 o binding-sid-unavailable-reason: The base identity along with its 237 children to specify reason for a BSID's unavailability. 239 The associated YANG specification for this module is captured in 240 Section 6.1. 242 4.2. SR Policy 244 The base SR policy model is captured in ietf-sr-policy module. This 245 base module augments "/rt:routing" and specifies the configuration, 246 operational state, executables/rpcs, and notification events required 247 to manage SR policies. 249 The associated YANG specification for this module is captured in 250 Section 6.2. 252 4.2.1. Configuration 254 In terms of configuration hierarchy, SR policy configuration tree has 255 following two main areas: 257 o attributes: container that defines common constructs that could be 258 used across policies. Examples of such a construct include 259 segment-lists, affinity-map etc. In future revision of this 260 document, it is expected that this container will have more 261 constructs defined. 263 o policies: container that defines list of policies with their 264 attributes such as BSID, candidate-paths etc. 266 Following diagram depicts high level yang organization and hierarchy 267 for an SR policy specification: 269 segment-routing 270 traffic-engineering 271 + attributes 272 | + affinity-map 273 | | .... 274 | | 275 | + segment-lists 276 | | segment-list* [name] 277 | | segments 278 | | segment* [index] 279 | | ... 280 | + explicit-binding-sid-rules 281 | ... 282 | 283 + policies 284 policy* [color endpoint] 285 + ... 286 | 287 + binding-sid 288 | ... 289 | 290 + candidate-paths 291 candidate-path* [protocol-origin originator discriminator] 292 + ... 293 | 294 + type 295 + explicit 296 | segment-lists 297 | segment-list* [ref] 298 | ... 299 + dynamic 300 constraints 301 ... 303 Figure 1: SR Policy - Hierarchy 305 Using the building blocks described in Section 3, following is the 306 complete graphical representation of the data model for SR policy 307 configuration: 309 module: ietf-sr-policy 310 augment /rt:routing: 311 +--rw segment-routing 312 +--rw traffic-engineering 313 +--rw attributes 314 | +--rw affinity-map 315 | | +--rw affinity* [name] 316 | | +--rw name string 317 | | +--rw bit-position? uint16 318 | +--rw segment-lists 319 | | +--rw segment-list* [name] 320 | | +--rw name string 321 | | +--rw segments 322 | | +--rw segment* [index] 323 | | +--rw index uint32 324 | | +--rw type? sr-policy-types:segment-type 325 | | +--rw segment-types 326 | | | +--rw segment-type-1 327 | | | | +--rw sid-value? rt-types:mpls-label 328 | | | +--rw segment-type-2 329 | | | | +--rw sid-value? srv6-types:srv6-sid 330 | | | +--rw segment-type-3 331 | | | | +--rw ipv4-address? inet:ipv4-address 332 | | | | +--rw algorithm? uint8 333 | | | +--rw segment-type-4 334 | | | | +--rw ipv6-address? inet:ipv6-address 335 | | | | +--rw algorithm? uint8 336 | | | +--rw segment-type-5 337 | | | | +--rw ipv4-address? inet:ipv4-address 338 | | | | +--rw interface-identifier? uint32 339 | | | +--rw segment-type-6 340 | | | | +--rw local-ipv4-address? inet:ipv4-address 341 | | | | +--rw remote-ipv4-address? inet:ipv4-address 342 | | | +--rw segment-type-7 343 | | | | +--rw local-ipv6-address? inet:ipv6-address 344 | | | | +--rw local-interface-identifier? uint32 345 | | | | +--rw remote-ipv6-address? inet:ipv6-address 346 | | | | +--rw remote-interface-identifier? uint32 347 | | | +--rw segment-type-8 348 | | | | +--rw local-ipv6-address? inet:ipv6-address 349 | | | | +--rw remote-ipv6-address? inet:ipv6-address 350 | | | +--rw segment-type-9 351 | | | | +--rw ipv6-address? inet:ipv6-address 352 | | | | +--rw algorithm? uint8 353 | | | +--rw segment-type-10 354 | | | | +--rw local-ipv6-address? inet:ipv6-address 355 | | | | +--rw local-interface-identifier? uint32 356 | | | | +--rw remote-ipv6-address? inet:ipv6-address 357 | | | | +--rw remote-interface-identifier? uint32 358 | | | +--rw segment-type-11 359 | | | +--rw local-ipv6-address? inet:ipv6-address 360 | | | +--rw remote-ipv6-address? inet:ipv6-address 361 | | +--rw validate? boolean 362 | +--rw explicit-binding-sid-rules* [index] 363 | +--rw index uint32 364 | +--rw rule? sr-policy-types:explicit-binding-sid-rule-type 365 +--rw policies 366 +--rw policy* [color endpoint] 367 +--rw color uint32 368 +--rw endpoint inet:ip-address 369 +--rw name? string 370 +--rw description? string 371 +--rw admin-state? sr-policy-types:policy-admin-state 372 +--rw priority? uint8 373 +--rw binding-sid 374 | +--rw dataplane? sr-policy-types:dataplane-type 375 | +--rw value? sr-policy-types:sid-value-type 376 +--rw candidate-paths 377 +--rw candidate-path* [protocol-origin originator discriminator] 378 +--rw protocol-origin sr-policy-types:protocol-origin-type 379 +--rw originator string 380 +--rw discriminator uint32 381 +--rw preference uint32 382 +--rw name? string 383 +--rw description? string 384 +--rw binding-sid {capability-candidate-path-binding-sid}? 385 | +--rw dataplane? sr-policy-types:dataplane-type 386 | +--rw value? sr-policy-types:sid-value-type 387 +--rw (type)? 388 +--:(explicit) 389 | +--rw segment-lists 390 | +--rw segment-list* [name-ref] 391 | +--rw name-ref -> /rt:routing/sr-policy:segment-routing/traffic-engineering/attributes/segment-lists/segment-list/name 392 | +--rw weight? uint32 393 +--:(dynamic) 394 +--rw sid-dataplane-type? sr-policy-types:dataplane-type 395 +--rw constraints 396 +--rw affinities 397 | +--rw exclude-any* string 398 | +--rw include-any* string 399 | +--rw include-all* string 400 +--rw bounds 401 | +--rw igp-metric-bound? uint32 402 | +--rw te-metric-bound? uint32 403 | +--rw latency-metric-bound? uint32 404 | +--rw segment-bound? uint32 405 +--rw segment-rules 406 | +--rw sid-algorithm? uint8 407 +--rw disjoint-path 408 +--rw group-id? uint32 409 +--rw disjointness-type? identityref 410 +--rw subgroup-id? uint32 412 Figure 2: SR Policy - Config Tree 414 Please take note of the following important points in the above 415 configuration model: 417 o This model supports both MPLS and SRv6 dataplane for SR -- i.e. 418 items like segments and BSID can be defined as MPLS label or SRv6 419 SIDs. 421 o Specification of a segment supports all the types defined in SR 422 policy base specification document 424 o The above model supports explicit BSID specification on SR policy 425 level as the main mode of specification. The model also allows 426 explicit BSID per candidate-path as an if-feature capability that 427 is optional for implementations 429 o The above model will be extended in future revisions of this 430 document to enhance constraints specification for dynamic type of 431 candidate-path, as well as add traffic-steering controls. 433 4.2.2. State 435 As per NMDA model, the state related to configuration items specified 436 in earlier Section 4.2.1 can be retrieved from the same tree. This 437 section defines the other operational state items related to SR 438 policy. 440 In addition to configured state, the operational state corresponding 441 to the SR policy includes: 443 o policy operational state 445 o policy up/down timestamps 447 o policy BSID info such as alloc mode, actual value in-use, 448 operational state, and forwarding stats 450 o Per candidate-path info such as: 452 * Whether candidate-path is the best candidate-path 454 * In case of non-best, the reason for such non-selection 456 * Type of candidate-path - explicit or dynamic 458 * Per segment-list information - such as validity of the segment- 459 list, as well as forwarding state for a valid segment-list. 461 The forwarding state is represented in terms of per forwarding 462 path info that includes nexthop address, outgoing interface, 463 protection information, and encapsulation (label stack or SRv6 464 SID stack) etc. 466 Following is a simplified graphical representation of the data model 467 for the SR policy (derived) operational state: 469 module: ietf-sr-policy 470 augment /rt:routing: 471 +--rw segment-routing 472 +--rw traffic-engineering 473 +--rw policies 474 +--rw policy* [color endpoint] 475 +--rw color uint32 476 +--rw endpoint inet:ip-address 477 +--ro oper-state? sr-policy-types:policy-oper-state 478 +--ro transition-count? uint32 479 +--ro up-time? yang:date-and-time 480 +--ro down-time? yang:date-and-time 481 +--rw binding-sid 482 | +--ro alloc-mode? sr-policy-types:binding-sid-alloc-mode 483 | +--ro allocated-sid? sr-policy-types:sid-value-type 484 | +--ro oper-state? sr-policy-types:binding-sid-oper-state 485 +--ro counters 486 | +--ro pkts? yang:counter64 487 | +--ro octets? yang:counter64 488 +--rw candidate-paths 489 +--rw candidate-path* [protocol-origin originator discriminator] 490 +--rw protocol-origin sr-policy-types:protocol-origin-type 491 +--rw originator string 492 +--rw discriminator uint32 493 +--rw name string 494 +--ro is-best-candidate-path? boolean 495 +--ro non-selection-reason? identityref 496 +--ro is-valid? boolean 497 +--ro forwarding-paths 498 +--ro forwarding-path* [path-id] 499 +--ro path-id uint8 500 +--ro next-hop-address? inet:ip-address 501 +--ro next-hop-table-id? uint32 502 +--ro interface? if:interface-ref 503 +--ro sid-list 504 | +--ro (dataplanetype)? 505 | +--:(mpls) 506 | | +--ro labels* [label] 507 | | +--ro label rt-types:mpls-label 508 | +--:(srv6) 509 | +--ro sids* [sid] 510 | +--ro sid srv6-types:srv6-sid 511 +--ro is-protected? boolean 512 +--ro is-pure-backup? boolean 513 +--ro backup-path-id? uint8 514 +--ro weight? uint32 516 Figure 3: SR Policy - State Tree 518 4.2.3. Notification 520 This model defines a list of notifications to inform an operator of 521 important events detected regarding an SR policy. These events 522 include events related to: 524 o policy status: policy operational state changes 526 o Candidate-path active status and changes 528 o Explicit Binding SID collision/unavailability events 530 Following is a simplified graphical representation of the data model 531 for SR policy notifications: 533 module: ietf-sr-policy 535 notifications: 536 +---n sr-policy-oper-state-change-event 537 | +--ro policy-name-ref? -> /rt:routing/sr-policy:segment-routing/traffic-engineering/policies/policy/name 538 | +--ro policy-color-ref? -> /rt:routing/sr-policy:segment-routing/traffic-engineering/policies/policy/color 539 | +--ro policy-endpoint-ref? -> /rt:routing/sr-policy:segment-routing/traffic-engineering/policies/policy/endpoint 540 | +--ro policy-new-oper-state? sr-policy-types:policy-oper-state 541 | +--ro policy-down-reason? identityref 542 +---n sr-policy-candidate-path-change-event 543 | +--ro policy-name-ref? -> /rt:routing/sr-policy:segment-routing/traffic-engineering/policies/policy/name 544 | +--ro policy-color-ref? -> /rt:routing/sr-policy:segment-routing/traffic-engineering/policies/policy/color 545 | +--ro policy-endpoint-ref? -> /rt:routing/sr-policy:segment-routing/traffic-engineering/policies/policy/endpoint 546 | +--ro existing-preference? uint32 547 | +--ro new-preference? uint32 548 +---n sr-policy-binding-sid-unavailable-event 549 | +--ro policy-name-ref? -> /rt:routing/sr-policy:segment-routing/traffic-engineering/policies/policy/name 550 | +--ro policy-color-ref? -> /rt:routing/sr-policy:segment-routing/traffic-engineering/policies/policy/color 551 | +--ro policy-endpoint-ref? -> /rt:routing/sr-policy:segment-routing/traffic-engineering/policies/policy/endpoint 552 | +--ro policy-binding-sid-value-ref? -> /rt:routing/sr-policy:segment-routing/traffic-engineering/policies/policy/binding-sid/value 553 | +--ro reason? identityref 554 +---n sr-policy-candidate-path-binding-sid-mismatch-event 555 +--ro policy-color-ref? -> /rt:routing/sr-policy:segment-routing/traffic-engineering/policies/policy/color 556 +--ro policy-endpoint-ref? -> /rt:routing/sr-policy:segment-routing/traffic-engineering/policies/policy/endpoint 557 +--ro existing-candidate-path-protocol-origin-ref? -> /rt:routing/sr-policy:segment-routing/traffic-engineering/policies/policy/candidate-paths/candidate-path/protocol-origin 558 +--ro existing-candidate-path-preference-ref? -> /rt:routing/sr-policy:segment-routing/traffic-engineering/policies/policy/candidate-paths/candidate-path/preference 559 +--ro existing-candidate-path-binding-sid-dataplane-ref? -> /rt:routing/sr-policy:segment-routing/traffic-engineering/policies/policy/candidate-paths/candidate-path/binding-sid/dataplane 560 +--ro existing-candidate-path-binding-sid-value-ref? -> /rt:routing/sr-policy:segment-routing/traffic-engineering/policies/policy/candidate-paths/candidate-path/binding-sid/value 561 +--ro conflicting-candidate-path-protocol-origin? uint8 562 +--ro conflicting-candidate-path-preference? uint32 563 +--ro conflicting-candidate-path-binding-sid-dataplane? sr-policy-types:dataplane-type 564 +--ro conflicting-candidate-path-binding-sid-value? sr-policy-types:sid-value-type 566 Figure 4: SR Policy - Notification Tree 568 5. Pending Items 570 Following are the items that will be addressed in future revisions of 571 this document: 573 o Configuration and Specification of: 575 * Traffic steering over SR policy 577 * ODN templates 579 * Spray policy 581 o Executables (RPC actions) 583 6. YANG Specification 585 Following are actual YANG definition for the modules defined earlier 586 in the document. 588 6.1. Types 590 file "ietf-sr-policy-types@2019-11-04.yang" 592 module ietf-sr-policy-types { 593 namespace "urn:ietf:params:xml:ns:yang:ietf-sr-policy-types"; 595 prefix "sr-policy-types"; 597 import ietf-inet-types { 598 prefix "inet"; 599 } 601 import ietf-routing-types { 602 prefix "rt-types"; 603 } 605 import ietf-srv6-types { 606 prefix "srv6-types"; 607 } 609 organization "IETF SPRING Working Group"; 611 contact 612 "WG Web: 613 WG List: 614 Editor: Kamran Raza 615 616 Editor: Zhuang Shunwan 617 618 Editor: Daniel Voyer 619 620 Editor: Muhammad Durrani 621 622 Editor: Satoru Matsushima 623 624 Editor: Pavan Vishnu Beeram 625 626 "; 628 description 629 "This YANG module defines the essential types for the management 630 of SR policy module. 631 Copyright (c) 2019 IETF Trust and the persons identified as 632 authors of the code. All rights reserved. 633 Redistribution and use in source and binary forms, with or 634 without modification, is permitted pursuant to, and subject 635 to the license terms contained in, the Simplified BSD License 636 set forth in Section 4.c of the IETF Trust's Legal Provisions 637 Relating to IETF Documents 638 (http://trustee.ietf.org/license-info)."; 640 revision "2019-11-04" { 641 description 642 "New editor added"; 643 reference 644 "draft-raza-spring-sr-policy-yang"; 645 } 647 revision "2019-07-08" { 648 description 649 "Dynamic TE candidate-path support"; 650 reference 651 "draft-raza-spring-sr-policy-yang"; 652 } 654 revision "2018-07-01" { 655 description 656 "Initial version"; 657 reference 658 "draft-raza-spring-sr-policy-yang"; 659 } 661 /* Identities */ 662 identity candidate-path-not-selected-reason { 663 description 664 "Base identity for which reasons for not selecting 665 candidate path are derived from"; 666 } 667 identity candidate-path-not-selected-not-best { 668 base candidate-path-not-selected-reason; 669 description 670 "Higher preference path exists"; 671 } 672 identity candidate-path-not-selected-no-valid-segment-list { 673 base candidate-path-not-selected-reason; 674 description 675 "Candidate path has no valid segment list(s)"; 677 } 678 identity candidate-path-not-selected-empty-segment-list { 679 base candidate-path-not-selected-reason; 680 description 681 "Candidate path has empty segment list(s)"; 682 } 683 identity candidate-path-not-selected-invalid-binding-sid { 684 base candidate-path-not-selected-reason; 685 description 686 "Candidate path has invalid binding SID"; 687 } 689 identity policy-down-reason { 690 description 691 "Base identity for the reasons why SR policy is operationally down"; 692 } 693 identity policy-down-reason-admin-down { 694 base policy-down-reason; 695 description "Policy is administrately down"; 696 } 697 identity policy-down-reason-no-source-address { 698 base policy-down-reason; 699 description "Policy has no source address"; 700 } 701 identity policy-down-reason-no-endpoint { 702 base policy-down-reason; 703 description "Policy has no end-point"; 704 } 705 identity policy-down-reason-no-candidate-path { 706 base policy-down-reason; 707 description "Policy has no candidate path"; 708 } 709 identity policy-down-reason-no-valid-candidate-path { 710 base policy-down-reason; 711 description "Policy has no valid candidate path"; 712 } 713 identity policy-down-reason-candidate-path-invalid-segment-list { 714 base policy-down-reason; 715 description "Policy's candidate path has invalid segment list"; 716 } 717 identity policy-down-reason-policy-unconfigured { 718 base policy-down-reason; 719 description "Policy is unconfigured"; 720 } 721 identity policy-down-reason-policy-color-endpoint-updated { 722 base policy-down-reason; 723 description "Policy's color and end-point are updated"; 724 } 725 identity policy-down-reason-local-label-setup-failed { 726 base policy-down-reason; 727 description "Policy's local label setup (allocation/rewrite) failed"; 728 } 729 identity policy-down-reason-forwarding-rewrite-failed { 730 base policy-down-reason; 731 description "Policy's forwarding rewrite installation failed"; 732 } 733 identity policy-down-reason-internal-error { 734 base policy-down-reason; 735 description "Infra related internal error"; 736 } 738 identity binding-sid-unavailable-reason { 739 description 740 "Base identity for binding sid unavailable reason types"; 741 } 742 identity binding-sid-allocation-error { 743 base binding-sid-unavailable-reason; 744 description "SID allocator returned an error"; 745 } 746 identity binding-sid-already-exists { 747 base binding-sid-unavailable-reason; 748 description "Binding sid already exists/allocated"; 749 } 750 identity binding-sid-internal-error { 751 base binding-sid-unavailable-reason; 752 description "Internal error with binding sid allocation"; 753 } 754 identity binding-sid-color-endpoint-conflict { 755 base binding-sid-unavailable-reason; 756 description "Binding sid already allocated by another sr-policy with different color/endpoint"; 757 } 758 identity binding-sid-rewrite-error { 759 base binding-sid-unavailable-reason; 760 description "Binding sid forwarding rewrite error"; 761 } 762 identity binding-sid-outside-srlb-range { 763 base binding-sid-unavailable-reason; 764 description "Binding sid outside SRLB range"; 765 } 767 identity path-disjointness { 768 description 769 "Base identity for the type of path disjointness computation"; 770 } 771 identity path-disjointness-link { 772 base path-disjointness; 773 description "The computed path is link-disjoint with the existing path"; 774 } 775 identity path-disjointness-node { 776 base path-disjointness; 777 description "The computed path is node-disjoint with the existing path"; 778 } 779 identity path-disjointness-srlg { 780 base path-disjointness; 781 description "The computed path is srlg-disjoint with the existing path"; 782 } 783 identity path-disjointness-srlg-node { 784 base path-disjointness; 785 description "The computed path is node and srlg disjoint with the existing path"; 786 } 788 /* Typdefs */ 789 typedef sid-value-type { 790 type union { 791 type rt-types:mpls-label; 792 type srv6-types:srv6-sid; 793 } 794 description "The SID value type"; 795 } 797 typedef binding-sid-oper-state { 798 type enumeration { 799 enum ALLOC-PENDING { 800 value 1; 801 description "SID allocation pending for Binding SID"; 802 } 803 enum PROGRAMMED { 804 value 3; 805 description "Binding SID is programmed in forwarding"; 806 } 807 enum CONFLICT { 808 value 4; 809 description "Binding SID is in-conflict state with 810 regards to SID allocation. This also means that SID 811 allocation is pending"; 812 } 813 } 814 description 815 "Binding SID operational state type"; 816 } 818 typedef policy-admin-state { 819 type enumeration { 820 enum UP { 821 value 1; 822 description "SR policy is administratively up"; 823 } 824 enum DOWN { 825 value 2; 826 description "SR policy is administratively down"; 827 } 828 } 829 description "SR policy admin state"; 830 } 832 typedef policy-oper-state { 833 type enumeration { 834 enum UP { 835 value 1; 836 description "SR policy is operationally up"; 837 } 838 enum DOWN { 839 value 2; 840 description "SR policy is operationally down"; 841 } 842 } 843 description "SR policy oper state"; 844 } 846 typedef segment-type { 847 type enumeration { 848 enum segment-type-1 { 849 value 1; 850 description "SR-MPLS Label"; 851 } 852 enum segment-type-2 { 853 value 2; 854 description "SRv6 SID"; 855 } 856 enum segment-type-3 { 857 value 3; 858 description "IPv4 Prefix with optional SR Algorithm"; 859 } 860 enum segment-type-4 { 861 value 4; 862 description "IPv6 Global Prefix with optional SR Algorithm for SR-MPLS"; 863 } 864 enum segment-type-5 { 865 value 5; 866 description "IPv4 Prefix with Local Interface ID"; 867 } 868 enum segment-type-6 { 869 value 6; 870 description "IPv4 Addresses for link endpoints as Local, Remote pair"; 871 } 872 enum segment-type-7 { 873 value 7; 874 description "IPv6 Prefix and Interface ID for link endpoints as Local, 875 Remote pair for SR-MPLS"; 876 } 877 enum segment-type-8 { 878 value 8; 879 description "IPv6 Addresses for link endpoints as Local, Remote pair for 880 SR-MPLS"; 881 } 882 enum segment-type-9 { 883 value 9; 884 description "IPv6 Global Prefix with optional SR Algorithm for SRv6"; 885 } 886 enum segment-type-10 { 887 value 10; 888 description "IPv6 Prefix and Interface ID for link endpoints as Local, 889 Remote pair for SRv6"; 890 } 891 enum segment-type-11 { 892 value 11; 893 description "IPv6 Addresses for link endpoints as Local, Remote pair for 894 SRv6"; 895 } 896 } 897 description "SR segment type"; 898 } 900 typedef dataplane-type { 901 type enumeration { 902 enum mpls { 903 value 1; 904 description "Segment-routing MPLS"; 905 } 906 enum srv6 { 907 value 2; 908 description "Segment-routing v6"; 909 } 910 } 911 description "Dataplane type of the segments"; 912 } 914 typedef binding-sid-alloc-mode { 915 type enumeration { 916 enum explicit { 917 value 1; 918 description "Explicitly specified BSID"; 919 } 920 enum dynamic { 921 value 2; 922 description "Dynamically allocated BSID"; 923 } 924 } 925 description "binding SID allocation mode"; 926 } 928 typedef protocol-origin-type { 929 type enumeration { 930 enum pcep { 931 value 10; 932 description "PCEP used as signalling mechanism for the candidate path"; 933 } 934 enum bgp { 935 value 20; 936 description "BGP used as signalling mechanism for the candidate path"; 937 } 938 enum local { 939 value 30; 940 description "CLI, Yang model via Netconf, gRPC, etc used for candidate path instantiation"; 941 } 942 } 944 description "Originating protocol type"; 945 } 947 typedef explicit-binding-sid-rule-type { 948 type enumeration { 949 enum enforce-srlb { 950 value 1; 951 description 952 "Explicit Binding SID is enforced with no 953 fallback if label does not fall in SRLB or 954 if no SRLB is configured"; 955 } 956 enum fallback-dynamic { 957 value 2; 958 description 959 "Explicit Binding SID falls back to dynamic in 960 case explicit label is not available."; 961 } 962 } 963 description "Explicit binding sid rule types"; 964 } 966 } // module 968 970 Figure 5: ietf-sr-policy-types.yang 972 6.2. SR Policy 974 file "ietf-sr-policy@2019-11-04.yang" 976 module ietf-sr-policy { 978 namespace "urn:ietf:params:xml:ns:yang:ietf-sr-policy"; 980 prefix "sr-policy"; 982 import ietf-inet-types { 983 prefix "inet"; 984 } 986 import ietf-interfaces { 987 prefix if; 988 } 990 import ietf-routing { 991 prefix "rt"; 992 } 994 import ietf-routing-types { 995 prefix "rt-types"; 996 } 998 import ietf-yang-types { 999 prefix "yang"; 1000 } 1002 import ietf-srv6-types { 1003 prefix "srv6-types"; 1004 } 1006 import ietf-sr-policy-types { 1007 prefix "sr-policy-types"; 1008 } 1010 organization "IETF SPRING Working Group"; 1011 contact 1012 "WG Web: 1013 WG List: 1015 Editor: Kamran Raza 1016 1018 Editor: Zhuang Shunwan 1019 1021 Editor: Daniel Voyer 1022 1024 Editor: Muhammad Durrani 1025 1027 Editor: Satoru Matsushima 1028 1030 Editor: Pavan Vishnu Beeram 1031 1032 "; 1034 description 1035 "This module contains a collection of YANG definitions 1036 for SR policy module. 1038 Copyright (c) 2019 IETF Trust and the persons identified as 1039 authors of the code. All rights reserved. 1041 Redistribution and use in source and binary forms, with or 1042 without modification, is permitted pursuant to, and subject 1043 to the license terms contained in, the Simplified BSD License 1044 set forth in Section 4.c of the IETF Trust's Legal Provisions 1045 Relating to IETF Documents 1046 (http://trustee.ietf.org/license-info)."; 1048 revision "2019-11-04" { 1049 description 1050 "Changes in keys for policy and its candidate paths"; 1051 reference 1052 "draft-raza-spring-sr-policy-yang"; 1053 } 1055 revision "2019-07-08" { 1056 description 1057 "Dynamic TE candidate-path support"; 1059 reference 1060 "draft-raza-spring-sr-policy-yang"; 1061 } 1063 revision "2018-07-01" { 1064 description 1065 "Initial version"; 1066 reference 1067 "draft-raza-spring-sr-policy-yang"; 1068 } 1070 grouping segment_config { 1071 description "Segment properties grouping"; 1072 leaf index { 1073 type uint32; 1074 description "Segment index"; 1075 } 1076 leaf type { 1077 type sr-policy-types:segment-type; 1078 description "Segment type"; 1079 } 1080 container segment-types { 1081 description "Types of segments"; 1082 container segment-type-1 { 1083 description 1084 "Segment declared by MPLS label"; 1085 leaf sid-value { 1086 type rt-types:mpls-label; 1087 description "MPLS label value"; 1088 } 1089 } 1090 container segment-type-2 { 1091 description 1092 "Segment declared by SRv6 SID value"; 1093 leaf sid-value { 1094 type srv6-types:srv6-sid; 1095 description "SRv6 SID value"; 1096 } 1097 } 1098 container segment-type-3 { 1099 description 1100 "Segment declared by IPv4 Prefix with optional SR Algorithm"; 1101 leaf ipv4-address { 1102 type inet:ipv4-address; 1103 description "Segment IPv4 address"; 1104 } 1105 leaf algorithm { 1106 type uint8; 1107 description "Prefix SID algorithm identifier"; 1108 } 1109 } 1110 container segment-type-4 { 1111 description 1112 "Segment declared by IPv6 Global Prefix with optional 1113 SR Algorithm for SR-MPLS"; 1114 leaf ipv6-address { 1115 type inet:ipv6-address; 1116 description "Segment IPv6 address"; 1117 } 1118 leaf algorithm { 1119 type uint8; 1120 description "Prefix SID algorithm identifier"; 1121 } 1122 } 1123 container segment-type-5 { 1124 description 1125 "Segment declared by IPv4 Prefix with Local Interface ID"; 1126 leaf ipv4-address { 1127 type inet:ipv4-address; 1128 description "Node IPv4 address"; 1129 } 1130 leaf interface-identifier { 1131 type uint32; 1132 description "local interface identifier"; 1133 } 1134 } 1135 container segment-type-6 { 1136 description 1137 "Segment declared by IPv4 Addresses for link endpoints 1138 as Local, Remote pair"; 1139 leaf local-ipv4-address { 1140 type inet:ipv4-address; 1141 description "Segment local IPv4 adjacency address"; 1142 } 1143 leaf remote-ipv4-address { 1144 type inet:ipv4-address; 1145 description "Segment remote IPv4 adjacency address"; 1146 } 1147 } 1148 container segment-type-7 { 1149 description 1150 "Segment declared by IPv6 Prefix and Interface ID for 1151 link endpoints as Local, Remote pair for SR-MPLS"; 1152 leaf local-ipv6-address { 1153 type inet:ipv6-address; 1154 description "Local link IPv6 address"; 1156 } 1157 leaf local-interface-identifier { 1158 type uint32; 1159 description "Local interface identifier"; 1160 } 1161 leaf remote-ipv6-address { 1162 type inet:ipv6-address; 1163 description "Remote link IPv6 address"; 1164 } 1165 leaf remote-interface-identifier { 1166 type uint32; 1167 description "Remote interface identifier"; 1168 } 1169 } 1170 container segment-type-8 { 1171 description 1172 "Segment declared by IPv6 Addresses for link endpoints as 1173 Local, Remote pair for SR-MPLS"; 1174 leaf local-ipv6-address { 1175 type inet:ipv6-address; 1176 description "Segment local IPv6 adjacency address"; 1177 } 1178 leaf remote-ipv6-address { 1179 type inet:ipv6-address; 1180 description "Segment remote IPv6 adjacency address"; 1181 } 1182 } 1183 container segment-type-9 { 1184 description 1185 "Segment declared by IPv6 Global Prefix with optional 1186 SR Algorithm for SRv6"; 1187 leaf ipv6-address { 1188 type inet:ipv6-address; 1189 description "Segment IPv6 prefix"; 1190 } 1191 leaf algorithm { 1192 type uint8; 1193 description "Prefix SID algorithm identifier"; 1194 } 1195 } 1196 container segment-type-10 { 1197 description 1198 "Segment declared by IPv6 Prefix and Interface ID for 1199 link endpoints as Local, Remote pair for SRv6"; 1200 leaf local-ipv6-address { 1201 type inet:ipv6-address; 1202 description "Local link IPv6 address"; 1203 } 1204 leaf local-interface-identifier { 1205 type uint32; 1206 description "Local interface identifier"; 1207 } 1208 leaf remote-ipv6-address { 1209 type inet:ipv6-address; 1210 description "Remote link IPv6 address"; 1211 } 1212 leaf remote-interface-identifier { 1213 type uint32; 1214 description "Remote interface identifier"; 1215 } 1216 } 1217 container segment-type-11 { 1218 description 1219 "Segment declared by IPv6 Addresses for link endpoints as 1220 Local, Remote pair for SRv6"; 1221 leaf local-ipv6-address { 1222 type inet:ipv6-address; 1223 description "Segment local IPv6 adjacency address"; 1224 } 1225 leaf remote-ipv6-address { 1226 type inet:ipv6-address; 1227 description "Segment remote IPv6 adjacency address"; 1228 } 1229 } 1230 } 1231 leaf validate { 1232 type boolean; 1233 default 'false'; 1234 description "Indicates whether the segment should be validated. The default 1235 applies to all segments other than the first segment. For the 1236 first segment, validation is always done."; 1237 } 1238 } 1240 grouping segment-properties { 1241 description 1242 "SR segment properties grouping"; 1243 uses segment_config; 1244 } 1246 grouping attributes { 1247 description 1248 "Grouping containing attributes applicable to all SR policies"; 1250 container attributes { 1251 description 1252 "Attributes applicable to SR policies"; 1254 uses affinity-mapping; 1255 uses segment-lists; 1256 uses explicit-binding-sid-rules; 1257 } 1258 } 1260 grouping segment-lists { 1261 description 1262 "Segment lists grouping"; 1263 container segment-lists { 1264 description "Segment-lists properties"; 1266 list segment-list { 1267 key "name"; 1268 description "Segment-list properties"; 1269 leaf name { 1270 type string; 1271 description "Segment-list name"; 1272 } 1273 container segments { 1274 description 1275 "Segments for given segment list"; 1277 list segment { 1278 key "index"; 1279 description "Configure Segment/hop at the index"; 1280 uses segment-properties; 1281 } 1282 } 1283 } 1284 } 1285 } 1287 grouping binding-sid_config { 1288 description 1289 "Binding SID configuration properties grouping"; 1290 leaf dataplane { 1291 type sr-policy-types:dataplane-type; 1292 description "Binding SID dataplane type"; 1293 } 1294 leaf value { 1295 type sr-policy-types:sid-value-type; 1296 description "Binding SID value"; 1297 } 1298 } 1299 grouping forwarding-counters { 1300 description 1301 "Grouping for counters"; 1302 container counters { 1303 config false; 1304 description 1305 "Counters containing stats related to forwarding"; 1307 leaf pkts { 1308 type yang:counter64; 1309 description "Number of packets forwarded"; 1310 } 1311 leaf octets { 1312 type yang:counter64; 1313 units "byte"; 1314 description "Number of bytes forwarded"; 1315 } 1316 } 1317 } 1319 grouping binding-sid_state { 1320 description 1321 "Binding SID state properties grouping"; 1322 leaf alloc-mode { 1323 type sr-policy-types:binding-sid-alloc-mode; 1324 config false; 1325 description "Binding SID type"; 1326 } 1327 leaf allocated-sid { 1328 type sr-policy-types:sid-value-type; 1329 config false; 1330 description "Allocated SID value for the Binding SID"; 1331 } 1332 leaf oper-state { 1333 type sr-policy-types:binding-sid-oper-state; 1334 config false; 1335 description 1336 "Binding SID operational state"; 1337 } 1338 } 1340 grouping binding-sid-properties { 1341 description 1342 "Binding SID properties grouping"; 1343 container binding-sid { 1344 description "Binding Segment ID"; 1345 uses binding-sid_config; 1346 uses binding-sid_state; 1348 } 1349 } 1351 grouping mpls-label-stack { 1352 description 1353 "Grouping for MPLS label stack"; 1355 list labels { 1356 key "label"; 1357 description 1358 "Stack containing MPLS labels"; 1360 leaf label { 1361 type rt-types:mpls-label; 1362 description 1363 "MPLS label value"; 1364 } 1365 } 1366 } 1368 grouping srv6-sid-stack { 1369 description 1370 "Grouping for SRv6 label stack"; 1372 list sids { 1373 key "sid"; 1374 description 1375 "Stack containing SRv6 SIDs"; 1377 leaf sid { 1378 type srv6-types:srv6-sid; 1379 description 1380 "SRv6 sid value"; 1381 } 1382 } 1383 } 1385 grouping path-forwarding_state { 1386 description "Policy Forwarding path information"; 1387 leaf path-id { 1388 type uint8; 1389 description "Primary path id"; 1390 } 1391 leaf next-hop-address { 1392 type inet:ip-address; 1393 description "Nexthop address"; 1394 } 1395 leaf next-hop-table-id { 1396 type uint32; 1397 description "Table ID for nexthop address"; 1398 } 1399 leaf interface { 1400 type if:interface-ref; 1401 description "Outgoing interface handle"; 1402 } 1403 container sid-list { 1404 description 1405 "Outgoing sid stack"; 1406 choice dataplanetype { 1407 description 1408 "Outgoing sids dataplane choice"; 1409 case mpls { 1410 uses mpls-label-stack; 1411 } 1412 case srv6 { 1413 uses srv6-sid-stack; 1414 } 1415 } 1416 } 1417 leaf is-protected { 1418 type boolean; 1419 description "Is this path protected ?"; 1420 } 1421 leaf is-pure-backup { 1422 type boolean; 1423 description "Is this path a pure backup ?"; 1424 } 1425 leaf backup-path-id { 1426 type uint8; 1427 description "Backup path id"; 1428 } 1429 leaf weight { 1430 type uint32; 1431 description "Path's weight for W-ECMP balancing"; 1432 } 1433 } 1435 grouping cpath-cmn-properties { 1436 description 1437 "Common properties of the candidate path"; 1439 leaf is-valid { 1440 type boolean; 1441 config false; 1442 description 1443 "True if the segment-list is valid, False otherwise"; 1445 } 1447 container forwarding-paths { 1448 config false; 1449 description 1450 "Forwarding state of paths"; 1451 list forwarding-path { 1452 key "path-id"; 1453 description "Forwarding path"; 1454 uses path-forwarding_state; 1455 } 1456 } 1457 } 1459 grouping explicit-path-properties { 1460 description 1461 "Explicit path properties of the candidate path"; 1462 container segment-lists { 1463 description 1464 "Path segment list(s) properties"; 1465 list segment-list { 1466 key "name-ref"; 1467 description "SR policy candidate path segment lists"; 1469 leaf name-ref { 1470 type leafref { 1471 path "/rt:routing/sr-policy:segment-routing/sr-policy:traffic-engineering/sr-policy:attributes/sr-policy:segment-lists/sr-policy:segment-list/sr-policy:name"; 1472 } 1473 description "Reference to segment-list name"; 1474 } 1475 leaf weight { 1476 type uint32; 1477 description "Segment-list weighted loadshare"; 1478 } 1479 } 1480 } 1481 } 1483 grouping affinity-mapping { 1484 description "Affinity-map grouping"; 1486 container affinity-map { 1487 description 1488 "Mapping of affinity names to bit position"; 1489 list affinity { 1490 key "name"; 1491 unique "bit-position"; 1492 leaf name { 1493 type string; 1494 description 1495 "Name of the affinity"; 1496 } 1497 leaf bit-position { 1498 type uint16; 1499 description 1500 "The affinity entry in this list is mapped to the this bit-position in the 1501 affinity bitmap"; 1502 } 1504 description "Affinity"; 1505 } 1506 } 1507 } 1508 grouping dynamic-path-properties { 1509 description 1510 "Dynamic path properties of the candidate path"; 1511 leaf sid-dataplane-type { 1512 type sr-policy-types:dataplane-type; 1513 description 1514 "The dataplane type for the sid"; 1515 } 1517 container constraints { 1518 description "Constraints for the dynamic path computation"; 1519 container affinities { 1520 description "Affinity constraints on the computed dynamic path"; 1521 leaf-list exclude-any { 1522 type string; 1523 description 1524 "The link is excluded if it has any of these affinities."; 1525 } 1526 leaf-list include-any { 1527 type string; 1528 description 1529 "The link is accepted if it has any of these affinities"; 1530 } 1531 leaf-list include-all { 1532 type string; 1533 description 1534 "The link is accepted if it has all these affinities"; 1535 } 1536 } 1538 container bounds { 1539 description "Upper-bound constraints on the computed dynamic path"; 1540 leaf igp-metric-bound { 1541 type uint32; 1542 description 1543 "Path is invalid if its IGP metric exceeds this value"; 1544 } 1545 leaf te-metric-bound { 1546 type uint32; 1547 description 1548 "Path is invalid if its TE metric exceeds this value"; 1549 } 1550 leaf latency-metric-bound { 1551 type uint32; 1552 units "microsecond"; 1553 description 1554 "Path is invalid if its latency exceeds this value"; 1555 } 1556 leaf segment-bound { 1557 type uint32; 1558 description 1559 "Path is invalid if it has more segments than this value"; 1560 } 1561 } 1562 container segment-rules { 1563 description "Constraints on the segments to be used in the path"; 1564 leaf sid-algorithm { 1565 type uint8 { 1566 range "128..255"; 1567 } 1568 description 1569 "The prefix-sid algorithm to be used in path calculation"; 1570 } 1571 } 1572 container disjoint-path { 1573 description "Path disjointness constraints"; 1574 leaf group-id { 1575 type uint32 { range "1..65535"; } 1576 description ""; 1577 } 1578 leaf disjointness-type { 1579 type identityref { base sr-policy-types:path-disjointness; } 1580 description 1581 "Type of disjointness computation used to find the path"; 1582 } 1583 leaf subgroup-id { 1584 type uint32 { range "1..65535"; } 1585 description ""; 1586 } 1587 } 1588 } 1590 } 1592 grouping candidate-path_state { 1593 description 1594 "Candidate path state properties grouping"; 1595 leaf is-best-candidate-path { 1596 type boolean; 1597 default 'false'; 1598 config false; 1599 description 1600 "True if the candidate path is the best candidate path, False otherwise"; 1601 } 1602 leaf non-selection-reason { 1603 type identityref { 1604 base sr-policy-types:candidate-path-not-selected-reason; 1605 } 1606 config false; 1607 description 1608 "Candidate path not selected reason"; 1609 } 1610 } 1612 grouping policy-properties_config { 1613 description 1614 "SR policy configuration grouping"; 1615 leaf name { 1616 type string { 1617 length "1..59"; 1618 } 1619 description "SR policy name"; 1620 } 1621 leaf color { 1622 type uint32 { 1623 range "1..4294967295"; 1624 } 1625 description "Color associated with the policy"; 1626 } 1627 leaf endpoint { 1628 type inet:ip-address; 1629 description "Policy end point IP address"; 1630 } 1631 leaf description { 1632 type string; 1633 description "Description of the policy"; 1634 } 1635 leaf admin-state { 1636 type sr-policy-types:policy-admin-state; 1637 default 'UP'; 1638 description 1639 "SR policy administrative state, true for 1640 enabled, false for disabled"; 1641 } 1642 } 1644 grouping policy-properties_state { 1645 description 1646 "SR policy property grouping"; 1647 leaf oper-state { 1648 type sr-policy-types:policy-oper-state; 1649 config false; 1650 description 1651 "SR policy operational state"; 1652 } 1653 leaf transition-count { 1654 type uint32; 1655 config false; 1656 description "Indicates number of up/down transitions"; 1657 } 1658 leaf up-time { 1659 type yang:date-and-time; 1660 config false; 1661 description "Policy up time in seconds"; 1662 } 1663 leaf down-time { 1664 type yang:date-and-time; 1665 config false; 1666 description "Policy down time in seconds"; 1667 } 1668 } 1670 grouping policy-properties { 1671 description 1672 "SR policy properties"; 1673 uses policy-properties_state; 1674 uses binding-sid-properties; 1675 uses forwarding-counters; 1676 } 1678 grouping candidate-path-type { 1679 description "Candidate path type grouping"; 1680 choice type { 1681 description 1682 "Type of candidate paths"; 1683 case explicit { 1684 description "Candidate path with explicitly defined set/s of segment-lists"; 1685 uses explicit-path-properties; 1687 } 1688 case dynamic { 1689 description "Candidate path with dynamic computed segment-lists"; 1690 uses dynamic-path-properties; 1691 } 1692 } 1693 } 1695 grouping candidate-paths { 1696 description "SR policy candidate path grouping"; 1697 container candidate-paths { 1698 description "SR policy candidate path(s) "; 1700 list candidate-path { 1701 key "protocol-origin originator discriminator"; 1702 unique "preference"; 1704 description "SR policy Candidate path(s) list entry"; 1706 leaf protocol-origin { 1707 type sr-policy-types:protocol-origin-type; 1708 description 1709 "Instantiation mechanism used to create the candidate path"; 1710 } 1711 leaf originator { 1712 type string; 1713 description 1714 "Identifier (concatenation of ASN and node-address) of the node 1715 that signalled/instantiated the candidate path on headend"; 1716 } 1717 leaf discriminator { 1718 type uint32; 1719 description "Candidate path distinguisher"; 1720 } 1722 leaf preference { 1723 type uint32 { 1724 range "1..65535"; 1725 } 1726 mandatory true; 1727 description "Candidate path preference"; 1728 } 1729 leaf name { 1730 type string; 1731 description "Candidate path name"; 1732 } 1733 leaf description { 1734 type string; 1735 description "Candidate path description"; 1736 } 1737 container binding-sid { 1738 if-feature capability-candidate-path-binding-sid; 1739 description 1740 "Binding segment ID"; 1741 uses binding-sid_config; 1742 } 1744 uses candidate-path-type; 1745 uses candidate-path_state; 1746 uses cpath-cmn-properties; 1747 } 1748 } 1749 } 1751 grouping policies { 1752 description "SR policy grouping"; 1753 container policies { 1754 description "SR Policy container"; 1756 list policy { 1757 key "color endpoint"; 1758 unique "name"; 1760 description "SR Policy properties"; 1761 leaf color { 1762 type uint32 { 1763 range "1..4294967295"; 1764 } 1765 description "Color associated with the policy"; 1766 } 1767 leaf endpoint { 1768 type inet:ip-address; 1769 description "Policy end point IP address"; 1770 } 1771 leaf name { 1772 type string { 1773 length "1..59"; 1774 } 1775 description "SR policy name"; 1776 } 1777 leaf description { 1778 type string; 1779 description "Description of the policy"; 1780 } 1781 leaf admin-state { 1782 type sr-policy-types:policy-admin-state; 1783 default 'UP'; 1784 description 1785 "SR policy administrative state, true for 1786 enabled, false for disabled"; 1787 } 1788 leaf priority { 1789 type uint8; 1790 default 128; 1791 description "Priority considered when policy is recomputed due to topology changes"; 1792 } 1794 uses policy-properties; 1796 uses candidate-paths; 1797 } 1798 } 1799 } 1801 grouping explicit-binding-sid-rules { 1802 description 1803 "Grouping for explicit binding sid rules"; 1805 list explicit-binding-sid-rules { 1806 key "index"; 1807 description 1808 "Explicit binding sid rules applicable for all policies"; 1809 leaf index { 1810 type uint32; 1811 description "Explicit binding SID rules list index"; 1812 } 1813 leaf rule { 1814 type sr-policy-types:explicit-binding-sid-rule-type; 1815 description "Explicit binding sid rule"; 1816 } 1817 } 1818 } 1820 augment "/rt:routing" { 1821 description 1822 "This augments routing-instance configuration with segment-routing sr-policy."; 1823 container segment-routing { 1824 description "Main segment routing container"; 1825 container traffic-engineering { 1826 description "Traffic-engineering container"; 1828 uses attributes; 1830 uses policies; 1832 } 1833 } 1834 } 1836 /* Notifications */ 1838 notification sr-policy-oper-state-change-event { 1839 description 1840 "Notification event when the operational state of the SR policy changes"; 1842 leaf policy-name-ref { 1843 type leafref { 1844 path "/rt:routing/sr-policy:segment-routing/sr-policy:traffic-engineering/sr-policy:policies/sr-policy:policy/sr-policy:name"; 1845 } 1846 description "Reference to sr-policy name"; 1847 } 1849 leaf policy-color-ref { 1850 type leafref { 1851 path "/rt:routing/sr-policy:segment-routing/sr-policy:traffic-engineering/sr-policy:policies/sr-policy:policy/sr-policy:color"; 1852 } 1853 description "Reference to sr-policy color"; 1854 } 1856 leaf policy-endpoint-ref { 1857 type leafref { 1858 path "/rt:routing/sr-policy:segment-routing/sr-policy:traffic-engineering/sr-policy:policies/sr-policy:policy/sr-policy:endpoint"; 1859 } 1860 description "Reference to sr-policy endpoint"; 1861 } 1863 leaf policy-new-oper-state { 1864 type sr-policy-types:policy-oper-state; 1865 description "New operational state of the SR policy"; 1866 } 1868 leaf policy-down-reason { 1869 type identityref { 1870 base sr-policy-types:policy-down-reason; 1871 } 1872 description "Down reason if the SR policy's new operational state is down"; 1873 } 1874 } 1876 notification sr-policy-candidate-path-change-event { 1877 description 1878 "Notification event when candidate path changes for SR policy"; 1880 leaf policy-name-ref { 1881 type leafref { 1882 path "/rt:routing/sr-policy:segment-routing/sr-policy:traffic-engineering/sr-policy:policies/sr-policy:policy/sr-policy:name"; 1883 } 1884 description "Reference to sr-policy name"; 1885 } 1887 leaf policy-color-ref { 1888 type leafref { 1889 path "/rt:routing/sr-policy:segment-routing/sr-policy:traffic-engineering/sr-policy:policies/sr-policy:policy/sr-policy:color"; 1890 } 1891 description "Reference to sr-policy color"; 1892 } 1894 leaf policy-endpoint-ref { 1895 type leafref { 1896 path "/rt:routing/sr-policy:segment-routing/sr-policy:traffic-engineering/sr-policy:policies/sr-policy:policy/sr-policy:endpoint"; 1897 } 1898 description "Reference to sr-policy endpoint"; 1899 } 1901 leaf existing-preference { 1902 type uint32; 1903 description "Existing candidate path preference"; 1904 } 1906 leaf new-preference { 1907 type uint32; 1908 description "New candidate path preference"; 1909 } 1910 } 1912 notification sr-policy-binding-sid-unavailable-event { 1913 description 1914 "Notification event when the binding sid of sr-policy is unavailable"; 1916 leaf policy-name-ref { 1917 type leafref { 1918 path "/rt:routing/sr-policy:segment-routing/sr-policy:traffic-engineering/sr-policy:policies/sr-policy:policy/sr-policy:name"; 1919 } 1920 description "Reference to sr-policy name"; 1921 } 1923 leaf policy-color-ref { 1924 type leafref { 1925 path "/rt:routing/sr-policy:segment-routing/sr-policy:traffic-engineering/sr-policy:policies/sr-policy:policy/sr-policy:color"; 1926 } 1927 description "Reference to sr-policy color"; 1929 } 1931 leaf policy-endpoint-ref { 1932 type leafref { 1933 path "/rt:routing/sr-policy:segment-routing/sr-policy:traffic-engineering/sr-policy:policies/sr-policy:policy/sr-policy:endpoint"; 1934 } 1935 description "Reference to sr-policy endpoint"; 1936 } 1938 leaf policy-binding-sid-value-ref { 1939 if-feature capability-candidate-path-binding-sid; 1940 type leafref { 1941 path "/rt:routing/sr-policy:segment-routing/sr-policy:traffic-engineering/sr-policy:policies/sr-policy:policy/sr-policy:binding-sid/sr-policy:value"; 1942 } 1943 description "Reference to sr-policy binding-sid value"; 1944 } 1946 leaf reason { 1947 type identityref { 1948 base sr-policy-types:binding-sid-unavailable-reason; 1949 } 1950 description 1951 "Reason why the binding sid is unavailable"; 1952 } 1953 } 1955 notification sr-policy-candidate-path-binding-sid-mismatch-event { 1956 description 1957 "Notification event when binding sid of requested candidate path 1958 is different from the binding sid of the existing candidate path"; 1960 leaf policy-color-ref { 1961 type leafref { 1962 path "/rt:routing/sr-policy:segment-routing/sr-policy:traffic-engineering/sr-policy:policies/sr-policy:policy/sr-policy:color"; 1963 } 1964 description "Reference to sr-policy color"; 1965 } 1967 leaf policy-endpoint-ref { 1968 type leafref { 1969 path "/rt:routing/sr-policy:segment-routing/sr-policy:traffic-engineering/sr-policy:policies/sr-policy:policy/sr-policy:endpoint"; 1970 } 1971 description "Reference to sr-policy endpoint"; 1972 } 1974 leaf existing-candidate-path-protocol-origin-ref { 1975 type leafref { 1976 path "/rt:routing/sr-policy:segment-routing/sr-policy:traffic-engineering/sr-policy:policies/sr-policy:policy/sr-policy:candidate-paths/sr-policy:candidate-path/sr-policy:protocol-origin"; 1978 } 1979 description "Reference to existing candidate path protocol origin"; 1980 } 1982 leaf existing-candidate-path-preference-ref { 1983 type leafref { 1984 path "/rt:routing/sr-policy:segment-routing/sr-policy:traffic-engineering/sr-policy:policies/sr-policy:policy/sr-policy:candidate-paths/sr-policy:candidate-path/sr-policy:preference"; 1985 } 1986 description "Reference to existing candidate path preference"; 1987 } 1989 leaf existing-candidate-path-binding-sid-dataplane-ref { 1990 if-feature capability-candidate-path-binding-sid; 1991 type leafref { 1992 path "/rt:routing/sr-policy:segment-routing/sr-policy:traffic-engineering/sr-policy:policies/sr-policy:policy/sr-policy:candidate-paths/sr-policy:candidate-path/sr-policy:binding-sid/sr-policy:dataplane"; 1993 } 1994 description "Reference to existing candidate path binding sid dataplane type"; 1995 } 1997 leaf existing-candidate-path-binding-sid-value-ref { 1998 if-feature capability-candidate-path-binding-sid; 1999 type leafref { 2000 path "/rt:routing/sr-policy:segment-routing/sr-policy:traffic-engineering/sr-policy:policies/sr-policy:policy/sr-policy:candidate-paths/sr-policy:candidate-path/sr-policy:binding-sid/sr-policy:value"; 2001 } 2002 description "Reference to existing candidate path binding sid value"; 2003 } 2005 leaf conflicting-candidate-path-protocol-origin { 2006 type uint8; 2007 description "Conflicting candidate path protocol origin"; 2008 } 2010 leaf conflicting-candidate-path-preference { 2011 type uint32; 2012 description "Conflicting candidate path preference"; 2013 } 2015 leaf conflicting-candidate-path-binding-sid-dataplane { 2016 type sr-policy-types:dataplane-type; 2017 description "Conflicting candidate path binding sid dataplane type"; 2018 } 2020 leaf conflicting-candidate-path-binding-sid-value { 2021 type sr-policy-types:sid-value-type; 2022 description "Conflicting candidate path binding sid value"; 2023 } 2024 } 2025 /* Features */ 2027 feature capability-candidate-path-binding-sid { 2028 description 2029 "This feature enables the capability of specifying binding-sid 2030 for a candidate path."; 2031 } 2032 } // module 2034 2036 Figure 6: ietf-sr-policy.yang 2038 7. Security Considerations 2040 The configuration, state, and notification data defined using YANG 2041 data models in this document are likely to be accessed via the 2042 protocols such as NETCONF [RFC6241] etc. 2044 Hence, YANG implementations MUST comply with the security 2045 requirements specified in section 15 of [RFC6020]. Additionally, 2046 NETCONF implementations MUST comply with the security requirements 2047 specified in sections 2.2, 2.3 and 9 of [RFC6241] as well as section 2048 3.7 of [RFC8341]. 2050 8. IANA Considerations 2052 This document requests the registration of the following URIs in the 2053 IETF "XML registry" [RFC3688]: 2055 +------------------------------------------------+------------+-----+ 2056 | URI | Registrant | XML | 2057 +------------------------------------------------+------------+-----+ 2058 | urn:ietf:params:xml:ns:yang:ietf-sr-policy- | The IESG | N/A | 2059 | types | | | 2060 | | | | 2061 | urn:ietf:params:xml:ns:yang:ietf-sr-policy | The IESG | N/A | 2062 +------------------------------------------------+------------+-----+ 2064 This document requests the registration of the following YANG modules 2065 in the "YANG Module Names" registry [RFC6020]: 2067 +--------------+------------------------------+------------+--------+ 2068 | Name | Namespace | Prefix | Refere | 2069 | | | | nce | 2070 +--------------+------------------------------+------------+--------+ 2071 | ietf-sr- | urn:ietf:params:xml:ns:yang: | sr-policy- | This d | 2072 | policy-types | ietf-sr-policy-types | types | ocumen | 2073 | | | | t | 2074 | | | | | 2075 | ietf-sr- | urn:ietf:params:xml:ns:yang: | sr-policy | This d | 2076 | policy | ietf-sr-policy | | ocumen | 2077 | | | | t | 2078 +--------------+------------------------------+------------+--------+ 2080 9. Acknowledgments 2082 The authors of this document/YANG model would like to acknowledge the 2083 contributions/reviews by Johnson Thomas, Clarence Filsfils, Siva 2084 Sivabalan, Tarek Saad, Kris Michielsen, Dhanendra Jain, Ketan 2085 Talaulikar, Bhupendra Yadav, and Bruno Decraene. 2087 10. References 2089 10.1. Normative References 2091 [I-D.ietf-spring-segment-routing-policy] 2092 Filsfils, C., Talaulikar, K., Voyer, D., Bogdanov, A., and 2093 P. Mattes, "Segment Routing Policy Architecture", draft- 2094 ietf-spring-segment-routing-policy-09 (work in progress), 2095 November 2020. 2097 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2098 Requirement Levels", BCP 14, RFC 2119, 2099 DOI 10.17487/RFC2119, March 1997, 2100 . 2102 [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, 2103 DOI 10.17487/RFC3688, January 2004, 2104 . 2106 [RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for 2107 the Network Configuration Protocol (NETCONF)", RFC 6020, 2108 DOI 10.17487/RFC6020, October 2010, 2109 . 2111 [RFC6241] Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed., 2112 and A. Bierman, Ed., "Network Configuration Protocol 2113 (NETCONF)", RFC 6241, DOI 10.17487/RFC6241, June 2011, 2114 . 2116 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2117 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 2118 May 2017, . 2120 [RFC8341] Bierman, A. and M. Bjorklund, "Network Configuration 2121 Access Control Model", STD 91, RFC 8341, 2122 DOI 10.17487/RFC8341, March 2018, 2123 . 2125 [RFC8342] Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K., 2126 and R. Wilton, "Network Management Datastore Architecture 2127 (NMDA)", RFC 8342, DOI 10.17487/RFC8342, March 2018, 2128 . 2130 [RFC8402] Filsfils, C., Ed., Previdi, S., Ed., Ginsberg, L., 2131 Decraene, B., Litkowski, S., and R. Shakir, "Segment 2132 Routing Architecture", RFC 8402, DOI 10.17487/RFC8402, 2133 July 2018, . 2135 [RFC8407] Bierman, A., "Guidelines for Authors and Reviewers of 2136 Documents Containing YANG Data Models", BCP 216, RFC 8407, 2137 DOI 10.17487/RFC8407, October 2018, 2138 . 2140 10.2. Informative References 2142 [I-D.ietf-idr-segment-routing-te-policy] 2143 Previdi, S., Filsfils, C., Talaulikar, K., Mattes, P., 2144 Rosen, E., Jain, D., and S. Lin, "Advertising Segment 2145 Routing Policies in BGP", draft-ietf-idr-segment-routing- 2146 te-policy-11 (work in progress), November 2020. 2148 Authors' Addresses 2150 Kamran Raza (editor) 2151 Cisco Systems 2152 Email: skraza@cisco.com 2154 Robert Sawaya 2155 Cisco Systems 2156 Email: rsawaya@cisco.com 2157 Zhuang Shunwan 2158 Huawei Technologies 2159 Email: zhuangshunwa@huawei.com 2161 Daniel Voyer 2162 Bell Canada 2163 Email: daniel.voyer@bell.ca 2165 Muhammad Durrani 2166 Equinix 2167 Email: mdurrani@equinix.com 2169 Satoru Matsushima 2170 SoftBank 2171 Email: satoru.matsushima@g.softbank.co.jp 2173 Vishnu Pavan Beeram 2174 Juniper Networks 2175 Email: vbeeram@juniper.net