idnits 2.17.1 draft-thomas-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: ---------------------------------------------------------------------------- No issues found here. 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. ** There is 1 instance of lines with control characters in the document. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Line 339 has weird spacing: '...w index uin...' == Line 472 has weird spacing: '...o label rt-...' == Line 475 has weird spacing: '...-ro sid srv...' == Line 492 has weird spacing: '...o label rt-...' == Line 495 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. (The document does seem to have the reference to RFC 2119 which the ID-Checklist requires). -- The document date (July 1, 2018) is 2119 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) == Unused Reference: 'RFC2119' is defined on line 1955, but no explicit reference was found in the text == Outdated reference: A later version (-22) exists of draft-ietf-spring-segment-routing-policy-01 ** Obsolete normative reference: RFC 6536 (Obsoleted by RFC 8341) == Outdated reference: A later version (-26) exists of draft-ietf-idr-segment-routing-te-policy-03 Summary: 3 errors (**), 0 flaws (~~), 10 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 1 SPRING Working Group J. Thomas 2 Internet-Draft K. Raza, Ed. 3 Intended status: Standards Track Cisco Systems, Inc. 4 Expires: January 2, 2019 5 Z. Shunwan 6 Huawei Technologies 8 D. Voyer 9 Bell Canada 11 M. Durrani 12 Equinix 14 S. Matsushima 15 SoftBank 17 July 1, 2018 19 YANG Data Model for Segment Routing Policy 20 draft-thomas-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 January 2, 2019. 46 Copyright Notice 48 Copyright (c) 2018 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. Building Blocks . . . . . . . . . . . . . . . . . . . . . . . 3 65 3. YANG Model . . . . . . . . . . . . . . . . . . . . . . . . . 4 66 3.1. Types and Definitions . . . . . . . . . . . . . . . . . . 4 67 3.2. SR Policy . . . . . . . . . . . . . . . . . . . . . . . . 5 68 3.2.1. Configuration . . . . . . . . . . . . . . . . . . . . 5 69 3.2.2. State . . . . . . . . . . . . . . . . . . . . . . . . 9 70 3.2.3. Notification . . . . . . . . . . . . . . . . . . . . 11 71 4. Pending Items . . . . . . . . . . . . . . . . . . . . . . . . 12 72 5. YANG Specification . . . . . . . . . . . . . . . . . . . . . 13 73 5.1. Types . . . . . . . . . . . . . . . . . . . . . . . . . . 13 74 5.2. SR Policy . . . . . . . . . . . . . . . . . . . . . . . . 20 75 6. Security Considerations . . . . . . . . . . . . . . . . . . . 40 76 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 40 77 8. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 41 78 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 41 79 9.1. Normative References . . . . . . . . . . . . . . . . . . 41 80 9.2. Informative References . . . . . . . . . . . . . . . . . 42 81 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 42 83 1. Introduction 85 The Network Configuration Protocol (NETCONF) [RFC6241] defines 86 mechanisms to manage network devices. YANG [RFC6020] is a modular 87 language that represents data structures in an XML tree format, and 88 is used as a data modeling language for the NETCONF. 90 Segment Routing (SR), as defined in 91 [I-D.ietf-spring-segment-routing], allows a headend node to steer a 92 packet flow along any topological path and/or service chain. The 93 headend node is said to steer a flow into a Segment Routing Policy 94 (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. Building Blocks 122 Before looking into the YANG model for SR policy, it is important to 123 recall and highlight the major building blocks and constructs that 124 constitute and contribute to an SR policy, as described in 125 [I-D.ietf-spring-segment-routing-policy]. 127 o policy: specifies constructs to allow a headend node to setup SR 128 path(s) as an ordered list of segments for a given color and 129 endpoint. The endpoint and the color are used to automate the 130 steering of service or transport routes on an SR Policy. For a 131 given headend, the key for an SR policy is (color, endpoint) where 132 endpoint is an IP address that could be also NULL. 134 o candidate-path: is the unit for signalling of an SR Policy to a 135 headend via protocols (such as PCEP, BGP, CLI etc.). A candidate 136 path is either dynamic or explicit type, where an explicit 137 candidate path is associated with one or more segment-lists and 138 dynamic candidate path expresses optimization objectives and set 139 of constraints. An SR Policy is associated with one or more 140 candidate paths and the preference of the candidate path is used 141 to select the best candidate path for an SR Policy. A candidate 142 path is valid if it is usable (e.g. when its constituents SIDs are 143 reachable). An "active" candidate path is the selected path (for 144 forwarding) that is valid and determined to be the best path of 145 the SR Policy. 147 o segment-list: specifies ordered list of segments to traverse, 148 where a segment can be specified in various forms (refer section 4 149 of [I-D.ietf-spring-segment-routing-policy]). The list is sorted 150 by the index of the segment. A segment-list is used and referred 151 by an explicit type of candidate-path. 153 o binding-sid: An SR policy is associated with a BSID to provide 154 benefits of scaling, network opacity and service independence. 156 3. YANG Model 158 The modeling in this document complies with the Network Management 159 Datastore Architecture (NMDA) [I-D.ietf-netmod-revised-datastores]. 160 The operational state data is combined with the associated 161 configuration data in the same hierarchy 162 [I-D.ietf-netmod-rfc6087bis]. When protocol states are retrieved 163 from the NMDA operational state datastore, the returned states cover 164 all "config true" (rw) and "config false" (ro) nodes defined in the 165 schema. 167 For SR policy YANG specification, this document defines following new 168 YANG modules: 170 +----------------------+--------------------------------------------+ 171 | Module Name | Purpose | 172 +----------------------+--------------------------------------------+ 173 | ietf-sr-policy-types | defines common and basic types related to | 174 | | an SR policy and related constructs | 175 | | | 176 | ietf-sr-policy | defines the model for SR policy | 177 | | instantiation, configuration, and | 178 | | management | 179 +----------------------+--------------------------------------------+ 181 3.1. Types and Definitions 183 SR policy common types and definitions are defined in the new module 184 "ietf-sr-policy-types". The main types defined in this module 185 include: 187 o dataplane-type: A union to specify MPLS or IPv6 as the dataplane 188 type for SR. 190 o sid-value-type: A Union to specify SID value for SR-MPLS or SRv6 191 type. 193 o binding-sid-alloc-mode: Enum to define explicit or dynamic alloc 194 mode types for a BSID. 196 o protocol-origin-type: Enum to specify protocol origin (e.g. PCEP) 197 for an SR policy. 199 o explicit-binding-sid-rule-type: Enum to specify BSID alloc 200 enforcement/rule when doing explicit alloc request. 202 o binding-sid-oper-state: An Enum representing various operational 203 states for a BSID. 205 o policy-admin-state: An Enum for admin state of an SR policy. 207 o policy-oper-state: An Enum for operational state of an SR policy. 209 o segment-type: An Enum that defines various types for a "segment" 210 of a Segment list. 212 o candidate-path-non-selection-reason: The base identity along with 213 its children to specify reason for not selecting a candidate path 214 as the best/active path. 216 o policy-down-reason: The base identity along with its children to 217 specify reason for a policy becoming (or remaining) operationally 218 down. 220 o binding-sid-unavailable-reason: The base identity along with its 221 children to specify reason for a BSID's unavailability. 223 The associated YANG specification for this module is captured in 224 Section 5.1. 226 3.2. SR Policy 228 The base SR policy model is captured in ietf-sr-policy module. This 229 base module augments "/rt:routing" and specifies the configuration, 230 operational state, executables/rpcs, and notification events required 231 to manage SR policies. 233 The associated YANG specification for this module is captured in 234 Section 5.2. 236 3.2.1. Configuration 238 In terms of configuration hierarchy, SR policy configuration tree has 239 following two main areas: 241 o policy-attributes: container that defines common constructs that 242 could be used across policies. An example of such a construct is 243 segment-lists definition. In future revision of this document, it 244 is expected that this container will have more constructs defined. 246 o policies: container that defines list of policies with their 247 attributes such as BSID, candidate-paths etc. 249 Following diagram depicts high level yang organization and hierarchy 250 for an SR policy specification: 252 segment-routing 253 sr-policy 254 + policy-attributes 255 | + segment-lists 256 | | segment-list* [name] 257 | | segments 258 | | segment* [index] 259 | | ... 260 | + explicit-binding-sid-rules 261 | ... 262 | 263 + policies 264 policy* [color endpoint] 265 + ... 266 | 267 + binding-sid 268 | ... 269 | 270 + candidate-paths 271 candidate-path* [protocol origin discrim] 272 + ... 273 | 274 + type 275 + dynamic 276 | ... 277 | 278 + explicit 279 segment-lists 280 segment-list* [ref] 281 ... 283 Figure 1: SR Policy - Hierarchy 285 Using the building blocks described in Section 2, following is the 286 complete graphical representation of the data model for SR policy 287 configuration: 289 module: ietf-sr-policy 290 augment /rt:routing: 291 +--rw segment-routing 292 +--rw sr-policy 293 +--rw policy-attributes 294 | +--rw segment-lists 295 | | +--rw segment-list* [name] 296 | | +--rw name string 297 | | +--rw segments 298 | | +--rw segment* [index] 299 | | +--rw index uint32 300 | | +--rw type? sr-policy-types:segment-type 301 | | +--rw segment-types 302 | | | +--rw segment-type-1 303 | | | | +--rw sid-value? rt-types:mpls-label 304 | | | +--rw segment-type-2 305 | | | | +--rw sid-value? srv6-types:srv6-sid 306 | | | +--rw segment-type-3 307 | | | | +--rw ipv4-address? inet:ipv4-address 308 | | | | +--rw algorithm? uint8 309 | | | +--rw segment-type-4 310 | | | | +--rw ipv4-address? inet:ipv6-address 311 | | | | +--rw algorithm? uint8 312 | | | +--rw segment-type-5 313 | | | | +--rw ipv4-address? inet:ipv4-address 314 | | | | +--rw interface-identifier? uint32 315 | | | +--rw segment-type-6 316 | | | | +--rw local-ipv4-address? inet:ipv4-address 317 | | | | +--rw remote-ipv4-address? inet:ipv4-address 318 | | | +--rw segment-type-7 319 | | | | +--rw local-ipv6-address? inet:ipv6-address 320 | | | | +--rw local-interface-identifier? uint32 321 | | | | +--rw remote-ipv6-address? inet:ipv6-address 322 | | | | +--rw remote-interface-identifier? uint32 323 | | | +--rw segment-type-8 324 | | | | +--rw local-ipv6-address? inet:ipv6-address 325 | | | | +--rw remote-ipv6-address? inet:ipv6-address 326 | | | +--rw segment-type-9 327 | | | | +--rw ipv6-address? inet:ipv6-address 328 | | | | +--rw algorithm? uint8 329 | | | +--rw segment-type-10 330 | | | | +--rw local-ipv6-address? inet:ipv6-address 331 | | | | +--rw local-interface-identifier? uint32 332 | | | | +--rw remote-ipv6-address? inet:ipv6-address 333 | | | | +--rw remote-interface-identifier? uint32 334 | | | +--rw segment-type-11 335 | | | +--rw local-ipv6-address? inet:ipv6-address 336 | | | +--rw remote-ipv6-address? inet:ipv6-address 337 | | +--rw validate? boolean 338 | +--rw explicit-binding-sid-rules* [index] 339 | +--rw index uint32 340 | +--rw rule? sr-policy-types:explicit-binding-sid-rule-type 341 +--rw policies 342 +--rw policy* [color endpoint] 343 +--rw color uint32 344 +--rw endpoint inet:ip-address 345 +--rw name? string 346 +--rw description? string 347 +--rw admin-state? sr-policy-types:policy-admin-state 348 +--rw priority? uint8 349 +--rw binding-sid 350 | +--rw dataplane? sr-policy-types:dataplane-type 351 | +--rw value? sr-policy-types:sid-value-type 352 +--rw candidate-paths 353 +--rw candidate-path* [protocol-origin originator discriminator] 354 +--rw protocol-origin sr-policy-types:protocol-origin-type 355 +--rw originator string 356 +--rw discriminator uint32 357 +--rw name? string 358 +--rw preference? uint32 359 +--rw description? string 360 +--rw binding-sid {capability-candidate-path-binding-sid}? 361 | +--rw dataplane? sr-policy-types:dataplane-type 362 | +--rw value? sr-policy-types:sid-value-type 363 +--rw (type)? 364 +--:(explicit) 365 | +--rw segment-lists 366 | +--rw segment-list* [name-ref] 367 | +--rw name-ref -> .. segment-list/name 368 | +--rw weight? uint32 369 +--:(dynamic) 370 +--rw sid-dataplane-type? sr-policy-types:dataplane-type 372 Figure 2: SR Policy - Config Tree 374 Please take note of the following important points in the above 375 configuration model: 377 o This model supports both MPLS and SRv6 dataplane for SR -- i.e. 378 items like segments and BSID can be defined as MPLS label or SRv6 379 SIDs. 381 o Specification of a segment supports all the types defined in SR 382 policy base specification document 384 o The above model supports explicit BSID specification on SR policy 385 level as the main mode of specification. The model also allows 386 explicit BSID per candidate-path as an if-feature capability that 387 is optional for implementations 389 o The above model will be extended in future revisions of this 390 document to enhance items like attribute and control related to 391 dynamic type of segment-list, candidate-path, and traffic steering 392 etc. 394 3.2.2. State 396 As per NMDA model, the state related to configuration items specified 397 in earlier Section 3.2.1 can be retrieved from the same tree. This 398 section defines the other operational state items related to SR 399 policy. 401 In addition to configured state, the operational state corresponding 402 to the SR policy includes: 404 o policy operational state 406 o policy up/down timestamps 408 o policy BSID info such as alloc mode, actual value in-use, 409 operational state, and forwarding stats 411 o Per candidate-path info such as: 413 * Whether candidate-path is the best candidate-path 415 * In case of non-best, the reason for such non-selection 417 * Type of candidate-path - explicit or dynamic 419 * Per segment-list information - such as validity of the segment- 420 list, as well as forwarding state for a valid segment-list. 421 The forwarding state is represented in terms of per forwarding 422 path info that includes nexthop address, outgoing interface, 423 protection information, and encapsulation (label stack or SRv6 424 SID stack) etc. 426 Following is a simplified graphical representation of the data model 427 for the SR policy operational state: 429 module: ietf-sr-policy 430 augment /rt:routing: 432 +--rw segment-routing 433 +--rw sr-policy 434 +--rw policies 435 +--rw policy* [color endpoint] 436 +--rw color uint32 437 +--rw endpoint inet:ip-address 438 +--ro oper-state? sr-policy-types:policy-oper-state 439 +--ro transition-count? uint32 440 +--ro up-time? yang:date-and-time 441 +--ro down-time? yang:date-and-time 442 +--rw binding-sid 443 | +--ro alloc-mode? sr-policy-types:binding-sid-alloc-mode 444 | +--ro allocated-sid? sr-policy-types:sid-value-type 445 | +--ro oper-state? sr-policy-types:binding-sid-oper-state 446 +--ro counters 447 | +--ro pkts? yang:counter64 448 | +--ro octets? yang:counter64 449 +--rw candidate-paths 450 +--rw candidate-path* [protocol-origin originator discriminator] 451 +--rw protocol-origin sr-policy-types:protocol-origin-type 452 +--rw originator string 453 +--rw discriminator uint32 454 +--ro is-best-candidate-path? boolean 455 +--ro non-selection-reason? identityref 456 +--rw (type)? 457 +--:(explicit) 458 | +--rw segment-lists 459 | +--rw segment-list* [name-ref] 460 | +--rw name-ref -> .. segment-list/name 461 | +--ro is-valid? boolean 462 | +--ro forwarding-paths 463 | +--ro forwarding-path* [path-id] 464 | +--ro path-id uint8 465 | +--ro next-hop-address? inet:ip-address 466 | +--ro next-hop-table-id? uint32 467 | +--ro outgoing-interface? if:interface-ref 468 | +--ro outgoing-sids 469 | | +--ro (dataplanetype)? 470 | | +--:(mpls) 471 | | | +--ro labels* [label] 472 | | | +--ro label rt-types:mpls-label 473 | | +--:(srv6) 474 | | +--ro sids* [sid] 475 | | +--ro sid srv6-types:srv6-sid 476 | +--ro is-protected? boolean 477 | +--ro is-pure-backup? boolean 478 | +--ro backup-path-id? uint8 479 | +--ro weight? uint32 480 +--:(dynamic) 481 +--ro is-valid? boolean 482 +--ro forwarding-paths 483 +--ro forwarding-path* [path-id] 484 +--ro path-id uint8 485 +--ro next-hop-address? inet:ip-address 486 +--ro next-hop-table-id? uint32 487 +--ro outgoing-interface? if:interface-ref 488 +--ro outgoing-sids 489 | +--ro (dataplanetype)? 490 | +--:(mpls) 491 | | +--ro labels* [label] 492 | | +--ro label rt-types:mpls-label 493 | +--:(srv6) 494 | +--ro sids* [sid] 495 | +--ro sid srv6-types:srv6-sid 496 +--ro is-protected? boolean 497 +--ro is-pure-backup? boolean 498 +--ro backup-path-id? uint8 499 +--ro weight? uint32 501 Figure 3: SR Policy - State Tree 503 3.2.3. Notification 505 This model defines a list of notifications to inform an operator of 506 important events detected regarding an SR policy. These events 507 include events related to: 509 o policy status: policy operational state changes 511 o Candidate-path active status and changes 513 o Explicit Binding SID collision/unavailability events 515 Following is a simplified graphical representation of the data model 516 for SR policy notifications: 518 module: ietf-sr-policy 519 notifications: 520 +---n sr-policy-oper-state-change-event 521 | +--ro policy-name-ref? -> .. policy/name 522 | +--ro policy-color-ref? -> .. policy/color 523 | +--ro policy-endpoint-ref? -> .. policy/endpoint 524 | +--ro policy-new-oper-state? sr-policy-types:policy-oper-state 525 | +--ro policy-down-reason? identityref 526 +---n sr-policy-candidate-path-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 existing-preference? uint32 531 | +--ro new-preference? uint32 532 +---n sr-policy-binding-sid-unavailable-event 533 | +--ro policy-name-ref? -> .. policy/name 534 | +--ro policy-color-ref? -> .. policy/color 535 | +--ro policy-endpoint-ref? -> .. policy/endpoint 536 | +--ro policy-binding-sid-value-ref? -> .. policy/binding-sid/value 537 | +--ro reason? identityref 538 +---n sr-policy-candidate-path-binding-sid-mismatch-event 539 +--ro policy-color-ref? -> .. policy/color 540 +--ro policy-endpoint-ref? -> .. policy/endpoint 541 +--ro existing-candidate-path-protocol-origin-ref? -> .. candidate-path/protocol-origin 542 +--ro existing-candidate-path-preference-ref? -> .. candidate-path/preference 543 +--ro existing-candidate-path-binding-sid-dataplane-ref? -> .. candidate-path/binding-sid/dataplane 544 +--ro existing-candidate-path-binding-sid-value-ref? -> .. candidate-path/binding-sid/value 545 +--ro conflicting-candidate-path-protocol-origin? uint8 546 +--ro conflicting-candidate-path-preference? uint32 547 +--ro conflicting-candidate-path-binding-sid-dataplane? sr-policy-types:dataplane-type 548 +--ro conflicting-candidate-path-binding-sid-value? sr-policy-types:sid-value-type 550 Figure 4: SR Policy - Notification Tree 552 4. Pending Items 554 Following are the items that will be addressed in future revisions of 555 this document: 557 o Configuration and Specification of: 559 * Link Attributes 561 * Dynamic type of candidate-path (optimization objectives and 562 constraints) 564 * Traffic steering over SR policy 565 * ODN templates 567 * Spray policy 569 o Executables (RPC actions) 571 5. YANG Specification 573 Following are actual YANG definition for the modules defined earlier 574 in the document. 576 5.1. Types 578 file "ietf-sr-policy-types@2018-07-01.yang" --> 580 module ietf-sr-policy-types { 581 namespace "urn:ietf:params:xml:ns:yang:ietf-sr-policy-types"; 583 prefix "ietf-sr-policy-types"; 585 import ietf-routing-types { 586 prefix "rt-types"; 587 } 589 import ietf-srv6-types { 590 prefix "srv6-types"; 591 } 593 organization "IETF SPRING Working Group"; 595 contact 596 "WG Web: 597 WG List: 599 Editor: Johnson Thomas 600 602 Editor: Kamran Raza 603 605 Editor: Zhuang Shunwan 606 608 Editor: Daniel Voyer 609 611 Editor: Muhammad Durrani 612 614 Editor: Satoru Matsushima 615 616 "; 618 description 619 "This YANG module defines the essential types for the management 620 of SR policy module. 622 Copyright (c) 2018 IETF Trust and the persons identified as 623 authors of the code. All rights reserved. 625 Redistribution and use in source and binary forms, with or 626 without modification, is permitted pursuant to, and subject 627 to the license terms contained in, the Simplified BSD License 628 set forth in Section 4.c of the IETF Trust's Legal Provisions 629 Relating to IETF Documents 630 (http://trustee.ietf.org/license-info)."; 632 revision "2018-07-01" { 633 description 634 "Initial version"; 635 reference 636 "draft-ietf-spring-segment-routing-policy"; 637 } 639 /* Identities */ 640 identity candidate-path-not-selected-reason { 641 description 642 "Base identity for which reasons for not selecting 643 candidate path are derived from"; 644 } 645 identity candidate-path-not-selected-not-best { 646 base candidate-path-not-selected-reason; 647 description 648 "Higher preference path exists"; 649 } 650 identity candidate-path-not-selected-no-valid-segment-list { 651 base candidate-path-not-selected-reason; 652 description 653 "Candidate path has no valid segment list(s)"; 654 } 655 identity candidate-path-not-selected-empty-segment-list { 656 base candidate-path-not-selected-reason; 657 description 658 "Candidate path has empty segment list(s)"; 659 } 660 identity candidate-path-not-selected-invalid-binding-sid { 661 base candidate-path-not-selected-reason; 662 description 663 "Candidate path has invalid binding SID"; 664 } 666 identity policy-down-reason { 667 description 668 "Base identity for the reasons why SR policy is operationally down"; 669 } 670 identity policy-down-reason-admin-down { 671 base policy-down-reason; 672 description "Policy is administrately down"; 673 } 674 identity policy-down-reason-no-source-address { 675 base policy-down-reason; 676 description "Policy has no source address"; 677 } 678 identity policy-down-reason-no-endpoint { 679 base policy-down-reason; 680 description "Policy has no end-point"; 681 } 682 identity policy-down-reason-no-candidate-path { 683 base policy-down-reason; 684 description "Policy has no candidate path"; 685 } 686 identity policy-down-reason-no-valid-candidate-path { 687 base policy-down-reason; 688 description "Policy has no valid candidate path"; 689 } 690 identity policy-down-reason-candidate-path-invalid-segment-list { 691 base policy-down-reason; 692 description "Policy's candidate path has invalid segment list"; 693 } 694 identity policy-down-reason-policy-unconfigured { 695 base policy-down-reason; 696 description "Policy is unconfigured"; 697 } 698 identity policy-down-reason-policy-color-endpoint-updated { 699 base policy-down-reason; 700 description "Policy's color and end-point are updated"; 701 } 702 identity policy-down-reason-local-label-setup-failed { 703 base policy-down-reason; 704 description "Policy's local label setup (allocation/rewrite) failed"; 705 } 706 identity policy-down-reason-forwarding-rewrite-failed { 707 base policy-down-reason; 708 description "Policy's forwarding rewrite installation failed"; 709 } 710 identity policy-down-reason-internal-error { 711 base policy-down-reason; 712 description "Infra related internal error"; 713 } 715 identity binding-sid-unavailable-reason { 716 description 717 "Base identity for binding sid unavailable reason types"; 718 } 719 identity binding-sid-allocation-error { 720 base binding-sid-unavailable-reason; 721 description "SID allocator returned an error"; 722 } 723 identity binding-sid-already-exists { 724 base binding-sid-unavailable-reason; 725 description "Binding sid already exists/allocated"; 726 } 727 identity binding-sid-internal-error { 728 base binding-sid-unavailable-reason; 729 description "Internal error with binding sid allocation"; 730 } 731 identity binding-sid-color-endpoint-conflict { 732 base binding-sid-unavailable-reason; 733 description "Binding sid already allocated by another sr-policy with different color/endpoint"; 734 } 735 identity binding-sid-rewrite-error { 736 base binding-sid-unavailable-reason; 737 description "Binding sid forwarding rewrite error"; 738 } 739 identity binding-sid-outside-srlb-range { 740 base binding-sid-unavailable-reason; 741 description "Binding sid outside SRLB range"; 742 } 744 /* Typdefs */ 745 typedef sid-value-type { 746 type union { 747 type rt-types:mpls-label; 748 type srv6-types:srv6-sid; 749 } 750 description "The SID value type"; 751 } 752 typedef binding-sid-oper-state { 753 type enumeration { 754 enum ALLOC-PENDING { 755 value 1; 756 description "SID allocation pending for Binding SID"; 757 } 758 enum PROGRAMMED { 759 value 3; 760 description "Binding SID is programmed in forwarding"; 761 } 762 enum CONFLICT { 763 value 4; 764 description "Binding SID is in-conflict state with 765 regards to SID allocation. This also means that SID 766 allocation is pending"; 767 } 768 } 769 description 770 "Binding SID operational state type"; 771 } 773 typedef policy-admin-state { 774 type enumeration { 775 enum UP { 776 value 1; 777 description "SR policy is administratively up"; 778 } 779 enum DOWN { 780 value 2; 781 description "SR policy is administratively down"; 782 } 783 } 784 description "SR policy admin state"; 785 } 787 typedef policy-oper-state { 788 type enumeration { 789 enum UP { 790 value 1; 791 description "SR policy is operationally up"; 792 } 793 enum DOWN { 794 value 2; 795 description "SR policy is operationally down"; 796 } 797 } 798 description "SR policy oper state"; 799 } 800 typedef segment-type { 801 type enumeration { 802 enum segment-type-1 { 803 value 1; 804 description "SR-MPLS Label"; 805 } 806 enum segment-type-2 { 807 value 2; 808 description "SRv6 SID"; 809 } 810 enum segment-type-3 { 811 value 3; 812 description "IPv4 Prefix with optional SR Algorithm"; 813 } 814 enum segment-type-4 { 815 value 4; 816 description "IPv6 Global Prefix with optional SR Algorithm for SR-MPLS"; 817 } 818 enum segment-type-5 { 819 value 5; 820 description "IPv4 Prefix with Local Interface ID"; 821 } 822 enum segment-type-6 { 823 value 6; 824 description "IPv4 Addresses for link endpoints as Local, Remote pair"; 825 } 826 enum segment-type-7 { 827 value 7; 828 description "IPv6 Prefix and Interface ID for link endpoints as Local, 829 Remote pair for SR-MPLS"; 830 } 831 enum segment-type-8 { 832 value 8; 833 description "IPv6 Addresses for link endpoints as Local, Remote pair for 834 SR-MPLS"; 835 } 836 enum segment-type-9 { 837 value 9; 838 description "IPv6 Global Prefix with optional SR Algorithm for SRv6"; 839 } 840 enum segment-type-10 { 841 value 10; 842 description "IPv6 Prefix and Interface ID for link endpoints as Local, 843 Remote pair for SRv6"; 844 } 845 enum segment-type-11 { 846 value 11; 847 description "IPv6 Addresses for link endpoints as Local, Remote pair for 848 SRv6"; 849 } 850 } 851 description "SR segment type"; 852 } 854 typedef dataplane-type { 855 type enumeration { 856 enum mpls { 857 value 1; 858 description "Segment-routing MPLS"; 859 } 860 enum srv6 { 861 value 2; 862 description "Segment-routing v6"; 863 } 864 } 865 description "Dataplane type of the segments"; 866 } 868 typedef binding-sid-alloc-mode { 869 type enumeration { 870 enum explicit { 871 value 1; 872 description "Explicitly specified BSID"; 873 } 874 enum dynamic { 875 value 2; 876 description "Dynamically allocated BSID"; 877 } 878 } 879 description "binding SID allocation mode"; 880 } 882 typedef protocol-origin-type { 883 type enumeration { 884 enum pcep { 885 value 10; 886 description "PCEP used as signalling mechanism for the candidate path"; 887 } 888 enum bgp { 889 value 20; 890 description "BGP used as signalling mechanism for the candidate path"; 891 } 892 enum local { 893 value 30; 894 description "CLI, Yang model via Netconf, gRPC, etc used for candidate path instantiation"; 895 } 897 } 898 description "Originating Protocol type"; 899 } 901 typedef explicit-binding-sid-rule-type { 902 type enumeration { 903 enum enforce-srlb { 904 value 1; 905 description 906 "Explicit Binding SID is enforced with no 907 fallback if label does not fall in SRLB or 908 if no SRLB is configured"; 909 } 910 enum fallback-dynamic { 911 value 2; 912 description 913 "Explicit Binding SID falls back to dynamic in 914 case explicit label is not available."; 915 } 916 } 917 description "Explicit binding sid rule types"; 918 } 919 } 921 923 Figure 5: ietf-sr-policy-types.yang 925 5.2. SR Policy 927 file "ietf-sr-policy@2018-07-01.yang" --> 929 module ietf-sr-policy { 931 namespace "urn:ietf:params:xml:ns:yang:ietf-sr-policy"; 933 prefix "ietf-sr-policy"; 935 import ietf-inet-types { 936 prefix "inet"; 937 } 939 import ietf-interfaces { 940 prefix if; 941 } 942 import ietf-routing { 943 prefix "rt"; 944 } 946 import ietf-routing-types { 947 prefix "rt-types"; 948 } 950 import ietf-yang-types { 951 prefix "yang"; 952 } 954 import ietf-srv6-types { 955 prefix "srv6-types"; 956 } 958 import ietf-sr-policy-types { 959 prefix "sr-policy-types"; 960 } 962 organization "IETF SPRING Working Group"; 964 contact 965 "WG Web: 966 WG List: 968 Editor: Johnson Thomas 969 971 Editor: Kamran Raza 972 974 Editor: Zhuang Shunwan 975 977 Editor: Daniel Voyer 978 980 Editor: Muhammad Durrani 981 983 Editor: Satoru Matsushima 984 985 "; 987 description 988 "This module contains a collection of YANG definitions 989 for SR policy module. 991 Copyright (c) 2018 IETF Trust and the persons identified as 992 authors of the code. All rights reserved. 994 Redistribution and use in source and binary forms, with or 995 without modification, is permitted pursuant to, and subject 996 to the license terms contained in, the Simplified BSD License 997 set forth in Section 4.c of the IETF Trust's Legal Provisions 998 Relating to IETF Documents 999 (http://trustee.ietf.org/license-info)."; 1001 revision "2018-07-01" { 1002 description 1003 "Initial version"; 1004 reference 1005 "draft-ietf-spring-segment-routing-policy"; 1006 } 1008 grouping segment_config { 1009 description "Segment properties grouping"; 1010 leaf index { 1011 type uint32; 1012 description "Segment index"; 1013 } 1014 leaf type { 1015 type sr-policy-types:segment-type; 1016 description "Segment type"; 1017 } 1018 container segment-types { 1019 description "Types of segments"; 1020 container segment-type-1 { 1021 description 1022 "Segment declared by MPLS label"; 1023 leaf sid-value { 1024 type rt-types:mpls-label; 1025 description "MPLS label value"; 1026 } 1027 } 1028 container segment-type-2 { 1029 description 1030 "Segment declared by SRv6 SID value"; 1031 leaf sid-value { 1032 type srv6-types:srv6-sid; 1033 description "SRv6 SID value"; 1034 } 1035 } 1036 container segment-type-3 { 1037 description 1038 "Segment declared by IPv4 Prefix with optional SR Algorithm"; 1039 leaf ipv4-address { 1040 type inet:ipv4-address; 1041 description "Segment IPv4 address"; 1042 } 1043 leaf algorithm { 1044 type uint8; 1045 description "Prefix SID algorithm identifier"; 1046 } 1047 } 1048 container segment-type-4 { 1049 description 1050 "Segment declared by IPv6 Global Prefix with optional 1051 SR Algorithm for SR-MPLS"; 1052 leaf ipv6-address { 1053 type inet:ipv6-address; 1054 description "Segment IPv6 address"; 1055 } 1056 leaf algorithm { 1057 type uint8; 1058 description "Prefix SID algorithm identifier"; 1059 } 1060 } 1061 container segment-type-5 { 1062 description 1063 "Segment declared by IPv4 Prefix with Local Interface ID"; 1064 leaf ipv4-address { 1065 type inet:ipv4-address; 1066 description "Node IPv4 address"; 1067 } 1068 leaf interface-identifier { 1069 type uint32; 1070 description "local interface identifier"; 1071 } 1072 } 1073 container segment-type-6 { 1074 description 1075 "Segment declared by IPv4 Addresses for link endpoints 1076 as Local, Remote pair"; 1077 leaf local-ipv4-address { 1078 type inet:ipv4-address; 1079 description "Segment local IPv4 adjacency address"; 1080 } 1081 leaf remote-ipv4-address { 1082 type inet:ipv4-address; 1083 description "Segment remote IPv4 adjacency address"; 1084 } 1086 } 1087 container segment-type-7 { 1088 description 1089 "Segment declared by IPv6 Prefix and Interface ID for 1090 link endpoints as Local, Remote pair for SR-MPLS"; 1091 leaf local-ipv6-address { 1092 type inet:ipv6-address; 1093 description "Local link IPv6 address"; 1094 } 1095 leaf local-interface-identifier { 1096 type uint32; 1097 description "Local interface identifier"; 1098 } 1099 leaf remote-ipv6-address { 1100 type inet:ipv6-address; 1101 description "Remote link IPv6 address"; 1102 } 1103 leaf remote-interface-identifier { 1104 type uint32; 1105 description "Remote interface identifier"; 1106 } 1107 } 1108 container segment-type-8 { 1109 description 1110 "Segment declared by IPv6 Addresses for link endpoints as 1111 Local, Remote pair for SR-MPLS"; 1112 leaf local-ipv6-address { 1113 type inet:ipv6-address; 1114 description "Segment local IPv6 adjacency address"; 1115 } 1116 leaf remote-ipv6-address { 1117 type inet:ipv6-address; 1118 description "Segment remote IPv6 adjacency address"; 1119 } 1120 } 1121 container segment-type-9 { 1122 description 1123 "Segment declared by IPv6 Global Prefix with optional 1124 SR Algorithm for SRv6"; 1125 leaf ipv6-address { 1126 type inet:ipv6-address; 1127 description "Segment IPv6 prefix"; 1128 } 1129 leaf algorithm { 1130 type uint8; 1131 description "Prefix SID algorithm identifier"; 1132 } 1133 } 1134 container segment-type-10 { 1135 description 1136 "Segment declared by IPv6 Prefix and Interface ID for 1137 link endpoints as Local, Remote pair for SRv6"; 1138 leaf local-ipv6-address { 1139 type inet:ipv6-address; 1140 description "Local link IPv6 address"; 1141 } 1142 leaf local-interface-identifier { 1143 type uint32; 1144 description "Local interface identifier"; 1145 } 1146 leaf remote-ipv6-address { 1147 type inet:ipv6-address; 1148 description "Remote link IPv6 address"; 1149 } 1150 leaf remote-interface-identifier { 1151 type uint32; 1152 description "Remote interface identifier"; 1153 } 1154 } 1155 container segment-type-11 { 1156 description 1157 "Segment declared by IPv6 Addresses for link endpoints as 1158 Local, Remote pair for SRv6"; 1159 leaf local-ipv6-address { 1160 type inet:ipv6-address; 1161 description "Segment local IPv6 adjacency address"; 1162 } 1163 leaf remote-ipv6-address { 1164 type inet:ipv6-address; 1165 description "Segment remote IPv6 adjacency address"; 1166 } 1167 } 1168 } 1169 leaf validate { 1170 type boolean; 1171 default 'false'; 1172 description "Indicates whether the segment should be validated. The default 1173 applies to all segments other than the first segment. For the 1174 first segment, validation is always done."; 1175 } 1176 } 1178 grouping segment-properties { 1179 description 1180 "SR segment properties grouping"; 1181 uses segment_config; 1183 } 1185 grouping policy-attributes { 1186 description 1187 "Grouping containing attributes applicable to all SR policies"; 1189 container policy-attributes { 1190 description 1191 "Attributes applicable to all SR policies"; 1193 uses segment-lists; 1195 uses explicit-binding-sid-rules; 1196 } 1197 } 1199 grouping segment-lists { 1200 description 1201 "Segment lists grouping"; 1202 container segment-lists { 1203 description "Segment-lists properties"; 1205 list segment-list { 1206 key "name"; 1207 description "Segment-list properties"; 1208 leaf name { 1209 type string; 1210 description "Segment-list name"; 1211 } 1212 container segments { 1213 description 1214 "Segments for given segment list"; 1216 list segment { 1217 key "index"; 1218 description "Configure Segment/hop at the index"; 1219 uses segment-properties; 1220 } 1221 } 1222 } 1223 } 1224 } 1226 grouping binding-sid_config { 1227 description 1228 "Binding SID configuration properties grouping"; 1229 leaf dataplane { 1230 type sr-policy-types:dataplane-type; 1231 description "Binding SID dataplane type"; 1232 } 1233 leaf value { 1234 type sr-policy-types:sid-value-type; 1235 description "Binding SID value"; 1236 } 1237 } 1239 grouping forwarding-counters { 1240 description 1241 "Grouping for counters"; 1242 container counters { 1243 config false; 1244 description 1245 "Counters containing stats related to forwarding"; 1247 leaf pkts { 1248 type yang:counter64; 1249 description "Number of packets forwarded"; 1250 } 1251 leaf octets { 1252 type yang:counter64; 1253 units "byte"; 1254 description "Number of bytes forwarded"; 1255 } 1256 } 1257 } 1259 grouping binding-sid_state { 1260 description 1261 "Binding SID state properties grouping"; 1262 leaf alloc-mode { 1263 type sr-policy-types:binding-sid-alloc-mode; 1264 config false; 1265 description "Binding SID type"; 1266 } 1267 leaf allocated-sid { 1268 type sr-policy-types:sid-value-type; 1269 config false; 1270 description "Allocated SID value for the Binding SID"; 1271 } 1272 leaf oper-state { 1273 type sr-policy-types:binding-sid-oper-state; 1274 config false; 1275 description 1276 "Binding SID operational state"; 1277 } 1278 } 1279 grouping binding-sid-properties { 1280 description 1281 "Binding SID properties grouping"; 1282 container binding-sid { 1283 description "Binding Segment ID"; 1284 uses binding-sid_config; 1285 uses binding-sid_state; 1286 } 1287 } 1289 grouping mpls-label-stack { 1290 description 1291 "Grouping for MPLS label stack"; 1293 list labels { 1294 key "label"; 1295 description 1296 "Stack containing MPLS labels"; 1298 leaf label { 1299 type rt-types:mpls-label; 1300 description 1301 "MPLS label value"; 1302 } 1303 } 1304 } 1306 grouping srv6-sid-stack { 1307 description 1308 "Grouping for SRv6 label stack"; 1310 list sids { 1311 key "sid"; 1312 description 1313 "Stack containing SRv6 SIDs"; 1315 leaf sid { 1316 type srv6-types:srv6-sid; 1317 description 1318 "SRv6 sid value"; 1319 } 1320 } 1321 } 1323 grouping path-forwarding_state { 1324 description "Policy Forwarding path information"; 1325 leaf path-id { 1326 type uint8; 1327 description "Primary path id"; 1328 } 1329 leaf next-hop-address { 1330 type inet:ip-address; 1331 description "Nexthop address"; 1332 } 1333 leaf next-hop-table-id { 1334 type uint32; 1335 description "Table ID for nexthop address"; 1336 } 1337 leaf outgoing-interface { 1338 type if:interface-ref; 1339 description "Outgoing interface handle"; 1340 } 1341 container outgoing-sids { 1342 description 1343 "Outgoing sid stack"; 1344 choice dataplanetype { 1345 description 1346 "Outgoing sids dataplane choice"; 1347 case mpls { 1348 uses mpls-label-stack; 1349 } 1350 case srv6 { 1351 uses srv6-sid-stack; 1352 } 1353 } 1354 } 1355 leaf is-protected { 1356 type boolean; 1357 description "Is this path protected ?"; 1358 } 1359 leaf is-pure-backup { 1360 type boolean; 1361 description "Is this path a pure backup ?"; 1362 } 1363 leaf backup-path-id { 1364 type uint8; 1365 description "Backup path id"; 1366 } 1367 leaf weight { 1368 type uint32; 1369 description "Path's weight for W-ECMP balancing"; 1370 } 1371 } 1373 grouping explicit-path-properties { 1374 description 1375 "Explicit path properties of the candidate path"; 1376 container segment-lists { 1377 description 1378 "Path segment list(s) properties"; 1379 list segment-list { 1380 key "name-ref"; 1381 description "SR policy candidate path segment lists"; 1383 leaf name-ref { 1384 type leafref { 1385 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"; 1386 } 1387 description "Reference to segment-list name"; 1388 } 1389 leaf weight { 1390 type uint32; 1391 description "Segment-list weighted loadshare"; 1392 } 1393 leaf is-valid { 1394 type boolean; 1395 config false; 1396 description 1397 "True if the segment-list is valid, False otherwise"; 1398 } 1399 container forwarding-paths { 1400 config false; 1401 description 1402 "Forwarding state of paths"; 1403 list forwarding-path { 1404 key "path-id"; 1405 description "Forwarding path"; 1406 uses path-forwarding_state; 1407 } 1408 } 1409 } 1410 } 1411 } 1413 grouping dynamic-path-properties { 1414 description 1415 "Dynamic path properties of the candidate path"; 1416 leaf sid-dataplane-type { 1417 type sr-policy-types:dataplane-type; 1418 description 1419 "The dataplane type for the sid"; 1420 } 1421 leaf is-valid { 1422 type boolean; 1423 config false; 1424 description 1425 "True if the segment-list is valid, False otherwise"; 1426 } 1427 container forwarding-paths { 1428 config false; 1429 description 1430 "Forwarding state of paths"; 1431 list forwarding-path { 1432 key "path-id"; 1433 description "Forwarding path"; 1434 uses path-forwarding_state; 1435 } 1436 } 1437 } 1439 grouping candidate-path_state { 1440 description 1441 "Candidate path state properties grouping"; 1442 leaf is-best-candidate-path { 1443 type boolean; 1444 default 'false'; 1445 config false; 1446 description 1447 "True if the candidate path is the best candidate path, False otherwise"; 1448 } 1449 leaf non-selection-reason { 1450 type identityref { 1451 base sr-policy-types:candidate-path-not-selected-reason; 1452 } 1453 config false; 1454 description 1455 "Candidate path not selected reason"; 1456 } 1457 } 1459 grouping policy-properties_config { 1460 description 1461 "SR policy configuration grouping"; 1462 leaf name { 1463 type string { 1464 length "1..59"; 1465 } 1466 description "SR policy name"; 1467 } 1468 leaf color { 1469 type uint32 { 1470 range "1..4294967295"; 1472 } 1473 description "Color associated with the policy"; 1474 } 1475 leaf endpoint { 1476 type inet:ip-address; 1477 description "Policy end point IP address"; 1478 } 1479 leaf description { 1480 type string; 1481 description "Description of the policy"; 1482 } 1483 leaf admin-state { 1484 type sr-policy-types:policy-admin-state; 1485 default 'UP'; 1486 description 1487 "SR policy administrative state, true for 1488 enabled, false for disabled"; 1489 } 1490 } 1492 grouping policy-properties_state { 1493 description 1494 "SR policy property grouping"; 1495 leaf oper-state { 1496 type sr-policy-types:policy-oper-state; 1497 config false; 1498 description 1499 "SR policy operational state"; 1500 } 1501 leaf transition-count { 1502 type uint32; 1503 config false; 1504 description "Indicates number of up/down transitions"; 1505 } 1506 leaf up-time { 1507 type yang:date-and-time; 1508 config false; 1509 description "Policy up time in seconds"; 1510 } 1511 leaf down-time { 1512 type yang:date-and-time; 1513 config false; 1514 description "Policy down time in seconds"; 1515 } 1516 } 1518 grouping policy-properties { 1519 description 1520 "SR policy properties"; 1521 uses policy-properties_state; 1522 uses binding-sid-properties; 1523 uses forwarding-counters; 1524 } 1526 grouping candidate-path-type { 1527 description "Candidate path type grouping"; 1528 choice type { 1529 description 1530 "Type of candidate paths"; 1531 case explicit { 1532 description "Candidate path with explicitly defined set/s of segment-lists"; 1533 uses explicit-path-properties; 1534 } 1535 case dynamic { 1536 description "Candidate path with dynamic computed segment-lists"; 1537 uses dynamic-path-properties; 1538 } 1539 } 1540 } 1542 grouping candidate-paths { 1543 description "SR policy candidate path grouping"; 1544 container candidate-paths { 1545 description "SR policy candidate path(s) "; 1547 list candidate-path { 1548 key "protocol-origin originator discriminator"; 1549 description "SR policy Candidate path(s) list entry"; 1551 leaf protocol-origin { 1552 type sr-policy-types:protocol-origin-type; 1553 description 1554 "Instantiation mechanism used to create the candidate path"; 1555 } 1556 leaf originator { 1557 type string; 1558 description 1559 "Identifier (concatenation of ASN and node-address) of the node 1560 that signalled/instantiated the candidate path on headend"; 1561 } 1562 leaf discriminator { 1563 type uint32; 1564 description "Candidate path distinguisher"; 1565 } 1566 leaf name { 1567 type string; 1568 description "Candidate path name"; 1569 } 1570 leaf preference { 1571 type uint32 { 1572 range "1..65535"; 1573 } 1574 description "Candidate path preference"; 1575 } 1576 leaf description { 1577 type string; 1578 description "Candidate path description"; 1579 } 1580 container binding-sid { 1581 if-feature capability-candidate-path-binding-sid; 1582 description 1583 "Binding segment ID"; 1584 uses binding-sid_config; 1585 } 1586 uses candidate-path_state; 1587 uses candidate-path-type; 1588 } 1589 } 1590 } 1592 grouping policies { 1593 description "SR policy grouping"; 1594 container policies { 1595 description "SR Policy container"; 1597 list policy { 1598 key "color endpoint"; 1599 unique "name"; 1600 description "SR Policy properties"; 1602 leaf color { 1603 type uint32 { 1604 range "1..4294967295"; 1605 } 1606 description "Color associated with the policy"; 1607 } 1608 leaf endpoint { 1609 type inet:ip-address; 1610 description "Policy end point IP address"; 1611 } 1612 leaf name { 1613 type string { 1614 length "1..59"; 1615 } 1616 description "SR policy name"; 1617 } 1618 leaf description { 1619 type string; 1620 description "Description of the policy"; 1621 } 1622 leaf admin-state { 1623 type sr-policy-types:policy-admin-state; 1624 default 'UP'; 1625 description 1626 "SR policy administrative state, true for 1627 enabled, false for disabled"; 1628 } 1629 leaf priority { 1630 type uint8; 1631 default 128; 1632 description "Priority considered when policy is recomputed due to topology changes"; 1633 } 1635 uses policy-properties; 1637 uses candidate-paths; 1638 } 1639 } 1640 } 1642 grouping explicit-binding-sid-rules { 1643 description 1644 "Grouping for explicit binding sid rules"; 1646 list explicit-binding-sid-rules { 1647 key "index"; 1648 description 1649 "Explicit binding sid rules applicable for all policies"; 1650 leaf index { 1651 type uint32; 1652 description "Explicit binding SID rules list index"; 1653 } 1654 leaf rule { 1655 type sr-policy-types:explicit-binding-sid-rule-type; 1656 description "Explicit binding sid rule"; 1657 } 1658 } 1659 } 1661 augment "/rt:routing" { 1662 description 1663 "This augments routing-instance configuration with segment-routing sr-policy."; 1665 container segment-routing { 1666 description "Main segment routing container"; 1668 container sr-policy { 1669 description "SR policy main container"; 1671 uses policy-attributes; 1673 uses policies; 1674 } 1675 } 1676 } 1678 /* Notifications */ 1680 notification sr-policy-oper-state-change-event { 1681 description 1682 "Notification event when the operational state of the SR policy changes"; 1684 leaf policy-name-ref { 1685 type leafref { 1686 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"; 1687 } 1688 description "Reference to sr-policy name"; 1689 } 1691 leaf policy-color-ref { 1692 type leafref { 1693 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"; 1694 } 1695 description "Reference to sr-policy color"; 1696 } 1698 leaf policy-endpoint-ref { 1699 type leafref { 1700 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"; 1701 } 1702 description "Reference to sr-policy endpoint"; 1703 } 1705 leaf policy-new-oper-state { 1706 type sr-policy-types:policy-oper-state; 1707 description "New operational state of the SR policy"; 1708 } 1710 leaf policy-down-reason { 1711 type identityref { 1712 base sr-policy-types:policy-down-reason; 1714 } 1715 description "Down reason if the SR policy's new operational state is down"; 1716 } 1717 } 1719 notification sr-policy-candidate-path-change-event { 1720 description 1721 "Notification event when candidate path changes for SR policy"; 1723 leaf policy-name-ref { 1724 type leafref { 1725 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"; 1726 } 1727 description "Reference to sr-policy name"; 1728 } 1730 leaf policy-color-ref { 1731 type leafref { 1732 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"; 1733 } 1734 description "Reference to sr-policy color"; 1735 } 1737 leaf policy-endpoint-ref { 1738 type leafref { 1739 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"; 1740 } 1741 description "Reference to sr-policy endpoint"; 1742 } 1744 leaf existing-preference { 1745 type uint32; 1746 description "Existing candidate path preference"; 1747 } 1749 leaf new-preference { 1750 type uint32; 1751 description "New candidate path preference"; 1752 } 1753 } 1755 notification sr-policy-binding-sid-unavailable-event { 1756 description 1757 "Notification event when the binding sid of sr-policy is unavailable"; 1759 leaf policy-name-ref { 1760 type leafref { 1761 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"; 1763 } 1764 description "Reference to sr-policy name"; 1765 } 1767 leaf policy-color-ref { 1768 type leafref { 1769 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"; 1770 } 1771 description "Reference to sr-policy color"; 1772 } 1774 leaf policy-endpoint-ref { 1775 type leafref { 1776 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"; 1777 } 1778 description "Reference to sr-policy endpoint"; 1779 } 1781 leaf policy-binding-sid-value-ref { 1782 type leafref { 1783 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"; 1784 } 1785 description "Reference to sr-policy binding-sid value"; 1786 } 1788 leaf reason { 1789 type identityref { 1790 base sr-policy-types:binding-sid-unavailable-reason; 1791 } 1792 description 1793 "Reason why the binding sid is unavailable"; 1794 } 1795 } 1797 notification sr-policy-candidate-path-binding-sid-mismatch-event { 1798 description 1799 "Notification event when binding sid of requested candidate path 1800 is different from the binding sid of the existing candidate path"; 1802 leaf policy-color-ref { 1803 type leafref { 1804 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"; 1805 } 1806 description "Reference to sr-policy color"; 1807 } 1809 leaf policy-endpoint-ref { 1810 type leafref { 1811 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"; 1812 } 1813 description "Reference to sr-policy endpoint"; 1814 } 1816 leaf existing-candidate-path-protocol-origin-ref { 1817 type leafref { 1818 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"; 1819 } 1820 description "Reference to existing candidate path protocol origin"; 1821 } 1823 leaf existing-candidate-path-preference-ref { 1824 type leafref { 1825 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"; 1826 } 1827 description "Reference to existing candidate path preference"; 1828 } 1830 leaf existing-candidate-path-binding-sid-dataplane-ref { 1831 if-feature capability-candidate-path-binding-sid; 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 if-feature capability-candidate-path-binding-sid; 1840 type leafref { 1841 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"; 1842 } 1843 description "Reference to existing candidate path binding sid value"; 1844 } 1846 leaf conflicting-candidate-path-protocol-origin { 1847 type uint8; 1848 description "Conflicting candidate path protocol origin"; 1849 } 1851 leaf conflicting-candidate-path-preference { 1852 type uint32; 1853 description "Conflicting candidate path preference"; 1854 } 1856 leaf conflicting-candidate-path-binding-sid-dataplane { 1857 type sr-policy-types:dataplane-type; 1858 description "Conflicting candidate path binding sid dataplane type"; 1859 } 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 } 1866 /* Features */ 1868 feature capability-candidate-path-binding-sid { 1869 description 1870 "This feature enables the capability of specifying binding-sid 1871 for a candidate path."; 1872 } 1873 } 1875 1877 Figure 6: ietf-sr-policy.yang 1879 6. Security Considerations 1881 The configuration, state, and notification data defined using YANG 1882 data models in this document are likely to be accessed via the 1883 protocols such as NETCONF [RFC6241] etc. 1885 Hence, YANG implementations MUST comply with the security 1886 requirements specified in section 15 of [RFC6020]. Additionally, 1887 NETCONF implementations MUST comply with the security requirements 1888 specified in sections 2.2, 2.3 and 9 of [RFC6241] as well as section 1889 3.7 of [RFC6536]. 1891 7. IANA Considerations 1893 This document requests the registration of the following URIs in the 1894 IETF "XML registry" [RFC3688]: 1896 +------------------------------------------------+------------+-----+ 1897 | URI | Registrant | XML | 1898 +------------------------------------------------+------------+-----+ 1899 | urn:ietf:params:xml:ns:yang:ietf-sr-policy- | The IESG | N/A | 1900 | types | | | 1901 | | | | 1902 | urn:ietf:params:xml:ns:yang:ietf-sr-policy | The IESG | N/A | 1903 +------------------------------------------------+------------+-----+ 1905 This document requests the registration of the following YANG modules 1906 in the "YANG Module Names" registry [RFC6020]: 1908 +--------------+------------------------------+------------+--------+ 1909 | Name | Namespace | Prefix | Refere | 1910 | | | | nce | 1911 +--------------+------------------------------+------------+--------+ 1912 | ietf-sr- | urn:ietf:params:xml:ns:yang | sr-policy- | This d | 1913 | policy-types | :ietf-sr-policy-types | types | ocumen | 1914 | | | | t | 1915 | | | | | 1916 | ietf-sr- | urn:ietf:params:xml:ns:yang | sr-policy | This d | 1917 | policy | :ietf-sr-policy | | ocumen | 1918 | | | | t | 1919 +--------------+------------------------------+------------+--------+ 1921 8. Acknowledgments 1923 The authors of this document/YANG model would like to acknowledge the 1924 contributions/reviews by Clarence Filsfils, Siva Sivabalan, Tarek 1925 Saad, Kris Michielsen, Dhanendra Jain, Ketan Talaulikar, Bhupendra 1926 Yadav, and Bruno Decraene. 1928 9. References 1930 9.1. Normative References 1932 [I-D.ietf-netmod-revised-datastores] 1933 Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K., 1934 and R. Wilton, "Network Management Datastore 1935 Architecture", draft-ietf-netmod-revised-datastores-10 1936 (work in progress), January 2018. 1938 [I-D.ietf-netmod-rfc6087bis] 1939 Bierman, A., "Guidelines for Authors and Reviewers of YANG 1940 Data Model Documents", draft-ietf-netmod-rfc6087bis-20 1941 (work in progress), March 2018. 1943 [I-D.ietf-spring-segment-routing] 1944 Filsfils, C., Previdi, S., Ginsberg, L., Decraene, B., 1945 Litkowski, S., and R. Shakir, "Segment Routing 1946 Architecture", draft-ietf-spring-segment-routing-15 (work 1947 in progress), January 2018. 1949 [I-D.ietf-spring-segment-routing-policy] 1950 Filsfils, C., Sivabalan, S., daniel.voyer@bell.ca, d., 1951 bogdanov@google.com, b., and P. Mattes, "Segment Routing 1952 Policy Architecture", draft-ietf-spring-segment-routing- 1953 policy-01 (work in progress), June 2018. 1955 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1956 Requirement Levels", BCP 14, RFC 2119, 1957 DOI 10.17487/RFC2119, March 1997, 1958 . 1960 [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, 1961 DOI 10.17487/RFC3688, January 2004, 1962 . 1964 [RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for 1965 the Network Configuration Protocol (NETCONF)", RFC 6020, 1966 DOI 10.17487/RFC6020, October 2010, 1967 . 1969 [RFC6241] Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed., 1970 and A. Bierman, Ed., "Network Configuration Protocol 1971 (NETCONF)", RFC 6241, DOI 10.17487/RFC6241, June 2011, 1972 . 1974 [RFC6536] Bierman, A. and M. Bjorklund, "Network Configuration 1975 Protocol (NETCONF) Access Control Model", RFC 6536, 1976 DOI 10.17487/RFC6536, March 2012, 1977 . 1979 9.2. Informative References 1981 [I-D.ietf-idr-segment-routing-te-policy] 1982 Previdi, S., Filsfils, C., Jain, D., Mattes, P., Rosen, 1983 E., and S. Lin, "Advertising Segment Routing Policies in 1984 BGP", draft-ietf-idr-segment-routing-te-policy-03 (work in 1985 progress), May 2018. 1987 Authors' Addresses 1989 Johnson Thomas 1990 Cisco Systems, Inc. 1991 Email: thjohns2@cisco.com 1993 Kamran Raza (editor) 1994 Cisco Systems, Inc. 1995 Email: skraza@cisco.com 1996 Zhuang Shunwan 1997 Huawei Technologies 1998 Email: zhuangshunwa@huawei.com 2000 Daniel Voyer 2001 Bell Canada 2002 Email: daniel.voyer@bell.ca 2004 Muhammad Durrani 2005 Equinix 2006 Email: mdurrani@equinix.com 2008 Satoru Matsushima 2009 SoftBank 2010 Email: satoru.matsushima@g.softbank.co.jp