idnits 2.17.1 draft-ietf-rtgwg-qos-model-06.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 90 pages Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Line 218 has weird spacing: '...cal-not boo...' == Line 240 has weird spacing: '...cal-not boo...' == Line 242 has weird spacing: '...rw type ide...' == Line 343 has weird spacing: '...rection ide...' == Line 362 has weird spacing: '...scp-min ine...' == (28 more instances...) -- The document date (Nov 08, 2021) is 892 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) ** Downref: Normative reference to an Informational RFC: RFC 2697 ** Downref: Normative reference to an Informational RFC: RFC 2698 Summary: 2 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 Cisco Systems 4 Intended status: Standards Track M. Jethanandani 5 Expires: May 12, 2022 VMware 6 E. Aries 7 Juniper Networks 8 I. Chen 9 The MITRE Corporation 10 Nov 08, 2021 12 A YANG Data Model for Quality of Service (QoS) 13 draft-ietf-rtgwg-qos-model-06 15 Abstract 17 This document describes a YANG Data model for Quality of Service 18 (QoS) configuration in network devices. This document doesn't 19 describe QoS statistics counters. 21 Status of This Memo 23 This Internet-Draft is submitted in full conformance with the 24 provisions of BCP 78 and BCP 79. 26 Internet-Drafts are working documents of the Internet Engineering 27 Task Force (IETF). Note that other groups may also distribute 28 working documents as Internet-Drafts. The list of current Internet- 29 Drafts is at https://datatracker.ietf.org/drafts/current/. 31 Internet-Drafts are draft documents valid for a maximum of six months 32 and may be updated, replaced, or obsoleted by other documents at any 33 time. It is inappropriate to use Internet-Drafts as reference 34 material or to cite them other than as "work in progress." 36 This Internet-Draft will expire on May 12, 2022. 38 Copyright Notice 40 Copyright (c) 2021 IETF Trust and the persons identified as the 41 document authors. All rights reserved. 43 This document is subject to BCP 78 and the IETF Trust's Legal 44 Provisions Relating to IETF Documents 45 (https://trustee.ietf.org/license-info) in effect on the date of 46 publication of this document. Please review these documents 47 carefully, as they describe your rights and restrictions with respect 48 to this document. Code Components extracted from this document must 49 include Simplified BSD License text as described in Section 4.e of 50 the Trust Legal Provisions and are provided without warranty as 51 described in the Simplified BSD License. 53 Table of Contents 55 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 56 1.1. Tree Diagrams . . . . . . . . . . . . . . . . . . . . . . 3 57 1.2. Terminology . . . . . . . . . . . . . . . . . . . . . . . 3 58 1.3. Definitions and Acronyms . . . . . . . . . . . . . . . . 3 59 2. QoS Model Design . . . . . . . . . . . . . . . . . . . . . . 3 60 3. DiffServ Model Design . . . . . . . . . . . . . . . . . . . . 4 61 4. Modules Tree Structure . . . . . . . . . . . . . . . . . . . 5 62 5. Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 63 5.1. ietf-qos-classifier . . . . . . . . . . . . . . . . . . . 14 64 5.2. ietf-qos-policy . . . . . . . . . . . . . . . . . . . . . 18 65 5.3. ietf-qos-action . . . . . . . . . . . . . . . . . . . . . 20 66 5.4. ietf-qos-target . . . . . . . . . . . . . . . . . . . . . 38 67 5.5. ietf-diffserv . . . . . . . . . . . . . . . . . . . . . . 40 68 5.6. ietf-queue-policy . . . . . . . . . . . . . . . . . . . . 50 69 5.7. ietf-scheduler-policy . . . . . . . . . . . . . . . . . . 53 70 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 56 71 7. Security Considerations . . . . . . . . . . . . . . . . . . . 56 72 8. Acknowledgement . . . . . . . . . . . . . . . . . . . . . . . 56 73 9. Contributors . . . . . . . . . . . . . . . . . . . . . . . . 57 74 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 57 75 10.1. Normative References . . . . . . . . . . . . . . . . . . 57 76 10.2. Informative References . . . . . . . . . . . . . . . . . 58 77 Appendix A. Company A, Company B and Company C examples . . . . 58 78 A.1. Example of Company A Diffserv Model . . . . . . . . . . . 58 79 A.2. Example of Company B Diffserv Model . . . . . . . . . . . 68 80 A.3. Example of Company C Diffserv Model . . . . . . . . . . . 82 81 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 90 83 1. Introduction 85 This document defines a base YANG [RFC6020] [RFC7950] data model for 86 Quality of Service (QoS) configuration parameters. Differentiated 87 Services (DiffServ) module is an augmentation of base QoS modules. 88 Remote Procedure Calls (RPC) or notification definition is not part 89 of this document. QoS base modules define a basic building blocks to 90 define a classifier, policy, action and target. The base modules 91 have been augmented to include packet match fields and action 92 parameters to define the DiffServ module. Queues and schedulers are 93 stitched as part of diffserv policy itself or separate modules are 94 defined for creating Queue policy and Scheduling policy. The 95 DiffServ model is based on DiffServ architecture, and various 96 references have been made to available standard architecture 97 documents. 99 DiffServ is a preferred approach for network service providers to 100 offer services to different customers based on their network Quality- 101 of-Service (QoS) objectives. The traffic streams are differentiated 102 based on DiffServ Code Points (DSCP) carried in the IP header of each 103 packet. The DSCP markings are applied by upstream node or by the 104 edge router on entry to the DiffServ network. 106 Editorial Note: (To be removed by RFC Editor) 108 This draft contains several placeholder values that need to be 109 replaced with finalized values at the time of publication. Please 110 apply the following replacements: o "XXXX" --> the assigned RFC value 111 for this draft both in this draft and in the YANG models under the 112 revision statement. o The "revision" date in model, in the format 113 XXXX-XX-XX, needs to be updated with the date the draft gets 114 approved. 116 The YANG modules in this document conform to the Network Management 117 Datastore Architecture (NMDA) [RFC8342]. 119 1.1. Tree Diagrams 121 Tree diagrams used in this document follow the notation defined in 122 [RFC8340] 124 1.2. Terminology 126 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 127 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 128 "OPTIONAL" in this document are to be interpreted as described in BCP 129 14 [RFC2119] [RFC8174] when, and only when, they appear in all 130 capitals, as shown here. 132 1.3. Definitions and Acronyms 134 DSCP: Differentiated Services Code Point ICMP: Internet Control 135 Message Protocol IP: Internet Protocol IPv4: Internet Protocol 136 version 4 IPv6: Internet Protocol version 6 TCP: Transmission Control 137 Protocol UDP: User Datagram Protocol 139 2. QoS Model Design 141 A classifier consists of packets which may be grouped when a logical 142 set of rules are applied on different packet header fields. The 143 grouping may be based on different values or range of values of same 144 packet header field, presence or absence of some values or range of 145 values of a packet field or a combination thereof. The QoS 146 classifier is defined in the ietf-qos-classifier module. 148 A classifier entry contains one or more packet conditioning 149 functions. A packet conditioning function is typically based on 150 direction of traffic and may drop, mark or delay network packets. A 151 set of classifier entries with corresponding conditioning functions 152 when arranged in order of priority represents a QoS policy. A QoS 153 policy may contain one or more classifier entries. These are defined 154 in ietf-qos-policy module. 156 Actions are configured in line with respect to the policy module. 157 These include marking, dropping or shaping. Actions are defined in 158 the ietf-qos-action module. 160 A meter qualifies if the traffic arrival rate is based on agreed upon 161 rate and variability. A meter is modeled based on commonly used 162 alogrithms in industry, Single Rate Tri Color Marking (srTCM) 163 [RFC2697] meter, Two Rate Tri Color Marking (trTCM) [RFC2698] meter, 164 and Single Rate Two Color Marking meter. Different vendors can 165 extend it with other types of meters as well. 167 This module imports definitions from "Common YANG Data Types" 168 [RFC6991] and "A YANG Data Model for Interface Management" [RFC8343]. 170 3. DiffServ Model Design 172 DiffServ architecture [RFC3289] and [RFC2475] describe the 173 architecture as a simple model where traffic entering a network is 174 classified and possibly conditioned at the boundary of the network 175 and assigned a different Behavior Aggregate (BA). Each BA is 176 identified by a specific value of DSCP, and is used to select a Per 177 Hop Behavior (PHB). 179 The packet classification policy identifies the subset of traffic 180 which may receive a DiffServ by being conditioned or mapped. Packet 181 classifiers select packets within a stream based on the content of 182 some portion of the packet header. There are two types of 183 classifiers, the BA classifier, and the Multi-Field (MF) classifier 184 which selects packets based on a value which is combination of one or 185 more header fields. In the ietf-diffserv module, this is realized by 186 augmenting the QoS classification module. 188 Traffic conditioning includes metering, shaping and/or marking. A 189 meter is used to measure the traffic against a given traffic profile. 190 The traffic profile specifies the temporal property of the traffic. 191 A packet that arrives is first determined to be in or out of the 192 profile, which will result in the action of marked, dropped or 193 shaped. This is realized in vendor specific modules based on the 194 parameters defined in action module. The metering parameters are 195 augmented to the QoS policy module when metering is defined inline, 196 and to the metering template when metering profile is referred in 197 policy module. 199 4. Modules Tree Structure 201 This document defines seven YANG modules - four QoS base modules, a 202 scheduler policy module, a queuing policy module and one DiffServ 203 module. 205 ietf-qos-classifier consists of classifier entries identified by a 206 classifier entry name. Each entry MAY contain a list of filter 207 entries. When no filter entry is present in a classifier entry, it 208 matches all traffic. 210 module: ietf-qos-classifier 211 +--rw classifiers {classifier-template-feature}? 212 +--rw classifier* [name] 213 +--rw name string 214 +--rw description? string 215 +--rw filter-operation? identityref 216 +--rw filter* [type logical-not] 217 +--rw type identityref 218 +--rw logical-not boolean 220 An ietf-qos-policy module contains list of policy objects identified 221 by a policy name and policy type which MUST be provided. With 222 different values of policy types, each vendor MAY define their own 223 construct of policy for different QoS functionalities. Each vendor 224 MAY augment classifier entry in a policy definition with a set of 225 actions. 227 module: ietf-qos-policy 228 +--rw policies 229 +--rw policy* [name type] 230 +--rw name string 231 +--rw type identityref 232 +--rw description? string 233 +--rw classifier* [name] 234 +--rw name string 235 +--rw inline? boolean 236 +--rw filter-operation? identityref 237 +--rw filter* [type logical-not] 238 {policy-inline-classifier}? 239 | +--rw type identityref 240 | +--rw logical-not boolean 241 +--rw action* [type] 242 +--rw type identityref 243 +--rw (action-params)? 245 ietf-qos-action module contains grouping of set of QoS actions. 246 These include metering, marking, dropping and shaping. Marking sets 247 DiffServ codepoint value in the classified packet. Color-aware and 248 Color-blind meters are augmented by vendor specific modules based on 249 the parameters defined in action module. 251 module: ietf-qos-action 252 +--rw meters 253 +--rw meter* [name] {meter-template-support}? 254 +--rw name string 255 +--rw (meter-type)? 256 +--:(one-rate-two-color-meter-type) 257 | +--rw one-rate-two-color-meter 258 | +--rw committed-rate-value? uint64 259 | +--rw committed-rate-unit? identityref 260 | +--rw committed-burst-value? uint64 261 | +--rw committed-burst-unit? identityref 262 | +--rw conform-action 263 | | +--rw conform-2color-meter-action-params* 264 [conform-2color-meter-action-type] 265 | | +--rw conform-2color-meter-action-type 266 identityref 267 | | +--rw (conform-2color-meter-action-val)? 268 | +--rw exceed-action 269 | +--rw exceed-2color-meter-action-params* 270 [exceed-2color-meter-action-type] 271 | +--rw exceed-2color-meter-action-type 272 identityref 273 | +--rw (exceed-2color-meter-action-val)? 274 +--:(one-rate-tri-color-meter-type) 275 | +--rw one-rate-tri-color-meter 276 | +--rw committed-rate-value? uint64 277 | +--rw committed-rate-unit? identityref 278 | +--rw committed-burst-value? uint64 279 | +--rw committed-burst-unit? identityref 280 | +--rw excess-burst-value? uint64 281 | +--rw excess-burst-unit? identityref 282 | +--rw conform-action 283 | | +--rw conform-3color-meter-action-params* 284 [conform-3color-meter-action-type] 285 | | +--rw conform-3color-meter-action-type 286 identityref 287 | | +--rw (conform-3color-meter-action-val)? 288 | +--rw exceed-action 289 | | +--rw exceed-3color-meter-action-params* 290 [exceed-3color-meter-action-type] 291 | | +--rw exceed-3color-meter-action-type 292 identityref 293 | | +--rw (exceed-3color-meter-action-val)? 294 | +--rw violate-action 295 | +--rw violate-3color-meter-action-params* 296 [violate-3color-meter-action-type] 297 | +--rw violate-3color-meter-action-type 298 identityref 299 | +--rw (violate-3color-meter-action-val)? 300 +--:(two-rate-tri-color-meter-type) 301 +--rw two-rate-tri-color-meter 302 +--rw committed-rate-value? uint64 303 +--rw committed-rate-unit? identityref 304 +--rw committed-burst-value? uint64 305 +--rw committed-burst-unit? identityref 306 +--rw peak-rate-value? uint64 307 +--rw peak-rate-unit? identityref 308 +--rw peak-burst-value? uint64 309 +--rw peak-burst-unit? identityref 310 +--rw conform-action 311 | +--rw conform-3color-meter-action-params* 312 [conform-3color-meter-action-type] 313 | +--rw conform-3color-meter-action-type 314 identityref 315 | +--rw (conform-3color-meter-action-val)? 316 +--rw exceed-action 317 | +--rw exceed-3color-meter-action-params* 318 [exceed-3color-meter-action-type] 319 | +--rw exceed-3color-meter-action-type 320 identityref 321 | +--rw (exceed-3color-meter-action-val)? 322 +--rw violate-action 323 +--rw violate-3color-meter-action-params* 324 [violate-3color-meter-action-type] 325 +--rw violate-3color-meter-action-type 326 identityref 327 +--rw (violate-3color-meter-action-val)? 329 ietf-qos-target module contains reference of qos-policy and augments 330 ietf-interfaces [RFC8343] module. A single policy of a particular 331 policy-type can be applied on an interface in each direction of 332 traffic. Policy-type is of type identity and is populated in a 333 vendor specific manner. This way it provides greater flexibility for 334 each vendor to define different policy types each with its own 335 capabilities and restrictions. 337 Classifier, metering and queuing counters are associated with a 338 target. 340 module: ietf-qos-target 341 augment /if:interfaces/if:interface: 342 +--rw qos-target-policy* [direction type] 343 +--rw direction identityref 344 +--rw type identityref 345 +--rw name string 347 Diffserv module augments QoS classifier module. Many of the YANG 348 types defined in [RFC6991] are represented as leafs in the classifier 349 module. 351 Metering and marking actions are realized by augmenting the QoS 352 policy-module. Any queuing, AQM and scheduling actions are part of 353 vendor specific augmentation. Statistics are realized by augmenting 354 the QoS target module. 356 module: ietf-diffserv 357 augment /classifier:classifiers/classifier:classifier + 358 /classifier:filter: 359 +--rw (filter-param)? 360 +--:(dscp) 361 | +--rw dscp* [dscp-min dscp-max] 362 | +--rw dscp-min inet:dscp 363 | +--rw dscp-max inet:dscp 364 +--:(source-ipv4-prefix) 365 | +--rw source-ipv4-prefix* [source-ipv4-prefix] 366 | +--rw source-ipv4-prefix inet:ipv4-prefix 367 +--:(destination-ipv4-prefix) 368 | +--rw destination-ipv4-prefix* [destination-ipv4-prefix] 369 | +--rw destination-ipv4-prefix inet:ipv4-prefix 370 +--:(source-ipv6-prefix) 371 | +--rw source-ipv6-prefix* [source-ipv6-prefix] 372 | +--rw source-ipv6-prefix inet:ipv6-prefix 373 +--:(destination-ipv6-prefix) 374 | +--rw destination-ipv6-prefix* [destination-ipv6-prefix] 375 | +--rw destination-ipv6-prefix inet:ipv6-prefix 376 +--:(source-port) 377 | +--rw source-port* [source-port-min source-port-max] 378 | +--rw source-port-min inet:port-number 379 | +--rw source-port-max inet:port-number 380 +--:(destination-port) 381 | +--rw destination-port* 382 [destination-port-min destination-port-max] 383 | +--rw destination-port-min inet:port-number 384 | +--rw destination-port-max inet:port-number 385 +--:(protocol) 386 | +--rw protocol* [protocol-min protocol-max] 387 | +--rw protocol-min uint8 388 | +--rw protocol-max uint8 389 +--:(traffic-group) 390 +--rw traffic-group 391 +--rw traffic-group-name? string 392 augment /policy:policies/policy:policy/policy:classifier + 393 /policy:filter: 394 +--rw (filter-params)? 395 +--:(dscp) 396 | +--rw dscp* [dscp-min dscp-max] 397 | +--rw dscp-min inet:dscp 398 | +--rw dscp-max inet:dscp 399 +--:(source-ipv4-prefix) 400 | +--rw source-ipv4-prefix* [source-ipv4-prefix] 401 | +--rw source-ipv4-prefix inet:ipv4-prefix 402 +--:(destination-ipv4-prefix) 403 | +--rw destination-ipv4-prefix* [destination-ipv4-prefix] 404 | +--rw destination-ipv4-prefix inet:ipv4-prefix 405 +--:(source-ipv6-prefix) 406 | +--rw source-ipv6-prefix* [source-ipv6-prefix] 407 | +--rw source-ipv6-prefix inet:ipv6-prefix 408 +--:(destination-ipv6-prefix) 409 | +--rw destination-ipv6-prefix* [destination-ipv6-prefix] 410 | +--rw destination-ipv6-prefix inet:ipv6-prefix 411 +--:(source-port) 412 | +--rw source-port* [source-port-min source-port-max] 413 | +--rw source-port-min inet:port-number 414 | +--rw source-port-max inet:port-number 415 +--:(destination-port) 416 | +--rw destination-port* 417 [destination-port-min destination-port-max] 418 | +--rw destination-port-min inet:port-number 419 | +--rw destination-port-max inet:port-number 420 +--:(protocol) 421 | +--rw protocol* [protocol-min protocol-max] 422 | +--rw protocol-min uint8 423 | +--rw protocol-max uint8 424 +--:(traffic-group) 425 +--rw traffic-group 426 +--rw traffic-group-name? string 427 augment /policy:policies/policy:policy/policy:classifier + 428 /policy:action/policy:action-params: 429 +--:(dscp-marking) 430 | +--rw dscp 431 | +--rw dscp? inet:dscp 432 +--:(meter-inline) {action:meter-inline-feature}? 433 | +--rw (meter-type)? 434 | +--:(one-rate-two-color-meter-type) 435 | | +--rw one-rate-two-color-meter 436 | | +--rw committed-rate-value? uint64 437 | | +--rw committed-rate-unit? identityref 438 | | +--rw committed-burst-value? uint64 439 | | +--rw committed-burst-unit? identityref 440 | | +--rw conform-action 441 | | | +--rw conform-2color-meter-action-params* 442 [conform-2color-meter-action-type] 443 | | | +--rw conform-2color-meter-action-type 444 identityref 445 | | | +--rw (conform-2color-meter-action-val)? 446 | | +--rw exceed-action 447 | | +--rw exceed-2color-meter-action-params* 448 [exceed-2color-meter-action-type] 449 | | +--rw exceed-2color-meter-action-type 450 identityref 451 | | +--rw (exceed-2color-meter-action-val)? 452 | +--:(one-rate-tri-color-meter-type) 453 | | +--rw one-rate-tri-color-meter 454 | | +--rw committed-rate-value? uint64 455 | | +--rw committed-rate-unit? identityref 456 | | +--rw committed-burst-value? uint64 457 | | +--rw committed-burst-unit? identityref 458 | | +--rw excess-burst-value? uint64 459 | | +--rw excess-burst-unit? identityref 460 | | +--rw conform-action 461 | | | +--rw conform-3color-meter-action-params* 462 [conform-3color-meter-action-type] 463 | | | +--rw conform-3color-meter-action-type 464 identityref 465 | | | +--rw (conform-3color-meter-action-val)? 466 | | +--rw exceed-action 467 | | | +--rw exceed-3color-meter-action-params* 468 [exceed-3color-meter-action-type] 469 | | | +--rw exceed-3color-meter-action-type 470 identityref 471 | | | +--rw (exceed-3color-meter-action-val)? 472 | | +--rw violate-action 473 | | +--rw violate-3color-meter-action-params* 474 [violate-3color-meter-action-type] 475 | | +--rw violate-3color-meter-action-type 476 identityref 477 | | +--rw (violate-3color-meter-action-val)? 478 | +--:(two-rate-tri-color-meter-type) 479 | +--rw two-rate-tri-color-meter 480 | +--rw committed-rate-value? uint64 481 | +--rw committed-rate-unit? identityref 482 | +--rw committed-burst-value? uint64 483 | +--rw committed-burst-unit? identityref 484 | +--rw peak-rate-value? uint64 485 | +--rw peak-rate-unit? identityref 486 | +--rw peak-burst-value? uint64 487 | +--rw peak-burst-unit? identityref 488 | +--rw conform-action 489 | | +--rw conform-3color-meter-action-params* 490 [conform-3color-meter-action-type] 491 | | +--rw conform-3color-meter-action-type 492 identityref 493 | | +--rw (conform-3color-meter-action-val)? 494 | +--rw exceed-action 495 | | +--rw exceed-3color-meter-action-params* 496 [exceed-3color-meter-action-type] 497 | | +--rw exceed-3color-meter-action-type 498 identityref 499 | | +--rw (exceed-3color-meter-action-val)? 500 | +--rw violate-action 501 | +--rw violate-3color-meter-action-params* 502 [violate-3color-meter-action-type] 503 | +--rw violate-3color-meter-action-type 504 identityref 505 | +--rw (violate-3color-meter-action-val)? 506 +--:(meter-reference) {action:meter-reference-feature}? 507 | +--rw meter 508 | +--rw name string 509 | +--rw type identityref 510 +--:(traffic-group-marking) {action:traffic-group-feature}? 511 | +--rw traffic-group 512 | +--rw traffic-group? string 513 +--:(child-policy) {action:child-policy-feature}? 514 | +--rw child-policy {child-policy-feature}? 515 | +--rw policy-name? string 516 +--:(count) {action:count-feature}? 517 | +--rw count {count-feature}? 518 | +--rw count-action? empty 519 +--:(named-count) {action:named-counter-feature}? 520 | +--rw named-counter {named-counter-feature}? 521 | +--rw count-name-action? string 522 +--:(queue-inline) {diffserv-queue-inline-support}? 523 | +--rw queue 524 | +--rw priority 525 | | +--rw priority-level? uint8 526 | +--rw min-rate 527 | | +--rw rate-value? uint64 528 | | +--rw rate-unit? identityref 529 | +--rw max-rate 530 | | +--rw rate-value? uint64 531 | | +--rw rate-unit? identityref 532 | | +--rw burst-value? uint64 533 | | +--rw burst-unit? identityref 534 | +--rw algorithmic-drop 535 | +--rw (drop-algorithm)? 536 | +--:(tail-drop) 537 | +--rw tail-drop 538 | +--rw tail-drop? empty 539 +--:(scheduler-inline) {diffserv-scheduler-inline-support}? 540 +--rw scheduler 541 +--rw min-rate 542 | +--rw rate-value? uint64 543 | +--rw rate-unit? identityref 544 +--rw max-rate 545 +--rw rate-value? uint64 546 +--rw rate-unit? identityref 547 +--rw burst-value? uint64 548 +--rw burst-unit? identityref 550 module: ietf-queue-policy 551 +--rw queue {queue-policy-support}? 552 +--rw name? string 553 +--rw queue 554 +--rw priority 555 | +--rw priority-level? uint8 556 +--rw min-rate 557 | +--rw rate-value? uint64 558 | +--rw rate-unit? identityref 559 +--rw max-rate 560 | +--rw rate-value? uint64 561 | +--rw rate-unit? identityref 562 | +--rw burst-value? uint64 563 | +--rw burst-unit? identityref 564 +--rw algorithmic-drop 565 +--rw (drop-algorithm)? 566 +--:(tail-drop) 567 +--rw tail-drop 568 +--rw tail-drop? empty 570 augment /policy:policies/policy:policy/policy:classifier + 571 /policy:filter: 572 +--rw (filter-params)? {queue-policy-support}? 573 +--:(traffic-group-name) 574 +--rw traffic-group 575 +--rw traffic-group-name? string 576 augment /policy:policies/policy:policy/policy:classifier + 577 /policy:action/policy:action-params: 578 +--:(queue-template-name) 579 {queue-template-support,queue-policy-support}? 580 | +--rw queue-reference 581 | +--rw queue-name string 582 +--:(queue-inline) {queue-inline-support,queue-policy-support}? 583 +--rw queue 584 +--rw priority 585 | +--rw priority-level? uint8 586 +--rw min-rate 587 | +--rw rate-value? uint64 588 | +--rw rate-unit? identityref 589 +--rw max-rate 590 | +--rw rate-value? uint64 591 | +--rw rate-unit? identityref 592 | +--rw burst-value? uint64 593 | +--rw burst-unit? identityref 594 +--rw algorithmic-drop 595 +--rw (drop-algorithm)? 596 +--:(tail-drop) 597 +--rw tail-drop 598 +--rw tail-drop? empty 600 module: ietf-scheduler-policy 601 augment /policy:policies/policy:policy/policy:classifier + 602 /policy:filter: 603 +--rw (filter-params)? 604 +--:(filter-match-all) 605 +--rw match-all-cfg 606 +--rw match-all-action? empty 607 augment /policy:policies/policy:policy/policy:classifier + 608 /policy:action/policy:action-params: 609 +--:(scheduler) 610 | +--rw scheduler 611 | +--rw min-rate 612 | | +--rw rate-value? uint64 613 | | +--rw rate-unit? identityref 614 | +--rw max-rate 615 | +--rw rate-value? uint64 616 | +--rw rate-unit? identityref 617 | +--rw burst-value? uint64 618 | +--rw burst-unit? identityref 619 +--:(queue-policy-name) 620 +--rw queue-policy-name 621 +--rw queue-policy string 623 5. Modules 625 5.1. ietf-qos-classifier 627 file "ietf-qos-classifier@2021-07-12.yang" 628 module ietf-qos-classifier { 629 yang-version 1.1; 630 namespace "urn:ietf:params:xml:ns:yang:ietf-qos-classifier"; 631 prefix classifier; 632 organization "IETF RTG (Routing Area) Working Group"; 633 contact 634 "WG Web: 635 WG List: 636 WG Chair: Chris Bowers 637 638 WG Chair: Jeff Tantsura 639 640 Editor: Aseem Choudhary 641 642 Editor: Mahesh Jethanandani 643 "; 644 description 645 "This module contains a collection of YANG definitions for 646 configuring qos specification implementations. 647 Copyright (c) 2021 IETF Trust and the persons identified as 648 authors of the code. All rights reserved. 649 Redistribution and use in source and binary forms, with or 650 without modification, is permitted pursuant to, and subject 651 to the license terms contained in, the Simplified BSD License 652 set forth in Section 4.c of the IETF Trust's Legal Provisions 653 Relating to IETF Documents 654 (http://trustee.ietf.org/license-info). 655 This version of this YANG module is part of RFC XXXX; see 656 the RFC itself for full legal notices."; 657 revision 2021-07-12 { 658 description 659 "Initial revision of qos base classifier module"; 660 reference "RFC XXXX"; 661 } 662 feature policy-inline-classifier{ 663 description 664 " This feature allows classifier configuration 665 directly under policy."; 666 } 667 feature classifier-template-feature { 668 description 669 " This feature allows classifier as template configuration 670 in a policy."; 671 } 672 feature match-any-filter-type-support { 673 description 674 " This feature allows classifier configuration 675 directly under policy."; 676 } 678 identity filter-type { 679 description 680 "This is identity of base filter-type"; 681 } 682 identity match-filter-operation { 683 description 684 "filter match logical operation type"; 685 } 686 identity match-all-filter { 687 base match-filter-operation; 688 description 689 "Classifier entry filter logical AND operation"; 690 } 691 identity match-any-filter { 692 if-feature "match-any-filter-type-support"; 693 base match-filter-operation; 694 description 695 "Classifier entry filter logical OR operation"; 697 } 698 grouping filters { 699 description 700 "Filters types in a Classifier entry"; 701 leaf type { 702 type identityref { 703 base filter-type; 704 } 705 description 706 "This leaf defines type of the filter"; 707 } 708 leaf logical-not { 709 type boolean; 710 description 711 " 712 This is logical-not operator for a filter. When true, it 713 indicates filter looks for absence of a pattern defined 714 by the filter 715 "; 716 } 717 } 718 grouping generic-attr { 719 description 720 " 721 Classifier generic attributes like name, 722 description, operation type 723 "; 724 leaf name { 725 type string; 726 description 727 "classifier entry name"; 728 } 729 leaf description { 730 type string; 731 description 732 "classifier entry description statement"; 733 } 734 leaf filter-operation { 735 type identityref { 736 base match-filter-operation; 737 } 738 default "match-all-filter"; 739 description 740 "Filters are applicable as match-any or match-all filters"; 741 } 742 } 743 grouping inline-attr { 744 description 745 "attributes of inline classifier in a policy"; 746 leaf inline { 747 type boolean; 748 default "false"; 749 description 750 "Indication of inline classifier entry"; 751 } 752 leaf filter-operation { 753 type identityref { 754 base match-filter-operation; 755 } 756 default "match-all-filter"; 757 description 758 "Filters are applicable as match-any or match-all filters"; 759 } 760 list filter{ 761 if-feature policy-inline-classifier; 762 must " ../inline = 'true' " { 763 description 764 "For inline filter configuration, inline attribute" + 765 "must be true"; 766 } 767 key "type logical-not"; 768 uses filters; 769 description 770 "Filters configured inline in a policy"; 771 } 772 } 773 container classifiers { 774 if-feature classifier-template-feature; 775 description 776 "list of classifier entry"; 777 list classifier{ 778 key "name"; 779 description 780 "each classifier entry contains a list of filters"; 781 uses generic-attr; 782 list filter { 783 key "type logical-not"; 784 uses filters; 785 description 786 "Filter entry configuration"; 787 } 788 } 789 } 790 } 791 793 5.2. ietf-qos-policy 795 file "ietf-qos-policy@2021-07-12.yang" 796 module ietf-qos-policy { 797 yang-version 1; 798 namespace "urn:ietf:params:xml:ns:yang:ietf-qos-policy"; 799 prefix policy; 800 import ietf-qos-classifier { 801 prefix classifier; 802 } 803 organization "IETF RTG (Routing Area) Working Group"; 804 contact 805 "WG Web: 806 WG List: 807 WG Chair: Chris Bowers 808 809 WG Chair: Jeff Tantsura 810 811 Editor: Aseem Choudhary 812 813 Editor: Mahesh Jethanandani 814 "; 815 description 816 "This module contains a collection of YANG definitions for 817 configuring qos specification implementations. 818 Copyright (c) 2021 IETF Trust and the persons identified as 819 authors of the code. All rights reserved. 820 Redistribution and use in source and binary forms, with or 821 without modification, is permitted pursuant to, and subject 822 to the license terms contained in, the Simplified BSD License 823 set forth in Section 4.c of the IETF Trust's Legal Provisions 824 Relating to IETF Documents 825 (http://trustee.ietf.org/license-info). 826 This version of this YANG module is part of RFC XXXX; see 827 the RFC itself for full legal notices."; 828 revision 2021-07-12 { 829 description 830 "Initial revision of qos policy"; 831 reference "RFC XXXX"; 832 } 833 identity policy-type { 834 description 835 "This base identity type defines policy-types"; 836 } 837 grouping generic-attr { 838 description 839 "Policy Attributes"; 840 leaf name { 841 type string; 842 description 843 "policy name"; 844 } 845 leaf type { 846 type identityref { 847 base policy-type; 848 } 849 description 850 "policy type"; 851 } 852 leaf description { 853 type string; 854 description 855 "policy description"; 856 } 857 } 858 identity action-type { 859 description 860 "This base identity type defines action-types"; 861 } 862 grouping classifier-action-entry { 863 description 864 "List of Configuration of classifier & associated actions"; 865 list action { 866 key "type"; 867 ordered-by user; 868 description 869 "Configuration of classifier & associated actions"; 870 leaf type { 871 type identityref { 872 base action-type; 873 } 874 description 875 "This defines action type "; 876 } 877 choice action-params { 878 description 879 "Choice of action types"; 880 } 881 } 882 } 883 container policies{ 884 description 885 "list of policy templates"; 886 list policy{ 887 key "name type"; 888 description 889 "policy template"; 890 uses generic-attr; 891 list classifier{ 892 key "name"; 893 ordered-by user; 894 description 895 "Classifier entry configuration in a policy"; 896 leaf name { 897 type string; 898 description 899 "classifier entry name"; 900 } 901 uses classifier:inline-attr; 902 uses classifier-action-entry; 903 } 904 } 905 } 906 } 907 909 5.3. ietf-qos-action 911 file "ietf-qos-action@2021-07-12.yang" 912 module ietf-qos-action { 913 yang-version 1.1; 914 namespace "urn:ietf:params:xml:ns:yang:ietf-qos-action"; 915 prefix action; 916 import ietf-inet-types { 917 prefix inet; 918 reference "RFC 6991: Common YANG Data Types"; 919 } 920 import ietf-qos-policy { 921 prefix policy; 922 reference "RFC XXXX: YANG Model for QoS"; 923 } 924 organization "IETF RTG (Routing Area) Working Group"; 925 contact 926 "WG Web: 927 WG List: 928 WG Chair: Chris Bowers 929 930 WG Chair: Jeff Tantsura 931 932 Editor: Aseem Choudhary 933 934 Editor: Mahesh Jethanandani 935 "; 936 description 937 "This module contains a collection of YANG definitions for 938 configuring qos specification implementations. 939 Copyright (c) 2021 IETF Trust and the persons identified as 940 authors of the code. All rights reserved. 941 Redistribution and use in source and binary forms, with or 942 without modification, is permitted pursuant to, and subject 943 to the license terms contained in, the Simplified BSD License 944 set forth in Section 4.c of the IETF Trust's Legal Provisions 945 Relating to IETF Documents 946 (http://trustee.ietf.org/license-info). 947 This version of this YANG module is part of RFC XXXX; see 948 the RFC itself for full legal notices."; 949 revision 2021-07-12 { 950 description 951 "Initial revision for qos actions"; 952 reference "RFC XXXX"; 953 } 954 feature meter-template-support { 955 description 956 " This feature allows support of meter-template."; 957 } 958 feature meter-inline-feature { 959 description 960 "This feature allows support of meter-inline configuration."; 961 } 962 feature meter-reference-feature { 963 description 964 " This feature allows support of meter byi 965 reference configuration."; 966 } 967 feature queue-action-support { 968 description 969 " This feature allows support of queue action 970 configuration in policy."; 971 } 972 feature scheduler-action-support { 973 description 974 " This feature allows support of scheduler 975 configuration in policy."; 976 } 977 feature child-policy-feature { 978 description 979 "This feature allows configuration of hierarchical policy."; 980 } 981 feature count-feature { 982 description 983 "This feature allows action configuration to enable 984 counter in a classifier"; 986 } 987 feature named-counter-feature { 988 description 989 "This feature allows action configuration to enable 990 named counter in a classifier"; 991 } 992 feature traffic-group-feature { 993 description 994 "traffic-group action support"; 995 } 996 feature burst-time-unit-support { 997 description 998 "This feature allows burst unit to be configured as 999 time duration."; 1000 } 1002 identity rate-unit-type { 1003 description 1004 "base rate-unit type"; 1005 } 1006 identity bits-per-second { 1007 base rate-unit-type; 1008 description 1009 "bits per second identity"; 1010 } 1011 identity kilo-bits-per-second { 1012 base rate-unit-type; 1013 description 1014 "kilo bits per second identity"; 1015 } 1016 identity mega-bits-per-second { 1017 base rate-unit-type; 1018 description 1019 "mega bits per second identity"; 1020 } 1021 identity giga-bits-per-second { 1022 base rate-unit-type; 1023 description 1024 "mega bits per second identity"; 1025 } 1026 identity percent { 1027 base rate-unit-type; 1028 description 1029 "percentage"; 1030 } 1031 identity burst-unit-type { 1032 description 1033 "base burst-unit type"; 1035 } 1036 identity bytes { 1037 base burst-unit-type; 1038 description 1039 "bytes"; 1040 } 1041 identity kilo-bytes { 1042 base burst-unit-type; 1043 description 1044 "kilo bytes"; 1045 } 1046 identity mega-bytes { 1047 base burst-unit-type; 1048 description 1049 "mega bytes"; 1050 } 1051 identity millisecond { 1052 if-feature burst-time-unit-support; 1053 base burst-unit-type; 1054 description 1055 "milli seconds"; 1056 } 1057 identity microsecond { 1058 if-feature burst-time-unit-support; 1059 base burst-unit-type; 1060 description 1061 "micro seconds"; 1062 } 1063 identity dscp-marking { 1064 base policy:action-type; 1065 description 1066 "dscp marking action type"; 1067 } 1068 identity meter-inline { 1069 if-feature meter-inline-feature; 1070 base policy:action-type; 1071 description 1072 "meter-inline action type"; 1073 } 1074 identity meter-reference { 1075 if-feature meter-reference-feature; 1076 base policy:action-type; 1077 description 1078 "meter reference action type"; 1079 } 1080 identity queue { 1081 if-feature queue-action-support; 1082 base policy:action-type; 1083 description 1084 "queue action type"; 1085 } 1086 identity scheduler { 1087 if-feature scheduler-action-support; 1088 base policy:action-type; 1089 description 1090 "scheduler action type"; 1091 } 1092 identity discard { 1093 base policy:action-type; 1094 description 1095 "discard action type"; 1096 } 1097 identity child-policy { 1098 if-feature child-policy-feature; 1099 base policy:action-type; 1100 description 1101 "child-policy action type"; 1102 } 1103 identity count { 1104 if-feature count-feature; 1105 base policy:action-type; 1106 description 1107 "count action type"; 1108 } 1109 identity named-counter { 1110 if-feature named-counter-feature; 1111 base policy:action-type; 1112 description 1113 "name counter action type"; 1114 } 1116 identity meter-type { 1117 description 1118 "This base identity type defines meter types"; 1119 } 1120 identity one-rate-two-color-meter-type { 1121 base meter-type; 1122 description 1123 "one rate two color meter type"; 1124 } 1125 identity one-rate-tri-color-meter-type { 1126 base meter-type; 1127 description 1128 "one rate three color meter type"; 1129 } 1130 identity two-rate-tri-color-meter-type { 1131 base meter-type; 1132 description 1133 "two rate three color meter action type"; 1134 } 1136 identity drop-type { 1137 description 1138 "drop algorithm"; 1139 } 1140 identity tail-drop { 1141 base drop-type; 1142 description 1143 "tail drop algorithm"; 1144 } 1146 identity conform-2color-meter-action-type { 1147 description 1148 "action type in a meter"; 1149 } 1150 identity exceed-2color-meter-action-type { 1151 description 1152 "action type in a meter"; 1153 } 1154 identity conform-3color-meter-action-type { 1155 description 1156 "action type in a meter"; 1157 } 1158 identity exceed-3color-meter-action-type { 1159 description 1160 "action type in a meter"; 1161 } 1162 identity violate-3color-meter-action-type { 1163 description 1164 "action type in a meter"; 1165 } 1167 grouping rate-value-unit { 1168 leaf rate-value { 1169 type uint64; 1170 description 1171 "rate value"; 1172 } 1173 leaf rate-unit { 1174 type identityref { 1175 base rate-unit-type; 1176 } 1177 description 1178 "rate unit"; 1180 } 1181 description 1182 "rate value and unit grouping"; 1183 } 1184 grouping burst { 1185 description 1186 "burst value and unit configuration"; 1187 leaf burst-value { 1188 type uint64; 1189 description 1190 "burst value"; 1191 } 1192 leaf burst-unit { 1193 type identityref { 1194 base burst-unit-type; 1195 } 1196 description 1197 "burst unit"; 1198 } 1199 } 1201 grouping threshold { 1202 description 1203 "Threshold Parameters"; 1204 container threshold { 1205 description 1206 "threshold"; 1207 choice threshold-type { 1208 case size { 1209 leaf threshold-size { 1210 type uint64; 1211 units "bytes"; 1212 description 1213 "Threshold size"; 1214 } 1215 } 1216 case interval { 1217 leaf threshold-interval { 1218 type uint64; 1219 units "microsecond"; 1220 description 1221 "Threshold interval"; 1222 } 1223 } 1224 description 1225 "Choice of threshold type"; 1226 } 1227 } 1229 } 1231 grouping drop { 1232 container drop { 1233 leaf drop-action { 1234 type empty; 1235 description 1236 "always drop algorithm"; 1237 } 1238 description 1239 "the drop action"; 1240 } 1241 description 1242 "always drop grouping"; 1243 } 1245 grouping queuelimit { 1246 container qlimit-thresh { 1247 uses threshold; 1248 description 1249 "the queue limit"; 1250 } 1251 description 1252 "the queue limit beyond which queue will not hold any packet"; 1253 } 1255 grouping conform-2color-meter-action-params { 1256 description 1257 "meter action parameters"; 1258 list conform-2color-meter-action-params { 1259 key "conform-2color-meter-action-type"; 1260 ordered-by user; 1261 description 1262 "Configuration of basic-meter & associated actions"; 1263 leaf conform-2color-meter-action-type { 1264 type identityref { 1265 base conform-2color-meter-action-type; 1266 } 1267 description 1268 "meter action type"; 1269 } 1270 choice conform-2color-meter-action-val { 1271 description 1272 " meter action based on choice of meter action type"; 1273 } 1274 } 1275 } 1276 grouping exceed-2color-meter-action-params { 1277 description 1278 "meter action parameters"; 1279 list exceed-2color-meter-action-params { 1280 key "exceed-2color-meter-action-type"; 1281 ordered-by user; 1282 description 1283 "Configuration of basic-meter & associated actions"; 1284 leaf exceed-2color-meter-action-type { 1285 type identityref { 1286 base exceed-2color-meter-action-type; 1287 } 1288 description 1289 "meter action type"; 1290 } 1291 choice exceed-2color-meter-action-val { 1292 description 1293 " meter action based on choice of meter action type"; 1294 } 1295 } 1296 } 1298 grouping conform-3color-meter-action-params { 1299 description 1300 "meter action parameters"; 1301 list conform-3color-meter-action-params { 1302 key "conform-3color-meter-action-type"; 1303 ordered-by user; 1304 description 1305 "Configuration of basic-meter & associated actions"; 1306 leaf conform-3color-meter-action-type { 1307 type identityref { 1308 base conform-3color-meter-action-type; 1309 } 1310 description 1311 "meter action type"; 1312 } 1313 choice conform-3color-meter-action-val { 1314 description 1315 " meter action based on choice of meter action type"; 1316 } 1317 } 1318 } 1320 grouping exceed-3color-meter-action-params { 1321 description 1322 "meter action parameters"; 1324 list exceed-3color-meter-action-params { 1325 key "exceed-3color-meter-action-type"; 1326 ordered-by user; 1327 description 1328 "Configuration of basic-meter & associated actions"; 1329 leaf exceed-3color-meter-action-type { 1330 type identityref { 1331 base exceed-3color-meter-action-type; 1332 } 1333 description 1334 "meter action type"; 1335 } 1336 choice exceed-3color-meter-action-val { 1337 description 1338 " meter action based on choice of meter action type"; 1339 } 1340 } 1341 } 1343 grouping violate-3color-meter-action-params { 1344 description 1345 "meter action parameters"; 1346 list violate-3color-meter-action-params { 1347 key "violate-3color-meter-action-type"; 1348 ordered-by user; 1349 description 1350 "Configuration of basic-meter & associated actions"; 1351 leaf violate-3color-meter-action-type { 1352 type identityref { 1353 base violate-3color-meter-action-type; 1354 } 1355 description 1356 "meter action type"; 1357 } 1358 choice violate-3color-meter-action-val { 1359 description 1360 " meter action based on choice of meter action type"; 1361 } 1362 } 1363 } 1365 grouping one-rate-two-color-meter { 1366 container one-rate-two-color-meter { 1367 description 1368 "single rate two color marker meter"; 1369 leaf committed-rate-value { 1370 type uint64; 1371 description 1372 "committed rate value"; 1373 } 1374 leaf committed-rate-unit { 1375 type identityref { 1376 base rate-unit-type; 1377 } 1378 description 1379 "committed rate unit"; 1380 } 1381 leaf committed-burst-value { 1382 type uint64; 1383 description 1384 "burst value"; 1385 } 1386 leaf committed-burst-unit { 1387 type identityref { 1388 base burst-unit-type; 1389 } 1390 description 1391 "committed burst unit"; 1392 } 1393 container conform-action { 1394 uses conform-2color-meter-action-params; 1395 description 1396 "conform action"; 1397 } 1398 container exceed-action { 1399 uses exceed-2color-meter-action-params; 1400 description 1401 "exceed action"; 1402 } 1403 } 1404 description 1405 "single rate two color marker meter attributes"; 1406 } 1408 grouping one-rate-tri-color-meter { 1409 container one-rate-tri-color-meter { 1410 description 1411 "single rate three color meter"; 1412 leaf committed-rate-value { 1413 type uint64; 1414 description 1415 "meter rate"; 1416 } 1417 leaf committed-rate-unit { 1418 type identityref { 1419 base rate-unit-type; 1421 } 1422 description 1423 "committed rate unit"; 1424 } 1425 leaf committed-burst-value { 1426 type uint64; 1427 description 1428 "committed burst size"; 1429 } 1430 leaf committed-burst-unit { 1431 type identityref { 1432 base burst-unit-type; 1433 } 1434 description 1435 "committed burst unit"; 1436 } 1437 leaf excess-burst-value { 1438 type uint64; 1439 description 1440 "excess burst size"; 1441 } 1442 leaf excess-burst-unit { 1443 type identityref { 1444 base burst-unit-type; 1445 } 1446 description 1447 "excess burst unit"; 1448 } 1449 container conform-action { 1450 uses conform-3color-meter-action-params; 1451 description 1452 "conform, or green action"; 1453 } 1454 container exceed-action { 1455 uses exceed-3color-meter-action-params; 1456 description 1457 "exceed, or yellow action"; 1458 } 1459 container violate-action { 1460 uses violate-3color-meter-action-params; 1461 description 1462 "violate, or red action"; 1463 } 1464 } 1465 description 1466 "one-rate-tri-color-meter attributes"; 1467 } 1468 grouping two-rate-tri-color-meter { 1469 container two-rate-tri-color-meter { 1470 description 1471 "two rate three color meter"; 1472 leaf committed-rate-value { 1473 type uint64; 1474 units "bits-per-second"; 1475 description 1476 "committed rate"; 1477 } 1478 leaf committed-rate-unit { 1479 type identityref { 1480 base rate-unit-type; 1481 } 1482 description 1483 "committed rate unit"; 1484 } 1485 leaf committed-burst-value { 1486 type uint64; 1487 description 1488 "commited burst size"; 1489 } 1490 leaf committed-burst-unit { 1491 type identityref { 1492 base burst-unit-type; 1493 } 1494 description 1495 "committed burst unit"; 1496 } 1497 leaf peak-rate-value { 1498 type uint64; 1499 description 1500 "peak rate"; 1501 } 1502 leaf peak-rate-unit { 1503 type identityref { 1504 base rate-unit-type; 1505 } 1506 description 1507 "committed rate unit"; 1508 } 1509 leaf peak-burst-value { 1510 type uint64; 1511 description 1512 "commited burst size"; 1513 } 1514 leaf peak-burst-unit { 1515 type identityref { 1516 base burst-unit-type; 1517 } 1518 description 1519 "peak burst unit"; 1520 } 1521 container conform-action { 1522 uses conform-3color-meter-action-params; 1523 description 1524 "conform, or green action"; 1525 } 1526 container exceed-action { 1527 uses exceed-3color-meter-action-params; 1528 description 1529 "exceed, or yellow action"; 1530 } 1531 container violate-action { 1532 uses violate-3color-meter-action-params; 1533 description 1534 "exceed, or red action"; 1535 } 1536 } 1537 description 1538 "two-rate-tri-color-meter attributes"; 1539 } 1541 grouping meter { 1542 choice meter-type { 1543 case one-rate-two-color-meter-type { 1544 uses one-rate-two-color-meter; 1545 description 1546 "basic meter"; 1547 } 1548 case one-rate-tri-color-meter-type { 1549 uses one-rate-tri-color-meter; 1550 description 1551 "one rate tri-color meter"; 1552 } 1553 case two-rate-tri-color-meter-type { 1554 uses two-rate-tri-color-meter; 1555 description 1556 "two rate tri-color meter"; 1557 } 1558 description 1559 " meter action based on choice of meter action type"; 1560 } 1561 description 1562 "meter attributes"; 1563 } 1564 container meters { 1565 description 1566 "list of meter templates"; 1567 list meter { 1568 if-feature meter-template-support; 1569 key "name"; 1570 description 1571 "meter entry template"; 1572 leaf name { 1573 type string; 1574 description 1575 "meter identifier"; 1576 } 1577 uses meter; 1578 } 1579 } 1581 grouping meter-reference { 1582 container meter { 1583 leaf name { 1584 type string ; 1585 mandatory true; 1586 description 1587 "This leaf defines name of the meter referenced"; 1588 } 1589 leaf type { 1590 type identityref { 1591 base meter-type; 1592 } 1593 mandatory true; 1594 description 1595 "This leaf defines type of the meter"; 1596 } 1597 description 1598 "meter reference name"; 1599 } 1600 description 1601 "meter reference"; 1602 } 1604 grouping count { 1605 container count { 1606 if-feature count-feature; 1607 leaf count-action { 1608 type empty; 1609 description 1610 "count action"; 1611 } 1612 description 1613 "the count action"; 1614 } 1615 description 1616 "the count action grouping"; 1617 } 1619 grouping named-counter { 1620 container named-counter { 1621 if-feature named-counter-feature; 1622 leaf count-name-action { 1623 type string; 1624 description 1625 "count action"; 1626 } 1627 description 1628 "the count action"; 1629 } 1630 description 1631 "the count action grouping"; 1632 } 1634 grouping discard { 1635 container discard { 1636 leaf discard { 1637 type empty; 1638 description 1639 "discard action"; 1640 } 1641 description 1642 "discard action"; 1643 } 1644 description 1645 "discard grouping"; 1646 } 1648 grouping priority { 1649 container priority { 1650 leaf priority-level { 1651 type uint8; 1652 description 1653 "priority level"; 1654 } 1655 description 1656 "priority attributes"; 1657 } 1658 description 1659 "priority attributes grouping"; 1661 } 1662 grouping min-rate { 1663 container min-rate { 1664 uses rate-value-unit; 1665 description 1666 "min guaranteed bandwidth"; 1667 } 1668 description 1669 "minimum rate grouping"; 1670 } 1671 grouping dscp-marking { 1672 container dscp { 1673 leaf dscp { 1674 type inet:dscp; 1675 description 1676 "dscp marking"; 1677 } 1678 description 1679 "dscp marking container"; 1680 } 1681 description 1682 "dscp marking grouping"; 1683 } 1684 grouping traffic-group-marking { 1685 container traffic-group { 1686 leaf traffic-group { 1687 type string; 1688 description 1689 "traffic group marking"; 1690 } 1691 description 1692 "traffic group marking container"; 1693 } 1694 description 1695 "traffic group marking grouping"; 1696 } 1697 grouping child-policy { 1698 container child-policy { 1699 if-feature child-policy-feature; 1700 leaf policy-name { 1701 type string; 1702 description 1703 "Hierarchical Policy"; 1704 } 1705 description 1706 "Hierarchical Policy configuration container"; 1707 } 1708 description 1709 "Grouping of Hierarchical Policy configuration"; 1710 } 1711 grouping max-rate { 1712 container max-rate { 1713 uses rate-value-unit; 1714 uses burst; 1715 description 1716 "maximum rate attributes container"; 1717 } 1718 description 1719 "maximum rate attributes"; 1720 } 1721 grouping queue { 1722 container queue { 1723 uses priority; 1724 uses min-rate; 1725 uses max-rate; 1726 container algorithmic-drop { 1727 choice drop-algorithm { 1728 case tail-drop { 1729 container tail-drop { 1730 leaf tail-drop { 1731 type empty; 1732 description 1733 "tail drop algorithm"; 1734 } 1735 description 1736 "Tail Drop configuration container"; 1737 } 1738 description 1739 "Tail Drop choice"; 1740 } 1741 description 1742 "Choice of Drop Algorithm"; 1743 } 1744 description 1745 "Algorithmic Drop configuration container"; 1746 } 1747 description 1748 "Queue configuration container"; 1749 } 1750 description 1751 "Queue grouping"; 1752 } 1753 grouping scheduler { 1754 container scheduler { 1755 uses min-rate; 1756 uses max-rate; 1757 description 1758 "Schedular configuration container"; 1759 } 1760 description 1761 "Schedular configuration grouping"; 1762 } 1763 } 1764 1766 5.4. ietf-qos-target 1768 file "ietf-qos-target@2021-07-12.yang" 1769 module ietf-qos-target { 1770 yang-version 1; 1771 namespace "urn:ietf:params:xml:ns:yang:ietf-qos-target"; 1772 prefix target; 1773 import ietf-interfaces { 1774 prefix if; 1775 } 1776 import ietf-qos-policy { 1777 prefix policy; 1778 } 1779 organization "IETF RTG (Routing Area) Working Group"; 1780 contact 1781 "WG Web: 1782 WG List: 1783 WG Chair: Jurgen Schonwalder 1784 1785 WG Chair: Lou Berger 1786 1787 WG Chair: Kent Watsen 1788 1789 Editor: Aseem Choudhary 1790 1791 Editor: Mahesh Jethanandani 1792 1857 5.5. ietf-diffserv 1859 file "ietf-diffserv@2021-07-12.yang" 1860 module ietf-diffserv { 1861 yang-version 1.1; 1862 namespace "urn:ietf:params:xml:ns:yang:ietf-diffserv"; 1863 prefix diffserv; 1865 import ietf-qos-classifier { 1866 prefix classifier; 1867 } 1868 import ietf-qos-policy { 1869 prefix policy; 1870 } 1871 import ietf-qos-action { 1872 prefix action; 1873 } 1874 import ietf-inet-types { 1875 prefix inet; 1876 } 1878 organization "IETF RTG (Routing Area) Working Group"; 1879 contact 1880 "WG Web: 1881 WG List: 1882 WG Chair: Jurgen Schonwalder 1883 1884 WG Chair: Lou Berger 1885 1886 WG Chair: Kent Watsen 1887 1888 Editor: Aseem Choudhary 1889 1890 Editor: Mahesh Jethanandani 1891 = ../dscp-min" { 2015 error-message 2016 "The dscp-max must be greater than or equal to dscp-min"; 2017 } 2018 description 2019 "maximum value of dscp min-max range"; 2020 } 2021 } 2022 description 2023 "Filter grouping containing list of dscp ranges"; 2024 } 2025 grouping source-ipv4-prefix { 2026 list source-ipv4-prefix { 2027 key "source-ipv4-prefix"; 2028 description 2029 "list of source ipv4 prefix"; 2030 leaf source-ipv4-prefix { 2031 type inet:ipv4-prefix; 2032 description 2033 "source ipv4 prefix"; 2034 } 2035 } 2036 description 2037 "Filter grouping containing list of source ipv4 prefixes"; 2038 } 2039 grouping destination-ipv4-prefix { 2040 list destination-ipv4-prefix { 2041 key "destination-ipv4-prefix"; 2042 description 2043 "list of destination ipv4 prefix"; 2044 leaf destination-ipv4-prefix { 2045 type inet:ipv4-prefix; 2046 description 2047 "destination ipv4 prefix"; 2048 } 2049 } 2050 description 2051 "Filter grouping containing list of destination ipv4 prefix"; 2052 } 2053 grouping source-ipv6-prefix { 2054 list source-ipv6-prefix { 2055 key "source-ipv6-prefix"; 2056 description 2057 "list of source ipv6 prefix"; 2058 leaf source-ipv6-prefix { 2059 type inet:ipv6-prefix; 2060 description 2061 "source ipv6 prefix"; 2062 } 2063 } 2064 description 2065 "Filter grouping containing list of source ipv6 prefixes"; 2066 } 2067 grouping destination-ipv6-prefix { 2068 list destination-ipv6-prefix { 2069 key "destination-ipv6-prefix"; 2070 description 2071 "list of destination ipv4 or ipv6 prefix"; 2072 leaf destination-ipv6-prefix { 2073 type inet:ipv6-prefix; 2074 description 2075 "destination ipv6 prefix"; 2076 } 2077 } 2078 description 2079 "Filter grouping containing list of destination ipv6 prefix"; 2080 } 2081 grouping source-port { 2082 list source-port { 2083 key "source-port-min source-port-max"; 2084 description 2085 "list of ranges of source port"; 2086 leaf source-port-min { 2087 type inet:port-number; 2088 description 2089 "minimum value of source port range"; 2090 } 2091 leaf source-port-max { 2092 type inet:port-number; 2093 must ". >= ../source-port-min" { 2094 error-message 2095 "The source-port-max must be greater than or equal to 2096 source-port-min"; 2097 } 2098 description 2099 "maximum value of source port range"; 2100 } 2101 } 2102 description 2103 "Filter grouping containing list of source port ranges"; 2104 } 2105 grouping destination-port { 2106 list destination-port { 2107 key "destination-port-min destination-port-max"; 2108 description 2109 "list of ranges of destination port"; 2110 leaf destination-port-min { 2111 type inet:port-number; 2112 description 2113 "minimum value of destination port range"; 2114 } 2115 leaf destination-port-max { 2116 type inet:port-number; 2117 must ". >= ../destination-port-min" { 2118 error-message 2119 "The destination-port-max must be greater than or equal to 2120 destination-port-min"; 2121 } 2122 description 2123 "maximum value of destination port range"; 2124 } 2125 } 2126 description 2127 "Filter grouping containing list of destination port ranges"; 2128 } 2129 grouping protocol { 2130 list protocol { 2131 key "protocol-min protocol-max"; 2132 description 2133 "list of ranges of protocol values. Protocol refers to the 2134 value in the protocol field of the ipv4 header and value 2135 in the 'next-header' field of ipv6 header. In ipv6 header, 2136 'next-header' field indicates first extension header or the 2137 protocol in the 'upper-layer' header."; 2138 reference 2139 "RFC 791: Internet Protocol 2140 RFC 8200: Internet Protocol, Version 6 (IPv6) 2141 Specification"; 2142 leaf protocol-min { 2143 type uint8 { 2144 range "0..255"; 2145 } 2146 description 2147 "minimum value of protocol range"; 2148 } 2149 leaf protocol-max { 2150 type uint8 { 2151 range "0..255"; 2152 } 2153 must ". >= ../protocol-min" { 2154 error-message 2155 "The protocol-max must be greater than or equal to 2156 protocol-min"; 2157 } 2158 description 2159 "maximum value of protocol range"; 2160 } 2161 } 2162 description 2163 "Filter grouping containing list of Protocol ranges"; 2164 } 2165 grouping traffic-group { 2166 container traffic-group { 2167 leaf traffic-group-name { 2168 type string ; 2169 description 2170 "This leaf defines name of the traffic group referenced"; 2171 } 2172 description 2173 "traffic group container"; 2174 } 2175 description 2176 "traffic group grouping"; 2177 } 2179 augment "/classifier:classifiers/classifier:classifier" + 2180 "/classifier:filter" { 2181 choice filter-param { 2182 description 2183 "Choice of filter types"; 2184 case dscp { 2185 uses dscp; 2186 description 2187 "Filter containing list of dscp ranges"; 2188 } 2189 case source-ipv4-prefix { 2190 uses source-ipv4-prefix; 2191 description 2192 "Filter containing list of source ipv4 prefixes"; 2193 } 2194 case destination-ipv4-prefix { 2195 uses destination-ipv4-prefix; 2196 description 2197 "Filter containing list of destination ipv4 prefix"; 2198 } 2199 case source-ipv6-prefix { uses source-ipv6-prefix; 2200 description 2201 "Filter containing list of source ipv6 prefixes"; 2202 } 2203 case destination-ipv6-prefix { 2204 uses destination-ipv6-prefix; 2205 description 2206 "Filter containing list of destination ipv6 prefix"; 2207 } 2208 case source-port { 2209 uses source-port; 2210 description 2211 "Filter containing list of source-port ranges"; 2212 } 2213 case destination-port { 2214 uses destination-port; 2215 description 2216 "Filter containing list of destination-port ranges"; 2217 } 2218 case protocol { 2219 uses protocol; 2220 description 2221 "Filter Type Protocol"; 2222 } 2223 case traffic-group { 2224 uses traffic-group; 2225 description 2226 "Filter Type traffic-group"; 2227 } 2228 } 2229 description 2230 "augments diffserv filters to qos classifier"; 2231 } 2232 augment "/policy:policies/policy:policy/policy:classifier" + 2233 "/policy:filter" { 2234 when "../../policy:type = 'diffserv:ipv4-diffserv-policy-type' or 2235 ../../policy:type = 'diffserv:ipv6-diffserv-policy-type' or 2236 ../../policy:type = 'diffserv:diffserv-policy-type'" { 2237 description 2238 "If policy type is v4, v6 or default diffserv, 2239 below filters can be used."; 2240 } 2241 choice filter-params { 2242 description 2243 "Choice of action types"; 2244 case dscp { 2245 uses dscp; 2246 description 2247 "Filter containing list of dscp ranges"; 2248 } 2249 case source-ipv4-prefix { 2250 when "../../policy:type !=" + 2251 "'diffserv:ipv6-diffserv-policy-type'" { 2252 description 2253 "If policy type is v6, this filter cannot be used."; 2254 } 2255 uses source-ipv4-prefix; 2256 description 2257 "Filter containing list of source ipv4 prefixes"; 2258 } 2259 case destination-ipv4-prefix { 2260 when "../../policy:type !=" + 2261 "'diffserv:ipv6-diffserv-policy-type'" { 2262 description 2263 "If policy type is v6, this filter cannot be used."; 2264 } 2265 uses destination-ipv4-prefix; 2266 description 2267 "Filter containing list of destination ipv4 prefix"; 2268 } 2269 case source-ipv6-prefix { 2270 when "../../policy:type !=" + 2271 "'diffserv:ipv4-diffserv-policy-type'" { 2272 description 2273 "If policy type is v4, this filter cannot be used."; 2274 } 2275 uses source-ipv6-prefix; 2276 description 2277 "Filter containing list of source ipv6 prefixes"; 2278 } 2279 case destination-ipv6-prefix { 2280 when "../../policy:type !=" + 2281 "'diffserv:ipv4-diffserv-policy-type'" { 2282 description 2283 "If policy type is v4, this filter cannot be used."; 2284 } 2285 uses destination-ipv6-prefix; 2286 description 2287 "Filter containing list of destination ipv6 prefix"; 2288 } 2289 case source-port { 2290 uses source-port; 2291 description 2292 "Filter containing list of source-port ranges"; 2293 } 2294 case destination-port { 2295 uses destination-port; 2296 description 2297 "Filter containing list of destination-port ranges"; 2298 } 2299 case protocol { 2300 uses protocol; 2301 description 2302 "Filter Type Protocol"; 2303 } 2304 case traffic-group { 2305 uses traffic-group; 2306 description 2307 "Filter Type traffic-group"; 2308 } 2309 } 2310 description 2311 "Augments Diffserv Classifier with common filter types"; 2312 } 2313 augment "/policy:policies/policy:policy/policy:classifier" + 2314 "/policy:action/policy:action-params" { 2315 when "../../policy:type = 'diffserv:ipv4-diffserv-policy-type' or 2316 ../../policy:type = 'diffserv:ipv6-diffserv-policy-type' or 2317 ../../policy:type = 'diffserv:diffserv-policy-type' " { 2318 description 2319 "If policy type is v4, v6 or default diffserv, 2320 the below actions can be used."; 2321 } 2322 description 2323 "Augments Diffserv Policy with action configuration"; 2325 case dscp-marking { 2326 uses action:dscp-marking; 2327 } 2328 case meter-inline { 2329 if-feature action:meter-inline-feature; 2330 uses action:meter; 2331 } 2332 case meter-reference { 2333 if-feature action:meter-reference-feature; 2334 uses action:meter-reference; 2336 } 2337 case traffic-group-marking { 2338 if-feature action:traffic-group-feature; 2339 uses action:traffic-group-marking; 2340 } 2341 case child-policy { 2342 if-feature action:child-policy-feature; 2343 uses action:child-policy; 2344 } 2345 case count { 2346 if-feature action:count-feature; 2347 uses action:count; 2348 } 2349 case named-count { 2350 if-feature action:named-counter-feature; 2351 uses action:named-counter; 2352 } 2353 case queue-inline { 2354 if-feature diffserv-queue-inline-support; 2355 uses action:queue; 2356 } 2357 case scheduler-inline { 2358 if-feature diffserv-scheduler-inline-support; 2359 uses action:scheduler; 2360 } 2361 } 2362 } 2363 2365 5.6. ietf-queue-policy 2367 file "ietf-queue-policy@2021-07-12.yang" 2368 module ietf-queue-policy { 2369 yang-version 1.1; 2370 namespace "urn:ietf:params:xml:ns:yang:ietf-queue-policy"; 2371 prefix queue-policy; 2373 import ietf-qos-policy { 2374 prefix policy; 2375 } 2376 import ietf-qos-action { 2377 prefix action; 2378 } 2379 import ietf-diffserv { 2380 prefix diffserv; 2381 } 2383 organization "IETF RTG (Routing Area) Working Group"; 2384 contact 2385 "WG Web: 2386 WG List: 2387 WG Chair: Jurgen Schonwalder 2388 2389 WG Chair: Lou Berger 2390 2391 WG Chair: Kent Watsen 2392 2393 Editor: Aseem Choudhary 2394 2395 Editor: Mahesh Jethanandani 2396 2511 5.7. ietf-scheduler-policy 2513 file "ietf-scheduler-policy@2021-07-12.yang" 2514 module ietf-scheduler-policy { 2515 yang-version 1.1; 2516 namespace "urn:ietf:params:xml:ns:yang:ietf-scheduler-policy"; 2517 prefix scheduler-policy; 2519 import ietf-qos-classifier { 2520 prefix classifier; 2521 } 2522 import ietf-qos-policy { 2523 prefix policy; 2524 } 2525 import ietf-qos-action { 2526 prefix action; 2528 } 2530 organization "IETF RTG (Routing Area) Working Group"; 2531 contact 2532 "WG Web: 2533 WG List: 2534 WG Chair: Jurgen Schonwalder 2535 2536 WG Chair: Lou Berger 2537 2538 WG Chair: Kent Watsen 2539 2540 Editor: Aseem Choudhary 2541 2542 Editor: Mahesh Jethanandani 2543 2657 6. IANA Considerations 2659 TBD 2661 7. Security Considerations 2663 8. Acknowledgement 2665 The authors wish to thank Ruediger Geib, Fred Baker, Greg Misky, Tom 2666 Petch, Acee Lindem, many others for their helpful comments. 2668 MITRE has approved this document for Public Release, Distribution 2669 Unlimited, with Public Release Case Number 19-3027. 2671 9. Contributors 2673 The following people have substantially contributed to the editing of 2674 this document: 2676 Norm Strahle 2677 Email: nstrahle@juniper.net . 2679 10. References 2681 10.1. Normative References 2683 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2684 Requirement Levels", BCP 14, RFC 2119, 2685 DOI 10.17487/RFC2119, March 1997, 2686 . 2688 [RFC2697] Heinanen, J. and R. Guerin, "A Single Rate Three Color 2689 Marker", RFC 2697, DOI 10.17487/RFC2697, September 1999, 2690 . 2692 [RFC2698] Heinanen, J. and R. Guerin, "A Two Rate Three Color 2693 Marker", RFC 2698, DOI 10.17487/RFC2698, September 1999, 2694 . 2696 [RFC3289] Baker, F., Chan, K., and A. Smith, "Management Information 2697 Base for the Differentiated Services Architecture", 2698 RFC 3289, DOI 10.17487/RFC3289, May 2002, 2699 . 2701 [RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for 2702 the Network Configuration Protocol (NETCONF)", RFC 6020, 2703 DOI 10.17487/RFC6020, October 2010, 2704 . 2706 [RFC6991] Schoenwaelder, J., Ed., "Common YANG Data Types", 2707 RFC 6991, DOI 10.17487/RFC6991, July 2013, 2708 . 2710 [RFC7950] Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language", 2711 RFC 7950, DOI 10.17487/RFC7950, August 2016, 2712 . 2714 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2715 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 2716 May 2017, . 2718 [RFC8342] Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K., 2719 and R. Wilton, "Network Management Datastore Architecture 2720 (NMDA)", RFC 8342, DOI 10.17487/RFC8342, March 2018, 2721 . 2723 [RFC8343] Bjorklund, M., "A YANG Data Model for Interface 2724 Management", RFC 8343, DOI 10.17487/RFC8343, March 2018, 2725 . 2727 10.2. Informative References 2729 [RFC2475] Blake, S., Black, D., Carlson, M., Davies, E., Wang, Z., 2730 and W. Weiss, "An Architecture for Differentiated 2731 Services", RFC 2475, DOI 10.17487/RFC2475, December 1998, 2732 . 2734 [RFC8340] Bjorklund, M. and L. Berger, Ed., "YANG Tree Diagrams", 2735 BCP 215, RFC 8340, DOI 10.17487/RFC8340, March 2018, 2736 . 2738 Appendix A. Company A, Company B and Company C examples 2740 Company A, Company B and Company C Diffserv modules augments all the 2741 filter types of the QoS classifier module as well as the QoS policy 2742 module that allow it to define marking, metering, min-rate, max-rate 2743 actions. Queuing and metering counters are realized by augmenting of 2744 the QoS target module. 2746 A.1. Example of Company A Diffserv Model 2748 The following Company A vendor example augments the qos and diffserv 2749 model, demonstrating some of the following functionality: 2751 - use of template based classifier definitions 2753 - use of single policy type modelling queue, scheduler policy, and a 2754 filter policy. All of these policies either augment the qos policy 2755 or the diffserv modules 2757 - use of inline actions in a policy 2759 - flexibility in marking dscp or metadata at ingress and/or egress. 2761 module example-compa-diffserv { 2762 yang-version 1.1; 2763 namespace "urn:ietf:params:xml:ns:yang:example-compa-diffserv"; 2764 prefix example; 2765 import ietf-qos-classifier { 2766 prefix classifier; 2767 reference "RFC XXXX: YANG Model for QoS"; 2768 } 2769 import ietf-qos-policy { 2770 prefix policy; 2771 reference "RFC XXXX: YANG Model for QoS"; 2772 } 2773 import ietf-qos-action { 2774 prefix action; 2775 reference "RFC XXXX: YANG Model for QoS"; 2776 } 2777 import ietf-diffserv { 2778 prefix diffserv; 2779 reference "RFC XXXX: YANG Model for QoS"; 2780 } 2782 organization "Company A"; 2783 contact 2784 "Editor: XYZ 2785 "; 2786 description 2787 "This module contains a collection of YANG definitions of 2788 companyA diffserv specification extension."; 2789 Copyright (c) 2021 IETF Trust and the persons identified as 2790 authors of the code. All rights reserved. 2791 Redistribution and use in source and binary forms, with or 2792 without modification, is permitted pursuant to, and subject 2793 to the license terms contained in, the Simplified BSD License 2794 set forth in Section 4.c of the IETF Trust's Legal Provisions 2795 Relating to IETF Documents 2796 (http://trustee.ietf.org/license-info). 2798 This version of this YANG module is part of RFC XXXX; see 2799 the RFC itself for full legal notices."; 2801 revision 2021-07-12 { 2802 description 2803 "Initial revision for diffserv actions on network packets"; 2804 reference 2805 "RFC 6020: YANG - A Data Modeling Language for the 2806 Network Configuration Protocol (NETCONF)"; 2807 } 2809 identity default-policy-type { 2810 base policy:policy-type; 2811 description 2812 "This defines default policy-type"; 2814 } 2816 identity qos-group { 2817 base classifier:filter-type; 2818 description 2819 "qos-group filter-type"; 2820 } 2822 grouping qos-group-cfg { 2823 list qos-group-cfg { 2824 key "qos-group-min qos-group-max"; 2825 description 2826 "list of dscp ranges"; 2827 leaf qos-group-min { 2828 type uint8; 2829 description 2830 "Minimum value of qos-group range"; 2831 } 2832 leaf qos-group-max { 2833 type uint8; 2834 must ". >= ../qos-group-min" { 2835 error-message 2836 "The qos-group-max must be greater than or equal to 2837 qos-group-min"; 2838 } 2839 description 2840 "maximum value of qos-group range"; 2841 } 2842 } 2843 description 2844 "Filter containing list of qos-group ranges"; 2845 } 2847 grouping wred-threshold { 2848 container wred-min-thresh { 2849 uses action:threshold; 2850 description 2851 "Minimum threshold"; 2852 } 2853 container wred-max-thresh { 2854 uses action:threshold; 2855 description 2856 "Maximum threshold"; 2857 } 2858 leaf mark-probability { 2859 type uint32 { 2860 range "1..1000"; 2861 } 2862 description 2863 "Mark probability"; 2864 } 2865 description 2866 "WRED threshold attributes"; 2867 } 2869 grouping randomdetect { 2870 leaf exp-weighting-const { 2871 type uint32; 2872 description 2873 "Exponential weighting constant factor for wred profile"; 2874 } 2875 uses wred-threshold; 2876 description 2877 "Random detect attributes"; 2878 } 2880 augment "/classifier:classifiers/" + 2881 "classifier:classifier-entry/" + 2882 "classifier:filter-entry/diffserv:filter-param" { 2883 case qos-group { 2884 uses qos-group-cfg; 2885 description 2886 "Filter containing list of qos-group ranges. 2887 Qos-group represent packet metadata information 2888 in a device. "; 2889 } 2890 description 2891 "augmentation of classifier filters"; 2892 } 2893 augment "/policy:policies/policy:policy-entry/" + 2894 "policy:classifier-entry/" + 2895 "policy:classifier-action-entry-cfg/" + 2896 "policy:action-cfg-params" { 2897 case random-detect { 2898 uses randomdetect; 2899 } 2900 description 2901 "Augment the actions to policy entry"; 2902 } 2904 augment "/policy:policies" + 2905 "/policy:policy-entry" + 2906 "/policy:classifier-entry" + 2907 "/policy:classifier-action-entry-cfg" + 2908 "/policy:action-cfg-params" + 2909 "/diffserv:meter-inline" + 2910 "/diffserv:meter-type" + 2911 "/diffserv:one-rate-two-color-meter-type" + 2912 "/diffserv:one-rate-two-color-meter" + 2913 "/diffserv:conform-action" + 2914 "/diffserv:conform-2color-meter-action-params" + 2915 "/diffserv:conform-2color-meter-action-val" { 2917 description 2918 "augment the one-rate-two-color meter conform 2919 with actions"; 2920 case meter-action-drop { 2921 description 2922 "meter drop"; 2923 uses action:drop; 2924 } 2925 case meter-action-mark-dscp { 2926 description 2927 "meter action dscp marking"; 2928 uses action:dscp-marking; 2929 } 2930 } 2931 augment "/policy:policies" + 2932 "/policy:policy-entry" + 2933 "/policy:classifier-entry" + 2934 "/policy:classifier-action-entry-cfg" + 2935 "/policy:action-cfg-params" + 2936 "/diffserv:meter-inline" + 2937 "/diffserv:meter-type" + 2938 "/diffserv:one-rate-two-color-meter-type" + 2939 "/diffserv:one-rate-two-color-meter" + 2940 "/diffserv:exceed-action" + 2941 "/diffserv:exceed-2color-meter-action-params" + 2942 "/diffserv:exceed-2color-meter-action-val" { 2944 description 2945 "augment the one-rate-two-color meter exceed 2946 with actions"; 2947 case meter-action-drop { 2948 description 2949 "meter drop"; 2950 uses action:drop; 2951 } 2952 case meter-action-mark-dscp { 2953 description 2954 "meter action dscp marking"; 2955 uses action:dscp-marking; 2956 } 2957 } 2958 augment "/policy:policies" + 2959 "/policy:policy-entry" + 2960 "/policy:classifier-entry" + 2961 "/policy:classifier-action-entry-cfg" + 2962 "/policy:action-cfg-params" + 2963 "/diffserv:meter-inline" + 2964 "/diffserv:meter-type" + 2965 "/diffserv:one-rate-tri-color-meter-type" + 2966 "/diffserv:one-rate-tri-color-meter" + 2967 "/diffserv:conform-action" + 2968 "/diffserv:conform-3color-meter-action-params" + 2969 "/diffserv:conform-3color-meter-action-val" { 2971 description 2972 "augment the one-rate-tri-color meter conform 2973 with actions"; 2974 case meter-action-drop { 2975 description 2976 "meter drop"; 2977 uses action:drop; 2978 } 2979 case meter-action-mark-dscp { 2980 description 2981 "meter action dscp marking"; 2982 uses action:dscp-marking; 2983 } 2984 } 2985 augment "/policy:policies" + 2986 "/policy:policy-entry" + 2987 "/policy:classifier-entry" + 2988 "/policy:classifier-action-entry-cfg" + 2989 "/policy:action-cfg-params" + 2990 "/diffserv:meter-inline" + 2991 "/diffserv:meter-type" + 2992 "/diffserv:one-rate-tri-color-meter-type" + 2993 "/diffserv:one-rate-tri-color-meter" + 2994 "/diffserv:exceed-action" + 2995 "/diffserv:exceed-3color-meter-action-params" + 2996 "/diffserv:exceed-3color-meter-action-val" { 2998 description 2999 "augment the one-rate-tri-color meter exceed 3000 with actions"; 3001 case meter-action-drop { 3002 description 3003 "meter drop"; 3004 uses action:drop; 3005 } 3006 case meter-action-mark-dscp { 3007 description 3008 "meter action dscp marking"; 3009 uses action:dscp-marking; 3010 } 3011 } 3012 augment "/policy:policies" + 3013 "/policy:policy-entry" + 3014 "/policy:classifier-entry" + 3015 "/policy:classifier-action-entry-cfg" + 3016 "/policy:action-cfg-params" + 3017 "/diffserv:meter-inline" + 3018 "/diffserv:meter-type" + 3019 "/diffserv:one-rate-tri-color-meter-type" + 3020 "/diffserv:one-rate-tri-color-meter" + 3021 "/diffserv:violate-action" + 3022 "/diffserv:violate-3color-meter-action-params" + 3023 "/diffserv:violate-3color-meter-action-val" { 3024 description 3025 "augment the one-rate-tri-color meter conform 3026 with actions"; 3027 case meter-action-drop { 3028 description 3029 "meter drop"; 3030 uses action:drop; 3031 } 3032 case meter-action-mark-dscp { 3033 description 3034 "meter action dscp marking"; 3035 uses action:dscp-marking; 3036 } 3037 } 3039 augment "/policy:policies" + 3040 "/policy:policy-entry" + 3041 "/policy:classifier-entry" + 3042 "/policy:classifier-action-entry-cfg" + 3043 "/policy:action-cfg-params" + 3044 "/diffserv:meter-inline" + 3045 "/diffserv:meter-type" + 3046 "/diffserv:two-rate-tri-color-meter-type" + 3047 "/diffserv:two-rate-tri-color-meter" + 3048 "/diffserv:conform-action" + 3049 "/diffserv:conform-3color-meter-action-params" + 3050 "/diffserv:conform-3color-meter-action-val" { 3052 description 3053 "augment the one-rate-tri-color meter conform 3054 with actions"; 3055 case meter-action-drop { 3056 description 3057 "meter drop"; 3058 uses action:drop; 3059 } 3060 case meter-action-mark-dscp { 3061 description 3062 "meter action dscp marking"; 3063 uses action:dscp-marking; 3064 } 3065 } 3066 augment "/policy:policies" + 3067 "/policy:policy-entry" + 3068 "/policy:classifier-entry" + 3069 "/policy:classifier-action-entry-cfg" + 3070 "/policy:action-cfg-params" + 3071 "/diffserv:meter-inline" + 3072 "/diffserv:meter-type" + 3073 "/diffserv:two-rate-tri-color-meter-type" + 3074 "/diffserv:two-rate-tri-color-meter" + 3075 "/diffserv:exceed-action" + 3076 "/diffserv:exceed-3color-meter-action-params" + 3077 "/diffserv:exceed-3color-meter-action-val" { 3079 description 3080 "augment the two-rate-tri-color meter exceed 3081 with actions"; 3082 case meter-action-drop { 3083 description 3084 "meter drop"; 3085 uses action:drop; 3086 } 3087 case meter-action-mark-dscp { 3088 description 3089 "meter action dscp marking"; 3090 uses action:dscp-marking; 3091 } 3092 } 3093 augment "/policy:policies" + 3094 "/policy:policy-entry" + 3095 "/policy:classifier-entry" + 3096 "/policy:classifier-action-entry-cfg" + 3097 "/policy:action-cfg-params" + 3098 "/diffserv:meter-inline" + 3099 "/diffserv:meter-type" + 3100 "/diffserv:two-rate-tri-color-meter-type" + 3101 "/diffserv:two-rate-tri-color-meter" + 3102 "/diffserv:violate-action" + 3103 "/diffserv:violate-3color-meter-action-params" + 3104 "/diffserv:violate-3color-meter-action-val" { 3105 description 3106 "augment the two-rate-tri-color meter violate 3107 with actions"; 3108 case meter-action-drop { 3109 description 3110 "meter drop"; 3111 uses action:drop; 3112 } 3113 case meter-action-mark-dscp { 3114 description 3115 "meter action dscp marking"; 3116 uses action:dscp-marking; 3117 } 3118 } 3119 augment "/policy:policies" + 3120 "/policy:policy-entry" + 3121 "/policy:classifier-entry" + 3122 "/policy:classifier-action-entry-cfg" + 3123 "/policy:action-cfg-params" + 3124 "/diffserv:meter-inline" + 3125 "/diffserv:meter-type" + 3126 "/diffserv:one-rate-two-color-meter-type" + 3127 "/diffserv:one-rate-two-color-meter" { 3128 description 3129 "augment the one-rate-two-color meter with" + 3130 "color classifiers"; 3131 container conform-color { 3132 uses classifier:classifier-entry-generic-attr; 3133 description 3134 "conform color classifier container"; 3135 } 3136 container exceed-color { 3137 uses classifier:classifier-entry-generic-attr; 3138 description 3139 "exceed color classifier container"; 3140 } 3141 } 3142 augment "/policy:policies" + 3143 "/policy:policy-entry" + 3144 "/policy:classifier-entry" + 3145 "/policy:classifier-action-entry-cfg" + 3146 "/policy:action-cfg-params" + 3147 "/diffserv:meter-inline" + 3148 "/diffserv:meter-type" + 3149 "/diffserv:one-rate-tri-color-meter-type" + 3150 "/diffserv:one-rate-tri-color-meter" { 3151 description 3152 "augment the one-rate-tri-color meter with" + 3153 "color classifiers"; 3154 container conform-color { 3155 uses classifier:classifier-entry-generic-attr; 3156 description 3157 "conform color classifier container"; 3158 } 3159 container exceed-color { 3160 uses classifier:classifier-entry-generic-attr; 3161 description 3162 "exceed color classifier container"; 3163 } 3164 container violate-color { 3165 uses classifier:classifier-entry-generic-attr; 3166 description 3167 "violate color classifier container"; 3168 } 3169 } 3170 augment "/policy:policies" + 3171 "/policy:policy-entry" + 3172 "/policy:classifier-entry" + 3173 "/policy:classifier-action-entry-cfg" + 3174 "/policy:action-cfg-params" + 3175 "/diffserv:meter-inline" + 3176 "/diffserv:meter-type" + 3177 "/diffserv:two-rate-tri-color-meter-type" + 3178 "/diffserv:two-rate-tri-color-meter" { 3179 description 3180 "augment the two-rate-tri-color meter with" + 3181 "color classifiers"; 3182 container conform-color { 3183 uses classifier:classifier-entry-generic-attr; 3184 description 3185 "conform color classifier container"; 3186 } 3187 container exceed-color { 3188 uses classifier:classifier-entry-generic-attr; 3189 description 3190 "exceed color classifier container"; 3191 } 3192 container violate-color { 3193 uses classifier:classifier-entry-generic-attr; 3194 description 3195 "violate color classifier container"; 3196 } 3197 } 3199 } 3201 A.2. Example of Company B Diffserv Model 3203 The following vendor example augments the qos and diffserv model, 3204 demonstrating some of the following functionality: 3206 - use of inline classifier definitions (defined inline in the policy 3207 vs referencing an externally defined classifier) 3209 - use of mulitple policy types, e.g. a queue policy, a scheduler 3210 policy, and a filter policy. All of these policies either augment 3211 the qos policy or the diffserv modules 3213 - use of a queue module, which uses and extends the queue grouping 3214 from the ietf-qos-action module 3216 - use of meter templates (v.s. meter inline) 3218 - use of internal meta data for classification and marking 3220 module example-compb-diffserv-filter-policy { 3221 yang-version 1.1; 3222 namespace "urn:ietf:params:xml:ns:yang:" + 3223 "example-compb-diffserv-filter-policy"; 3224 prefix compb-filter-policy; 3226 import ietf-qos-classifier { 3227 prefix classifier; 3228 reference "RFC XXXX: YANG Model for QoS"; 3229 } 3230 import ietf-qos-policy { 3231 prefix policy; 3232 reference "RFC XXXX: YANG Model for QoS"; 3233 } 3234 import ietf-qos-action { 3235 prefix action; 3236 reference "RFC XXXX: YANG Model for QoS"; 3237 } 3238 import ietf-diffserv { 3239 prefix diffserv; 3240 reference "RFC XXXX: YANG Model for QoS"; 3241 } 3243 organization "Company B"; 3244 contact 3245 "Editor: XYZ 3246 "; 3248 description 3249 "This module contains a collection of YANG definitions for 3250 configuring diffserv specification implementations. 3251 Copyright (c) 2021 IETF Trust and the persons identified as 3252 authors of the code. All rights reserved. 3253 Redistribution and use in source and binary forms, with or 3254 without modification, is permitted pursuant to, and subject 3255 to the license terms contained in, the Simplified BSD License 3256 set forth in Section 4.c of the IETF Trust's Legal Provisions 3257 Relating to IETF Documents 3258 (http://trustee.ietf.org/license-info). 3260 This version of this YANG module is part of RFC XXXX; see 3261 the RFC itself for full legal notices."; 3263 revision 2021-07-12 { 3264 description 3265 "Initial revision of Company B diffserv policy"; 3266 reference "RFC XXXX"; 3267 } 3269 /************************************************* 3270 * Classification types 3271 *************************************************/ 3273 identity forwarding-class { 3274 base classifier:filter-type; 3275 description 3276 "Forwarding class filter type"; 3277 } 3279 identity internal-loss-priority { 3280 base classifier:filter-type; 3281 description 3282 "Internal loss priority filter type"; 3283 } 3285 grouping forwarding-class-cfg { 3286 list forwarding-class-cfg { 3287 key "forwarding-class"; 3288 description 3289 "list of forwarding-classes"; 3290 leaf forwarding-class { 3291 type string; 3292 description 3293 "Forwarding class name"; 3294 } 3296 } 3297 description 3298 "Filter containing list of forwarding classes"; 3299 } 3301 grouping loss-priority-cfg { 3302 list loss-priority-cfg { 3303 key "loss-priority"; 3304 description 3305 "list of loss-priorities"; 3306 leaf loss-priority { 3307 type enumeration { 3308 enum high { 3309 description "High Loss Priority"; 3310 } 3311 enum medium-high { 3312 description "Medium-high Loss Priority"; 3313 } 3314 enum medium-low { 3315 description "Medium-low Loss Priority"; 3316 } 3317 enum low { 3318 description "Low Loss Priority"; 3319 } 3320 } 3321 description 3322 "Loss-priority"; 3323 } 3324 } 3325 description 3326 "Filter containing list of loss priorities"; 3327 } 3329 augment "/policy:policies" + 3330 "/policy:policy-entry" + 3331 "/policy:classifier-entry" + 3332 "/policy:filter-entry" + 3333 "/diffserv:filter-params" { 3334 case forwarding-class { 3335 uses forwarding-class-cfg; 3336 description 3337 "Filter Type Internal-loss-priority"; 3338 } 3339 case internal-loss-priority { 3340 uses loss-priority-cfg; 3341 description 3342 "Filter Type Internal-loss-priority"; 3343 } 3344 description 3345 "Augments Diffserv Classifier with vendor" + 3346 " specific types"; 3347 } 3349 /************************************************* 3350 * Actions 3351 *************************************************/ 3353 identity mark-fwd-class { 3354 base policy:action-type; 3355 description 3356 "mark forwarding class action type"; 3357 } 3359 identity mark-loss-priority { 3360 base policy:action-type; 3361 description 3362 "mark loss-priority action type"; 3363 } 3365 grouping mark-fwd-class { 3366 container mark-fwd-class-cfg { 3367 leaf forwarding-class { 3368 type string; 3369 description 3370 "Forwarding class name"; 3371 } 3372 description 3373 "mark-fwd-class container"; 3374 } 3375 description 3376 "mark-fwd-class grouping"; 3377 } 3379 grouping mark-loss-priority { 3380 container mark-loss-priority-cfg { 3381 leaf loss-priority { 3382 type enumeration { 3383 enum high { 3384 description "High Loss Priority"; 3385 } 3386 enum medium-high { 3387 description "Medium-high Loss Priority"; 3388 } 3389 enum medium-low { 3390 description "Medium-low Loss Priority"; 3391 } 3392 enum low { 3393 description "Low Loss Priority"; 3394 } 3395 } 3396 description 3397 "Loss-priority"; 3398 } 3399 description 3400 "mark-loss-priority container"; 3401 } 3402 description 3403 "mark-loss-priority grouping"; 3404 } 3406 identity exceed-2color-meter-action-drop { 3407 base action:exceed-2color-meter-action-type; 3408 description 3409 "drop action type in a meter"; 3410 } 3412 identity meter-action-mark-fwd-class { 3413 base action:exceed-2color-meter-action-type; 3414 description 3415 "mark forwarding class action type"; 3416 } 3418 identity meter-action-mark-loss-priority { 3419 base action:exceed-2color-meter-action-type; 3420 description 3421 "mark loss-priority action type"; 3422 } 3424 identity violate-3color-meter-action-drop { 3425 base action:violate-3color-meter-action-type; 3426 description 3427 "drop action type in a meter"; 3428 } 3430 augment "/policy:policies/policy:policy-entry/" + 3431 "policy:classifier-entry/" + 3432 "policy:classifier-action-entry-cfg/" + 3433 "policy:action-cfg-params" { 3434 case mark-fwd-class { 3435 uses mark-fwd-class; 3436 description 3437 "Mark forwarding class in the packet"; 3438 } 3439 case mark-loss-priority { 3440 uses mark-loss-priority; 3441 description 3442 "Mark loss priority in the packet"; 3443 } 3444 case discard { 3445 uses action:discard; 3446 description 3447 "Discard action"; 3448 } 3449 description 3450 "Augments common diffserv policy actions"; 3451 } 3453 augment "/action:meter-template" + 3454 "/action:meter-entry" + 3455 "/action:meter-type" + 3456 "/action:one-rate-tri-color-meter-type" + 3457 "/action:one-rate-tri-color-meter" { 3458 leaf one-rate-color-aware { 3459 type boolean; 3460 description 3461 "This defines if the meter is color-aware"; 3462 } 3463 } 3464 augment "/action:meter-template" + 3465 "/action:meter-entry" + 3466 "/action:meter-type" + 3467 "/action:two-rate-tri-color-meter-type" + 3468 "/action:two-rate-tri-color-meter" { 3469 leaf two-rate-color-aware { 3470 type boolean; 3471 description 3472 "This defines if the meter is color-aware"; 3473 } 3474 } 3476 /* example of augmenting a meter template with a 3477 /* vendor specific action */ 3478 augment "/action:meter-template" + 3479 "/action:meter-entry" + 3480 "/action:meter-type" + 3481 "/action:one-rate-two-color-meter-type" + 3482 "/action:one-rate-two-color-meter" + 3483 "/action:exceed-action" + 3484 "/action:exceed-2color-meter-action-params" + 3485 "/action:exceed-2color-meter-action-val" { 3487 case exceed-2color-meter-action-drop { 3488 description 3489 "meter drop"; 3490 uses action:drop; 3491 } 3492 case meter-action-mark-fwd-class { 3493 uses mark-fwd-class; 3494 description 3495 "Mark forwarding class in the packet"; 3496 } 3497 case meter-action-mark-loss-priority { 3498 uses mark-loss-priority; 3499 description 3500 "Mark loss priority in the packet"; 3501 } 3502 } 3504 augment "/action:meter-template" + 3505 "/action:meter-entry" + 3506 "/action:meter-type" + 3507 "/action:two-rate-tri-color-meter-type" + 3508 "/action:two-rate-tri-color-meter" + 3509 "/action:violate-action" + 3510 "/action:violate-3color-meter-action-params" + 3511 "/action:violate-3color-meter-action-val" { 3512 case exceed-3color-meter-action-drop { 3513 description 3514 "meter drop"; 3515 uses action:drop; 3516 } 3518 description 3519 "Augment the actions to the two-color meter"; 3520 } 3522 augment "/action:meter-template" + 3523 "/action:meter-entry" + 3524 "/action:meter-type" + 3525 "/action:one-rate-tri-color-meter-type" + 3526 "/action:one-rate-tri-color-meter" + 3527 "/action:violate-action" + 3528 "/action:violate-3color-meter-action-params" + 3529 "/action:violate-3color-meter-action-val" { 3530 case exceed-3color-meter-action-drop { 3531 description 3532 "meter drop"; 3533 uses action:drop; 3534 } 3535 description 3536 "Augment the actions to basic meter"; 3537 } 3539 } 3540 module example-compb-queue-policy { 3541 yang-version 1.1; 3542 namespace "urn:ietf:params:xml:ns:yang:example-compb-queue-policy"; 3543 prefix queue-plcy; 3545 import ietf-qos-classifier { 3546 prefix classifier; 3547 reference "RFC XXXX: YANG Model for QoS"; 3548 } 3549 import ietf-qos-policy { 3550 prefix policy; 3551 reference "RFC XXXX: YANG Model for QoS"; 3552 } 3554 organization "Company B"; 3555 contact 3556 "Editor: XYZ 3557 "; 3559 description 3560 "This module defines a queue policy. The classification 3561 is based on aforwarding class, and the actions are queues. 3562 Copyright (c) 2021 IETF Trust and the persons identified as 3563 authors of the code. All rights reserved. 3564 Redistribution and use in source and binary forms, with or 3565 without modification, is permitted pursuant to, and subject 3566 to the license terms contained in, the Simplified BSD License 3567 set forth in Section 4.c of the IETF Trust's Legal Provisions 3568 Relating to IETF Documents 3569 (http://trustee.ietf.org/license-info). 3570 This version of this YANG module is part of RFC XXXX; see 3571 the RFC itself for full legal notices."; 3573 revision 2021-07-12 { 3574 description 3575 "Latest revision of Company B queue policy"; 3576 reference "RFC XXXX"; 3577 } 3579 identity forwarding-class { 3580 base classifier:filter-type; 3581 description 3582 "Forwarding class filter type"; 3584 } 3586 grouping forwarding-class-cfg { 3587 leaf forwarding-class-cfg { 3588 type string; 3589 description 3590 "forwarding-class name"; 3591 } 3592 description 3593 "Forwarding class filter"; 3594 } 3596 augment "/policy:policies" + 3597 "/policy:policy-entry" + 3598 "/policy:classifier-entry" + 3599 "/policy:filter-entry" { 3600 /* Does NOT support "logical-not" of forwarding class. 3601 Use "must"? */ 3602 choice filter-params { 3603 description 3604 "Choice of filters"; 3605 case forwarding-class-cfg { 3606 uses forwarding-class-cfg; 3607 description 3608 "Filter Type Internal-loss-priority"; 3609 } 3610 } 3611 description 3612 "Augments Diffserv Classifier with fwd class filter"; 3613 } 3615 identity compb-queue { 3616 base policy:action-type; 3617 description 3618 "compb-queue action type"; 3619 } 3621 grouping compb-queue-name { 3622 container queue-name { 3623 leaf name { 3624 type string; 3625 description 3626 "Queue class name"; 3627 } 3628 description 3629 "compb queue container"; 3630 } 3631 description 3632 "compb-queue grouping"; 3633 } 3635 augment "/policy:policies" + 3636 "/policy:policy-entry" + 3637 "/policy:classifier-entry" + 3638 "/policy:classifier-action-entry-cfg" { 3639 choice action-cfg-params { 3640 description 3641 "Choice of action types"; 3642 case compb-queue { 3643 uses compb-queue-name; 3644 } 3645 } 3646 description 3647 "Augment the queue actions to queue policy entry"; 3648 } 3649 } 3651 module example-compb-queue { 3652 yang-version 1.1; 3653 namespace "urn:ietf:params:xml:ns:yang:ietf-compb-queue"; 3654 prefix compb-queue; 3656 import ietf-qos-action { 3657 prefix action; 3658 reference "RFC XXXX: YANG Model for QoS"; 3659 } 3661 organization "Company B"; 3662 contact 3663 "Editor: XYZ 3664 "; 3666 description 3667 "This module describes a compb queue module. This is a 3668 template for a queue within a queue policy, referenced 3669 by name. 3671 This version of this YANG module is part of RFC XXXX; see 3672 the RFC itself for full legal notices."; 3674 revision 2021-07-12 { 3675 description 3676 "Latest revision of diffserv based classifier"; 3677 reference "RFC XXXX"; 3678 } 3679 container compb-queue { 3680 description 3681 "Queue used in compb architecture"; 3682 leaf name { 3683 type string; 3684 description 3685 "A unique name identifying this queue"; 3686 } 3687 uses action:queue; 3688 container excess-rate { 3689 choice excess-rate-type { 3690 case percent { 3691 leaf excess-rate-percent { 3692 type uint32 { 3693 range "1..100"; 3694 } 3695 description 3696 "excess-rate-percent"; 3697 } 3698 } 3699 case proportion { 3700 leaf excess-rate-poroportion { 3701 type uint32 { 3702 range "1..1000"; 3703 } 3704 description 3705 "excess-rate-poroportion"; 3706 } 3707 } 3708 description 3709 "Choice of excess-rate type"; 3710 } 3711 description 3712 "Excess rate value"; 3713 } 3714 leaf excess-priority { 3715 type enumeration { 3716 enum high { 3717 description "High Loss Priority"; 3718 } 3719 enum medium-high { 3720 description "Medium-high Loss Priority"; 3721 } 3722 enum medium-low { 3723 description "Medium-low Loss Priority"; 3724 } 3725 enum low { 3726 description "Low Loss Priority"; 3728 } 3729 enum none { 3730 description "No excess priority"; 3731 } 3732 } 3733 description 3734 "Priority of excess (above guaranted rate) traffic"; 3735 } 3736 container buffer-size { 3737 choice buffer-size-type { 3738 case percent { 3739 leaf buffer-size-percent { 3740 type uint32 { 3741 range "1..100"; 3742 } 3743 description 3744 "buffer-size-percent"; 3745 } 3746 } 3747 case temporal { 3748 leaf buffer-size-temporal { 3749 type uint64; 3750 units "microsecond"; 3751 description 3752 "buffer-size-temporal"; 3753 } 3754 } 3755 case remainder { 3756 leaf buffer-size-remainder { 3757 type empty; 3758 description 3759 "use remaining of buffer"; 3760 } 3761 } 3762 description 3763 "Choice of buffer size type"; 3764 } 3765 description 3766 "Buffer size value"; 3767 } 3768 } 3770 augment 3771 "/compb-queue" + 3772 "/queue-cfg" + 3773 "/algorithmic-drop-cfg" + 3774 "/drop-algorithm" { 3775 case random-detect { 3776 list drop-profile-list { 3777 key "priority"; 3778 description 3779 "map of priorities to drop-algorithms"; 3780 leaf priority { 3781 type enumeration { 3782 enum any { 3783 description "Any priority mapped here"; 3784 } 3785 enum high { 3786 description "High Priority Packet"; 3787 } 3788 enum medium-high { 3789 description "Medium-high Priority Packet"; 3790 } 3791 enum medium-low { 3792 description "Medium-low Priority Packet"; 3793 } 3794 enum low { 3795 description "Low Priority Packet"; 3796 } 3797 } 3798 description 3799 "Priority of guaranteed traffic"; 3800 } 3801 leaf drop-profile { 3802 type string; 3803 description 3804 "drop profile to use for this priority"; 3805 } 3806 } 3807 } 3808 description 3809 "compb random detect drop algorithm config"; 3810 } 3811 } 3813 module example-compb-scheduler-policy { 3814 yang-version 1.1; 3815 namespace "urn:ietf:params:xml:ns:yang:" + 3816 "example-compb-scheduler-policy"; 3817 prefix scheduler-plcy; 3819 import ietf-qos-action { 3820 prefix action; 3821 reference "RFC XXXX: YANG Model for QoS"; 3822 } 3823 import ietf-qos-policy { 3824 prefix policy; 3825 reference "RFC XXXX: YANG Model for QoS"; 3826 } 3828 organization "Company B"; 3829 contact 3830 "Editor: XYZ 3831 "; 3833 description 3834 "This module defines a scheduler policy. The classification 3835 is based on classifier-any, and the action is a scheduler."; 3837 revision 2021-07-12 { 3838 description 3839 "Initial revision of Company B Scheduler policy"; 3840 reference "RFC XXXX"; 3841 } 3843 identity queue-policy { 3844 base policy:action-type; 3845 description 3846 "forwarding-class-queue action type"; 3847 } 3849 grouping queue-policy-name { 3850 container compb-queue-policy-name { 3851 leaf name { 3852 type string; 3853 description 3854 "Queue policy name"; 3855 } 3856 description 3857 "compb-queue-policy container"; 3858 } 3859 description 3860 "compb-queue policy grouping"; 3861 } 3863 augment "/policy:policies" + 3864 "/policy:policy-entry" + 3865 "/policy:classifier-entry" + 3866 "/policy:classifier-action-entry-cfg" { 3867 choice action-cfg-params { 3868 case schedular { 3869 uses action:schedular; 3870 } 3871 case queue-policy { 3872 uses queue-policy-name; 3873 } 3874 description 3875 "Augment the scheduler policy with a queue policy"; 3876 } 3877 } 3878 } 3880 A.3. Example of Company C Diffserv Model 3882 Company C vendor augmentation is based on Ericsson's implementation 3883 differentiated QoS. This implementation first sorts traffic based on 3884 a classifier, which can sort traffic into one or more traffic 3885 forwarding classes. Then, a policer or meter policy references the 3886 classifier and its traffic forwarding classes to specify different 3887 service levels for each traffic forwarding class. 3889 Because each classifier sorts traffic into one or more traffic 3890 forwarding classes, this type of classifier does not align with ietf- 3891 qos-classifier.yang, which defines one traffic forwarding class per 3892 classifier. Additionally, Company C's policing and metering policies 3893 relies on the classifier's pre-defined traffic forwarding classes to 3894 provide differentiated services, rather than redefining the patterns 3895 within a policing or metering policy, as is defined in ietf- 3896 diffserv.yang. 3898 Due to these differences, even though Company C uses all the building 3899 blocks of classifier and policy, Company C's augmentation does not 3900 use ietf-diffserv.yang to provide differentiated service levels. 3901 Instead, Company C's augmentation uses the basic building blocks, 3902 ietf-qos-policy.yang to provide differentiated services. 3904 module example-compc-qos-policy { 3905 yang-version 1.1; 3906 namespace "urn:ietf:params:xml:ns:yang:example-compc-qos-policy"; 3907 prefix "compcqos"; 3909 import ietf-qos-policy { 3910 prefix "pol"; 3911 reference "RFC XXXX: YANG Model for QoS"; 3912 } 3914 import ietf-qos-action { 3915 prefix "action"; 3916 reference "RFC XXXX: YANG Model for QoS"; 3917 } 3918 organization "Company C"; 3919 contact "Company C Editor: XYZ "; 3920 description 3921 "This module contains a collection of YANG definitions for 3922 configuring diffserv specification implementations. 3923 Copyright (c) 2021 IETF Trust and the persons identified as 3924 authors of the code. All rights reserved. 3925 Redistribution and use in source and binary forms, with or 3926 without modification, is permitted pursuant to, and subject 3927 to the license terms contained in, the Simplified BSD License 3928 set forth in Section 4.c of the IETF Trust's Legal Provisions 3929 Relating to IETF Documents 3930 (http://trustee.ietf.org/license-info). 3932 This version of this YANG module is part of RFC XXXX; see 3933 the RFC itself for full legal notices."; 3935 revision 2021-07-12 { 3936 description "Initial version"; 3937 reference "RFC XXXX"; 3938 } 3940 /* identities */ 3942 identity compc-qos-policy { 3943 base pol:policy-type; 3944 description "compc-specific policy base type"; 3945 } 3947 identity mdrr-queuing-policy { 3948 base compc-qos-policy; 3949 description "compc-specific MDRR policy type"; 3950 } 3952 identity pwfq-queuing-policy { 3953 base compc-qos-policy; 3954 description "compc-specific queuing policy type"; 3955 } 3957 identity policing-policy { 3958 base compc-qos-policy; 3959 description "compc-specific policing policy type"; 3960 } 3962 identity metering-policy { 3963 base compc-qos-policy; 3964 description "compc-specific metering policy type"; 3965 } 3966 identity forwarding-policy { 3967 base compc-qos-policy; 3968 description "compc-specific forwarding policy type"; 3969 } 3971 identity overhead-profile-policy { 3972 base compc-qos-policy; 3973 description "compc-specific overhead profile policy type"; 3974 } 3976 identity resource-profile-policy { 3977 base compc-qos-policy; 3978 description "compc-specific resource profile policy type"; 3979 } 3981 identity protocol-rate-limit-policy { 3982 base compc-qos-policy; 3983 description "compc-specific protocol rate limit policy type"; 3984 } 3986 identity compc-qos-action { 3987 base pol:action-type; 3988 description "compc-specificc qos action base type"; 3989 } 3991 /* groupings */ 3993 grouping redirect-action-grp { 3994 description "Redirection options grouping"; 3995 container redirect { 3996 description "Redirect options"; 3997 } 3998 } 4000 /* deviations */ 4002 deviation "/pol:policies/pol:policy-entry" { 4003 deviate add { 4004 must "pol:type = compc-qos-policy" { 4005 description 4006 "Only policy types drived from compc-qos-policy " + 4007 "are supported"; 4008 } 4009 } 4010 } 4012 deviation "/pol:policies/pol:policy-entry/pol:classifier-entry" { 4013 deviate add { 4014 must "../per-class-action = 'true'" { 4015 description 4016 "Only policies with per-class actions have classifiers"; 4017 } 4018 must "((../compcqos:sub-type != " + 4019 "'compcqos:mdrr-queuing-policy') and " + 4020 " (../compcqos:sub-type != " + 4021 "'compcqos:pwfq-queuing-policy')) or " + 4022 "(((../compcqos:sub-type = " + 4023 "'compcqos:mdrr-queuing-policy') or " + 4024 " (../compcqos:sub-type = " + 4025 "'compcqos:pwfq-queueing-policy')) and " + 4026 " ((classifier-entry-name = '0') or " + 4027 " (classifier-entry-name = '1') or " + 4028 " (classifier-entry-name = '2') or " + 4029 " (classifier-entry-name = '3') or " + 4030 " (classifier-entry-name = '4') or " + 4031 " (classifier-entry-name = '5') or " + 4032 " (classifier-entry-name = '6') or " + 4033 " (classifier-entry-name = '7') or " + 4034 " (classifier-entry-name = '8')))" { 4035 description 4036 "MDRR queuing policy's or PWFQ queuing policy's " + 4037 "classifier-entry-name is limited to the listed values"; 4038 } 4039 } 4040 } 4042 deviation "/pol:policies/pol:policy-entry/pol:classifier-entry" + 4043 "/pol:classifier-action-entry-cfg" { 4044 deviate add { 4045 must "action-type = 'compcqos:compc-qos-action'" { 4046 description 4047 "Only compc-qos-action is allowed"; 4048 } 4049 max-elements 1; 4050 } 4051 } 4053 /* augments */ 4055 augment "/pol:policies/pol:policy-entry" { 4056 when "pol:policy-type = 'compc-qos-policy'" { 4057 description 4058 "Additional nodes only for diffserv-policy"; 4059 } 4060 description "Additional diffserv-policy nodes"; 4061 leaf sub-type { 4062 type identityref { 4063 base compc-qos-policy; 4064 } 4065 mandatory true; 4066 description "Policy sub-type. The value of this leaf must " + 4067 "not change once configured"; 4068 } 4069 leaf per-class-action { 4070 type boolean; 4071 must "(((. = 'true') and " + 4072 " ((../compcqos:sub-type = " + 4073 "'compcqos:policing-policy') or " + 4074 " (../compcqos:sub-type = " + 4075 "'compcqos:metering-policy') or " + 4076 " (../compcqos:sub-type = " + 4077 "'compcqos:mdrr-queuing-policy') or " + 4078 " (../compcqos:sub-type = " + 4079 "'compcqos:pwfq-queuing-policy') or " + 4080 " (../compcqos:sub-type = " + 4081 "'compcqos:forwarding-policy'))) or " + 4082 " ((. = 'false') and " + 4083 " ((../compcqos:sub-type = " + 4084 "'compcqos:overhead-profile-policy') or " + 4085 " (../compcqos:sub-type = " + 4086 "'compcqos:resource-profile-policy') or " + 4087 " (../compcqos:sub-type = " + 4088 "'compcqos:protocol-rate-limit-policy'))))" { 4089 description 4090 "Only certain policies have per-class action"; 4091 } 4092 mandatory true; 4093 description "Per-class action"; 4094 } 4095 container traffic-classifier { 4096 when "../compcqos:sub-type = 'compcqos:policing-policy' or " + 4097 "../compcqos:sub-type = 'compcqos:metering-policy' or " + 4098 "../compcqos:sub-type = 'compcqos:forwarding-policy'" { 4099 description 4100 "A classifier for policing-policy or metering-policy"; 4101 } 4102 presence true; 4103 leaf name { 4104 type string; 4105 mandatory true; 4106 description 4107 "Traffic classifier name"; 4108 } 4109 leaf type { 4110 type enumeration { 4111 enum 'internal-dscp-only-classifier' { 4112 value 0; 4113 description 4114 "Classify traffic based on (internal) dscp only"; 4115 } 4116 enum 'ipv4-header-based-classifier' { 4117 value 1; 4118 description 4119 "Classify traffic based on IPv4 packet header fields"; 4120 } 4121 enum 'ipv6-header-based-classifier' { 4122 value 2; 4123 description 4124 "Classify traffic based on IPv6 packet header fields"; 4125 } 4126 } 4127 mandatory true; 4128 description 4129 "Traffic classifier type"; 4130 } 4131 description "Traffic classifier"; 4132 } 4133 container traffic-queue { 4134 when "(../compcqos:sub-type = " + 4135 "'compcqos:mdrr-queuing-policy') or " + 4136 "(../compcqos:sub-type = " + 4137 "'compcqos:pwfq-queuing-policy')" { 4138 description 4139 "Queuing policy properties"; 4140 } 4141 leaf queue-map { 4142 type string; 4143 description 4144 "Traffic queue map for queuing policy"; 4145 } 4146 description "Traffic queue"; 4147 } 4148 container overhead-profile { 4149 when "../compcqos:sub-type = " + 4150 "'compcqos:overhead-profile-policy'" { 4151 description 4152 "Overhead profile policy properties"; 4153 } 4154 description "Overhead profile"; 4155 } 4156 container resource-profile { 4157 when "../compcqos:sub-type = " + 4158 "'compcqos:resource-profile-policy'" { 4159 description 4160 "Resource profile policy properties"; 4161 } 4162 description "Resource profile"; 4163 } 4164 container protocol-rate-limit { 4165 when "../compcqos:sub-type = " + 4166 "'compcqos:protocol-rate-limit-policy'" { 4167 description 4168 "Protocol rate limit policy properties"; 4169 } 4170 description "Protocol rate limit"; 4171 } 4172 } 4174 augment "/pol:policies/pol:policy-entry/pol:classifier-entry" + 4175 "/pol:classifier-action-entry-cfg/pol:action-cfg-params" { 4176 when "../../pol:policy-type = 'compc-qos-policy'" { 4177 description 4178 "Configurations for a classifier-policy-type policy"; 4179 } 4180 case metering-or-policing-policy { 4181 when "../../compcqos:sub-type = " + 4182 "'compcqos:policing-policy' or " + 4183 "../../compcqos:sub-type = 'compcqos:metering-policy'" { 4184 } 4185 container dscp-marking { 4186 uses action:dscp-marking; 4187 description "DSCP marking"; 4188 } 4189 container precedence-marking { 4190 uses action:dscp-marking; 4191 description "Precedence marking"; 4192 } 4193 container priority-marking { 4194 uses action:priority; 4195 description "Priority marking"; 4196 } 4197 container rate-limiting { 4198 uses action:one-rate-two-color-meter; 4199 description "Rate limiting"; 4200 } 4201 } 4202 case mdrr-queuing-policy { 4203 when "../../compcqos:sub-type = " + 4204 "'compcqos:mdrr-queuing-policy'" { 4205 description 4206 "MDRR queue handling properties for the traffic " + 4207 "classified into current queue"; 4208 } 4209 leaf mdrr-queue-weight { 4210 type uint8 { 4211 range "20..100"; 4212 } 4213 units percentage; 4214 description "MDRR queue weight"; 4215 } 4216 } 4217 case pwfq-queuing-policy { 4218 when "../../compcqos:sub-type = " + 4219 "'compcqos:pwfq-queuing-policy'" { 4220 description 4221 "PWFQ queue handling properties for traffic " + 4222 "classified into current queue"; 4223 } 4224 leaf pwfq-queue-weight { 4225 type uint8 { 4226 range "20..100"; 4227 } 4228 units percentage; 4229 description "Priority-based weighted fair queue weight"; 4230 } 4231 leaf pwfq-queue-priority { 4232 type uint8; 4233 description "Priority-based weighted fair queue priority"; 4234 } 4235 leaf pwfq-queue-rate { 4236 type uint8; 4237 description "Priority-based weighted fair queue rate"; 4238 } 4239 } 4240 case forwarding-policy { 4241 when "../../compcqos:sub-type = 'compcqos:forwarding-policy'" { 4242 description 4243 "Forward policy handling properties for traffic " + 4244 "in this classifier"; 4245 } 4246 uses redirect-action-grp; 4247 } 4248 description 4249 "Add the classify action configuration"; 4250 } 4251 } 4253 Authors' Addresses 4255 Aseem Choudhary 4256 Cisco Systems 4257 170 W. Tasman Drive 4258 San Jose, CA 95134 4259 US 4261 Email: asechoud@cisco.com 4263 Mahesh Jethanandani 4264 VMware 4266 Email: mjethanandani@gmail.com 4268 Ebben Aries 4269 Juniper Networks 4270 1194 North Mathilda Avenue 4271 Sunnyvale, CA 94089 4272 US 4274 Email: exa@juniper.net 4276 Ing-Wher Chen 4277 The MITRE Corporation 4279 Email: ingwherchen@mitre.org