idnits 2.17.1 draft-raza-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 60 lines Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** There are 101 instances of too long lines in the document, the longest one being 128 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 361 has weird spacing: '...w index uin...' == Line 504 has weird spacing: '...o label rt-...' == Line 507 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 (July 8, 2019) is 1754 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-03 == Outdated reference: A later version (-26) exists of draft-ietf-idr-segment-routing-te-policy-07 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: January 9, 2020 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 July 8, 2019 22 YANG Data Model for Segment Routing Policy 23 draft-raza-spring-sr-policy-yang-01.txt 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 January 9, 2020. 49 Copyright Notice 51 Copyright (c) 2019 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 . . . . . . . . . . . . . . . . . . 4 71 4.2. SR Policy . . . . . . . . . . . . . . . . . . . . . . . . 5 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 . . . . . . . . . . . . . . . . . . . 43 80 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 44 81 9. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 44 82 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 44 83 10.1. Normative References . . . . . . . . . . . . . . . . . . 44 84 10.2. Informative References . . . . . . . . . . . . . . . . . 45 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. 158 o segment-list: specifies ordered list of segments to traverse, 159 where a segment can be specified in various forms (refer section 4 160 of [I-D.ietf-spring-segment-routing-policy]). The list is sorted 161 by the index of the segment. A segment-list is used and referred 162 by an explicit type of candidate-path. 164 o binding-sid: An SR policy is associated with a BSID to provide 165 benefits of scaling, network opacity and service independence. 167 4. YANG Model 169 The modeling in this document complies with the Network Management 170 Datastore Architecture (NMDA) [RFC8342]. The operational state data 171 is combined with the associated configuration data in the same 172 hierarchy [RFC8407]. When protocol states are retrieved from the 173 NMDA operational state datastore, the returned states cover all 174 "config true" (rw) and "config false" (ro) nodes defined in the 175 schema. 177 For SR policy YANG specification, this document defines following new 178 YANG modules: 180 +----------------------+--------------------------------------------+ 181 | Module Name | Purpose | 182 +----------------------+--------------------------------------------+ 183 | ietf-sr-policy-types | defines common and basic types related to | 184 | | an SR policy and related constructs | 185 | | | 186 | ietf-sr-policy | defines the model for SR policy | 187 | | instantiation, configuration, and | 188 | | management | 189 +----------------------+--------------------------------------------+ 191 4.1. Types and Definitions 193 SR policy common types and definitions are defined in the new module 194 "ietf-sr-policy-types". The main types defined in this module 195 include: 197 o dataplane-type: A union to specify MPLS or IPv6 as the dataplane 198 type for SR. 200 o sid-value-type: A Union to specify SID value for SR-MPLS or SRv6 201 type. 203 o binding-sid-alloc-mode: Enum to define explicit or dynamic alloc 204 mode types for a BSID. 206 o protocol-origin-type: Enum to specify protocol origin (e.g. PCEP) 207 for an SR policy. 209 o explicit-binding-sid-rule-type: Enum to specify BSID alloc 210 enforcement/rule when doing explicit alloc request. 212 o binding-sid-oper-state: An Enum representing various operational 213 states for a BSID. 215 o policy-admin-state: An Enum for admin state of an SR policy. 217 o policy-oper-state: An Enum for operational state of an SR policy. 219 o segment-type: An Enum that defines various types for a "segment" 220 of a Segment list. 222 o candidate-path-non-selection-reason: The base identity along with 223 its children to specify reason for not selecting a candidate path 224 as the best/active path. 226 o path-disjointness: The base identity for disjoint path 227 computation. The disjointness types include link, node, srlg, 228 srlg-node etc. 230 o policy-down-reason: The base identity along with its children to 231 specify reason for a policy becoming (or remaining) operationally 232 down. 234 o binding-sid-unavailable-reason: The base identity along with its 235 children to specify reason for a BSID's unavailability. 237 The associated YANG specification for this module is captured in 238 Section 6.1. 240 4.2. SR Policy 242 The base SR policy model is captured in ietf-sr-policy module. This 243 base module augments "/rt:routing" and specifies the configuration, 244 operational state, executables/rpcs, and notification events required 245 to manage SR policies. 247 The associated YANG specification for this module is captured in 248 Section 6.2. 250 4.2.1. Configuration 252 In terms of configuration hierarchy, SR policy configuration tree has 253 following two main areas: 255 o policy-attributes: container that defines common constructs that 256 could be used across policies. Examples of such a construct 257 include segment-lists, affinity-map etc. In future revision of 258 this document, it is expected that this container will have more 259 constructs defined. 261 o policies: container that defines list of policies with their 262 attributes such as BSID, candidate-paths etc. 264 Following diagram depicts high level yang organization and hierarchy 265 for an SR policy specification: 267 segment-routing 268 sr-policy 269 + policy-attributes 270 | + affinity-map 271 | | .... 272 | | 273 | + segment-lists 274 | | segment-list* [name] 275 | | segments 276 | | segment* [index] 277 | | ... 278 | + explicit-binding-sid-rules 279 | ... 280 | 281 + policies 282 policy* [color endpoint] 283 + ... 284 | 285 + binding-sid 286 | ... 287 | 288 + candidate-paths 289 candidate-path* [protocol origin discrim] 290 + ... 291 | 292 + type 293 + explicit 294 | segment-lists 295 | segment-list* [ref] 296 | ... 297 + dynamic 298 constraints 299 ... 301 Figure 1: SR Policy - Hierarchy 303 Using the building blocks described in Section 3, following is the 304 complete graphical representation of the data model for SR policy 305 configuration: 307 module: ietf-sr-policy 308 augment /rt:routing: 309 +--rw segment-routing 310 +--rw sr-policy 311 +--rw policy-attributes 312 | +--rw affinity-map 313 | | +--rw affinity* [name] 314 | | +--rw name string 315 | | +--rw bit-position? uint16 316 | +--rw segment-lists 317 | | +--rw segment-list* [name] 318 | | +--rw name string 319 | | +--rw segments 320 | | +--rw segment* [index] 321 | | +--rw index uint32 322 | | +--rw type? sr-policy-types:segment-type 323 | | +--rw segment-types 324 | | | +--rw segment-type-1 325 | | | | +--rw sid-value? rt-types:mpls-label 326 | | | +--rw segment-type-2 327 | | | | +--rw sid-value? srv6-types:srv6-sid 328 | | | +--rw segment-type-3 329 | | | | +--rw ipv4-address? inet:ipv4-address 330 | | | | +--rw algorithm? uint8 331 | | | +--rw segment-type-4 332 | | | | +--rw ipv6-address? inet:ipv6-address 333 | | | | +--rw algorithm? uint8 334 | | | +--rw segment-type-5 335 | | | | +--rw ipv4-address? inet:ipv4-address 336 | | | | +--rw interface-identifier? uint32 337 | | | +--rw segment-type-6 338 | | | | +--rw local-ipv4-address? inet:ipv4-address 339 | | | | +--rw remote-ipv4-address? inet:ipv4-address 340 | | | +--rw segment-type-7 341 | | | | +--rw local-ipv6-address? inet:ipv6-address 342 | | | | +--rw local-interface-identifier? uint32 343 | | | | +--rw remote-ipv6-address? inet:ipv6-address 344 | | | | +--rw remote-interface-identifier? uint32 345 | | | +--rw segment-type-8 346 | | | | +--rw local-ipv6-address? inet:ipv6-address 347 | | | | +--rw remote-ipv6-address? inet:ipv6-address 348 | | | +--rw segment-type-9 349 | | | | +--rw ipv6-address? inet:ipv6-address 350 | | | | +--rw algorithm? uint8 351 | | | +--rw segment-type-10 352 | | | | +--rw local-ipv6-address? inet:ipv6-address 353 | | | | +--rw local-interface-identifier? uint32 354 | | | | +--rw remote-ipv6-address? inet:ipv6-address 355 | | | | +--rw remote-interface-identifier? uint32 356 | | | +--rw segment-type-11 357 | | | +--rw local-ipv6-address? inet:ipv6-address 358 | | | +--rw remote-ipv6-address? inet:ipv6-address 359 | | +--rw validate? boolean 360 | +--rw explicit-binding-sid-rules* [index] 361 | +--rw index uint32 362 | +--rw rule? sr-policy-types:explicit-binding-sid-rule-type 363 +--rw policies 364 +--rw policy* [color endpoint] 365 +--rw color uint32 366 +--rw endpoint inet:ip-address 367 +--rw name? string 368 +--rw description? string 369 +--rw admin-state? sr-policy-types:policy-admin-state 370 +--rw priority? uint8 371 +--rw binding-sid 372 | +--rw dataplane? sr-policy-types:dataplane-type 373 | +--rw value? sr-policy-types:sid-value-type 374 +--rw candidate-paths 375 +--rw candidate-path* [protocol-origin originator discriminator] 376 +--rw protocol-origin sr-policy-types:protocol-origin-type 377 +--rw originator string 378 +--rw discriminator uint32 379 +--rw name? string 380 +--rw preference? uint32 381 +--rw description? string 382 +--rw binding-sid {capability-candidate-path-binding-sid}? 383 | +--rw dataplane? sr-policy-types:dataplane-type 384 | +--rw value? sr-policy-types:sid-value-type 385 +--rw (type)? 386 +--:(explicit) 387 | +--rw segment-lists 388 | +--rw segment-list* [name-ref] 389 | +--rw name-ref -> /rt:routing/sr-policy:segment-routing/sr-policy/policy-attributes/segment-lists/segment-list/name 390 | +--rw weight? uint32 391 +--:(dynamic) 392 +--rw sid-dataplane-type? sr-policy-types:dataplane-type 393 +--rw constraints 394 +--rw affinities 395 | +--rw exclude-any* string 396 | +--rw include-any* string 397 | +--rw include-all* string 398 +--rw bounds 399 | +--rw igp-metric-bound? uint32 400 | +--rw te-metric-bound? uint32 401 | +--rw latency-metric-bound? uint32 402 | +--rw segment-bound? uint32 403 +--rw segment-rules 404 | +--rw sid-algorithm? uint8 405 +--rw disjoint-path 406 +--rw group-id? uint32 407 +--rw disjointness-type? identityref 408 +--rw subgroup-id? uint32 410 Figure 2: SR Policy - Config Tree 412 Please take note of the following important points in the above 413 configuration model: 415 o This model supports both MPLS and SRv6 dataplane for SR -- i.e. 416 items like segments and BSID can be defined as MPLS label or SRv6 417 SIDs. 419 o Specification of a segment supports all the types defined in SR 420 policy base specification document 422 o The above model supports explicit BSID specification on SR policy 423 level as the main mode of specification. The model also allows 424 explicit BSID per candidate-path as an if-feature capability that 425 is optional for implementations 427 o The above model will be extended in future revisions of this 428 document to enhance constraints specification for dynamic type of 429 candidate-path, as well as add traffic-steering controls. 431 4.2.2. State 433 As per NMDA model, the state related to configuration items specified 434 in earlier Section 4.2.1 can be retrieved from the same tree. This 435 section defines the other operational state items related to SR 436 policy. 438 In addition to configured state, the operational state corresponding 439 to the SR policy includes: 441 o policy operational state 443 o policy up/down timestamps 445 o policy BSID info such as alloc mode, actual value in-use, 446 operational state, and forwarding stats 448 o Per candidate-path info such as: 450 * Whether candidate-path is the best candidate-path 452 * In case of non-best, the reason for such non-selection 454 * Type of candidate-path - explicit or dynamic 456 * Per segment-list information - such as validity of the segment- 457 list, as well as forwarding state for a valid segment-list. 459 The forwarding state is represented in terms of per forwarding 460 path info that includes nexthop address, outgoing interface, 461 protection information, and encapsulation (label stack or SRv6 462 SID stack) etc. 464 Following is a simplified graphical representation of the data model 465 for the SR policy (derived) operational state: 467 module: ietf-sr-policy 468 augment /rt:routing: 469 +--rw segment-routing 470 +--rw sr-policy 471 +--rw policies 472 +--rw policy* [color endpoint] 473 +--rw color uint32 474 +--rw endpoint inet:ip-address 475 +--ro oper-state? sr-policy-types:policy-oper-state 476 +--ro transition-count? uint32 477 +--ro up-time? yang:date-and-time 478 +--ro down-time? yang:date-and-time 479 +--rw binding-sid 480 | +--ro alloc-mode? sr-policy-types:binding-sid-alloc-mode 481 | +--ro allocated-sid? sr-policy-types:sid-value-type 482 | +--ro oper-state? sr-policy-types:binding-sid-oper-state 483 +--ro counters 484 | +--ro pkts? yang:counter64 485 | +--ro octets? yang:counter64 486 +--rw candidate-paths 487 +--rw candidate-path* [protocol-origin originator discriminator] 488 +--rw protocol-origin sr-policy-types:protocol-origin-type 489 +--rw originator string 490 +--rw discriminator uint32 491 +--ro is-best-candidate-path? boolean 492 +--ro non-selection-reason? identityref 493 +--ro is-valid? boolean 494 +--ro forwarding-paths 495 +--ro forwarding-path* [path-id] 496 +--ro path-id uint8 497 +--ro next-hop-address? inet:ip-address 498 +--ro next-hop-table-id? uint32 499 +--ro outgoing-interface? if:interface-ref 500 +--ro outgoing-sids 501 | +--ro (dataplanetype)? 502 | +--:(mpls) 503 | | +--ro labels* [label] 504 | | +--ro label rt-types:mpls-label 505 | +--:(srv6) 506 | +--ro sids* [sid] 507 | +--ro sid srv6-types:srv6-sid 508 +--ro is-protected? boolean 509 +--ro is-pure-backup? boolean 510 +--ro backup-path-id? uint8 511 +--ro weight? uint32 513 Figure 3: SR Policy - State Tree 515 4.2.3. Notification 517 This model defines a list of notifications to inform an operator of 518 important events detected regarding an SR policy. These events 519 include events related to: 521 o Policy status: policy operational state changes 523 o Candidate-path active status and changes 525 o Explicit Binding SID collision/unavailability events 527 Following is a simplified graphical representation of the data model 528 for SR policy notifications: 530 module: ietf-sr-policy 532 notifications: 533 +---n sr-policy-oper-state-change-event 534 | +--ro policy-name-ref? -> /rt:routing/sr-policy:segment-routing/sr-policy/policies/policy/name 535 | +--ro policy-color-ref? -> /rt:routing/sr-policy:segment-routing/sr-policy/policies/policy/color 536 | +--ro policy-endpoint-ref? -> /rt:routing/sr-policy:segment-routing/sr-policy/policies/policy/endpoint 537 | +--ro policy-new-oper-state? sr-policy-types:policy-oper-state 538 | +--ro policy-down-reason? identityref 539 +---n sr-policy-candidate-path-change-event 540 | +--ro policy-name-ref? -> /rt:routing/sr-policy:segment-routing/sr-policy/policies/policy/name 541 | +--ro policy-color-ref? -> /rt:routing/sr-policy:segment-routing/sr-policy/policies/policy/color 542 | +--ro policy-endpoint-ref? -> /rt:routing/sr-policy:segment-routing/sr-policy/policies/policy/endpoint 543 | +--ro existing-preference? uint32 544 | +--ro new-preference? uint32 545 +---n sr-policy-binding-sid-unavailable-event 546 | +--ro policy-name-ref? -> /rt:routing/sr-policy:segment-routing/sr-policy/policies/policy/name 547 | +--ro policy-color-ref? -> /rt:routing/sr-policy:segment-routing/sr-policy/policies/policy/color 548 | +--ro policy-endpoint-ref? -> /rt:routing/sr-policy:segment-routing/sr-policy/policies/policy/endpoint 549 | +--ro policy-binding-sid-value-ref? -> /rt:routing/sr-policy:segment-routing/sr-policy/policies/policy/binding-sid/value 550 | +--ro reason? identityref 551 +---n sr-policy-candidate-path-binding-sid-mismatch-event 552 +--ro policy-color-ref? -> /rt:routing/sr-policy:segment-routing/sr-policy/policies/policy/color 553 +--ro policy-endpoint-ref? -> /rt:routing/sr-policy:segment-routing/sr-policy/policies/policy/endpoint 554 +--ro existing-candidate-path-protocol-origin-ref? -> /rt:routing/sr-policy:segment-routing/sr-policy/policies/policy/candidate-paths/candidate-path/protocol-origin 555 +--ro existing-candidate-path-preference-ref? -> /rt:routing/sr-policy:segment-routing/sr-policy/policies/policy/candidate-paths/candidate-path/preference 556 +--ro existing-candidate-path-binding-sid-dataplane-ref? -> /rt:routing/sr-policy:segment-routing/sr-policy/policies/policy/candidate-paths/candidate-path/binding-sid/dataplane 557 +--ro existing-candidate-path-binding-sid-value-ref? -> /rt:routing/sr-policy:segment-routing/sr-policy/policies/policy/candidate-paths/candidate-path/binding-sid/value 558 +--ro conflicting-candidate-path-protocol-origin? uint8 559 +--ro conflicting-candidate-path-preference? uint32 560 +--ro conflicting-candidate-path-binding-sid-dataplane? sr-policy-types:dataplane-type 561 +--ro conflicting-candidate-path-binding-sid-value? sr-policy-types:sid-value-type 563 Figure 4: SR Policy - Notification Tree 565 5. Pending Items 567 Following are the items that will be addressed in future revisions of 568 this document: 570 o Configuration and Specification of: 572 * Traffic steering over SR policy 574 * ODN templates 576 * Spray policy 578 o Executables (RPC actions) 580 o Re-use and leverage common constructs from TE YANG specification. 582 6. YANG Specification 584 Following are actual YANG definition for the modules defined earlier 585 in the document. 587 6.1. Types 589 file "ietf-sr-policy-types@2019-07-08.yang" --> 591 module ietf-sr-policy-types { 592 namespace "urn:ietf:params:xml:ns:yang:ietf-sr-policy-types"; 594 prefix "sr-policy-types"; 596 import ietf-inet-types { 597 prefix "inet"; 598 } 600 import ietf-routing-types { 601 prefix "rt-types"; 602 } 604 import ietf-srv6-types { 605 prefix "srv6-types"; 606 } 608 organization "IETF SPRING Working Group"; 610 contact 611 "WG Web: 612 WG List: 613 Editor: Kamran Raza 614 615 Editor: Zhuang Shunwan 616 617 Editor: Daniel Voyer 618 619 Editor: Muhammad Durrani 620 621 Editor: Satoru Matsushima 622 623 "; 625 description 626 "This YANG module defines the essential types for the management 627 of SR policy module. 628 Copyright (c) 2019 IETF Trust and the persons identified as 629 authors of the code. All rights reserved. 630 Redistribution and use in source and binary forms, with or 631 without modification, is permitted pursuant to, and subject 632 to the license terms contained in, the Simplified BSD License 633 set forth in Section 4.c of the IETF Trust's Legal Provisions 634 Relating to IETF Documents 635 (http://trustee.ietf.org/license-info)."; 637 revision "2019-07-08" { 638 description 639 "Dynamic TE candidate-path support"; 640 reference 641 "draft-ietf-spring-segment-routing-policy"; 642 } 644 revision "2018-07-01" { 645 description 646 "Initial version"; 647 reference 648 "draft-ietf-spring-segment-routing-policy"; 649 } 651 /* Identities */ 652 identity candidate-path-not-selected-reason { 653 description 654 "Base identity for which reasons for not selecting 655 candidate path are derived from"; 656 } 657 identity candidate-path-not-selected-not-best { 658 base candidate-path-not-selected-reason; 659 description 660 "Higher preference path exists"; 661 } 662 identity candidate-path-not-selected-no-valid-segment-list { 663 base candidate-path-not-selected-reason; 664 description 665 "Candidate path has no valid segment list(s)"; 666 } 667 identity candidate-path-not-selected-empty-segment-list { 668 base candidate-path-not-selected-reason; 669 description 670 "Candidate path has empty segment list(s)"; 671 } 672 identity candidate-path-not-selected-invalid-binding-sid { 673 base candidate-path-not-selected-reason; 674 description 675 "Candidate path has invalid binding SID"; 676 } 678 identity policy-down-reason { 679 description 680 "Base identity for the reasons why SR policy is operationally down"; 681 } 682 identity policy-down-reason-admin-down { 683 base policy-down-reason; 684 description "Policy is administrately down"; 685 } 686 identity policy-down-reason-no-source-address { 687 base policy-down-reason; 688 description "Policy has no source address"; 689 } 690 identity policy-down-reason-no-endpoint { 691 base policy-down-reason; 692 description "Policy has no end-point"; 693 } 694 identity policy-down-reason-no-candidate-path { 695 base policy-down-reason; 696 description "Policy has no candidate path"; 697 } 698 identity policy-down-reason-no-valid-candidate-path { 699 base policy-down-reason; 700 description "Policy has no valid candidate path"; 701 } 702 identity policy-down-reason-candidate-path-invalid-segment-list { 703 base policy-down-reason; 704 description "Policy's candidate path has invalid segment list"; 705 } 706 identity policy-down-reason-policy-unconfigured { 707 base policy-down-reason; 708 description "Policy is unconfigured"; 709 } 710 identity policy-down-reason-policy-color-endpoint-updated { 711 base policy-down-reason; 712 description "Policy's color and end-point are updated"; 713 } 714 identity policy-down-reason-local-label-setup-failed { 715 base policy-down-reason; 716 description "Policy's local label setup (allocation/rewrite) failed"; 717 } 718 identity policy-down-reason-forwarding-rewrite-failed { 719 base policy-down-reason; 720 description "Policy's forwarding rewrite installation failed"; 721 } 722 identity policy-down-reason-internal-error { 723 base policy-down-reason; 724 description "Infra related internal error"; 725 } 727 identity binding-sid-unavailable-reason { 728 description 729 "Base identity for binding sid unavailable reason types"; 730 } 731 identity binding-sid-allocation-error { 732 base binding-sid-unavailable-reason; 733 description "SID allocator returned an error"; 734 } 735 identity binding-sid-already-exists { 736 base binding-sid-unavailable-reason; 737 description "Binding sid already exists/allocated"; 738 } 739 identity binding-sid-internal-error { 740 base binding-sid-unavailable-reason; 741 description "Internal error with binding sid allocation"; 742 } 743 identity binding-sid-color-endpoint-conflict { 744 base binding-sid-unavailable-reason; 745 description "Binding sid already allocated by another sr-policy with different color/endpoint"; 746 } 747 identity binding-sid-rewrite-error { 748 base binding-sid-unavailable-reason; 749 description "Binding sid forwarding rewrite error"; 750 } 751 identity binding-sid-outside-srlb-range { 752 base binding-sid-unavailable-reason; 753 description "Binding sid outside SRLB range"; 754 } 756 identity path-disjointness { 757 description 758 "Base identity for the type of path disjointness computation"; 759 } 760 identity path-disjointness-link { 761 base path-disjointness; 762 description "The computed path is link-disjoint with the existing path"; 763 } 764 identity path-disjointness-node { 765 base path-disjointness; 766 description "The computed path is node-disjoint with the existing path"; 767 } 768 identity path-disjointness-srlg { 769 base path-disjointness; 770 description "The computed path is srlg-disjoint with the existing path"; 772 } 773 identity path-disjointness-srlg-node { 774 base path-disjointness; 775 description "The computed path is node and srlg disjoint with the existing path"; 776 } 778 /* Typdefs */ 779 typedef sid-value-type { 780 type union { 781 type rt-types:mpls-label; 782 type srv6-types:srv6-sid; 783 } 784 description "The SID value type"; 785 } 787 typedef binding-sid-oper-state { 788 type enumeration { 789 enum ALLOC-PENDING { 790 value 1; 791 description "SID allocation pending for Binding SID"; 792 } 793 enum PROGRAMMED { 794 value 3; 795 description "Binding SID is programmed in forwarding"; 796 } 797 enum CONFLICT { 798 value 4; 799 description "Binding SID is in-conflict state with 800 regards to SID allocation. This also means that SID 801 allocation is pending"; 802 } 803 } 804 description 805 "Binding SID operational state type"; 806 } 808 typedef policy-admin-state { 809 type enumeration { 810 enum UP { 811 value 1; 812 description "SR policy is administratively up"; 813 } 814 enum DOWN { 815 value 2; 816 description "SR policy is administratively down"; 817 } 818 } 819 description "SR policy admin state"; 821 } 823 typedef policy-oper-state { 824 type enumeration { 825 enum UP { 826 value 1; 827 description "SR policy is operationally up"; 828 } 829 enum DOWN { 830 value 2; 831 description "SR policy is operationally down"; 832 } 833 } 834 description "SR policy oper state"; 835 } 837 typedef segment-type { 838 type enumeration { 839 enum segment-type-1 { 840 value 1; 841 description "SR-MPLS Label"; 842 } 843 enum segment-type-2 { 844 value 2; 845 description "SRv6 SID"; 846 } 847 enum segment-type-3 { 848 value 3; 849 description "IPv4 Prefix with optional SR Algorithm"; 850 } 851 enum segment-type-4 { 852 value 4; 853 description "IPv6 Global Prefix with optional SR Algorithm for SR-MPLS"; 854 } 855 enum segment-type-5 { 856 value 5; 857 description "IPv4 Prefix with Local Interface ID"; 858 } 859 enum segment-type-6 { 860 value 6; 861 description "IPv4 Addresses for link endpoints as Local, Remote pair"; 862 } 863 enum segment-type-7 { 864 value 7; 865 description "IPv6 Prefix and Interface ID for link endpoints as Local, 866 Remote pair for SR-MPLS"; 867 } 868 enum segment-type-8 { 869 value 8; 870 description "IPv6 Addresses for link endpoints as Local, Remote pair for 871 SR-MPLS"; 872 } 873 enum segment-type-9 { 874 value 9; 875 description "IPv6 Global Prefix with optional SR Algorithm for SRv6"; 876 } 877 enum segment-type-10 { 878 value 10; 879 description "IPv6 Prefix and Interface ID for link endpoints as Local, 880 Remote pair for SRv6"; 881 } 882 enum segment-type-11 { 883 value 11; 884 description "IPv6 Addresses for link endpoints as Local, Remote pair for 885 SRv6"; 886 } 887 } 888 description "SR segment type"; 889 } 891 typedef dataplane-type { 892 type enumeration { 893 enum mpls { 894 value 1; 895 description "Segment-routing MPLS"; 896 } 897 enum srv6 { 898 value 2; 899 description "Segment-routing v6"; 900 } 901 } 902 description "Dataplane type of the segments"; 903 } 905 typedef binding-sid-alloc-mode { 906 type enumeration { 907 enum explicit { 908 value 1; 909 description "Explicitly specified BSID"; 910 } 911 enum dynamic { 912 value 2; 913 description "Dynamically allocated BSID"; 914 } 915 } 916 description "binding SID allocation mode"; 918 } 920 typedef protocol-origin-type { 921 type enumeration { 922 enum pcep { 923 value 10; 924 description "PCEP used as signalling mechanism for the candidate path"; 925 } 926 enum bgp { 927 value 20; 928 description "BGP used as signalling mechanism for the candidate path"; 929 } 930 enum local { 931 value 30; 932 description "CLI, Yang model via Netconf, gRPC, etc used for candidate path instantiation"; 933 } 934 } 936 description "Originating protocol type"; 937 } 939 typedef explicit-binding-sid-rule-type { 940 type enumeration { 941 enum enforce-srlb { 942 value 1; 943 description 944 "Explicit Binding SID is enforced with no 945 fallback if label does not fall in SRLB or 946 if no SRLB is configured"; 947 } 948 enum fallback-dynamic { 949 value 2; 950 description 951 "Explicit Binding SID falls back to dynamic in 952 case explicit label is not available."; 953 } 954 } 955 description "Explicit binding sid rule types"; 956 } 957 } // module 959 961 Figure 5: ietf-sr-policy-types.yang 963 6.2. SR Policy 965 file "ietf-sr-policy@2019-07-08.yang" --> 967 module ietf-sr-policy { 969 namespace "urn:ietf:params:xml:ns:yang:ietf-sr-policy"; 971 prefix "sr-policy"; 973 import ietf-inet-types { 974 prefix "inet"; 975 } 977 import ietf-interfaces { 978 prefix if; 979 } 981 import ietf-routing { 982 prefix "rt"; 983 } 985 import ietf-routing-types { 986 prefix "rt-types"; 987 } 989 import ietf-yang-types { 990 prefix "yang"; 991 } 993 import ietf-srv6-types { 994 prefix "srv6-types"; 995 } 997 import ietf-sr-policy-types { 998 prefix "sr-policy-types"; 999 } 1001 organization "IETF SPRING Working Group"; 1003 contact 1004 "WG Web: 1005 WG List: 1007 Editor: Kamran Raza 1008 1010 Editor: Zhuang Shunwan 1011 1013 Editor: Daniel Voyer 1014 1016 Editor: Muhammad Durrani 1017 1019 Editor: Satoru Matsushima 1020 1021 "; 1023 description 1024 "This module contains a collection of YANG definitions 1025 for SR policy module. 1027 Copyright (c) 2019 IETF Trust and the persons identified as 1028 authors of the code. All rights reserved. 1030 Redistribution and use in source and binary forms, with or 1031 without modification, is permitted pursuant to, and subject 1032 to the license terms contained in, the Simplified BSD License 1033 set forth in Section 4.c of the IETF Trust's Legal Provisions 1034 Relating to IETF Documents 1035 (http://trustee.ietf.org/license-info)."; 1037 revision "2019-07-08" { 1038 description 1039 "Dynamic TE candidate-path support"; 1040 reference 1041 "draft-ietf-spring-segment-routing-policy"; 1042 } 1044 revision "2018-07-01" { 1045 description 1046 "Initial version"; 1047 reference 1048 "draft-ietf-spring-segment-routing-policy"; 1049 } 1051 grouping segment_config { 1052 description "Segment properties grouping"; 1053 leaf index { 1054 type uint32; 1055 description "Segment index"; 1056 } 1057 leaf type { 1058 type sr-policy-types:segment-type; 1059 description "Segment type"; 1060 } 1061 container segment-types { 1062 description "Types of segments"; 1063 container segment-type-1 { 1064 description 1065 "Segment declared by MPLS label"; 1066 leaf sid-value { 1067 type rt-types:mpls-label; 1068 description "MPLS label value"; 1069 } 1070 } 1071 container segment-type-2 { 1072 description 1073 "Segment declared by SRv6 SID value"; 1074 leaf sid-value { 1075 type srv6-types:srv6-sid; 1076 description "SRv6 SID value"; 1077 } 1078 } 1079 container segment-type-3 { 1080 description 1081 "Segment declared by IPv4 Prefix with optional SR Algorithm"; 1082 leaf ipv4-address { 1083 type inet:ipv4-address; 1084 description "Segment IPv4 address"; 1085 } 1086 leaf algorithm { 1087 type uint8; 1088 description "Prefix SID algorithm identifier"; 1089 } 1090 } 1091 container segment-type-4 { 1092 description 1093 "Segment declared by IPv6 Global Prefix with optional 1094 SR Algorithm for SR-MPLS"; 1095 leaf ipv6-address { 1096 type inet:ipv6-address; 1097 description "Segment IPv6 address"; 1098 } 1099 leaf algorithm { 1100 type uint8; 1101 description "Prefix SID algorithm identifier"; 1102 } 1103 } 1104 container segment-type-5 { 1105 description 1106 "Segment declared by IPv4 Prefix with Local Interface ID"; 1107 leaf ipv4-address { 1108 type inet:ipv4-address; 1109 description "Node IPv4 address"; 1110 } 1111 leaf interface-identifier { 1112 type uint32; 1113 description "local interface identifier"; 1114 } 1115 } 1116 container segment-type-6 { 1117 description 1118 "Segment declared by IPv4 Addresses for link endpoints 1119 as Local, Remote pair"; 1120 leaf local-ipv4-address { 1121 type inet:ipv4-address; 1122 description "Segment local IPv4 adjacency address"; 1123 } 1124 leaf remote-ipv4-address { 1125 type inet:ipv4-address; 1126 description "Segment remote IPv4 adjacency address"; 1127 } 1128 } 1129 container segment-type-7 { 1130 description 1131 "Segment declared by IPv6 Prefix and Interface ID for 1132 link endpoints as Local, Remote pair for SR-MPLS"; 1133 leaf local-ipv6-address { 1134 type inet:ipv6-address; 1135 description "Local link IPv6 address"; 1136 } 1137 leaf local-interface-identifier { 1138 type uint32; 1139 description "Local interface identifier"; 1140 } 1141 leaf remote-ipv6-address { 1142 type inet:ipv6-address; 1143 description "Remote link IPv6 address"; 1144 } 1145 leaf remote-interface-identifier { 1146 type uint32; 1147 description "Remote interface identifier"; 1148 } 1149 } 1150 container segment-type-8 { 1151 description 1152 "Segment declared by IPv6 Addresses for link endpoints as 1153 Local, Remote pair for SR-MPLS"; 1154 leaf local-ipv6-address { 1155 type inet:ipv6-address; 1156 description "Segment local IPv6 adjacency address"; 1157 } 1158 leaf remote-ipv6-address { 1159 type inet:ipv6-address; 1160 description "Segment remote IPv6 adjacency address"; 1161 } 1162 } 1163 container segment-type-9 { 1164 description 1165 "Segment declared by IPv6 Global Prefix with optional 1166 SR Algorithm for SRv6"; 1167 leaf ipv6-address { 1168 type inet:ipv6-address; 1169 description "Segment IPv6 prefix"; 1170 } 1171 leaf algorithm { 1172 type uint8; 1173 description "Prefix SID algorithm identifier"; 1174 } 1175 } 1176 container segment-type-10 { 1177 description 1178 "Segment declared by IPv6 Prefix and Interface ID for 1179 link endpoints as Local, Remote pair for SRv6"; 1180 leaf local-ipv6-address { 1181 type inet:ipv6-address; 1182 description "Local link IPv6 address"; 1183 } 1184 leaf local-interface-identifier { 1185 type uint32; 1186 description "Local interface identifier"; 1187 } 1188 leaf remote-ipv6-address { 1189 type inet:ipv6-address; 1190 description "Remote link IPv6 address"; 1191 } 1192 leaf remote-interface-identifier { 1193 type uint32; 1194 description "Remote interface identifier"; 1195 } 1196 } 1197 container segment-type-11 { 1198 description 1199 "Segment declared by IPv6 Addresses for link endpoints as 1200 Local, Remote pair for SRv6"; 1202 leaf local-ipv6-address { 1203 type inet:ipv6-address; 1204 description "Segment local IPv6 adjacency address"; 1205 } 1206 leaf remote-ipv6-address { 1207 type inet:ipv6-address; 1208 description "Segment remote IPv6 adjacency address"; 1209 } 1210 } 1211 } 1212 leaf validate { 1213 type boolean; 1214 default 'false'; 1215 description "Indicates whether the segment should be validated. The default 1216 applies to all segments other than the first segment. For the 1217 first segment, validation is always done."; 1218 } 1219 } 1221 grouping segment-properties { 1222 description 1223 "SR segment properties grouping"; 1224 uses segment_config; 1225 } 1227 grouping policy-attributes { 1228 description 1229 "Grouping containing attributes applicable to all SR policies"; 1231 container policy-attributes { 1232 description 1233 "Attributes applicable to all SR policies"; 1235 uses affinity-mapping; 1236 uses segment-lists; 1237 uses explicit-binding-sid-rules; 1238 } 1239 } 1241 grouping segment-lists { 1242 description 1243 "Segment lists grouping"; 1244 container segment-lists { 1245 description "Segment-lists properties"; 1247 list segment-list { 1248 key "name"; 1249 description "Segment-list properties"; 1250 leaf name { 1251 type string; 1252 description "Segment-list name"; 1253 } 1254 container segments { 1255 description 1256 "Segments for given segment list"; 1258 list segment { 1259 key "index"; 1260 description "Configure Segment/hop at the index"; 1261 uses segment-properties; 1262 } 1263 } 1264 } 1265 } 1266 } 1268 grouping binding-sid_config { 1269 description 1270 "Binding SID configuration properties grouping"; 1271 leaf dataplane { 1272 type sr-policy-types:dataplane-type; 1273 description "Binding SID dataplane type"; 1274 } 1275 leaf value { 1276 type sr-policy-types:sid-value-type; 1277 description "Binding SID value"; 1278 } 1279 } 1281 grouping forwarding-counters { 1282 description 1283 "Grouping for counters"; 1284 container counters { 1285 config false; 1286 description 1287 "Counters containing stats related to forwarding"; 1289 leaf pkts { 1290 type yang:counter64; 1291 description "Number of packets forwarded"; 1292 } 1293 leaf octets { 1294 type yang:counter64; 1295 units "byte"; 1296 description "Number of bytes forwarded"; 1297 } 1299 } 1300 } 1302 grouping binding-sid_state { 1303 description 1304 "Binding SID state properties grouping"; 1305 leaf alloc-mode { 1306 type sr-policy-types:binding-sid-alloc-mode; 1307 config false; 1308 description "Binding SID type"; 1309 } 1310 leaf allocated-sid { 1311 type sr-policy-types:sid-value-type; 1312 config false; 1313 description "Allocated SID value for the Binding SID"; 1314 } 1315 leaf oper-state { 1316 type sr-policy-types:binding-sid-oper-state; 1317 config false; 1318 description 1319 "Binding SID operational state"; 1320 } 1321 } 1323 grouping binding-sid-properties { 1324 description 1325 "Binding SID properties grouping"; 1326 container binding-sid { 1327 description "Binding Segment ID"; 1328 uses binding-sid_config; 1329 uses binding-sid_state; 1330 } 1331 } 1333 grouping mpls-label-stack { 1334 description 1335 "Grouping for MPLS label stack"; 1337 list labels { 1338 key "label"; 1339 description 1340 "Stack containing MPLS labels"; 1342 leaf label { 1343 type rt-types:mpls-label; 1344 description 1345 "MPLS label value"; 1346 } 1348 } 1349 } 1351 grouping srv6-sid-stack { 1352 description 1353 "Grouping for SRv6 label stack"; 1355 list sids { 1356 key "sid"; 1357 description 1358 "Stack containing SRv6 SIDs"; 1360 leaf sid { 1361 type srv6-types:srv6-sid; 1362 description 1363 "SRv6 sid value"; 1364 } 1365 } 1366 } 1368 grouping path-forwarding_state { 1369 description "Policy Forwarding path information"; 1370 leaf path-id { 1371 type uint8; 1372 description "Primary path id"; 1373 } 1374 leaf next-hop-address { 1375 type inet:ip-address; 1376 description "Nexthop address"; 1377 } 1378 leaf next-hop-table-id { 1379 type uint32; 1380 description "Table ID for nexthop address"; 1381 } 1382 leaf outgoing-interface { 1383 type if:interface-ref; 1384 description "Outgoing interface handle"; 1385 } 1386 container outgoing-sids { 1387 description 1388 "Outgoing sid stack"; 1389 choice dataplanetype { 1390 description 1391 "Outgoing sids dataplane choice"; 1392 case mpls { 1393 uses mpls-label-stack; 1394 } 1395 case srv6 { 1396 uses srv6-sid-stack; 1397 } 1398 } 1399 } 1400 leaf is-protected { 1401 type boolean; 1402 description "Is this path protected ?"; 1403 } 1404 leaf is-pure-backup { 1405 type boolean; 1406 description "Is this path a pure backup ?"; 1407 } 1408 leaf backup-path-id { 1409 type uint8; 1410 description "Backup path id"; 1411 } 1412 leaf weight { 1413 type uint32; 1414 description "Path's weight for W-ECMP balancing"; 1415 } 1416 } 1418 grouping cpath-cmn-properties { 1419 description 1420 "Common properties of the candidate path"; 1422 leaf is-valid { 1423 type boolean; 1424 config false; 1425 description 1426 "True if the segment-list is valid, False otherwise"; 1428 } 1430 container forwarding-paths { 1431 config false; 1432 description 1433 "Forwarding state of paths"; 1434 list forwarding-path { 1435 key "path-id"; 1436 description "Forwarding path"; 1437 uses path-forwarding_state; 1438 } 1439 } 1440 } 1442 grouping explicit-path-properties { 1443 description 1444 "Explicit path properties of the candidate path"; 1445 container segment-lists { 1446 description 1447 "Path segment list(s) properties"; 1448 list segment-list { 1449 key "name-ref"; 1450 description "SR policy candidate path segment lists"; 1452 leaf name-ref { 1453 type leafref { 1454 path "/rt:routing/sr-policy:segment-routing/sr-policy:sr-policy/sr-policy:policy-attributes/sr-policy:segment-lists/sr-policy:segment-list/sr-policy:name"; 1455 } 1456 description "Reference to segment-list name"; 1457 } 1458 leaf weight { 1459 type uint32; 1460 description "Segment-list weighted loadshare"; 1461 } 1462 } 1463 } 1464 } 1466 grouping affinity-mapping { 1467 description "Affinity-map grouping"; 1469 container affinity-map { 1470 description 1471 "Mapping of affinity names to bit position"; 1472 list affinity { 1473 key "name"; 1474 unique "bit-position"; 1475 leaf name { 1476 type string; 1477 description 1478 "Name of the affinity"; 1479 } 1480 leaf bit-position { 1481 type uint16; 1482 description 1483 "The affinity entry in this list is mapped to the this bit-position in the 1484 affinity bitmap"; 1485 } 1487 description "Affinity"; 1488 } 1489 } 1490 } 1491 grouping dynamic-path-properties { 1492 description 1493 "Dynamic path properties of the candidate path"; 1494 leaf sid-dataplane-type { 1495 type sr-policy-types:dataplane-type; 1496 description 1497 "The dataplane type for the sid"; 1498 } 1500 container constraints { 1501 description "Constraints for the dynamic path computation"; 1502 container affinities { 1503 description "Affinity constraints on the computed dynamic path"; 1504 leaf-list exclude-any { 1505 type string; 1506 description 1507 "The link is excluded if it has any of these affinities."; 1508 } 1509 leaf-list include-any { 1510 type string; 1511 description 1512 "The link is accepted if it has any of these affinities"; 1513 } 1514 leaf-list include-all { 1515 type string; 1516 description 1517 "The link is accepted if it has all these affinities"; 1518 } 1519 } 1521 container bounds { 1522 description "Upper-bound constraints on the computed dynamic path"; 1523 leaf igp-metric-bound { 1524 type uint32; 1525 description 1526 "Path is invalid if its IGP metric exceeds this value"; 1527 } 1528 leaf te-metric-bound { 1529 type uint32; 1530 description 1531 "Path is invalid if its TE metric exceeds this value"; 1532 } 1533 leaf latency-metric-bound { 1534 type uint32; 1535 units "microsecond"; 1536 description 1537 "Path is invalid if its latency exceeds this value"; 1538 } 1539 leaf segment-bound { 1540 type uint32; 1541 description 1542 "Path is invalid if it has more segments than this value"; 1543 } 1544 } 1545 container segment-rules { 1546 description "Constraints on the segments to be used in the path"; 1547 leaf sid-algorithm { 1548 type uint8 { 1549 range "128..255"; 1550 } 1551 description 1552 "The prefix-sid algorithm to be used in path calculation"; 1553 } 1554 } 1555 container disjoint-path { 1556 description "Path disjointness constraints"; 1557 leaf group-id { 1558 type uint32 { range "1..65535"; } 1559 description ""; 1560 } 1561 leaf disjointness-type { 1562 type identityref { base sr-policy-types:path-disjointness; } 1563 description 1564 "Type of disjointness computation used to find the path"; 1565 } 1566 leaf subgroup-id { 1567 type uint32 { range "1..65535"; } 1568 description ""; 1569 } 1570 } 1571 } 1572 } 1574 grouping candidate-path_state { 1575 description 1576 "Candidate path state properties grouping"; 1577 leaf is-best-candidate-path { 1578 type boolean; 1579 default 'false'; 1580 config false; 1581 description 1582 "True if the candidate path is the best candidate path, False otherwise"; 1583 } 1584 leaf non-selection-reason { 1585 type identityref { 1586 base sr-policy-types:candidate-path-not-selected-reason; 1587 } 1588 config false; 1589 description 1590 "Candidate path not selected reason"; 1591 } 1592 } 1594 grouping policy-properties_config { 1595 description 1596 "SR policy configuration grouping"; 1597 leaf name { 1598 type string { 1599 length "1..59"; 1600 } 1601 description "SR policy name"; 1602 } 1603 leaf color { 1604 type uint32 { 1605 range "1..4294967295"; 1606 } 1607 description "Color associated with the policy"; 1608 } 1609 leaf endpoint { 1610 type inet:ip-address; 1611 description "Policy end point IP address"; 1612 } 1613 leaf description { 1614 type string; 1615 description "Description of the policy"; 1616 } 1617 leaf admin-state { 1618 type sr-policy-types:policy-admin-state; 1619 default 'UP'; 1620 description 1621 "SR policy administrative state, true for 1622 enabled, false for disabled"; 1623 } 1624 } 1626 grouping policy-properties_state { 1627 description 1628 "SR policy property grouping"; 1629 leaf oper-state { 1630 type sr-policy-types:policy-oper-state; 1631 config false; 1632 description 1633 "SR policy operational state"; 1634 } 1635 leaf transition-count { 1636 type uint32; 1637 config false; 1638 description "Indicates number of up/down transitions"; 1639 } 1640 leaf up-time { 1641 type yang:date-and-time; 1642 config false; 1643 description "Policy up time in seconds"; 1644 } 1645 leaf down-time { 1646 type yang:date-and-time; 1647 config false; 1648 description "Policy down time in seconds"; 1649 } 1650 } 1652 grouping policy-properties { 1653 description 1654 "SR policy properties"; 1655 uses policy-properties_state; 1656 uses binding-sid-properties; 1657 uses forwarding-counters; 1658 } 1660 grouping candidate-path-type { 1661 description "Candidate path type grouping"; 1662 choice type { 1663 description 1664 "Type of candidate paths"; 1665 case explicit { 1666 description "Candidate path with explicitly defined set/s of segment-lists"; 1667 uses explicit-path-properties; 1668 } 1669 case dynamic { 1670 description "Candidate path with dynamic computed segment-lists"; 1671 uses dynamic-path-properties; 1672 } 1673 } 1674 } 1676 grouping candidate-paths { 1677 description "SR policy candidate path grouping"; 1678 container candidate-paths { 1679 description "SR policy candidate path(s) "; 1681 list candidate-path { 1682 key "protocol-origin originator discriminator"; 1683 description "SR policy Candidate path(s) list entry"; 1684 leaf protocol-origin { 1685 type sr-policy-types:protocol-origin-type; 1686 description 1687 "Instantiation mechanism used to create the candidate path"; 1688 } 1689 leaf originator { 1690 type string; 1691 description 1692 "Identifier (concatenation of ASN and node-address) of the node 1693 that signalled/instantiated the candidate path on headend"; 1694 } 1695 leaf discriminator { 1696 type uint32; 1697 description "Candidate path distinguisher"; 1698 } 1699 leaf name { 1700 type string; 1701 description "Candidate path name"; 1702 } 1703 leaf preference { 1704 type uint32 { 1705 range "1..65535"; 1706 } 1707 description "Candidate path preference"; 1708 } 1709 leaf description { 1710 type string; 1711 description "Candidate path description"; 1712 } 1713 container binding-sid { 1714 if-feature capability-candidate-path-binding-sid; 1715 description 1716 "Binding segment ID"; 1717 uses binding-sid_config; 1718 } 1720 uses candidate-path-type; 1721 uses candidate-path_state; 1722 uses cpath-cmn-properties; 1723 } 1724 } 1725 } 1727 grouping policies { 1728 description "SR policy grouping"; 1729 container policies { 1730 description "SR Policy container"; 1731 list policy { 1732 key "color endpoint"; 1733 unique "name"; 1734 description "SR Policy properties"; 1736 leaf color { 1737 type uint32 { 1738 range "1..4294967295"; 1739 } 1740 description "Color associated with the policy"; 1741 } 1742 leaf endpoint { 1743 type inet:ip-address; 1744 description "Policy end point IP address"; 1745 } 1746 leaf name { 1747 type string { 1748 length "1..59"; 1749 } 1750 description "SR policy name"; 1751 } 1752 leaf description { 1753 type string; 1754 description "Description of the policy"; 1755 } 1756 leaf admin-state { 1757 type sr-policy-types:policy-admin-state; 1758 default 'UP'; 1759 description 1760 "SR policy administrative state, true for 1761 enabled, false for disabled"; 1762 } 1763 leaf priority { 1764 type uint8; 1765 default 128; 1766 description "Priority considered when policy is recomputed due to topology changes"; 1767 } 1769 uses policy-properties; 1771 uses candidate-paths; 1772 } 1773 } 1774 } 1776 grouping explicit-binding-sid-rules { 1777 description 1778 "Grouping for explicit binding sid rules"; 1780 list explicit-binding-sid-rules { 1781 key "index"; 1782 description 1783 "Explicit binding sid rules applicable for all policies"; 1784 leaf index { 1785 type uint32; 1786 description "Explicit binding SID rules list index"; 1787 } 1788 leaf rule { 1789 type sr-policy-types:explicit-binding-sid-rule-type; 1790 description "Explicit binding sid rule"; 1791 } 1792 } 1793 } 1795 augment "/rt:routing" { 1796 description 1797 "This augments routing-instance configuration with segment-routing sr-policy."; 1798 container segment-routing { 1799 description "Main segment routing container"; 1800 container sr-policy { 1801 description "SR policy main container"; 1803 uses policy-attributes; 1805 uses policies; 1806 } 1807 } 1808 } 1810 /* Notifications */ 1812 notification sr-policy-oper-state-change-event { 1813 description 1814 "Notification event when the operational state of the SR policy changes"; 1816 leaf policy-name-ref { 1817 type leafref { 1818 path "/rt:routing/sr-policy:segment-routing/sr-policy:sr-policy/sr-policy:policies/sr-policy:policy/sr-policy:name"; 1819 } 1820 description "Reference to sr-policy name"; 1821 } 1823 leaf policy-color-ref { 1824 type leafref { 1825 path "/rt:routing/sr-policy:segment-routing/sr-policy:sr-policy/sr-policy:policies/sr-policy:policy/sr-policy:color"; 1826 } 1827 description "Reference to sr-policy color"; 1829 } 1831 leaf policy-endpoint-ref { 1832 type leafref { 1833 path "/rt:routing/sr-policy:segment-routing/sr-policy:sr-policy/sr-policy:policies/sr-policy:policy/sr-policy:endpoint"; 1834 } 1835 description "Reference to sr-policy endpoint"; 1836 } 1838 leaf policy-new-oper-state { 1839 type sr-policy-types:policy-oper-state; 1840 description "New operational state of the SR policy"; 1841 } 1843 leaf policy-down-reason { 1844 type identityref { 1845 base sr-policy-types:policy-down-reason; 1846 } 1847 description "Down reason if the SR policy's new operational state is down"; 1848 } 1849 } 1851 notification sr-policy-candidate-path-change-event { 1852 description 1853 "Notification event when candidate path changes for SR policy"; 1855 leaf policy-name-ref { 1856 type leafref { 1857 path "/rt:routing/sr-policy:segment-routing/sr-policy:sr-policy/sr-policy:policies/sr-policy:policy/sr-policy:name"; 1858 } 1859 description "Reference to sr-policy name"; 1860 } 1862 leaf policy-color-ref { 1863 type leafref { 1864 path "/rt:routing/sr-policy:segment-routing/sr-policy:sr-policy/sr-policy:policies/sr-policy:policy/sr-policy:color"; 1865 } 1866 description "Reference to sr-policy color"; 1867 } 1869 leaf policy-endpoint-ref { 1870 type leafref { 1871 path "/rt:routing/sr-policy:segment-routing/sr-policy:sr-policy/sr-policy:policies/sr-policy:policy/sr-policy:endpoint"; 1872 } 1873 description "Reference to sr-policy endpoint"; 1874 } 1876 leaf existing-preference { 1877 type uint32; 1878 description "Existing candidate path preference"; 1879 } 1881 leaf new-preference { 1882 type uint32; 1883 description "New candidate path preference"; 1884 } 1885 } 1887 notification sr-policy-binding-sid-unavailable-event { 1888 description 1889 "Notification event when the binding sid of sr-policy is unavailable"; 1891 leaf policy-name-ref { 1892 type leafref { 1893 path "/rt:routing/sr-policy:segment-routing/sr-policy:sr-policy/sr-policy:policies/sr-policy:policy/sr-policy:name"; 1894 } 1895 description "Reference to sr-policy name"; 1896 } 1898 leaf policy-color-ref { 1899 type leafref { 1900 path "/rt:routing/sr-policy:segment-routing/sr-policy:sr-policy/sr-policy:policies/sr-policy:policy/sr-policy:color"; 1901 } 1902 description "Reference to sr-policy color"; 1903 } 1905 leaf policy-endpoint-ref { 1906 type leafref { 1907 path "/rt:routing/sr-policy:segment-routing/sr-policy:sr-policy/sr-policy:policies/sr-policy:policy/sr-policy:endpoint"; 1908 } 1909 description "Reference to sr-policy endpoint"; 1910 } 1912 leaf policy-binding-sid-value-ref { 1913 type leafref { 1914 path "/rt:routing/sr-policy:segment-routing/sr-policy:sr-policy/sr-policy:policies/sr-policy:policy/sr-policy:binding-sid/sr-policy:value"; 1915 } 1916 description "Reference to sr-policy binding-sid value"; 1917 } 1919 leaf reason { 1920 type identityref { 1921 base sr-policy-types:binding-sid-unavailable-reason; 1922 } 1923 description 1924 "Reason why the binding sid is unavailable"; 1926 } 1927 } 1929 notification sr-policy-candidate-path-binding-sid-mismatch-event { 1930 description 1931 "Notification event when binding sid of requested candidate path 1932 is different from the binding sid of the existing candidate path"; 1934 leaf policy-color-ref { 1935 type leafref { 1936 path "/rt:routing/sr-policy:segment-routing/sr-policy:sr-policy/sr-policy:policies/sr-policy:policy/sr-policy:color"; 1937 } 1938 description "Reference to sr-policy color"; 1939 } 1941 leaf policy-endpoint-ref { 1942 type leafref { 1943 path "/rt:routing/sr-policy:segment-routing/sr-policy:sr-policy/sr-policy:policies/sr-policy:policy/sr-policy:endpoint"; 1944 } 1945 description "Reference to sr-policy endpoint"; 1946 } 1948 leaf existing-candidate-path-protocol-origin-ref { 1949 type leafref { 1950 path "/rt:routing/sr-policy:segment-routing/sr-policy:sr-policy/sr-policy:policies/sr-policy:policy/sr-policy:candidate-paths/sr-policy:candidate-path/sr-policy:protocol-origin"; 1951 } 1952 description "Reference to existing candidate path protocol origin"; 1953 } 1955 leaf existing-candidate-path-preference-ref { 1956 type leafref { 1957 path "/rt:routing/sr-policy:segment-routing/sr-policy:sr-policy/sr-policy:policies/sr-policy:policy/sr-policy:candidate-paths/sr-policy:candidate-path/sr-policy:preference"; 1958 } 1959 description "Reference to existing candidate path preference"; 1960 } 1962 leaf existing-candidate-path-binding-sid-dataplane-ref { 1963 type leafref { 1964 path "/rt:routing/sr-policy:segment-routing/sr-policy:sr-policy/sr-policy:policies/sr-policy:policy/sr-policy:candidate-paths/sr-policy:candidate-path/sr-policy:binding-sid/sr-policy:dataplane"; 1965 } 1966 description "Reference to existing candidate path binding sid dataplane type"; 1967 } 1969 leaf existing-candidate-path-binding-sid-value-ref { 1970 type leafref { 1971 path "/rt:routing/sr-policy:segment-routing/sr-policy:sr-policy/sr-policy:policies/sr-policy:policy/sr-policy:candidate-paths/sr-policy:candidate-path/sr-policy:binding-sid/sr-policy:value"; 1972 } 1973 description "Reference to existing candidate path binding sid value"; 1975 } 1977 leaf conflicting-candidate-path-protocol-origin { 1978 type uint8; 1979 description "Conflicting candidate path protocol origin"; 1980 } 1982 leaf conflicting-candidate-path-preference { 1983 type uint32; 1984 description "Conflicting candidate path preference"; 1985 } 1987 leaf conflicting-candidate-path-binding-sid-dataplane { 1988 type sr-policy-types:dataplane-type; 1989 description "Conflicting candidate path binding sid dataplane type"; 1990 } 1992 leaf conflicting-candidate-path-binding-sid-value { 1993 type sr-policy-types:sid-value-type; 1994 description "Conflicting candidate path binding sid value"; 1995 } 1996 } 1998 /* Features */ 2000 feature capability-candidate-path-binding-sid { 2001 description 2002 "This feature enables the capability of specifying binding-sid 2003 for a candidate path."; 2004 } 2005 } // module 2007 2009 Figure 6: ietf-sr-policy.yang 2011 7. Security Considerations 2013 The configuration, state, and notification data defined using YANG 2014 data models in this document are likely to be accessed via the 2015 protocols such as NETCONF [RFC6241] etc. 2017 Hence, YANG implementations MUST comply with the security 2018 requirements specified in section 15 of [RFC6020]. Additionally, 2019 NETCONF implementations MUST comply with the security requirements 2020 specified in sections 2.2, 2.3 and 9 of [RFC6241] as well as section 2021 3.7 of [RFC8341]. 2023 8. IANA Considerations 2025 This document requests the registration of the following URIs in the 2026 IETF "XML registry" [RFC3688]: 2028 +------------------------------------------------+------------+-----+ 2029 | URI | Registrant | XML | 2030 +------------------------------------------------+------------+-----+ 2031 | urn:ietf:params:xml:ns:yang:ietf-sr-policy- | The IESG | N/A | 2032 | types | | | 2033 | | | | 2034 | urn:ietf:params:xml:ns:yang:ietf-sr-policy | The IESG | N/A | 2035 +------------------------------------------------+------------+-----+ 2037 This document requests the registration of the following YANG modules 2038 in the "YANG Module Names" registry [RFC6020]: 2040 +--------------+------------------------------+------------+--------+ 2041 | Name | Namespace | Prefix | Refere | 2042 | | | | nce | 2043 +--------------+------------------------------+------------+--------+ 2044 | ietf-sr- | urn:ietf:params:xml:ns:yang | sr-policy- | This d | 2045 | policy-types | :ietf-sr-policy-types | types | ocumen | 2046 | | | | t | 2047 | | | | | 2048 | ietf-sr- | urn:ietf:params:xml:ns:yang | sr-policy | This d | 2049 | policy | :ietf-sr-policy | | ocumen | 2050 | | | | t | 2051 +--------------+------------------------------+------------+--------+ 2053 9. Acknowledgments 2055 The authors of this document/YANG model would like to acknowledge the 2056 contributions/reviews by Johnson Thomas, Clarence Filsfils, Siva 2057 Sivabalan, Tarek Saad, Kris Michielsen, Dhanendra Jain, Ketan 2058 Talaulikar, Bhupendra Yadav, and Bruno Decraene. 2060 10. References 2062 10.1. Normative References 2064 [I-D.ietf-spring-segment-routing-policy] 2065 Filsfils, C., Sivabalan, S., daniel.voyer@bell.ca, d., 2066 bogdanov@google.com, b., and P. Mattes, "Segment Routing 2067 Policy Architecture", draft-ietf-spring-segment-routing- 2068 policy-03 (work in progress), May 2019. 2070 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2071 Requirement Levels", BCP 14, RFC 2119, 2072 DOI 10.17487/RFC2119, March 1997, 2073 . 2075 [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, 2076 DOI 10.17487/RFC3688, January 2004, 2077 . 2079 [RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for 2080 the Network Configuration Protocol (NETCONF)", RFC 6020, 2081 DOI 10.17487/RFC6020, October 2010, 2082 . 2084 [RFC6241] Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed., 2085 and A. Bierman, Ed., "Network Configuration Protocol 2086 (NETCONF)", RFC 6241, DOI 10.17487/RFC6241, June 2011, 2087 . 2089 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2090 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 2091 May 2017, . 2093 [RFC8341] Bierman, A. and M. Bjorklund, "Network Configuration 2094 Access Control Model", STD 91, RFC 8341, 2095 DOI 10.17487/RFC8341, March 2018, 2096 . 2098 [RFC8342] Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K., 2099 and R. Wilton, "Network Management Datastore Architecture 2100 (NMDA)", RFC 8342, DOI 10.17487/RFC8342, March 2018, 2101 . 2103 [RFC8402] Filsfils, C., Ed., Previdi, S., Ed., Ginsberg, L., 2104 Decraene, B., Litkowski, S., and R. Shakir, "Segment 2105 Routing Architecture", RFC 8402, DOI 10.17487/RFC8402, 2106 July 2018, . 2108 [RFC8407] Bierman, A., "Guidelines for Authors and Reviewers of 2109 Documents Containing YANG Data Models", BCP 216, RFC 8407, 2110 DOI 10.17487/RFC8407, October 2018, 2111 . 2113 10.2. Informative References 2115 [I-D.ietf-idr-segment-routing-te-policy] 2116 Previdi, S., Filsfils, C., Mattes, P., Rosen, E., Jain, 2117 D., and S. Lin, "Advertising Segment Routing Policies in 2118 BGP", draft-ietf-idr-segment-routing-te-policy-07 (work in 2119 progress), July 2019. 2121 Authors' Addresses 2123 Kamran Raza (editor) 2124 Cisco Systems 2125 Email: skraza@cisco.com 2127 Robert Sawaya 2128 Cisco Systems 2129 Email: thjohns2@cisco.com 2131 Zhuang Shunwan 2132 Huawei Technologies 2133 Email: zhuangshunwa@huawei.com 2135 Daniel Voyer 2136 Bell Canada 2137 Email: daniel.voyer@bell.ca 2139 Muhammad Durrani 2140 Equinix 2141 Email: mdurrani@equinix.com 2143 Satoru Matsushima 2144 SoftBank 2145 Email: satoru.matsushima@g.softbank.co.jp 2147 Vishnu Pavan Beeram 2148 Juniper Networks 2149 Email: vbeeram@juniper.net@g.softbank.co.jp