idnits 2.17.1 draft-raza-spring-sr-policy-yang-00.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 98 instances of too long lines in the document, the longest one being 168 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 346 has weird spacing: '...w index uin...' == Line 478 has weird spacing: '...o label rt-...' == Line 481 has weird spacing: '...-ro sid srv...' == Line 498 has weird spacing: '...o label rt-...' == Line 501 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 (May 30, 2019) is 1792 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-06 Summary: 1 error (**), 0 flaws (~~), 10 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: December 1, 2019 5 Z. Shunwan 6 Huawei Technologies 8 D. Voyer 9 Bell Canada 11 M. Durrani 12 Equinix 14 S. Matsushima 15 SoftBank 17 May 30, 2019 19 YANG Data Model for Segment Routing Policy 20 draft-raza-spring-sr-policy-yang-00.txt 22 Abstract 24 This document defines a YANG data model for Segment Routing (SR) 25 Policy that can be used for configuring, instantiating, and managing 26 SR policies. The model is generic and apply equally to the MPLS and 27 SRv6 instantiations of SR policies. 29 Status of This Memo 31 This Internet-Draft is submitted in full conformance with the 32 provisions of BCP 78 and BCP 79. 34 Internet-Drafts are working documents of the Internet Engineering 35 Task Force (IETF). Note that other groups may also distribute 36 working documents as Internet-Drafts. The list of current Internet- 37 Drafts is at https://datatracker.ietf.org/drafts/current/. 39 Internet-Drafts are draft documents valid for a maximum of six months 40 and may be updated, replaced, or obsoleted by other documents at any 41 time. It is inappropriate to use Internet-Drafts as reference 42 material or to cite them other than as "work in progress." 44 This Internet-Draft will expire on December 1, 2019. 46 Copyright Notice 48 Copyright (c) 2019 IETF Trust and the persons identified as the 49 document authors. All rights reserved. 51 This document is subject to BCP 78 and the IETF Trust's Legal 52 Provisions Relating to IETF Documents 53 (https://trustee.ietf.org/license-info) in effect on the date of 54 publication of this document. Please review these documents 55 carefully, as they describe your rights and restrictions with respect 56 to this document. Code Components extracted from this document must 57 include Simplified BSD License text as described in Section 4.e of 58 the Trust Legal Provisions and are provided without warranty as 59 described in the Simplified BSD License. 61 Table of Contents 63 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 64 2. Specification of Requirements . . . . . . . . . . . . . . . . 3 65 3. Building Blocks . . . . . . . . . . . . . . . . . . . . . . . 3 66 4. YANG Model . . . . . . . . . . . . . . . . . . . . . . . . . 4 67 4.1. Types and Definitions . . . . . . . . . . . . . . . . . . 4 68 4.2. SR Policy . . . . . . . . . . . . . . . . . . . . . . . . 5 69 4.2.1. Configuration . . . . . . . . . . . . . . . . . . . . 6 70 4.2.2. State . . . . . . . . . . . . . . . . . . . . . . . . 10 71 4.2.3. Notification . . . . . . . . . . . . . . . . . . . . 12 72 5. Pending Items . . . . . . . . . . . . . . . . . . . . . . . . 13 73 6. YANG Specification . . . . . . . . . . . . . . . . . . . . . 14 74 6.1. Types . . . . . . . . . . . . . . . . . . . . . . . . . . 14 75 6.2. SR Policy . . . . . . . . . . . . . . . . . . . . . . . . 21 76 7. Security Considerations . . . . . . . . . . . . . . . . . . . 41 77 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 41 78 9. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 42 79 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 42 80 10.1. Normative References . . . . . . . . . . . . . . . . . . 42 81 10.2. Informative References . . . . . . . . . . . . . . . . . 43 82 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 43 84 1. Introduction 86 The Network Configuration Protocol (NETCONF) [RFC6241] defines 87 mechanisms to manage network devices. YANG [RFC6020] is a modular 88 language that represents data structures in an XML tree format, and 89 is used as a data modeling language for the NETCONF. 91 Segment Routing (SR), as defined in [RFC8402], allows a headend node 92 to steer a packet flow along any topological path and/or service 93 chain. The headend node is said to steer a flow into a Segment 94 Routing Policy (SR Policy). An SR policy is a framework 95 [I-D.ietf-spring-segment-routing-policy] that enables instantiation 96 of an ordered list of segments on a node for implementing a policy. 98 This document introduces a YANG data model for SR policy framework 99 for instantiating, configuring and managing SR policies along with 100 its attributes. It is also expected that other companion models, 101 such as BGP SR Policy [I-D.ietf-idr-segment-routing-te-policy], will 102 be defined and/or augmented accordingly in their respective areas. 104 This model defines the following constructs for managing an SR 105 policy: 107 o Configuration 109 o Operational State 111 o Notifications 113 o Executables (Actions) 115 This document expects and requires the reader to be well familiar 116 with the concepts and constructs of an SR policy 117 [I-D.ietf-spring-segment-routing-policy] as well as the YANG modeling 118 language and its presentation [RFC6020]. 120 2. Specification of Requirements 122 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 123 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 124 document are to be interpreted as described in BCP 14 [RFC2119] 125 [RFC8174] when, and only when, they appear in all capitals, as shown 126 here. 128 3. Building Blocks 130 Before looking into the YANG model for SR policy, it is important to 131 recall and highlight the major building blocks and constructs that 132 constitute and contribute to an SR policy, as described in 133 [I-D.ietf-spring-segment-routing-policy]. 135 o policy: specifies constructs to allow a headend node to setup SR 136 path(s) as an ordered list of segments for a given color and 137 endpoint. The endpoint and the color are used to automate the 138 steering of service or transport routes on an SR Policy. For a 139 given headend, the key for an SR policy is (color, endpoint) where 140 endpoint is an IP address that could be also NULL. 142 o candidate-path: is the unit for signalling of an SR Policy to a 143 headend via protocols (such as PCEP, BGP, CLI etc.). A candidate 144 path is either dynamic or explicit type, where an explicit 145 candidate path is associated with one or more segment-lists and 146 dynamic candidate path expresses optimization objectives and set 147 of constraints. An SR Policy is associated with one or more 148 candidate paths and the preference of the candidate path is used 149 to select the best candidate path for an SR Policy. A candidate 150 path is valid if it is usable (e.g. when its constituents SIDs are 151 reachable). An "active" candidate path is the selected path (for 152 forwarding) that is valid and determined to be the best path of 153 the SR Policy. 155 o segment-list: specifies ordered list of segments to traverse, 156 where a segment can be specified in various forms (refer section 4 157 of [I-D.ietf-spring-segment-routing-policy]). The list is sorted 158 by the index of the segment. A segment-list is used and referred 159 by an explicit type of candidate-path. 161 o binding-sid: An SR policy is associated with a BSID to provide 162 benefits of scaling, network opacity and service independence. 164 4. YANG Model 166 The modeling in this document complies with the Network Management 167 Datastore Architecture (NMDA) [RFC8342]. The operational state data 168 is combined with the associated configuration data in the same 169 hierarchy [RFC8407]. When protocol states are retrieved from the 170 NMDA operational state datastore, the returned states cover all 171 "config true" (rw) and "config false" (ro) nodes defined in the 172 schema. 174 For SR policy YANG specification, this document defines following new 175 YANG modules: 177 +----------------------+--------------------------------------------+ 178 | Module Name | Purpose | 179 +----------------------+--------------------------------------------+ 180 | ietf-sr-policy-types | defines common and basic types related to | 181 | | an SR policy and related constructs | 182 | | | 183 | ietf-sr-policy | defines the model for SR policy | 184 | | instantiation, configuration, and | 185 | | management | 186 +----------------------+--------------------------------------------+ 188 4.1. Types and Definitions 190 SR policy common types and definitions are defined in the new module 191 "ietf-sr-policy-types". The main types defined in this module 192 include: 194 o dataplane-type: A union to specify MPLS or IPv6 as the dataplane 195 type for SR. 197 o sid-value-type: A Union to specify SID value for SR-MPLS or SRv6 198 type. 200 o binding-sid-alloc-mode: Enum to define explicit or dynamic alloc 201 mode types for a BSID. 203 o protocol-origin-type: Enum to specify protocol origin (e.g. PCEP) 204 for an SR policy. 206 o explicit-binding-sid-rule-type: Enum to specify BSID alloc 207 enforcement/rule when doing explicit alloc request. 209 o binding-sid-oper-state: An Enum representing various operational 210 states for a BSID. 212 o policy-admin-state: An Enum for admin state of an SR policy. 214 o policy-oper-state: An Enum for operational state of an SR policy. 216 o segment-type: An Enum that defines various types for a "segment" 217 of a Segment list. 219 o candidate-path-non-selection-reason: The base identity along with 220 its children to specify reason for not selecting a candidate path 221 as the best/active path. 223 o policy-down-reason: The base identity along with its children to 224 specify reason for a policy becoming (or remaining) operationally 225 down. 227 o binding-sid-unavailable-reason: The base identity along with its 228 children to specify reason for a BSID's unavailability. 230 The associated YANG specification for this module is captured in 231 Section 6.1. 233 4.2. SR Policy 235 The base SR policy model is captured in ietf-sr-policy module. This 236 base module augments "/rt:routing" and specifies the configuration, 237 operational state, executables/rpcs, and notification events required 238 to manage SR policies. 240 The associated YANG specification for this module is captured in 241 Section 6.2. 243 4.2.1. Configuration 245 In terms of configuration hierarchy, SR policy configuration tree has 246 following two main areas: 248 o policy-attributes: container that defines common constructs that 249 could be used across policies. An example of such a construct is 250 segment-lists definition. In future revision of this document, it 251 is expected that this container will have more constructs defined. 253 o policies: container that defines list of policies with their 254 attributes such as BSID, candidate-paths etc. 256 Following diagram depicts high level yang organization and hierarchy 257 for an SR policy specification: 259 segment-routing 260 sr-policy 261 + policy-attributes 262 | + segment-lists 263 | | segment-list* [name] 264 | | segments 265 | | segment* [index] 266 | | ... 267 | + explicit-binding-sid-rules 268 | ... 269 | 270 + policies 271 policy* [color endpoint] 272 + ... 273 | 274 + binding-sid 275 | ... 276 | 277 + candidate-paths 278 candidate-path* [protocol origin discrim] 279 + ... 280 | 281 + type 282 + dynamic 283 | ... 284 | 285 + explicit 286 segment-lists 287 segment-list* [ref] 288 ... 290 Figure 1: SR Policy - Hierarchy 292 Using the building blocks described in Section 3, following is the 293 complete graphical representation of the data model for SR policy 294 configuration: 296 module: ietf-sr-policy 297 augment /rt:routing: 298 +--rw segment-routing 299 +--rw sr-policy 300 +--rw policy-attributes 301 | +--rw segment-lists 302 | | +--rw segment-list* [name] 303 | | +--rw name string 304 | | +--rw segments 305 | | +--rw segment* [index] 306 | | +--rw index uint32 307 | | +--rw type? sr-policy-types:segment-type 308 | | +--rw segment-types 309 | | | +--rw segment-type-1 310 | | | | +--rw sid-value? rt-types:mpls-label 311 | | | +--rw segment-type-2 312 | | | | +--rw sid-value? srv6-types:srv6-sid 313 | | | +--rw segment-type-3 314 | | | | +--rw ipv4-address? inet:ipv4-address 315 | | | | +--rw algorithm? uint8 316 | | | +--rw segment-type-4 317 | | | | +--rw ipv4-address? inet:ipv6-address 318 | | | | +--rw algorithm? uint8 319 | | | +--rw segment-type-5 320 | | | | +--rw ipv4-address? inet:ipv4-address 321 | | | | +--rw interface-identifier? uint32 322 | | | +--rw segment-type-6 323 | | | | +--rw local-ipv4-address? inet:ipv4-address 324 | | | | +--rw remote-ipv4-address? inet:ipv4-address 325 | | | +--rw segment-type-7 326 | | | | +--rw local-ipv6-address? inet:ipv6-address 327 | | | | +--rw local-interface-identifier? uint32 328 | | | | +--rw remote-ipv6-address? inet:ipv6-address 329 | | | | +--rw remote-interface-identifier? uint32 330 | | | +--rw segment-type-8 331 | | | | +--rw local-ipv6-address? inet:ipv6-address 332 | | | | +--rw remote-ipv6-address? inet:ipv6-address 333 | | | +--rw segment-type-9 334 | | | | +--rw ipv6-address? inet:ipv6-address 335 | | | | +--rw algorithm? uint8 336 | | | +--rw segment-type-10 337 | | | | +--rw local-ipv6-address? inet:ipv6-address 338 | | | | +--rw local-interface-identifier? uint32 339 | | | | +--rw remote-ipv6-address? inet:ipv6-address 340 | | | | +--rw remote-interface-identifier? uint32 341 | | | +--rw segment-type-11 342 | | | +--rw local-ipv6-address? inet:ipv6-address 343 | | | +--rw remote-ipv6-address? inet:ipv6-address 344 | | +--rw validate? boolean 345 | +--rw explicit-binding-sid-rules* [index] 346 | +--rw index uint32 347 | +--rw rule? sr-policy-types:explicit-binding-sid-rule-type 348 +--rw policies 349 +--rw policy* [color endpoint] 350 +--rw color uint32 351 +--rw endpoint inet:ip-address 352 +--rw name? string 353 +--rw description? string 354 +--rw admin-state? sr-policy-types:policy-admin-state 355 +--rw priority? uint8 356 +--rw binding-sid 357 | +--rw dataplane? sr-policy-types:dataplane-type 358 | +--rw value? sr-policy-types:sid-value-type 359 +--rw candidate-paths 360 +--rw candidate-path* [protocol-origin originator discriminator] 361 +--rw protocol-origin sr-policy-types:protocol-origin-type 362 +--rw originator string 363 +--rw discriminator uint32 364 +--rw name? string 365 +--rw preference? uint32 366 +--rw description? string 367 +--rw binding-sid {capability-candidate-path-binding-sid}? 368 | +--rw dataplane? sr-policy-types:dataplane-type 369 | +--rw value? sr-policy-types:sid-value-type 370 +--rw (type)? 371 +--:(explicit) 372 | +--rw segment-lists 373 | +--rw segment-list* [name-ref] 374 | +--rw name-ref -> .. segment-list/name 375 | +--rw weight? uint32 376 +--:(dynamic) 377 +--rw sid-dataplane-type? sr-policy-types:dataplane-type 379 Figure 2: SR Policy - Config Tree 381 Please take note of the following important points in the above 382 configuration model: 384 o This model supports both MPLS and SRv6 dataplane for SR -- i.e. 385 items like segments and BSID can be defined as MPLS label or SRv6 386 SIDs. 388 o Specification of a segment supports all the types defined in SR 389 policy base specification document 391 o The above model supports explicit BSID specification on SR policy 392 level as the main mode of specification. The model also allows 393 explicit BSID per candidate-path as an if-feature capability that 394 is optional for implementations 396 o The above model will be extended in future revisions of this 397 document to enhance items like attribute and control related to 398 dynamic type of segment-list, candidate-path, and traffic steering 399 etc. 401 4.2.2. State 403 As per NMDA model, the state related to configuration items specified 404 in earlier Section 4.2.1 can be retrieved from the same tree. This 405 section defines the other operational state items related to SR 406 policy. 408 In addition to configured state, the operational state corresponding 409 to the SR policy includes: 411 o policy operational state 413 o policy up/down timestamps 415 o policy BSID info such as alloc mode, actual value in-use, 416 operational state, and forwarding stats 418 o Per candidate-path info such as: 420 * Whether candidate-path is the best candidate-path 422 * In case of non-best, the reason for such non-selection 424 * Type of candidate-path - explicit or dynamic 426 * Per segment-list information - such as validity of the segment- 427 list, as well as forwarding state for a valid segment-list. 428 The forwarding state is represented in terms of per forwarding 429 path info that includes nexthop address, outgoing interface, 430 protection information, and encapsulation (label stack or SRv6 431 SID stack) etc. 433 Following is a simplified graphical representation of the data model 434 for the SR policy operational state: 436 module: ietf-sr-policy 437 augment /rt:routing: 438 +--rw segment-routing 439 +--rw sr-policy 440 +--rw policies 441 +--rw policy* [color endpoint] 442 +--rw color uint32 443 +--rw endpoint inet:ip-address 444 +--ro oper-state? sr-policy-types:policy-oper-state 445 +--ro transition-count? uint32 446 +--ro up-time? yang:date-and-time 447 +--ro down-time? yang:date-and-time 448 +--rw binding-sid 449 | +--ro alloc-mode? sr-policy-types:binding-sid-alloc-mode 450 | +--ro allocated-sid? sr-policy-types:sid-value-type 451 | +--ro oper-state? sr-policy-types:binding-sid-oper-state 452 +--ro counters 453 | +--ro pkts? yang:counter64 454 | +--ro octets? yang:counter64 455 +--rw candidate-paths 456 +--rw candidate-path* [protocol-origin originator discriminator] 457 +--rw protocol-origin sr-policy-types:protocol-origin-type 458 +--rw originator string 459 +--rw discriminator uint32 460 +--ro is-best-candidate-path? boolean 461 +--ro non-selection-reason? identityref 462 +--rw (type)? 463 +--:(explicit) 464 | +--rw segment-lists 465 | +--rw segment-list* [name-ref] 466 | +--rw name-ref -> .. segment-list/name 467 | +--ro is-valid? boolean 468 | +--ro forwarding-paths 469 | +--ro forwarding-path* [path-id] 470 | +--ro path-id uint8 471 | +--ro next-hop-address? inet:ip-address 472 | +--ro next-hop-table-id? uint32 473 | +--ro outgoing-interface? if:interface-ref 474 | +--ro outgoing-sids 475 | | +--ro (dataplanetype)? 476 | | +--:(mpls) 477 | | | +--ro labels* [label] 478 | | | +--ro label rt-types:mpls-label 479 | | +--:(srv6) 480 | | +--ro sids* [sid] 481 | | +--ro sid srv6-types:srv6-sid 482 | +--ro is-protected? boolean 483 | +--ro is-pure-backup? boolean 484 | +--ro backup-path-id? uint8 485 | +--ro weight? uint32 486 +--:(dynamic) 487 +--ro is-valid? boolean 488 +--ro forwarding-paths 489 +--ro forwarding-path* [path-id] 490 +--ro path-id uint8 491 +--ro next-hop-address? inet:ip-address 492 +--ro next-hop-table-id? uint32 493 +--ro outgoing-interface? if:interface-ref 494 +--ro outgoing-sids 495 | +--ro (dataplanetype)? 496 | +--:(mpls) 497 | | +--ro labels* [label] 498 | | +--ro label rt-types:mpls-label 499 | +--:(srv6) 500 | +--ro sids* [sid] 501 | +--ro sid srv6-types:srv6-sid 502 +--ro is-protected? boolean 503 +--ro is-pure-backup? boolean 504 +--ro backup-path-id? uint8 505 +--ro weight? uint32 507 Figure 3: SR Policy - State Tree 509 4.2.3. Notification 511 This model defines a list of notifications to inform an operator of 512 important events detected regarding an SR policy. These events 513 include events related to: 515 o policy status: policy operational state changes 517 o Candidate-path active status and changes 519 o Explicit Binding SID collision/unavailability events 521 Following is a simplified graphical representation of the data model 522 for SR policy notifications: 524 module: ietf-sr-policy 525 notifications: 526 +---n sr-policy-oper-state-change-event 527 | +--ro policy-name-ref? -> .. policy/name 528 | +--ro policy-color-ref? -> .. policy/color 529 | +--ro policy-endpoint-ref? -> .. policy/endpoint 530 | +--ro policy-new-oper-state? sr-policy-types:policy-oper-state 531 | +--ro policy-down-reason? identityref 532 +---n sr-policy-candidate-path-change-event 533 | +--ro policy-name-ref? -> .. policy/name 534 | +--ro policy-color-ref? -> .. policy/color 535 | +--ro policy-endpoint-ref? -> .. policy/endpoint 536 | +--ro existing-preference? uint32 537 | +--ro new-preference? uint32 538 +---n sr-policy-binding-sid-unavailable-event 539 | +--ro policy-name-ref? -> .. policy/name 540 | +--ro policy-color-ref? -> .. policy/color 541 | +--ro policy-endpoint-ref? -> .. policy/endpoint 542 | +--ro policy-binding-sid-value-ref? -> .. policy/binding-sid/value 543 | +--ro reason? identityref 544 +---n sr-policy-candidate-path-binding-sid-mismatch-event 545 +--ro policy-color-ref? -> .. policy/color 546 +--ro policy-endpoint-ref? -> .. policy/endpoint 547 +--ro existing-candidate-path-protocol-origin-ref? -> .. candidate-path/protocol-origin 548 +--ro existing-candidate-path-preference-ref? -> .. candidate-path/preference 549 +--ro existing-candidate-path-binding-sid-dataplane-ref? -> .. candidate-path/binding-sid/dataplane 550 +--ro existing-candidate-path-binding-sid-value-ref? -> .. candidate-path/binding-sid/value 551 +--ro conflicting-candidate-path-protocol-origin? uint8 552 +--ro conflicting-candidate-path-preference? uint32 553 +--ro conflicting-candidate-path-binding-sid-dataplane? sr-policy-types:dataplane-type 554 +--ro conflicting-candidate-path-binding-sid-value? sr-policy-types:sid-value-type 556 Figure 4: SR Policy - Notification Tree 558 5. Pending Items 560 Following are the items that will be addressed in future revisions of 561 this document: 563 o Configuration and Specification of: 565 * Link Attributes 567 * Dynamic type of candidate-path (optimization objectives and 568 constraints) 570 * Traffic steering over SR policy 571 * ODN templates 573 * Spray policy 575 o Executables (RPC actions) 577 6. YANG Specification 579 Following are actual YANG definition for the modules defined earlier 580 in the document. 582 6.1. Types 584 file "ietf-sr-policy-types@2018-07-01.yang" --> 586 module ietf-sr-policy-types { 587 namespace "urn:ietf:params:xml:ns:yang:ietf-sr-policy"; 589 prefix "ietf-sr-policy-types"; 591 import ietf-inet-types { 592 prefix "inet"; 593 } 595 import ietf-routing-types { 596 prefix "rt-types"; 597 } 599 import ietf-srv6-types { 600 prefix "srv6-types"; 601 } 603 organization "IETF SPRING Working Group"; 605 contact 606 "WG Web: 607 WG List: 609 Editor: Kamran Raza 610 612 Editor: Zhuang Shunwan 613 615 Editor: Daniel Voyer 616 618 Editor: Muhammad Durrani 619 621 Editor: Satoru Matsushima 622 623 "; 625 description 626 "This YANG module defines the essential types for the management 627 of SR policy module. 629 Copyright (c) 2018 IETF Trust and the persons identified as 630 authors of the code. All rights reserved. 632 Redistribution and use in source and binary forms, with or 633 without modification, is permitted pursuant to, and subject 634 to the license terms contained in, the Simplified BSD License 635 set forth in Section 4.c of the IETF Trust's Legal Provisions 636 Relating to IETF Documents 637 (http://trustee.ietf.org/license-info)."; 639 revision "2018-07-01" { 640 description 641 "Initial version"; 642 reference 643 "draft-ietf-spring-segment-routing-policy"; 644 } 646 /* Identities */ 647 identity candidate-path-not-selected-reason { 648 description 649 "Base identity for which reasons for not selecting 650 candidate path are derived from"; 651 } 652 identity candidate-path-not-selected-not-best { 653 base candidate-path-not-selected-reason; 654 description 655 "Higher preference path exists"; 656 } 657 identity candidate-path-not-selected-no-valid-segment-list { 658 base candidate-path-not-selected-reason; 659 description 660 "Candidate path has no valid segment list(s)"; 661 } 662 identity candidate-path-not-selected-empty-segment-list { 663 base candidate-path-not-selected-reason; 664 description 665 "Candidate path has empty segment list(s)"; 667 } 668 identity candidate-path-not-selected-invalid-binding-sid { 669 base candidate-path-not-selected-reason; 670 description 671 "Candidate path has invalid binding SID"; 672 } 674 identity policy-down-reason { 675 description 676 "Base identity for the reasons why SR policy is operationally down"; 677 } 678 identity policy-down-reason-admin-down { 679 base policy-down-reason; 680 description "Policy is administrately down"; 681 } 682 identity policy-down-reason-no-source-address { 683 base policy-down-reason; 684 description "Policy has no source address"; 685 } 686 identity policy-down-reason-no-endpoint { 687 base policy-down-reason; 688 description "Policy has no end-point"; 689 } 690 identity policy-down-reason-no-candidate-path { 691 base policy-down-reason; 692 description "Policy has no candidate path"; 693 } 694 identity policy-down-reason-no-valid-candidate-path { 695 base policy-down-reason; 696 description "Policy has no valid candidate path"; 697 } 698 identity policy-down-reason-candidate-path-invalid-segment-list { 699 base policy-down-reason; 700 description "Policy's candidate path has invalid segment list"; 701 } 702 identity policy-down-reason-policy-unconfigured { 703 base policy-down-reason; 704 description "Policy is unconfigured"; 705 } 706 identity policy-down-reason-policy-color-endpoint-updated { 707 base policy-down-reason; 708 description "Policy's color and end-point are updated"; 709 } 710 identity policy-down-reason-local-label-setup-failed { 711 base policy-down-reason; 712 description "Policy's local label setup (allocation/rewrite) failed"; 713 } 714 identity policy-down-reason-forwarding-rewrite-failed { 715 base policy-down-reason; 716 description "Policy's forwarding rewrite installation failed"; 717 } 718 identity policy-down-reason-internal-error { 719 base policy-down-reason; 720 description "Infra related internal error"; 721 } 723 identity binding-sid-unavailable-reason { 724 description 725 "Base identity for binding sid unavailable reason types"; 726 } 727 identity binding-sid-allocation-error { 728 base binding-sid-unavailable-reason; 729 description "SID allocator returned an error"; 730 } 731 identity binding-sid-already-exists { 732 base binding-sid-unavailable-reason; 733 description "Binding sid already exists/allocated"; 734 } 735 identity binding-sid-internal-error { 736 base binding-sid-unavailable-reason; 737 description "Internal error with binding sid allocation"; 738 } 739 identity binding-sid-color-endpoint-conflict { 740 base binding-sid-unavailable-reason; 741 description "Binding sid already allocated by another sr-policy with different color/endpoint"; 742 } 743 identity binding-sid-rewrite-error { 744 base binding-sid-unavailable-reason; 745 description "Binding sid forwarding rewrite error"; 746 } 747 identity binding-sid-outside-srlb-range { 748 base binding-sid-unavailable-reason; 749 description "Binding sid outside SRLB range"; 750 } 752 /* Typdefs */ 753 typedef sid-value-type { 754 type union { 755 type rt-types:mpls-label; 756 type srv6-types:srv6-sid; 757 } 758 description "The SID value type"; 759 } 761 typedef binding-sid-oper-state { 762 type enumeration { 763 enum ALLOC-PENDING { 764 value 1; 765 description "SID allocation pending for Binding SID"; 766 } 767 enum PROGRAMMED { 768 value 3; 769 description "Binding SID is programmed in forwarding"; 770 } 771 enum CONFLICT { 772 value 4; 773 description "Binding SID is in-conflict state with 774 regards to SID allocation. This also means that SID 775 allocation is pending"; 776 } 777 } 778 description 779 "Binding SID operational state type"; 780 } 782 typedef policy-admin-state { 783 type enumeration { 784 enum UP { 785 value 1; 786 description "SR policy is administratively up"; 787 } 788 enum DOWN { 789 value 2; 790 description "SR policy is administratively down"; 791 } 792 } 793 description "SR policy admin state"; 794 } 796 typedef policy-oper-state { 797 type enumeration { 798 enum UP { 799 value 1; 800 description "SR policy is operationally up"; 801 } 802 enum DOWN { 803 value 2; 804 description "SR policy is operationally down"; 805 } 806 } 807 description "SR policy oper state"; 808 } 810 typedef segment-type { 811 type enumeration { 812 enum segment-type-1 { 813 value 1; 814 description "SR-MPLS Label"; 815 } 816 enum segment-type-2 { 817 value 2; 818 description "SRv6 SID"; 819 } 820 enum segment-type-3 { 821 value 3; 822 description "IPv4 Prefix with optional SR Algorithm"; 823 } 824 enum segment-type-4 { 825 value 4; 826 description "IPv6 Global Prefix with optional SR Algorithm for SR-MPLS"; 827 } 828 enum segment-type-5 { 829 value 5; 830 description "IPv4 Prefix with Local Interface ID"; 831 } 832 enum segment-type-6 { 833 value 6; 834 description "IPv4 Addresses for link endpoints as Local, Remote pair"; 835 } 836 enum segment-type-7 { 837 value 7; 838 description "IPv6 Prefix and Interface ID for link endpoints as Local, 839 Remote pair for SR-MPLS"; 840 } 841 enum segment-type-8 { 842 value 8; 843 description "IPv6 Addresses for link endpoints as Local, Remote pair for 844 SR-MPLS"; 845 } 846 enum segment-type-9 { 847 value 9; 848 description "IPv6 Global Prefix with optional SR Algorithm for SRv6"; 849 } 850 enum segment-type-10 { 851 value 10; 852 description "IPv6 Prefix and Interface ID for link endpoints as Local, 853 Remote pair for SRv6"; 854 } 855 enum segment-type-11 { 856 value 11; 857 description "IPv6 Addresses for link endpoints as Local, Remote pair for 858 SRv6"; 860 } 861 } 862 description "SR segment type"; 863 } 865 typedef dataplane-type { 866 type enumeration { 867 enum mpls { 868 value 1; 869 description "Segment-routing MPLS"; 870 } 871 enum srv6 { 872 value 2; 873 description "Segment-routing v6"; 874 } 875 } 876 description "Dataplane type of the segments"; 877 } 879 typedef binding-sid-alloc-mode { 880 type enumeration { 881 enum explicit { 882 value 1; 883 description "Explicitly specified BSID"; 884 } 885 enum dynamic { 886 value 2; 887 description "Dynamically allocated BSID"; 888 } 889 } 890 description "binding SID allocation mode"; 891 } 893 typedef protocol-origin-type { 894 type enumeration { 895 enum pcep { 896 value 10; 897 description "PCEP used as signalling mechanism for the candidate path"; 898 } 899 enum bgp { 900 value 20; 901 description "BGP used as signalling mechanism for the candidate path"; 902 } 903 enum local { 904 value 30; 905 description "CLI, Yang model via Netconf, gRPC, etc used for candidate path instantiation"; 906 } 907 } 908 description "Originating protocol type"; 909 } 911 typedef explicit-binding-sid-rule-type { 912 type enumeration { 913 enum enforce-srlb { 914 value 1; 915 description 916 "Explicit Binding SID is enforced with no 917 fallback if label does not fall in SRLB or 918 if no SRLB is configured"; 919 } 920 enum fallback-dynamic { 921 value 2; 922 description 923 "Explicit Binding SID falls back to dynamic in 924 case explicit label is not available."; 925 } 926 } 927 description "Explicit binding sid rule types"; 928 } 929 } 931 933 Figure 5: ietf-sr-policy-types.yang 935 6.2. SR Policy 937 file "ietf-sr-policy@2018-07-01.yang" --> 939 module ietf-sr-policy { 941 namespace "urn:ietf:params:xml:ns:yang:ietf-sr-policy"; 943 prefix "ietf-sr-policy"; 945 import ietf-inet-types { 946 prefix "inet"; 947 } 949 import ietf-interfaces { 950 prefix if; 951 } 952 import ietf-routing { 953 prefix "rt"; 954 } 956 import ietf-routing-types { 957 prefix "rt-types"; 958 } 960 import ietf-yang-types { 961 prefix "yang"; 962 } 964 import ietf-srv6-types { 965 prefix "srv6-types"; 966 } 968 import ietf-sr-policy-types { 969 prefix "sr-policy-types"; 970 } 972 organization "IETF SPRING Working Group"; 974 contact 975 "WG Web: 976 WG List: 978 Editor: Kamran Raza 979 981 Editor: Zhuang Shunwan 982 984 Editor: Daniel Voyer 985 987 Editor: Muhammad Durrani 988 990 Editor: Satoru Matsushima 991 992 "; 994 description 995 "This module contains a collection of YANG definitions 996 for SR policy module. 998 Copyright (c) 2018 IETF Trust and the persons identified as 999 authors of the code. All rights reserved. 1001 Redistribution and use in source and binary forms, with or 1002 without modification, is permitted pursuant to, and subject 1003 to the license terms contained in, the Simplified BSD License 1004 set forth in Section 4.c of the IETF Trust's Legal Provisions 1005 Relating to IETF Documents 1006 (http://trustee.ietf.org/license-info)."; 1008 revision "2018-07-01" { 1009 description 1010 "Initial version"; 1011 reference 1012 "draft-ietf-spring-segment-routing-policy"; 1013 } 1015 grouping segment_config { 1016 description "Segment properties grouping"; 1017 leaf index { 1018 type uint32; 1019 description "Segment index"; 1020 } 1021 leaf type { 1022 type sr-policy-types:segment-type; 1023 description "Segment type"; 1024 } 1025 container segment-types { 1026 description "Types of segments"; 1027 container segment-type-1 { 1028 description 1029 "Segment declared by MPLS label"; 1030 leaf sid-value { 1031 type rt-types:mpls-label; 1032 description "MPLS label value"; 1033 } 1034 } 1035 container segment-type-2 { 1036 description 1037 "Segment declared by SRv6 SID value"; 1038 leaf sid-value { 1039 type srv6-types:srv6-sid; 1040 description "SRv6 SID value"; 1041 } 1042 } 1043 container segment-type-3 { 1044 description 1045 "Segment declared by IPv4 Prefix with optional SR Algorithm"; 1046 leaf ipv4-address { 1047 type inet:ipv4-address; 1048 description "Segment IPv4 address"; 1049 } 1050 leaf algorithm { 1051 type uint8; 1052 description "Prefix SID algorithm identifier"; 1053 } 1054 } 1055 container segment-type-4 { 1056 description 1057 "Segment declared by IPv6 Global Prefix with optional 1058 SR Algorithm for SR-MPLS"; 1059 leaf ipv6-address { 1060 type inet:ipv6-address; 1061 description "Segment IPv6 address"; 1062 } 1063 leaf algorithm { 1064 type uint8; 1065 description "Prefix SID algorithm identifier"; 1066 } 1067 } 1068 container segment-type-5 { 1069 description 1070 "Segment declared by IPv4 Prefix with Local Interface ID"; 1071 leaf ipv4-address { 1072 type inet:ipv4-address; 1073 description "Node IPv4 address"; 1074 } 1075 leaf interface-identifier { 1076 type uint32; 1077 description "local interface identifier"; 1078 } 1079 } 1080 container segment-type-6 { 1081 description 1082 "Segment declared by IPv4 Addresses for link endpoints 1083 as Local, Remote pair"; 1084 leaf local-ipv4-address { 1085 type inet:ipv4-address; 1086 description "Segment local IPv4 adjacency address"; 1087 } 1088 leaf remote-ipv4-address { 1089 type inet:ipv4-address; 1090 description "Segment remote IPv4 adjacency address"; 1091 } 1092 } 1093 container segment-type-7 { 1094 description 1095 "Segment declared by IPv6 Prefix and Interface ID for 1096 link endpoints as Local, Remote pair for SR-MPLS"; 1097 leaf local-ipv6-address { 1098 type inet:ipv6-address; 1099 description "Local link IPv6 address"; 1100 } 1101 leaf local-interface-identifier { 1102 type uint32; 1103 description "Local interface identifier"; 1104 } 1105 leaf remote-ipv6-address { 1106 type inet:ipv6-address; 1107 description "Remote link IPv6 address"; 1108 } 1109 leaf remote-interface-identifier { 1110 type uint32; 1111 description "Remote interface identifier"; 1112 } 1113 } 1114 container segment-type-8 { 1115 description 1116 "Segment declared by IPv6 Addresses for link endpoints as 1117 Local, Remote pair for SR-MPLS"; 1118 leaf local-ipv6-address { 1119 type inet:ipv6-address; 1120 description "Segment local IPv6 adjacency address"; 1121 } 1122 leaf remote-ipv6-address { 1123 type inet:ipv6-address; 1124 description "Segment remote IPv6 adjacency address"; 1125 } 1126 } 1127 container segment-type-9 { 1128 description 1129 "Segment declared by IPv6 Global Prefix with optional 1130 SR Algorithm for SRv6"; 1131 leaf ipv6-address { 1132 type inet:ipv6-address; 1133 description "Segment IPv6 prefix"; 1134 } 1135 leaf algorithm { 1136 type uint8; 1137 description "Prefix SID algorithm identifier"; 1138 } 1139 } 1140 container segment-type-10 { 1141 description 1142 "Segment declared by IPv6 Prefix and Interface ID for 1143 link endpoints as Local, Remote pair for SRv6"; 1144 leaf local-ipv6-address { 1145 type inet:ipv6-address; 1146 description "Local link IPv6 address"; 1147 } 1148 leaf local-interface-identifier { 1149 type uint32; 1150 description "Local interface identifier"; 1151 } 1152 leaf remote-ipv6-address { 1153 type inet:ipv6-address; 1154 description "Remote link IPv6 address"; 1155 } 1156 leaf remote-interface-identifier { 1157 type uint32; 1158 description "Remote interface identifier"; 1159 } 1160 } 1161 container segment-type-11 { 1162 description 1163 "Segment declared by IPv6 Addresses for link endpoints as 1164 Local, Remote pair for SRv6"; 1165 leaf local-ipv6-address { 1166 type inet:ipv6-address; 1167 description "Segment local IPv6 adjacency address"; 1168 } 1169 leaf remote-ipv6-address { 1170 type inet:ipv6-address; 1171 description "Segment remote IPv6 adjacency address"; 1172 } 1173 } 1174 } 1175 leaf validate { 1176 type boolean; 1177 default 'false'; 1178 description "Indicates whether the segment should be validated. The default 1179 applies to all segments other than the first segment. For the 1180 first segment, validation is always done."; 1181 } 1182 } 1184 grouping segment-properties { 1185 description 1186 "SR segment properties grouping"; 1187 uses segment_config; 1188 } 1190 grouping policy-attributes { 1191 description 1192 "Grouping containing attributes applicable to all SR policies"; 1194 container policy-attributes { 1195 description 1196 "Attributes applicable to all SR policies"; 1198 uses segment-lists; 1200 uses explicit-binding-sid-rules; 1201 } 1202 } 1204 grouping segment-lists { 1205 description 1206 "Segment lists grouping"; 1207 container segment-lists { 1208 description "Segment-lists properties"; 1210 list segment-list { 1211 key "name"; 1212 description "Segment-list properties"; 1213 leaf name { 1214 type string; 1215 description "Segment-list name"; 1216 } 1217 container segments { 1218 description 1219 "Segments for given segment list"; 1221 list segment { 1222 key "index"; 1223 description "Configure Segment/hop at the index"; 1224 uses segment-properties; 1225 } 1226 } 1227 } 1228 } 1229 } 1231 grouping binding-sid_config { 1232 description 1233 "Binding SID configuration properties grouping"; 1234 leaf dataplane { 1235 type sr-policy-types:dataplane-type; 1236 description "Binding SID dataplane type"; 1237 } 1238 leaf value { 1239 type sr-policy-types:sid-value-type; 1240 description "Binding SID value"; 1241 } 1242 } 1244 grouping forwarding-counters { 1245 description 1246 "Grouping for counters"; 1247 container counters { 1248 config false; 1249 description 1250 "Counters containing stats related to forwarding"; 1252 leaf pkts { 1253 type yang:counter64; 1254 description "Number of packets forwarded"; 1255 } 1256 leaf octets { 1257 type yang:counter64; 1258 units "byte"; 1259 description "Number of bytes forwarded"; 1260 } 1261 } 1262 } 1264 grouping binding-sid_state { 1265 description 1266 "Binding SID state properties grouping"; 1267 leaf alloc-mode { 1268 type sr-policy-types:binding-sid-alloc-mode; 1269 config false; 1270 description "Binding SID type"; 1271 } 1272 leaf allocated-sid { 1273 type sr-policy-types:sid-value-type; 1274 config false; 1275 description "Allocated SID value for the Binding SID"; 1276 } 1277 leaf oper-state { 1278 type sr-policy-types:binding-sid-oper-state; 1279 config false; 1280 description 1281 "Binding SID operational state"; 1282 } 1283 } 1285 grouping binding-sid-properties { 1286 description 1287 "Binding SID properties grouping"; 1288 container binding-sid { 1289 description "Binding Segment ID"; 1290 uses binding-sid_config; 1291 uses binding-sid_state; 1292 } 1293 } 1295 grouping mpls-label-stack { 1296 description 1297 "Grouping for MPLS label stack"; 1299 list labels { 1300 key "label"; 1301 description 1302 "Stack containing MPLS labels"; 1304 leaf label { 1305 type rt-types:mpls-label; 1306 description 1307 "MPLS label value"; 1308 } 1309 } 1310 } 1312 grouping srv6-sid-stack { 1313 description 1314 "Grouping for SRv6 label stack"; 1316 list sids { 1317 key "sid"; 1318 description 1319 "Stack containing SRv6 SIDs"; 1321 leaf sid { 1322 type srv6-types:srv6-sid; 1323 description 1324 "SRv6 sid value"; 1325 } 1326 } 1327 } 1329 grouping path-forwarding_state { 1330 description "Policy Forwarding path information"; 1331 leaf path-id { 1332 type uint8; 1333 description "Primary path id"; 1334 } 1335 leaf next-hop-address { 1336 type inet:ip-address; 1337 description "Nexthop address"; 1338 } 1339 leaf next-hop-table-id { 1340 type uint32; 1341 description "Table ID for nexthop address"; 1342 } 1343 leaf outgoing-interface { 1344 type if:interface-ref; 1345 description "Outgoing interface handle"; 1346 } 1347 container outgoing-sids { 1348 description 1349 "Outgoing sid stack"; 1350 choice dataplanetype { 1351 description 1352 "Outgoing sids dataplane choice"; 1353 case mpls { 1354 uses mpls-label-stack; 1355 } 1356 case srv6 { 1357 uses srv6-sid-stack; 1358 } 1359 } 1360 } 1361 leaf is-protected { 1362 type boolean; 1363 description "Is this path protected ?"; 1364 } 1365 leaf is-pure-backup { 1366 type boolean; 1367 description "Is this path a pure backup ?"; 1368 } 1369 leaf backup-path-id { 1370 type uint8; 1371 description "Backup path id"; 1372 } 1373 leaf weight { 1374 type uint32; 1375 description "Path's weight for W-ECMP balancing"; 1376 } 1377 } 1379 grouping explicit-path-properties { 1380 description 1381 "Explicit path properties of the candidate path"; 1382 container segment-lists { 1383 description 1384 "Path segment list(s) properties"; 1385 list segment-list { 1386 key "name-ref"; 1387 description "SR policy candidate path segment lists"; 1389 leaf name-ref { 1390 type leafref { 1391 path "/rt:routing/ietf-sr-policy:segment-routing/ietf-sr-policy:sr-policy/ietf-sr-policy:policy-attributes/ietf-sr-policy:segment-lists/ietf-sr-policy:segment-list/ietf-sr-policy:name"; 1392 } 1393 description "Reference to segment-list name"; 1394 } 1395 leaf weight { 1396 type uint32; 1397 description "Segment-list weighted loadshare"; 1398 } 1399 leaf is-valid { 1400 type boolean; 1401 config false; 1402 description 1403 "True if the segment-list is valid, False otherwise"; 1404 } 1405 container forwarding-paths { 1406 config false; 1407 description 1408 "Forwarding state of paths"; 1409 list forwarding-path { 1410 key "path-id"; 1411 description "Forwarding path"; 1412 uses path-forwarding_state; 1413 } 1414 } 1415 } 1416 } 1417 } 1419 grouping dynamic-path-properties { 1420 description 1421 "Dynamic path properties of the candidate path"; 1422 leaf sid-dataplane-type { 1423 type sr-policy-types:dataplane-type; 1424 description 1425 "The dataplane type for the sid"; 1426 } 1427 leaf is-valid { 1428 type boolean; 1429 config false; 1430 description 1431 "True if the segment-list is valid, False otherwise"; 1432 } 1433 container forwarding-paths { 1434 config false; 1435 description 1436 "Forwarding state of paths"; 1437 list forwarding-path { 1438 key "path-id"; 1439 description "Forwarding path"; 1440 uses path-forwarding_state; 1441 } 1442 } 1443 } 1445 grouping candidate-path_state { 1446 description 1447 "Candidate path state properties grouping"; 1448 leaf is-best-candidate-path { 1449 type boolean; 1450 default 'false'; 1451 config false; 1452 description 1453 "True if the candidate path is the best candidate path, False otherwise"; 1454 } 1455 leaf non-selection-reason { 1456 type identityref { 1457 base sr-policy-types:candidate-path-not-selected-reason; 1458 } 1459 config false; 1460 description 1461 "Candidate path not selected reason"; 1462 } 1463 } 1465 grouping policy-properties_config { 1466 description 1467 "SR policy configuration grouping"; 1468 leaf name { 1469 type string { 1470 length "1..59"; 1471 } 1472 description "SR policy name"; 1473 } 1474 leaf color { 1475 type uint32 { 1476 range "1..4294967295"; 1477 } 1478 description "Color associated with the policy"; 1480 } 1481 leaf endpoint { 1482 type inet:ip-address; 1483 description "Policy end point IP address"; 1484 } 1485 leaf description { 1486 type string; 1487 description "Description of the policy"; 1488 } 1489 leaf admin-state { 1490 type sr-policy-types:policy-admin-state; 1491 default 'UP'; 1492 description 1493 "SR policy administrative state, true for 1494 enabled, false for disabled"; 1495 } 1496 } 1498 grouping policy-properties_state { 1499 description 1500 "SR policy property grouping"; 1501 leaf oper-state { 1502 type sr-policy-types:policy-oper-state; 1503 config false; 1504 description 1505 "SR policy operational state"; 1506 } 1507 leaf transition-count { 1508 type uint32; 1509 config false; 1510 description "Indicates number of up/down transitions"; 1511 } 1512 leaf up-time { 1513 type yang:date-and-time; 1514 config false; 1515 description "Policy up time in seconds"; 1516 } 1517 leaf down-time { 1518 type yang:date-and-time; 1519 config false; 1520 description "Policy down time in seconds"; 1521 } 1522 } 1524 grouping policy-properties { 1525 description 1526 "SR policy properties"; 1527 uses policy-properties_state; 1528 uses binding-sid-properties; 1529 uses forwarding-counters; 1530 } 1532 grouping candidate-path-type { 1533 description "Candidate path type grouping"; 1534 choice type { 1535 description 1536 "Type of candidate paths"; 1537 case explicit { 1538 description "Candidate path with explicitly defined set/s of segment-lists"; 1539 uses explicit-path-properties; 1540 } 1541 case dynamic { 1542 description "Candidate path with dynamic computed segment-lists"; 1543 uses dynamic-path-properties; 1544 } 1545 } 1546 } 1548 grouping candidate-paths { 1549 description "SR policy candidate path grouping"; 1550 container candidate-paths { 1551 description "SR policy candidate path(s) "; 1553 list candidate-path { 1554 key "protocol-origin originator discriminator"; 1555 description "SR policy Candidate path(s) list entry"; 1557 leaf protocol-origin { 1558 type sr-policy-types:protocol-origin-type; 1559 description 1560 "Instantiation mechanism used to create the candidate path"; 1561 } 1562 leaf originator { 1563 type string; 1564 description 1565 "Identifier (concatenation of ASN and node-address) of the node 1566 that signalled/instantiated the candidate path on headend"; 1567 } 1568 leaf discriminator { 1569 type uint32; 1570 description "Candidate path distinguisher"; 1571 } 1572 leaf name { 1573 type string; 1574 description "Candidate path name"; 1575 } 1576 leaf preference { 1577 type uint32 { 1578 range "1..65535"; 1579 } 1580 description "Candidate path preference"; 1581 } 1582 leaf description { 1583 type string; 1584 description "Candidate path description"; 1585 } 1586 container binding-sid { 1587 if-feature capability-candidate-path-binding-sid; 1588 description 1589 "Binding segment ID"; 1590 uses binding-sid_config; 1591 } 1592 uses candidate-path_state; 1593 uses candidate-path-type; 1594 } 1595 } 1596 } 1598 grouping policies { 1599 description "SR policy grouping"; 1600 container policies { 1601 description "SR Policy container"; 1603 list policy { 1604 key "color endpoint"; 1605 unique "name"; 1606 description "SR Policy properties"; 1608 leaf color { 1609 type uint32 { 1610 range "1..4294967295"; 1611 } 1612 description "Color associated with the policy"; 1613 } 1614 leaf endpoint { 1615 type inet:ip-address; 1616 description "Policy end point IP address"; 1617 } 1618 leaf name { 1619 type string { 1620 length "1..59"; 1621 } 1622 description "SR policy name"; 1623 } 1624 leaf description { 1625 type string; 1626 description "Description of the policy"; 1627 } 1628 leaf admin-state { 1629 type sr-policy-types:policy-admin-state; 1630 default 'UP'; 1631 description 1632 "SR policy administrative state, true for 1633 enabled, false for disabled"; 1634 } 1635 leaf priority { 1636 type uint8; 1637 default 128; 1638 description "Priority considered when policy is recomputed due to topology changes"; 1639 } 1641 uses policy-properties; 1643 uses candidate-paths; 1644 } 1645 } 1646 } 1648 grouping explicit-binding-sid-rules { 1649 description 1650 "Grouping for explicit binding sid rules"; 1652 list explicit-binding-sid-rules { 1653 key "index"; 1654 description 1655 "Explicit binding sid rules applicable for all policies"; 1656 leaf index { 1657 type uint32; 1658 description "Explicit binding SID rules list index"; 1659 } 1660 leaf rule { 1661 type sr-policy-types:explicit-binding-sid-rule-type; 1662 description "Explicit binding sid rule"; 1663 } 1664 } 1665 } 1667 augment "/rt:routing" { 1668 description 1669 "This augments routing-instance configuration with segment-routing sr-policy."; 1670 container segment-routing { 1671 description "Main segment routing container"; 1672 container sr-policy { 1673 description "SR policy main container"; 1675 uses policy-attributes; 1677 uses policies; 1678 } 1679 } 1680 } 1682 /* Notifications */ 1684 notification sr-policy-oper-state-change-event { 1685 description 1686 "Notification event when the operational state of the SR policy changes"; 1688 leaf policy-name-ref { 1689 type leafref { 1690 path "/rt:routing/ietf-sr-policy:segment-routing/ietf-sr-policy:sr-policy/ietf-sr-policy:policies/ietf-sr-policy:policy/ietf-sr-policy:name"; 1691 } 1692 description "Reference to sr-policy name"; 1693 } 1695 leaf policy-color-ref { 1696 type leafref { 1697 path "/rt:routing/ietf-sr-policy:segment-routing/ietf-sr-policy:sr-policy/ietf-sr-policy:policies/ietf-sr-policy:policy/ietf-sr-policy:color"; 1698 } 1699 description "Reference to sr-policy color"; 1700 } 1702 leaf policy-endpoint-ref { 1703 type leafref { 1704 path "/rt:routing/ietf-sr-policy:segment-routing/ietf-sr-policy:sr-policy/ietf-sr-policy:policies/ietf-sr-policy:policy/ietf-sr-policy:endpoint"; 1705 } 1706 description "Reference to sr-policy endpoint"; 1707 } 1709 leaf policy-new-oper-state { 1710 type sr-policy-types:policy-oper-state; 1711 description "New operational state of the SR policy"; 1712 } 1714 leaf policy-down-reason { 1715 type identityref { 1716 base sr-policy-types:policy-down-reason; 1717 } 1718 description "Down reason if the SR policy's new operational state is down"; 1719 } 1721 } 1723 notification sr-policy-candidate-path-change-event { 1724 description 1725 "Notification event when candidate path changes for SR policy"; 1727 leaf policy-name-ref { 1728 type leafref { 1729 path "/rt:routing/ietf-sr-policy:segment-routing/ietf-sr-policy:sr-policy/ietf-sr-policy:policies/ietf-sr-policy:policy/ietf-sr-policy:name"; 1730 } 1731 description "Reference to sr-policy name"; 1732 } 1734 leaf policy-color-ref { 1735 type leafref { 1736 path "/rt:routing/ietf-sr-policy:segment-routing/ietf-sr-policy:sr-policy/ietf-sr-policy:policies/ietf-sr-policy:policy/ietf-sr-policy:color"; 1737 } 1738 description "Reference to sr-policy color"; 1739 } 1741 leaf policy-endpoint-ref { 1742 type leafref { 1743 path "/rt:routing/ietf-sr-policy:segment-routing/ietf-sr-policy:sr-policy/ietf-sr-policy:policies/ietf-sr-policy:policy/ietf-sr-policy:endpoint"; 1744 } 1745 description "Reference to sr-policy endpoint"; 1746 } 1748 leaf existing-preference { 1749 type uint32; 1750 description "Existing candidate path preference"; 1751 } 1753 leaf new-preference { 1754 type uint32; 1755 description "New candidate path preference"; 1756 } 1757 } 1759 notification sr-policy-binding-sid-unavailable-event { 1760 description 1761 "Notification event when the binding sid of sr-policy is unavailable"; 1763 leaf policy-name-ref { 1764 type leafref { 1765 path "/rt:routing/ietf-sr-policy:segment-routing/ietf-sr-policy:sr-policy/ietf-sr-policy:policies/ietf-sr-policy:policy/ietf-sr-policy:name"; 1766 } 1767 description "Reference to sr-policy name"; 1768 } 1769 leaf policy-color-ref { 1770 type leafref { 1771 path "/rt:routing/ietf-sr-policy:segment-routing/ietf-sr-policy:sr-policy/ietf-sr-policy:policies/ietf-sr-policy:policy/ietf-sr-policy:color"; 1772 } 1773 description "Reference to sr-policy color"; 1774 } 1776 leaf policy-endpoint-ref { 1777 type leafref { 1778 path "/rt:routing/ietf-sr-policy:segment-routing/ietf-sr-policy:sr-policy/ietf-sr-policy:policies/ietf-sr-policy:policy/ietf-sr-policy:endpoint"; 1779 } 1780 description "Reference to sr-policy endpoint"; 1781 } 1783 leaf policy-binding-sid-value-ref { 1784 type leafref { 1785 path "/rt:routing/ietf-sr-policy:segment-routing/ietf-sr-policy:sr-policy/ietf-sr-policy:policies/ietf-sr-policy:policy/ietf-sr-policy:binding-sid/ietf-sr-policy:value"; 1786 } 1787 description "Reference to sr-policy binding-sid value"; 1788 } 1790 leaf reason { 1791 type identityref { 1792 base sr-policy-types:binding-sid-unavailable-reason; 1793 } 1794 description 1795 "Reason why the binding sid is unavailable"; 1796 } 1797 } 1799 notification sr-policy-candidate-path-binding-sid-mismatch-event { 1800 description 1801 "Notification event when binding sid of requested candidate path 1802 is different from the binding sid of the existing candidate path"; 1804 leaf policy-color-ref { 1805 type leafref { 1806 path "/rt:routing/ietf-sr-policy:segment-routing/ietf-sr-policy:sr-policy/ietf-sr-policy:policies/ietf-sr-policy:policy/ietf-sr-policy:color"; 1807 } 1808 description "Reference to sr-policy color"; 1809 } 1811 leaf policy-endpoint-ref { 1812 type leafref { 1813 path "/rt:routing/ietf-sr-policy:segment-routing/ietf-sr-policy:sr-policy/ietf-sr-policy:policies/ietf-sr-policy:policy/ietf-sr-policy:endpoint"; 1814 } 1815 description "Reference to sr-policy endpoint"; 1816 } 1817 leaf existing-candidate-path-protocol-origin-ref { 1818 type leafref { 1819 path "/rt:routing/ietf-sr-policy:segment-routing/ietf-sr-policy:sr-policy/ietf-sr-policy:policies/ietf-sr-policy:policy/ietf-sr-policy:candidate-paths/ietf-sr-policy:candidate-path/ietf-sr-policy:protocol-origin"; 1820 } 1821 description "Reference to existing candidate path protocol origin"; 1822 } 1824 leaf existing-candidate-path-preference-ref { 1825 type leafref { 1826 path "/rt:routing/ietf-sr-policy:segment-routing/ietf-sr-policy:sr-policy/ietf-sr-policy:policies/ietf-sr-policy:policy/ietf-sr-policy:candidate-paths/ietf-sr-policy:candidate-path/ietf-sr-policy:preference"; 1827 } 1828 description "Reference to existing candidate path preference"; 1829 } 1831 leaf existing-candidate-path-binding-sid-dataplane-ref { 1832 type leafref { 1833 path "/rt:routing/ietf-sr-policy:segment-routing/ietf-sr-policy:sr-policy/ietf-sr-policy:policies/ietf-sr-policy:policy/ietf-sr-policy:candidate-paths/ietf-sr-policy:candidate-path/ietf-sr-policy:binding-sid/ietf-sr-policy:dataplane"; 1834 } 1835 description "Reference to existing candidate path binding sid dataplane type"; 1836 } 1838 leaf existing-candidate-path-binding-sid-value-ref { 1839 type leafref { 1840 path "/rt:routing/ietf-sr-policy:segment-routing/ietf-sr-policy:sr-policy/ietf-sr-policy:policies/ietf-sr-policy:policy/ietf-sr-policy:candidate-paths/ietf-sr-policy:candidate-path/ietf-sr-policy:binding-sid/ietf-sr-policy:value"; 1841 } 1842 description "Reference to existing candidate path binding sid value"; 1843 } 1845 leaf conflicting-candidate-path-protocol-origin { 1846 type uint8; 1847 description "Conflicting candidate path protocol origin"; 1848 } 1850 leaf conflicting-candidate-path-preference { 1851 type uint32; 1852 description "Conflicting candidate path preference"; 1853 } 1855 leaf conflicting-candidate-path-binding-sid-dataplane { 1856 type sr-policy-types:dataplane-type; 1857 description "Conflicting candidate path binding sid dataplane type"; 1858 } 1860 leaf conflicting-candidate-path-binding-sid-value { 1861 type sr-policy-types:sid-value-type; 1862 description "Conflicting candidate path binding sid value"; 1863 } 1864 } 1865 /* Features */ 1867 feature capability-candidate-path-binding-sid { 1868 description 1869 "This feature enables the capability of specifying binding-sid 1870 for a candidate path."; 1871 } 1872 } 1874 1876 Figure 6: ietf-sr-policy.yang 1878 7. Security Considerations 1880 The configuration, state, and notification data defined using YANG 1881 data models in this document are likely to be accessed via the 1882 protocols such as NETCONF [RFC6241] etc. 1884 Hence, YANG implementations MUST comply with the security 1885 requirements specified in section 15 of [RFC6020]. Additionally, 1886 NETCONF implementations MUST comply with the security requirements 1887 specified in sections 2.2, 2.3 and 9 of [RFC6241] as well as section 1888 3.7 of [RFC8341]. 1890 8. IANA Considerations 1892 This document requests the registration of the following URIs in the 1893 IETF "XML registry" [RFC3688]: 1895 +------------------------------------------------+------------+-----+ 1896 | URI | Registrant | XML | 1897 +------------------------------------------------+------------+-----+ 1898 | urn:ietf:params:xml:ns:yang:ietf-sr-policy- | The IESG | N/A | 1899 | types | | | 1900 | | | | 1901 | urn:ietf:params:xml:ns:yang:ietf-sr-policy | The IESG | N/A | 1902 +------------------------------------------------+------------+-----+ 1904 This document requests the registration of the following YANG modules 1905 in the "YANG Module Names" registry [RFC6020]: 1907 +--------------+------------------------------+------------+--------+ 1908 | Name | Namespace | Prefix | Refere | 1909 | | | | nce | 1910 +--------------+------------------------------+------------+--------+ 1911 | ietf-sr- | urn:ietf:params:xml:ns:yang | sr-policy- | This d | 1912 | policy-types | :ietf-sr-policy-types | types | ocumen | 1913 | | | | t | 1914 | | | | | 1915 | ietf-sr- | urn:ietf:params:xml:ns:yang | sr-policy | This d | 1916 | policy | :ietf-sr-policy | | ocumen | 1917 | | | | t | 1918 +--------------+------------------------------+------------+--------+ 1920 9. Acknowledgments 1922 The authors of this document/YANG model would like to acknowledge the 1923 contributions/reviews by Johnson Thomas, Clarence Filsfils, Siva 1924 Sivabalan, Tarek Saad, Kris Michielsen, Dhanendra Jain, Ketan 1925 Talaulikar, Bhupendra Yadav, and Bruno Decraene. 1927 10. References 1929 10.1. Normative References 1931 [I-D.ietf-spring-segment-routing-policy] 1932 Filsfils, C., Sivabalan, S., daniel.voyer@bell.ca, d., 1933 bogdanov@google.com, b., and P. Mattes, "Segment Routing 1934 Policy Architecture", draft-ietf-spring-segment-routing- 1935 policy-03 (work in progress), May 2019. 1937 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1938 Requirement Levels", BCP 14, RFC 2119, 1939 DOI 10.17487/RFC2119, March 1997, 1940 . 1942 [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, 1943 DOI 10.17487/RFC3688, January 2004, 1944 . 1946 [RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for 1947 the Network Configuration Protocol (NETCONF)", RFC 6020, 1948 DOI 10.17487/RFC6020, October 2010, 1949 . 1951 [RFC6241] Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed., 1952 and A. Bierman, Ed., "Network Configuration Protocol 1953 (NETCONF)", RFC 6241, DOI 10.17487/RFC6241, June 2011, 1954 . 1956 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 1957 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 1958 May 2017, . 1960 [RFC8341] Bierman, A. and M. Bjorklund, "Network Configuration 1961 Access Control Model", STD 91, RFC 8341, 1962 DOI 10.17487/RFC8341, March 2018, 1963 . 1965 [RFC8342] Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K., 1966 and R. Wilton, "Network Management Datastore Architecture 1967 (NMDA)", RFC 8342, DOI 10.17487/RFC8342, March 2018, 1968 . 1970 [RFC8402] Filsfils, C., Ed., Previdi, S., Ed., Ginsberg, L., 1971 Decraene, B., Litkowski, S., and R. Shakir, "Segment 1972 Routing Architecture", RFC 8402, DOI 10.17487/RFC8402, 1973 July 2018, . 1975 [RFC8407] Bierman, A., "Guidelines for Authors and Reviewers of 1976 Documents Containing YANG Data Models", BCP 216, RFC 8407, 1977 DOI 10.17487/RFC8407, October 2018, 1978 . 1980 10.2. Informative References 1982 [I-D.ietf-idr-segment-routing-te-policy] 1983 Previdi, S., Filsfils, C., Jain, D., Mattes, P., Rosen, 1984 E., and S. Lin, "Advertising Segment Routing Policies in 1985 BGP", draft-ietf-idr-segment-routing-te-policy-06 (work in 1986 progress), May 2019. 1988 Authors' Addresses 1990 Kamran Raza (editor) 1991 Cisco Systems 1993 Email: skraza@cisco.com 1995 Robert Sawaya 1996 Cisco Systems 1998 Email: thjohns2@cisco.com 1999 Zhuang Shunwan 2000 Huawei Technologies 2002 Email: zhuangshunwa@huawei.com 2004 Daniel Voyer 2005 Bell Canada 2007 Email: daniel.voyer@bell.ca 2009 Muhammad Durrani 2010 Equinix 2012 Email: mdurrani@equinix.com 2014 Satoru Matsushima 2015 SoftBank 2017 Email: satoru.matsushima@g.softbank.co.jp