idnits 2.17.1 draft-asechoud-rtgwg-qos-model-02.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 72 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 186 has weird spacing: '...cal-not boo...' == Line 208 has weird spacing: '...cal-not boo...' == Line 210 has weird spacing: '...on-type ide...' == Line 230 has weird spacing: '...on-type ide...' == Line 234 has weird spacing: '...on-type ide...' == (28 more instances...) -- The document date (June 14, 2017) is 2505 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: December 16, 2017 N. Strahle 6 E. Aries 7 Juniper Networks 8 I. Chen 9 Kuatro Technologies 10 June 14, 2017 12 YANG Model for QoS 13 draft-asechoud-rtgwg-qos-model-02 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 http://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 December 16, 2017. 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 (http://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 . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 60 6.1. IETF-QOS-CLASSIFIER . . . . . . . . . . . . . . . . . . . 9 61 6.2. IETF-QOS-POLICY . . . . . . . . . . . . . . . . . . . . . 15 62 6.3. IETF-QOS-ACTION . . . . . . . . . . . . . . . . . . . . . 18 63 6.4. IETF-QOS-TARGET . . . . . . . . . . . . . . . . . . . . . 30 64 6.5. IETF-DIFFSERV . . . . . . . . . . . . . . . . . . . . . . 35 65 7. Security Considerations . . . . . . . . . . . . . . . . . . . 40 66 8. Acknowledgement . . . . . . . . . . . . . . . . . . . . . . . 40 67 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 40 68 9.1. Normative References . . . . . . . . . . . . . . . . . . 40 69 9.2. Informative References . . . . . . . . . . . . . . . . . 41 70 Appendix A. Company A, Company B and Company C examples . . . . 41 71 A.1. Example of Company A Diffserv Model . . . . . . . . . . . 41 72 A.2. Example of Company B Diffserv Model . . . . . . . . . . . 51 73 A.3. Example of Company C Diffserv Model . . . . . . . . . . . 65 74 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 71 76 1. Introduction 78 This document defines a base YANG [RFC6020] data module for Quality 79 of Service (QoS) configuration and operational parameters. 80 Differentiated Services (DiffServ) module is an augmentation of the 81 base QoS model. Remote Procedure Calls (RPC) or notification 82 definition is currently not part of this document and will be added 83 later if necessary. QoS base modules define a basic building blocks 84 to define a classifier, policy, action and target. The base modules 85 have been augmented to include packet match fields, action 86 parameters, and statistics data to define the DiffServ module. It is 87 left up to individual vendors to stitch actions like queues, random- 88 detect (RED) and vendor specific parameters of the DiffServ policy 89 definitions. Designing the module in this manner allows for a very 90 flexible and extensible module that should fit in with most of the 91 vendor requirements. The DiffServ model is based on DiffServ 92 architecture, and various references have been made to available 93 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 2. Terminology 104 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 105 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 106 document are to be interpreted as described in [RFC2119]. 108 3. QoS Model Design 110 A classifier consists of packets which may be grouped when a logical 111 set of rules are applied on different packet header fields. The 112 grouping may be based on different values or range of values of same 113 packet header field, presence or absence of some values or range of 114 values of a packet field or a combination thereof. The QoS 115 classifier is defined in the ietf-qos-classifier module. 117 A classifier entry contains one or more packet conditioning 118 functions. A packet conditioning function is typically based on 119 direction of traffic and may drop, mark or delay network packets. A 120 set of classifier entries with corresponding conditioning functions 121 when arranged in order of priority represents a QoS policy. A QoS 122 policy may contain one or more classifier entries. These are defined 123 in ietf-qos-policy module. 125 Actions are configured in line with respect to the policy module. 126 These include marking, dropping or shaping. Actions are defined in 127 the ietf-qos-action module. 129 A meter qualifies if the traffic arrival rate is based on agreed upon 130 rate and variability. A meter is modeled based on commonly used 131 alogrithms in industry, Single Rate Tri Color Marking (srTCM) 132 [RFC2697] meter, Two Rate Tri Color Marking (trTCM) [RFC2698] meter, 133 and Single Rate Two Color Marking meter. Different vendors can 134 extend it with other types of meters as well. 136 4. DiffServ Model Design 138 DiffServ architecture [RFC3289] and [RFC2475] describe the 139 architecture as a simple model where traffic entering a network is 140 classified and possibly conditioned at the boundary of the network 141 and assigned a different Behavior Aggregate (BA). Each BA is 142 identified by a specific value of DSCP, and is used to select a Per 143 Hop Behavior (PHB). 145 The packet classification policy identifies the subset of traffic 146 which may receive a DiffServ by being conditioned or mapped. Packet 147 classifiers select packets within a stream based on the content of 148 some portion of the packet header. There are two types of 149 classifiers, the BA classifier, and the Multi-Field (MF) classifier 150 which selects packets based on a value which is combination of one or 151 more header fields. In the ietf-diffserv module, this is realized by 152 augmenting the QoS classification module. 154 Traffic conditioning includes metering, shaping and/or marking. A 155 meter is used to measure the traffic against a given traffic profile. 156 The traffic profile specifies the temporal property of the traffic. 157 A packet that arrives is first determined to be in or out of the 158 profile, which will result in the action of marked, dropped or 159 shaped. This is realized in vendor specific modules based on the 160 parameters defined in action module. The metering parameters are 161 augmented to the QoS policy module when metering is defined inline, 162 and to the metering template when metering profile is referred in 163 policy module. 165 Finally, statistics are realized in the ietf-diffserv module by 166 augmenting the QoS target module. 168 5. Modules Tree Structure 170 This document defines five YANG modules - four QoS base modules and 171 one DiffServ module. 173 ietf-qos-classifier consists of classifier entries identified by a 174 classifier entry name. Each entry MAY contain a list of filter 175 entries. When no filter entry is present in a classifier entry, it 176 matches all traffic. 178 module: ietf-qos-classifier 179 +--rw classifiers 180 +--rw classifier-entry* [classifier-entry-name] 181 +--rw classifier-entry-name string 182 +--rw classifier-entry-descr? string 183 +--rw classifier-entry-filter-operation? identityref 184 +--rw filter-entry* [filter-type filter-logical-not] 185 +--rw filter-type identityref 186 +--rw filter-logical-not boolean 188 An ietf-qos-policy module contains list of policy objects identified 189 by a policy name and policy type which MUST be provided. With 190 different values of policy types, each vendor MAY define their own 191 construct of policy for different QoS functionalities. Each vendor 192 MAY augment classifier entry in a policy definition with a set of 193 actions. 195 module: ietf-qos-policy 196 +--rw policies 197 +--rw policy-entry* [policy-name policy-type] 198 +--rw policy-name string 199 +--rw policy-type identityref 200 +--rw policy-descr? string 201 +--rw classifier-entry* [classifier-entry-name] 202 +--rw classifier-entry-name string 203 +--rw classifier-entry-inline? boolean 204 +--rw classifier-entry-filter-oper? identityref 205 +--rw filter-entry* [filter-type filter-logical-not] 206 {policy-inline-classifier-config}? 207 | +--rw filter-type identityref 208 | +--rw filter-logical-not boolean 209 +--rw classifier-action-entry-cfg* [action-type] 210 +--rw action-type identityref 211 +--rw (action-cfg-params)? 213 ietf-qos-action module contains grouping of set of QoS actions. 214 These include metering, marking, dropping and shaping. Marking sets 215 DiffServ codepoint value in the classified packet. Color-aware and 216 Color-blind meters are augmented by vendor specific modules based on 217 the parameters defined in action module. 219 module: ietf-qos-action 220 +--rw meter-template 221 +--rw meter-entry* [meter-name] {meter-template-support}? 222 +--rw meter-name string 223 +--rw (meter-type)? 224 +--:(one-rate-two-color-meter-type) 225 | +--rw one-rate-two-color-meter 226 | +--rw meter-rate? uint64 227 | +--rw meter-burst? uint64 228 | +--rw conform-action 229 | | +--rw meter-action-params* [meter-action-type] 230 | | +--rw meter-action-type identityref 231 | | +--rw (meter-action-val)? 232 | +--rw exceed-action 233 | +--rw meter-action-params* [meter-action-type] 234 | +--rw meter-action-type identityref 235 | +--rw (meter-action-val)? 236 +--:(one-rate-tri-color-meter-type) 237 | +--rw one-rate-tri-color-meter 238 | +--rw committed-rate? uint64 239 | +--rw committed-burst? uint64 240 | +--rw excess-burst? uint64 241 | +--rw conform-action 242 | | +--rw meter-action-params* [meter-action-type] 243 | | +--rw meter-action-type identityref 244 | | +--rw (meter-action-val)? 245 | +--rw exceed-action 246 | | +--rw meter-action-params* [meter-action-type] 247 | | +--rw meter-action-type identityref 248 | | +--rw (meter-action-val)? 249 | +--rw violate-action 250 | +--rw meter-action-params* [meter-action-type] 251 | +--rw meter-action-type identityref 252 | +--rw (meter-action-val)? 253 +--:(two-rate-tri-color-meter-type) 254 +--rw two-rate-tri-color-meter 255 +--rw committed-rate? uint64 256 +--rw committed-burst? uint64 257 +--rw peak-rate? uint64 258 +--rw peak-burst? uint64 259 +--rw conform-action 260 | +--rw meter-action-params* [meter-action-type] 261 | +--rw meter-action-type identityref 262 | +--rw (meter-action-val)? 263 +--rw exceed-action 264 | +--rw meter-action-params* [meter-action-type] 265 | +--rw meter-action-type identityref 266 | +--rw (meter-action-val)? 267 +--rw violate-action 268 +--rw meter-action-params* [meter-action-type] 269 +--rw meter-action-type identityref 270 +--rw (meter-action-val)? 272 ietf-qos-target module contains reference of qos-policy and augments 273 ietf-interfaces [RFC7223] module. A single policy of a particular 274 policy-type can be applied on an interface in each direction of 275 traffic. Policy-type is of type identity and is populated in a 276 vendor specific manner. This way it provides greater flexibility for 277 each vendor to define different policy types each with its own 278 capabilities and restrictions. 280 Classifier, metering and queuing counters are associated with a 281 target. 283 module: ietf-qos-target 284 augment /if:interfaces/if:interface: 285 +--rw qos-target-entry* [direction policy-type] 286 | +--rw direction identityref 287 | +--rw policy-type identityref 288 | +--rw policy-name string 289 +--ro qos-target-classifier-statistics* 290 +--ro policy-name? string 291 +--ro direction? identityref 292 +--ro classifier-entry-name? string 293 +--ro stats-name? string 294 +--ro classifier-entry-statistics 295 +--ro classified-pkts? uint64 296 +--ro classified-bytes? uint64 297 +--ro classified-rate? uint64 299 Diffserv module augments QoS classifier module. Many of the YANG 300 types defined in [RFC6991] are represented as leafs in the classifier 301 module. 303 Metering and marking actions are realized by augmenting the QoS 304 policy-module. Any queuing, AQM and scheduling actions are part of 305 vendor specific augmentation. Statistics are realized by augmenting 306 the QoS target module. 308 module: ietf-diffserv 309 augment "/classifier:classifiers/classifier:classifier-entry" + 310 "/classifier:filter-entry": 311 +--rw (filter-param)? 312 +--:(dscp) 313 | +--rw dscp-cfg* [dscp-min dscp-max] 314 | +--rw dscp-min inet:dscp 315 | +--rw dscp-max inet:dscp 316 +--:(source-ip-address) 317 | +--rw source-ip-address-cfg* [source-ip-addr] 318 | +--rw source-ip-addr inet:ip-prefix 319 +--:(destination-ip-address) 320 | +--rw destination-ip-address-cfg* [destination-ip-addr] 321 | +--rw destination-ip-addr inet:ip-prefix 322 +--:(source-port) 323 | +--rw source-port-cfg* [source-port-min source-port-max] 324 | +--rw source-port-min inet:port-number 325 | +--rw source-port-max inet:port-number 326 +--:(destination-port) 327 | +--rw destination-port-cfg* 328 [destination-port-min destination-port-max] 329 | +--rw destination-port-min inet:port-number 330 | +--rw destination-port-max inet:port-number 331 +--:(protocol) 332 +--rw protocol-cfg* [protocol-min protocol-max] 333 +--rw protocol-min uint8 334 +--rw protocol-max uint8 335 augment "/policy:policies/policy:policy-entry" + 336 "/policy:classifier-entry/policy:filter-entry": 337 +--rw (filter-params)? 338 +--:(dscp) 339 | +--rw dscp-cfg* [dscp-min dscp-max] 340 | +--rw dscp-min inet:dscp 341 | +--rw dscp-max inet:dscp 342 +--:(source-ip-address) 343 | +--rw source-ip-address-cfg* [source-ip-addr] 344 | +--rw source-ip-addr inet:ip-prefix 345 +--:(destination-ip-address) 346 | +--rw destination-ip-address-cfg* [destination-ip-addr] 347 | +--rw destination-ip-addr inet:ip-prefix 348 +--:(source-port) 349 | +--rw source-port-cfg* [source-port-min source-port-max] 350 | +--rw source-port-min inet:port-number 351 | +--rw source-port-max inet:port-number 352 +--:(destination-port) 353 | +--rw destination-port-cfg* 354 [destination-port-min destination-port-max] 355 | +--rw destination-port-min inet:port-number 356 | +--rw destination-port-max inet:port-number 357 +--:(protocol) 358 +--rw protocol-cfg* [protocol-min protocol-max] 359 +--rw protocol-min uint8 360 +--rw protocol-max uint8 361 augment "/policy:policies/policy:policy-entry" + 362 "/policy:classifier-entry" + 363 "/policy:classifier-action-entry-cfg": 364 +--rw (action-cfg-params)? 365 +--:(dscp-marking) 366 +--rw dscp-cfg 367 +--rw dscp? inet:dscp 368 augment /if:interfaces/if:interface: 369 +--ro qos-target-meter-statistics* 370 | +--ro policy-name? string 371 | +--ro direction? identityref 372 | +--ro classifier-entry-name? string 373 | +--ro meter-name? string 374 | +--ro conform-pkts? uint64 375 | +--ro conform-bytes? uint64 376 | +--ro conform-rate? uint64 377 | +--ro exceed-pkts? uint64 378 | +--ro exceed-bytes? uint64 379 | +--ro exceed-rate? uint64 380 | +--ro violate-pkts? uint64 381 | +--ro violate-bytes? uint64 382 | +--ro violate-rate? uint64 383 +--ro qos-target-queue-statistics* 384 +--ro policy-name? string 385 +--ro direction? identityref 386 +--ro classifier-entry-name? string 387 +--ro queue-id? uint64 388 +--ro traffic-class? string 389 +--ro queuing-statistics 390 +--ro output-pkts? uint64 391 +--ro output-bytes? uint64 392 +--ro queue-current-size-bytes? uint64 393 +--ro queue-average-size-bytes? uint64 394 +--ro queue-peak-size-bytes? uint64 395 +--ro drop-pkts? uint64 396 +--ro drop-bytes? uint64 398 6. Modules 400 6.1. IETF-QOS-CLASSIFIER 402 file "ietf-qos-classifier@2016-03-03.yang" 403 module ietf-qos-classifier { 404 yang-version 1; 405 namespace "urn:ietf:params:xml:ns:yang:ietf-qos-classifier"; 406 prefix classifier; 407 import ietf-inet-types { 408 prefix inet; 409 } 410 organization "IETF RTG (Routing Area) Working Group"; 411 contact 412 "WG Web: 413 WG List: 414 WG Chair: Chris Bowers 415 416 WG Chair: Jeff Tantsura 417 418 Editor: Aseem Choudhary 419 420 Editor: Mahesh Jethanandani 421 422 Editor: Norm Strahle 423 "; 424 description 425 "This module contains a collection of YANG definitions for 426 configuring qos specification implementations. 428 Copyright (c) 2014 IETF Trust and the persons identified as 429 authors of the code. All rights reserved. 430 Redistribution and use in source and binary forms, with or 431 without modification, is permitted pursuant to, and subject 432 to the license terms contained in, the Simplified BSD License 433 set forth in Section 4.c of the IETF Trust's Legal Provisions 434 Relating to IETF Documents 435 (http://trustee.ietf.org/license-info). 436 This version of this YANG module is part of RFC XXXX; see 437 the RFC itself for full legal notices."; 438 revision 2016-03-03 { 439 description 440 "Latest revision of qos base classifier module"; 441 reference "RFC XXXX"; 442 } 443 feature policy-inline-classifier-config { 444 description 445 " This feature allows classifier configuration 446 directly under policy."; 447 } 448 identity filter-type { 449 description 450 "This is identity of base filter-type"; 451 } 452 identity dscp { 453 base filter-type; 454 description 455 "Differentiated services code point filter-type"; 456 } 457 identity source-ip-address { 458 base filter-type; 459 description 460 "source ipv4 and ipv6 address filter-type"; 461 } 462 identity destination-ip-address { 463 base filter-type; 464 description 465 "destination ipv4 and ipv6 address filter-type"; 466 } 467 identity source-port { 468 base filter-type; 469 description 470 "source port filter-type"; 471 } 472 identity destination-port { 473 base filter-type; 474 description 475 "destination port filter-type"; 477 } 478 identity protocol { 479 base filter-type; 480 description 481 "protocol type filter-type"; 482 } 483 identity classifier-entry-filter-operation-type { 484 description 485 "Classifier entry filter logical operation"; 486 } 487 identity match-any-filter { 488 base classifier-entry-filter-operation-type; 489 description 490 "Classifier entry filter logical OR operation"; 491 } 492 identity match-all-filter { 493 base classifier-entry-filter-operation-type; 494 description 495 "Classifier entry filter logical AND operation"; 496 } 497 grouping dscp-cfg { 498 list dscp-cfg { 499 key "dscp-min dscp-max"; 500 description 501 "list of dscp ranges"; 502 leaf dscp-min { 503 type inet:dscp; 504 description 505 "Minimum value of dscp min-max range"; 506 } 507 leaf dscp-max { 508 type inet:dscp; 509 description 510 "maximum value of dscp min-max range"; 511 } 512 } 513 description 514 "Filter grouping containing list of dscp ranges"; 515 } 516 grouping source-ip-address-cfg { 517 list source-ip-address-cfg { 518 key "source-ip-addr"; 519 description 520 "list of source ipv4 or ipv6 address"; 521 leaf source-ip-addr { 522 type inet:ip-prefix; 523 description 524 "source ipv4 or ipv6 prefix"; 526 } 527 } 528 description 529 "Filter grouping containing list of source ip addresses"; 530 } 531 grouping destination-ip-address-cfg { 532 list destination-ip-address-cfg { 533 key "destination-ip-addr"; 534 description 535 "list of destination ipv4 or ipv6 address"; 536 leaf destination-ip-addr { 537 type inet:ip-prefix; 538 description 539 "destination ipv4 or ipv6 prefix"; 540 } 541 } 542 description 543 "Filter grouping containing list of destination ip address"; 544 } 545 grouping source-port-cfg { 546 list source-port-cfg { 547 key "source-port-min source-port-max"; 548 description 549 "list of ranges of source port"; 550 leaf source-port-min { 551 type inet:port-number; 552 description 553 "minimum value of source port range"; 554 } 555 leaf source-port-max { 556 type inet:port-number; 557 description 558 "maximum value of source port range"; 559 } 560 } 561 description 562 "Filter grouping containing list of source port ranges"; 563 } 564 grouping destination-port-cfg { 565 list destination-port-cfg { 566 key "destination-port-min destination-port-max"; 567 description 568 "list of ranges of destination port"; 569 leaf destination-port-min { 570 type inet:port-number; 571 description 572 "minimum value of destination port range"; 573 } 574 leaf destination-port-max { 575 type inet:port-number; 576 description 577 "maximum value of destination port range"; 578 } 579 } 580 description 581 "Filter grouping containing list of destination port ranges"; 582 } 583 grouping protocol-cfg { 584 list protocol-cfg { 585 key "protocol-min protocol-max"; 586 description 587 "list of ranges of protocol values"; 588 leaf protocol-min { 589 type uint8 { 590 range "0..255"; 591 } 592 description 593 "minimum value of protocol range"; 594 } 595 leaf protocol-max { 596 type uint8 { 597 range "0..255"; 598 } 599 description 600 "maximum value of protocol range"; 601 } 602 } 603 description 604 "Filter grouping containing list of Protocol ranges"; 605 } 606 grouping filters { 607 description 608 "Filters types in a Classifier entry"; 609 leaf filter-type { 610 type identityref { 611 base filter-type; 612 } 613 description 614 "This leaf defines type of the filter"; 615 } 616 leaf filter-logical-not { 617 type boolean; 618 description 619 " 620 This is logical-not operator for a filter. When true, it 621 indicates filter looks for absence of a pattern defined 622 by the filter 623 "; 624 } 625 } 626 grouping classifier-entry-generic-attr { 627 description 628 " 629 Classifier generic attributes like name, 630 description, operation type 631 "; 632 leaf classifier-entry-name { 633 type string; 634 description 635 "classifier entry name"; 636 } 637 leaf classifier-entry-descr { 638 type string; 639 description 640 "classifier entry description statement"; 641 } 642 leaf classifier-entry-filter-operation { 643 type identityref { 644 base classifier-entry-filter-operation-type; 645 } 646 default "match-any-filter"; 647 description 648 "Filters are applicable as match-any or match-all filters"; 649 } 650 } 651 grouping classifier-entry-inline-attr { 652 description 653 "attributes of inline classifier in a policy"; 654 leaf classifier-entry-inline { 655 type boolean; 656 default "false"; 657 description 658 "Indication of inline classifier entry"; 659 } 660 leaf classifier-entry-filter-oper { 661 type identityref { 662 base classifier-entry-filter-operation-type; 663 } 664 default "match-all-filter"; 665 description 666 "Filters are applicable as match-any or match-all filters"; 667 } 668 list filter-entry { 669 if-feature policy-inline-classifier-config; 670 must " ../classifier-entry-inline = 'true' " { 671 description 672 "For inline filter configuration, inline attribute" + 673 "must be true"; 674 } 675 key "filter-type filter-logical-not"; 676 uses filters; 677 description 678 "Filters configured inline in a policy"; 679 } 680 } 681 container classifiers { 682 description 683 "list of classifier entry"; 684 list classifier-entry { 685 key "classifier-entry-name"; 686 description 687 "each classifier entry contains a list of filters"; 688 uses classifier-entry-generic-attr; 689 list filter-entry { 690 key "filter-type filter-logical-not"; 691 uses filters; 692 description 693 "Filter entry configuration"; 694 } 695 } 696 } 697 } 698 700 6.2. IETF-QOS-POLICY 702 file "ietf-qos-policy@2016-03-03.yang" 703 module ietf-qos-policy { 704 yang-version 1; 705 namespace "urn:ietf:params:xml:ns:yang:ietf-qos-policy"; 706 prefix policy; 707 import ietf-qos-classifier { 708 prefix classifier; 709 } 710 organization "IETF RTG (Routing Area) Working Group"; 711 contact 712 "WG Web: 713 WG List: 714 WG Chair: Chris Bowers 715 716 WG Chair: Jeff Tantsura 717 719 Editor: Aseem Choudhary 720 721 Editor: Mahesh Jethanandani 722 723 Editor: Norm Strahle 724 "; 725 description 726 "This module contains a collection of YANG definitions for 727 configuring qos specification implementations. 728 Copyright (c) 2014 IETF Trust and the persons identified as 729 authors of the code. All rights reserved. 730 Redistribution and use in source and binary forms, with or 731 without modification, is permitted pursuant to, and subject 732 to the license terms contained in, the Simplified BSD License 733 set forth in Section 4.c of the IETF Trust's Legal Provisions 734 Relating to IETF Documents 735 (http://trustee.ietf.org/license-info). 736 This version of this YANG module is part of RFC XXXX; see 737 the RFC itself for full legal notices."; 738 revision 2016-03-03 { 739 description 740 "Latest revision of qos policy"; 741 reference "RFC XXXX"; 742 } 743 identity policy-type { 744 description 745 "This base identity type defines policy-types"; 746 } 747 grouping policy-generic-attr { 748 description 749 "Policy Attributes"; 750 leaf policy-name { 751 type string; 752 description 753 "policy name"; 754 } 755 leaf policy-type { 756 type identityref { 757 base policy-type; 758 } 759 description 760 "policy type"; 761 } 762 leaf policy-descr { 763 type string; 764 description 765 "policy description"; 766 } 768 } 769 identity action-type { 770 description 771 "This base identity type defines action-types"; 772 } 773 grouping classifier-action-entry-cfg { 774 description 775 "List of Configuration of classifier & associated actions"; 776 list classifier-action-entry-cfg { 777 key "action-type"; 778 ordered-by user; 779 description 780 "Configuration of classifier & associated actions"; 781 leaf action-type { 782 type identityref { 783 base action-type; 784 } 785 description 786 "This defines action type "; 787 } 788 choice action-cfg-params { 789 description 790 "Choice of action types"; 791 } 792 } 793 } 794 container policies { 795 description 796 "list of policy templates"; 797 list policy-entry { 798 key "policy-name policy-type"; 799 description 800 "policy template"; 801 uses policy-generic-attr; 802 list classifier-entry { 803 key "classifier-entry-name"; 804 ordered-by user; 805 description 806 "Classifier entry configuration in a policy"; 807 leaf classifier-entry-name { 808 type string; 809 description 810 "classifier entry name"; 811 } 812 uses classifier:classifier-entry-inline-attr; 813 uses classifier-action-entry-cfg; 814 } 815 } 817 } 818 } 819 821 6.3. IETF-QOS-ACTION 823 file "ietf-qos-action@2016-06-15.yang" 824 module ietf-qos-action { 825 namespace "urn:ietf:params:xml:ns:yang:ietf-qos-action"; 826 prefix action; 827 import ietf-inet-types { 828 prefix inet; 829 } 830 import ietf-qos-policy { 831 prefix policy; 832 } 833 organization "IETF RTG (Routing Area) Working Group"; 834 contact 835 "WG Web: 836 WG List: 837 WG Chair: Chris Bowers 838 839 WG Chair: Jeff Tantsura 840 841 Editor: Aseem Choudhary 842 843 Editor: Mahesh Jethanandani 844 845 Editor: Norm Strahle 846 "; 847 description 848 "This module contains a collection of YANG definitions for 849 configuring qos specification implementations. 850 Copyright (c) 2014 IETF Trust and the persons identified as 851 authors of the code. All rights reserved. 852 Redistribution and use in source and binary forms, with or 853 without modification, is permitted pursuant to, and subject 854 to the license terms contained in, the Simplified BSD License 855 set forth in Section 4.c of the IETF Trust's Legal Provisions 856 Relating to IETF Documents 857 (http://trustee.ietf.org/license-info). 858 This version of this YANG module is part of RFC XXXX; see 859 the RFC itself for full legal notices."; 860 revision 2016-06-15 { 861 description 862 "Latest revision for qos actions"; 863 reference "RFC XXXX"; 864 } 865 feature meter-template-support { 866 description 867 " This feature allows support of meter-template."; 868 } 870 identity rate-unit-type { 871 description 872 "base rate-unit type"; 873 } 874 identity bits-per-second { 875 base rate-unit-type; 876 description 877 "bits per second identity"; 878 } 879 identity kilo-bits-per-second { 880 base rate-unit-type; 881 description 882 "kilo bits per second identity"; 883 } 884 identity mega-bits-per-second { 885 base rate-unit-type; 886 description 887 "mega bits per second identity"; 888 } 889 identity giga-bits-per-second { 890 base rate-unit-type; 891 description 892 "mega bits per second identity"; 893 } 894 identity percent { 895 base rate-unit-type; 896 description 897 "percentage"; 898 } 900 identity dscp-marking { 901 base policy:action-type; 902 description 903 "dscp marking action type"; 904 } 905 identity meter-inline { 906 base policy:action-type; 907 description 908 "meter-inline action type"; 909 } 910 identity meter-reference { 911 base policy:action-type; 912 description 913 "meter reference action type"; 914 } 915 identity min-rate { 916 base policy:action-type; 917 description 918 "min-rate action type"; 919 } 920 identity max-rate { 921 base policy:action-type; 922 description 923 "max-rate action type"; 924 } 925 identity queue { 926 base policy:action-type; 927 description 928 "queue action type"; 929 } 930 identity schedular { 931 base policy:action-type; 932 description 933 "schedular action type"; 934 } 935 identity discard { 936 base policy:action-type; 937 description 938 "discard action type"; 939 } 940 identity child-policy { 941 base policy:action-type; 942 description 943 "child-policy action type"; 944 } 945 identity count { 946 base policy:action-type; 947 description 948 "discard action type"; 949 } 951 identity meter-type { 952 description 953 "This base identity type defines meter types"; 954 } 955 identity one-rate-two-color-meter-type { 956 base meter-type; 957 description 958 "one rate two color meter type"; 959 } 960 identity one-rate-tri-color-meter-type { 961 base meter-type; 962 description 963 "one rate three color meter type"; 964 } 965 identity two-rate-tri-color-meter-type { 966 base meter-type; 967 description 968 "two rate three color meter action type"; 969 } 971 identity drop-type { 972 description 973 "drop algorithm"; 974 } 975 identity tail-drop { 976 base drop-type; 977 description 978 "tail drop algorithm"; 979 } 980 identity random-detect { 981 base drop-type; 982 description 983 "random detect algorithm"; 984 } 986 identity meter-action-type { 987 description 988 "action type in a meter"; 989 } 990 identity meter-action-drop { 991 base meter-action-type; 992 description 993 "drop action type in a meter"; 994 } 995 identity meter-action-mark-dscp { 996 base meter-action-type; 997 description 998 "dscp mark action type in a meter"; 999 } 1001 grouping rate-value-unit { 1002 leaf rate-value { 1003 type uint64; 1004 description 1005 "rate value"; 1006 } 1007 leaf rate-unit { 1008 type identityref { 1009 base rate-unit-type; 1010 } 1011 description 1012 "rate unit"; 1013 } 1014 description 1015 "rate value and unit grouping"; 1016 } 1017 grouping burst { 1018 description 1019 "burst size or interval configuration"; 1020 choice burst-type { 1021 case size { 1022 leaf burst-size { 1023 type uint64; 1024 units "bytes"; 1025 description 1026 "burst size"; 1027 } 1028 } 1029 case interval { 1030 leaf burst-interval { 1031 type uint64; 1032 units "microsecond"; 1033 description 1034 "burst interval"; 1035 } 1036 } 1037 description 1038 "Choice of burst type"; 1039 } 1040 } 1042 grouping threshold { 1043 description 1044 "Threshold Parameters"; 1045 container threshold { 1046 description 1047 "threshold"; 1048 choice threshold-type { 1049 case size { 1050 leaf threshold-size { 1051 type uint64; 1052 units "bytes"; 1053 description 1054 "Threshold size"; 1055 } 1056 } 1057 case interval { 1058 leaf threshold-interval { 1059 type uint64; 1060 units "microsecond"; 1061 description 1062 "Threshold interval"; 1063 } 1064 } 1065 description 1066 "Choice of threshold type"; 1067 } 1068 } 1069 } 1071 grouping drop { 1072 container drop-cfg { 1073 leaf drop-action { 1074 type empty; 1075 description 1076 "always drop algorithm"; 1077 } 1078 description 1079 "the drop action"; 1080 } 1081 description 1082 "always drop grouping"; 1083 } 1085 grouping queuelimit { 1086 container qlimit-thresh { 1087 uses threshold; 1088 description 1089 "the queue limit"; 1090 } 1091 description 1092 "the queue limit beyond which queue will not hold any packet"; 1093 } 1095 grouping meter-action-params { 1096 description 1097 "meter action parameters"; 1098 list meter-action-params { 1099 key "meter-action-type"; 1100 ordered-by user; 1101 description 1102 "Configuration of basic-meter & associated actions"; 1103 leaf meter-action-type { 1104 type identityref { 1105 base meter-action-type; 1106 } 1107 description 1108 "meter action type"; 1109 } 1110 choice meter-action-val { 1111 description 1112 " meter action based on choice of meter action type"; 1113 } 1114 } 1115 } 1117 grouping one-rate-two-color-meter { 1118 container one-rate-two-color-meter { 1119 description 1120 "single rate two color marker meter"; 1121 leaf meter-rate { 1122 type uint64; 1123 units "bits-per-second"; 1124 description 1125 "meter rate"; 1126 } 1127 leaf meter-burst { 1128 type uint64; 1129 units "byes"; 1130 description 1131 "burst size"; 1132 } 1133 container conform-action { 1134 uses meter-action-params; 1135 description 1136 "conform action"; 1137 } 1138 container exceed-action { 1139 uses meter-action-params; 1140 description 1141 "exceed action"; 1142 } 1143 } 1144 description 1145 "single rate two color marker meter attributes"; 1146 } 1148 grouping one-rate-tri-color-meter { 1149 container one-rate-tri-color-meter { 1150 description 1151 "single rate three color meter"; 1152 leaf committed-rate { 1153 type uint64; 1154 units "bits-per-second"; 1155 description 1156 "meter rate"; 1157 } 1158 leaf committed-burst { 1159 type uint64; 1160 units "byes"; 1161 description 1162 "commited burst size"; 1163 } 1164 leaf excess-burst { 1165 type uint64; 1166 units "byes"; 1167 description 1168 "excess burst size"; 1169 } 1170 container conform-action { 1171 uses meter-action-params; 1172 description 1173 "conform, or green action"; 1174 } 1175 container exceed-action { 1176 uses meter-action-params; 1177 description 1178 "exceed, or yellow action"; 1179 } 1180 container violate-action { 1181 uses meter-action-params; 1182 description 1183 "violate, or red action"; 1184 } 1185 } 1186 description 1187 "one-rate-tri-color-meter attributes"; 1188 } 1190 grouping two-rate-tri-color-meter { 1191 container two-rate-tri-color-meter { 1192 description 1193 "two rate three color meter"; 1194 leaf committed-rate { 1195 type uint64; 1196 units "bits-per-second"; 1197 description 1198 "meter rate"; 1199 } 1200 leaf committed-burst { 1201 type uint64; 1202 units "byes"; 1203 description 1204 "commited burst size"; 1205 } 1206 leaf peak-rate { 1207 type uint64; 1208 units "bits-per-second"; 1209 description 1210 "meter rate"; 1211 } 1212 leaf peak-burst { 1213 type uint64; 1214 units "byes"; 1215 description 1216 "commited burst size"; 1217 } 1218 container conform-action { 1219 uses meter-action-params; 1220 description 1221 "conform, or green action"; 1222 } 1223 container exceed-action { 1224 uses meter-action-params; 1225 description 1226 "exceed, or yellow action"; 1227 } 1228 container violate-action { 1229 uses meter-action-params; 1230 description 1231 "exceed, or red action"; 1232 } 1233 } 1234 description 1235 "two-rate-tri-color-meter attributes"; 1236 } 1238 grouping meter { 1239 choice meter-type { 1240 case one-rate-two-color-meter-type { 1241 uses one-rate-two-color-meter; 1242 description 1243 "basic meter"; 1244 } 1245 case one-rate-tri-color-meter-type { 1246 uses one-rate-tri-color-meter; 1247 description 1248 "one rate tri-color meter"; 1250 } 1251 case two-rate-tri-color-meter-type { 1252 uses two-rate-tri-color-meter; 1253 description 1254 "two rate tri-color meter"; 1255 } 1256 description 1257 " meter action based on choice of meter action type"; 1258 } 1259 description 1260 "meter attributes"; 1261 } 1263 container meter-template { 1264 description 1265 "list of meter templates"; 1266 list meter-entry { 1267 if-feature meter-template-support; 1268 key "meter-name"; 1269 description 1270 "meter entry template"; 1271 leaf meter-name { 1272 type string; 1273 description 1274 "meter identifier"; 1275 } 1276 uses meter; 1277 } 1278 } 1280 grouping meter-reference { 1281 container meter-reference-cfg { 1282 leaf meter-type { 1283 type identityref { 1284 base meter-type; 1285 } 1286 description 1287 "This leaf defines type of the filter"; 1288 } 1289 description 1290 "meter reference"; 1291 } 1292 description 1293 "meter reference"; 1294 } 1296 grouping count { 1297 container count-cfg { 1298 leaf count-action { 1299 type empty; 1300 description 1301 "count action"; 1302 } 1303 description 1304 "the count action"; 1305 } 1306 description 1307 "the count action grouping"; 1308 } 1310 grouping discard { 1311 container discard-cfg { 1312 leaf discard { 1313 type empty; 1314 description 1315 "discard action"; 1316 } 1317 description 1318 "discard action"; 1319 } 1320 description 1321 "discard grouping"; 1322 } 1323 grouping priority { 1324 container priority-cfg { 1325 leaf priority-level { 1326 type uint8; 1327 description 1328 "priority level"; 1329 } 1330 description 1331 "priority attributes"; 1332 } 1333 description 1334 "priority attributes grouping"; 1335 } 1336 grouping min-rate { 1337 container min-rate-cfg { 1338 uses rate-value-unit; 1339 description 1340 "min guaranteed bandwidth"; 1341 } 1342 description 1343 "minimum rate grouping"; 1344 } 1345 grouping dscp-marking { 1346 container dscp-cfg { 1347 leaf dscp { 1348 type inet:dscp; 1349 description 1350 "dscp marking"; 1351 } 1352 description 1353 "dscp marking container"; 1354 } 1355 description 1356 "dscp marking grouping"; 1357 } 1358 grouping max-rate { 1359 container max-rate-cfg { 1360 uses rate-value-unit; 1361 uses burst; 1362 description 1363 "maximum rate attributes container"; 1364 } 1365 description 1366 "maximum rate attributes"; 1367 } 1368 grouping queue { 1369 container queue-cfg { 1370 uses priority; 1371 uses min-rate; 1372 uses max-rate; 1373 container algorithmic-drop-cfg { 1374 choice drop-algorithm { 1375 case tail-drop { 1376 container tail-drop-cfg { 1377 leaf tail-drop-alg { 1378 type empty; 1379 description 1380 "tail drop algorithm"; 1381 } 1382 description 1383 "Tail Drop configuration container"; 1384 } 1385 description 1386 "Tail Drop choice"; 1387 } 1388 description 1389 "Choice of Drop Algorithm"; 1390 } 1391 description 1392 "Algorithmic Drop configuration container"; 1393 } 1394 description 1395 "Queue configuration container"; 1396 } 1397 description 1398 "Queue grouping"; 1399 } 1400 grouping schedular { 1401 container schedular-cfg { 1402 uses min-rate; 1403 uses max-rate; 1404 description 1405 "Schedular configuration container"; 1406 } 1407 description 1408 "Schedular configuration grouping"; 1409 } 1410 } 1411 1413 6.4. IETF-QOS-TARGET 1415 file "ietf-qos-target@2017-06-06.yang" 1416 module ietf-qos-target { 1417 yang-version 1; 1418 namespace "urn:ietf:params:xml:ns:yang:ietf-qos-target"; 1419 prefix target; 1420 import ietf-interfaces { 1421 prefix if; 1422 } 1423 import ietf-qos-policy { 1424 prefix policy; 1425 } 1426 organization "IETF NETMOD (Netmod Working Group) Working Group"; 1427 contact 1428 "WG Web: 1429 WG List: 1430 WG Chair: Jurgen Schonwalder 1431 1432 WG Chair: Lou Berger 1433 1434 WG Chair: Kent Watsen 1435 1436 Editor: Aseem Choudhary 1437 1438 Editor: Mahesh Jethanandani 1439 1679 6.5. IETF-DIFFSERV 1681 file "ietf-diffserv@2017-06-06.yang" 1682 module ietf-diffserv { 1683 yang-version 1; 1684 namespace "urn:ietf:params:xml:ns:yang:ietf-diffserv"; 1685 prefix diffserv; 1686 import ietf-interfaces { 1687 prefix if; 1688 } 1689 import ietf-qos-classifier { 1690 prefix classifier; 1691 } 1692 import ietf-qos-policy { 1693 prefix policy; 1694 } 1695 import ietf-qos-action { 1696 prefix action; 1697 } 1698 import ietf-qos-target { 1699 prefix target; 1700 } 1701 organization "IETF NETMOD (Netmod Working Group) Working Group"; 1702 contact 1703 "WG Web: 1704 WG List: 1705 WG Chair: Jurgen Schonwalder 1706 1707 WG Chair: Lou Berger 1708 1709 WG Chair: Kent Watsen 1710 1711 Editor: Aseem Choudhary 1712 1713 Editor: Mahesh Jethanandani 1714 1898 7. Security Considerations 1900 8. Acknowledgement 1902 9. References 1904 9.1. Normative References 1906 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1907 Requirement Levels", BCP 14, RFC 2119, 1908 DOI 10.17487/RFC2119, March 1997, 1909 . 1911 [RFC2697] Heinanen, J. and R. Guerin, "A Single Rate Three Color 1912 Marker", RFC 2697, DOI 10.17487/RFC2697, September 1999, 1913 . 1915 [RFC2698] Heinanen, J. and R. Guerin, "A Two Rate Three Color 1916 Marker", RFC 2698, DOI 10.17487/RFC2698, September 1999, 1917 . 1919 [RFC3289] Baker, F., Chan, K., and A. Smith, "Management Information 1920 Base for the Differentiated Services Architecture", 1921 RFC 3289, DOI 10.17487/RFC3289, May 2002, 1922 . 1924 [RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for 1925 the Network Configuration Protocol (NETCONF)", RFC 6020, 1926 DOI 10.17487/RFC6020, October 2010, 1927 . 1929 [RFC6991] Schoenwaelder, J., Ed., "Common YANG Data Types", 1930 RFC 6991, DOI 10.17487/RFC6991, July 2013, 1931 . 1933 [RFC7223] Bjorklund, M., "A YANG Data Model for Interface 1934 Management", RFC 7223, DOI 10.17487/RFC7223, May 2014, 1935 . 1937 9.2. Informative References 1939 [RFC2475] Blake, S., Black, D., Carlson, M., Davies, E., Wang, Z., 1940 and W. Weiss, "An Architecture for Differentiated 1941 Services", RFC 2475, DOI 10.17487/RFC2475, December 1998, 1942 . 1944 Appendix A. Company A, Company B and Company C examples 1946 Company A, Company B and Company C Diffserv modules augments all the 1947 filter types of the QoS classifier module as well as the QoS policy 1948 module that allow it to define marking, metering, min-rate, max-rate 1949 actions. Queuing and metering counters are realized by augmenting of 1950 the QoS target module. 1952 A.1. Example of Company A Diffserv Model 1954 The following Company A vendor example augments the qos and diffserv 1955 model, demonstrating some of the following functionality: 1957 - use of template based classifier definitions 1959 - use of single policy type modelling queue, scheduler policy, and a 1960 filter policy. All of these policies either augment the qos policy 1961 or the diffserv modules 1963 - support of hierarchial policy. 1965 - use of inline actions in a policy 1967 - flexibility in marking dscp or metadata at ingress and/or egress. 1969 module example-compa-diffserv { 1970 namespace "urn:ietf:params:xml:ns:yang:example-compa-diffserv"; 1971 prefix example; 1972 import ietf-interfaces { 1973 prefix if; 1974 } 1975 import ietf-qos-classifier { 1976 prefix classifier; 1977 } 1978 import ietf-qos-policy { 1979 prefix policy; 1980 } 1981 import ietf-qos-action { 1982 prefix action; 1983 } 1984 import ietf-qos-target { 1985 prefix target; 1986 } 1987 import ietf-diffserv { 1988 prefix diffserv; 1989 } 1991 organization "Company A"; 1992 contact 1993 "Editor: XYZ 1994 "; 1995 description 1996 "This module contains a collection of YANG definitions of 1997 companyA diffserv specification extension."; 1998 revision 2016-06-15 { 1999 description 2000 "Initial revision for diffserv actions on network packets"; 2001 reference 2002 "RFC 6020: YANG - A Data Modeling Language for the 2003 Network Configuration Protocol (NETCONF)"; 2004 } 2006 identity default-policy-type { 2007 base policy:policy-type; 2008 description 2009 "This defines default policy-type"; 2010 } 2012 identity qos-group { 2013 base classifier:filter-type; 2014 description 2015 "qos-group filter-type"; 2016 } 2018 grouping qos-group-cfg { 2019 list qos-group-cfg { 2020 key "qos-group-min qos-group-max"; 2021 description 2022 "list of dscp ranges"; 2023 leaf qos-group-min { 2024 type uint8; 2025 description 2026 "Minimum value of qos-group range"; 2027 } 2028 leaf qos-group-max { 2029 type uint8; 2030 description 2031 "maximum value of qos-group range"; 2032 } 2033 } 2034 description 2035 "Filter containing list of qos-group ranges"; 2036 } 2038 grouping wred-threshold { 2039 container wred-min-thresh { 2040 uses action:threshold; 2041 description 2042 "Minimum threshold"; 2043 } 2044 container wred-max-thresh { 2045 uses action:threshold; 2046 description 2047 "Maximum threshold"; 2048 } 2049 leaf mark-probability { 2050 type uint32 { 2051 range "1..1000"; 2052 } 2053 description 2054 "Mark probability"; 2055 } 2056 description 2057 "WRED threshold attributes"; 2058 } 2060 grouping randomdetect { 2061 leaf exp-weighting-const { 2062 type uint32; 2063 description 2064 "Exponential weighting constant factor for wred profile"; 2065 } 2066 uses wred-threshold; 2067 description 2068 "Random detect attributes"; 2069 } 2071 /************************************************* 2072 * Augmentation to Classifier Module 2073 *************************************************/ 2075 augment "/classifier:classifiers/" + 2076 "classifier:classifier-entry/" + 2077 "classifier:filter-entry/diffserv:filter-param" { 2078 case qos-group { 2079 uses qos-group-cfg; 2080 description 2081 "Filter containing list of qos-group ranges. 2082 Qos-group represent packet metadata information 2083 in a device. "; 2084 } 2085 description 2086 "augmentation of classifier filters"; 2087 } 2089 /************************************************* 2090 * Augmentation to Policy Module 2091 *************************************************/ 2093 augment "/policy:policies/policy:policy-entry/" + 2094 "policy:classifier-entry/" + 2095 "policy:classifier-action-entry-cfg/" + 2096 "policy:action-cfg-params" { 2097 case priority { 2098 uses action:priority; 2099 } 2100 case min-rate { 2101 uses action:min-rate; 2102 } 2103 case max-rate { 2104 uses action:max-rate; 2105 } 2106 case random-detect { 2107 uses randomdetect; 2108 } 2109 case meter-inline { 2110 uses action:meter; 2111 } 2112 case child-policy { 2113 leaf child-policy { 2114 type leafref { 2115 path "/policy:policies/policy:policy-entry/" + 2116 "policy:policy-name"; 2117 } 2118 description 2119 "Child Policy in the hierarchial configuration"; 2120 } 2121 } 2122 description 2123 "Augment the actions to policy entry"; 2124 } 2126 augment "/policy:policies" + 2127 "/policy:policy-entry" + 2128 "/policy:classifier-entry" + 2129 "/policy:classifier-action-entry-cfg" + 2130 "/policy:action-cfg-params" + 2131 "/example:meter-inline" + 2132 "/example:meter-type" + 2133 "/example:one-rate-two-color-meter-type" + 2134 "/example:one-rate-two-color-meter" + 2135 "/example:conform-action" + 2136 "/example:meter-action-params" + 2137 "/example:meter-action-val" { 2139 description 2140 "augment the one-rate-two-color meter conform 2141 with actions"; 2142 case meter-action-drop { 2143 description 2144 "meter drop"; 2145 uses action:drop; 2146 } 2147 case meter-action-mark-dscp { 2148 description 2149 "meter action dscp marking"; 2150 uses action:dscp-marking; 2151 } 2152 } 2153 augment "/policy:policies" + 2154 "/policy:policy-entry" + 2155 "/policy:classifier-entry" + 2156 "/policy:classifier-action-entry-cfg" + 2157 "/policy:action-cfg-params" + 2158 "/example:meter-inline" + 2159 "/example:meter-type" + 2160 "/example:one-rate-two-color-meter-type" + 2161 "/example:one-rate-two-color-meter" + 2162 "/example:exceed-action" + 2163 "/example:meter-action-params" + 2164 "/example:meter-action-val" { 2166 description 2167 "augment the one-rate-two-color meter exceed 2168 with actions"; 2169 case meter-action-drop { 2170 description 2171 "meter drop"; 2172 uses action:drop; 2173 } 2174 case meter-action-mark-dscp { 2175 description 2176 "meter action dscp marking"; 2177 uses action:dscp-marking; 2178 } 2179 } 2180 augment "/policy:policies" + 2181 "/policy:policy-entry" + 2182 "/policy:classifier-entry" + 2183 "/policy:classifier-action-entry-cfg" + 2184 "/policy:action-cfg-params" + 2185 "/example:meter-inline" + 2186 "/example:meter-type" + 2187 "/example:one-rate-tri-color-meter-type" + 2188 "/example:one-rate-tri-color-meter" + 2189 "/example:conform-action" + 2190 "/example:meter-action-params" + 2191 "/example:meter-action-val" { 2193 description 2194 "augment the one-rate-tri-color meter conform 2195 with actions"; 2196 case meter-action-drop { 2197 description 2198 "meter drop"; 2199 uses action:drop; 2200 } 2201 case meter-action-mark-dscp { 2202 description 2203 "meter action dscp marking"; 2204 uses action:dscp-marking; 2205 } 2206 } 2207 augment "/policy:policies" + 2208 "/policy:policy-entry" + 2209 "/policy:classifier-entry" + 2210 "/policy:classifier-action-entry-cfg" + 2211 "/policy:action-cfg-params" + 2212 "/example:meter-inline" + 2213 "/example:meter-type" + 2214 "/example:one-rate-tri-color-meter-type" + 2215 "/example:one-rate-tri-color-meter" + 2216 "/example:exceed-action" + 2217 "/example:meter-action-params" + 2218 "/example:meter-action-val" { 2220 description 2221 "augment the one-rate-tri-color meter exceed 2222 with actions"; 2223 case meter-action-drop { 2224 description 2225 "meter drop"; 2226 uses action:drop; 2227 } 2228 case meter-action-mark-dscp { 2229 description 2230 "meter action dscp marking"; 2231 uses action:dscp-marking; 2232 } 2233 } 2234 augment "/policy:policies" + 2235 "/policy:policy-entry" + 2236 "/policy:classifier-entry" + 2237 "/policy:classifier-action-entry-cfg" + 2238 "/policy:action-cfg-params" + 2239 "/example:meter-inline" + 2240 "/example:meter-type" + 2241 "/example:one-rate-tri-color-meter-type" + 2242 "/example:one-rate-tri-color-meter" + 2243 "/example:violate-action" + 2244 "/example:meter-action-params" + 2245 "/example:meter-action-val" { 2246 description 2247 "augment the one-rate-tri-color meter conform 2248 with actions"; 2249 case meter-action-drop { 2250 description 2251 "meter drop"; 2252 uses action:drop; 2253 } 2254 case meter-action-mark-dscp { 2255 description 2256 "meter action dscp marking"; 2257 uses action:dscp-marking; 2258 } 2259 } 2260 augment "/policy:policies" + 2261 "/policy:policy-entry" + 2262 "/policy:classifier-entry" + 2263 "/policy:classifier-action-entry-cfg" + 2264 "/policy:action-cfg-params" + 2265 "/example:meter-inline" + 2266 "/example:meter-type" + 2267 "/example:two-rate-tri-color-meter-type" + 2268 "/example:two-rate-tri-color-meter" + 2269 "/example:conform-action" + 2270 "/example:meter-action-params" + 2271 "/example:meter-action-val" { 2273 description 2274 "augment the one-rate-tri-color meter conform 2275 with actions"; 2276 case meter-action-drop { 2277 description 2278 "meter drop"; 2279 uses action:drop; 2280 } 2281 case meter-action-mark-dscp { 2282 description 2283 "meter action dscp marking"; 2284 uses action:dscp-marking; 2285 } 2286 } 2287 augment "/policy:policies" + 2288 "/policy:policy-entry" + 2289 "/policy:classifier-entry" + 2290 "/policy:classifier-action-entry-cfg" + 2291 "/policy:action-cfg-params" + 2292 "/example:meter-inline" + 2293 "/example:meter-type" + 2294 "/example:two-rate-tri-color-meter-type" + 2295 "/example:two-rate-tri-color-meter" + 2296 "/example:exceed-action" + 2297 "/example:meter-action-params" + 2298 "/example:meter-action-val" { 2300 description 2301 "augment the two-rate-tri-color meter exceed 2302 with actions"; 2303 case meter-action-drop { 2304 description 2305 "meter drop"; 2306 uses action:drop; 2307 } 2308 case meter-action-mark-dscp { 2309 description 2310 "meter action dscp marking"; 2311 uses action:dscp-marking; 2312 } 2313 } 2314 augment "/policy:policies" + 2315 "/policy:policy-entry" + 2316 "/policy:classifier-entry" + 2317 "/policy:classifier-action-entry-cfg" + 2318 "/policy:action-cfg-params" + 2319 "/example:meter-inline" + 2320 "/example:meter-type" + 2321 "/example:two-rate-tri-color-meter-type" + 2322 "/example:two-rate-tri-color-meter" + 2323 "/example:violate-action" + 2324 "/example:meter-action-params" + 2325 "/example:meter-action-val" { 2326 description 2327 "augment the two-rate-tri-color meter violate 2328 with actions"; 2329 case meter-action-drop { 2330 description 2331 "meter drop"; 2332 uses action:drop; 2333 } 2334 case meter-action-mark-dscp { 2335 description 2336 "meter action dscp marking"; 2337 uses action:dscp-marking; 2338 } 2339 } 2340 augment "/policy:policies" + 2341 "/policy:policy-entry" + 2342 "/policy:classifier-entry" + 2343 "/policy:classifier-action-entry-cfg" + 2344 "/policy:action-cfg-params" + 2345 "/example:meter-inline" + 2346 "/example:meter-type" + 2347 "/example:one-rate-two-color-meter-type" + 2348 "/example:one-rate-two-color-meter" { 2349 description 2350 "augment the one-rate-two-color meter with" + 2351 "color classifiers"; 2352 container conform-color { 2353 uses classifier:classifier-entry-generic-attr; 2354 description 2355 "conform color classifier container"; 2357 } 2358 container exceed-color { 2359 uses classifier:classifier-entry-generic-attr; 2360 description 2361 "exceed color classifier container"; 2362 } 2363 } 2364 augment "/policy:policies" + 2365 "/policy:policy-entry" + 2366 "/policy:classifier-entry" + 2367 "/policy:classifier-action-entry-cfg" + 2368 "/policy:action-cfg-params" + 2369 "/example:meter-inline" + 2370 "/example:meter-type" + 2371 "/example:one-rate-tri-color-meter-type" + 2372 "/example:one-rate-tri-color-meter" { 2373 description 2374 "augment the one-rate-tri-color meter with" + 2375 "color classifiers"; 2376 container conform-color { 2377 uses classifier:classifier-entry-generic-attr; 2378 description 2379 "conform color classifier container"; 2380 } 2381 container exceed-color { 2382 uses classifier:classifier-entry-generic-attr; 2383 description 2384 "exceed color classifier container"; 2385 } 2386 container violate-color { 2387 uses classifier:classifier-entry-generic-attr; 2388 description 2389 "violate color classifier container"; 2390 } 2391 } 2392 augment "/policy:policies" + 2393 "/policy:policy-entry" + 2394 "/policy:classifier-entry" + 2395 "/policy:classifier-action-entry-cfg" + 2396 "/policy:action-cfg-params" + 2397 "/example:meter-inline" + 2398 "/example:meter-type" + 2399 "/example:two-rate-tri-color-meter-type" + 2400 "/example:two-rate-tri-color-meter" { 2401 description 2402 "augment the two-rate-tri-color meter with" + 2403 "color classifiers"; 2404 container conform-color { 2405 uses classifier:classifier-entry-generic-attr; 2406 description 2407 "conform color classifier container"; 2408 } 2409 container exceed-color { 2410 uses classifier:classifier-entry-generic-attr; 2411 description 2412 "exceed color classifier container"; 2413 } 2414 container violate-color { 2415 uses classifier:classifier-entry-generic-attr; 2416 description 2417 "violate color classifier container"; 2418 } 2419 } 2421 /************************************************* 2422 * Augmentation to Target Module 2423 *************************************************/ 2425 augment "/if:interfaces/if:interface/" + 2426 "target:qos-target-entry/" + 2427 "target:qos-target-classifier-statistics/" + 2428 "diffserv:diffserv-action-statistics" { 2429 uses target:queuing-stats; 2430 description 2431 "Augment the statistics to policy entry"; 2432 } 2433 augment "/if:interfaces/if:interface/" + 2434 "target:qos-target-entry/" + 2435 "target:qos-target-classifier-statistics" { 2436 leaf relative-path { 2437 type string; 2438 description 2439 "Relative Path of the classifier entry in the 2440 hierarchial policy"; 2441 } 2442 description 2443 "Augment the statistics to policy entry"; 2444 } 2445 } 2447 A.2. Example of Company B Diffserv Model 2449 The following vendor example augments the qos and diffserv model, 2450 demonstrating some of the following functionality: 2452 - use of inline classifier definitions (defined inline in the policy 2453 vs referencing an externally defined classifier) 2455 - use of mulitple policy types, e.g. a queue policy, a scheduler 2456 policy, and a filter policy. All of these policies either augment 2457 the qos policy or the diffserv modules 2459 - use of a queue module, which uses and extends the queue grouping 2460 from the ietf-qos-action module 2462 - use of meter templates (v.s. meter inline) 2464 - use of internal meta data for classification and marking 2466 module example-compb-diffserv-filter-policy { 2467 yang-version 1; 2468 namespace "urn:ietf:params:xml:ns:yang:" + 2469 "example-compb-diffserv-filter-policy"; 2470 prefix compb-filter-policy; 2472 import ietf-qos-classifier { 2473 prefix classifier; 2474 } 2475 import ietf-qos-policy { 2476 prefix policy; 2477 } 2478 import ietf-qos-action { 2479 prefix action; 2480 } 2481 import ietf-diffserv { 2482 prefix diffserv; 2483 } 2485 organization "Company B"; 2486 contact 2487 "Editor: XYZ 2488 "; 2490 description 2491 "This module contains a collection of YANG definitions for 2492 configuring diffserv specification implementations. 2493 Copyright (c) 2014 IETF Trust and the persons identified as 2494 authors of the code. All rights reserved. 2495 Redistribution and use in source and binary forms, with or 2496 without modification, is permitted pursuant to, and subject 2497 to the license terms contained in, the Simplified BSD License 2498 set forth in Section 4.c of the IETF Trust's Legal Provisions 2499 Relating to IETF Documents 2500 (http://trustee.ietf.org/license-info). 2501 This version of this YANG module is part of RFC XXXX; see 2502 the RFC itself for full legal notices."; 2504 revision 2015-04-07 { 2505 description 2506 "Latest revision of diffserv policy"; 2507 reference "RFC XXXX"; 2508 } 2510 /* 2511 * The policy must be of either type v4 or v6. Corresponding 2512 * address types must be used. Enforce with "must" statement? 2513 */ 2514 identity v4-diffserv-policy-type { 2515 base policy:policy-type; 2516 description 2517 "This defines default policy-type"; 2518 } 2520 identity v6-diffserv-policy-type { 2521 base policy:policy-type; 2522 description 2523 "This defines default policy-type"; 2524 } 2526 /************************************************* 2527 * Classification types 2528 *************************************************/ 2530 identity forwarding-class { 2531 base classifier:filter-type; 2532 description 2533 "Forwarding class filter type"; 2534 } 2536 identity internal-loss-priority { 2537 base classifier:filter-type; 2538 description 2539 "Internal loss priority filter type"; 2540 } 2542 grouping forwarding-class-cfg { 2543 list forwarding-class-cfg { 2544 key "forwarding-class"; 2545 description 2546 "list of forwarding-classes"; 2548 leaf forwarding-class { 2549 type string; 2550 description 2551 "Forwarding class name"; 2552 } 2553 } 2554 description 2555 "Filter containing list of forwarding classes"; 2556 } 2558 grouping loss-priority-cfg { 2559 list loss-priority-cfg { 2560 key "loss-priority"; 2561 description 2562 "list of loss-priorities"; 2563 leaf loss-priority { 2564 type enumeration { 2565 enum high { 2566 description "High Loss Priority"; 2567 } 2568 enum medium-high { 2569 description "Medium-high Loss Priority"; 2570 } 2571 enum medium-low { 2572 description "Medium-low Loss Priority"; 2573 } 2574 enum low { 2575 description "Low Loss Priority"; 2576 } 2577 } 2578 description 2579 "Loss-priority"; 2580 } 2581 } 2582 description 2583 "Filter containing list of loss priorities"; 2584 } 2586 augment "/policy:policies" + 2587 "/policy:policy-entry" + 2588 "/policy:classifier-entry" + 2589 "/policy:filter-entry" + 2590 "/diffserv:filter-params" { 2591 case forwarding-class { 2592 uses forwarding-class-cfg; 2593 description 2594 "Filter Type Internal-loss-priority"; 2595 } 2596 case internal-loss-priority { 2597 uses loss-priority-cfg; 2598 description 2599 "Filter Type Internal-loss-priority"; 2600 } 2601 description 2602 "Augments Diffserv Classifier with vendor" + 2603 " specific types"; 2604 } 2606 /************************************************* 2607 * Actions 2608 *************************************************/ 2610 identity mark-fwd-class { 2611 base policy:action-type; 2612 description 2613 "mark forwarding class action type"; 2614 } 2616 identity mark-loss-priority { 2617 base policy:action-type; 2618 description 2619 "mark loss-priority action type"; 2620 } 2622 grouping mark-fwd-class { 2623 container mark-fwd-class-cfg { 2624 leaf forwarding-class { 2625 type string; 2626 description 2627 "Forwarding class name"; 2628 } 2629 description 2630 "mark-fwd-class container"; 2631 } 2632 description 2633 "mark-fwd-class grouping"; 2634 } 2636 grouping mark-loss-priority { 2637 container mark-loss-priority-cfg { 2638 leaf loss-priority { 2639 type enumeration { 2640 enum high { 2641 description "High Loss Priority"; 2642 } 2643 enum medium-high { 2644 description "Medium-high Loss Priority"; 2645 } 2646 enum medium-low { 2647 description "Medium-low Loss Priority"; 2648 } 2649 enum low { 2650 description "Low Loss Priority"; 2651 } 2652 } 2653 description 2654 "Loss-priority"; 2655 } 2656 description 2657 "mark-loss-priority container"; 2658 } 2659 description 2660 "mark-loss-priority grouping"; 2661 } 2663 augment "/policy:policies" + 2664 "/policy:policy-entry" + 2665 "/policy:classifier-entry" + 2666 "/policy:classifier-action-entry-cfg" + 2667 "/diffserv:action-cfg-params" { 2668 case mark-fwd-class { 2669 uses mark-fwd-class; 2670 description 2671 "Mark forwarding class in the packet"; 2672 } 2673 case mark-loss-priority { 2674 uses mark-loss-priority; 2675 description 2676 "Mark loss priority in the packet"; 2677 } 2678 case meter-reference { 2679 uses action:meter-reference; 2680 description 2681 "Assign a meter as an action"; 2682 } 2683 case discard { 2684 uses action:discard; 2685 description 2686 "Discard action"; 2687 } 2688 case count { 2689 uses action:count; 2690 description 2691 "Count action - explicit count configuration"; 2693 } 2694 description 2695 "Augments common diffserv policy actions"; 2696 } 2698 augment "/action:meter-template" + 2699 "/action:meter-entry" + 2700 "/action:meter-type" + 2701 "/action:one-rate-tri-color-meter-type" + 2702 "/action:one-rate-tri-color-meter" { 2703 leaf one-rate-color-aware { 2704 type boolean; 2705 description 2706 "This defines if the meter is color-aware"; 2707 } 2708 } 2709 augment "/action:meter-template" + 2710 "/action:meter-entry" + 2711 "/action:meter-type" + 2712 "/action:two-rate-tri-color-meter-type" + 2713 "/action:two-rate-tri-color-meter" { 2714 leaf two-rate-color-aware { 2715 type boolean; 2716 description 2717 "This defines if the meter is color-aware"; 2718 } 2719 } 2721 /* example of augmenting a meter template with a 2722 /* vendor specific action */ 2723 augment "/action:meter-template" + 2724 "/action:meter-entry" + 2725 "/action:meter-type" + 2726 "/action:one-rate-two-color-meter-type" + 2727 "/action:one-rate-two-color-meter" + 2728 "/action:exceed-action" + 2729 "/action:meter-action-params" + 2730 "/action:meter-action-val" { 2731 case meter-action-drop { 2732 description 2733 "meter drop"; 2734 uses action:drop; 2735 } 2737 description 2738 "Augment the actions to basic meter"; 2739 } 2741 } 2743 module example-compb-queue-policy { 2744 yang-version 1; 2745 namespace "urn:ietf:params:xml:ns:yang:example-compb-queue-policy"; 2746 prefix queue-plcy; 2748 import ietf-qos-classifier { 2749 prefix classifier; 2750 } 2751 import ietf-qos-policy { 2752 prefix policy; 2753 } 2755 organization "Company B"; 2756 contact 2757 "Editor: XYZ 2758 "; 2760 description 2761 "This module defines a queue policy. The classification 2762 is based on aforwarding class, and the actions are queues. 2763 Copyright (c) 2014 IETF Trust and the persons identified as 2764 authors of the code. All rights reserved. 2765 Redistribution and use in source and binary forms, with or 2766 without modification, is permitted pursuant to, and subject 2767 to the license terms contained in, the Simplified BSD License 2768 set forth in Section 4.c of the IETF Trust's Legal Provisions 2769 Relating to IETF Documents 2770 (http://trustee.ietf.org/license-info). 2771 This version of this YANG module is part of RFC XXXX; see 2772 the RFC itself for full legal notices."; 2774 revision 2015-04-07 { 2775 description 2776 "Latest revision of diffserv policy"; 2777 reference "RFC XXXX"; 2778 } 2780 identity forwarding-class { 2781 base classifier:filter-type; 2782 description 2783 "Forwarding class filter type"; 2784 } 2786 grouping forwarding-class-cfg { 2787 leaf forwarding-class-cfg { 2788 type string; 2789 description 2790 "forwarding-class name"; 2791 } 2792 description 2793 "Forwarding class filter"; 2794 } 2796 augment "/policy:policies" + 2797 "/policy:policy-entry" + 2798 "/policy:classifier-entry" + 2799 "/policy:filter-entry" { 2800 /* Does NOT support "logical-not" of forwarding class. 2801 Use "must"? */ 2802 choice filter-params { 2803 description 2804 "Choice of filters"; 2805 case forwarding-class-cfg { 2806 uses forwarding-class-cfg; 2807 description 2808 "Filter Type Internal-loss-priority"; 2809 } 2810 } 2811 description 2812 "Augments Diffserv Classifier with fwd class filter"; 2813 } 2815 identity compb-queue { 2816 base policy:action-type; 2817 description 2818 "compb-queue action type"; 2819 } 2821 grouping compb-queue-name { 2822 container queue-name { 2823 leaf name { 2824 type string; 2825 description 2826 "Queue class name"; 2827 } 2828 description 2829 "compb queue container"; 2830 } 2831 description 2832 "compb-queue grouping"; 2833 } 2835 augment "/policy:policies" + 2836 "/policy:policy-entry" + 2837 "/policy:classifier-entry" + 2838 "/policy:classifier-action-entry-cfg" { 2839 choice action-cfg-params { 2840 description 2841 "Choice of action types"; 2842 case compb-queue { 2843 uses compb-queue-name; 2844 } 2845 } 2846 description 2847 "Augment the queue actions to queue policy entry"; 2848 } 2849 } 2851 module example-compb-queue { 2852 yang-version 1; 2853 namespace "urn:ietf:params:xml:ns:yang:ietf-compb-queue"; 2854 prefix compb-queue; 2856 import ietf-qos-action { 2857 prefix action; 2858 } 2860 organization "Company B"; 2861 contact 2862 "Editor: XYZ 2863 "; 2865 description 2866 "This module describes a compb queue module. This is a 2867 template for a queue within a queue policy, referenced 2868 by name. 2870 This version of this YANG module is part of RFC XXXX; see 2871 the RFC itself for full legal notices."; 2873 revision 2015-04-07 { 2874 description 2875 "Latest revision of diffserv based classifier"; 2876 reference "RFC XXXX"; 2877 } 2879 container compb-queue { 2880 description 2881 "Queue used in compb architecture"; 2882 leaf name { 2883 type string; 2884 description 2885 "A unique name identifying this queue"; 2886 } 2887 uses action:queue; 2888 container excess-rate { 2889 choice excess-rate-type { 2890 case percent { 2891 leaf excess-rate-percent { 2892 type uint32 { 2893 range "1..100"; 2894 } 2895 description 2896 "excess-rate-percent"; 2897 } 2898 } 2899 case proportion { 2900 leaf excess-rate-poroportion { 2901 type uint32 { 2902 range "1..1000"; 2903 } 2904 description 2905 "excess-rate-poroportion"; 2906 } 2907 } 2908 description 2909 "Choice of excess-rate type"; 2910 } 2911 description 2912 "Excess rate value"; 2913 } 2914 leaf excess-priority { 2915 type enumeration { 2916 enum high { 2917 description "High Loss Priority"; 2918 } 2919 enum medium-high { 2920 description "Medium-high Loss Priority"; 2921 } 2922 enum medium-low { 2923 description "Medium-low Loss Priority"; 2924 } 2925 enum low { 2926 description "Low Loss Priority"; 2927 } 2928 enum none { 2929 description "No excess priority"; 2930 } 2931 } 2932 description 2933 "Priority of excess (above guaranted rate) traffic"; 2934 } 2935 container buffer-size { 2936 choice buffer-size-type { 2937 case percent { 2938 leaf buffer-size-percent { 2939 type uint32 { 2940 range "1..100"; 2941 } 2942 description 2943 "buffer-size-percent"; 2944 } 2945 } 2946 case temporal { 2947 leaf buffer-size-temporal { 2948 type uint64; 2949 units "microsecond"; 2950 description 2951 "buffer-size-temporal"; 2952 } 2953 } 2954 case remainder { 2955 leaf buffer-size-remainder { 2956 type empty; 2957 description 2958 "use remaining of buffer"; 2959 } 2960 } 2961 description 2962 "Choice of buffer size type"; 2963 } 2964 description 2965 "Buffer size value"; 2966 } 2967 } 2969 augment 2970 "/compb-queue" + 2971 "/queue-cfg" + 2972 "/algorithmic-drop-cfg" + 2973 "/drop-algorithm" { 2974 case random-detect { 2975 list drop-profile-list { 2976 key "priority"; 2977 description 2978 "map of priorities to drop-algorithms"; 2979 leaf priority { 2980 type enumeration { 2981 enum any { 2982 description "Any priority mapped here"; 2983 } 2984 enum high { 2985 description "High Priority Packet"; 2986 } 2987 enum medium-high { 2988 description "Medium-high Priority Packet"; 2989 } 2990 enum medium-low { 2991 description "Medium-low Priority Packet"; 2992 } 2993 enum low { 2994 description "Low Priority Packet"; 2995 } 2996 } 2997 description 2998 "Priority of guaranteed traffic"; 2999 } 3000 leaf drop-profile { 3001 type string; 3002 description 3003 "drop profile to use for this priority"; 3004 } 3005 } 3006 } 3007 description 3008 "compb random detect drop algorithm config"; 3009 } 3010 } 3012 module example-compb-scheduler-policy { 3013 yang-version 1; 3014 namespace "urn:ietf:params:xml:ns:yang:" + 3015 "example-compb-scheduler-policy"; 3016 prefix scheduler-plcy; 3018 import ietf-qos-action { 3019 prefix action; 3020 } 3022 import ietf-qos-policy { 3023 prefix policy; 3024 } 3026 organization "Company B"; 3027 contact 3028 "Editor: XYZ 3029 "; 3031 description 3032 "This module defines a scheduler policy. The classification 3033 is based on classifier-any, and the action is a scheduler."; 3035 revision 2015-04-07 { 3036 description 3037 "Latest revision of diffserv policy"; 3038 reference "RFC XXXX"; 3039 } 3041 identity queue-policy { 3042 base policy:action-type; 3043 description 3044 "forwarding-class-queue action type"; 3045 } 3047 grouping queue-policy-name { 3048 container compb-queue-policy-name { 3049 leaf name { 3050 type string; 3051 description 3052 "Queue policy name"; 3053 } 3054 description 3055 "compb-queue-policy container"; 3056 } 3057 description 3058 "compb-queue policy grouping"; 3059 } 3061 augment "/policy:policies" + 3062 "/policy:policy-entry" + 3063 "/policy:classifier-entry" + 3064 "/policy:classifier-action-entry-cfg" { 3065 choice action-cfg-params { 3066 case schedular { 3067 uses action:schedular; 3068 } 3069 case queue-policy { 3070 uses queue-policy-name; 3071 } 3072 description 3073 "Augment the scheduler policy with a queue policy"; 3074 } 3075 } 3076 } 3078 A.3. Example of Company C Diffserv Model 3080 Company C vendor augmentation is based on Ericsson's implementation 3081 differentiated QoS. This implementation first sorts traffic based on 3082 a classifier, which can sort traffic into one or more traffic 3083 forwarding classes. Then, a policer or meter policy references the 3084 classifier and its traffic forwarding classes to specify different 3085 service levels for each traffic forwarding class. 3087 Because each classifier sorts traffic into one or more traffic 3088 forwarding classes, this type of classifier does not align with ietf- 3089 qos-classifier.yang, which defines one traffic forwarding class per 3090 classifier. Additionally, Company C's policing and metering policies 3091 relies on the classifier's pre-defined traffic forwarding classes to 3092 provide differentiated services, rather than redefining the patterns 3093 within a policing or metering policy, as is defined in ietf- 3094 diffserv.yang. 3096 Due to these differences, even though Company C uses all the building 3097 blocks of classifier and policy, Company C's augmentation does not 3098 use ietf-diffserv.yang to provide differentiated service levels. 3099 Instead, Company C's augmentation uses the basic building blocks, 3100 ietf-qos-policy.yang to provide differentiated services. 3102 module example-compc-qos-policy { 3103 yang-version 1.1; 3104 namespace "urn:example-compc-qos-policy"; 3105 prefix "compcqos"; 3107 import ietf-qos-policy { 3108 prefix "pol"; 3109 } 3111 import ietf-qos-action { 3112 prefix "action"; 3113 } 3115 organization ""; 3116 contact ""; 3117 description ""; 3119 revision 2016-09-26 { 3120 description ""; 3121 reference ""; 3122 } 3124 /* identities */ 3125 identity compc-qos-policy { 3126 base pol:policy-type; 3127 } 3129 identity mdrr-queuing-policy { 3130 base compc-qos-policy; 3131 } 3133 identity pwfq-queuing-policy { 3134 base compc-qos-policy; 3135 } 3137 identity policing-policy { 3138 base compc-qos-policy; 3139 } 3141 identity metering-policy { 3142 base compc-qos-policy; 3143 } 3145 identity forwarding-policy { 3146 base compc-qos-policy; 3147 } 3149 identity overhead-profile-policy { 3150 base compc-qos-policy; 3151 } 3153 identity resource-profile-policy { 3154 base compc-qos-policy; 3155 } 3157 identity protocol-rate-limit-policy { 3158 base compc-qos-policy; 3159 } 3161 identity compc-qos-action { 3162 base pol:action-type; 3163 } 3165 /* groupings */ 3167 grouping redirect-action-grp { 3168 container redirect { 3169 /* Redirect options */ 3170 } 3171 } 3172 /* deviations */ 3174 deviation "/pol:policies/pol:policy-entry" { 3175 deviate add { 3176 must "pol:type = compc-qos-policy" { 3177 description 3178 "Only policy types drived from compc-qos-policy " + 3179 "are supported"; 3180 } 3181 } 3182 } 3184 deviation "/pol:policies/pol:policy-entry/pol:classifier-entry" { 3185 deviate add { 3186 must "../per-class-action = 'true'" { 3187 description 3188 "Only policies with per-class actions have classifiers"; 3189 } 3190 must "((../sub-type != 'mdrr-queuing-policy') and " + 3191 " (../sub-type != 'pwfq-queuing-policy')) or " + 3192 "(((../sub-type = 'mdrr-queuing-policy') or " + 3193 " (../sub-type = 'pwfq-queueing-policy')) and " + 3194 " ((classifier-entry-name = '0') or " + 3195 " (classifier-entry-name = '1') or " + 3196 " (classifier-entry-name = '2') or " + 3197 " (classifier-entry-name = '3') or " + 3198 " (classifier-entry-name = '4') or " + 3199 " (classifier-entry-name = '5') or " + 3200 " (classifier-entry-name = '6') or " + 3201 " (classifier-entry-name = '7') or " + 3202 " (classifier-entry-name = '8')))" { 3203 description 3204 "MDRR queuing policy's or PWFQ queuing policy's " + 3205 "classifier-entry-name is limited to the listed values"; 3206 } 3207 } 3208 } 3210 deviation "/pol:policies/pol:policy-entry/pol:classifier-entry" + 3211 "/pol:classifier-action-entry-cfg" { 3212 deviate add { 3213 max-elements 1; 3214 must "action-type = 'compc-qos-action'" { 3215 description 3216 "Only compc-qos-action is allowed"; 3217 } 3218 } 3219 } 3220 /* augments */ 3222 augment "/pol:policies/pol:policy-entry" { 3223 when "pol:type = 'compc-qos-policy')" { 3224 description 3225 "Additional nodes only for diffserv-policy"; 3226 } 3227 leaf sub-type { 3228 type identityref { 3229 base compc-qos-policy; 3230 } 3231 mandatory true; 3232 /* The value of this leaf must not change once configured */ 3233 } 3234 leaf per-class-action { 3235 mandatory true; 3236 type boolean; 3237 must "(((. = 'true') and " + 3238 " ((../sub-type = 'policing-policy') or " + 3239 " (../sub-type = 'metering-policy') or " + 3240 " (../sub-type = 'mdrr-queuing-policy') or " + 3241 " (../sub-type = 'pwfq-queuing-policy') or " + 3242 " (../sub-type = 'forwarding-policy'))) or " + 3243 " ((. = 'false') and " + 3244 " ((../sub-type = 'overhead-profile-policy') or " + 3245 " (../sub-type = 'resource-profile-policy') or " + 3246 " (../sub-type = 'protocol-rate-limit-policy')))" { 3247 description 3248 "Only certain policies have per-class action"; 3249 } 3250 } 3251 container traffic-classifier { 3252 presence true; 3253 when "../sub-type = 'policing-policy' or " + 3254 "../sub-type = 'metering-policy' or " + 3255 "../sub-type = 'forwarding-policy'" { 3256 description 3257 "A classifier for policing-policy or metering-policy"; 3258 } 3259 leaf name { 3260 type string; 3261 mandatory true; 3262 description 3263 "Traffic classifier name"; 3264 } 3265 leaf type { 3266 type enumeration { 3267 enum 'internal-dscp-only-classifier' { 3268 value 0; 3269 description 3270 "Classify traffic based on (internal) dscp only"; 3271 } 3272 enum 'ipv4-header-based-classifier' { 3273 value 1; 3274 description 3275 "Classify traffic based on IPv4 packet header fields"; 3276 } 3277 enum 'ipv6-header-based-classifier' { 3278 value 2; 3279 description 3280 "Classify traffic based on IPv6 packet header fields"; 3281 } 3282 } 3283 mandatory true; 3284 description 3285 "Traffic classifier type"; 3286 } 3287 } 3288 container traffic-queue { 3289 when "(../sub-type = 'mdrr-queuing-policy') or " + 3290 "(../sub-type = 'pwfq-queuing-policy')" { 3291 description 3292 "Queuing policy properties"; 3293 } 3294 leaf queue-map { 3295 type string; 3296 description 3297 "Traffic queue map for queuing policy"; 3298 } 3299 } 3300 container overhead-profile { 3301 when "../sub-type = 'overhead-profile-policy'" { 3302 description 3303 "Overhead profile policy properties"; 3304 } 3305 } 3306 container resource-profile { 3307 when "../sub-type = 'resource-profile-policy'" { 3308 description 3309 "Resource profile policy properties"; 3310 } 3311 } 3312 container protocol-rate-limit { 3313 when "../sub-type = 'protocol-rate-limit-policy'" { 3314 description 3315 "Protocol rate limit policy properties"; 3317 } 3318 } 3319 } 3321 augment "/pol:policies/pol:policy-entry/pol:classifier-entry" + 3322 "/pol:classifier-action-entry-cfg/pol:action-cfg-params" { 3323 when "../../../pol:type = 'compc-qos-policy')" { 3324 description 3325 "Configurations for a classifier-policy-type policy"; 3326 } 3327 case metering-or-policing-policy { 3328 when "../../../sub-type = 'policing-policy' or " 3329 + "../../../sub-type = 'metering-policy'" { 3330 } 3331 container dscp-marking { 3332 uses action:dscp-marking; 3333 } 3334 container precedence-marking { 3335 uses action:dscp-marking; 3336 } 3337 container priority-marking { 3338 uses action:priority; 3339 } 3340 container rate-limiting { 3341 uses action:one-rate-two-color-meter; 3342 } 3343 } 3344 case mdrr-queuing-policy { 3345 when "../../../sub-type = 'mdrr-queuing-policy'" { 3346 description 3347 "MDRR queue handling properties for the traffic " + 3348 "classified into current queue"; 3349 } 3350 leaf mdrr-queue-weight { 3351 type uint8 { 3352 range "20..100"; 3353 } 3354 units percentage; 3355 } 3356 } 3357 case pwfq-queuing-policy { 3358 when "../../../sub-type = 'pwfq-queuing-policy'" { 3359 description 3360 "PWFQ queue handling properties for traffic " + 3361 "classified into current queue"; 3362 } 3363 leaf pwfq-queue-weight { 3364 type uint8 { 3365 range "20..100"; 3366 } 3367 units percentage; 3368 } 3369 leaf pwfq-queue-priority { 3370 type uint8; 3371 } 3372 leaf pwfq-queue-rate { 3373 type uint8; 3374 } 3375 } 3376 case forwarding-policy { 3377 when "../../../sub-type = 'forwarding-policy'" { 3378 description 3379 "Forward policy handling properties for traffic " + 3380 "in this classifier"; 3381 } 3382 uses redirect-action-grp; 3383 } 3384 description 3385 "Add the classify action configuration"; 3386 } 3388 } 3390 Authors' Addresses 3392 Aseem Choudhary 3393 Cisco Systems 3394 170 W. Tasman Drive 3395 San Jose, CA 95134 3396 US 3398 Email: asechoud@cisco.com 3400 Mahesh Jethanandani 3401 Cisco Systems 3402 170 W. Tasman Drive 3403 San Jose, CA 95134 3404 US 3406 Email: mjethanandani@gmail.com 3407 Norm Strahle 3408 Juniper Networks 3409 1194 North Mathilda Avenue 3410 Sunnyvale, CA 94089 3411 US 3413 Email: nstrahle@juniper.net 3415 Ebben Aries 3416 Juniper Networks 3417 1194 North Mathilda Avenue 3418 Sunnyvale, CA 94089 3419 US 3421 Email: exa@juniper.net 3423 Ing-Wher Chen 3424 Kuatro Technologies 3426 Email: ichen@kuatrotech.com