idnits 2.17.1 draft-ietf-rtgwg-qos-model-04.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- 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 (July 12, 2021) is 1017 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 (~~), 7 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: January 13, 2022 VMware 6 N. Strahle 7 E. Aries 8 Juniper Networks 9 I. Chen 10 The MITRE Corporation 11 July 12, 2021 13 A YANG Data Model for Quality of Service (QoS) 14 draft-ietf-rtgwg-qos-model-04 16 Abstract 18 This document describes a YANG Data model for Quality of Service 19 (QoS) configuration in network devices. This document doesn't 20 describe QoS statistics counters. 22 Status of This Memo 24 This Internet-Draft is submitted in full conformance with the 25 provisions of BCP 78 and BCP 79. 27 Internet-Drafts are working documents of the Internet Engineering 28 Task Force (IETF). Note that other groups may also distribute 29 working documents as Internet-Drafts. The list of current Internet- 30 Drafts is at https://datatracker.ietf.org/drafts/current/. 32 Internet-Drafts are draft documents valid for a maximum of six months 33 and may be updated, replaced, or obsoleted by other documents at any 34 time. It is inappropriate to use Internet-Drafts as reference 35 material or to cite them other than as "work in progress." 37 This Internet-Draft will expire on January 13, 2022. 39 Copyright Notice 41 Copyright (c) 2021 IETF Trust and the persons identified as the 42 document authors. All rights reserved. 44 This document is subject to BCP 78 and the IETF Trust's Legal 45 Provisions Relating to IETF Documents 46 (https://trustee.ietf.org/license-info) in effect on the date of 47 publication of this document. Please review these documents 48 carefully, as they describe your rights and restrictions with respect 49 to this document. Code Components extracted from this document must 50 include Simplified BSD License text as described in Section 4.e of 51 the Trust Legal Provisions and are provided without warranty as 52 described in the Simplified BSD License. 54 Table of Contents 56 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 57 1.1. Tree Diagrams . . . . . . . . . . . . . . . . . . . . . . 3 58 1.2. Terminology . . . . . . . . . . . . . . . . . . . . . . . 3 59 1.3. Definitions and Acronyms . . . . . . . . . . . . . . . . 3 60 2. QoS Model Design . . . . . . . . . . . . . . . . . . . . . . 3 61 3. DiffServ Model Design . . . . . . . . . . . . . . . . . . . . 4 62 4. Modules Tree Structure . . . . . . . . . . . . . . . . . . . 5 63 5. Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 64 5.1. ietf-qos-classifier . . . . . . . . . . . . . . . . . . . 14 65 5.2. ietf-qos-policy . . . . . . . . . . . . . . . . . . . . . 18 66 5.3. ietf-qos-action . . . . . . . . . . . . . . . . . . . . . 20 67 5.4. ietf-qos-target . . . . . . . . . . . . . . . . . . . . . 38 68 5.5. ietf-diffserv . . . . . . . . . . . . . . . . . . . . . . 40 69 5.6. ietf-queue-policy . . . . . . . . . . . . . . . . . . . . 50 70 5.7. ietf-scheduler-policy . . . . . . . . . . . . . . . . . . 53 71 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 56 72 7. Security Considerations . . . . . . . . . . . . . . . . . . . 57 73 8. Acknowledgement . . . . . . . . . . . . . . . . . . . . . . . 57 74 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 57 75 9.1. Normative References . . . . . . . . . . . . . . . . . . 57 76 9.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 Editor: Norm Strahle 645 "; 646 description 647 "This module contains a collection of YANG definitions for 648 configuring qos specification implementations. 649 Copyright (c) 2021 IETF Trust and the persons identified as 650 authors of the code. All rights reserved. 651 Redistribution and use in source and binary forms, with or 652 without modification, is permitted pursuant to, and subject 653 to the license terms contained in, the Simplified BSD License 654 set forth in Section 4.c of the IETF Trust's Legal Provisions 655 Relating to IETF Documents 656 (http://trustee.ietf.org/license-info). 657 This version of this YANG module is part of RFC XXXX; see 658 the RFC itself for full legal notices."; 659 revision 2021-07-12 { 660 description 661 "Initial revision of qos base classifier module"; 662 reference "RFC XXXX"; 663 } 664 feature policy-inline-classifier{ 665 description 666 " This feature allows classifier configuration 667 directly under policy."; 668 } 669 feature classifier-template-feature { 670 description 671 " This feature allows classifier as template configuration 672 in a policy."; 673 } 674 feature match-any-filter-type-support { 675 description 676 " This feature allows classifier configuration 677 directly under policy."; 678 } 680 identity filter-type { 681 description 682 "This is identity of base filter-type"; 683 } 684 identity match-filter-operation { 685 description 686 "filter match logical operation type"; 687 } 688 identity match-all-filter { 689 base match-filter-operation; 690 description 691 "Classifier entry filter logical AND operation"; 692 } 693 identity match-any-filter { 694 if-feature "match-any-filter-type-support"; 695 base match-filter-operation; 696 description 697 "Classifier entry filter logical OR operation"; 698 } 699 grouping filters { 700 description 701 "Filters types in a Classifier entry"; 702 leaf type { 703 type identityref { 704 base filter-type; 705 } 706 description 707 "This leaf defines type of the filter"; 708 } 709 leaf logical-not { 710 type boolean; 711 description 712 " 713 This is logical-not operator for a filter. When true, it 714 indicates filter looks for absence of a pattern defined 715 by the filter 716 "; 717 } 718 } 719 grouping generic-attr { 720 description 721 " 722 Classifier generic attributes like name, 723 description, operation type 724 "; 725 leaf name { 726 type string; 727 description 728 "classifier entry name"; 729 } 730 leaf description { 731 type string; 732 description 733 "classifier entry description statement"; 734 } 735 leaf filter-operation { 736 type identityref { 737 base match-filter-operation; 738 } 739 default "match-all-filter"; 740 description 741 "Filters are applicable as match-any or match-all filters"; 742 } 743 } 744 grouping inline-attr { 745 description 746 "attributes of inline classifier in a policy"; 747 leaf inline { 748 type boolean; 749 default "false"; 750 description 751 "Indication of inline classifier entry"; 752 } 753 leaf filter-operation { 754 type identityref { 755 base match-filter-operation; 756 } 757 default "match-all-filter"; 758 description 759 "Filters are applicable as match-any or match-all filters"; 760 } 761 list filter{ 762 if-feature policy-inline-classifier; 763 must " ../inline = 'true' " { 764 description 765 "For inline filter configuration, inline attribute" + 766 "must be true"; 767 } 768 key "type logical-not"; 769 uses filters; 770 description 771 "Filters configured inline in a policy"; 772 } 773 } 774 container classifiers { 775 if-feature classifier-template-feature; 776 description 777 "list of classifier entry"; 778 list classifier{ 779 key "name"; 780 description 781 "each classifier entry contains a list of filters"; 782 uses generic-attr; 783 list filter { 784 key "type logical-not"; 785 uses filters; 786 description 787 "Filter entry configuration"; 788 } 789 } 790 } 791 } 792 794 5.2. ietf-qos-policy 796 file "ietf-qos-policy@2021-07-12.yang" 797 module ietf-qos-policy { 798 yang-version 1; 799 namespace "urn:ietf:params:xml:ns:yang:ietf-qos-policy"; 800 prefix policy; 801 import ietf-qos-classifier { 802 prefix classifier; 803 } 804 organization "IETF RTG (Routing Area) Working Group"; 805 contact 806 "WG Web: 807 WG List: 808 WG Chair: Chris Bowers 809 810 WG Chair: Jeff Tantsura 811 812 Editor: Aseem Choudhary 813 814 Editor: Mahesh Jethanandani 815 816 Editor: Norm Strahle 817 "; 818 description 819 "This module contains a collection of YANG definitions for 820 configuring qos specification implementations. 821 Copyright (c) 2021 IETF Trust and the persons identified as 822 authors of the code. All rights reserved. 823 Redistribution and use in source and binary forms, with or 824 without modification, is permitted pursuant to, and subject 825 to the license terms contained in, the Simplified BSD License 826 set forth in Section 4.c of the IETF Trust's Legal Provisions 827 Relating to IETF Documents 828 (http://trustee.ietf.org/license-info). 829 This version of this YANG module is part of RFC XXXX; see 830 the RFC itself for full legal notices."; 831 revision 2021-07-12 { 832 description 833 "Initial revision of qos policy"; 834 reference "RFC XXXX"; 835 } 836 identity policy-type { 837 description 838 "This base identity type defines policy-types"; 839 } 840 grouping generic-attr { 841 description 842 "Policy Attributes"; 843 leaf name { 844 type string; 845 description 846 "policy name"; 847 } 848 leaf type { 849 type identityref { 850 base policy-type; 851 } 852 description 853 "policy type"; 854 } 855 leaf description { 856 type string; 857 description 858 "policy description"; 859 } 860 } 861 identity action-type { 862 description 863 "This base identity type defines action-types"; 864 } 865 grouping classifier-action-entry { 866 description 867 "List of Configuration of classifier & associated actions"; 868 list action { 869 key "type"; 870 ordered-by user; 871 description 872 "Configuration of classifier & associated actions"; 873 leaf type { 874 type identityref { 875 base action-type; 876 } 877 description 878 "This defines action type "; 879 } 880 choice action-params { 881 description 882 "Choice of action types"; 883 } 884 } 885 } 886 container policies{ 887 description 888 "list of policy templates"; 889 list policy{ 890 key "name type"; 891 description 892 "policy template"; 893 uses generic-attr; 894 list classifier{ 895 key "name"; 896 ordered-by user; 897 description 898 "Classifier entry configuration in a policy"; 899 leaf name { 900 type string; 901 description 902 "classifier entry name"; 903 } 904 uses classifier:inline-attr; 905 uses classifier-action-entry; 906 } 907 } 908 } 909 } 910 912 5.3. ietf-qos-action 914 file "ietf-qos-action@2021-07-12.yang" 915 module ietf-qos-action { 916 yang-version 1.1; 917 namespace "urn:ietf:params:xml:ns:yang:ietf-qos-action"; 918 prefix action; 919 import ietf-inet-types { 920 prefix inet; 921 reference "RFC 6991: Common YANG Data Types"; 922 } 923 import ietf-qos-policy { 924 prefix policy; 925 reference "RFC XXXX: YANG Model for QoS"; 926 } 927 organization "IETF RTG (Routing Area) Working Group"; 928 contact 929 "WG Web: 930 WG List: 931 WG Chair: Chris Bowers 932 933 WG Chair: Jeff Tantsura 934 935 Editor: Aseem Choudhary 936 937 Editor: Mahesh Jethanandani 938 939 Editor: Norm Strahle 940 "; 941 description 942 "This module contains a collection of YANG definitions for 943 configuring qos specification implementations. 944 Copyright (c) 2021 IETF Trust and the persons identified as 945 authors of the code. All rights reserved. 946 Redistribution and use in source and binary forms, with or 947 without modification, is permitted pursuant to, and subject 948 to the license terms contained in, the Simplified BSD License 949 set forth in Section 4.c of the IETF Trust's Legal Provisions 950 Relating to IETF Documents 951 (http://trustee.ietf.org/license-info). 952 This version of this YANG module is part of RFC XXXX; see 953 the RFC itself for full legal notices."; 954 revision 2021-07-12 { 955 description 956 "Initial revision for qos actions"; 957 reference "RFC XXXX"; 958 } 959 feature meter-template-support { 960 description 961 " This feature allows support of meter-template."; 962 } 963 feature meter-inline-feature { 964 description 965 "This feature allows support of meter-inline configuration."; 966 } 967 feature meter-reference-feature { 968 description 969 " This feature allows support of meter byi 970 reference configuration."; 971 } 972 feature queue-action-support { 973 description 974 " This feature allows support of queue action 975 configuration in policy."; 976 } 977 feature scheduler-action-support { 978 description 979 " This feature allows support of scheduler 980 configuration in policy."; 981 } 982 feature child-policy-feature { 983 description 984 "This feature allows configuration of hierarchical policy."; 985 } 986 feature count-feature { 987 description 988 "This feature allows action configuration to enable 989 counter in a classifier"; 990 } 991 feature named-counter-feature { 992 description 993 "This feature allows action configuration to enable 994 named counter in a classifier"; 995 } 996 feature traffic-group-feature { 997 description 998 "traffic-group action support"; 999 } 1000 feature burst-time-unit-support { 1001 description 1002 "This feature allows burst unit to be configured as 1003 time duration."; 1004 } 1006 identity rate-unit-type { 1007 description 1008 "base rate-unit type"; 1009 } 1010 identity bits-per-second { 1011 base rate-unit-type; 1012 description 1013 "bits per second identity"; 1014 } 1015 identity kilo-bits-per-second { 1016 base rate-unit-type; 1017 description 1018 "kilo bits per second identity"; 1019 } 1020 identity mega-bits-per-second { 1021 base rate-unit-type; 1022 description 1023 "mega bits per second identity"; 1024 } 1025 identity giga-bits-per-second { 1026 base rate-unit-type; 1027 description 1028 "mega bits per second identity"; 1029 } 1030 identity percent { 1031 base rate-unit-type; 1032 description 1033 "percentage"; 1034 } 1035 identity burst-unit-type { 1036 description 1037 "base burst-unit type"; 1038 } 1039 identity bytes { 1040 base burst-unit-type; 1041 description 1042 "bytes"; 1043 } 1044 identity kilo-bytes { 1045 base burst-unit-type; 1046 description 1047 "kilo bytes"; 1048 } 1049 identity mega-bytes { 1050 base burst-unit-type; 1051 description 1052 "mega bytes"; 1053 } 1054 identity millisecond { 1055 if-feature burst-time-unit-support; 1056 base burst-unit-type; 1057 description 1058 "milli seconds"; 1059 } 1060 identity microsecond { 1061 if-feature burst-time-unit-support; 1062 base burst-unit-type; 1063 description 1064 "micro seconds"; 1065 } 1066 identity dscp-marking { 1067 base policy:action-type; 1068 description 1069 "dscp marking action type"; 1070 } 1071 identity meter-inline { 1072 if-feature meter-inline-feature; 1073 base policy:action-type; 1074 description 1075 "meter-inline action type"; 1076 } 1077 identity meter-reference { 1078 if-feature meter-reference-feature; 1079 base policy:action-type; 1080 description 1081 "meter reference action type"; 1082 } 1083 identity queue { 1084 if-feature queue-action-support; 1085 base policy:action-type; 1086 description 1087 "queue action type"; 1088 } 1089 identity scheduler { 1090 if-feature scheduler-action-support; 1091 base policy:action-type; 1092 description 1093 "scheduler action type"; 1094 } 1095 identity discard { 1096 base policy:action-type; 1097 description 1098 "discard action type"; 1099 } 1100 identity child-policy { 1101 if-feature child-policy-feature; 1102 base policy:action-type; 1103 description 1104 "child-policy action type"; 1105 } 1106 identity count { 1107 if-feature count-feature; 1108 base policy:action-type; 1109 description 1110 "count action type"; 1111 } 1112 identity named-counter { 1113 if-feature named-counter-feature; 1114 base policy:action-type; 1115 description 1116 "name counter action type"; 1117 } 1119 identity meter-type { 1120 description 1121 "This base identity type defines meter types"; 1122 } 1123 identity one-rate-two-color-meter-type { 1124 base meter-type; 1125 description 1126 "one rate two color meter type"; 1127 } 1128 identity one-rate-tri-color-meter-type { 1129 base meter-type; 1130 description 1131 "one rate three color meter type"; 1132 } 1133 identity two-rate-tri-color-meter-type { 1134 base meter-type; 1135 description 1136 "two rate three color meter action type"; 1137 } 1139 identity drop-type { 1140 description 1141 "drop algorithm"; 1142 } 1143 identity tail-drop { 1144 base drop-type; 1145 description 1146 "tail drop algorithm"; 1147 } 1149 identity conform-2color-meter-action-type { 1150 description 1151 "action type in a meter"; 1152 } 1153 identity exceed-2color-meter-action-type { 1154 description 1155 "action type in a meter"; 1156 } 1157 identity conform-3color-meter-action-type { 1158 description 1159 "action type in a meter"; 1160 } 1161 identity exceed-3color-meter-action-type { 1162 description 1163 "action type in a meter"; 1164 } 1165 identity violate-3color-meter-action-type { 1166 description 1167 "action type in a meter"; 1168 } 1170 grouping rate-value-unit { 1171 leaf rate-value { 1172 type uint64; 1173 description 1174 "rate value"; 1175 } 1176 leaf rate-unit { 1177 type identityref { 1178 base rate-unit-type; 1179 } 1180 description 1181 "rate unit"; 1182 } 1183 description 1184 "rate value and unit grouping"; 1185 } 1186 grouping burst { 1187 description 1188 "burst value and unit configuration"; 1189 leaf burst-value { 1190 type uint64; 1191 description 1192 "burst value"; 1193 } 1194 leaf burst-unit { 1195 type identityref { 1196 base burst-unit-type; 1197 } 1198 description 1199 "burst unit"; 1200 } 1201 } 1203 grouping threshold { 1204 description 1205 "Threshold Parameters"; 1206 container threshold { 1207 description 1208 "threshold"; 1209 choice threshold-type { 1210 case size { 1211 leaf threshold-size { 1212 type uint64; 1213 units "bytes"; 1214 description 1215 "Threshold size"; 1216 } 1217 } 1218 case interval { 1219 leaf threshold-interval { 1220 type uint64; 1221 units "microsecond"; 1222 description 1223 "Threshold interval"; 1225 } 1226 } 1227 description 1228 "Choice of threshold type"; 1229 } 1230 } 1231 } 1233 grouping drop { 1234 container drop { 1235 leaf drop-action { 1236 type empty; 1237 description 1238 "always drop algorithm"; 1239 } 1240 description 1241 "the drop action"; 1242 } 1243 description 1244 "always drop grouping"; 1245 } 1247 grouping queuelimit { 1248 container qlimit-thresh { 1249 uses threshold; 1250 description 1251 "the queue limit"; 1252 } 1253 description 1254 "the queue limit beyond which queue will not hold any packet"; 1255 } 1257 grouping conform-2color-meter-action-params { 1258 description 1259 "meter action parameters"; 1260 list conform-2color-meter-action-params { 1261 key "conform-2color-meter-action-type"; 1262 ordered-by user; 1263 description 1264 "Configuration of basic-meter & associated actions"; 1265 leaf conform-2color-meter-action-type { 1266 type identityref { 1267 base conform-2color-meter-action-type; 1268 } 1269 description 1270 "meter action type"; 1271 } 1272 choice conform-2color-meter-action-val { 1273 description 1274 " meter action based on choice of meter action type"; 1275 } 1276 } 1277 } 1279 grouping exceed-2color-meter-action-params { 1280 description 1281 "meter action parameters"; 1282 list exceed-2color-meter-action-params { 1283 key "exceed-2color-meter-action-type"; 1284 ordered-by user; 1285 description 1286 "Configuration of basic-meter & associated actions"; 1287 leaf exceed-2color-meter-action-type { 1288 type identityref { 1289 base exceed-2color-meter-action-type; 1290 } 1291 description 1292 "meter action type"; 1293 } 1294 choice exceed-2color-meter-action-val { 1295 description 1296 " meter action based on choice of meter action type"; 1297 } 1298 } 1299 } 1301 grouping conform-3color-meter-action-params { 1302 description 1303 "meter action parameters"; 1304 list conform-3color-meter-action-params { 1305 key "conform-3color-meter-action-type"; 1306 ordered-by user; 1307 description 1308 "Configuration of basic-meter & associated actions"; 1309 leaf conform-3color-meter-action-type { 1310 type identityref { 1311 base conform-3color-meter-action-type; 1312 } 1313 description 1314 "meter action type"; 1315 } 1316 choice conform-3color-meter-action-val { 1317 description 1318 " meter action based on choice of meter action type"; 1319 } 1321 } 1322 } 1324 grouping exceed-3color-meter-action-params { 1325 description 1326 "meter action parameters"; 1327 list exceed-3color-meter-action-params { 1328 key "exceed-3color-meter-action-type"; 1329 ordered-by user; 1330 description 1331 "Configuration of basic-meter & associated actions"; 1332 leaf exceed-3color-meter-action-type { 1333 type identityref { 1334 base exceed-3color-meter-action-type; 1335 } 1336 description 1337 "meter action type"; 1338 } 1339 choice exceed-3color-meter-action-val { 1340 description 1341 " meter action based on choice of meter action type"; 1342 } 1343 } 1344 } 1346 grouping violate-3color-meter-action-params { 1347 description 1348 "meter action parameters"; 1349 list violate-3color-meter-action-params { 1350 key "violate-3color-meter-action-type"; 1351 ordered-by user; 1352 description 1353 "Configuration of basic-meter & associated actions"; 1354 leaf violate-3color-meter-action-type { 1355 type identityref { 1356 base violate-3color-meter-action-type; 1357 } 1358 description 1359 "meter action type"; 1360 } 1361 choice violate-3color-meter-action-val { 1362 description 1363 " meter action based on choice of meter action type"; 1364 } 1365 } 1366 } 1368 grouping one-rate-two-color-meter { 1369 container one-rate-two-color-meter { 1370 description 1371 "single rate two color marker meter"; 1372 leaf committed-rate-value { 1373 type uint64; 1374 description 1375 "committed rate value"; 1376 } 1377 leaf committed-rate-unit { 1378 type identityref { 1379 base rate-unit-type; 1380 } 1381 description 1382 "committed rate unit"; 1383 } 1384 leaf committed-burst-value { 1385 type uint64; 1386 description 1387 "burst value"; 1388 } 1389 leaf committed-burst-unit { 1390 type identityref { 1391 base burst-unit-type; 1392 } 1393 description 1394 "committed burst unit"; 1395 } 1396 container conform-action { 1397 uses conform-2color-meter-action-params; 1398 description 1399 "conform action"; 1400 } 1401 container exceed-action { 1402 uses exceed-2color-meter-action-params; 1403 description 1404 "exceed action"; 1405 } 1406 } 1407 description 1408 "single rate two color marker meter attributes"; 1409 } 1411 grouping one-rate-tri-color-meter { 1412 container one-rate-tri-color-meter { 1413 description 1414 "single rate three color meter"; 1415 leaf committed-rate-value { 1416 type uint64; 1417 description 1418 "meter rate"; 1419 } 1420 leaf committed-rate-unit { 1421 type identityref { 1422 base rate-unit-type; 1423 } 1424 description 1425 "committed rate unit"; 1426 } 1427 leaf committed-burst-value { 1428 type uint64; 1429 description 1430 "committed burst size"; 1431 } 1432 leaf committed-burst-unit { 1433 type identityref { 1434 base burst-unit-type; 1435 } 1436 description 1437 "committed burst unit"; 1438 } 1439 leaf excess-burst-value { 1440 type uint64; 1441 description 1442 "excess burst size"; 1443 } 1444 leaf excess-burst-unit { 1445 type identityref { 1446 base burst-unit-type; 1447 } 1448 description 1449 "excess burst unit"; 1450 } 1451 container conform-action { 1452 uses conform-3color-meter-action-params; 1453 description 1454 "conform, or green action"; 1455 } 1456 container exceed-action { 1457 uses exceed-3color-meter-action-params; 1458 description 1459 "exceed, or yellow action"; 1460 } 1461 container violate-action { 1462 uses violate-3color-meter-action-params; 1463 description 1464 "violate, or red action"; 1466 } 1467 } 1468 description 1469 "one-rate-tri-color-meter attributes"; 1470 } 1472 grouping two-rate-tri-color-meter { 1473 container two-rate-tri-color-meter { 1474 description 1475 "two rate three color meter"; 1476 leaf committed-rate-value { 1477 type uint64; 1478 units "bits-per-second"; 1479 description 1480 "committed rate"; 1481 } 1482 leaf committed-rate-unit { 1483 type identityref { 1484 base rate-unit-type; 1485 } 1486 description 1487 "committed rate unit"; 1488 } 1489 leaf committed-burst-value { 1490 type uint64; 1491 description 1492 "commited burst size"; 1493 } 1494 leaf committed-burst-unit { 1495 type identityref { 1496 base burst-unit-type; 1497 } 1498 description 1499 "committed burst unit"; 1500 } 1501 leaf peak-rate-value { 1502 type uint64; 1503 description 1504 "peak rate"; 1505 } 1506 leaf peak-rate-unit { 1507 type identityref { 1508 base rate-unit-type; 1509 } 1510 description 1511 "committed rate unit"; 1512 } 1513 leaf peak-burst-value { 1514 type uint64; 1515 description 1516 "commited burst size"; 1517 } 1518 leaf peak-burst-unit { 1519 type identityref { 1520 base burst-unit-type; 1521 } 1522 description 1523 "peak burst unit"; 1524 } 1525 container conform-action { 1526 uses conform-3color-meter-action-params; 1527 description 1528 "conform, or green action"; 1529 } 1530 container exceed-action { 1531 uses exceed-3color-meter-action-params; 1532 description 1533 "exceed, or yellow action"; 1534 } 1535 container violate-action { 1536 uses violate-3color-meter-action-params; 1537 description 1538 "exceed, or red action"; 1539 } 1540 } 1541 description 1542 "two-rate-tri-color-meter attributes"; 1543 } 1545 grouping meter { 1546 choice meter-type { 1547 case one-rate-two-color-meter-type { 1548 uses one-rate-two-color-meter; 1549 description 1550 "basic meter"; 1551 } 1552 case one-rate-tri-color-meter-type { 1553 uses one-rate-tri-color-meter; 1554 description 1555 "one rate tri-color meter"; 1556 } 1557 case two-rate-tri-color-meter-type { 1558 uses two-rate-tri-color-meter; 1559 description 1560 "two rate tri-color meter"; 1561 } 1562 description 1563 " meter action based on choice of meter action type"; 1564 } 1565 description 1566 "meter attributes"; 1567 } 1569 container meters { 1570 description 1571 "list of meter templates"; 1572 list meter { 1573 if-feature meter-template-support; 1574 key "name"; 1575 description 1576 "meter entry template"; 1577 leaf name { 1578 type string; 1579 description 1580 "meter identifier"; 1581 } 1582 uses meter; 1583 } 1584 } 1586 grouping meter-reference { 1587 container meter { 1588 leaf name { 1589 type string ; 1590 mandatory true; 1591 description 1592 "This leaf defines name of the meter referenced"; 1593 } 1594 leaf type { 1595 type identityref { 1596 base meter-type; 1597 } 1598 mandatory true; 1599 description 1600 "This leaf defines type of the meter"; 1601 } 1602 description 1603 "meter reference name"; 1604 } 1605 description 1606 "meter reference"; 1607 } 1609 grouping count { 1610 container count { 1611 if-feature count-feature; 1612 leaf count-action { 1613 type empty; 1614 description 1615 "count action"; 1616 } 1617 description 1618 "the count action"; 1619 } 1620 description 1621 "the count action grouping"; 1622 } 1624 grouping named-counter { 1625 container named-counter { 1626 if-feature named-counter-feature; 1627 leaf count-name-action { 1628 type string; 1629 description 1630 "count action"; 1631 } 1632 description 1633 "the count action"; 1634 } 1635 description 1636 "the count action grouping"; 1637 } 1639 grouping discard { 1640 container discard { 1641 leaf discard { 1642 type empty; 1643 description 1644 "discard action"; 1645 } 1646 description 1647 "discard action"; 1648 } 1649 description 1650 "discard grouping"; 1651 } 1653 grouping priority { 1654 container priority { 1655 leaf priority-level { 1656 type uint8; 1657 description 1658 "priority level"; 1659 } 1660 description 1661 "priority attributes"; 1662 } 1663 description 1664 "priority attributes grouping"; 1665 } 1666 grouping min-rate { 1667 container min-rate { 1668 uses rate-value-unit; 1669 description 1670 "min guaranteed bandwidth"; 1671 } 1672 description 1673 "minimum rate grouping"; 1674 } 1675 grouping dscp-marking { 1676 container dscp { 1677 leaf dscp { 1678 type inet:dscp; 1679 description 1680 "dscp marking"; 1681 } 1682 description 1683 "dscp marking container"; 1684 } 1685 description 1686 "dscp marking grouping"; 1687 } 1688 grouping traffic-group-marking { 1689 container traffic-group { 1690 leaf traffic-group { 1691 type string; 1692 description 1693 "traffic group marking"; 1694 } 1695 description 1696 "traffic group marking container"; 1697 } 1698 description 1699 "traffic group marking grouping"; 1700 } 1701 grouping child-policy { 1702 container child-policy { 1703 if-feature child-policy-feature; 1704 leaf policy-name { 1705 type string; 1706 description 1707 "Hierarchical Policy"; 1708 } 1709 description 1710 "Hierarchical Policy configuration container"; 1711 } 1712 description 1713 "Grouping of Hierarchical Policy configuration"; 1714 } 1715 grouping max-rate { 1716 container max-rate { 1717 uses rate-value-unit; 1718 uses burst; 1719 description 1720 "maximum rate attributes container"; 1721 } 1722 description 1723 "maximum rate attributes"; 1724 } 1725 grouping queue { 1726 container queue { 1727 uses priority; 1728 uses min-rate; 1729 uses max-rate; 1730 container algorithmic-drop { 1731 choice drop-algorithm { 1732 case tail-drop { 1733 container tail-drop { 1734 leaf tail-drop { 1735 type empty; 1736 description 1737 "tail drop algorithm"; 1738 } 1739 description 1740 "Tail Drop configuration container"; 1741 } 1742 description 1743 "Tail Drop choice"; 1744 } 1745 description 1746 "Choice of Drop Algorithm"; 1747 } 1748 description 1749 "Algorithmic Drop configuration container"; 1750 } 1751 description 1752 "Queue configuration container"; 1753 } 1754 description 1755 "Queue grouping"; 1756 } 1757 grouping scheduler { 1758 container scheduler { 1759 uses min-rate; 1760 uses max-rate; 1761 description 1762 "Schedular configuration container"; 1763 } 1764 description 1765 "Schedular configuration grouping"; 1766 } 1767 } 1768 1770 5.4. ietf-qos-target 1772 file "ietf-qos-target@2021-07-12.yang" 1773 module ietf-qos-target { 1774 yang-version 1; 1775 namespace "urn:ietf:params:xml:ns:yang:ietf-qos-target"; 1776 prefix target; 1777 import ietf-interfaces { 1778 prefix if; 1779 } 1780 import ietf-qos-policy { 1781 prefix policy; 1782 } 1783 organization "IETF RTG (Routing Area) Working Group"; 1784 contact 1785 "WG Web: 1786 WG List: 1787 WG Chair: Jurgen Schonwalder 1788 1789 WG Chair: Lou Berger 1790 1791 WG Chair: Kent Watsen 1792 1793 Editor: Aseem Choudhary 1794 1795 Editor: Mahesh Jethanandani 1796 1861 5.5. ietf-diffserv 1863 file "ietf-diffserv@2021-07-12.yang" 1864 module ietf-diffserv { 1865 yang-version 1.1; 1866 namespace "urn:ietf:params:xml:ns:yang:ietf-diffserv"; 1867 prefix diffserv; 1869 import ietf-qos-classifier { 1870 prefix classifier; 1871 } 1872 import ietf-qos-policy { 1873 prefix policy; 1874 } 1875 import ietf-qos-action { 1876 prefix action; 1877 } 1878 import ietf-inet-types { 1879 prefix inet; 1880 } 1882 organization "IETF RTG (Routing Area) Working Group"; 1883 contact 1884 "WG Web: 1885 WG List: 1886 WG Chair: Jurgen Schonwalder 1887 1888 WG Chair: Lou Berger 1889 1890 WG Chair: Kent Watsen 1891 1892 Editor: Aseem Choudhary 1893 1894 Editor: Mahesh Jethanandani 1895 = ../dscp-min" { 2019 error-message 2020 "The dscp-max must be greater than or equal to dscp-min"; 2021 } 2022 description 2023 "maximum value of dscp min-max range"; 2024 } 2025 } 2026 description 2027 "Filter grouping containing list of dscp ranges"; 2028 } 2029 grouping source-ipv4-prefix { 2030 list source-ipv4-prefix { 2031 key "source-ipv4-prefix"; 2032 description 2033 "list of source ipv4 prefix"; 2034 leaf source-ipv4-prefix { 2035 type inet:ipv4-prefix; 2036 description 2037 "source ipv4 prefix"; 2038 } 2039 } 2040 description 2041 "Filter grouping containing list of source ipv4 prefixes"; 2042 } 2043 grouping destination-ipv4-prefix { 2044 list destination-ipv4-prefix { 2045 key "destination-ipv4-prefix"; 2046 description 2047 "list of destination ipv4 prefix"; 2048 leaf destination-ipv4-prefix { 2049 type inet:ipv4-prefix; 2050 description 2051 "destination ipv4 prefix"; 2052 } 2053 } 2054 description 2055 "Filter grouping containing list of destination ipv4 prefix"; 2056 } 2057 grouping source-ipv6-prefix { 2058 list source-ipv6-prefix { 2059 key "source-ipv6-prefix"; 2060 description 2061 "list of source ipv6 prefix"; 2062 leaf source-ipv6-prefix { 2063 type inet:ipv6-prefix; 2064 description 2065 "source ipv6 prefix"; 2066 } 2067 } 2068 description 2069 "Filter grouping containing list of source ipv6 prefixes"; 2070 } 2071 grouping destination-ipv6-prefix { 2072 list destination-ipv6-prefix { 2073 key "destination-ipv6-prefix"; 2074 description 2075 "list of destination ipv4 or ipv6 prefix"; 2076 leaf destination-ipv6-prefix { 2077 type inet:ipv6-prefix; 2078 description 2079 "destination ipv6 prefix"; 2080 } 2081 } 2082 description 2083 "Filter grouping containing list of destination ipv6 prefix"; 2084 } 2085 grouping source-port { 2086 list source-port { 2087 key "source-port-min source-port-max"; 2088 description 2089 "list of ranges of source port"; 2090 leaf source-port-min { 2091 type inet:port-number; 2092 description 2093 "minimum value of source port range"; 2094 } 2095 leaf source-port-max { 2096 type inet:port-number; 2097 must ". >= ../source-port-min" { 2098 error-message 2099 "The source-port-max must be greater than or equal to 2100 source-port-min"; 2101 } 2102 description 2103 "maximum value of source port range"; 2104 } 2105 } 2106 description 2107 "Filter grouping containing list of source port ranges"; 2108 } 2109 grouping destination-port { 2110 list destination-port { 2111 key "destination-port-min destination-port-max"; 2112 description 2113 "list of ranges of destination port"; 2114 leaf destination-port-min { 2115 type inet:port-number; 2116 description 2117 "minimum value of destination port range"; 2118 } 2119 leaf destination-port-max { 2120 type inet:port-number; 2121 must ". >= ../destination-port-min" { 2122 error-message 2123 "The destination-port-max must be greater than or equal to 2124 destination-port-min"; 2125 } 2126 description 2127 "maximum value of destination port range"; 2128 } 2129 } 2130 description 2131 "Filter grouping containing list of destination port ranges"; 2132 } 2133 grouping protocol { 2134 list protocol { 2135 key "protocol-min protocol-max"; 2136 description 2137 "list of ranges of protocol values. Protocol refers to the 2138 value in the protocol field of the ipv4 header and value 2139 in the 'next-header' field of ipv6 header. In ipv6 header, 2140 'next-header' field indicates first extension header or the 2141 protocol in the 'upper-layer' header."; 2142 reference 2143 "RFC 791: Internet Protocol 2144 RFC 8200: Internet Protocol, Version 6 (IPv6) 2145 Specification"; 2146 leaf protocol-min { 2147 type uint8 { 2148 range "0..255"; 2149 } 2150 description 2151 "minimum value of protocol range"; 2152 } 2153 leaf protocol-max { 2154 type uint8 { 2155 range "0..255"; 2156 } 2157 must ". >= ../protocol-min" { 2158 error-message 2159 "The protocol-max must be greater than or equal to 2160 protocol-min"; 2161 } 2162 description 2163 "maximum value of protocol range"; 2164 } 2165 } 2166 description 2167 "Filter grouping containing list of Protocol ranges"; 2168 } 2169 grouping traffic-group { 2170 container traffic-group { 2171 leaf traffic-group-name { 2172 type string ; 2173 description 2174 "This leaf defines name of the traffic group referenced"; 2175 } 2176 description 2177 "traffic group container"; 2178 } 2179 description 2180 "traffic group grouping"; 2181 } 2183 augment "/classifier:classifiers/classifier:classifier" + 2184 "/classifier:filter" { 2185 choice filter-param { 2186 description 2187 "Choice of filter types"; 2189 case dscp { 2190 uses dscp; 2191 description 2192 "Filter containing list of dscp ranges"; 2193 } 2194 case source-ipv4-prefix { 2195 uses source-ipv4-prefix; 2196 description 2197 "Filter containing list of source ipv4 prefixes"; 2198 } 2199 case destination-ipv4-prefix { 2200 uses destination-ipv4-prefix; 2201 description 2202 "Filter containing list of destination ipv4 prefix"; 2203 } 2204 case source-ipv6-prefix { uses source-ipv6-prefix; 2205 description 2206 "Filter containing list of source ipv6 prefixes"; 2207 } 2208 case destination-ipv6-prefix { 2209 uses destination-ipv6-prefix; 2210 description 2211 "Filter containing list of destination ipv6 prefix"; 2212 } 2213 case source-port { 2214 uses source-port; 2215 description 2216 "Filter containing list of source-port ranges"; 2217 } 2218 case destination-port { 2219 uses destination-port; 2220 description 2221 "Filter containing list of destination-port ranges"; 2222 } 2223 case protocol { 2224 uses protocol; 2225 description 2226 "Filter Type Protocol"; 2227 } 2228 case traffic-group { 2229 uses traffic-group; 2230 description 2231 "Filter Type traffic-group"; 2232 } 2233 } 2234 description 2235 "augments diffserv filters to qos classifier"; 2236 } 2237 augment "/policy:policies/policy:policy/policy:classifier" + 2238 "/policy:filter" { 2239 when "../../policy:type = 'diffserv:ipv4-diffserv-policy-type' or 2240 ../../policy:type = 'diffserv:ipv6-diffserv-policy-type' or 2241 ../../policy:type = 'diffserv:diffserv-policy-type'" { 2242 description 2243 "If policy type is v4, v6 or default diffserv, 2244 below filters can be used."; 2245 } 2246 choice filter-params { 2247 description 2248 "Choice of action types"; 2249 case dscp { 2250 uses dscp; 2251 description 2252 "Filter containing list of dscp ranges"; 2253 } 2254 case source-ipv4-prefix { 2255 when "../../policy:type !=" + 2256 "'diffserv:ipv6-diffserv-policy-type'" { 2257 description 2258 "If policy type is v6, this filter cannot be used."; 2259 } 2260 uses source-ipv4-prefix; 2261 description 2262 "Filter containing list of source ipv4 prefixes"; 2263 } 2264 case destination-ipv4-prefix { 2265 when "../../policy:type !=" + 2266 "'diffserv:ipv6-diffserv-policy-type'" { 2267 description 2268 "If policy type is v6, this filter cannot be used."; 2269 } 2270 uses destination-ipv4-prefix; 2271 description 2272 "Filter containing list of destination ipv4 prefix"; 2273 } 2274 case source-ipv6-prefix { 2275 when "../../policy:type !=" + 2276 "'diffserv:ipv4-diffserv-policy-type'" { 2277 description 2278 "If policy type is v4, this filter cannot be used."; 2279 } 2280 uses source-ipv6-prefix; 2281 description 2282 "Filter containing list of source ipv6 prefixes"; 2283 } 2284 case destination-ipv6-prefix { 2285 when "../../policy:type !=" + 2286 "'diffserv:ipv4-diffserv-policy-type'" { 2287 description 2288 "If policy type is v4, this filter cannot be used."; 2289 } 2290 uses destination-ipv6-prefix; 2291 description 2292 "Filter containing list of destination ipv6 prefix"; 2293 } 2294 case source-port { 2295 uses source-port; 2296 description 2297 "Filter containing list of source-port ranges"; 2298 } 2299 case destination-port { 2300 uses destination-port; 2301 description 2302 "Filter containing list of destination-port ranges"; 2303 } 2304 case protocol { 2305 uses protocol; 2306 description 2307 "Filter Type Protocol"; 2308 } 2309 case traffic-group { 2310 uses traffic-group; 2311 description 2312 "Filter Type traffic-group"; 2313 } 2314 } 2315 description 2316 "Augments Diffserv Classifier with common filter types"; 2317 } 2318 augment "/policy:policies/policy:policy/policy:classifier" + 2319 "/policy:action/policy:action-params" { 2320 when "../../policy:type = 'diffserv:ipv4-diffserv-policy-type' or 2321 ../../policy:type = 'diffserv:ipv6-diffserv-policy-type' or 2322 ../../policy:type = 'diffserv:diffserv-policy-type' " { 2323 description 2324 "If policy type is v4, v6 or default diffserv, 2325 the below actions can be used."; 2326 } 2327 description 2328 "Augments Diffserv Policy with action configuration"; 2330 case dscp-marking { 2331 uses action:dscp-marking; 2332 } 2333 case meter-inline { 2334 if-feature action:meter-inline-feature; 2335 uses action:meter; 2336 } 2337 case meter-reference { 2338 if-feature action:meter-reference-feature; 2339 uses action:meter-reference; 2340 } 2341 case traffic-group-marking { 2342 if-feature action:traffic-group-feature; 2343 uses action:traffic-group-marking; 2344 } 2345 case child-policy { 2346 if-feature action:child-policy-feature; 2347 uses action:child-policy; 2348 } 2349 case count { 2350 if-feature action:count-feature; 2351 uses action:count; 2352 } 2353 case named-count { 2354 if-feature action:named-counter-feature; 2355 uses action:named-counter; 2356 } 2357 case queue-inline { 2358 if-feature diffserv-queue-inline-support; 2359 uses action:queue; 2360 } 2361 case scheduler-inline { 2362 if-feature diffserv-scheduler-inline-support; 2363 uses action:scheduler; 2364 } 2365 } 2366 } 2367 2369 5.6. ietf-queue-policy 2371 file "ietf-queue-policy@2021-07-12.yang" 2372 module ietf-queue-policy { 2373 yang-version 1.1; 2374 namespace "urn:ietf:params:xml:ns:yang:ietf-queue-policy"; 2375 prefix queue-policy; 2377 import ietf-qos-policy { 2378 prefix policy; 2379 } 2380 import ietf-qos-action { 2381 prefix action; 2382 } 2383 import ietf-diffserv { 2384 prefix diffserv; 2385 } 2387 organization "IETF RTG (Routing Area) Working Group"; 2388 contact 2389 "WG Web: 2390 WG List: 2391 WG Chair: Jurgen Schonwalder 2392 2393 WG Chair: Lou Berger 2394 2395 WG Chair: Kent Watsen 2396 2397 Editor: Aseem Choudhary 2398 2399 Editor: Mahesh Jethanandani 2400 2518 5.7. ietf-scheduler-policy 2520 file "ietf-scheduler-policy@2021-07-12.yang" 2521 module ietf-scheduler-policy { 2522 yang-version 1.1; 2523 namespace "urn:ietf:params:xml:ns:yang:ietf-scheduler-policy"; 2524 prefix scheduler-policy; 2525 import ietf-qos-classifier { 2526 prefix classifier; 2527 } 2528 import ietf-qos-policy { 2529 prefix policy; 2530 } 2531 import ietf-qos-action { 2532 prefix action; 2533 } 2535 organization "IETF RTG (Routing Area) Working Group"; 2536 contact 2537 "WG Web: 2538 WG List: 2539 WG Chair: Jurgen Schonwalder 2540 2541 WG Chair: Lou Berger 2542 2543 WG Chair: Kent Watsen 2544 2545 Editor: Aseem Choudhary 2546 2547 Editor: Mahesh Jethanandani 2548 2661 6. IANA Considerations 2663 TBD 2665 7. Security Considerations 2667 8. Acknowledgement 2669 The authors wish to thank Ruediger Geib, Fred Baker, Greg Misky, Tom 2670 Petch, Acee Lindem, many others for their helpful comments. 2672 MITRE has approved this document for Public Release, Distribution 2673 Unlimited, with Public Release Case Number 19-3027. 2675 9. References 2677 9.1. Normative References 2679 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2680 Requirement Levels", BCP 14, RFC 2119, 2681 DOI 10.17487/RFC2119, March 1997, 2682 . 2684 [RFC2697] Heinanen, J. and R. Guerin, "A Single Rate Three Color 2685 Marker", RFC 2697, DOI 10.17487/RFC2697, September 1999, 2686 . 2688 [RFC2698] Heinanen, J. and R. Guerin, "A Two Rate Three Color 2689 Marker", RFC 2698, DOI 10.17487/RFC2698, September 1999, 2690 . 2692 [RFC3289] Baker, F., Chan, K., and A. Smith, "Management Information 2693 Base for the Differentiated Services Architecture", 2694 RFC 3289, DOI 10.17487/RFC3289, May 2002, 2695 . 2697 [RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for 2698 the Network Configuration Protocol (NETCONF)", RFC 6020, 2699 DOI 10.17487/RFC6020, October 2010, 2700 . 2702 [RFC6991] Schoenwaelder, J., Ed., "Common YANG Data Types", 2703 RFC 6991, DOI 10.17487/RFC6991, July 2013, 2704 . 2706 [RFC7950] Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language", 2707 RFC 7950, DOI 10.17487/RFC7950, August 2016, 2708 . 2710 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2711 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 2712 May 2017, . 2714 [RFC8342] Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K., 2715 and R. Wilton, "Network Management Datastore Architecture 2716 (NMDA)", RFC 8342, DOI 10.17487/RFC8342, March 2018, 2717 . 2719 [RFC8343] Bjorklund, M., "A YANG Data Model for Interface 2720 Management", RFC 8343, DOI 10.17487/RFC8343, March 2018, 2721 . 2723 9.2. Informative References 2725 [RFC2475] Blake, S., Black, D., Carlson, M., Davies, E., Wang, Z., 2726 and W. Weiss, "An Architecture for Differentiated 2727 Services", RFC 2475, DOI 10.17487/RFC2475, December 1998, 2728 . 2730 [RFC8340] Bjorklund, M. and L. Berger, Ed., "YANG Tree Diagrams", 2731 BCP 215, RFC 8340, DOI 10.17487/RFC8340, March 2018, 2732 . 2734 Appendix A. Company A, Company B and Company C examples 2736 Company A, Company B and Company C Diffserv modules augments all the 2737 filter types of the QoS classifier module as well as the QoS policy 2738 module that allow it to define marking, metering, min-rate, max-rate 2739 actions. Queuing and metering counters are realized by augmenting of 2740 the QoS target module. 2742 A.1. Example of Company A Diffserv Model 2744 The following Company A vendor example augments the qos and diffserv 2745 model, demonstrating some of the following functionality: 2747 - use of template based classifier definitions 2749 - use of single policy type modelling queue, scheduler policy, and a 2750 filter policy. All of these policies either augment the qos policy 2751 or the diffserv modules 2753 - use of inline actions in a policy 2755 - flexibility in marking dscp or metadata at ingress and/or egress. 2757 module example-compa-diffserv { 2758 yang-version 1.1; 2759 namespace "urn:ietf:params:xml:ns:yang:example-compa-diffserv"; 2760 prefix example; 2761 import ietf-qos-classifier { 2762 prefix classifier; 2763 reference "RFC XXXX: YANG Model for QoS"; 2764 } 2765 import ietf-qos-policy { 2766 prefix policy; 2767 reference "RFC XXXX: YANG Model for QoS"; 2768 } 2769 import ietf-qos-action { 2770 prefix action; 2771 reference "RFC XXXX: YANG Model for QoS"; 2772 } 2773 import ietf-diffserv { 2774 prefix diffserv; 2775 reference "RFC XXXX: YANG Model for QoS"; 2776 } 2778 organization "Company A"; 2779 contact 2780 "Editor: XYZ 2781 "; 2782 description 2783 "This module contains a collection of YANG definitions of 2784 companyA diffserv specification extension."; 2785 Copyright (c) 2021 IETF Trust and the persons identified as 2786 authors of the code. All rights reserved. 2787 Redistribution and use in source and binary forms, with or 2788 without modification, is permitted pursuant to, and subject 2789 to the license terms contained in, the Simplified BSD License 2790 set forth in Section 4.c of the IETF Trust's Legal Provisions 2791 Relating to IETF Documents 2792 (http://trustee.ietf.org/license-info). 2794 This version of this YANG module is part of RFC XXXX; see 2795 the RFC itself for full legal notices."; 2797 revision 2021-07-12 { 2798 description 2799 "Initial revision for diffserv actions on network packets"; 2800 reference 2801 "RFC 6020: YANG - A Data Modeling Language for the 2802 Network Configuration Protocol (NETCONF)"; 2803 } 2805 identity default-policy-type { 2806 base policy:policy-type; 2807 description 2808 "This defines default policy-type"; 2810 } 2812 identity qos-group { 2813 base classifier:filter-type; 2814 description 2815 "qos-group filter-type"; 2816 } 2818 grouping qos-group-cfg { 2819 list qos-group-cfg { 2820 key "qos-group-min qos-group-max"; 2821 description 2822 "list of dscp ranges"; 2823 leaf qos-group-min { 2824 type uint8; 2825 description 2826 "Minimum value of qos-group range"; 2827 } 2828 leaf qos-group-max { 2829 type uint8; 2830 must ". >= ../qos-group-min" { 2831 error-message 2832 "The qos-group-max must be greater than or equal to 2833 qos-group-min"; 2834 } 2835 description 2836 "maximum value of qos-group range"; 2837 } 2838 } 2839 description 2840 "Filter containing list of qos-group ranges"; 2841 } 2843 grouping wred-threshold { 2844 container wred-min-thresh { 2845 uses action:threshold; 2846 description 2847 "Minimum threshold"; 2848 } 2849 container wred-max-thresh { 2850 uses action:threshold; 2851 description 2852 "Maximum threshold"; 2853 } 2854 leaf mark-probability { 2855 type uint32 { 2856 range "1..1000"; 2857 } 2858 description 2859 "Mark probability"; 2860 } 2861 description 2862 "WRED threshold attributes"; 2863 } 2865 grouping randomdetect { 2866 leaf exp-weighting-const { 2867 type uint32; 2868 description 2869 "Exponential weighting constant factor for wred profile"; 2870 } 2871 uses wred-threshold; 2872 description 2873 "Random detect attributes"; 2874 } 2876 augment "/classifier:classifiers/" + 2877 "classifier:classifier-entry/" + 2878 "classifier:filter-entry/diffserv:filter-param" { 2879 case qos-group { 2880 uses qos-group-cfg; 2881 description 2882 "Filter containing list of qos-group ranges. 2883 Qos-group represent packet metadata information 2884 in a device. "; 2885 } 2886 description 2887 "augmentation of classifier filters"; 2888 } 2889 augment "/policy:policies/policy:policy-entry/" + 2890 "policy:classifier-entry/" + 2891 "policy:classifier-action-entry-cfg/" + 2892 "policy:action-cfg-params" { 2893 case random-detect { 2894 uses randomdetect; 2895 } 2896 description 2897 "Augment the actions to policy entry"; 2898 } 2900 augment "/policy:policies" + 2901 "/policy:policy-entry" + 2902 "/policy:classifier-entry" + 2903 "/policy:classifier-action-entry-cfg" + 2904 "/policy:action-cfg-params" + 2905 "/diffserv:meter-inline" + 2906 "/diffserv:meter-type" + 2907 "/diffserv:one-rate-two-color-meter-type" + 2908 "/diffserv:one-rate-two-color-meter" + 2909 "/diffserv:conform-action" + 2910 "/diffserv:conform-2color-meter-action-params" + 2911 "/diffserv:conform-2color-meter-action-val" { 2913 description 2914 "augment the one-rate-two-color meter conform 2915 with actions"; 2916 case meter-action-drop { 2917 description 2918 "meter drop"; 2919 uses action:drop; 2920 } 2921 case meter-action-mark-dscp { 2922 description 2923 "meter action dscp marking"; 2924 uses action:dscp-marking; 2925 } 2926 } 2927 augment "/policy:policies" + 2928 "/policy:policy-entry" + 2929 "/policy:classifier-entry" + 2930 "/policy:classifier-action-entry-cfg" + 2931 "/policy:action-cfg-params" + 2932 "/diffserv:meter-inline" + 2933 "/diffserv:meter-type" + 2934 "/diffserv:one-rate-two-color-meter-type" + 2935 "/diffserv:one-rate-two-color-meter" + 2936 "/diffserv:exceed-action" + 2937 "/diffserv:exceed-2color-meter-action-params" + 2938 "/diffserv:exceed-2color-meter-action-val" { 2940 description 2941 "augment the one-rate-two-color meter exceed 2942 with actions"; 2943 case meter-action-drop { 2944 description 2945 "meter drop"; 2946 uses action:drop; 2947 } 2948 case meter-action-mark-dscp { 2949 description 2950 "meter action dscp marking"; 2951 uses action:dscp-marking; 2952 } 2953 } 2954 augment "/policy:policies" + 2955 "/policy:policy-entry" + 2956 "/policy:classifier-entry" + 2957 "/policy:classifier-action-entry-cfg" + 2958 "/policy:action-cfg-params" + 2959 "/diffserv:meter-inline" + 2960 "/diffserv:meter-type" + 2961 "/diffserv:one-rate-tri-color-meter-type" + 2962 "/diffserv:one-rate-tri-color-meter" + 2963 "/diffserv:conform-action" + 2964 "/diffserv:conform-3color-meter-action-params" + 2965 "/diffserv:conform-3color-meter-action-val" { 2967 description 2968 "augment the one-rate-tri-color meter conform 2969 with actions"; 2970 case meter-action-drop { 2971 description 2972 "meter drop"; 2973 uses action:drop; 2974 } 2975 case meter-action-mark-dscp { 2976 description 2977 "meter action dscp marking"; 2978 uses action:dscp-marking; 2979 } 2980 } 2981 augment "/policy:policies" + 2982 "/policy:policy-entry" + 2983 "/policy:classifier-entry" + 2984 "/policy:classifier-action-entry-cfg" + 2985 "/policy:action-cfg-params" + 2986 "/diffserv:meter-inline" + 2987 "/diffserv:meter-type" + 2988 "/diffserv:one-rate-tri-color-meter-type" + 2989 "/diffserv:one-rate-tri-color-meter" + 2990 "/diffserv:exceed-action" + 2991 "/diffserv:exceed-3color-meter-action-params" + 2992 "/diffserv:exceed-3color-meter-action-val" { 2994 description 2995 "augment the one-rate-tri-color meter exceed 2996 with actions"; 2997 case meter-action-drop { 2998 description 2999 "meter drop"; 3000 uses action:drop; 3001 } 3002 case meter-action-mark-dscp { 3003 description 3004 "meter action dscp marking"; 3005 uses action:dscp-marking; 3006 } 3007 } 3008 augment "/policy:policies" + 3009 "/policy:policy-entry" + 3010 "/policy:classifier-entry" + 3011 "/policy:classifier-action-entry-cfg" + 3012 "/policy:action-cfg-params" + 3013 "/diffserv:meter-inline" + 3014 "/diffserv:meter-type" + 3015 "/diffserv:one-rate-tri-color-meter-type" + 3016 "/diffserv:one-rate-tri-color-meter" + 3017 "/diffserv:violate-action" + 3018 "/diffserv:violate-3color-meter-action-params" + 3019 "/diffserv:violate-3color-meter-action-val" { 3020 description 3021 "augment the one-rate-tri-color meter conform 3022 with actions"; 3023 case meter-action-drop { 3024 description 3025 "meter drop"; 3026 uses action:drop; 3027 } 3028 case meter-action-mark-dscp { 3029 description 3030 "meter action dscp marking"; 3031 uses action:dscp-marking; 3032 } 3033 } 3035 augment "/policy:policies" + 3036 "/policy:policy-entry" + 3037 "/policy:classifier-entry" + 3038 "/policy:classifier-action-entry-cfg" + 3039 "/policy:action-cfg-params" + 3040 "/diffserv:meter-inline" + 3041 "/diffserv:meter-type" + 3042 "/diffserv:two-rate-tri-color-meter-type" + 3043 "/diffserv:two-rate-tri-color-meter" + 3044 "/diffserv:conform-action" + 3045 "/diffserv:conform-3color-meter-action-params" + 3046 "/diffserv:conform-3color-meter-action-val" { 3048 description 3049 "augment the one-rate-tri-color meter conform 3050 with actions"; 3051 case meter-action-drop { 3052 description 3053 "meter drop"; 3054 uses action:drop; 3055 } 3056 case meter-action-mark-dscp { 3057 description 3058 "meter action dscp marking"; 3059 uses action:dscp-marking; 3060 } 3061 } 3062 augment "/policy:policies" + 3063 "/policy:policy-entry" + 3064 "/policy:classifier-entry" + 3065 "/policy:classifier-action-entry-cfg" + 3066 "/policy:action-cfg-params" + 3067 "/diffserv:meter-inline" + 3068 "/diffserv:meter-type" + 3069 "/diffserv:two-rate-tri-color-meter-type" + 3070 "/diffserv:two-rate-tri-color-meter" + 3071 "/diffserv:exceed-action" + 3072 "/diffserv:exceed-3color-meter-action-params" + 3073 "/diffserv:exceed-3color-meter-action-val" { 3075 description 3076 "augment the two-rate-tri-color meter exceed 3077 with actions"; 3078 case meter-action-drop { 3079 description 3080 "meter drop"; 3081 uses action:drop; 3082 } 3083 case meter-action-mark-dscp { 3084 description 3085 "meter action dscp marking"; 3086 uses action:dscp-marking; 3087 } 3088 } 3089 augment "/policy:policies" + 3090 "/policy:policy-entry" + 3091 "/policy:classifier-entry" + 3092 "/policy:classifier-action-entry-cfg" + 3093 "/policy:action-cfg-params" + 3094 "/diffserv:meter-inline" + 3095 "/diffserv:meter-type" + 3096 "/diffserv:two-rate-tri-color-meter-type" + 3097 "/diffserv:two-rate-tri-color-meter" + 3098 "/diffserv:violate-action" + 3099 "/diffserv:violate-3color-meter-action-params" + 3100 "/diffserv:violate-3color-meter-action-val" { 3101 description 3102 "augment the two-rate-tri-color meter violate 3103 with actions"; 3104 case meter-action-drop { 3105 description 3106 "meter drop"; 3107 uses action:drop; 3108 } 3109 case meter-action-mark-dscp { 3110 description 3111 "meter action dscp marking"; 3112 uses action:dscp-marking; 3113 } 3114 } 3115 augment "/policy:policies" + 3116 "/policy:policy-entry" + 3117 "/policy:classifier-entry" + 3118 "/policy:classifier-action-entry-cfg" + 3119 "/policy:action-cfg-params" + 3120 "/diffserv:meter-inline" + 3121 "/diffserv:meter-type" + 3122 "/diffserv:one-rate-two-color-meter-type" + 3123 "/diffserv:one-rate-two-color-meter" { 3124 description 3125 "augment the one-rate-two-color meter with" + 3126 "color classifiers"; 3127 container conform-color { 3128 uses classifier:classifier-entry-generic-attr; 3129 description 3130 "conform color classifier container"; 3131 } 3132 container exceed-color { 3133 uses classifier:classifier-entry-generic-attr; 3134 description 3135 "exceed color classifier container"; 3136 } 3137 } 3138 augment "/policy:policies" + 3139 "/policy:policy-entry" + 3140 "/policy:classifier-entry" + 3141 "/policy:classifier-action-entry-cfg" + 3142 "/policy:action-cfg-params" + 3143 "/diffserv:meter-inline" + 3144 "/diffserv:meter-type" + 3145 "/diffserv:one-rate-tri-color-meter-type" + 3146 "/diffserv:one-rate-tri-color-meter" { 3147 description 3148 "augment the one-rate-tri-color meter with" + 3149 "color classifiers"; 3150 container conform-color { 3151 uses classifier:classifier-entry-generic-attr; 3152 description 3153 "conform color classifier container"; 3154 } 3155 container exceed-color { 3156 uses classifier:classifier-entry-generic-attr; 3157 description 3158 "exceed color classifier container"; 3159 } 3160 container violate-color { 3161 uses classifier:classifier-entry-generic-attr; 3162 description 3163 "violate color classifier container"; 3164 } 3165 } 3166 augment "/policy:policies" + 3167 "/policy:policy-entry" + 3168 "/policy:classifier-entry" + 3169 "/policy:classifier-action-entry-cfg" + 3170 "/policy:action-cfg-params" + 3171 "/diffserv:meter-inline" + 3172 "/diffserv:meter-type" + 3173 "/diffserv:two-rate-tri-color-meter-type" + 3174 "/diffserv:two-rate-tri-color-meter" { 3175 description 3176 "augment the two-rate-tri-color meter with" + 3177 "color classifiers"; 3178 container conform-color { 3179 uses classifier:classifier-entry-generic-attr; 3180 description 3181 "conform color classifier container"; 3182 } 3183 container exceed-color { 3184 uses classifier:classifier-entry-generic-attr; 3185 description 3186 "exceed color classifier container"; 3187 } 3188 container violate-color { 3189 uses classifier:classifier-entry-generic-attr; 3190 description 3191 "violate color classifier container"; 3192 } 3193 } 3195 } 3197 A.2. Example of Company B Diffserv Model 3199 The following vendor example augments the qos and diffserv model, 3200 demonstrating some of the following functionality: 3202 - use of inline classifier definitions (defined inline in the policy 3203 vs referencing an externally defined classifier) 3205 - use of mulitple policy types, e.g. a queue policy, a scheduler 3206 policy, and a filter policy. All of these policies either augment 3207 the qos policy or the diffserv modules 3209 - use of a queue module, which uses and extends the queue grouping 3210 from the ietf-qos-action module 3212 - use of meter templates (v.s. meter inline) 3214 - use of internal meta data for classification and marking 3216 module example-compb-diffserv-filter-policy { 3217 yang-version 1.1; 3218 namespace "urn:ietf:params:xml:ns:yang:" + 3219 "example-compb-diffserv-filter-policy"; 3220 prefix compb-filter-policy; 3222 import ietf-qos-classifier { 3223 prefix classifier; 3224 reference "RFC XXXX: YANG Model for QoS"; 3225 } 3226 import ietf-qos-policy { 3227 prefix policy; 3228 reference "RFC XXXX: YANG Model for QoS"; 3229 } 3230 import ietf-qos-action { 3231 prefix action; 3232 reference "RFC XXXX: YANG Model for QoS"; 3233 } 3234 import ietf-diffserv { 3235 prefix diffserv; 3236 reference "RFC XXXX: YANG Model for QoS"; 3237 } 3239 organization "Company B"; 3240 contact 3241 "Editor: XYZ 3242 "; 3244 description 3245 "This module contains a collection of YANG definitions for 3246 configuring diffserv specification implementations. 3247 Copyright (c) 2021 IETF Trust and the persons identified as 3248 authors of the code. All rights reserved. 3249 Redistribution and use in source and binary forms, with or 3250 without modification, is permitted pursuant to, and subject 3251 to the license terms contained in, the Simplified BSD License 3252 set forth in Section 4.c of the IETF Trust's Legal Provisions 3253 Relating to IETF Documents 3254 (http://trustee.ietf.org/license-info). 3256 This version of this YANG module is part of RFC XXXX; see 3257 the RFC itself for full legal notices."; 3259 revision 2021-07-12 { 3260 description 3261 "Initial revision of Company B diffserv policy"; 3262 reference "RFC XXXX"; 3263 } 3265 /************************************************* 3266 * Classification types 3267 *************************************************/ 3269 identity forwarding-class { 3270 base classifier:filter-type; 3271 description 3272 "Forwarding class filter type"; 3273 } 3275 identity internal-loss-priority { 3276 base classifier:filter-type; 3277 description 3278 "Internal loss priority filter type"; 3279 } 3281 grouping forwarding-class-cfg { 3282 list forwarding-class-cfg { 3283 key "forwarding-class"; 3284 description 3285 "list of forwarding-classes"; 3286 leaf forwarding-class { 3287 type string; 3288 description 3289 "Forwarding class name"; 3290 } 3292 } 3293 description 3294 "Filter containing list of forwarding classes"; 3295 } 3297 grouping loss-priority-cfg { 3298 list loss-priority-cfg { 3299 key "loss-priority"; 3300 description 3301 "list of loss-priorities"; 3302 leaf loss-priority { 3303 type enumeration { 3304 enum high { 3305 description "High Loss Priority"; 3306 } 3307 enum medium-high { 3308 description "Medium-high Loss Priority"; 3309 } 3310 enum medium-low { 3311 description "Medium-low Loss Priority"; 3312 } 3313 enum low { 3314 description "Low Loss Priority"; 3315 } 3316 } 3317 description 3318 "Loss-priority"; 3319 } 3320 } 3321 description 3322 "Filter containing list of loss priorities"; 3323 } 3325 augment "/policy:policies" + 3326 "/policy:policy-entry" + 3327 "/policy:classifier-entry" + 3328 "/policy:filter-entry" + 3329 "/diffserv:filter-params" { 3330 case forwarding-class { 3331 uses forwarding-class-cfg; 3332 description 3333 "Filter Type Internal-loss-priority"; 3334 } 3335 case internal-loss-priority { 3336 uses loss-priority-cfg; 3337 description 3338 "Filter Type Internal-loss-priority"; 3339 } 3340 description 3341 "Augments Diffserv Classifier with vendor" + 3342 " specific types"; 3343 } 3345 /************************************************* 3346 * Actions 3347 *************************************************/ 3349 identity mark-fwd-class { 3350 base policy:action-type; 3351 description 3352 "mark forwarding class action type"; 3353 } 3355 identity mark-loss-priority { 3356 base policy:action-type; 3357 description 3358 "mark loss-priority action type"; 3359 } 3361 grouping mark-fwd-class { 3362 container mark-fwd-class-cfg { 3363 leaf forwarding-class { 3364 type string; 3365 description 3366 "Forwarding class name"; 3367 } 3368 description 3369 "mark-fwd-class container"; 3370 } 3371 description 3372 "mark-fwd-class grouping"; 3373 } 3375 grouping mark-loss-priority { 3376 container mark-loss-priority-cfg { 3377 leaf loss-priority { 3378 type enumeration { 3379 enum high { 3380 description "High Loss Priority"; 3381 } 3382 enum medium-high { 3383 description "Medium-high Loss Priority"; 3384 } 3385 enum medium-low { 3386 description "Medium-low Loss Priority"; 3387 } 3388 enum low { 3389 description "Low Loss Priority"; 3390 } 3391 } 3392 description 3393 "Loss-priority"; 3394 } 3395 description 3396 "mark-loss-priority container"; 3397 } 3398 description 3399 "mark-loss-priority grouping"; 3400 } 3402 identity exceed-2color-meter-action-drop { 3403 base action:exceed-2color-meter-action-type; 3404 description 3405 "drop action type in a meter"; 3406 } 3408 identity meter-action-mark-fwd-class { 3409 base action:exceed-2color-meter-action-type; 3410 description 3411 "mark forwarding class action type"; 3412 } 3414 identity meter-action-mark-loss-priority { 3415 base action:exceed-2color-meter-action-type; 3416 description 3417 "mark loss-priority action type"; 3418 } 3420 identity violate-3color-meter-action-drop { 3421 base action:violate-3color-meter-action-type; 3422 description 3423 "drop action type in a meter"; 3424 } 3426 augment "/policy:policies/policy:policy-entry/" + 3427 "policy:classifier-entry/" + 3428 "policy:classifier-action-entry-cfg/" + 3429 "policy:action-cfg-params" { 3430 case mark-fwd-class { 3431 uses mark-fwd-class; 3432 description 3433 "Mark forwarding class in the packet"; 3434 } 3435 case mark-loss-priority { 3436 uses mark-loss-priority; 3437 description 3438 "Mark loss priority in the packet"; 3439 } 3440 case discard { 3441 uses action:discard; 3442 description 3443 "Discard action"; 3444 } 3445 description 3446 "Augments common diffserv policy actions"; 3447 } 3449 augment "/action:meter-template" + 3450 "/action:meter-entry" + 3451 "/action:meter-type" + 3452 "/action:one-rate-tri-color-meter-type" + 3453 "/action:one-rate-tri-color-meter" { 3454 leaf one-rate-color-aware { 3455 type boolean; 3456 description 3457 "This defines if the meter is color-aware"; 3458 } 3459 } 3460 augment "/action:meter-template" + 3461 "/action:meter-entry" + 3462 "/action:meter-type" + 3463 "/action:two-rate-tri-color-meter-type" + 3464 "/action:two-rate-tri-color-meter" { 3465 leaf two-rate-color-aware { 3466 type boolean; 3467 description 3468 "This defines if the meter is color-aware"; 3469 } 3470 } 3472 /* example of augmenting a meter template with a 3473 /* vendor specific action */ 3474 augment "/action:meter-template" + 3475 "/action:meter-entry" + 3476 "/action:meter-type" + 3477 "/action:one-rate-two-color-meter-type" + 3478 "/action:one-rate-two-color-meter" + 3479 "/action:exceed-action" + 3480 "/action:exceed-2color-meter-action-params" + 3481 "/action:exceed-2color-meter-action-val" { 3483 case exceed-2color-meter-action-drop { 3484 description 3485 "meter drop"; 3486 uses action:drop; 3487 } 3488 case meter-action-mark-fwd-class { 3489 uses mark-fwd-class; 3490 description 3491 "Mark forwarding class in the packet"; 3492 } 3493 case meter-action-mark-loss-priority { 3494 uses mark-loss-priority; 3495 description 3496 "Mark loss priority in the packet"; 3497 } 3498 } 3500 augment "/action:meter-template" + 3501 "/action:meter-entry" + 3502 "/action:meter-type" + 3503 "/action:two-rate-tri-color-meter-type" + 3504 "/action:two-rate-tri-color-meter" + 3505 "/action:violate-action" + 3506 "/action:violate-3color-meter-action-params" + 3507 "/action:violate-3color-meter-action-val" { 3508 case exceed-3color-meter-action-drop { 3509 description 3510 "meter drop"; 3511 uses action:drop; 3512 } 3514 description 3515 "Augment the actions to the two-color meter"; 3516 } 3518 augment "/action:meter-template" + 3519 "/action:meter-entry" + 3520 "/action:meter-type" + 3521 "/action:one-rate-tri-color-meter-type" + 3522 "/action:one-rate-tri-color-meter" + 3523 "/action:violate-action" + 3524 "/action:violate-3color-meter-action-params" + 3525 "/action:violate-3color-meter-action-val" { 3526 case exceed-3color-meter-action-drop { 3527 description 3528 "meter drop"; 3529 uses action:drop; 3530 } 3531 description 3532 "Augment the actions to basic meter"; 3533 } 3535 } 3536 module example-compb-queue-policy { 3537 yang-version 1.1; 3538 namespace "urn:ietf:params:xml:ns:yang:example-compb-queue-policy"; 3539 prefix queue-plcy; 3541 import ietf-qos-classifier { 3542 prefix classifier; 3543 reference "RFC XXXX: YANG Model for QoS"; 3544 } 3545 import ietf-qos-policy { 3546 prefix policy; 3547 reference "RFC XXXX: YANG Model for QoS"; 3548 } 3550 organization "Company B"; 3551 contact 3552 "Editor: XYZ 3553 "; 3555 description 3556 "This module defines a queue policy. The classification 3557 is based on aforwarding class, and the actions are queues. 3558 Copyright (c) 2021 IETF Trust and the persons identified as 3559 authors of the code. All rights reserved. 3560 Redistribution and use in source and binary forms, with or 3561 without modification, is permitted pursuant to, and subject 3562 to the license terms contained in, the Simplified BSD License 3563 set forth in Section 4.c of the IETF Trust's Legal Provisions 3564 Relating to IETF Documents 3565 (http://trustee.ietf.org/license-info). 3566 This version of this YANG module is part of RFC XXXX; see 3567 the RFC itself for full legal notices."; 3569 revision 2021-07-12 { 3570 description 3571 "Latest revision of Company B queue policy"; 3572 reference "RFC XXXX"; 3573 } 3575 identity forwarding-class { 3576 base classifier:filter-type; 3577 description 3578 "Forwarding class filter type"; 3580 } 3582 grouping forwarding-class-cfg { 3583 leaf forwarding-class-cfg { 3584 type string; 3585 description 3586 "forwarding-class name"; 3587 } 3588 description 3589 "Forwarding class filter"; 3590 } 3592 augment "/policy:policies" + 3593 "/policy:policy-entry" + 3594 "/policy:classifier-entry" + 3595 "/policy:filter-entry" { 3596 /* Does NOT support "logical-not" of forwarding class. 3597 Use "must"? */ 3598 choice filter-params { 3599 description 3600 "Choice of filters"; 3601 case forwarding-class-cfg { 3602 uses forwarding-class-cfg; 3603 description 3604 "Filter Type Internal-loss-priority"; 3605 } 3606 } 3607 description 3608 "Augments Diffserv Classifier with fwd class filter"; 3609 } 3611 identity compb-queue { 3612 base policy:action-type; 3613 description 3614 "compb-queue action type"; 3615 } 3617 grouping compb-queue-name { 3618 container queue-name { 3619 leaf name { 3620 type string; 3621 description 3622 "Queue class name"; 3623 } 3624 description 3625 "compb queue container"; 3626 } 3627 description 3628 "compb-queue grouping"; 3629 } 3631 augment "/policy:policies" + 3632 "/policy:policy-entry" + 3633 "/policy:classifier-entry" + 3634 "/policy:classifier-action-entry-cfg" { 3635 choice action-cfg-params { 3636 description 3637 "Choice of action types"; 3638 case compb-queue { 3639 uses compb-queue-name; 3640 } 3641 } 3642 description 3643 "Augment the queue actions to queue policy entry"; 3644 } 3645 } 3647 module example-compb-queue { 3648 yang-version 1.1; 3649 namespace "urn:ietf:params:xml:ns:yang:ietf-compb-queue"; 3650 prefix compb-queue; 3652 import ietf-qos-action { 3653 prefix action; 3654 reference "RFC XXXX: YANG Model for QoS"; 3655 } 3657 organization "Company B"; 3658 contact 3659 "Editor: XYZ 3660 "; 3662 description 3663 "This module describes a compb queue module. This is a 3664 template for a queue within a queue policy, referenced 3665 by name. 3667 This version of this YANG module is part of RFC XXXX; see 3668 the RFC itself for full legal notices."; 3670 revision 2021-07-12 { 3671 description 3672 "Latest revision of diffserv based classifier"; 3673 reference "RFC XXXX"; 3674 } 3675 container compb-queue { 3676 description 3677 "Queue used in compb architecture"; 3678 leaf name { 3679 type string; 3680 description 3681 "A unique name identifying this queue"; 3682 } 3683 uses action:queue; 3684 container excess-rate { 3685 choice excess-rate-type { 3686 case percent { 3687 leaf excess-rate-percent { 3688 type uint32 { 3689 range "1..100"; 3690 } 3691 description 3692 "excess-rate-percent"; 3693 } 3694 } 3695 case proportion { 3696 leaf excess-rate-poroportion { 3697 type uint32 { 3698 range "1..1000"; 3699 } 3700 description 3701 "excess-rate-poroportion"; 3702 } 3703 } 3704 description 3705 "Choice of excess-rate type"; 3706 } 3707 description 3708 "Excess rate value"; 3709 } 3710 leaf excess-priority { 3711 type enumeration { 3712 enum high { 3713 description "High Loss Priority"; 3714 } 3715 enum medium-high { 3716 description "Medium-high Loss Priority"; 3717 } 3718 enum medium-low { 3719 description "Medium-low Loss Priority"; 3720 } 3721 enum low { 3722 description "Low Loss Priority"; 3724 } 3725 enum none { 3726 description "No excess priority"; 3727 } 3728 } 3729 description 3730 "Priority of excess (above guaranted rate) traffic"; 3731 } 3732 container buffer-size { 3733 choice buffer-size-type { 3734 case percent { 3735 leaf buffer-size-percent { 3736 type uint32 { 3737 range "1..100"; 3738 } 3739 description 3740 "buffer-size-percent"; 3741 } 3742 } 3743 case temporal { 3744 leaf buffer-size-temporal { 3745 type uint64; 3746 units "microsecond"; 3747 description 3748 "buffer-size-temporal"; 3749 } 3750 } 3751 case remainder { 3752 leaf buffer-size-remainder { 3753 type empty; 3754 description 3755 "use remaining of buffer"; 3756 } 3757 } 3758 description 3759 "Choice of buffer size type"; 3760 } 3761 description 3762 "Buffer size value"; 3763 } 3764 } 3766 augment 3767 "/compb-queue" + 3768 "/queue-cfg" + 3769 "/algorithmic-drop-cfg" + 3770 "/drop-algorithm" { 3771 case random-detect { 3772 list drop-profile-list { 3773 key "priority"; 3774 description 3775 "map of priorities to drop-algorithms"; 3776 leaf priority { 3777 type enumeration { 3778 enum any { 3779 description "Any priority mapped here"; 3780 } 3781 enum high { 3782 description "High Priority Packet"; 3783 } 3784 enum medium-high { 3785 description "Medium-high Priority Packet"; 3786 } 3787 enum medium-low { 3788 description "Medium-low Priority Packet"; 3789 } 3790 enum low { 3791 description "Low Priority Packet"; 3792 } 3793 } 3794 description 3795 "Priority of guaranteed traffic"; 3796 } 3797 leaf drop-profile { 3798 type string; 3799 description 3800 "drop profile to use for this priority"; 3801 } 3802 } 3803 } 3804 description 3805 "compb random detect drop algorithm config"; 3806 } 3807 } 3809 module example-compb-scheduler-policy { 3810 yang-version 1.1; 3811 namespace "urn:ietf:params:xml:ns:yang:" + 3812 "example-compb-scheduler-policy"; 3813 prefix scheduler-plcy; 3815 import ietf-qos-action { 3816 prefix action; 3817 reference "RFC XXXX: YANG Model for QoS"; 3818 } 3819 import ietf-qos-policy { 3820 prefix policy; 3821 reference "RFC XXXX: YANG Model for QoS"; 3822 } 3824 organization "Company B"; 3825 contact 3826 "Editor: XYZ 3827 "; 3829 description 3830 "This module defines a scheduler policy. The classification 3831 is based on classifier-any, and the action is a scheduler."; 3833 revision 2021-07-12 { 3834 description 3835 "Initial revision of Company B Scheduler policy"; 3836 reference "RFC XXXX"; 3837 } 3839 identity queue-policy { 3840 base policy:action-type; 3841 description 3842 "forwarding-class-queue action type"; 3843 } 3845 grouping queue-policy-name { 3846 container compb-queue-policy-name { 3847 leaf name { 3848 type string; 3849 description 3850 "Queue policy name"; 3851 } 3852 description 3853 "compb-queue-policy container"; 3854 } 3855 description 3856 "compb-queue policy grouping"; 3857 } 3859 augment "/policy:policies" + 3860 "/policy:policy-entry" + 3861 "/policy:classifier-entry" + 3862 "/policy:classifier-action-entry-cfg" { 3863 choice action-cfg-params { 3864 case schedular { 3865 uses action:schedular; 3866 } 3867 case queue-policy { 3868 uses queue-policy-name; 3869 } 3870 description 3871 "Augment the scheduler policy with a queue policy"; 3872 } 3873 } 3874 } 3876 A.3. Example of Company C Diffserv Model 3878 Company C vendor augmentation is based on Ericsson's implementation 3879 differentiated QoS. This implementation first sorts traffic based on 3880 a classifier, which can sort traffic into one or more traffic 3881 forwarding classes. Then, a policer or meter policy references the 3882 classifier and its traffic forwarding classes to specify different 3883 service levels for each traffic forwarding class. 3885 Because each classifier sorts traffic into one or more traffic 3886 forwarding classes, this type of classifier does not align with ietf- 3887 qos-classifier.yang, which defines one traffic forwarding class per 3888 classifier. Additionally, Company C's policing and metering policies 3889 relies on the classifier's pre-defined traffic forwarding classes to 3890 provide differentiated services, rather than redefining the patterns 3891 within a policing or metering policy, as is defined in ietf- 3892 diffserv.yang. 3894 Due to these differences, even though Company C uses all the building 3895 blocks of classifier and policy, Company C's augmentation does not 3896 use ietf-diffserv.yang to provide differentiated service levels. 3897 Instead, Company C's augmentation uses the basic building blocks, 3898 ietf-qos-policy.yang to provide differentiated services. 3900 module example-compc-qos-policy { 3901 yang-version 1.1; 3902 namespace "urn:ietf:params:xml:ns:yang:example-compc-qos-policy"; 3903 prefix "compcqos"; 3905 import ietf-qos-policy { 3906 prefix "pol"; 3907 reference "RFC XXXX: YANG Model for QoS"; 3908 } 3910 import ietf-qos-action { 3911 prefix "action"; 3912 reference "RFC XXXX: YANG Model for QoS"; 3913 } 3914 organization "Company C"; 3915 contact "Company C Editor: XYZ "; 3916 description 3917 "This module contains a collection of YANG definitions for 3918 configuring diffserv specification implementations. 3919 Copyright (c) 2021 IETF Trust and the persons identified as 3920 authors of the code. All rights reserved. 3921 Redistribution and use in source and binary forms, with or 3922 without modification, is permitted pursuant to, and subject 3923 to the license terms contained in, the Simplified BSD License 3924 set forth in Section 4.c of the IETF Trust's Legal Provisions 3925 Relating to IETF Documents 3926 (http://trustee.ietf.org/license-info). 3928 This version of this YANG module is part of RFC XXXX; see 3929 the RFC itself for full legal notices."; 3931 revision 2021-07-12 { 3932 description "Initial version"; 3933 reference "RFC XXXX"; 3934 } 3936 /* identities */ 3938 identity compc-qos-policy { 3939 base pol:policy-type; 3940 description "compc-specific policy base type"; 3941 } 3943 identity mdrr-queuing-policy { 3944 base compc-qos-policy; 3945 description "compc-specific MDRR policy type"; 3946 } 3948 identity pwfq-queuing-policy { 3949 base compc-qos-policy; 3950 description "compc-specific queuing policy type"; 3951 } 3953 identity policing-policy { 3954 base compc-qos-policy; 3955 description "compc-specific policing policy type"; 3956 } 3958 identity metering-policy { 3959 base compc-qos-policy; 3960 description "compc-specific metering policy type"; 3961 } 3962 identity forwarding-policy { 3963 base compc-qos-policy; 3964 description "compc-specific forwarding policy type"; 3965 } 3967 identity overhead-profile-policy { 3968 base compc-qos-policy; 3969 description "compc-specific overhead profile policy type"; 3970 } 3972 identity resource-profile-policy { 3973 base compc-qos-policy; 3974 description "compc-specific resource profile policy type"; 3975 } 3977 identity protocol-rate-limit-policy { 3978 base compc-qos-policy; 3979 description "compc-specific protocol rate limit policy type"; 3980 } 3982 identity compc-qos-action { 3983 base pol:action-type; 3984 description "compc-specificc qos action base type"; 3985 } 3987 /* groupings */ 3989 grouping redirect-action-grp { 3990 description "Redirection options grouping"; 3991 container redirect { 3992 description "Redirect options"; 3993 } 3994 } 3996 /* deviations */ 3998 deviation "/pol:policies/pol:policy-entry" { 3999 deviate add { 4000 must "pol:type = compc-qos-policy" { 4001 description 4002 "Only policy types drived from compc-qos-policy " + 4003 "are supported"; 4004 } 4005 } 4006 } 4008 deviation "/pol:policies/pol:policy-entry/pol:classifier-entry" { 4009 deviate add { 4010 must "../per-class-action = 'true'" { 4011 description 4012 "Only policies with per-class actions have classifiers"; 4013 } 4014 must "((../compcqos:sub-type != " + 4015 "'compcqos:mdrr-queuing-policy') and " + 4016 " (../compcqos:sub-type != " + 4017 "'compcqos:pwfq-queuing-policy')) or " + 4018 "(((../compcqos:sub-type = " + 4019 "'compcqos:mdrr-queuing-policy') or " + 4020 " (../compcqos:sub-type = " + 4021 "'compcqos:pwfq-queueing-policy')) and " + 4022 " ((classifier-entry-name = '0') or " + 4023 " (classifier-entry-name = '1') or " + 4024 " (classifier-entry-name = '2') or " + 4025 " (classifier-entry-name = '3') or " + 4026 " (classifier-entry-name = '4') or " + 4027 " (classifier-entry-name = '5') or " + 4028 " (classifier-entry-name = '6') or " + 4029 " (classifier-entry-name = '7') or " + 4030 " (classifier-entry-name = '8')))" { 4031 description 4032 "MDRR queuing policy's or PWFQ queuing policy's " + 4033 "classifier-entry-name is limited to the listed values"; 4034 } 4035 } 4036 } 4038 deviation "/pol:policies/pol:policy-entry/pol:classifier-entry" + 4039 "/pol:classifier-action-entry-cfg" { 4040 deviate add { 4041 must "action-type = 'compcqos:compc-qos-action'" { 4042 description 4043 "Only compc-qos-action is allowed"; 4044 } 4045 max-elements 1; 4046 } 4047 } 4049 /* augments */ 4051 augment "/pol:policies/pol:policy-entry" { 4052 when "pol:policy-type = 'compc-qos-policy'" { 4053 description 4054 "Additional nodes only for diffserv-policy"; 4055 } 4056 description "Additional diffserv-policy nodes"; 4057 leaf sub-type { 4058 type identityref { 4059 base compc-qos-policy; 4060 } 4061 mandatory true; 4062 description "Policy sub-type. The value of this leaf must " + 4063 "not change once configured"; 4064 } 4065 leaf per-class-action { 4066 type boolean; 4067 must "(((. = 'true') and " + 4068 " ((../compcqos:sub-type = " + 4069 "'compcqos:policing-policy') or " + 4070 " (../compcqos:sub-type = " + 4071 "'compcqos:metering-policy') or " + 4072 " (../compcqos:sub-type = " + 4073 "'compcqos:mdrr-queuing-policy') or " + 4074 " (../compcqos:sub-type = " + 4075 "'compcqos:pwfq-queuing-policy') or " + 4076 " (../compcqos:sub-type = " + 4077 "'compcqos:forwarding-policy'))) or " + 4078 " ((. = 'false') and " + 4079 " ((../compcqos:sub-type = " + 4080 "'compcqos:overhead-profile-policy') or " + 4081 " (../compcqos:sub-type = " + 4082 "'compcqos:resource-profile-policy') or " + 4083 " (../compcqos:sub-type = " + 4084 "'compcqos:protocol-rate-limit-policy'))))" { 4085 description 4086 "Only certain policies have per-class action"; 4087 } 4088 mandatory true; 4089 description "Per-class action"; 4090 } 4091 container traffic-classifier { 4092 when "../compcqos:sub-type = 'compcqos:policing-policy' or " + 4093 "../compcqos:sub-type = 'compcqos:metering-policy' or " + 4094 "../compcqos:sub-type = 'compcqos:forwarding-policy'" { 4095 description 4096 "A classifier for policing-policy or metering-policy"; 4097 } 4098 presence true; 4099 leaf name { 4100 type string; 4101 mandatory true; 4102 description 4103 "Traffic classifier name"; 4104 } 4105 leaf type { 4106 type enumeration { 4107 enum 'internal-dscp-only-classifier' { 4108 value 0; 4109 description 4110 "Classify traffic based on (internal) dscp only"; 4111 } 4112 enum 'ipv4-header-based-classifier' { 4113 value 1; 4114 description 4115 "Classify traffic based on IPv4 packet header fields"; 4116 } 4117 enum 'ipv6-header-based-classifier' { 4118 value 2; 4119 description 4120 "Classify traffic based on IPv6 packet header fields"; 4121 } 4122 } 4123 mandatory true; 4124 description 4125 "Traffic classifier type"; 4126 } 4127 description "Traffic classifier"; 4128 } 4129 container traffic-queue { 4130 when "(../compcqos:sub-type = " + 4131 "'compcqos:mdrr-queuing-policy') or " + 4132 "(../compcqos:sub-type = " + 4133 "'compcqos:pwfq-queuing-policy')" { 4134 description 4135 "Queuing policy properties"; 4136 } 4137 leaf queue-map { 4138 type string; 4139 description 4140 "Traffic queue map for queuing policy"; 4141 } 4142 description "Traffic queue"; 4143 } 4144 container overhead-profile { 4145 when "../compcqos:sub-type = " + 4146 "'compcqos:overhead-profile-policy'" { 4147 description 4148 "Overhead profile policy properties"; 4149 } 4150 description "Overhead profile"; 4151 } 4152 container resource-profile { 4153 when "../compcqos:sub-type = " + 4154 "'compcqos:resource-profile-policy'" { 4155 description 4156 "Resource profile policy properties"; 4157 } 4158 description "Resource profile"; 4159 } 4160 container protocol-rate-limit { 4161 when "../compcqos:sub-type = " + 4162 "'compcqos:protocol-rate-limit-policy'" { 4163 description 4164 "Protocol rate limit policy properties"; 4165 } 4166 description "Protocol rate limit"; 4167 } 4168 } 4170 augment "/pol:policies/pol:policy-entry/pol:classifier-entry" + 4171 "/pol:classifier-action-entry-cfg/pol:action-cfg-params" { 4172 when "../../pol:policy-type = 'compc-qos-policy'" { 4173 description 4174 "Configurations for a classifier-policy-type policy"; 4175 } 4176 case metering-or-policing-policy { 4177 when "../../compcqos:sub-type = " + 4178 "'compcqos:policing-policy' or " + 4179 "../../compcqos:sub-type = 'compcqos:metering-policy'" { 4180 } 4181 container dscp-marking { 4182 uses action:dscp-marking; 4183 description "DSCP marking"; 4184 } 4185 container precedence-marking { 4186 uses action:dscp-marking; 4187 description "Precedence marking"; 4188 } 4189 container priority-marking { 4190 uses action:priority; 4191 description "Priority marking"; 4192 } 4193 container rate-limiting { 4194 uses action:one-rate-two-color-meter; 4195 description "Rate limiting"; 4196 } 4197 } 4198 case mdrr-queuing-policy { 4199 when "../../compcqos:sub-type = " + 4200 "'compcqos:mdrr-queuing-policy'" { 4201 description 4202 "MDRR queue handling properties for the traffic " + 4203 "classified into current queue"; 4204 } 4205 leaf mdrr-queue-weight { 4206 type uint8 { 4207 range "20..100"; 4208 } 4209 units percentage; 4210 description "MDRR queue weight"; 4211 } 4212 } 4213 case pwfq-queuing-policy { 4214 when "../../compcqos:sub-type = " + 4215 "'compcqos:pwfq-queuing-policy'" { 4216 description 4217 "PWFQ queue handling properties for traffic " + 4218 "classified into current queue"; 4219 } 4220 leaf pwfq-queue-weight { 4221 type uint8 { 4222 range "20..100"; 4223 } 4224 units percentage; 4225 description "Priority-based weighted fair queue weight"; 4226 } 4227 leaf pwfq-queue-priority { 4228 type uint8; 4229 description "Priority-based weighted fair queue priority"; 4230 } 4231 leaf pwfq-queue-rate { 4232 type uint8; 4233 description "Priority-based weighted fair queue rate"; 4234 } 4235 } 4236 case forwarding-policy { 4237 when "../../compcqos:sub-type = 'compcqos:forwarding-policy'" { 4238 description 4239 "Forward policy handling properties for traffic " + 4240 "in this classifier"; 4241 } 4242 uses redirect-action-grp; 4243 } 4244 description 4245 "Add the classify action configuration"; 4246 } 4247 } 4249 Authors' Addresses 4251 Aseem Choudhary 4252 Cisco Systems 4253 170 W. Tasman Drive 4254 San Jose, CA 95134 4255 US 4257 Email: asechoud@cisco.com 4259 Mahesh Jethanandani 4260 VMware 4262 Email: mjethanandani@gmail.com 4264 Norm Strahle 4265 Juniper Networks 4266 1194 North Mathilda Avenue 4267 Sunnyvale, CA 94089 4268 US 4270 Email: nstrahle@juniper.net 4272 Ebben Aries 4273 Juniper Networks 4274 1194 North Mathilda Avenue 4275 Sunnyvale, CA 94089 4276 US 4278 Email: exa@juniper.net 4280 Ing-Wher Chen 4281 The MITRE Corporation 4283 Email: ingwherchen@mitre.org