idnits 2.17.1 draft-asechoud-rtgwg-qos-model-03.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 66 pages Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack an IANA Considerations section. (See Section 2.2 of https://www.ietf.org/id-info/checklist for how to handle the case when there are no actions for IANA.) Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Line 182 has weird spacing: '...cal-not boo...' == Line 204 has weird spacing: '...cal-not boo...' == Line 206 has weird spacing: '...on-type ide...' == Line 226 has weird spacing: '...on-type ide...' == Line 230 has weird spacing: '...on-type ide...' == (28 more instances...) -- The document date (December 15, 2017) is 2318 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 ** Obsolete normative reference: RFC 7223 (Obsoleted by RFC 8343) Summary: 4 errors (**), 0 flaws (~~), 8 warnings (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group A. Choudhary 3 Internet-Draft M. Jethanandani 4 Intended status: Standards Track Cisco Systems 5 Expires: June 18, 2018 N. Strahle 6 E. Aries 7 Juniper Networks 8 I. Chen 9 Jabil 10 December 15, 2017 12 YANG Model for QoS 13 draft-asechoud-rtgwg-qos-model-03 15 Abstract 17 This document describes a YANG model for Quality of Service (QoS) 18 configuration and operational parameters. 20 Status of This Memo 22 This Internet-Draft is submitted in full conformance with the 23 provisions of BCP 78 and BCP 79. 25 Internet-Drafts are working documents of the Internet Engineering 26 Task Force (IETF). Note that other groups may also distribute 27 working documents as Internet-Drafts. The list of current Internet- 28 Drafts is at https://datatracker.ietf.org/drafts/current/. 30 Internet-Drafts are draft documents valid for a maximum of six months 31 and may be updated, replaced, or obsoleted by other documents at any 32 time. It is inappropriate to use Internet-Drafts as reference 33 material or to cite them other than as "work in progress." 35 This Internet-Draft will expire on June 18, 2018. 37 Copyright Notice 39 Copyright (c) 2017 IETF Trust and the persons identified as the 40 document authors. All rights reserved. 42 This document is subject to BCP 78 and the IETF Trust's Legal 43 Provisions Relating to IETF Documents 44 (https://trustee.ietf.org/license-info) in effect on the date of 45 publication of this document. Please review these documents 46 carefully, as they describe your rights and restrictions with respect 47 to this document. Code Components extracted from this document must 48 include Simplified BSD License text as described in Section 4.e of 49 the Trust Legal Provisions and are provided without warranty as 50 described in the Simplified BSD License. 52 Table of Contents 54 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 55 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 56 3. QoS Model Design . . . . . . . . . . . . . . . . . . . . . . 3 57 4. DiffServ Model Design . . . . . . . . . . . . . . . . . . . . 3 58 5. Modules Tree Structure . . . . . . . . . . . . . . . . . . . 4 59 6. Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 60 6.1. IETF-QOS-CLASSIFIER . . . . . . . . . . . . . . . . . . . 8 61 6.2. IETF-QOS-POLICY . . . . . . . . . . . . . . . . . . . . . 14 62 6.3. IETF-QOS-ACTION . . . . . . . . . . . . . . . . . . . . . 17 63 6.4. IETF-QOS-TARGET . . . . . . . . . . . . . . . . . . . . . 29 64 6.5. IETF-DIFFSERV . . . . . . . . . . . . . . . . . . . . . . 31 65 7. Security Considerations . . . . . . . . . . . . . . . . . . . 34 66 8. Acknowledgement . . . . . . . . . . . . . . . . . . . . . . . 34 67 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 34 68 9.1. Normative References . . . . . . . . . . . . . . . . . . 34 69 9.2. Informative References . . . . . . . . . . . . . . . . . 35 70 Appendix A. Company A, Company B and Company C examples . . . . 35 71 A.1. Example of Company A Diffserv Model . . . . . . . . . . . 35 72 A.2. Example of Company B Diffserv Model . . . . . . . . . . . 45 73 A.3. Example of Company C Diffserv Model . . . . . . . . . . . 58 74 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 65 76 1. Introduction 78 This document defines a base YANG [RFC6020] data module for Quality 79 of Service (QoS) configuration parameters. Differentiated Services 80 (DiffServ) module is an augmentation of the base QoS model. Remote 81 Procedure Calls (RPC) or notification definition is currently not 82 part of this document and will be added later if necessary. QoS base 83 modules define a basic building blocks to define a classifier, 84 policy, action and target. The base modules have been augmented to 85 include packet match fields and action parameters to define the 86 DiffServ module. It is left up to individual vendors to stitch some 87 of the actions like queues, random-detect (RED) and vendor specific 88 parameters of the DiffServ policy definitions. Designing the module 89 in this manner allows for a very flexible and extensible module that 90 should fit in with most of the vendor requirements. The DiffServ 91 model is based on DiffServ architecture, and various references have 92 been made to available standard architecture documents. 94 DiffServ is a preferred approach for network service providers to 95 offer services to different customers based on their network Quality- 96 of-Service (QoS) objectives. The traffic streams are differentiated 97 based on DiffServ Code Points (DSCP) carried in the IP header of each 98 packet. The DSCP markings are applied by upstream node or by the 99 edge router on entry to the DiffServ network. 101 2. Terminology 103 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 104 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 105 document are to be interpreted as described in [RFC2119]. 107 3. QoS Model Design 109 A classifier consists of packets which may be grouped when a logical 110 set of rules are applied on different packet header fields. The 111 grouping may be based on different values or range of values of same 112 packet header field, presence or absence of some values or range of 113 values of a packet field or a combination thereof. The QoS 114 classifier is defined in the ietf-qos-classifier module. 116 A classifier entry contains one or more packet conditioning 117 functions. A packet conditioning function is typically based on 118 direction of traffic and may drop, mark or delay network packets. A 119 set of classifier entries with corresponding conditioning functions 120 when arranged in order of priority represents a QoS policy. A QoS 121 policy may contain one or more classifier entries. These are defined 122 in ietf-qos-policy module. 124 Actions are configured in line with respect to the policy module. 125 These include marking, dropping or shaping. Actions are defined in 126 the ietf-qos-action module. 128 A meter qualifies if the traffic arrival rate is based on agreed upon 129 rate and variability. A meter is modeled based on commonly used 130 alogrithms in industry, Single Rate Tri Color Marking (srTCM) 131 [RFC2697] meter, Two Rate Tri Color Marking (trTCM) [RFC2698] meter, 132 and Single Rate Two Color Marking meter. Different vendors can 133 extend it with other types of meters as well. 135 4. DiffServ Model Design 137 DiffServ architecture [RFC3289] and [RFC2475] describe the 138 architecture as a simple model where traffic entering a network is 139 classified and possibly conditioned at the boundary of the network 140 and assigned a different Behavior Aggregate (BA). Each BA is 141 identified by a specific value of DSCP, and is used to select a Per 142 Hop Behavior (PHB). 144 The packet classification policy identifies the subset of traffic 145 which may receive a DiffServ by being conditioned or mapped. Packet 146 classifiers select packets within a stream based on the content of 147 some portion of the packet header. There are two types of 148 classifiers, the BA classifier, and the Multi-Field (MF) classifier 149 which selects packets based on a value which is combination of one or 150 more header fields. In the ietf-diffserv module, this is realized by 151 augmenting the QoS classification module. 153 Traffic conditioning includes metering, shaping and/or marking. A 154 meter is used to measure the traffic against a given traffic profile. 155 The traffic profile specifies the temporal property of the traffic. 156 A packet that arrives is first determined to be in or out of the 157 profile, which will result in the action of marked, dropped or 158 shaped. This is realized in vendor specific modules based on the 159 parameters defined in action module. The metering parameters are 160 augmented to the QoS policy module when metering is defined inline, 161 and to the metering template when metering profile is referred in 162 policy module. 164 5. Modules Tree Structure 166 This document defines five YANG modules - four QoS base modules and 167 one DiffServ module. 169 ietf-qos-classifier consists of classifier entries identified by a 170 classifier entry name. Each entry MAY contain a list of filter 171 entries. When no filter entry is present in a classifier entry, it 172 matches all traffic. 174 module: ietf-qos-classifier 175 +--rw classifiers 176 +--rw classifier-entry* [classifier-entry-name] 177 +--rw classifier-entry-name string 178 +--rw classifier-entry-descr? string 179 +--rw classifier-entry-filter-operation? identityref 180 +--rw filter-entry* [filter-type filter-logical-not] 181 +--rw filter-type identityref 182 +--rw filter-logical-not boolean 184 An ietf-qos-policy module contains list of policy objects identified 185 by a policy name and policy type which MUST be provided. With 186 different values of policy types, each vendor MAY define their own 187 construct of policy for different QoS functionalities. Each vendor 188 MAY augment classifier entry in a policy definition with a set of 189 actions. 191 module: ietf-qos-policy 192 +--rw policies 193 +--rw policy-entry* [policy-name policy-type] 194 +--rw policy-name string 195 +--rw policy-type identityref 196 +--rw policy-descr? string 197 +--rw classifier-entry* [classifier-entry-name] 198 +--rw classifier-entry-name string 199 +--rw classifier-entry-inline? boolean 200 +--rw classifier-entry-filter-oper? identityref 201 +--rw filter-entry* [filter-type filter-logical-not] 202 {policy-inline-classifier-config}? 203 | +--rw filter-type identityref 204 | +--rw filter-logical-not boolean 205 +--rw classifier-action-entry-cfg* [action-type] 206 +--rw action-type identityref 207 +--rw (action-cfg-params)? 209 ietf-qos-action module contains grouping of set of QoS actions. 210 These include metering, marking, dropping and shaping. Marking sets 211 DiffServ codepoint value in the classified packet. Color-aware and 212 Color-blind meters are augmented by vendor specific modules based on 213 the parameters defined in action module. 215 module: ietf-qos-action 216 +--rw meter-template 217 +--rw meter-entry* [meter-name] {meter-template-support}? 218 +--rw meter-name string 219 +--rw (meter-type)? 220 +--:(one-rate-two-color-meter-type) 221 | +--rw one-rate-two-color-meter 222 | +--rw meter-rate? uint64 223 | +--rw meter-burst? uint64 224 | +--rw conform-action 225 | | +--rw meter-action-params* [meter-action-type] 226 | | +--rw meter-action-type identityref 227 | | +--rw (meter-action-val)? 228 | +--rw exceed-action 229 | +--rw meter-action-params* [meter-action-type] 230 | +--rw meter-action-type identityref 231 | +--rw (meter-action-val)? 232 +--:(one-rate-tri-color-meter-type) 233 | +--rw one-rate-tri-color-meter 234 | +--rw committed-rate? uint64 235 | +--rw committed-burst? uint64 236 | +--rw excess-burst? uint64 237 | +--rw conform-action 238 | | +--rw meter-action-params* [meter-action-type] 239 | | +--rw meter-action-type identityref 240 | | +--rw (meter-action-val)? 241 | +--rw exceed-action 242 | | +--rw meter-action-params* [meter-action-type] 243 | | +--rw meter-action-type identityref 244 | | +--rw (meter-action-val)? 245 | +--rw violate-action 246 | +--rw meter-action-params* [meter-action-type] 247 | +--rw meter-action-type identityref 248 | +--rw (meter-action-val)? 249 +--:(two-rate-tri-color-meter-type) 250 +--rw two-rate-tri-color-meter 251 +--rw committed-rate? uint64 252 +--rw committed-burst? uint64 253 +--rw peak-rate? uint64 254 +--rw peak-burst? uint64 255 +--rw conform-action 256 | +--rw meter-action-params* [meter-action-type] 257 | +--rw meter-action-type identityref 258 | +--rw (meter-action-val)? 259 +--rw exceed-action 260 | +--rw meter-action-params* [meter-action-type] 261 | +--rw meter-action-type identityref 262 | +--rw (meter-action-val)? 263 +--rw violate-action 264 +--rw meter-action-params* [meter-action-type] 265 +--rw meter-action-type identityref 266 +--rw (meter-action-val)? 268 ietf-qos-target module contains reference of qos-policy and augments 269 ietf-interfaces [RFC7223] module. A single policy of a particular 270 policy-type can be applied on an interface in each direction of 271 traffic. Policy-type is of type identity and is populated in a 272 vendor specific manner. This way it provides greater flexibility for 273 each vendor to define different policy types each with its own 274 capabilities and restrictions. 276 Classifier, metering and queuing counters are associated with a 277 target. 279 module: ietf-qos-target 280 augment /if:interfaces/if:interface: 281 +--rw qos-target-entry* [direction policy-type] 282 +--rw direction identityref 283 +--rw policy-type identityref 284 +--rw policy-name string 286 Diffserv module augments QoS classifier module. Many of the YANG 287 types defined in [RFC6991] are represented as leafs in the classifier 288 module. 290 Metering and marking actions are realized by augmenting the QoS 291 policy-module. Any queuing, AQM and scheduling actions are part of 292 vendor specific augmentation. Statistics are realized by augmenting 293 the QoS target module. 295 module: ietf-diffserv 296 augment "/classifier:classifiers/classifier:classifier-entry" + 297 "/classifier:filter-entry": 298 +--rw (filter-param)? 299 +--:(dscp) 300 | +--rw dscp-cfg* [dscp-min dscp-max] 301 | +--rw dscp-min inet:dscp 302 | +--rw dscp-max inet:dscp 303 +--:(source-ip-address) 304 | +--rw source-ip-address-cfg* [source-ip-addr] 305 | +--rw source-ip-addr inet:ip-prefix 306 +--:(destination-ip-address) 307 | +--rw destination-ip-address-cfg* [destination-ip-addr] 308 | +--rw destination-ip-addr inet:ip-prefix 309 +--:(source-port) 310 | +--rw source-port-cfg* [source-port-min source-port-max] 311 | +--rw source-port-min inet:port-number 312 | +--rw source-port-max inet:port-number 313 +--:(destination-port) 314 | +--rw destination-port-cfg* 315 [destination-port-min destination-port-max] 316 | +--rw destination-port-min inet:port-number 317 | +--rw destination-port-max inet:port-number 318 +--:(protocol) 319 +--rw protocol-cfg* [protocol-min protocol-max] 320 +--rw protocol-min uint8 321 +--rw protocol-max uint8 322 augment "/policy:policies/policy:policy-entry" + 323 "/policy:classifier-entry/policy:filter-entry": 324 +--rw (filter-params)? 325 +--:(dscp) 326 | +--rw dscp-cfg* [dscp-min dscp-max] 327 | +--rw dscp-min inet:dscp 328 | +--rw dscp-max inet:dscp 329 +--:(source-ip-address) 330 | +--rw source-ip-address-cfg* [source-ip-addr] 331 | +--rw source-ip-addr inet:ip-prefix 332 +--:(destination-ip-address) 333 | +--rw destination-ip-address-cfg* [destination-ip-addr] 334 | +--rw destination-ip-addr inet:ip-prefix 335 +--:(source-port) 336 | +--rw source-port-cfg* [source-port-min source-port-max] 337 | +--rw source-port-min inet:port-number 338 | +--rw source-port-max inet:port-number 339 +--:(destination-port) 340 | +--rw destination-port-cfg* 341 [destination-port-min destination-port-max] 342 | +--rw destination-port-min inet:port-number 343 | +--rw destination-port-max inet:port-number 344 +--:(protocol) 345 +--rw protocol-cfg* [protocol-min protocol-max] 346 +--rw protocol-min uint8 347 +--rw protocol-max uint8 348 augment "/policy:policies/policy:policy-entry" + 349 "/policy:classifier-entry" + 350 "/policy:classifier-action-entry-cfg": 351 +--rw (action-cfg-params)? 352 +--:(dscp-marking) 353 +--rw dscp-cfg 354 +--rw dscp? inet:dscp 356 6. Modules 358 6.1. IETF-QOS-CLASSIFIER 360 file "ietf-qos-classifier@2016-03-03.yang" 361 module ietf-qos-classifier { 362 yang-version 1; 363 namespace "urn:ietf:params:xml:ns:yang:ietf-qos-classifier"; 364 prefix classifier; 365 import ietf-inet-types { 366 prefix inet; 367 } 368 organization "IETF RTG (Routing Area) Working Group"; 369 contact 370 "WG Web: 371 WG List: 372 WG Chair: Chris Bowers 373 374 WG Chair: Jeff Tantsura 375 376 Editor: Aseem Choudhary 377 378 Editor: Mahesh Jethanandani 379 380 Editor: Norm Strahle 381 "; 383 description 384 "This module contains a collection of YANG definitions for 385 configuring qos specification implementations. 386 Copyright (c) 2014 IETF Trust and the persons identified as 387 authors of the code. All rights reserved. 388 Redistribution and use in source and binary forms, with or 389 without modification, is permitted pursuant to, and subject 390 to the license terms contained in, the Simplified BSD License 391 set forth in Section 4.c of the IETF Trust's Legal Provisions 392 Relating to IETF Documents 393 (http://trustee.ietf.org/license-info). 394 This version of this YANG module is part of RFC XXXX; see 395 the RFC itself for full legal notices."; 396 revision 2016-03-03 { 397 description 398 "Latest revision of qos base classifier module"; 399 reference "RFC XXXX"; 400 } 401 feature policy-inline-classifier-config { 402 description 403 " This feature allows classifier configuration 404 directly under policy."; 405 } 406 identity filter-type { 407 description 408 "This is identity of base filter-type"; 409 } 410 identity dscp { 411 base filter-type; 412 description 413 "Differentiated services code point filter-type"; 414 } 415 identity source-ip-address { 416 base filter-type; 417 description 418 "source ipv4 and ipv6 address filter-type"; 419 } 420 identity destination-ip-address { 421 base filter-type; 422 description 423 "destination ipv4 and ipv6 address filter-type"; 424 } 425 identity source-port { 426 base filter-type; 427 description 428 "source port filter-type"; 429 } 430 identity destination-port { 431 base filter-type; 432 description 433 "destination port filter-type"; 434 } 435 identity protocol { 436 base filter-type; 437 description 438 "protocol type filter-type"; 439 } 440 identity classifier-entry-filter-operation-type { 441 description 442 "Classifier entry filter logical operation"; 443 } 444 identity match-any-filter { 445 base classifier-entry-filter-operation-type; 446 description 447 "Classifier entry filter logical OR operation"; 448 } 449 identity match-all-filter { 450 base classifier-entry-filter-operation-type; 451 description 452 "Classifier entry filter logical AND operation"; 453 } 454 grouping dscp-cfg { 455 list dscp-cfg { 456 key "dscp-min dscp-max"; 457 description 458 "list of dscp ranges"; 459 leaf dscp-min { 460 type inet:dscp; 461 description 462 "Minimum value of dscp min-max range"; 463 } 464 leaf dscp-max { 465 type inet:dscp; 466 description 467 "maximum value of dscp min-max range"; 468 } 469 } 470 description 471 "Filter grouping containing list of dscp ranges"; 472 } 473 grouping source-ip-address-cfg { 474 list source-ip-address-cfg { 475 key "source-ip-addr"; 476 description 477 "list of source ipv4 or ipv6 address"; 478 leaf source-ip-addr { 479 type inet:ip-prefix; 480 description 481 "source ipv4 or ipv6 prefix"; 482 } 483 } 484 description 485 "Filter grouping containing list of source ip addresses"; 486 } 487 grouping destination-ip-address-cfg { 488 list destination-ip-address-cfg { 489 key "destination-ip-addr"; 490 description 491 "list of destination ipv4 or ipv6 address"; 492 leaf destination-ip-addr { 493 type inet:ip-prefix; 494 description 495 "destination ipv4 or ipv6 prefix"; 496 } 497 } 498 description 499 "Filter grouping containing list of destination ip address"; 500 } 501 grouping source-port-cfg { 502 list source-port-cfg { 503 key "source-port-min source-port-max"; 504 description 505 "list of ranges of source port"; 506 leaf source-port-min { 507 type inet:port-number; 508 description 509 "minimum value of source port range"; 510 } 511 leaf source-port-max { 512 type inet:port-number; 513 description 514 "maximum value of source port range"; 515 } 516 } 517 description 518 "Filter grouping containing list of source port ranges"; 519 } 520 grouping destination-port-cfg { 521 list destination-port-cfg { 522 key "destination-port-min destination-port-max"; 523 description 524 "list of ranges of destination port"; 525 leaf destination-port-min { 526 type inet:port-number; 527 description 528 "minimum value of destination port range"; 529 } 530 leaf destination-port-max { 531 type inet:port-number; 532 description 533 "maximum value of destination port range"; 534 } 535 } 536 description 537 "Filter grouping containing list of destination port ranges"; 538 } 539 grouping protocol-cfg { 540 list protocol-cfg { 541 key "protocol-min protocol-max"; 542 description 543 "list of ranges of protocol values"; 544 leaf protocol-min { 545 type uint8 { 546 range "0..255"; 547 } 548 description 549 "minimum value of protocol range"; 550 } 551 leaf protocol-max { 552 type uint8 { 553 range "0..255"; 554 } 555 description 556 "maximum value of protocol range"; 557 } 558 } 559 description 560 "Filter grouping containing list of Protocol ranges"; 561 } 562 grouping filters { 563 description 564 "Filters types in a Classifier entry"; 565 leaf filter-type { 566 type identityref { 567 base filter-type; 568 } 569 description 570 "This leaf defines type of the filter"; 571 } 572 leaf filter-logical-not { 573 type boolean; 574 description 575 " 576 This is logical-not operator for a filter. When true, it 577 indicates filter looks for absence of a pattern defined 578 by the filter 579 "; 580 } 581 } 582 grouping classifier-entry-generic-attr { 583 description 584 " 585 Classifier generic attributes like name, 586 description, operation type 587 "; 588 leaf classifier-entry-name { 589 type string; 590 description 591 "classifier entry name"; 592 } 593 leaf classifier-entry-descr { 594 type string; 595 description 596 "classifier entry description statement"; 597 } 598 leaf classifier-entry-filter-operation { 599 type identityref { 600 base classifier-entry-filter-operation-type; 601 } 602 default "match-any-filter"; 603 description 604 "Filters are applicable as match-any or match-all filters"; 605 } 606 } 607 grouping classifier-entry-inline-attr { 608 description 609 "attributes of inline classifier in a policy"; 610 leaf classifier-entry-inline { 611 type boolean; 612 default "false"; 613 description 614 "Indication of inline classifier entry"; 615 } 616 leaf classifier-entry-filter-oper { 617 type identityref { 618 base classifier-entry-filter-operation-type; 619 } 620 default "match-all-filter"; 621 description 622 "Filters are applicable as match-any or match-all filters"; 624 } 625 list filter-entry { 626 if-feature policy-inline-classifier-config; 627 must " ../classifier-entry-inline = 'true' " { 628 description 629 "For inline filter configuration, inline attribute" + 630 "must be true"; 631 } 632 key "filter-type filter-logical-not"; 633 uses filters; 634 description 635 "Filters configured inline in a policy"; 636 } 637 } 638 container classifiers { 639 description 640 "list of classifier entry"; 641 list classifier-entry { 642 key "classifier-entry-name"; 643 description 644 "each classifier entry contains a list of filters"; 645 uses classifier-entry-generic-attr; 646 list filter-entry { 647 key "filter-type filter-logical-not"; 648 uses filters; 649 description 650 "Filter entry configuration"; 651 } 652 } 653 } 654 } 655 657 6.2. IETF-QOS-POLICY 659 file "ietf-qos-policy@2016-03-03.yang" 660 module ietf-qos-policy { 661 yang-version 1; 662 namespace "urn:ietf:params:xml:ns:yang:ietf-qos-policy"; 663 prefix policy; 664 import ietf-qos-classifier { 665 prefix classifier; 666 } 667 organization "IETF RTG (Routing Area) Working Group"; 668 contact 669 "WG Web: 670 WG List: 671 WG Chair: Chris Bowers 672 673 WG Chair: Jeff Tantsura 674 675 Editor: Aseem Choudhary 676 677 Editor: Mahesh Jethanandani 678 679 Editor: Norm Strahle 680 "; 681 description 682 "This module contains a collection of YANG definitions for 683 configuring qos specification implementations. 684 Copyright (c) 2014 IETF Trust and the persons identified as 685 authors of the code. All rights reserved. 686 Redistribution and use in source and binary forms, with or 687 without modification, is permitted pursuant to, and subject 688 to the license terms contained in, the Simplified BSD License 689 set forth in Section 4.c of the IETF Trust's Legal Provisions 690 Relating to IETF Documents 691 (http://trustee.ietf.org/license-info). 692 This version of this YANG module is part of RFC XXXX; see 693 the RFC itself for full legal notices."; 694 revision 2016-03-03 { 695 description 696 "Latest revision of qos policy"; 697 reference "RFC XXXX"; 698 } 699 identity policy-type { 700 description 701 "This base identity type defines policy-types"; 702 } 703 grouping policy-generic-attr { 704 description 705 "Policy Attributes"; 706 leaf policy-name { 707 type string; 708 description 709 "policy name"; 710 } 711 leaf policy-type { 712 type identityref { 713 base policy-type; 714 } 715 description 716 "policy type"; 717 } 718 leaf policy-descr { 719 type string; 720 description 721 "policy description"; 722 } 723 } 724 identity action-type { 725 description 726 "This base identity type defines action-types"; 727 } 728 grouping classifier-action-entry-cfg { 729 description 730 "List of Configuration of classifier & associated actions"; 731 list classifier-action-entry-cfg { 732 key "action-type"; 733 ordered-by user; 734 description 735 "Configuration of classifier & associated actions"; 736 leaf action-type { 737 type identityref { 738 base action-type; 739 } 740 description 741 "This defines action type "; 742 } 743 choice action-cfg-params { 744 description 745 "Choice of action types"; 746 } 747 } 748 } 749 container policies { 750 description 751 "list of policy templates"; 752 list policy-entry { 753 key "policy-name policy-type"; 754 description 755 "policy template"; 756 uses policy-generic-attr; 757 list classifier-entry { 758 key "classifier-entry-name"; 759 ordered-by user; 760 description 761 "Classifier entry configuration in a policy"; 762 leaf classifier-entry-name { 763 type string; 764 description 765 "classifier entry name"; 766 } 767 uses classifier:classifier-entry-inline-attr; 768 uses classifier-action-entry-cfg; 769 } 770 } 771 } 772 } 773 775 6.3. IETF-QOS-ACTION 777 file "ietf-qos-action@2016-06-15.yang" 778 module ietf-qos-action { 779 namespace "urn:ietf:params:xml:ns:yang:ietf-qos-action"; 780 prefix action; 781 import ietf-inet-types { 782 prefix inet; 783 } 784 import ietf-qos-policy { 785 prefix policy; 786 } 787 organization "IETF RTG (Routing Area) Working Group"; 788 contact 789 "WG Web: 790 WG List: 791 WG Chair: Chris Bowers 792 793 WG Chair: Jeff Tantsura 794 795 Editor: Aseem Choudhary 796 797 Editor: Mahesh Jethanandani 798 799 Editor: Norm Strahle 800 "; 801 description 802 "This module contains a collection of YANG definitions for 803 configuring qos specification implementations. 804 Copyright (c) 2014 IETF Trust and the persons identified as 805 authors of the code. All rights reserved. 806 Redistribution and use in source and binary forms, with or 807 without modification, is permitted pursuant to, and subject 808 to the license terms contained in, the Simplified BSD License 809 set forth in Section 4.c of the IETF Trust's Legal Provisions 810 Relating to IETF Documents 811 (http://trustee.ietf.org/license-info). 812 This version of this YANG module is part of RFC XXXX; see 813 the RFC itself for full legal notices."; 814 revision 2016-06-15 { 815 description 816 "Latest revision for qos actions"; 817 reference "RFC XXXX"; 818 } 819 feature meter-template-support { 820 description 821 " This feature allows support of meter-template."; 822 } 824 identity rate-unit-type { 825 description 826 "base rate-unit type"; 827 } 828 identity bits-per-second { 829 base rate-unit-type; 830 description 831 "bits per second identity"; 832 } 833 identity kilo-bits-per-second { 834 base rate-unit-type; 835 description 836 "kilo bits per second identity"; 837 } 838 identity mega-bits-per-second { 839 base rate-unit-type; 840 description 841 "mega bits per second identity"; 842 } 843 identity giga-bits-per-second { 844 base rate-unit-type; 845 description 846 "mega bits per second identity"; 847 } 848 identity percent { 849 base rate-unit-type; 850 description 851 "percentage"; 852 } 854 identity dscp-marking { 855 base policy:action-type; 856 description 857 "dscp marking action type"; 858 } 859 identity meter-inline { 860 base policy:action-type; 861 description 862 "meter-inline action type"; 863 } 864 identity meter-reference { 865 base policy:action-type; 866 description 867 "meter reference action type"; 868 } 869 identity min-rate { 870 base policy:action-type; 871 description 872 "min-rate action type"; 873 } 874 identity max-rate { 875 base policy:action-type; 876 description 877 "max-rate action type"; 878 } 879 identity queue { 880 base policy:action-type; 881 description 882 "queue action type"; 883 } 884 identity schedular { 885 base policy:action-type; 886 description 887 "schedular action type"; 888 } 889 identity discard { 890 base policy:action-type; 891 description 892 "discard action type"; 893 } 894 identity child-policy { 895 base policy:action-type; 896 description 897 "child-policy action type"; 898 } 899 identity count { 900 base policy:action-type; 901 description 902 "discard action type"; 903 } 905 identity meter-type { 906 description 907 "This base identity type defines meter types"; 908 } 909 identity one-rate-two-color-meter-type { 910 base meter-type; 911 description 912 "one rate two color meter type"; 913 } 914 identity one-rate-tri-color-meter-type { 915 base meter-type; 916 description 917 "one rate three color meter type"; 918 } 919 identity two-rate-tri-color-meter-type { 920 base meter-type; 921 description 922 "two rate three color meter action type"; 923 } 925 identity drop-type { 926 description 927 "drop algorithm"; 928 } 929 identity tail-drop { 930 base drop-type; 931 description 932 "tail drop algorithm"; 933 } 934 identity random-detect { 935 base drop-type; 936 description 937 "random detect algorithm"; 938 } 940 identity meter-action-type { 941 description 942 "action type in a meter"; 943 } 944 identity meter-action-drop { 945 base meter-action-type; 946 description 947 "drop action type in a meter"; 948 } 949 identity meter-action-mark-dscp { 950 base meter-action-type; 951 description 952 "dscp mark action type in a meter"; 953 } 955 grouping rate-value-unit { 956 leaf rate-value { 957 type uint64; 958 description 959 "rate value"; 961 } 962 leaf rate-unit { 963 type identityref { 964 base rate-unit-type; 965 } 966 description 967 "rate unit"; 968 } 969 description 970 "rate value and unit grouping"; 971 } 972 grouping burst { 973 description 974 "burst size or interval configuration"; 975 choice burst-type { 976 case size { 977 leaf burst-size { 978 type uint64; 979 units "bytes"; 980 description 981 "burst size"; 982 } 983 } 984 case interval { 985 leaf burst-interval { 986 type uint64; 987 units "microsecond"; 988 description 989 "burst interval"; 990 } 991 } 992 description 993 "Choice of burst type"; 994 } 995 } 997 grouping threshold { 998 description 999 "Threshold Parameters"; 1000 container threshold { 1001 description 1002 "threshold"; 1003 choice threshold-type { 1004 case size { 1005 leaf threshold-size { 1006 type uint64; 1007 units "bytes"; 1008 description 1009 "Threshold size"; 1010 } 1011 } 1012 case interval { 1013 leaf threshold-interval { 1014 type uint64; 1015 units "microsecond"; 1016 description 1017 "Threshold interval"; 1018 } 1019 } 1020 description 1021 "Choice of threshold type"; 1022 } 1023 } 1024 } 1026 grouping drop { 1027 container drop-cfg { 1028 leaf drop-action { 1029 type empty; 1030 description 1031 "always drop algorithm"; 1032 } 1033 description 1034 "the drop action"; 1035 } 1036 description 1037 "always drop grouping"; 1038 } 1040 grouping queuelimit { 1041 container qlimit-thresh { 1042 uses threshold; 1043 description 1044 "the queue limit"; 1045 } 1046 description 1047 "the queue limit beyond which queue will not hold any packet"; 1048 } 1050 grouping meter-action-params { 1051 description 1052 "meter action parameters"; 1053 list meter-action-params { 1054 key "meter-action-type"; 1055 ordered-by user; 1056 description 1057 "Configuration of basic-meter & associated actions"; 1058 leaf meter-action-type { 1059 type identityref { 1060 base meter-action-type; 1061 } 1062 description 1063 "meter action type"; 1064 } 1065 choice meter-action-val { 1066 description 1067 " meter action based on choice of meter action type"; 1068 } 1069 } 1070 } 1072 grouping one-rate-two-color-meter { 1073 container one-rate-two-color-meter { 1074 description 1075 "single rate two color marker meter"; 1076 leaf meter-rate { 1077 type uint64; 1078 units "bits-per-second"; 1079 description 1080 "meter rate"; 1081 } 1082 leaf meter-burst { 1083 type uint64; 1084 units "byes"; 1085 description 1086 "burst size"; 1087 } 1088 container conform-action { 1089 uses meter-action-params; 1090 description 1091 "conform action"; 1092 } 1093 container exceed-action { 1094 uses meter-action-params; 1095 description 1096 "exceed action"; 1097 } 1098 } 1099 description 1100 "single rate two color marker meter attributes"; 1101 } 1103 grouping one-rate-tri-color-meter { 1104 container one-rate-tri-color-meter { 1105 description 1106 "single rate three color meter"; 1107 leaf committed-rate { 1108 type uint64; 1109 units "bits-per-second"; 1110 description 1111 "meter rate"; 1112 } 1113 leaf committed-burst { 1114 type uint64; 1115 units "byes"; 1116 description 1117 "commited burst size"; 1118 } 1119 leaf excess-burst { 1120 type uint64; 1121 units "byes"; 1122 description 1123 "excess burst size"; 1124 } 1125 container conform-action { 1126 uses meter-action-params; 1127 description 1128 "conform, or green action"; 1129 } 1130 container exceed-action { 1131 uses meter-action-params; 1132 description 1133 "exceed, or yellow action"; 1134 } 1135 container violate-action { 1136 uses meter-action-params; 1137 description 1138 "violate, or red action"; 1139 } 1140 } 1141 description 1142 "one-rate-tri-color-meter attributes"; 1143 } 1145 grouping two-rate-tri-color-meter { 1146 container two-rate-tri-color-meter { 1147 description 1148 "two rate three color meter"; 1149 leaf committed-rate { 1150 type uint64; 1151 units "bits-per-second"; 1152 description 1153 "meter rate"; 1154 } 1155 leaf committed-burst { 1156 type uint64; 1157 units "byes"; 1158 description 1159 "commited burst size"; 1160 } 1161 leaf peak-rate { 1162 type uint64; 1163 units "bits-per-second"; 1164 description 1165 "meter rate"; 1166 } 1167 leaf peak-burst { 1168 type uint64; 1169 units "byes"; 1170 description 1171 "commited burst size"; 1172 } 1173 container conform-action { 1174 uses meter-action-params; 1175 description 1176 "conform, or green action"; 1177 } 1178 container exceed-action { 1179 uses meter-action-params; 1180 description 1181 "exceed, or yellow action"; 1182 } 1183 container violate-action { 1184 uses meter-action-params; 1185 description 1186 "exceed, or red action"; 1187 } 1188 } 1189 description 1190 "two-rate-tri-color-meter attributes"; 1191 } 1193 grouping meter { 1194 choice meter-type { 1195 case one-rate-two-color-meter-type { 1196 uses one-rate-two-color-meter; 1197 description 1198 "basic meter"; 1199 } 1200 case one-rate-tri-color-meter-type { 1201 uses one-rate-tri-color-meter; 1202 description 1203 "one rate tri-color meter"; 1204 } 1205 case two-rate-tri-color-meter-type { 1206 uses two-rate-tri-color-meter; 1207 description 1208 "two rate tri-color meter"; 1209 } 1210 description 1211 " meter action based on choice of meter action type"; 1212 } 1213 description 1214 "meter attributes"; 1215 } 1217 container meter-template { 1218 description 1219 "list of meter templates"; 1220 list meter-entry { 1221 if-feature meter-template-support; 1222 key "meter-name"; 1223 description 1224 "meter entry template"; 1225 leaf meter-name { 1226 type string; 1227 description 1228 "meter identifier"; 1229 } 1230 uses meter; 1231 } 1232 } 1234 grouping meter-reference { 1235 container meter-reference-cfg { 1236 leaf meter-type { 1237 type identityref { 1238 base meter-type; 1239 } 1240 description 1241 "This leaf defines type of the filter"; 1242 } 1243 description 1244 "meter reference"; 1245 } 1246 description 1247 "meter reference"; 1248 } 1249 grouping count { 1250 container count-cfg { 1251 leaf count-action { 1252 type empty; 1253 description 1254 "count action"; 1255 } 1256 description 1257 "the count action"; 1258 } 1259 description 1260 "the count action grouping"; 1261 } 1263 grouping discard { 1264 container discard-cfg { 1265 leaf discard { 1266 type empty; 1267 description 1268 "discard action"; 1269 } 1270 description 1271 "discard action"; 1272 } 1273 description 1274 "discard grouping"; 1275 } 1276 grouping priority { 1277 container priority-cfg { 1278 leaf priority-level { 1279 type uint8; 1280 description 1281 "priority level"; 1282 } 1283 description 1284 "priority attributes"; 1285 } 1286 description 1287 "priority attributes grouping"; 1288 } 1289 grouping min-rate { 1290 container min-rate-cfg { 1291 uses rate-value-unit; 1292 description 1293 "min guaranteed bandwidth"; 1294 } 1295 description 1296 "minimum rate grouping"; 1298 } 1299 grouping dscp-marking { 1300 container dscp-cfg { 1301 leaf dscp { 1302 type inet:dscp; 1303 description 1304 "dscp marking"; 1305 } 1306 description 1307 "dscp marking container"; 1308 } 1309 description 1310 "dscp marking grouping"; 1311 } 1312 grouping max-rate { 1313 container max-rate-cfg { 1314 uses rate-value-unit; 1315 uses burst; 1316 description 1317 "maximum rate attributes container"; 1318 } 1319 description 1320 "maximum rate attributes"; 1321 } 1322 grouping queue { 1323 container queue-cfg { 1324 uses priority; 1325 uses min-rate; 1326 uses max-rate; 1327 container algorithmic-drop-cfg { 1328 choice drop-algorithm { 1329 case tail-drop { 1330 container tail-drop-cfg { 1331 leaf tail-drop-alg { 1332 type empty; 1333 description 1334 "tail drop algorithm"; 1335 } 1336 description 1337 "Tail Drop configuration container"; 1338 } 1339 description 1340 "Tail Drop choice"; 1341 } 1342 description 1343 "Choice of Drop Algorithm"; 1344 } 1345 description 1346 "Algorithmic Drop configuration container"; 1347 } 1348 description 1349 "Queue configuration container"; 1350 } 1351 description 1352 "Queue grouping"; 1353 } 1354 grouping schedular { 1355 container schedular-cfg { 1356 uses min-rate; 1357 uses max-rate; 1358 description 1359 "Schedular configuration container"; 1360 } 1361 description 1362 "Schedular configuration grouping"; 1363 } 1364 } 1365 1367 6.4. IETF-QOS-TARGET 1369 file "ietf-qos-target@2017-12-12.yang" 1370 module ietf-qos-target { 1371 yang-version 1; 1372 namespace "urn:ietf:params:xml:ns:yang:ietf-qos-target"; 1373 prefix target; 1374 import ietf-interfaces { 1375 prefix if; 1376 } 1377 import ietf-qos-policy { 1378 prefix policy; 1379 } 1380 organization "IETF RTG (Routing Area) Working Group"; 1381 contact 1382 "WG Web: 1383 WG List: 1384 WG Chair: Chris Bowers 1385 1386 WG Chair: Jeff Tantsura 1387 1388 Editor: Aseem Choudhary 1389 1390 Editor: Mahesh Jethanandani 1391 1456 6.5. IETF-DIFFSERV 1458 file "ietf-diffserv@2017-12-12.yang" 1459 module ietf-diffserv { 1460 yang-version 1; 1461 namespace "urn:ietf:params:xml:ns:yang:ietf-diffserv"; 1462 prefix diffserv; 1464 import ietf-qos-classifier { 1465 prefix classifier; 1466 } 1467 import ietf-qos-policy { 1468 prefix policy; 1469 } 1470 import ietf-qos-action { 1471 prefix action; 1472 } 1474 organization "IETF RTG (Routing Area) Working Group"; 1475 contact 1476 "WG Web: 1477 WG List: 1478 WG Chair: Chris Bowers 1479 1480 WG Chair: Jeff Tantsura 1481 1482 Editor: Aseem Choudhary 1483 1484 Editor: Mahesh Jethanandani 1485 1600 7. Security Considerations 1602 8. Acknowledgement 1604 9. References 1606 9.1. Normative References 1608 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1609 Requirement Levels", BCP 14, RFC 2119, 1610 DOI 10.17487/RFC2119, March 1997, 1611 . 1613 [RFC2697] Heinanen, J. and R. Guerin, "A Single Rate Three Color 1614 Marker", RFC 2697, DOI 10.17487/RFC2697, September 1999, 1615 . 1617 [RFC2698] Heinanen, J. and R. Guerin, "A Two Rate Three Color 1618 Marker", RFC 2698, DOI 10.17487/RFC2698, September 1999, 1619 . 1621 [RFC3289] Baker, F., Chan, K., and A. Smith, "Management Information 1622 Base for the Differentiated Services Architecture", 1623 RFC 3289, DOI 10.17487/RFC3289, May 2002, 1624 . 1626 [RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for 1627 the Network Configuration Protocol (NETCONF)", RFC 6020, 1628 DOI 10.17487/RFC6020, October 2010, 1629 . 1631 [RFC6991] Schoenwaelder, J., Ed., "Common YANG Data Types", 1632 RFC 6991, DOI 10.17487/RFC6991, July 2013, 1633 . 1635 [RFC7223] Bjorklund, M., "A YANG Data Model for Interface 1636 Management", RFC 7223, DOI 10.17487/RFC7223, May 2014, 1637 . 1639 9.2. Informative References 1641 [RFC2475] Blake, S., Black, D., Carlson, M., Davies, E., Wang, Z., 1642 and W. Weiss, "An Architecture for Differentiated 1643 Services", RFC 2475, DOI 10.17487/RFC2475, December 1998, 1644 . 1646 Appendix A. Company A, Company B and Company C examples 1648 Company A, Company B and Company C Diffserv modules augments all the 1649 filter types of the QoS classifier module as well as the QoS policy 1650 module that allow it to define marking, metering, min-rate, max-rate 1651 actions. Queuing and metering counters are realized by augmenting of 1652 the QoS target module. 1654 A.1. Example of Company A Diffserv Model 1656 The following Company A vendor example augments the qos and diffserv 1657 model, demonstrating some of the following functionality: 1659 - use of template based classifier definitions 1661 - use of single policy type modelling queue, scheduler policy, and a 1662 filter policy. All of these policies either augment the qos policy 1663 or the diffserv modules 1665 - support of hierarchial policy. 1667 - use of inline actions in a policy 1669 - flexibility in marking dscp or metadata at ingress and/or egress. 1671 module example-compa-diffserv { 1672 namespace "urn:ietf:params:xml:ns:yang:example-compa-diffserv"; 1673 prefix example; 1675 import ietf-interfaces { 1676 prefix if; 1677 } 1678 import ietf-qos-classifier { 1679 prefix classifier; 1680 } 1681 import ietf-qos-policy { 1682 prefix policy; 1684 } 1685 import ietf-qos-action { 1686 prefix action; 1687 } 1688 import ietf-qos-target { 1689 prefix target; 1690 } 1691 import ietf-diffserv { 1692 prefix diffserv; 1693 } 1695 organization "Company A"; 1696 contact 1697 "Editor: XYZ 1698 "; 1699 description 1700 "This module contains a collection of YANG definitions of 1701 companyA diffserv specification extension."; 1702 revision 2016-06-15 { 1703 description 1704 "Initial revision for diffserv actions on network packets"; 1705 reference 1706 "RFC 6020: YANG - A Data Modeling Language for the 1707 Network Configuration Protocol (NETCONF)"; 1708 } 1710 identity default-policy-type { 1711 base policy:policy-type; 1712 description 1713 "This defines default policy-type"; 1714 } 1716 identity qos-group { 1717 base classifier:filter-type; 1718 description 1719 "qos-group filter-type"; 1720 } 1722 grouping qos-group-cfg { 1723 list qos-group-cfg { 1724 key "qos-group-min qos-group-max"; 1725 description 1726 "list of dscp ranges"; 1727 leaf qos-group-min { 1728 type uint8; 1729 description 1730 "Minimum value of qos-group range"; 1731 } 1732 leaf qos-group-max { 1733 type uint8; 1734 description 1735 "maximum value of qos-group range"; 1736 } 1737 } 1738 description 1739 "Filter containing list of qos-group ranges"; 1740 } 1742 grouping wred-threshold { 1743 container wred-min-thresh { 1744 uses action:threshold; 1745 description 1746 "Minimum threshold"; 1747 } 1748 container wred-max-thresh { 1749 uses action:threshold; 1750 description 1751 "Maximum threshold"; 1752 } 1753 leaf mark-probability { 1754 type uint32 { 1755 range "1..1000"; 1756 } 1757 description 1758 "Mark probability"; 1759 } 1760 description 1761 "WRED threshold attributes"; 1762 } 1764 grouping randomdetect { 1765 leaf exp-weighting-const { 1766 type uint32; 1767 description 1768 "Exponential weighting constant factor for wred profile"; 1769 } 1770 uses wred-threshold; 1771 description 1772 "Random detect attributes"; 1773 } 1775 /************************************************* 1776 * Augmentation to Classifier Module 1777 *************************************************/ 1779 augment "/classifier:classifiers/" + 1780 "classifier:classifier-entry/" + 1781 "classifier:filter-entry/diffserv:filter-param" { 1782 case qos-group { 1783 uses qos-group-cfg; 1784 description 1785 "Filter containing list of qos-group ranges. 1786 Qos-group represent packet metadata information 1787 in a device. "; 1788 } 1789 description 1790 "augmentation of classifier filters"; 1791 } 1793 /************************************************* 1794 * Augmentation to Policy Module 1795 *************************************************/ 1797 augment "/policy:policies/policy:policy-entry/" + 1798 "policy:classifier-entry/" + 1799 "policy:classifier-action-entry-cfg/" + 1800 "policy:action-cfg-params" { 1801 case priority { 1802 uses action:priority; 1803 } 1804 case min-rate { 1805 uses action:min-rate; 1806 } 1807 case max-rate { 1808 uses action:max-rate; 1809 } 1810 case random-detect { 1811 uses randomdetect; 1812 } 1813 case meter-inline { 1814 uses action:meter; 1815 } 1816 case child-policy { 1817 leaf child-policy { 1818 type leafref { 1819 path "/policy:policies/policy:policy-entry/" + 1820 "policy:policy-name"; 1821 } 1822 description 1823 "Child Policy in the hierarchial configuration"; 1824 } 1825 } 1826 description 1827 "Augment the actions to policy entry"; 1829 } 1831 augment "/policy:policies" + 1832 "/policy:policy-entry" + 1833 "/policy:classifier-entry" + 1834 "/policy:classifier-action-entry-cfg" + 1835 "/policy:action-cfg-params" + 1836 "/example:meter-inline" + 1837 "/example:meter-type" + 1838 "/example:one-rate-two-color-meter-type" + 1839 "/example:one-rate-two-color-meter" + 1840 "/example:conform-action" + 1841 "/example:meter-action-params" + 1842 "/example:meter-action-val" { 1844 description 1845 "augment the one-rate-two-color meter conform 1846 with actions"; 1847 case meter-action-drop { 1848 description 1849 "meter drop"; 1850 uses action:drop; 1851 } 1852 case meter-action-mark-dscp { 1853 description 1854 "meter action dscp marking"; 1855 uses action:dscp-marking; 1856 } 1857 } 1858 augment "/policy:policies" + 1859 "/policy:policy-entry" + 1860 "/policy:classifier-entry" + 1861 "/policy:classifier-action-entry-cfg" + 1862 "/policy:action-cfg-params" + 1863 "/example:meter-inline" + 1864 "/example:meter-type" + 1865 "/example:one-rate-two-color-meter-type" + 1866 "/example:one-rate-two-color-meter" + 1867 "/example:exceed-action" + 1868 "/example:meter-action-params" + 1869 "/example:meter-action-val" { 1871 description 1872 "augment the one-rate-two-color meter exceed 1873 with actions"; 1874 case meter-action-drop { 1875 description 1876 "meter drop"; 1877 uses action:drop; 1878 } 1879 case meter-action-mark-dscp { 1880 description 1881 "meter action dscp marking"; 1882 uses action:dscp-marking; 1883 } 1884 } 1885 augment "/policy:policies" + 1886 "/policy:policy-entry" + 1887 "/policy:classifier-entry" + 1888 "/policy:classifier-action-entry-cfg" + 1889 "/policy:action-cfg-params" + 1890 "/example:meter-inline" + 1891 "/example:meter-type" + 1892 "/example:one-rate-tri-color-meter-type" + 1893 "/example:one-rate-tri-color-meter" + 1894 "/example:conform-action" + 1895 "/example:meter-action-params" + 1896 "/example:meter-action-val" { 1898 description 1899 "augment the one-rate-tri-color meter conform 1900 with actions"; 1901 case meter-action-drop { 1902 description 1903 "meter drop"; 1904 uses action:drop; 1905 } 1906 case meter-action-mark-dscp { 1907 description 1908 "meter action dscp marking"; 1909 uses action:dscp-marking; 1910 } 1911 } 1912 augment "/policy:policies" + 1913 "/policy:policy-entry" + 1914 "/policy:classifier-entry" + 1915 "/policy:classifier-action-entry-cfg" + 1916 "/policy:action-cfg-params" + 1917 "/example:meter-inline" + 1918 "/example:meter-type" + 1919 "/example:one-rate-tri-color-meter-type" + 1920 "/example:one-rate-tri-color-meter" + 1921 "/example:exceed-action" + 1922 "/example:meter-action-params" + 1923 "/example:meter-action-val" { 1925 description 1926 "augment the one-rate-tri-color meter exceed 1927 with actions"; 1928 case meter-action-drop { 1929 description 1930 "meter drop"; 1931 uses action:drop; 1932 } 1933 case meter-action-mark-dscp { 1934 description 1935 "meter action dscp marking"; 1936 uses action:dscp-marking; 1937 } 1938 } 1939 augment "/policy:policies" + 1940 "/policy:policy-entry" + 1941 "/policy:classifier-entry" + 1942 "/policy:classifier-action-entry-cfg" + 1943 "/policy:action-cfg-params" + 1944 "/example:meter-inline" + 1945 "/example:meter-type" + 1946 "/example:one-rate-tri-color-meter-type" + 1947 "/example:one-rate-tri-color-meter" + 1948 "/example:violate-action" + 1949 "/example:meter-action-params" + 1950 "/example:meter-action-val" { 1951 description 1952 "augment the one-rate-tri-color meter conform 1953 with actions"; 1954 case meter-action-drop { 1955 description 1956 "meter drop"; 1957 uses action:drop; 1958 } 1959 case meter-action-mark-dscp { 1960 description 1961 "meter action dscp marking"; 1962 uses action:dscp-marking; 1963 } 1964 } 1966 augment "/policy:policies" + 1967 "/policy:policy-entry" + 1968 "/policy:classifier-entry" + 1969 "/policy:classifier-action-entry-cfg" + 1970 "/policy:action-cfg-params" + 1971 "/example:meter-inline" + 1972 "/example:meter-type" + 1973 "/example:two-rate-tri-color-meter-type" + 1974 "/example:two-rate-tri-color-meter" + 1975 "/example:conform-action" + 1976 "/example:meter-action-params" + 1977 "/example:meter-action-val" { 1979 description 1980 "augment the one-rate-tri-color meter conform 1981 with actions"; 1982 case meter-action-drop { 1983 description 1984 "meter drop"; 1985 uses action:drop; 1986 } 1987 case meter-action-mark-dscp { 1988 description 1989 "meter action dscp marking"; 1990 uses action:dscp-marking; 1991 } 1992 } 1993 augment "/policy:policies" + 1994 "/policy:policy-entry" + 1995 "/policy:classifier-entry" + 1996 "/policy:classifier-action-entry-cfg" + 1997 "/policy:action-cfg-params" + 1998 "/example:meter-inline" + 1999 "/example:meter-type" + 2000 "/example:two-rate-tri-color-meter-type" + 2001 "/example:two-rate-tri-color-meter" + 2002 "/example:exceed-action" + 2003 "/example:meter-action-params" + 2004 "/example:meter-action-val" { 2006 description 2007 "augment the two-rate-tri-color meter exceed 2008 with actions"; 2009 case meter-action-drop { 2010 description 2011 "meter drop"; 2012 uses action:drop; 2013 } 2014 case meter-action-mark-dscp { 2015 description 2016 "meter action dscp marking"; 2017 uses action:dscp-marking; 2018 } 2019 } 2020 augment "/policy:policies" + 2021 "/policy:policy-entry" + 2022 "/policy:classifier-entry" + 2023 "/policy:classifier-action-entry-cfg" + 2024 "/policy:action-cfg-params" + 2025 "/example:meter-inline" + 2026 "/example:meter-type" + 2027 "/example:two-rate-tri-color-meter-type" + 2028 "/example:two-rate-tri-color-meter" + 2029 "/example:violate-action" + 2030 "/example:meter-action-params" + 2031 "/example:meter-action-val" { 2032 description 2033 "augment the two-rate-tri-color meter violate 2034 with actions"; 2035 case meter-action-drop { 2036 description 2037 "meter drop"; 2038 uses action:drop; 2039 } 2040 case meter-action-mark-dscp { 2041 description 2042 "meter action dscp marking"; 2043 uses action:dscp-marking; 2044 } 2045 } 2046 augment "/policy:policies" + 2047 "/policy:policy-entry" + 2048 "/policy:classifier-entry" + 2049 "/policy:classifier-action-entry-cfg" + 2050 "/policy:action-cfg-params" + 2051 "/example:meter-inline" + 2052 "/example:meter-type" + 2053 "/example:one-rate-two-color-meter-type" + 2054 "/example:one-rate-two-color-meter" { 2055 description 2056 "augment the one-rate-two-color meter with" + 2057 "color classifiers"; 2058 container conform-color { 2059 uses classifier:classifier-entry-generic-attr; 2060 description 2061 "conform color classifier container"; 2062 } 2063 container exceed-color { 2064 uses classifier:classifier-entry-generic-attr; 2065 description 2066 "exceed color classifier container"; 2067 } 2068 } 2069 augment "/policy:policies" + 2070 "/policy:policy-entry" + 2071 "/policy:classifier-entry" + 2072 "/policy:classifier-action-entry-cfg" + 2073 "/policy:action-cfg-params" + 2074 "/example:meter-inline" + 2075 "/example:meter-type" + 2076 "/example:one-rate-tri-color-meter-type" + 2077 "/example:one-rate-tri-color-meter" { 2078 description 2079 "augment the one-rate-tri-color meter with" + 2080 "color classifiers"; 2081 container conform-color { 2082 uses classifier:classifier-entry-generic-attr; 2083 description 2084 "conform color classifier container"; 2085 } 2086 container exceed-color { 2087 uses classifier:classifier-entry-generic-attr; 2088 description 2089 "exceed color classifier container"; 2090 } 2091 container violate-color { 2092 uses classifier:classifier-entry-generic-attr; 2093 description 2094 "violate color classifier container"; 2095 } 2096 } 2097 augment "/policy:policies" + 2098 "/policy:policy-entry" + 2099 "/policy:classifier-entry" + 2100 "/policy:classifier-action-entry-cfg" + 2101 "/policy:action-cfg-params" + 2102 "/example:meter-inline" + 2103 "/example:meter-type" + 2104 "/example:two-rate-tri-color-meter-type" + 2105 "/example:two-rate-tri-color-meter" { 2106 description 2107 "augment the two-rate-tri-color meter with" + 2108 "color classifiers"; 2109 container conform-color { 2110 uses classifier:classifier-entry-generic-attr; 2111 description 2112 "conform color classifier container"; 2113 } 2114 container exceed-color { 2115 uses classifier:classifier-entry-generic-attr; 2116 description 2117 "exceed color classifier container"; 2118 } 2119 container violate-color { 2120 uses classifier:classifier-entry-generic-attr; 2121 description 2122 "violate color classifier container"; 2123 } 2124 } 2126 /************************************************* 2127 * Augmentation to Target Module 2128 *************************************************/ 2130 augment "/if:interfaces/if:interface/" + 2131 "target:qos-target-entry/" + 2132 "target:qos-target-classifier-statistics/" + 2133 "diffserv:diffserv-action-statistics" { 2134 uses target:queuing-stats; 2135 description 2136 "Augment the statistics to policy entry"; 2137 } 2138 augment "/if:interfaces/if:interface/" + 2139 "target:qos-target-entry/" + 2140 "target:qos-target-classifier-statistics" { 2141 leaf relative-path { 2142 type string; 2143 description 2144 "Relative Path of the classifier entry in the 2145 hierarchial policy"; 2146 } 2147 description 2148 "Augment the statistics to policy entry"; 2149 } 2150 } 2152 A.2. Example of Company B Diffserv Model 2154 The following vendor example augments the qos and diffserv model, 2155 demonstrating some of the following functionality: 2157 - use of inline classifier definitions (defined inline in the policy 2158 vs referencing an externally defined classifier) 2160 - use of mulitple policy types, e.g. a queue policy, a scheduler 2161 policy, and a filter policy. All of these policies either augment 2162 the qos policy or the diffserv modules 2163 - use of a queue module, which uses and extends the queue grouping 2164 from the ietf-qos-action module 2166 - use of meter templates (v.s. meter inline) 2168 - use of internal meta data for classification and marking 2170 module example-compb-diffserv-filter-policy { 2171 yang-version 1; 2172 namespace "urn:ietf:params:xml:ns:yang:" + 2173 "example-compb-diffserv-filter-policy"; 2174 prefix compb-filter-policy; 2176 import ietf-qos-classifier { 2177 prefix classifier; 2178 } 2179 import ietf-qos-policy { 2180 prefix policy; 2181 } 2182 import ietf-qos-action { 2183 prefix action; 2184 } 2185 import ietf-diffserv { 2186 prefix diffserv; 2187 } 2189 organization "Company B"; 2190 contact 2191 "Editor: XYZ 2192 "; 2194 description 2195 "This module contains a collection of YANG definitions for 2196 configuring diffserv specification implementations. 2197 Copyright (c) 2014 IETF Trust and the persons identified as 2198 authors of the code. All rights reserved. 2199 Redistribution and use in source and binary forms, with or 2200 without modification, is permitted pursuant to, and subject 2201 to the license terms contained in, the Simplified BSD License 2202 set forth in Section 4.c of the IETF Trust's Legal Provisions 2203 Relating to IETF Documents 2204 (http://trustee.ietf.org/license-info). 2205 This version of this YANG module is part of RFC XXXX; see 2206 the RFC itself for full legal notices."; 2208 revision 2015-04-07 { 2209 description 2210 "Latest revision of diffserv policy"; 2212 reference "RFC XXXX"; 2213 } 2215 /* 2216 * The policy must be of either type v4 or v6. Corresponding 2217 * address types must be used. Enforce with "must" statement? 2218 */ 2219 identity v4-diffserv-policy-type { 2220 base policy:policy-type; 2221 description 2222 "This defines default policy-type"; 2223 } 2225 identity v6-diffserv-policy-type { 2226 base policy:policy-type; 2227 description 2228 "This defines default policy-type"; 2229 } 2231 /************************************************* 2232 * Classification types 2233 *************************************************/ 2235 identity forwarding-class { 2236 base classifier:filter-type; 2237 description 2238 "Forwarding class filter type"; 2239 } 2241 identity internal-loss-priority { 2242 base classifier:filter-type; 2243 description 2244 "Internal loss priority filter type"; 2245 } 2247 grouping forwarding-class-cfg { 2248 list forwarding-class-cfg { 2249 key "forwarding-class"; 2250 description 2251 "list of forwarding-classes"; 2252 leaf forwarding-class { 2253 type string; 2254 description 2255 "Forwarding class name"; 2256 } 2257 } 2258 description 2259 "Filter containing list of forwarding classes"; 2260 } 2262 grouping loss-priority-cfg { 2263 list loss-priority-cfg { 2264 key "loss-priority"; 2265 description 2266 "list of loss-priorities"; 2267 leaf loss-priority { 2268 type enumeration { 2269 enum high { 2270 description "High Loss Priority"; 2271 } 2272 enum medium-high { 2273 description "Medium-high Loss Priority"; 2274 } 2275 enum medium-low { 2276 description "Medium-low Loss Priority"; 2277 } 2278 enum low { 2279 description "Low Loss Priority"; 2280 } 2281 } 2282 description 2283 "Loss-priority"; 2284 } 2285 } 2286 description 2287 "Filter containing list of loss priorities"; 2288 } 2290 augment "/policy:policies" + 2291 "/policy:policy-entry" + 2292 "/policy:classifier-entry" + 2293 "/policy:filter-entry" + 2294 "/diffserv:filter-params" { 2295 case forwarding-class { 2296 uses forwarding-class-cfg; 2297 description 2298 "Filter Type Internal-loss-priority"; 2299 } 2300 case internal-loss-priority { 2301 uses loss-priority-cfg; 2302 description 2303 "Filter Type Internal-loss-priority"; 2304 } 2305 description 2306 "Augments Diffserv Classifier with vendor" + 2307 " specific types"; 2308 } 2310 /************************************************* 2311 * Actions 2312 *************************************************/ 2314 identity mark-fwd-class { 2315 base policy:action-type; 2316 description 2317 "mark forwarding class action type"; 2318 } 2320 identity mark-loss-priority { 2321 base policy:action-type; 2322 description 2323 "mark loss-priority action type"; 2324 } 2326 grouping mark-fwd-class { 2327 container mark-fwd-class-cfg { 2328 leaf forwarding-class { 2329 type string; 2330 description 2331 "Forwarding class name"; 2332 } 2333 description 2334 "mark-fwd-class container"; 2335 } 2336 description 2337 "mark-fwd-class grouping"; 2338 } 2340 grouping mark-loss-priority { 2341 container mark-loss-priority-cfg { 2342 leaf loss-priority { 2343 type enumeration { 2344 enum high { 2345 description "High Loss Priority"; 2346 } 2347 enum medium-high { 2348 description "Medium-high Loss Priority"; 2349 } 2350 enum medium-low { 2351 description "Medium-low Loss Priority"; 2352 } 2353 enum low { 2354 description "Low Loss Priority"; 2356 } 2357 } 2358 description 2359 "Loss-priority"; 2360 } 2361 description 2362 "mark-loss-priority container"; 2363 } 2364 description 2365 "mark-loss-priority grouping"; 2366 } 2368 augment "/policy:policies" + 2369 "/policy:policy-entry" + 2370 "/policy:classifier-entry" + 2371 "/policy:classifier-action-entry-cfg" + 2372 "/diffserv:action-cfg-params" { 2373 case mark-fwd-class { 2374 uses mark-fwd-class; 2375 description 2376 "Mark forwarding class in the packet"; 2377 } 2378 case mark-loss-priority { 2379 uses mark-loss-priority; 2380 description 2381 "Mark loss priority in the packet"; 2382 } 2383 case meter-reference { 2384 uses action:meter-reference; 2385 description 2386 "Assign a meter as an action"; 2387 } 2388 case discard { 2389 uses action:discard; 2390 description 2391 "Discard action"; 2392 } 2393 case count { 2394 uses action:count; 2395 description 2396 "Count action - explicit count configuration"; 2397 } 2398 description 2399 "Augments common diffserv policy actions"; 2400 } 2402 augment "/action:meter-template" + 2403 "/action:meter-entry" + 2404 "/action:meter-type" + 2405 "/action:one-rate-tri-color-meter-type" + 2406 "/action:one-rate-tri-color-meter" { 2407 leaf one-rate-color-aware { 2408 type boolean; 2409 description 2410 "This defines if the meter is color-aware"; 2411 } 2412 } 2413 augment "/action:meter-template" + 2414 "/action:meter-entry" + 2415 "/action:meter-type" + 2416 "/action:two-rate-tri-color-meter-type" + 2417 "/action:two-rate-tri-color-meter" { 2418 leaf two-rate-color-aware { 2419 type boolean; 2420 description 2421 "This defines if the meter is color-aware"; 2422 } 2423 } 2425 /* example of augmenting a meter template with a 2426 /* vendor specific action */ 2427 augment "/action:meter-template" + 2428 "/action:meter-entry" + 2429 "/action:meter-type" + 2430 "/action:one-rate-two-color-meter-type" + 2431 "/action:one-rate-two-color-meter" + 2432 "/action:exceed-action" + 2433 "/action:meter-action-params" + 2434 "/action:meter-action-val" { 2435 case meter-action-drop { 2436 description 2437 "meter drop"; 2438 uses action:drop; 2439 } 2441 description 2442 "Augment the actions to basic meter"; 2443 } 2445 } 2447 module example-compb-queue-policy { 2448 yang-version 1; 2449 namespace "urn:ietf:params:xml:ns:yang:example-compb-queue-policy"; 2450 prefix queue-plcy; 2451 import ietf-qos-classifier { 2452 prefix classifier; 2453 } 2454 import ietf-qos-policy { 2455 prefix policy; 2456 } 2458 organization "Company B"; 2459 contact 2460 "Editor: XYZ 2461 "; 2463 description 2464 "This module defines a queue policy. The classification 2465 is based on aforwarding class, and the actions are queues. 2466 Copyright (c) 2014 IETF Trust and the persons identified as 2467 authors of the code. All rights reserved. 2468 Redistribution and use in source and binary forms, with or 2469 without modification, is permitted pursuant to, and subject 2470 to the license terms contained in, the Simplified BSD License 2471 set forth in Section 4.c of the IETF Trust's Legal Provisions 2472 Relating to IETF Documents 2473 (http://trustee.ietf.org/license-info). 2474 This version of this YANG module is part of RFC XXXX; see 2475 the RFC itself for full legal notices."; 2477 revision 2015-04-07 { 2478 description 2479 "Latest revision of diffserv policy"; 2480 reference "RFC XXXX"; 2481 } 2483 identity forwarding-class { 2484 base classifier:filter-type; 2485 description 2486 "Forwarding class filter type"; 2487 } 2489 grouping forwarding-class-cfg { 2490 leaf forwarding-class-cfg { 2491 type string; 2492 description 2493 "forwarding-class name"; 2494 } 2495 description 2496 "Forwarding class filter"; 2497 } 2498 augment "/policy:policies" + 2499 "/policy:policy-entry" + 2500 "/policy:classifier-entry" + 2501 "/policy:filter-entry" { 2502 /* Does NOT support "logical-not" of forwarding class. 2503 Use "must"? */ 2504 choice filter-params { 2505 description 2506 "Choice of filters"; 2507 case forwarding-class-cfg { 2508 uses forwarding-class-cfg; 2509 description 2510 "Filter Type Internal-loss-priority"; 2511 } 2512 } 2513 description 2514 "Augments Diffserv Classifier with fwd class filter"; 2515 } 2517 identity compb-queue { 2518 base policy:action-type; 2519 description 2520 "compb-queue action type"; 2521 } 2523 grouping compb-queue-name { 2524 container queue-name { 2525 leaf name { 2526 type string; 2527 description 2528 "Queue class name"; 2529 } 2530 description 2531 "compb queue container"; 2532 } 2533 description 2534 "compb-queue grouping"; 2535 } 2537 augment "/policy:policies" + 2538 "/policy:policy-entry" + 2539 "/policy:classifier-entry" + 2540 "/policy:classifier-action-entry-cfg" { 2541 choice action-cfg-params { 2542 description 2543 "Choice of action types"; 2544 case compb-queue { 2545 uses compb-queue-name; 2547 } 2548 } 2549 description 2550 "Augment the queue actions to queue policy entry"; 2551 } 2552 } 2554 module example-compb-queue { 2555 yang-version 1; 2556 namespace "urn:ietf:params:xml:ns:yang:ietf-compb-queue"; 2557 prefix compb-queue; 2559 import ietf-qos-action { 2560 prefix action; 2561 } 2563 organization "Company B"; 2564 contact 2565 "Editor: XYZ 2566 "; 2568 description 2569 "This module describes a compb queue module. This is a 2570 template for a queue within a queue policy, referenced 2571 by name. 2573 This version of this YANG module is part of RFC XXXX; see 2574 the RFC itself for full legal notices."; 2576 revision 2015-04-07 { 2577 description 2578 "Latest revision of diffserv based classifier"; 2579 reference "RFC XXXX"; 2580 } 2582 container compb-queue { 2583 description 2584 "Queue used in compb architecture"; 2585 leaf name { 2586 type string; 2587 description 2588 "A unique name identifying this queue"; 2589 } 2590 uses action:queue; 2591 container excess-rate { 2592 choice excess-rate-type { 2593 case percent { 2594 leaf excess-rate-percent { 2595 type uint32 { 2596 range "1..100"; 2597 } 2598 description 2599 "excess-rate-percent"; 2600 } 2601 } 2602 case proportion { 2603 leaf excess-rate-poroportion { 2604 type uint32 { 2605 range "1..1000"; 2606 } 2607 description 2608 "excess-rate-poroportion"; 2609 } 2610 } 2611 description 2612 "Choice of excess-rate type"; 2613 } 2614 description 2615 "Excess rate value"; 2616 } 2617 leaf excess-priority { 2618 type enumeration { 2619 enum high { 2620 description "High Loss Priority"; 2621 } 2622 enum medium-high { 2623 description "Medium-high Loss Priority"; 2624 } 2625 enum medium-low { 2626 description "Medium-low Loss Priority"; 2627 } 2628 enum low { 2629 description "Low Loss Priority"; 2630 } 2631 enum none { 2632 description "No excess priority"; 2633 } 2634 } 2635 description 2636 "Priority of excess (above guaranted rate) traffic"; 2637 } 2638 container buffer-size { 2639 choice buffer-size-type { 2640 case percent { 2641 leaf buffer-size-percent { 2642 type uint32 { 2643 range "1..100"; 2644 } 2645 description 2646 "buffer-size-percent"; 2647 } 2648 } 2649 case temporal { 2650 leaf buffer-size-temporal { 2651 type uint64; 2652 units "microsecond"; 2653 description 2654 "buffer-size-temporal"; 2655 } 2656 } 2657 case remainder { 2658 leaf buffer-size-remainder { 2659 type empty; 2660 description 2661 "use remaining of buffer"; 2662 } 2663 } 2664 description 2665 "Choice of buffer size type"; 2666 } 2667 description 2668 "Buffer size value"; 2669 } 2670 } 2672 augment 2673 "/compb-queue" + 2674 "/queue-cfg" + 2675 "/algorithmic-drop-cfg" + 2676 "/drop-algorithm" { 2677 case random-detect { 2678 list drop-profile-list { 2679 key "priority"; 2680 description 2681 "map of priorities to drop-algorithms"; 2682 leaf priority { 2683 type enumeration { 2684 enum any { 2685 description "Any priority mapped here"; 2686 } 2687 enum high { 2688 description "High Priority Packet"; 2689 } 2690 enum medium-high { 2691 description "Medium-high Priority Packet"; 2692 } 2693 enum medium-low { 2694 description "Medium-low Priority Packet"; 2695 } 2696 enum low { 2697 description "Low Priority Packet"; 2698 } 2699 } 2700 description 2701 "Priority of guaranteed traffic"; 2702 } 2703 leaf drop-profile { 2704 type string; 2705 description 2706 "drop profile to use for this priority"; 2707 } 2708 } 2709 } 2710 description 2711 "compb random detect drop algorithm config"; 2712 } 2713 } 2715 module example-compb-scheduler-policy { 2716 yang-version 1; 2717 namespace "urn:ietf:params:xml:ns:yang:" + 2718 "example-compb-scheduler-policy"; 2719 prefix scheduler-plcy; 2721 import ietf-qos-action { 2722 prefix action; 2723 } 2725 import ietf-qos-policy { 2726 prefix policy; 2727 } 2729 organization "Company B"; 2730 contact 2731 "Editor: XYZ 2732 "; 2734 description 2735 "This module defines a scheduler policy. The classification 2736 is based on classifier-any, and the action is a scheduler."; 2738 revision 2015-04-07 { 2739 description 2740 "Latest revision of diffserv policy"; 2741 reference "RFC XXXX"; 2742 } 2744 identity queue-policy { 2745 base policy:action-type; 2746 description 2747 "forwarding-class-queue action type"; 2748 } 2750 grouping queue-policy-name { 2751 container compb-queue-policy-name { 2752 leaf name { 2753 type string; 2754 description 2755 "Queue policy name"; 2756 } 2757 description 2758 "compb-queue-policy container"; 2759 } 2760 description 2761 "compb-queue policy grouping"; 2762 } 2764 augment "/policy:policies" + 2765 "/policy:policy-entry" + 2766 "/policy:classifier-entry" + 2767 "/policy:classifier-action-entry-cfg" { 2768 choice action-cfg-params { 2769 case schedular { 2770 uses action:schedular; 2771 } 2772 case queue-policy { 2773 uses queue-policy-name; 2774 } 2775 description 2776 "Augment the scheduler policy with a queue policy"; 2777 } 2778 } 2779 } 2781 A.3. Example of Company C Diffserv Model 2783 Company C vendor augmentation is based on Ericsson's implementation 2784 differentiated QoS. This implementation first sorts traffic based on 2785 a classifier, which can sort traffic into one or more traffic 2786 forwarding classes. Then, a policer or meter policy references the 2787 classifier and its traffic forwarding classes to specify different 2788 service levels for each traffic forwarding class. 2790 Because each classifier sorts traffic into one or more traffic 2791 forwarding classes, this type of classifier does not align with ietf- 2792 qos-classifier.yang, which defines one traffic forwarding class per 2793 classifier. Additionally, Company C's policing and metering policies 2794 relies on the classifier's pre-defined traffic forwarding classes to 2795 provide differentiated services, rather than redefining the patterns 2796 within a policing or metering policy, as is defined in ietf- 2797 diffserv.yang. 2799 Due to these differences, even though Company C uses all the building 2800 blocks of classifier and policy, Company C's augmentation does not 2801 use ietf-diffserv.yang to provide differentiated service levels. 2802 Instead, Company C's augmentation uses the basic building blocks, 2803 ietf-qos-policy.yang to provide differentiated services. 2805 module example-compc-qos-policy { 2806 yang-version 1.1; 2807 namespace "urn:example-compc-qos-policy"; 2808 prefix "compcqos"; 2810 import ietf-qos-policy { 2811 prefix "pol"; 2812 } 2814 import ietf-qos-action { 2815 prefix "action"; 2816 } 2818 organization ""; 2819 contact ""; 2820 description ""; 2822 revision 2016-09-26 { 2823 description ""; 2824 reference ""; 2825 } 2827 /* identities */ 2829 identity compc-qos-policy { 2830 base pol:policy-type; 2831 } 2833 identity mdrr-queuing-policy { 2834 base compc-qos-policy; 2836 } 2838 identity pwfq-queuing-policy { 2839 base compc-qos-policy; 2840 } 2842 identity policing-policy { 2843 base compc-qos-policy; 2844 } 2846 identity metering-policy { 2847 base compc-qos-policy; 2848 } 2850 identity forwarding-policy { 2851 base compc-qos-policy; 2852 } 2854 identity overhead-profile-policy { 2855 base compc-qos-policy; 2856 } 2858 identity resource-profile-policy { 2859 base compc-qos-policy; 2860 } 2862 identity protocol-rate-limit-policy { 2863 base compc-qos-policy; 2864 } 2866 identity compc-qos-action { 2867 base pol:action-type; 2868 } 2870 /* groupings */ 2872 grouping redirect-action-grp { 2873 container redirect { 2874 /* Redirect options */ 2875 } 2876 } 2878 /* deviations */ 2880 deviation "/pol:policies/pol:policy-entry" { 2881 deviate add { 2882 must "pol:type = compc-qos-policy" { 2883 description 2884 "Only policy types drived from compc-qos-policy " + 2885 "are supported"; 2886 } 2887 } 2888 } 2890 deviation "/pol:policies/pol:policy-entry/pol:classifier-entry" { 2891 deviate add { 2892 must "../per-class-action = 'true'" { 2893 description 2894 "Only policies with per-class actions have classifiers"; 2895 } 2896 must "((../sub-type != 'mdrr-queuing-policy') and " + 2897 " (../sub-type != 'pwfq-queuing-policy')) or " + 2898 "(((../sub-type = 'mdrr-queuing-policy') or " + 2899 " (../sub-type = 'pwfq-queueing-policy')) and " + 2900 " ((classifier-entry-name = '0') or " + 2901 " (classifier-entry-name = '1') or " + 2902 " (classifier-entry-name = '2') or " + 2903 " (classifier-entry-name = '3') or " + 2904 " (classifier-entry-name = '4') or " + 2905 " (classifier-entry-name = '5') or " + 2906 " (classifier-entry-name = '6') or " + 2907 " (classifier-entry-name = '7') or " + 2908 " (classifier-entry-name = '8')))" { 2909 description 2910 "MDRR queuing policy's or PWFQ queuing policy's " + 2911 "classifier-entry-name is limited to the listed values"; 2912 } 2913 } 2914 } 2916 deviation "/pol:policies/pol:policy-entry/pol:classifier-entry" + 2917 "/pol:classifier-action-entry-cfg" { 2918 deviate add { 2919 max-elements 1; 2920 must "action-type = 'compc-qos-action'" { 2921 description 2922 "Only compc-qos-action is allowed"; 2923 } 2924 } 2925 } 2927 /* augments */ 2929 augment "/pol:policies/pol:policy-entry" { 2930 when "pol:type = 'compc-qos-policy')" { 2931 description 2932 "Additional nodes only for diffserv-policy"; 2933 } 2934 leaf sub-type { 2935 type identityref { 2936 base compc-qos-policy; 2937 } 2938 mandatory true; 2939 /* The value of this leaf must not change once configured */ 2940 } 2941 leaf per-class-action { 2942 mandatory true; 2943 type boolean; 2944 must "(((. = 'true') and " + 2945 " ((../sub-type = 'policing-policy') or " + 2946 " (../sub-type = 'metering-policy') or " + 2947 " (../sub-type = 'mdrr-queuing-policy') or " + 2948 " (../sub-type = 'pwfq-queuing-policy') or " + 2949 " (../sub-type = 'forwarding-policy'))) or " + 2950 " ((. = 'false') and " + 2951 " ((../sub-type = 'overhead-profile-policy') or " + 2952 " (../sub-type = 'resource-profile-policy') or " + 2953 " (../sub-type = 'protocol-rate-limit-policy')))" { 2954 description 2955 "Only certain policies have per-class action"; 2956 } 2957 } 2958 container traffic-classifier { 2959 presence true; 2960 when "../sub-type = 'policing-policy' or " + 2961 "../sub-type = 'metering-policy' or " + 2962 "../sub-type = 'forwarding-policy'" { 2963 description 2964 "A classifier for policing-policy or metering-policy"; 2965 } 2966 leaf name { 2967 type string; 2968 mandatory true; 2969 description 2970 "Traffic classifier name"; 2971 } 2972 leaf type { 2973 type enumeration { 2974 enum 'internal-dscp-only-classifier' { 2975 value 0; 2976 description 2977 "Classify traffic based on (internal) dscp only"; 2978 } 2979 enum 'ipv4-header-based-classifier' { 2980 value 1; 2981 description 2982 "Classify traffic based on IPv4 packet header fields"; 2983 } 2984 enum 'ipv6-header-based-classifier' { 2985 value 2; 2986 description 2987 "Classify traffic based on IPv6 packet header fields"; 2988 } 2989 } 2990 mandatory true; 2991 description 2992 "Traffic classifier type"; 2993 } 2994 } 2995 container traffic-queue { 2996 when "(../sub-type = 'mdrr-queuing-policy') or " + 2997 "(../sub-type = 'pwfq-queuing-policy')" { 2998 description 2999 "Queuing policy properties"; 3000 } 3001 leaf queue-map { 3002 type string; 3003 description 3004 "Traffic queue map for queuing policy"; 3005 } 3006 } 3007 container overhead-profile { 3008 when "../sub-type = 'overhead-profile-policy'" { 3009 description 3010 "Overhead profile policy properties"; 3011 } 3012 } 3013 container resource-profile { 3014 when "../sub-type = 'resource-profile-policy'" { 3015 description 3016 "Resource profile policy properties"; 3017 } 3018 } 3019 container protocol-rate-limit { 3020 when "../sub-type = 'protocol-rate-limit-policy'" { 3021 description 3022 "Protocol rate limit policy properties"; 3023 } 3024 } 3025 } 3027 augment "/pol:policies/pol:policy-entry/pol:classifier-entry" + 3028 "/pol:classifier-action-entry-cfg/pol:action-cfg-params" { 3029 when "../../../pol:type = 'compc-qos-policy')" { 3030 description 3031 "Configurations for a classifier-policy-type policy"; 3032 } 3033 case metering-or-policing-policy { 3034 when "../../../sub-type = 'policing-policy' or " 3035 + "../../../sub-type = 'metering-policy'" { 3036 } 3037 container dscp-marking { 3038 uses action:dscp-marking; 3039 } 3040 container precedence-marking { 3041 uses action:dscp-marking; 3042 } 3043 container priority-marking { 3044 uses action:priority; 3045 } 3046 container rate-limiting { 3047 uses action:one-rate-two-color-meter; 3048 } 3049 } 3050 case mdrr-queuing-policy { 3051 when "../../../sub-type = 'mdrr-queuing-policy'" { 3052 description 3053 "MDRR queue handling properties for the traffic " + 3054 "classified into current queue"; 3055 } 3056 leaf mdrr-queue-weight { 3057 type uint8 { 3058 range "20..100"; 3059 } 3060 units percentage; 3061 } 3062 } 3063 case pwfq-queuing-policy { 3064 when "../../../sub-type = 'pwfq-queuing-policy'" { 3065 description 3066 "PWFQ queue handling properties for traffic " + 3067 "classified into current queue"; 3068 } 3069 leaf pwfq-queue-weight { 3070 type uint8 { 3071 range "20..100"; 3072 } 3073 units percentage; 3074 } 3075 leaf pwfq-queue-priority { 3076 type uint8; 3077 } 3078 leaf pwfq-queue-rate { 3079 type uint8; 3080 } 3081 } 3082 case forwarding-policy { 3083 when "../../../sub-type = 'forwarding-policy'" { 3084 description 3085 "Forward policy handling properties for traffic " + 3086 "in this classifier"; 3087 } 3088 uses redirect-action-grp; 3089 } 3090 description 3091 "Add the classify action configuration"; 3092 } 3094 } 3096 Authors' Addresses 3098 Aseem Choudhary 3099 Cisco Systems 3100 170 W. Tasman Drive 3101 San Jose, CA 95134 3102 US 3104 Email: asechoud@cisco.com 3106 Mahesh Jethanandani 3107 Cisco Systems 3108 170 W. Tasman Drive 3109 San Jose, CA 95134 3110 US 3112 Email: mjethanandani@gmail.com 3114 Norm Strahle 3115 Juniper Networks 3116 1194 North Mathilda Avenue 3117 Sunnyvale, CA 94089 3118 US 3120 Email: nstrahle@juniper.net 3121 Ebben Aries 3122 Juniper Networks 3123 1194 North Mathilda Avenue 3124 Sunnyvale, CA 94089 3125 US 3127 Email: exa@juniper.net 3129 Ing-Wher Chen 3130 Jabil 3132 Email: ing-wher_chen@jabil.com