idnits 2.17.00 (12 Aug 2021) /tmp/idnits16535/draft-ietf-rtgwg-qos-model-07.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: ---------------------------------------------------------------------------- == It seems as if not all pages are separated by form feeds - found 0 form feeds but 93 pages Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** There is 1 instance of too long lines in the document, the longest one being 1 character in excess of 72. Miscellaneous warnings: ---------------------------------------------------------------------------- == Line 296 has weird spacing: '...rection ide...' == Line 391 has weird spacing: '...rw name str...' == Line 392 has weird spacing: '...rw type ide...' == Line 448 has weird spacing: '...ue-name str...' == Line 480 has weird spacing: '...-policy str...' == (1 more instance...) -- The document date (6 March 2022) is 69 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) ** Downref: Normative reference to an Informational RFC: RFC 2697 ** Downref: Normative reference to an Informational RFC: RFC 2698 Summary: 3 errors (**), 0 flaws (~~), 7 warnings (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group A.C. Choudhary 3 Internet-Draft Cisco Systems 4 Intended status: Standards Track M. Jethanandani 5 Expires: 7 September 2022 Kloud Services 6 E. Aries 7 Juniper Networks 8 I. Chen 9 The MITRE Corporation 10 6 March 2022 12 YANG Models for Quality of Service (QoS) 13 draft-ietf-rtgwg-qos-model-07 15 Abstract 17 This document describes a YANG model for configuration of Quality of 18 Service (QoS) configuration in network devices. This document 19 doesn't describe QoS statistics counters. 21 Status of This Memo 23 This Internet-Draft is submitted in full conformance with the 24 provisions of BCP 78 and BCP 79. 26 Internet-Drafts are working documents of the Internet Engineering 27 Task Force (IETF). Note that other groups may also distribute 28 working documents as Internet-Drafts. The list of current Internet- 29 Drafts is at https://datatracker.ietf.org/drafts/current/. 31 Internet-Drafts are draft documents valid for a maximum of six months 32 and may be updated, replaced, or obsoleted by other documents at any 33 time. It is inappropriate to use Internet-Drafts as reference 34 material or to cite them other than as "work in progress." 36 This Internet-Draft will expire on 7 September 2022. 38 Copyright Notice 40 Copyright (c) 2022 IETF Trust and the persons identified as the 41 document authors. All rights reserved. 43 This document is subject to BCP 78 and the IETF Trust's Legal 44 Provisions Relating to IETF Documents (https://trustee.ietf.org/ 45 license-info) in effect on the date of publication of this document. 46 Please review these documents carefully, as they describe your rights 47 and restrictions with respect to this document. Code Components 48 extracted from this document must include Revised BSD License text as 49 described in Section 4.e of the Trust Legal Provisions and are 50 provided without warranty as described in the Revised BSD License. 52 Table of Contents 54 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 55 1.1. Note to RFC Editor . . . . . . . . . . . . . . . . . . . 3 56 1.2. Terminology . . . . . . . . . . . . . . . . . . . . . . . 3 57 1.3. Definitions and Acronyms . . . . . . . . . . . . . . . . 3 58 2. QoS Model Design . . . . . . . . . . . . . . . . . . . . . . 4 59 3. DiffServ Model Design . . . . . . . . . . . . . . . . . . . . 5 60 4. Modules Tree Structure . . . . . . . . . . . . . . . . . . . 5 61 5. Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 62 5.1. ietf-qos-classifier . . . . . . . . . . . . . . . . . . . 11 63 5.2. ietf-qos-policy . . . . . . . . . . . . . . . . . . . . . 15 64 5.3. ietf-qos-action . . . . . . . . . . . . . . . . . . . . . 17 65 5.4. ietf-qos-target . . . . . . . . . . . . . . . . . . . . . 40 66 5.5. ietf-diffserv . . . . . . . . . . . . . . . . . . . . . . 42 67 5.6. ietf-queue-policy . . . . . . . . . . . . . . . . . . . . 52 68 5.7. ietf-scheduler-policy . . . . . . . . . . . . . . . . . . 55 69 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 59 70 7. Security Considerations . . . . . . . . . . . . . . . . . . . 59 71 8. Acknowledgement . . . . . . . . . . . . . . . . . . . . . . . 59 72 9. Contributors . . . . . . . . . . . . . . . . . . . . . . . . 59 73 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 59 74 10.1. Normative References . . . . . . . . . . . . . . . . . . 59 75 10.2. Informative References . . . . . . . . . . . . . . . . . 60 76 Appendix A. Company A, Company B and Company C examples . . . . 61 77 A.1. Example of Company A Diffserv Model . . . . . . . . . . . 61 78 A.2. Example of Company B Diffserv Model . . . . . . . . . . . 70 79 A.3. Example of Company C Diffserv Model . . . . . . . . . . . 84 80 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 92 82 1. Introduction 84 This document defines a base YANG [RFC6020] [RFC7950] model for 85 Quality of Service (QoS) configuration parameters. QoS base modules 86 define the basic building blocks to define a classifier, policy, 87 action and target. The base models are augmented to include packet 88 match fields and action parameters to define the Diffrentiated 89 Services (DiffServ) module. Queues and schedulers are stitched as 90 part of diffserv policy model. Separate models have been defined for 91 creating Queue policy and Scheduling policy. The DiffServ model is 92 based on DiffServ architecture, and various references have been made 93 to available standard architecture documents. 95 DiffServ is a preferred approach for network service providers to 96 offer services to different customers based on their network Quality- 97 of-Service (QoS) objectives. The traffic streams are differentiated 98 based on DiffServ Code Points (DSCP) carried in the IP header of each 99 packet. The DSCP markings are applied by upstream node or by the 100 edge router on entry to the DiffServ network. 102 The YANG modules in this document conform to the Network Management 103 Datastore Architecture (NMDA) [RFC8342]. 105 Tree diagrams used in this document follow the notation defined in 106 [RFC8340] 108 1.1. Note to RFC Editor 110 Editorial Note: (To be removed by RFC Editor) 112 This draft contains several placeholder values that need to be 113 replaced with finalized values at the time of publication. Please 114 apply the following replacements: 116 * "XXXX" --> the assigned RFC value for this draft both in this 117 draft and in the yang modules under the revision statement. 119 * The "revision" date in model, in the format XXXX-XX-XX, needs to 120 be updated with the date the draft gets approved. 122 1.2. Terminology 124 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 125 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 126 "OPTIONAL" in this document are to be interpreted as described in BCP 127 14 [RFC2119] [RFC8174] when, and only when, they appear in all 128 capitals, as shown here. 130 1.3. Definitions and Acronyms 132 This document uses definitions and acronyms defined in Definitions of 133 the Differentiated Services Field (DS Field) in the IPv4 and IPv6 134 Headers [RFC2474], An Architecture for Differentiated Services 135 [RFC2475], and other documents. Here are some of them. 137 * Classifier: an entity which selects packets based on the content 138 of packet headers according to defined rules. 140 * DiffServ: Differentiated Services enhancements to the Internet 141 protocol are intended to enable scalable service discrimination in 142 the Internet without the need for per-flow state and signaling at 143 every hop. A variety of services may be built from a small, well- 144 defined set of building blocks which are deployed in network 145 nodes. 147 * DSCP: Differentiated Services Code Point 149 * Marking: the process of setting the DS codepoint in a packet based 150 on defined rules; pre-marking, re-marking. 152 * Metering: the process of measuring the temporal properties (e.g., 153 rate) of a traffic stream selected by a classifier. The 154 instantaneous state of this process may be used to affect the 155 operation of a marker, shaper, or dropper, and/or may be used for 156 accounting and measurement purposes. 158 * Policing: the process of discarding packets (by a dropper) within 159 a traffic stream in accordance with the state of a corresponding 160 meter enforcing a traffic profile. 162 * RED: Random Early Detection 164 * Shaping: the process of delaying packets within a traffic stream 165 to cause it to conform to some defined traffic profile. 167 * WRED: Weighted Random Early Detection 169 2. QoS Model Design 171 A classifier consists of packets which may be grouped when a logical 172 set of rules are applied on different packet header fields. The 173 grouping may be based on different values or range of values of same 174 packet header field, presence or absence of some values or range of 175 values of a packet field or a combination thereof. The QoS 176 classifier is defined in the ietf-qos-classifier module. 178 A classifier entry contains one or more packet conditioning 179 functions. A packet conditioning function is typically based on 180 direction of traffic and may drop, mark or delay network packets. A 181 set of classifier entries with corresponding conditioning functions 182 when arranged in order of priority represents a QoS policy. A QoS 183 policy may contain one or more classifier entries. These are defined 184 in ietf-qos-policy module. 186 Actions are configured in line with respect to the policy module. 187 These include marking, dropping or shaping. Actions are defined in 188 the ietf-qos-action module. 190 A meter qualifies if the traffic arrival rate is based on agreed upon 191 rate and variability. A meter is modeled based on commonly used 192 alogrithms in industry, Single Rate Tri Color Marking (srTCM) 193 [RFC2697] meter, Two Rate Tri Color Marking (trTCM) [RFC2698] meter, 194 and Single Rate Two Color Marking meter. Different vendors can 195 extend it with other types of meters as well. 197 3. DiffServ Model Design 199 DiffServ architecture [RFC3289] and [RFC2475] describe the 200 architecture as a simple model where traffic entering a network is 201 classified and possibly conditioned at the boundary of the network 202 and assigned a different Behavior Aggregate (BA). Each BA is 203 identified by a specific value of DSCP, and is used to select a Per 204 Hop Behavior (PHB). 206 The packet classification policy identifies the subset of traffic 207 which may receive a DiffServ by being conditioned or mapped. Packet 208 classifiers select packets within a stream based on the content of 209 some portion of the packet header. There are two types of 210 classifiers, the BA classifier, and the Multi-Field (MF) classifier 211 which selects packets based on a value which is combination of one or 212 more header fields. In the ietf-diffserv module, this is realized by 213 augmenting the QoS classification module. 215 Traffic conditioning includes metering, shaping and/or marking. A 216 meter is used to measure the traffic against a given traffic profile. 217 The traffic profile specifies the temporal property of the traffic. 218 A packet that arrives is first determined to be in or out of the 219 profile, which will result in the action of marked, dropped or 220 shaped. This is realized in vendor specific modules based on the 221 parameters defined in action module. The metering parameters are 222 augmented to the QoS policy module when metering is defined inline, 223 and to the metering template when metering profile is referred in 224 policy module. 226 4. Modules Tree Structure 228 This document defines seven YANG modules - four QoS base modules, a 229 scheduler policy module, a queuing policy module and one DiffServ 230 module. 232 ietf-qos-classifier consists of classifier entries identified by a 233 classifier entry name. Each entry MAY contain a list of filter 234 entries. When no filter entry is present in a classifier entry, it 235 matches all traffic. 237 module: ietf-qos-classifier 238 +--rw classifiers {classifier-template-feature}? 239 +--rw classifier* [name] 240 +--rw name string 241 +--rw description? string 242 +--rw filter-operation? identityref 243 +--rw filter* [type logical-not] 244 ... 246 Figure 1: ietf-qos-classifier tree diagram 248 An ietf-qos-policy module contains list of policy objects identified 249 by a policy name and policy type which MUST be provided. With 250 different values of policy types, each vendor MAY define their own 251 construct of policy for different QoS functionalities. Each vendor 252 MAY augment classifier entry in a policy definition with a set of 253 actions. 255 module: ietf-qos-policy 256 +--rw policies 257 +--rw policy* [name type] 258 +--rw name string 259 +--rw type identityref 260 +--rw description? string 261 +--rw classifier* [name] 262 ... 264 Figure 2: ietf-qos-policy tree diagram 266 ietf-qos-action module contains grouping of set of QoS actions. 267 These include metering, marking, dropping and shaping. Marking sets 268 DiffServ codepoint value in the classified packet. Color-aware and 269 Color-blind meters are augmented by vendor specific modules based on 270 the parameters defined in action module. 272 module: ietf-qos-action 273 +--rw meters 274 +--rw meter* [name] {meter-template-support}? 275 +--rw name string 276 +--rw (meter-type)? 277 ... 279 Figure 3: ietf-qos-actions tree diagram 281 ietf-qos-target module contains reference of qos-policy and augments 282 ietf-interfaces [RFC8343] module. A single policy of a particular 283 policy-type can be applied on an interface in each direction of 284 traffic. Policy-type is of type identity and is populated in a 285 vendor specific manner. This way it provides greater flexibility for 286 each vendor to define different policy types each with its own 287 capabilities and restrictions. 289 Classifier, metering and queuing counters are associated with a 290 target. 292 module: ietf-qos-target 294 augment /if:interfaces/if:interface: 295 +--rw qos-target-policy* [direction type] 296 +--rw direction identityref 297 +--rw type identityref 298 +--rw name string 300 Figure 4: ietf-qos-target tree diagram 302 Diffserv module augments QoS classifier module. Many of the YANG 303 types defined in [RFC6991] are represented as leafs in the classifier 304 module. 306 Metering and marking actions are realized by augmenting the QoS 307 policy-module. Any queuing, AQM and scheduling actions are part of 308 vendor specific augmentation. Statistics are realized by augmenting 309 the QoS target module. 311 module: ietf-diffserv 313 augment /classifier:classifiers/classifier:classifier 314 /classifier:filter: 315 +--rw (filter-param)? 316 +--:(dscp) 317 | +--rw dscp* [dscp-min dscp-max] 318 | ... 319 +--:(source-ipv4-prefix) 320 | +--rw source-ipv4-prefix* [source-ipv4-prefix] 321 | ... 322 +--:(destination-ipv4-prefix) 323 | +--rw destination-ipv4-prefix* [destination-ipv4-prefix] 324 | ... 325 +--:(source-ipv6-prefix) 326 | +--rw source-ipv6-prefix* [source-ipv6-prefix] 327 | ... 328 +--:(destination-ipv6-prefix) 329 | +--rw destination-ipv6-prefix* [destination-ipv6-prefix] 330 | ... 331 +--:(source-port) 332 | +--rw source-port* [source-port-min source-port-max] 333 | ... 334 +--:(destination-port) 335 | +--rw destination-port* 336 | [destination-port-min destination-port-max] 337 | ... 338 +--:(protocol) 339 | +--rw protocol* [protocol-min protocol-max] 340 | ... 341 +--:(traffic-group) 342 +--rw traffic-group 343 ... 344 augment /policy:policies/policy:policy/policy:classifier 345 /policy:filter: 346 +--rw (filter-params)? 347 +--:(dscp) 348 | +--rw dscp* [dscp-min dscp-max] 349 | ... 350 +--:(source-ipv4-prefix) 351 | +--rw source-ipv4-prefix* [source-ipv4-prefix] 352 | ... 353 +--:(destination-ipv4-prefix) 354 | +--rw destination-ipv4-prefix* [destination-ipv4-prefix] 355 | ... 356 +--:(source-ipv6-prefix) 357 | +--rw source-ipv6-prefix* [source-ipv6-prefix] 358 | ... 359 +--:(destination-ipv6-prefix) 360 | +--rw destination-ipv6-prefix* [destination-ipv6-prefix] 361 | ... 362 +--:(source-port) 363 | +--rw source-port* [source-port-min source-port-max] 364 | ... 365 +--:(destination-port) 366 | +--rw destination-port* 367 | [destination-port-min destination-port-max] 368 | ... 369 +--:(protocol) 370 | +--rw protocol* [protocol-min protocol-max] 371 | ... 372 +--:(traffic-group) 373 +--rw traffic-group 374 ... 376 augment /policy:policies/policy:policy/policy:classifier 377 /policy:action/policy:action-params: 378 +--:(dscp-marking) 379 | +--rw dscp 380 | +--rw dscp? inet:dscp 381 +--:(meter-inline) {action:meter-inline-feature}? 382 | +--rw (meter-type)? 383 | +--:(one-rate-two-color-meter-type) 384 | | ... 385 | +--:(one-rate-tri-color-meter-type) 386 | | ... 387 | +--:(two-rate-tri-color-meter-type) 388 | ... 389 +--:(meter-reference) {action:meter-reference-feature}? 390 | +--rw meter 391 | +--rw name string 392 | +--rw type identityref 393 +--:(traffic-group-marking) {action:traffic-group-feature}? 394 | +--rw traffic-group 395 | +--rw traffic-group? string 396 +--:(child-policy) {action:child-policy-feature}? 397 | +--rw child-policy {child-policy-feature}? 398 | +--rw policy-name? string 399 +--:(count) {action:count-feature}? 400 | +--rw count {count-feature}? 401 | +--rw count-action? empty 402 +--:(named-count) {action:named-counter-feature}? 403 | +--rw named-counter {named-counter-feature}? 404 | +--rw count-name-action? string 405 +--:(queue-inline) {diffserv-queue-inline-support}? 406 | +--rw queue 407 | +--rw priority 408 | | ... 409 | +--rw min-rate 410 | | ... 411 | +--rw max-rate 412 | | ... 413 | +--rw algorithmic-drop 414 | ... 415 +--:(scheduler-inline) {diffserv-scheduler-inline-support}? 416 +--rw scheduler 417 +--rw min-rate 418 | ... 419 +--rw max-rate 420 ... 422 Figure 5: ietf-diffserv tree diagram 424 module: ietf-queue-policy 425 +--rw queue {queue-policy-support}? 426 +--rw name? string 427 +--rw queue 428 +--rw priority 429 | ... 430 +--rw min-rate 431 | ... 432 +--rw max-rate 433 | ... 434 +--rw algorithmic-drop 435 ... 437 augment /policy:policies/policy:policy/policy:classifier 438 /policy:filter: 439 +--rw (filter-params)? {queue-policy-support}? 440 +--:(traffic-group-name) 441 +--rw traffic-group 442 ... 443 augment /policy:policies/policy:policy/policy:classifier 444 /policy:action/policy:action-params: 445 +--:(queue-template-name) 446 | {queue-template-support,queue-policy-support}? 447 | +--rw queue-reference 448 | +--rw queue-name string 449 +--:(queue-inline) {queue-inline-support,queue-policy-support}? 450 +--rw queue 451 +--rw priority 452 | ... 453 +--rw min-rate 454 | ... 455 +--rw max-rate 456 | ... 457 +--rw algorithmic-drop 458 ... 460 Figure 6: ietf-queue-policy tree diagram 462 module: ietf-scheduler-policy 464 augment /policy:policies/policy:policy/policy:classifier 465 /policy:filter: 466 +--rw (filter-params)? 467 +--:(filter-match-all) 468 +--rw match-all-cfg 469 ... 470 augment /policy:policies/policy:policy/policy:classifier 471 /policy:action/policy:action-params: 472 +--:(scheduler) 473 | +--rw scheduler 474 | +--rw min-rate 475 | | ... 476 | +--rw max-rate 477 | ... 478 +--:(queue-policy-name) 479 +--rw queue-policy-name 480 +--rw queue-policy string 482 Figure 7: ietf-scheduler-policy tree diagram 484 5. Modules 486 Modules defined in this draft import definitions from "Common YANG 487 Data Types" [RFC6991] and "A YANG Data Model for Interface 488 Management" [RFC8343]. 490 5.1. ietf-qos-classifier 492 file "ietf-qos-classifer@2022-03-06.yang" 493 module ietf-qos-classifier { 494 yang-version 1.1; 495 namespace "urn:ietf:params:xml:ns:yang:ietf-qos-classifier"; 496 prefix classifier; 498 organization 499 "IETF Routing Area Working Group"; 501 contact 502 "WG Web: 503 WG List: 505 Editor: Aseem Choudhary 506 507 Editor: Mahesh Jethanandani 508 "; 510 description 511 "This module contains a collection of YANG definitions for 512 configuring qos specification implementations. 514 Copyright (c) 2021 IETF Trust and the persons identified as 515 authors of the code. All rights reserved. 517 Redistribution and use in source and binary forms, with or 518 without modification, is permitted pursuant to, and subject 519 to the license terms contained in, the Simplified BSD License 520 set forth in Section 4.c of the IETF Trust's Legal Provisions 521 Relating to IETF Documents 522 (http://trustee.ietf.org/license-info). 524 This version of this YANG module is part of RFC XXXX; see 525 the RFC itself for full legal notices."; 527 revision 2022-03-06 { 528 description 529 "Initial version"; 530 reference 531 "RFC XXXX: YANG Models for Quality of Service (QoS)."; 532 } 534 feature policy-inline-classifier-config { 535 description 536 " This feature allows classifier configuration 537 directly under policy."; 538 } 539 feature classifier-template-feature { 540 description 541 " This feature allows classifier as template configuration 542 in a policy."; 543 } 544 feature match-any-filter-type-support { 545 description 546 " This feature allows classifier configuration 547 directly under policy."; 548 } 550 identity filter-type { 551 description 552 "This is identity of base filter-type"; 553 } 554 identity match-filter-operation { 555 description 556 "filter match logical operation type"; 557 } 558 identity match-all-filter { 559 base match-filter-operation; 560 description 561 "Classifier entry filter logical AND operation"; 562 } 563 identity match-any-filter { 564 if-feature "match-any-filter-type-support"; 565 base match-filter-operation; 566 description 567 "Classifier entry filter logical OR operation"; 568 } 569 grouping filters { 570 description 571 "Filters types in a Classifier entry"; 572 leaf type { 573 type identityref { 574 base filter-type; 575 } 576 description 577 "This leaf defines type of the filter"; 578 } 579 leaf logical-not { 580 type boolean; 581 description 582 " 583 This is logical-not operator for a filter. When true, it 584 indicates filter looks for absence of a pattern defined 585 by the filter 586 "; 587 } 588 } 589 grouping generic-attr { 590 description 591 " 592 Classifier generic attributes like name, 593 description, operation type 594 "; 595 leaf name { 596 type string; 597 description 598 "classifier entry name"; 599 } 600 leaf description { 601 type string; 602 description 603 "classifier entry description statement"; 604 } 605 leaf filter-operation { 606 type identityref { 607 base match-filter-operation; 608 } 609 default "match-all-filter"; 610 description 611 "Filters are applicable as match-any or match-all filters"; 612 } 613 } 614 grouping inline-attr { 615 description 616 "attributes of inline classifier in a policy"; 617 leaf inline { 618 type boolean; 619 default "false"; 620 description 621 "Indication of inline classifier entry"; 622 } 623 leaf filter-operation { 624 type identityref { 625 base match-filter-operation; 626 } 627 default "match-all-filter"; 628 description 629 "Filters are applicable as match-any or match-all filters"; 630 } 631 list filter{ 632 if-feature policy-inline-classifier-config; 633 must " ../classifier-entry-inline = 'true' " { 634 description 635 "For inline filter configuration, inline attribute" + 636 "must be true"; 637 } 638 key "type logical-not"; 639 uses filters; 640 description 641 "Filters configured inline in a policy"; 642 } 643 } 644 container classifiers { 645 if-feature classifier-template-feature; 646 description 647 "list of classifier entry"; 648 list classifier{ 649 key "name"; 650 description 651 "each classifier entry contains a list of filters"; 652 uses generic-attr; 653 list filter { 654 key "type logical-not"; 655 uses filters; 656 description 657 "Filter entry configuration"; 658 } 659 } 660 } 661 } 662 664 Figure 8: ietf-qos-classifier module 666 5.2. ietf-qos-policy 668 file "ietf-qos-policy@2022-03-06.yang" 669 module ietf-qos-policy { 670 yang-version 1.1; 671 namespace "urn:ietf:params:xml:ns:yang:ietf-qos-policy"; 672 prefix policy; 674 import ietf-qos-classifier { 675 prefix classifier; 676 } 678 organization 679 "IETF Routing Area Working Group"; 681 contact 682 "WG Web: 683 WG List: 685 Editor: Aseem Choudhary 686 687 Editor: Mahesh Jethanandani 688 "; 690 description 691 "This module contains a collection of YANG definitions for 692 configuring qos specification implementations. 694 Copyright (c) 2021 IETF Trust and the persons identified as 695 authors of the code. All rights reserved. 697 Redistribution and use in source and binary forms, with or 698 without modification, is permitted pursuant to, and subject 699 to the license terms contained in, the Simplified BSD License 700 set forth in Section 4.c of the IETF Trust's Legal Provisions 701 Relating to IETF Documents 702 (http://trustee.ietf.org/license-info). 704 This version of this YANG module is part of RFC XXXX; see 705 the RFC itself for full legal notices."; 707 revision 2022-03-06 { 708 description 709 "Initial version"; 710 reference 711 "RFC XXXX: YANG Models for Quality of Service (QoS)."; 712 } 714 identity policy-type { 715 description 716 "This base identity type defines policy-types"; 717 } 718 grouping generic-attr { 719 description 720 "Policy Attributes"; 721 leaf name { 722 type string; 723 description 724 "policy name"; 725 } 726 leaf type { 727 type identityref { 728 base policy-type; 729 } 730 description 731 "policy type"; 732 } 733 leaf description { 734 type string; 735 description 736 "policy description"; 737 } 738 } 739 identity action-type { 740 description 741 "This base identity type defines action-types"; 742 } 743 grouping classifier-action-entry { 744 description 745 "List of Configuration of classifier & associated actions"; 746 list action { 747 key "type"; 748 ordered-by user; 749 description 750 "Configuration of classifier & associated actions"; 751 leaf type { 752 type identityref { 753 base action-type; 754 } 755 description 756 "This defines action type "; 757 } 758 choice action-params { 759 description 760 "Choice of action types"; 761 } 762 } 763 } 764 container policies{ 765 description 766 "list of policy templates"; 767 list policy{ 768 key "name type"; 769 description 770 "policy template"; 771 uses generic-attr; 772 list classifier{ 773 key "name"; 774 ordered-by user; 775 description 776 "Classifier entry configuration in a policy"; 777 leaf name { 778 type string; 779 description 780 "classifier entry name"; 781 } 782 uses classifier:inline-attr; 783 uses classifier-action-entry; 784 } 785 } 786 } 787 } 788 790 Figure 9: ietf-qos-policy module 792 5.3. ietf-qos-action 793 794 file "ietf-qos-action@2022-03-06.yang" 795 module ietf-qos-action { 796 yang-version 1.1; 797 namespace "urn:ietf:params:xml:ns:yang:ietf-qos-action"; 798 prefix action; 800 import ietf-inet-types { 801 prefix inet; 802 reference "RFC 6991: Common YANG Data Types"; 803 } 804 import ietf-qos-policy { 805 prefix policy; 806 reference "RFC XXXX: YANG Model for QoS"; 807 } 809 organization 810 "IETF Routing Area Working Group"; 812 contact 813 "WG Web: 814 WG List: 816 Editor: Aseem Choudhary 817 818 Editor: Mahesh Jethanandani 819 "; 821 description 822 "This module contains a collection of YANG definitions for 823 configuring qos specification implementations. 825 Copyright (c) 2021 IETF Trust and the persons identified as 826 authors of the code. All rights reserved. 828 Redistribution and use in source and binary forms, with or 829 without modification, is permitted pursuant to, and subject 830 to the license terms contained in, the Simplified BSD License 831 set forth in Section 4.c of the IETF Trust's Legal Provisions 832 Relating to IETF Documents 833 (http://trustee.ietf.org/license-info). 835 This version of this YANG module is part of RFC XXXX; see 836 the RFC itself for full legal notices."; 838 revision 2022-03-06 { 839 description 840 "Initial version"; 842 reference 843 "RFC XXXX: YANG Models for Quality of Service (QoS)."; 844 } 846 feature meter-template-support { 847 description 848 " This feature allows support of meter-template."; 849 } 850 feature meter-inline-feature { 851 description 852 " This feature allows support of meter-inline configuration."; 853 } 854 feature meter-reference-feature { 855 description 856 " This feature allows support of meter by 857 reference configuration."; 858 } 859 feature queue-action-support { 860 description 861 " This feature allows support of queue action 862 configuration in policy."; 863 } 864 feature scheduler-action-support { 865 description 866 " This feature allows support of scheduler 867 configuration in policy."; 868 } 869 feature child-policy-feature { 870 description 871 " This feature allows configuration of hierarchical policy."; 872 } 873 feature count-feature { 874 description 875 "This feature allows action configuration to enable 876 counter in a classifier"; 877 } 878 feature named-counter-feature { 879 description 880 "This feature allows action configuration to enable 881 named counter in a classifier"; 882 } 883 feature traffic-group-feature { 884 description 885 "traffic-group action support"; 886 } 887 feature burst-time-unit-support { 888 description 889 "This feature allows burst unit to be configured as 890 time duration."; 891 } 893 identity rate-unit-type { 894 description 895 "base rate-unit type"; 896 } 897 identity bits-per-second { 898 base rate-unit-type; 899 description 900 "bits per second identity"; 901 } 902 identity kilo-bits-per-second { 903 base rate-unit-type; 904 description 905 "kilo bits per second identity"; 906 } 907 identity mega-bits-per-second { 908 base rate-unit-type; 909 description 910 "mega bits per second identity"; 911 } 912 identity giga-bits-per-second { 913 base rate-unit-type; 914 description 915 "mega bits per second identity"; 916 } 917 identity percent { 918 base rate-unit-type; 919 description 920 "percentage"; 921 } 922 identity burst-unit-type { 923 description 924 "base burst-unit type"; 925 } 926 identity bytes { 927 base burst-unit-type; 928 description 929 "bytes"; 930 } 931 identity kilo-bytes { 932 base burst-unit-type; 933 description 934 "kilo bytes"; 935 } 936 identity mega-bytes { 937 base burst-unit-type; 938 description 939 "mega bytes"; 940 } 941 identity millisecond { 942 if-feature burst-time-unit-support; 943 base burst-unit-type; 944 description 945 "milli seconds"; 946 } 947 identity microsecond { 948 if-feature burst-time-unit-support; 949 base burst-unit-type; 950 description 951 "micro seconds"; 952 } 953 identity red-threshold-unit { 954 description 955 "base red-unit type"; 956 } 957 identity red-threshold-bytes { 958 base red-threshold-unit; 959 description 960 "bytes"; 961 } 962 identity red-threshold-kb { 963 base red-threshold-unit; 964 description 965 "kilo bytes"; 966 } 967 identity red-threshold-mb { 968 base red-threshold-unit; 969 description 970 "mega bytes"; 971 } 972 identity red-threshold-ms { 973 base red-threshold-unit; 974 description 975 "milli seconds"; 976 } 977 identity red-threshold-us { 978 base red-threshold-unit; 979 description 980 "micro seconds"; 981 } 982 identity red-threshold-pc { 983 base red-threshold-unit; 984 description 985 "per-centage"; 987 } 988 identity red-theshold-pt { 989 base red-threshold-unit; 990 description 991 "per-thousand"; 992 } 993 identity red-threshold-pm { 994 base red-threshold-unit; 995 description 996 "per-million"; 997 } 998 identity wred-color-type { 999 description 1000 "base wred color type"; 1001 } 1002 identity wred-color-dscp { 1003 base wred-color-type; 1004 description 1005 "dscp wred color type"; 1006 } 1007 identity probability-unit { 1008 description 1009 "base probability unit type"; 1010 } 1011 identity probability-pc { 1012 base probability-unit; 1013 description 1014 "probability in percentage"; 1015 } 1016 identity probability-pt { 1017 base probability-unit; 1018 description 1019 "probability in per thousand"; 1020 } 1021 identity probability-pm { 1022 base probability-unit; 1023 description 1024 "probability in per million"; 1025 } 1026 identity probability-denominator { 1027 base probability-unit; 1028 description 1029 "probability value is denominator value 1030 while numerator is always 1"; 1031 } 1032 identity dscp-marking { 1033 base policy:action-type; 1034 description 1035 "dscp marking action type"; 1036 } 1037 identity meter-inline { 1038 if-feature meter-inline-feature; 1039 base policy:action-type; 1040 description 1041 "meter-inline action type"; 1042 } 1043 identity meter-reference { 1044 if-feature meter-reference-feature; 1045 base policy:action-type; 1046 description 1047 "meter reference action type"; 1048 } 1049 identity queue { 1050 if-feature queue-action-support; 1051 base policy:action-type; 1052 description 1053 "queue action type"; 1054 } 1055 identity scheduler { 1056 if-feature scheduler-action-support; 1057 base policy:action-type; 1058 description 1059 "scheduler action type"; 1060 } 1061 identity discard { 1062 base policy:action-type; 1063 description 1064 "discard action type"; 1065 } 1066 identity child-policy { 1067 if-feature child-policy-feature; 1068 base policy:action-type; 1069 description 1070 "child-policy action type"; 1071 } 1072 identity count { 1073 if-feature count-feature; 1074 base policy:action-type; 1075 description 1076 "count action type"; 1077 } 1078 identity named-counter { 1079 if-feature named-counter-feature; 1080 base policy:action-type; 1081 description 1082 "name counter action type"; 1084 } 1086 identity meter-type { 1087 description 1088 "This base identity type defines meter types"; 1089 } 1090 identity one-rate-two-color-meter-type { 1091 base meter-type; 1092 description 1093 "one rate two color meter type"; 1094 } 1095 identity one-rate-tri-color-meter-type { 1096 base meter-type; 1097 description 1098 "one rate three color meter type"; 1099 } 1100 identity two-rate-tri-color-meter-type { 1101 base meter-type; 1102 description 1103 "two rate three color meter action type"; 1104 } 1106 identity drop-type { 1107 description 1108 "drop algorithm"; 1109 } 1110 identity tail-drop { 1111 base drop-type; 1112 description 1113 "tail drop algorithm"; 1114 } 1115 identity red { 1116 base drop-type; 1117 description 1118 "Random Early Detect drop algorithm"; 1119 } 1120 identity wred { 1121 base drop-type; 1122 description 1123 "Weighted Random Early Detect drop algorithm"; 1124 } 1126 identity conform-2color-meter-action-type { 1127 description 1128 "action type in a meter"; 1129 } 1130 identity exceed-2color-meter-action-type { 1131 description 1132 "action type in a meter"; 1133 } 1134 identity conform-3color-meter-action-type { 1135 description 1136 "action type in a meter"; 1137 } 1138 identity exceed-3color-meter-action-type { 1139 description 1140 "action type in a meter"; 1141 } 1142 identity violate-3color-meter-action-type { 1143 description 1144 "action type in a meter"; 1145 } 1147 grouping rate-value-unit { 1148 leaf rate-value { 1149 type uint64; 1150 description 1151 "rate value"; 1152 } 1153 leaf rate-unit { 1154 type identityref { 1155 base rate-unit-type; 1156 } 1157 description 1158 "rate unit"; 1159 } 1160 description 1161 "rate value and unit grouping"; 1162 } 1163 grouping burst { 1164 description 1165 "burst value and unit configuration"; 1166 leaf burst-value { 1167 type uint64; 1168 description 1169 "burst value"; 1170 } 1171 leaf burst-unit { 1172 type identityref { 1173 base burst-unit-type; 1174 } 1175 description 1176 "burst unit"; 1177 } 1178 } 1179 grouping threshold { 1180 description 1181 "Threshold Parameters"; 1182 container threshold { 1183 description 1184 "threshold"; 1185 choice threshold-type { 1186 case size { 1187 leaf threshold-size { 1188 type uint64; 1189 units "bytes"; 1190 description 1191 "Threshold size"; 1192 } 1193 } 1194 case interval { 1195 leaf threshold-interval { 1196 type uint64; 1197 units "microsecond"; 1198 description 1199 "Threshold interval"; 1200 } 1201 } 1202 description 1203 "Choice of threshold type"; 1204 } 1205 } 1206 } 1208 grouping drop { 1209 container drop { 1210 leaf drop-action { 1211 type empty; 1212 description 1213 "always drop algorithm"; 1214 } 1215 description 1216 "the drop action"; 1217 } 1218 description 1219 "always drop grouping"; 1220 } 1222 grouping queuelimit { 1223 container qlimit-thresh { 1224 uses threshold; 1225 description 1226 "the queue limit"; 1228 } 1229 description 1230 "the queue limit beyond which queue will not hold any packet"; 1231 } 1233 grouping conform-2color-meter-action-params { 1234 description 1235 "meter action parameters"; 1236 list conform-2color-meter-action-params { 1237 key "conform-2color-meter-action-type"; 1238 ordered-by user; 1239 description 1240 "Configuration of basic-meter & associated actions"; 1241 leaf conform-2color-meter-action-type { 1242 type identityref { 1243 base conform-2color-meter-action-type; 1244 } 1245 description 1246 "meter action type"; 1247 } 1248 choice conform-2color-meter-action-val { 1249 description 1250 " meter action based on choice of meter action type"; 1251 } 1252 } 1253 } 1255 grouping exceed-2color-meter-action-params { 1256 description 1257 "meter action parameters"; 1258 list exceed-2color-meter-action-params { 1259 key "exceed-2color-meter-action-type"; 1260 ordered-by user; 1261 description 1262 "Configuration of basic-meter & associated actions"; 1263 leaf exceed-2color-meter-action-type { 1264 type identityref { 1265 base exceed-2color-meter-action-type; 1266 } 1267 description 1268 "meter action type"; 1269 } 1270 choice exceed-2color-meter-action-val { 1271 description 1272 " meter action based on choice of meter action type"; 1273 } 1274 } 1275 } 1276 grouping conform-3color-meter-action-params { 1277 description 1278 "meter action parameters"; 1279 list conform-3color-meter-action-params { 1280 key "conform-3color-meter-action-type"; 1281 ordered-by user; 1282 description 1283 "Configuration of basic-meter & associated actions"; 1284 leaf conform-3color-meter-action-type { 1285 type identityref { 1286 base conform-3color-meter-action-type; 1287 } 1288 description 1289 "meter action type"; 1290 } 1291 choice conform-3color-meter-action-val { 1292 description 1293 " meter action based on choice of meter action type"; 1294 } 1295 } 1296 } 1298 grouping exceed-3color-meter-action-params { 1299 description 1300 "meter action parameters"; 1301 list exceed-3color-meter-action-params { 1302 key "exceed-3color-meter-action-type"; 1303 ordered-by user; 1304 description 1305 "Configuration of basic-meter & associated actions"; 1306 leaf exceed-3color-meter-action-type { 1307 type identityref { 1308 base exceed-3color-meter-action-type; 1309 } 1310 description 1311 "meter action type"; 1312 } 1313 choice exceed-3color-meter-action-val { 1314 description 1315 " meter action based on choice of meter action type"; 1316 } 1317 } 1318 } 1320 grouping violate-3color-meter-action-params { 1321 description 1322 "meter action parameters"; 1323 list violate-3color-meter-action-params { 1324 key "violate-3color-meter-action-type"; 1325 ordered-by user; 1326 description 1327 "Configuration of basic-meter & associated actions"; 1328 leaf violate-3color-meter-action-type { 1329 type identityref { 1330 base violate-3color-meter-action-type; 1331 } 1332 description 1333 "meter action type"; 1334 } 1335 choice violate-3color-meter-action-val { 1336 description 1337 " meter action based on choice of meter action type"; 1338 } 1339 } 1340 } 1342 grouping one-rate-two-color-meter { 1343 container one-rate-two-color-meter { 1344 description 1345 "single rate two color marker meter"; 1346 leaf committed-rate-value { 1347 type uint64; 1348 description 1349 "committed rate value"; 1350 } 1351 leaf committed-rate-unit { 1352 type identityref { 1353 base rate-unit-type; 1354 } 1355 description 1356 "committed rate unit"; 1357 } 1358 leaf committed-burst-value { 1359 type uint64; 1360 description 1361 "burst value"; 1362 } 1363 leaf committed-burst-unit { 1364 type identityref { 1365 base burst-unit-type; 1366 } 1367 description 1368 "committed burst unit"; 1369 } 1370 container conform-action { 1371 uses conform-2color-meter-action-params; 1372 description 1373 "conform action"; 1374 } 1375 container exceed-action { 1376 uses exceed-2color-meter-action-params; 1377 description 1378 "exceed action"; 1379 } 1380 } 1381 description 1382 "single rate two color marker meter attributes"; 1383 } 1385 grouping one-rate-tri-color-meter { 1386 container one-rate-tri-color-meter { 1387 description 1388 "single rate three color meter"; 1389 leaf committed-rate-value { 1390 type uint64; 1391 description 1392 "meter rate"; 1393 } 1394 leaf committed-rate-unit { 1395 type identityref { 1396 base rate-unit-type; 1397 } 1398 description 1399 "committed rate unit"; 1400 } 1401 leaf committed-burst-value { 1402 type uint64; 1403 description 1404 "committed burst size"; 1405 } 1406 leaf committed-burst-unit { 1407 type identityref { 1408 base burst-unit-type; 1409 } 1410 description 1411 "committed burst unit"; 1412 } 1413 leaf excess-burst-value { 1414 type uint64; 1415 description 1416 "excess burst size"; 1417 } 1418 leaf excess-burst-unit { 1419 type identityref { 1420 base burst-unit-type; 1421 } 1422 description 1423 "excess burst unit"; 1424 } 1425 container conform-action { 1426 uses conform-3color-meter-action-params; 1427 description 1428 "conform, or green action"; 1429 } 1430 container exceed-action { 1431 uses exceed-3color-meter-action-params; 1432 description 1433 "exceed, or yellow action"; 1434 } 1435 container violate-action { 1436 uses violate-3color-meter-action-params; 1437 description 1438 "violate, or red action"; 1439 } 1440 } 1441 description 1442 "one-rate-tri-color-meter attributes"; 1443 } 1445 grouping two-rate-tri-color-meter { 1446 container two-rate-tri-color-meter { 1447 description 1448 "two rate three color meter"; 1449 leaf committed-rate-value { 1450 type uint64; 1451 units "bits-per-second"; 1452 description 1453 "committed rate"; 1454 } 1455 leaf committed-rate-unit { 1456 type identityref { 1457 base rate-unit-type; 1458 } 1459 description 1460 "committed rate unit"; 1461 } 1462 leaf committed-burst-value { 1463 type uint64; 1464 description 1465 "commited burst size"; 1466 } 1467 leaf committed-burst-unit { 1468 type identityref { 1469 base burst-unit-type; 1470 } 1471 description 1472 "committed burst unit"; 1473 } 1474 leaf peak-rate-value { 1475 type uint64; 1476 description 1477 "peak rate"; 1478 } 1479 leaf peak-rate-unit { 1480 type identityref { 1481 base rate-unit-type; 1482 } 1483 description 1484 "committed rate unit"; 1485 } 1486 leaf peak-burst-value { 1487 type uint64; 1488 description 1489 "commited burst size"; 1490 } 1491 leaf peak-burst-unit { 1492 type identityref { 1493 base burst-unit-type; 1494 } 1495 description 1496 "peak burst unit"; 1497 } 1498 container conform-action { 1499 uses conform-3color-meter-action-params; 1500 description 1501 "conform, or green action"; 1502 } 1503 container exceed-action { 1504 uses exceed-3color-meter-action-params; 1505 description 1506 "exceed, or yellow action"; 1507 } 1508 container violate-action { 1509 uses violate-3color-meter-action-params; 1510 description 1511 "exceed, or red action"; 1512 } 1513 } 1514 description 1515 "two-rate-tri-color-meter attributes"; 1517 } 1519 grouping meter { 1520 choice meter-type { 1521 case one-rate-two-color-meter-type { 1522 uses one-rate-two-color-meter; 1523 description 1524 "basic meter"; 1525 } 1526 case one-rate-tri-color-meter-type { 1527 uses one-rate-tri-color-meter; 1528 description 1529 "one rate tri-color meter"; 1530 } 1531 case two-rate-tri-color-meter-type { 1532 uses two-rate-tri-color-meter; 1533 description 1534 "two rate tri-color meter"; 1535 } 1536 description 1537 " meter action based on choice of meter action type"; 1538 } 1539 description 1540 "meter attributes"; 1541 } 1543 container meters { 1544 description 1545 "list of meter templates"; 1546 list meter { 1547 if-feature meter-template-support; 1548 key "name"; 1549 description 1550 "meter entry template"; 1551 leaf name { 1552 type string; 1553 description 1554 "meter identifier"; 1555 } 1556 uses meter; 1557 } 1558 } 1560 grouping meter-reference { 1561 container meter { 1562 leaf name { 1563 type string ; 1564 mandatory true; 1565 description 1566 "This leaf defines name of the meter referenced"; 1567 } 1568 leaf type { 1569 type identityref { 1570 base meter-type; 1571 } 1572 mandatory true; 1573 description 1574 "This leaf defines type of the meter"; 1575 } 1576 description 1577 "meter reference name"; 1578 } 1579 description 1580 "meter reference"; 1581 } 1583 grouping count { 1584 container count { 1585 if-feature count-feature; 1586 leaf count-action { 1587 type empty; 1588 description 1589 "count action"; 1590 } 1591 description 1592 "the count action"; 1593 } 1594 description 1595 "the count action grouping"; 1596 } 1598 grouping named-counter { 1599 container named-counter { 1600 if-feature named-counter-feature; 1601 leaf count-name-action { 1602 type string; 1603 description 1604 "count action"; 1605 } 1606 description 1607 "the count action"; 1608 } 1609 description 1610 "the count action grouping"; 1611 } 1612 grouping discard { 1613 container discard { 1614 leaf discard { 1615 type empty; 1616 description 1617 "discard action"; 1618 } 1619 description 1620 "discard action"; 1621 } 1622 description 1623 "discard grouping"; 1624 } 1626 grouping priority { 1627 container priority { 1628 leaf priority-level { 1629 type uint8; 1630 description 1631 "priority level"; 1632 } 1633 description 1634 "priority attributes"; 1635 } 1636 description 1637 "priority attributes grouping"; 1638 } 1639 grouping min-rate { 1640 container min-rate { 1641 uses rate-value-unit; 1642 description 1643 "min guaranteed bandwidth"; 1644 } 1645 description 1646 "minimum rate grouping"; 1647 } 1648 grouping dscp-marking { 1649 container dscp { 1650 leaf dscp { 1651 type inet:dscp; 1652 description 1653 "dscp marking"; 1654 } 1655 description 1656 "dscp marking container"; 1657 } 1658 description 1659 "dscp marking grouping"; 1661 } 1662 grouping traffic-group-marking { 1663 container traffic-group { 1664 leaf traffic-group { 1665 type string; 1666 description 1667 "traffic group marking"; 1668 } 1669 description 1670 "traffic group marking container"; 1671 } 1672 description 1673 "traffic group marking grouping"; 1674 } 1675 grouping child-policy { 1676 container child-policy { 1677 if-feature child-policy-feature; 1678 leaf policy-name { 1679 type string; 1680 description 1681 "Hierarchical Policy"; 1682 } 1683 description 1684 "Hierarchical Policy configuration container"; 1685 } 1686 description 1687 "Grouping of Hierarchical Policy configuration"; 1688 } 1689 grouping max-rate { 1690 container max-rate { 1691 uses rate-value-unit; 1692 uses burst; 1693 description 1694 "maximum rate attributes container"; 1695 } 1696 description 1697 "maximum rate attributes"; 1698 } 1699 grouping red-config-parameters { 1700 leaf min-threshold-val { 1701 type uint64; 1702 description 1703 "minimum value of red threshold"; 1704 } 1705 leaf min-threshold-unit { 1706 type identityref { 1707 base red-threshold-unit; 1708 } 1709 description 1710 "unit of minimum red threshold"; 1711 } 1712 leaf max-threshold-val { 1713 type uint64; 1714 description 1715 "maximum value of red threshold"; 1716 } 1717 leaf max-threshold-unit { 1718 type identityref { 1719 base red-threshold-unit; 1720 } 1721 description 1722 "unit of maximum red threshold"; 1723 } 1724 leaf weight { 1725 type uint8; 1726 description 1727 "the decay factor for the average queue size 1728 calculation. the numbers are 2's exponent"; 1729 } 1730 leaf max-probability-val { 1731 type uint64; 1732 description 1733 "value of maximum probability value. this value need 1734 be interpreted along with max-probability-unit"; 1735 } 1736 leaf max-probability-unit { 1737 type identityref { 1738 base probability-unit; 1739 } 1740 description 1741 "probability unit type as defined 1742 by probability-unit"; 1743 } 1744 description 1745 "Random Early Detect Configuration Parameters"; 1746 } 1747 grouping queue { 1748 container queue { 1749 uses priority; 1750 uses min-rate; 1751 uses max-rate; 1752 container algorithmic-drop { 1753 choice drop-algorithm { 1754 case tail-drop { 1755 container tail-drop { 1756 leaf tail-drop { 1757 type empty; 1758 description 1759 "tail drop algorithm"; 1760 } 1761 description 1762 "Tail Drop configuration container"; 1763 } 1764 description 1765 "Tail Drop choice"; 1766 } 1767 case red { 1768 container red { 1769 uses red-config-parameters; 1770 leaf ecn-enabled { 1771 type boolean; 1772 default "false"; 1773 description 1774 "ecn is enabled on the queue"; 1775 } 1776 description 1777 "Random Early Detect configuration"; 1778 } 1779 } 1780 case wred { 1781 container wred { 1782 list wred { 1783 key "profile"; 1784 leaf profile { 1785 type uint8; 1786 description 1787 "profile id of each wred profile"; 1788 } 1789 leaf color-type { 1790 type identityref { 1791 base wred-color-type; 1792 } 1793 description 1794 "wred color-type of each profile"; 1795 } 1796 list color-val { 1797 key "min max"; 1798 leaf min { 1799 type uint8; 1800 description 1801 "minimum value of color types"; 1802 } 1803 leaf max { 1804 type uint8; 1805 description 1806 "maximum value of color types"; 1807 } 1808 description 1809 "list of color markings which constitute 1810 a traffic profile"; 1811 } 1812 uses red-config-parameters; 1813 description 1814 "list of RED profiles each with its own 1815 threshold values"; 1816 } 1817 leaf ecn-enabled { 1818 type boolean; 1819 default "false"; 1820 description 1821 "ecn is enabled on the queue"; 1822 } 1823 description 1824 "Weighted Random Early Detect configuration"; 1825 } 1826 } 1827 description 1828 "Choice of Drop Algorithm"; 1829 } 1830 description 1831 "Algorithmic Drop configuration container"; 1832 } 1833 description 1834 "Queue configuration container"; 1835 } 1836 description 1837 "Queue grouping"; 1838 } 1839 grouping scheduler { 1840 container scheduler { 1841 uses min-rate; 1842 uses max-rate; 1843 description 1844 "Schedular configuration container"; 1845 } 1846 description 1847 "Schedular configuration grouping"; 1848 } 1849 } 1850 1852 Figure 10: ietf-qos-actions module 1854 5.4. ietf-qos-target 1856 1857 file "ietf-qos-target@2022-03-06.yang" 1858 module ietf-qos-target { 1859 yang-version 1.1; 1860 namespace "urn:ietf:params:xml:ns:yang:ietf-qos-target"; 1861 prefix target; 1863 import ietf-interfaces { 1864 prefix if; 1865 } 1866 import ietf-qos-policy { 1867 prefix policy; 1868 } 1870 organization 1871 "IETF Routing Area Working Group"; 1873 contact 1874 "WG Web: 1875 WG List: 1877 Editor: Aseem Choudhary 1878 1879 Editor: Mahesh Jethanandani 1880 1953 Figure 11: ietf-qos-target module 1955 5.5. ietf-diffserv 1957 1958 file "ietf-diffserv@2022-03-06.yang" 1959 module ietf-diffserv { 1960 yang-version 1.1; 1961 namespace "urn:ietf:params:xml:ns:yang:ietf-diffserv"; 1962 prefix diffserv; 1964 import ietf-qos-classifier { 1965 prefix classifier; 1966 } 1967 import ietf-qos-policy { 1968 prefix policy; 1969 } 1970 import ietf-qos-action { 1971 prefix action; 1972 } 1973 import ietf-inet-types { 1974 prefix inet; 1975 } 1977 organization 1978 "IETF Routing Area Working Group"; 1979 contact 1980 "WG Web: 1981 WG List: 1983 Editor: Aseem Choudhary 1984 1985 Editor: Mahesh Jethanandani 1986 = ../dscp-min" { 2115 error-message 2116 "The dscp-max must be greater than or equal to dscp-min"; 2117 } 2118 description 2119 "maximum value of dscp min-max range"; 2120 } 2121 } 2122 description 2123 "Filter grouping containing list of dscp ranges"; 2124 } 2125 grouping source-ipv4-prefix { 2126 list source-ipv4-prefix { 2127 key "source-ipv4-prefix"; 2128 description 2129 "list of source ipv4 prefix"; 2130 leaf source-ipv4-prefix { 2131 type inet:ipv4-prefix; 2132 description 2133 "source ipv4 prefix"; 2134 } 2135 } 2136 description 2137 "Filter grouping containing list of source ipv4 prefixes"; 2138 } 2139 grouping destination-ipv4-prefix { 2140 list destination-ipv4-prefix { 2141 key "destination-ipv4-prefix"; 2142 description 2143 "list of destination ipv4 prefix"; 2145 leaf destination-ipv4-prefix { 2146 type inet:ipv4-prefix; 2147 description 2148 "destination ipv4 prefix"; 2149 } 2150 } 2151 description 2152 "Filter grouping containing list of destination ipv4 prefix"; 2153 } 2154 grouping source-ipv6-prefix { 2155 list source-ipv6-prefix { 2156 key "source-ipv6-prefix"; 2157 description 2158 "list of source ipv6 prefix"; 2159 leaf source-ipv6-prefix { 2160 type inet:ipv6-prefix; 2161 description 2162 "source ipv6 prefix"; 2163 } 2164 } 2165 description 2166 "Filter grouping containing list of source ipv6 prefixes"; 2167 } 2168 grouping destination-ipv6-prefix { 2169 list destination-ipv6-prefix { 2170 key "destination-ipv6-prefix"; 2171 description 2172 "list of destination ipv4 or ipv6 prefix"; 2173 leaf destination-ipv6-prefix { 2174 type inet:ipv6-prefix; 2175 description 2176 "destination ipv6 prefix"; 2177 } 2178 } 2179 description 2180 "Filter grouping containing list of destination ipv6 prefix"; 2181 } 2182 grouping source-port { 2183 list source-port { 2184 key "source-port-min source-port-max"; 2185 description 2186 "list of ranges of source port"; 2187 leaf source-port-min { 2188 type inet:port-number; 2189 description 2190 "minimum value of source port range"; 2191 } 2192 leaf source-port-max { 2193 type inet:port-number; 2194 must ". >= ../source-port-min" { 2195 error-message 2196 "The source-port-max must be greater than or equal to 2197 source-port-min"; 2198 } 2199 description 2200 "maximum value of source port range"; 2201 } 2202 } 2203 description 2204 "Filter grouping containing list of source port ranges"; 2205 } 2206 grouping destination-port { 2207 list destination-port { 2208 key "destination-port-min destination-port-max"; 2209 description 2210 "list of ranges of destination port"; 2211 leaf destination-port-min { 2212 type inet:port-number; 2213 description 2214 "minimum value of destination port range"; 2215 } 2216 leaf destination-port-max { 2217 type inet:port-number; 2218 must ". >= ../destination-port-min" { 2219 error-message 2220 "The destination-port-max must be greater than or equal to 2221 destination-port-min"; 2222 } 2223 description 2224 "maximum value of destination port range"; 2225 } 2226 } 2227 description 2228 "Filter grouping containing list of destination port ranges"; 2229 } 2230 grouping protocol { 2231 list protocol { 2232 key "protocol-min protocol-max"; 2233 description 2234 "list of ranges of protocol values. Protocol refers to the 2235 value in the protocol field of the ipv4 header and value 2236 in the 'next-header' field of ipv6 header. In ipv6 header, 2237 'next-header' field indicates first extension header or the 2238 protocol in the 'upper-layer' header."; 2239 reference 2240 "RFC 791: Internet Protocol 2241 RFC 8200: Internet Protocol, Version 6 (IPv6) Specification"; 2242 leaf protocol-min { 2243 type uint8 { 2244 range "0..255"; 2245 } 2246 description 2247 "minimum value of protocol range"; 2248 } 2249 leaf protocol-max { 2250 type uint8 { 2251 range "0..255"; 2252 } 2253 must ". >= ../protocol-min" { 2254 error-message 2255 "The protocol-max must be greater than or equal to 2256 protocol-min"; 2257 } 2258 description 2259 "maximum value of protocol range"; 2260 } 2261 } 2262 description 2263 "Filter grouping containing list of Protocol ranges"; 2264 } 2265 grouping traffic-group { 2266 container traffic-group { 2267 leaf traffic-group-name { 2268 type string ; 2269 description 2270 "This leaf defines name of the traffic group referenced"; 2271 } 2272 description 2273 "traffic group container"; 2274 } 2275 description 2276 "traffic group grouping"; 2277 } 2279 augment "/classifier:classifiers/classifier:classifier" + 2280 "/classifier:filter" { 2281 choice filter-param { 2282 description 2283 "Choice of filter types"; 2284 case dscp { 2285 uses dscp; 2286 description 2287 "Filter containing list of dscp ranges"; 2288 } 2289 case source-ipv4-prefix { 2290 uses source-ipv4-prefix; 2291 description 2292 "Filter containing list of source ipv4 prefixes"; 2293 } 2294 case destination-ipv4-prefix { 2295 uses destination-ipv4-prefix; 2296 description 2297 "Filter containing list of destination ipv4 prefix"; 2298 } 2299 case source-ipv6-prefix { uses source-ipv6-prefix; 2300 description 2301 "Filter containing list of source ipv6 prefixes"; 2302 } 2303 case destination-ipv6-prefix { 2304 uses destination-ipv6-prefix; 2305 description 2306 "Filter containing list of destination ipv6 prefix"; 2307 } 2308 case source-port { 2309 uses source-port; 2310 description 2311 "Filter containing list of source-port ranges"; 2312 } 2313 case destination-port { 2314 uses destination-port; 2315 description 2316 "Filter containing list of destination-port ranges"; 2317 } 2318 case protocol { 2319 uses protocol; 2320 description 2321 "Filter Type Protocol"; 2322 } 2323 case traffic-group { 2324 uses traffic-group; 2325 description 2326 "Filter Type traffic-group"; 2327 } 2328 } 2329 description 2330 "augments diffserv filters to qos classifier"; 2331 } 2332 augment "/policy:policies/policy:policy/policy:classifier" + 2333 "/policy:filter" { 2334 when "../../policy:type = 'diffserv:ipv4-diffserv-policy-type' or 2335 ../../policy:type = 'diffserv:ipv6-diffserv-policy-type' or 2336 ../../policy:type = 'diffserv:diffserv-policy-type'" { 2338 description 2339 "If policy type is v4, v6 or default diffserv, 2340 this filter can be used."; 2341 } 2342 choice filter-params { 2343 description 2344 "Choice of action types"; 2345 case dscp { 2346 uses dscp; 2347 description 2348 "Filter containing list of dscp ranges"; 2349 } 2350 case source-ipv4-prefix { 2351 when "/policy:policies/policy:policy/policy:type != " + 2352 "'diffserv:ipv6-diffserv-policy-type'" { 2353 description 2354 "If policy type is v6, this filter cannot be used."; 2355 } 2356 uses source-ipv4-prefix; 2357 description 2358 "Filter containing list of source ipv4 prefixes"; 2359 } 2360 case destination-ipv4-prefix { 2361 when "/policy:policies/policy:policy/policy:type != " + 2362 "'diffserv:ipv6-diffserv-policy-type'" { 2363 description 2364 "If policy type is v6, this filter cannot be used."; 2365 } 2366 uses destination-ipv4-prefix; 2367 description 2368 "Filter containing list of destination ipv4 prefix"; 2369 } 2370 case source-ipv6-prefix { 2371 when "/policy:policies/policy:policy/policy:type != "+ 2372 "'diffserv:ipv4-diffserv-policy-type'" { 2373 description 2374 "If policy type is v4, this filter cannot be used."; 2375 } 2376 uses source-ipv6-prefix; 2377 description 2378 "Filter containing list of source ipv6 prefixes"; 2379 } 2380 case destination-ipv6-prefix { 2381 when "/policy:policies/policy:policy/policy:type != " + 2382 "'diffserv:ipv4-diffserv-policy-type'" { 2383 description 2384 "If policy type is v4, this filter cannot be used."; 2385 } 2386 uses destination-ipv6-prefix; 2387 description 2388 "Filter containing list of destination ipv6 prefix"; 2389 } 2390 case source-port { 2391 uses source-port; 2392 description 2393 "Filter containing list of source-port ranges"; 2394 } 2395 case destination-port { 2396 uses destination-port; 2397 description 2398 "Filter containing list of destination-port ranges"; 2399 } 2400 case protocol { 2401 uses protocol; 2402 description 2403 "Filter Type Protocol"; 2404 } 2405 case traffic-group { 2406 uses traffic-group; 2407 description 2408 "Filter Type traffic-group"; 2409 } 2410 } 2411 description 2412 "Augments Diffserv Classifier with common filter types"; 2413 } 2414 augment "/policy:policies/policy:policy/policy:classifier" + 2415 "/policy:action/policy:action-params" { 2416 when "../../policy:type = 'diffserv:ipv4-diffserv-policy-type' or 2417 ../../policy:type = 'diffserv:ipv6-diffserv-policy-type' or 2418 ../../policy:type = 'diffserv:diffserv-policy-type' " { 2419 description 2420 "If policy type is v4, v6 or default diffserv, 2421 these actions can be used."; 2422 } 2423 description 2424 "Augments Diffserv Policy with action configuration"; 2426 case dscp-marking { 2427 uses action:dscp-marking; 2428 } 2429 case meter-inline { 2430 if-feature action:meter-inline-feature; 2431 uses action:meter; 2432 } 2433 case meter-reference { 2434 if-feature action:meter-reference-feature; 2435 uses action:meter-reference; 2436 } 2437 case traffic-group-marking { 2438 if-feature action:traffic-group-feature; 2439 uses action:traffic-group-marking; 2440 } 2441 case child-policy { 2442 if-feature action:child-policy-feature; 2443 uses action:child-policy; 2444 } 2445 case count { 2446 if-feature action:count-feature; 2447 uses action:count; 2448 } 2449 case named-count { 2450 if-feature action:named-counter-feature; 2451 uses action:named-counter; 2452 } 2453 case queue-inline { 2454 if-feature diffserv-queue-inline-support; 2455 uses action:queue; 2456 } 2457 case scheduler-inline { 2458 if-feature diffserv-scheduler-inline-support; 2459 uses action:scheduler; 2460 } 2461 } 2462 } 2463 2465 Figure 12: ietf-diffserv module 2467 5.6. ietf-queue-policy 2469 2470 file "ietf-queue-policy@2022-03-06.yang" 2471 module ietf-queue-policy { 2472 yang-version 1.1; 2473 namespace "urn:ietf:params:xml:ns:yang:ietf-queue-policy"; 2474 prefix queue-policy; 2476 import ietf-qos-policy { 2477 prefix policy; 2478 } 2479 import ietf-qos-action { 2480 prefix action; 2481 } 2482 import ietf-diffserv { 2483 prefix diffserv; 2484 } 2486 organization 2487 "IETF Routing Area Working Group"; 2489 contact 2490 "WG Web: 2491 WG List: 2493 Editor: Aseem Choudhary 2494 2495 Editor: Mahesh Jethanandani 2496 2619 Figure 13: ietf-queue-policy module 2621 5.7. ietf-scheduler-policy 2622 2623 file "ietf-scheduler-policy@2022-03-06.yang" 2624 module ietf-scheduler-policy { 2625 yang-version 1.1; 2626 namespace "urn:ietf:params:xml:ns:yang:ietf-scheduler-policy"; 2627 prefix scheduler-policy; 2629 import ietf-qos-classifier { 2630 prefix classifier; 2631 } 2632 import ietf-qos-policy { 2633 prefix policy; 2634 } 2635 import ietf-qos-action { 2636 prefix action; 2637 } 2639 organization 2640 "IETF Routing Area Working Group"; 2642 contact 2643 "WG Web: 2644 WG List: 2646 Editor: Aseem Choudhary 2647 2648 Editor: Mahesh Jethanandani 2649 2770 Figure 14: ietf-scheduler-policy module 2772 6. IANA Considerations 2774 TBD 2776 7. Security Considerations 2778 8. Acknowledgement 2780 The authors wish to thank Ruediger Geib, Fred Baker, Greg Misky, Tom 2781 Petch, Acee Lindem, many others for their helpful comments. 2783 MITRE has approved this document for Public Release, Distribution 2784 Unlimited, with Public Release Case Number 19-3027. 2786 9. Contributors 2788 The following people have substantially contributed to the editing of 2789 this document: 2791 Norm Strahle 2792 Email: nstrahle@juniper.net . 2794 10. References 2796 10.1. Normative References 2798 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2799 Requirement Levels", BCP 14, RFC 2119, 2800 DOI 10.17487/RFC2119, March 1997, 2801 . 2803 [RFC2697] Heinanen, J. and R. Guerin, "A Single Rate Three Color 2804 Marker", RFC 2697, DOI 10.17487/RFC2697, September 1999, 2805 . 2807 [RFC2698] Heinanen, J. and R. Guerin, "A Two Rate Three Color 2808 Marker", RFC 2698, DOI 10.17487/RFC2698, September 1999, 2809 . 2811 [RFC8342] Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K., 2812 and R. Wilton, "Network Management Datastore Architecture 2813 (NMDA)", RFC 8342, DOI 10.17487/RFC8342, March 2018, 2814 . 2816 [RFC3289] Baker, F., Chan, K., and A. Smith, "Management Information 2817 Base for the Differentiated Services Architecture", 2818 RFC 3289, DOI 10.17487/RFC3289, May 2002, 2819 . 2821 [RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for 2822 the Network Configuration Protocol (NETCONF)", RFC 6020, 2823 DOI 10.17487/RFC6020, October 2010, 2824 . 2826 [RFC6991] Schoenwaelder, J., Ed., "Common YANG Data Types", 2827 RFC 6991, DOI 10.17487/RFC6991, July 2013, 2828 . 2830 [RFC7950] Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language", 2831 RFC 7950, DOI 10.17487/RFC7950, August 2016, 2832 . 2834 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2835 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 2836 May 2017, . 2838 [RFC8343] Bjorklund, M., "A YANG Data Model for Interface 2839 Management", RFC 8343, DOI 10.17487/RFC8343, March 2018, 2840 . 2842 10.2. Informative References 2844 [RFC2474] Nichols, K., Blake, S., Baker, F., and D. Black, 2845 "Definition of the Differentiated Services Field (DS 2846 Field) in the IPv4 and IPv6 Headers", RFC 2474, 2847 DOI 10.17487/RFC2474, December 1998, 2848 . 2850 [RFC2475] Blake, S., Black, D., Carlson, M., Davies, E., Wang, Z., 2851 and W. Weiss, "An Architecture for Differentiated 2852 Services", RFC 2475, DOI 10.17487/RFC2475, December 1998, 2853 . 2855 [RFC8340] Bjorklund, M. and L. Berger, Ed., "YANG Tree Diagrams", 2856 BCP 215, RFC 8340, DOI 10.17487/RFC8340, March 2018, 2857 . 2859 Appendix A. Company A, Company B and Company C examples 2861 Company A, Company B and Company C Diffserv modules augments all the 2862 filter types of the QoS classifier module as well as the QoS policy 2863 module that allow it to define marking, metering, min-rate, max-rate 2864 actions. Queuing and metering counters are realized by augmenting of 2865 the QoS target module. 2867 A.1. Example of Company A Diffserv Model 2869 The following Company A vendor example augments the qos and diffserv 2870 model, demonstrating some of the following functionality: 2872 - use of template based classifier definitions 2874 - use of single policy type modelling queue, scheduler policy, and a 2875 filter policy. All of these policies either augment the qos policy 2876 or the diffserv modules 2878 - use of inline actions in a policy 2880 - flexibility in marking dscp or metadata at ingress and/or egress. 2882 module example-compa-diffserv { 2883 yang-version 1.1; 2884 namespace "urn:ietf:params:xml:ns:yang:example-compa-diffserv"; 2885 prefix example; 2887 import ietf-qos-classifier { 2888 prefix classifier; 2889 reference "RFC XXXX: YANG Model for QoS"; 2890 } 2891 import ietf-qos-policy { 2892 prefix policy; 2893 reference "RFC XXXX: YANG Model for QoS"; 2894 } 2895 import ietf-qos-action { 2896 prefix action; 2897 reference "RFC XXXX: YANG Model for QoS"; 2898 } 2899 import ietf-diffserv { 2900 prefix diffserv; 2901 reference "RFC XXXX: YANG Model for QoS"; 2902 } 2904 organization "Company A"; 2905 contact 2906 "Editor: XYZ 2907 "; 2908 description 2909 "This module contains a collection of YANG definitions of 2910 companyA diffserv specification extension."; 2911 Copyright (c) 2021 IETF Trust and the persons identified as 2912 authors of the code. All rights reserved. 2913 Redistribution and use in source and binary forms, with or 2914 without modification, is permitted pursuant to, and subject 2915 to the license terms contained in, the Simplified BSD License 2916 set forth in Section 4.c of the IETF Trust's Legal Provisions 2917 Relating to IETF Documents 2918 (http://trustee.ietf.org/license-info). 2920 This version of this YANG module is part of RFC XXXX; see 2921 the RFC itself for full legal notices."; 2923 revision 2021-07-12 { 2924 description 2925 "Initial revision for diffserv actions on network packets"; 2926 reference 2927 "RFC 6020: YANG - A Data Modeling Language for the 2928 Network Configuration Protocol (NETCONF)"; 2929 } 2931 identity default-policy-type { 2932 base policy:policy-type; 2933 description 2934 "This defines default policy-type"; 2935 } 2937 identity qos-group { 2938 base classifier:filter-type; 2939 description 2940 "qos-group filter-type"; 2941 } 2943 grouping qos-group-cfg { 2944 list qos-group-cfg { 2945 key "qos-group-min qos-group-max"; 2946 description 2947 "list of dscp ranges"; 2948 leaf qos-group-min { 2949 type uint8; 2950 description 2951 "Minimum value of qos-group range"; 2952 } 2953 leaf qos-group-max { 2954 type uint8; 2955 must ". >= ../qos-group-min" { 2956 error-message 2957 "The qos-group-max must be greater than or equal to 2958 qos-group-min"; 2959 } 2960 description 2961 "maximum value of qos-group range"; 2962 } 2963 } 2964 description 2965 "Filter containing list of qos-group ranges"; 2966 } 2968 grouping wred-threshold { 2969 container wred-min-thresh { 2970 uses action:threshold; 2971 description 2972 "Minimum threshold"; 2973 } 2974 container wred-max-thresh { 2975 uses action:threshold; 2976 description 2977 "Maximum threshold"; 2978 } 2979 leaf mark-probability { 2980 type uint32 { 2981 range "1..1000"; 2982 } 2983 description 2984 "Mark probability"; 2985 } 2986 description 2987 "WRED threshold attributes"; 2988 } 2990 grouping randomdetect { 2991 leaf exp-weighting-const { 2992 type uint32; 2993 description 2994 "Exponential weighting constant factor for wred profile"; 2995 } 2996 uses wred-threshold; 2997 description 2998 "Random detect attributes"; 2999 } 3001 augment "/classifier:classifiers/" + 3002 "classifier:classifier-entry/" + 3003 "classifier:filter-entry/diffserv:filter-param" { 3004 case qos-group { 3005 uses qos-group-cfg; 3006 description 3007 "Filter containing list of qos-group ranges. 3008 Qos-group represent packet metadata information 3009 in a device. "; 3010 } 3011 description 3012 "augmentation of classifier filters"; 3013 } 3014 augment "/policy:policies/policy:policy-entry/" + 3015 "policy:classifier-entry/" + 3016 "policy:classifier-action-entry-cfg/" + 3017 "policy:action-cfg-params" { 3018 case random-detect { 3019 uses randomdetect; 3020 } 3021 description 3022 "Augment the actions to policy entry"; 3023 } 3025 augment "/policy:policies" + 3026 "/policy:policy-entry" + 3027 "/policy:classifier-entry" + 3028 "/policy:classifier-action-entry-cfg" + 3029 "/policy:action-cfg-params" + 3030 "/diffserv:meter-inline" + 3031 "/diffserv:meter-type" + 3032 "/diffserv:one-rate-two-color-meter-type" + 3033 "/diffserv:one-rate-two-color-meter" + 3034 "/diffserv:conform-action" + 3035 "/diffserv:conform-2color-meter-action-params" + 3036 "/diffserv:conform-2color-meter-action-val" { 3038 description 3039 "augment the one-rate-two-color meter conform 3040 with actions"; 3041 case meter-action-drop { 3042 description 3043 "meter drop"; 3044 uses action:drop; 3045 } 3046 case meter-action-mark-dscp { 3047 description 3048 "meter action dscp marking"; 3049 uses action:dscp-marking; 3050 } 3052 } 3053 augment "/policy:policies" + 3054 "/policy:policy-entry" + 3055 "/policy:classifier-entry" + 3056 "/policy:classifier-action-entry-cfg" + 3057 "/policy:action-cfg-params" + 3058 "/diffserv:meter-inline" + 3059 "/diffserv:meter-type" + 3060 "/diffserv:one-rate-two-color-meter-type" + 3061 "/diffserv:one-rate-two-color-meter" + 3062 "/diffserv:exceed-action" + 3063 "/diffserv:exceed-2color-meter-action-params" + 3064 "/diffserv:exceed-2color-meter-action-val" { 3066 description 3067 "augment the one-rate-two-color meter exceed 3068 with actions"; 3069 case meter-action-drop { 3070 description 3071 "meter drop"; 3072 uses action:drop; 3073 } 3074 case meter-action-mark-dscp { 3075 description 3076 "meter action dscp marking"; 3077 uses action:dscp-marking; 3078 } 3079 } 3080 augment "/policy:policies" + 3081 "/policy:policy-entry" + 3082 "/policy:classifier-entry" + 3083 "/policy:classifier-action-entry-cfg" + 3084 "/policy:action-cfg-params" + 3085 "/diffserv:meter-inline" + 3086 "/diffserv:meter-type" + 3087 "/diffserv:one-rate-tri-color-meter-type" + 3088 "/diffserv:one-rate-tri-color-meter" + 3089 "/diffserv:conform-action" + 3090 "/diffserv:conform-3color-meter-action-params" + 3091 "/diffserv:conform-3color-meter-action-val" { 3093 description 3094 "augment the one-rate-tri-color meter conform 3095 with actions"; 3096 case meter-action-drop { 3097 description 3098 "meter drop"; 3099 uses action:drop; 3101 } 3102 case meter-action-mark-dscp { 3103 description 3104 "meter action dscp marking"; 3105 uses action:dscp-marking; 3106 } 3107 } 3108 augment "/policy:policies" + 3109 "/policy:policy-entry" + 3110 "/policy:classifier-entry" + 3111 "/policy:classifier-action-entry-cfg" + 3112 "/policy:action-cfg-params" + 3113 "/diffserv:meter-inline" + 3114 "/diffserv:meter-type" + 3115 "/diffserv:one-rate-tri-color-meter-type" + 3116 "/diffserv:one-rate-tri-color-meter" + 3117 "/diffserv:exceed-action" + 3118 "/diffserv:exceed-3color-meter-action-params" + 3119 "/diffserv:exceed-3color-meter-action-val" { 3121 description 3122 "augment the one-rate-tri-color meter exceed 3123 with actions"; 3124 case meter-action-drop { 3125 description 3126 "meter drop"; 3127 uses action:drop; 3128 } 3129 case meter-action-mark-dscp { 3130 description 3131 "meter action dscp marking"; 3132 uses action:dscp-marking; 3133 } 3134 } 3135 augment "/policy:policies" + 3136 "/policy:policy-entry" + 3137 "/policy:classifier-entry" + 3138 "/policy:classifier-action-entry-cfg" + 3139 "/policy:action-cfg-params" + 3140 "/diffserv:meter-inline" + 3141 "/diffserv:meter-type" + 3142 "/diffserv:one-rate-tri-color-meter-type" + 3143 "/diffserv:one-rate-tri-color-meter" + 3144 "/diffserv:violate-action" + 3145 "/diffserv:violate-3color-meter-action-params" + 3146 "/diffserv:violate-3color-meter-action-val" { 3147 description 3148 "augment the one-rate-tri-color meter conform 3149 with actions"; 3150 case meter-action-drop { 3151 description 3152 "meter drop"; 3153 uses action:drop; 3154 } 3155 case meter-action-mark-dscp { 3156 description 3157 "meter action dscp marking"; 3158 uses action:dscp-marking; 3159 } 3160 } 3162 augment "/policy:policies" + 3163 "/policy:policy-entry" + 3164 "/policy:classifier-entry" + 3165 "/policy:classifier-action-entry-cfg" + 3166 "/policy:action-cfg-params" + 3167 "/diffserv:meter-inline" + 3168 "/diffserv:meter-type" + 3169 "/diffserv:two-rate-tri-color-meter-type" + 3170 "/diffserv:two-rate-tri-color-meter" + 3171 "/diffserv:conform-action" + 3172 "/diffserv:conform-3color-meter-action-params" + 3173 "/diffserv:conform-3color-meter-action-val" { 3175 description 3176 "augment the one-rate-tri-color meter conform 3177 with actions"; 3178 case meter-action-drop { 3179 description 3180 "meter drop"; 3181 uses action:drop; 3182 } 3183 case meter-action-mark-dscp { 3184 description 3185 "meter action dscp marking"; 3186 uses action:dscp-marking; 3187 } 3188 } 3189 augment "/policy:policies" + 3190 "/policy:policy-entry" + 3191 "/policy:classifier-entry" + 3192 "/policy:classifier-action-entry-cfg" + 3193 "/policy:action-cfg-params" + 3194 "/diffserv:meter-inline" + 3195 "/diffserv:meter-type" + 3196 "/diffserv:two-rate-tri-color-meter-type" + 3197 "/diffserv:two-rate-tri-color-meter" + 3198 "/diffserv:exceed-action" + 3199 "/diffserv:exceed-3color-meter-action-params" + 3200 "/diffserv:exceed-3color-meter-action-val" { 3202 description 3203 "augment the two-rate-tri-color meter exceed 3204 with actions"; 3205 case meter-action-drop { 3206 description 3207 "meter drop"; 3208 uses action:drop; 3209 } 3210 case meter-action-mark-dscp { 3211 description 3212 "meter action dscp marking"; 3213 uses action:dscp-marking; 3214 } 3215 } 3216 augment "/policy:policies" + 3217 "/policy:policy-entry" + 3218 "/policy:classifier-entry" + 3219 "/policy:classifier-action-entry-cfg" + 3220 "/policy:action-cfg-params" + 3221 "/diffserv:meter-inline" + 3222 "/diffserv:meter-type" + 3223 "/diffserv:two-rate-tri-color-meter-type" + 3224 "/diffserv:two-rate-tri-color-meter" + 3225 "/diffserv:violate-action" + 3226 "/diffserv:violate-3color-meter-action-params" + 3227 "/diffserv:violate-3color-meter-action-val" { 3228 description 3229 "augment the two-rate-tri-color meter violate 3230 with actions"; 3231 case meter-action-drop { 3232 description 3233 "meter drop"; 3234 uses action:drop; 3235 } 3236 case meter-action-mark-dscp { 3237 description 3238 "meter action dscp marking"; 3239 uses action:dscp-marking; 3240 } 3241 } 3242 augment "/policy:policies" + 3243 "/policy:policy-entry" + 3244 "/policy:classifier-entry" + 3245 "/policy:classifier-action-entry-cfg" + 3246 "/policy:action-cfg-params" + 3247 "/diffserv:meter-inline" + 3248 "/diffserv:meter-type" + 3249 "/diffserv:one-rate-two-color-meter-type" + 3250 "/diffserv:one-rate-two-color-meter" { 3251 description 3252 "augment the one-rate-two-color meter with" + 3253 "color classifiers"; 3254 container conform-color { 3255 uses classifier:classifier-entry-generic-attr; 3256 description 3257 "conform color classifier container"; 3258 } 3259 container exceed-color { 3260 uses classifier:classifier-entry-generic-attr; 3261 description 3262 "exceed color classifier container"; 3263 } 3264 } 3265 augment "/policy:policies" + 3266 "/policy:policy-entry" + 3267 "/policy:classifier-entry" + 3268 "/policy:classifier-action-entry-cfg" + 3269 "/policy:action-cfg-params" + 3270 "/diffserv:meter-inline" + 3271 "/diffserv:meter-type" + 3272 "/diffserv:one-rate-tri-color-meter-type" + 3273 "/diffserv:one-rate-tri-color-meter" { 3274 description 3275 "augment the one-rate-tri-color meter with" + 3276 "color classifiers"; 3277 container conform-color { 3278 uses classifier:classifier-entry-generic-attr; 3279 description 3280 "conform color classifier container"; 3281 } 3282 container exceed-color { 3283 uses classifier:classifier-entry-generic-attr; 3284 description 3285 "exceed color classifier container"; 3286 } 3287 container violate-color { 3288 uses classifier:classifier-entry-generic-attr; 3289 description 3290 "violate color classifier container"; 3291 } 3292 } 3293 augment "/policy:policies" + 3294 "/policy:policy-entry" + 3295 "/policy:classifier-entry" + 3296 "/policy:classifier-action-entry-cfg" + 3297 "/policy:action-cfg-params" + 3298 "/diffserv:meter-inline" + 3299 "/diffserv:meter-type" + 3300 "/diffserv:two-rate-tri-color-meter-type" + 3301 "/diffserv:two-rate-tri-color-meter" { 3302 description 3303 "augment the two-rate-tri-color meter with" + 3304 "color classifiers"; 3305 container conform-color { 3306 uses classifier:classifier-entry-generic-attr; 3307 description 3308 "conform color classifier container"; 3309 } 3310 container exceed-color { 3311 uses classifier:classifier-entry-generic-attr; 3312 description 3313 "exceed color classifier container"; 3314 } 3315 container violate-color { 3316 uses classifier:classifier-entry-generic-attr; 3317 description 3318 "violate color classifier container"; 3319 } 3320 } 3321 } 3323 A.2. Example of Company B Diffserv Model 3325 The following vendor example augments the qos and diffserv model, 3326 demonstrating some of the following functionality: 3328 - use of inline classifier definitions (defined inline in the policy 3329 vs referencing an externally defined classifier) 3331 - use of mulitple policy types, e.g. a queue policy, a scheduler 3332 policy, and a filter policy. All of these policies either augment 3333 the qos policy or the diffserv modules 3335 - use of a queue module, which uses and extends the queue grouping 3336 from the ietf-qos-action module 3338 - use of meter templates (v.s. meter inline) 3340 - use of internal meta data for classification and marking 3341 module example-compb-diffserv-filter-policy { 3342 yang-version 1.1; 3343 namespace "urn:ietf:params:xml:ns:yang:" + 3344 "example-compb-diffserv-filter-policy"; 3345 prefix compb-filter-policy; 3347 import ietf-qos-classifier { 3348 prefix classifier; 3349 reference "RFC XXXX: YANG Model for QoS"; 3350 } 3351 import ietf-qos-policy { 3352 prefix policy; 3353 reference "RFC XXXX: YANG Model for QoS"; 3354 } 3355 import ietf-qos-action { 3356 prefix action; 3357 reference "RFC XXXX: YANG Model for QoS"; 3358 } 3359 import ietf-diffserv { 3360 prefix diffserv; 3361 reference "RFC XXXX: YANG Model for QoS"; 3362 } 3364 organization "Company B"; 3365 contact 3366 "Editor: XYZ 3367 "; 3369 description 3370 "This module contains a collection of YANG definitions for 3371 configuring diffserv specification implementations. 3372 Copyright (c) 2021 IETF Trust and the persons identified as 3373 authors of the code. All rights reserved. 3374 Redistribution and use in source and binary forms, with or 3375 without modification, is permitted pursuant to, and subject 3376 to the license terms contained in, the Simplified BSD License 3377 set forth in Section 4.c of the IETF Trust's Legal Provisions 3378 Relating to IETF Documents 3379 (http://trustee.ietf.org/license-info). 3381 This version of this YANG module is part of RFC XXXX; see 3382 the RFC itself for full legal notices."; 3384 revision 2021-07-12 { 3385 description 3386 "Initial revision of Company B diffserv policy"; 3387 reference "RFC XXXX"; 3388 } 3389 /************************************************* 3390 * Classification types 3391 *************************************************/ 3393 identity forwarding-class { 3394 base classifier:filter-type; 3395 description 3396 "Forwarding class filter type"; 3397 } 3399 identity internal-loss-priority { 3400 base classifier:filter-type; 3401 description 3402 "Internal loss priority filter type"; 3403 } 3405 grouping forwarding-class-cfg { 3406 list forwarding-class-cfg { 3407 key "forwarding-class"; 3408 description 3409 "list of forwarding-classes"; 3410 leaf forwarding-class { 3411 type string; 3412 description 3413 "Forwarding class name"; 3414 } 3415 } 3416 description 3417 "Filter containing list of forwarding classes"; 3418 } 3420 grouping loss-priority-cfg { 3421 list loss-priority-cfg { 3422 key "loss-priority"; 3423 description 3424 "list of loss-priorities"; 3425 leaf loss-priority { 3426 type enumeration { 3427 enum high { 3428 description "High Loss Priority"; 3429 } 3430 enum medium-high { 3431 description "Medium-high Loss Priority"; 3432 } 3433 enum medium-low { 3434 description "Medium-low Loss Priority"; 3435 } 3436 enum low { 3437 description "Low Loss Priority"; 3438 } 3439 } 3440 description 3441 "Loss-priority"; 3442 } 3443 } 3444 description 3445 "Filter containing list of loss priorities"; 3446 } 3448 augment "/policy:policies" + 3449 "/policy:policy-entry" + 3450 "/policy:classifier-entry" + 3451 "/policy:filter-entry" + 3452 "/diffserv:filter-params" { 3453 case forwarding-class { 3454 uses forwarding-class-cfg; 3455 description 3456 "Filter Type Internal-loss-priority"; 3457 } 3458 case internal-loss-priority { 3459 uses loss-priority-cfg; 3460 description 3461 "Filter Type Internal-loss-priority"; 3462 } 3463 description 3464 "Augments Diffserv Classifier with vendor" + 3465 " specific types"; 3466 } 3468 /************************************************* 3469 * Actions 3470 *************************************************/ 3472 identity mark-fwd-class { 3473 base policy:action-type; 3474 description 3475 "mark forwarding class action type"; 3476 } 3478 identity mark-loss-priority { 3479 base policy:action-type; 3480 description 3481 "mark loss-priority action type"; 3482 } 3484 grouping mark-fwd-class { 3485 container mark-fwd-class-cfg { 3486 leaf forwarding-class { 3487 type string; 3488 description 3489 "Forwarding class name"; 3490 } 3491 description 3492 "mark-fwd-class container"; 3493 } 3494 description 3495 "mark-fwd-class grouping"; 3496 } 3498 grouping mark-loss-priority { 3499 container mark-loss-priority-cfg { 3500 leaf loss-priority { 3501 type enumeration { 3502 enum high { 3503 description "High Loss Priority"; 3504 } 3505 enum medium-high { 3506 description "Medium-high Loss Priority"; 3507 } 3508 enum medium-low { 3509 description "Medium-low Loss Priority"; 3510 } 3511 enum low { 3512 description "Low Loss Priority"; 3513 } 3514 } 3515 description 3516 "Loss-priority"; 3517 } 3518 description 3519 "mark-loss-priority container"; 3520 } 3521 description 3522 "mark-loss-priority grouping"; 3523 } 3525 identity exceed-2color-meter-action-drop { 3526 base action:exceed-2color-meter-action-type; 3527 description 3528 "drop action type in a meter"; 3529 } 3531 identity meter-action-mark-fwd-class { 3532 base action:exceed-2color-meter-action-type; 3533 description 3534 "mark forwarding class action type"; 3535 } 3537 identity meter-action-mark-loss-priority { 3538 base action:exceed-2color-meter-action-type; 3539 description 3540 "mark loss-priority action type"; 3541 } 3543 identity violate-3color-meter-action-drop { 3544 base action:violate-3color-meter-action-type; 3545 description 3546 "drop action type in a meter"; 3547 } 3549 augment "/policy:policies/policy:policy-entry/" + 3550 "policy:classifier-entry/" + 3551 "policy:classifier-action-entry-cfg/" + 3552 "policy:action-cfg-params" { 3553 case mark-fwd-class { 3554 uses mark-fwd-class; 3555 description 3556 "Mark forwarding class in the packet"; 3557 } 3558 case mark-loss-priority { 3559 uses mark-loss-priority; 3560 description 3561 "Mark loss priority in the packet"; 3562 } 3563 case discard { 3564 uses action:discard; 3565 description 3566 "Discard action"; 3567 } 3568 description 3569 "Augments common diffserv policy actions"; 3570 } 3572 augment "/action:meter-template" + 3573 "/action:meter-entry" + 3574 "/action:meter-type" + 3575 "/action:one-rate-tri-color-meter-type" + 3576 "/action:one-rate-tri-color-meter" { 3577 leaf one-rate-color-aware { 3578 type boolean; 3579 description 3580 "This defines if the meter is color-aware"; 3581 } 3582 } 3583 augment "/action:meter-template" + 3584 "/action:meter-entry" + 3585 "/action:meter-type" + 3586 "/action:two-rate-tri-color-meter-type" + 3587 "/action:two-rate-tri-color-meter" { 3588 leaf two-rate-color-aware { 3589 type boolean; 3590 description 3591 "This defines if the meter is color-aware"; 3592 } 3593 } 3595 /* example of augmenting a meter template with a 3596 /* vendor specific action */ 3597 augment "/action:meter-template" + 3598 "/action:meter-entry" + 3599 "/action:meter-type" + 3600 "/action:one-rate-two-color-meter-type" + 3601 "/action:one-rate-two-color-meter" + 3602 "/action:exceed-action" + 3603 "/action:exceed-2color-meter-action-params" + 3604 "/action:exceed-2color-meter-action-val" { 3606 case exceed-2color-meter-action-drop { 3607 description 3608 "meter drop"; 3609 uses action:drop; 3610 } 3611 case meter-action-mark-fwd-class { 3612 uses mark-fwd-class; 3613 description 3614 "Mark forwarding class in the packet"; 3615 } 3616 case meter-action-mark-loss-priority { 3617 uses mark-loss-priority; 3618 description 3619 "Mark loss priority in the packet"; 3620 } 3621 } 3623 augment "/action:meter-template" + 3624 "/action:meter-entry" + 3625 "/action:meter-type" + 3626 "/action:two-rate-tri-color-meter-type" + 3627 "/action:two-rate-tri-color-meter" + 3628 "/action:violate-action" + 3629 "/action:violate-3color-meter-action-params" + 3630 "/action:violate-3color-meter-action-val" { 3631 case exceed-3color-meter-action-drop { 3632 description 3633 "meter drop"; 3634 uses action:drop; 3635 } 3637 description 3638 "Augment the actions to the two-color meter"; 3639 } 3641 augment "/action:meter-template" + 3642 "/action:meter-entry" + 3643 "/action:meter-type" + 3644 "/action:one-rate-tri-color-meter-type" + 3645 "/action:one-rate-tri-color-meter" + 3646 "/action:violate-action" + 3647 "/action:violate-3color-meter-action-params" + 3648 "/action:violate-3color-meter-action-val" { 3649 case exceed-3color-meter-action-drop { 3650 description 3651 "meter drop"; 3652 uses action:drop; 3653 } 3655 description 3656 "Augment the actions to basic meter"; 3657 } 3659 } 3660 module example-compb-queue-policy { 3661 yang-version 1.1; 3662 namespace "urn:ietf:params:xml:ns:yang:example-compb-queue-policy"; 3663 prefix queue-plcy; 3665 import ietf-qos-classifier { 3666 prefix classifier; 3667 reference "RFC XXXX: YANG Model for QoS"; 3668 } 3669 import ietf-qos-policy { 3670 prefix policy; 3671 reference "RFC XXXX: YANG Model for QoS"; 3672 } 3674 organization "Company B"; 3675 contact 3676 "Editor: XYZ 3677 "; 3679 description 3680 "This module defines a queue policy. The classification 3681 is based on aforwarding class, and the actions are queues. 3682 Copyright (c) 2021 IETF Trust and the persons identified as 3683 authors of the code. All rights reserved. 3684 Redistribution and use in source and binary forms, with or 3685 without modification, is permitted pursuant to, and subject 3686 to the license terms contained in, the Simplified BSD License 3687 set forth in Section 4.c of the IETF Trust's Legal Provisions 3688 Relating to IETF Documents 3689 (http://trustee.ietf.org/license-info). 3690 This version of this YANG module is part of RFC XXXX; see 3691 the RFC itself for full legal notices."; 3693 revision 2021-07-12 { 3694 description 3695 "Latest revision of Company B queue policy"; 3696 reference "RFC XXXX"; 3697 } 3699 identity forwarding-class { 3700 base classifier:filter-type; 3701 description 3702 "Forwarding class filter type"; 3703 } 3705 grouping forwarding-class-cfg { 3706 leaf forwarding-class-cfg { 3707 type string; 3708 description 3709 "forwarding-class name"; 3710 } 3711 description 3712 "Forwarding class filter"; 3713 } 3715 augment "/policy:policies" + 3716 "/policy:policy-entry" + 3717 "/policy:classifier-entry" + 3718 "/policy:filter-entry" { 3719 /* Does NOT support "logical-not" of forwarding class. 3720 Use "must"? */ 3721 choice filter-params { 3722 description 3723 "Choice of filters"; 3725 case forwarding-class-cfg { 3726 uses forwarding-class-cfg; 3727 description 3728 "Filter Type Internal-loss-priority"; 3729 } 3730 } 3731 description 3732 "Augments Diffserv Classifier with fwd class filter"; 3733 } 3735 identity compb-queue { 3736 base policy:action-type; 3737 description 3738 "compb-queue action type"; 3739 } 3741 grouping compb-queue-name { 3742 container queue-name { 3743 leaf name { 3744 type string; 3745 description 3746 "Queue class name"; 3747 } 3748 description 3749 "compb queue container"; 3750 } 3751 description 3752 "compb-queue grouping"; 3753 } 3755 augment "/policy:policies" + 3756 "/policy:policy-entry" + 3757 "/policy:classifier-entry" + 3758 "/policy:classifier-action-entry-cfg" { 3759 choice action-cfg-params { 3760 description 3761 "Choice of action types"; 3762 case compb-queue { 3763 uses compb-queue-name; 3764 } 3765 } 3766 description 3767 "Augment the queue actions to queue policy entry"; 3768 } 3769 } 3771 module example-compb-queue { 3772 yang-version 1.1; 3773 namespace "urn:ietf:params:xml:ns:yang:ietf-compb-queue"; 3774 prefix compb-queue; 3776 import ietf-qos-action { 3777 prefix action; 3778 reference "RFC XXXX: YANG Model for QoS"; 3779 } 3781 organization "Company B"; 3782 contact 3783 "Editor: XYZ 3784 "; 3786 description 3787 "This module describes a compb queue module. This is a 3788 template for a queue within a queue policy, referenced 3789 by name. 3791 This version of this YANG module is part of RFC XXXX; see 3792 the RFC itself for full legal notices."; 3794 revision 2021-07-12 { 3795 description 3796 "Latest revision of diffserv based classifier"; 3797 reference "RFC XXXX"; 3798 } 3800 container compb-queue { 3801 description 3802 "Queue used in compb architecture"; 3803 leaf name { 3804 type string; 3805 description 3806 "A unique name identifying this queue"; 3807 } 3808 uses action:queue; 3809 container excess-rate { 3810 choice excess-rate-type { 3811 case percent { 3812 leaf excess-rate-percent { 3813 type uint32 { 3814 range "1..100"; 3815 } 3816 description 3817 "excess-rate-percent"; 3818 } 3819 } 3820 case proportion { 3821 leaf excess-rate-poroportion { 3822 type uint32 { 3823 range "1..1000"; 3824 } 3825 description 3826 "excess-rate-poroportion"; 3827 } 3828 } 3829 description 3830 "Choice of excess-rate type"; 3831 } 3832 description 3833 "Excess rate value"; 3834 } 3835 leaf excess-priority { 3836 type enumeration { 3837 enum high { 3838 description "High Loss Priority"; 3839 } 3840 enum medium-high { 3841 description "Medium-high Loss Priority"; 3842 } 3843 enum medium-low { 3844 description "Medium-low Loss Priority"; 3845 } 3846 enum low { 3847 description "Low Loss Priority"; 3848 } 3849 enum none { 3850 description "No excess priority"; 3851 } 3852 } 3853 description 3854 "Priority of excess (above guaranted rate) traffic"; 3855 } 3856 container buffer-size { 3857 choice buffer-size-type { 3858 case percent { 3859 leaf buffer-size-percent { 3860 type uint32 { 3861 range "1..100"; 3862 } 3863 description 3864 "buffer-size-percent"; 3865 } 3866 } 3867 case temporal { 3868 leaf buffer-size-temporal { 3869 type uint64; 3870 units "microsecond"; 3871 description 3872 "buffer-size-temporal"; 3873 } 3874 } 3875 case remainder { 3876 leaf buffer-size-remainder { 3877 type empty; 3878 description 3879 "use remaining of buffer"; 3880 } 3881 } 3882 description 3883 "Choice of buffer size type"; 3884 } 3885 description 3886 "Buffer size value"; 3887 } 3888 } 3890 augment 3891 "/compb-queue" + 3892 "/queue-cfg" + 3893 "/algorithmic-drop-cfg" + 3894 "/drop-algorithm" { 3895 case random-detect { 3896 list drop-profile-list { 3897 key "priority"; 3898 description 3899 "map of priorities to drop-algorithms"; 3900 leaf priority { 3901 type enumeration { 3902 enum any { 3903 description "Any priority mapped here"; 3904 } 3905 enum high { 3906 description "High Priority Packet"; 3907 } 3908 enum medium-high { 3909 description "Medium-high Priority Packet"; 3910 } 3911 enum medium-low { 3912 description "Medium-low Priority Packet"; 3913 } 3914 enum low { 3915 description "Low Priority Packet"; 3916 } 3918 } 3919 description 3920 "Priority of guaranteed traffic"; 3921 } 3922 leaf drop-profile { 3923 type string; 3924 description 3925 "drop profile to use for this priority"; 3926 } 3927 } 3928 } 3929 description 3930 "compb random detect drop algorithm config"; 3931 } 3932 } 3934 module example-compb-scheduler-policy { 3935 yang-version 1.1; 3936 namespace "urn:ietf:params:xml:ns:yang:" + 3937 "example-compb-scheduler-policy"; 3938 prefix scheduler-plcy; 3940 import ietf-qos-action { 3941 prefix action; 3942 reference "RFC XXXX: YANG Model for QoS"; 3943 } 3945 import ietf-qos-policy { 3946 prefix policy; 3947 reference "RFC XXXX: YANG Model for QoS"; 3948 } 3950 organization "Company B"; 3951 contact 3952 "Editor: XYZ 3953 "; 3955 description 3956 "This module defines a scheduler policy. The classification 3957 is based on classifier-any, and the action is a scheduler."; 3959 revision 2021-07-12 { 3960 description 3961 "Initial revision of Company B Scheduler policy"; 3962 reference "RFC XXXX"; 3963 } 3965 identity queue-policy { 3966 base policy:action-type; 3967 description 3968 "forwarding-class-queue action type"; 3969 } 3971 grouping queue-policy-name { 3972 container compb-queue-policy-name { 3973 leaf name { 3974 type string; 3975 description 3976 "Queue policy name"; 3977 } 3978 description 3979 "compb-queue-policy container"; 3980 } 3981 description 3982 "compb-queue policy grouping"; 3983 } 3985 augment "/policy:policies" + 3986 "/policy:policy-entry" + 3987 "/policy:classifier-entry" + 3988 "/policy:classifier-action-entry-cfg" { 3989 choice action-cfg-params { 3990 case schedular { 3991 uses action:schedular; 3992 } 3993 case queue-policy { 3994 uses queue-policy-name; 3995 } 3996 description 3997 "Augment the scheduler policy with a queue policy"; 3998 } 3999 } 4000 } 4002 A.3. Example of Company C Diffserv Model 4004 Company C vendor augmentation is based on Ericsson's implementation 4005 differentiated QoS. This implementation first sorts traffic based on 4006 a classifier, which can sort traffic into one or more traffic 4007 forwarding classes. Then, a policer or meter policy references the 4008 classifier and its traffic forwarding classes to specify different 4009 service levels for each traffic forwarding class. 4011 Because each classifier sorts traffic into one or more traffic 4012 forwarding classes, this type of classifier does not align with ietf- 4013 qos-classifier.yang, which defines one traffic forwarding class per 4014 classifier. Additionally, Company C's policing and metering policies 4015 relies on the classifier's pre-defined traffic forwarding classes to 4016 provide differentiated services, rather than redefining the patterns 4017 within a policing or metering policy, as is defined in ietf- 4018 diffserv.yang. 4020 Due to these differences, even though Company C uses all the building 4021 blocks of classifier and policy, Company C's augmentation does not 4022 use ietf-diffserv.yang to provide differentiated service levels. 4023 Instead, Company C's augmentation uses the basic building blocks, 4024 ietf-qos-policy.yang to provide differentiated services. 4026 module example-compc-qos-policy { 4027 yang-version 1.1; 4028 namespace "urn:ietf:params:xml:ns:yang:example-compc-qos-policy"; 4029 prefix "compcqos"; 4031 import ietf-qos-policy { 4032 prefix "pol"; 4033 reference "RFC XXXX: YANG Model for QoS"; 4034 } 4036 import ietf-qos-action { 4037 prefix "action"; 4038 reference "RFC XXXX: YANG Model for QoS"; 4039 } 4041 organization "Company C"; 4042 contact "Company C Editor: XYZ "; 4043 description 4044 "This module contains a collection of YANG definitions for 4045 configuring diffserv specification implementations. 4046 Copyright (c) 2021 IETF Trust and the persons identified as 4047 authors of the code. All rights reserved. 4048 Redistribution and use in source and binary forms, with or 4049 without modification, is permitted pursuant to, and subject 4050 to the license terms contained in, the Simplified BSD License 4051 set forth in Section 4.c of the IETF Trust's Legal Provisions 4052 Relating to IETF Documents 4053 (http://trustee.ietf.org/license-info). 4055 This version of this YANG module is part of RFC XXXX; see 4056 the RFC itself for full legal notices."; 4058 revision 2021-07-12 { 4059 description "Initial version"; 4060 reference "RFC XXXX"; 4061 } 4062 /* identities */ 4064 identity compc-qos-policy { 4065 base pol:policy-type; 4066 description "compc-specific policy base type"; 4067 } 4069 identity mdrr-queuing-policy { 4070 base compc-qos-policy; 4071 description "compc-specific MDRR policy type"; 4072 } 4074 identity pwfq-queuing-policy { 4075 base compc-qos-policy; 4076 description "compc-specific queuing policy type"; 4077 } 4079 identity policing-policy { 4080 base compc-qos-policy; 4081 description "compc-specific policing policy type"; 4082 } 4084 identity metering-policy { 4085 base compc-qos-policy; 4086 description "compc-specific metering policy type"; 4087 } 4089 identity forwarding-policy { 4090 base compc-qos-policy; 4091 description "compc-specific forwarding policy type"; 4092 } 4094 identity overhead-profile-policy { 4095 base compc-qos-policy; 4096 description "compc-specific overhead profile policy type"; 4097 } 4099 identity resource-profile-policy { 4100 base compc-qos-policy; 4101 description "compc-specific resource profile policy type"; 4102 } 4104 identity protocol-rate-limit-policy { 4105 base compc-qos-policy; 4106 description "compc-specific protocol rate limit policy type"; 4107 } 4109 identity compc-qos-action { 4110 base pol:action-type; 4111 description "compc-specificc qos action base type"; 4112 } 4114 /* groupings */ 4116 grouping redirect-action-grp { 4117 description "Redirection options grouping"; 4118 container redirect { 4119 description "Redirect options"; 4120 } 4121 } 4123 /* deviations */ 4125 deviation "/pol:policies/pol:policy-entry" { 4126 deviate add { 4127 must "pol:type = compc-qos-policy" { 4128 description 4129 "Only policy types drived from compc-qos-policy " + 4130 "are supported"; 4131 } 4132 } 4133 } 4135 deviation "/pol:policies/pol:policy-entry/pol:classifier-entry" { 4136 deviate add { 4137 must "../per-class-action = 'true'" { 4138 description 4139 "Only policies with per-class actions have classifiers"; 4140 } 4141 must "((../compcqos:sub-type != " + 4142 "'compcqos:mdrr-queuing-policy') and " + 4143 " (../compcqos:sub-type != " + 4144 "'compcqos:pwfq-queuing-policy')) or " + 4145 "(((../compcqos:sub-type = " + 4146 "'compcqos:mdrr-queuing-policy') or " + 4147 " (../compcqos:sub-type = " + 4148 "'compcqos:pwfq-queueing-policy')) and " + 4149 " ((classifier-entry-name = '0') or " + 4150 " (classifier-entry-name = '1') or " + 4151 " (classifier-entry-name = '2') or " + 4152 " (classifier-entry-name = '3') or " + 4153 " (classifier-entry-name = '4') or " + 4154 " (classifier-entry-name = '5') or " + 4155 " (classifier-entry-name = '6') or " + 4156 " (classifier-entry-name = '7') or " + 4157 " (classifier-entry-name = '8')))" { 4159 description 4160 "MDRR queuing policy's or PWFQ queuing policy's " + 4161 "classifier-entry-name is limited to the listed values"; 4162 } 4163 } 4164 } 4166 deviation "/pol:policies/pol:policy-entry/pol:classifier-entry" + 4167 "/pol:classifier-action-entry-cfg" { 4168 deviate add { 4169 must "action-type = 'compcqos:compc-qos-action'" { 4170 description 4171 "Only compc-qos-action is allowed"; 4172 } 4173 max-elements 1; 4174 } 4175 } 4177 /* augments */ 4179 augment "/pol:policies/pol:policy-entry" { 4180 when "pol:policy-type = 'compc-qos-policy'" { 4181 description 4182 "Additional nodes only for diffserv-policy"; 4183 } 4184 description "Additional diffserv-policy nodes"; 4185 leaf sub-type { 4186 type identityref { 4187 base compc-qos-policy; 4188 } 4189 mandatory true; 4190 description "Policy sub-type. The value of this leaf must " + 4191 "not change once configured"; 4192 } 4193 leaf per-class-action { 4194 type boolean; 4195 must "(((. = 'true') and " + 4196 " ((../compcqos:sub-type = " + 4197 "'compcqos:policing-policy') or " + 4198 " (../compcqos:sub-type = " + 4199 "'compcqos:metering-policy') or " + 4200 " (../compcqos:sub-type = " + 4201 "'compcqos:mdrr-queuing-policy') or " + 4202 " (../compcqos:sub-type = " + 4203 "'compcqos:pwfq-queuing-policy') or " + 4204 " (../compcqos:sub-type = " + 4205 "'compcqos:forwarding-policy'))) or " + 4206 " ((. = 'false') and " + 4207 " ((../compcqos:sub-type = " + 4208 "'compcqos:overhead-profile-policy') or " + 4209 " (../compcqos:sub-type = " + 4210 "'compcqos:resource-profile-policy') or " + 4211 " (../compcqos:sub-type = " + 4212 "'compcqos:protocol-rate-limit-policy'))))" { 4213 description 4214 "Only certain policies have per-class action"; 4215 } 4216 mandatory true; 4217 description "Per-class action"; 4218 } 4219 container traffic-classifier { 4220 when "../compcqos:sub-type = 'compcqos:policing-policy' or " + 4221 "../compcqos:sub-type = 'compcqos:metering-policy' or " + 4222 "../compcqos:sub-type = 'compcqos:forwarding-policy'" { 4223 description 4224 "A classifier for policing-policy or metering-policy"; 4225 } 4226 presence true; 4227 leaf name { 4228 type string; 4229 mandatory true; 4230 description 4231 "Traffic classifier name"; 4232 } 4233 leaf type { 4234 type enumeration { 4235 enum 'internal-dscp-only-classifier' { 4236 value 0; 4237 description 4238 "Classify traffic based on (internal) dscp only"; 4239 } 4240 enum 'ipv4-header-based-classifier' { 4241 value 1; 4242 description 4243 "Classify traffic based on IPv4 packet header fields"; 4244 } 4245 enum 'ipv6-header-based-classifier' { 4246 value 2; 4247 description 4248 "Classify traffic based on IPv6 packet header fields"; 4249 } 4250 } 4251 mandatory true; 4252 description 4253 "Traffic classifier type"; 4254 } 4255 description "Traffic classifier"; 4256 } 4257 container traffic-queue { 4258 when "(../compcqos:sub-type = " + 4259 "'compcqos:mdrr-queuing-policy') or " + 4260 "(../compcqos:sub-type = " + 4261 "'compcqos:pwfq-queuing-policy')" { 4262 description 4263 "Queuing policy properties"; 4264 } 4265 leaf queue-map { 4266 type string; 4267 description 4268 "Traffic queue map for queuing policy"; 4269 } 4270 description "Traffic queue"; 4271 } 4272 container overhead-profile { 4273 when "../compcqos:sub-type = " + 4274 "'compcqos:overhead-profile-policy'" { 4275 description 4276 "Overhead profile policy properties"; 4277 } 4278 description "Overhead profile"; 4279 } 4280 container resource-profile { 4281 when "../compcqos:sub-type = " + 4282 "'compcqos:resource-profile-policy'" { 4283 description 4284 "Resource profile policy properties"; 4285 } 4286 description "Resource profile"; 4287 } 4288 container protocol-rate-limit { 4289 when "../compcqos:sub-type = " + 4290 "'compcqos:protocol-rate-limit-policy'" { 4291 description 4292 "Protocol rate limit policy properties"; 4293 } 4294 description "Protocol rate limit"; 4295 } 4296 } 4298 augment "/pol:policies/pol:policy-entry/pol:classifier-entry" + 4299 "/pol:classifier-action-entry-cfg/pol:action-cfg-params" { 4300 when "../../pol:policy-type = 'compc-qos-policy'" { 4301 description 4302 "Configurations for a classifier-policy-type policy"; 4304 } 4305 case metering-or-policing-policy { 4306 when "../../compcqos:sub-type = " + 4307 "'compcqos:policing-policy' or " + 4308 "../../compcqos:sub-type = 'compcqos:metering-policy'" { 4309 } 4310 container dscp-marking { 4311 uses action:dscp-marking; 4312 description "DSCP marking"; 4313 } 4314 container precedence-marking { 4315 uses action:dscp-marking; 4316 description "Precedence marking"; 4317 } 4318 container priority-marking { 4319 uses action:priority; 4320 description "Priority marking"; 4321 } 4322 container rate-limiting { 4323 uses action:one-rate-two-color-meter; 4324 description "Rate limiting"; 4325 } 4326 } 4327 case mdrr-queuing-policy { 4328 when "../../compcqos:sub-type = " + 4329 "'compcqos:mdrr-queuing-policy'" { 4330 description 4331 "MDRR queue handling properties for the traffic " + 4332 "classified into current queue"; 4333 } 4334 leaf mdrr-queue-weight { 4335 type uint8 { 4336 range "20..100"; 4337 } 4338 units percentage; 4339 description "MDRR queue weight"; 4340 } 4341 } 4342 case pwfq-queuing-policy { 4343 when "../../compcqos:sub-type = " + 4344 "'compcqos:pwfq-queuing-policy'" { 4345 description 4346 "PWFQ queue handling properties for traffic " + 4347 "classified into current queue"; 4348 } 4349 leaf pwfq-queue-weight { 4350 type uint8 { 4351 range "20..100"; 4353 } 4354 units percentage; 4355 description "Priority-based weighted fair queue weight"; 4356 } 4357 leaf pwfq-queue-priority { 4358 type uint8; 4359 description "Priority-based weighted fair queue priority"; 4360 } 4361 leaf pwfq-queue-rate { 4362 type uint8; 4363 description "Priority-based weighted fair queue rate"; 4364 } 4365 } 4366 case forwarding-policy { 4367 when "../../compcqos:sub-type = 'compcqos:forwarding-policy'" { 4368 description 4369 "Forward policy handling properties for traffic " + 4370 "in this classifier"; 4371 } 4372 uses redirect-action-grp; 4373 } 4374 description 4375 "Add the classify action configuration"; 4376 } 4377 } 4379 Authors' Addresses 4381 Aseem Choudhary 4382 Cisco Systems 4383 170 W. Tasman Drive 4384 San Jose, CA 95134 4385 United States of America 4387 Email: asechoud@cisco.com 4389 Mahesh Jethanandani 4390 Kloud Services 4392 Email: mjethanandani@gmail.com 4393 Ebben Aries 4394 Juniper Networks 4395 1194 North Mathilda Avenue 4396 Sunnyvale, CA 94089 4397 United States of America 4399 Email: exa@juniper.net 4401 Ing-Wher Chen 4402 The MITRE Corporation 4404 Email: ingwherchen@mitre.org