idnits 2.17.1 draft-asechoud-rtgwg-qos-model-07.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- == It seems as if not all pages are separated by form feeds - found 0 form feeds but 87 pages Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack an IANA Considerations section. (See Section 2.2 of https://www.ietf.org/id-info/checklist for how to handle the case when there are no actions for IANA.) Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Line 182 has weird spacing: '...cal-not boo...' == Line 204 has weird spacing: '...cal-not boo...' == Line 206 has weird spacing: '...on-type ide...' == Line 308 has weird spacing: '...cy-type ide...' == Line 309 has weird spacing: '...cy-name str...' == (28 more instances...) -- The document date (July 14, 2018) is 2112 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) ** Downref: Normative reference to an Informational RFC: RFC 2697 ** Downref: Normative reference to an Informational RFC: RFC 2698 ** Obsolete normative reference: RFC 7223 (Obsoleted by RFC 8343) Summary: 4 errors (**), 0 flaws (~~), 8 warnings (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group A. Choudhary 3 Internet-Draft M. Jethanandani 4 Intended status: Standards Track Cisco Systems 5 Expires: January 15, 2019 N. Strahle 6 E. Aries 7 Juniper Networks 8 I. Chen 9 Jabil 10 July 14, 2018 12 YANG Model for QoS 13 draft-asechoud-rtgwg-qos-model-07 15 Abstract 17 This document describes a YANG model for Quality of Service (QoS) 18 configuration and operational parameters. 20 Status of This Memo 22 This Internet-Draft is submitted in full conformance with the 23 provisions of BCP 78 and BCP 79. 25 Internet-Drafts are working documents of the Internet Engineering 26 Task Force (IETF). Note that other groups may also distribute 27 working documents as Internet-Drafts. The list of current Internet- 28 Drafts is at https://datatracker.ietf.org/drafts/current/. 30 Internet-Drafts are draft documents valid for a maximum of six months 31 and may be updated, replaced, or obsoleted by other documents at any 32 time. It is inappropriate to use Internet-Drafts as reference 33 material or to cite them other than as "work in progress." 35 This Internet-Draft will expire on January 15, 2019. 37 Copyright Notice 39 Copyright (c) 2018 IETF Trust and the persons identified as the 40 document authors. All rights reserved. 42 This document is subject to BCP 78 and the IETF Trust's Legal 43 Provisions Relating to IETF Documents 44 (https://trustee.ietf.org/license-info) in effect on the date of 45 publication of this document. Please review these documents 46 carefully, as they describe your rights and restrictions with respect 47 to this document. Code Components extracted from this document must 48 include Simplified BSD License text as described in Section 4.e of 49 the Trust Legal Provisions and are provided without warranty as 50 described in the Simplified BSD License. 52 Table of Contents 54 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 55 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 56 3. QoS Model Design . . . . . . . . . . . . . . . . . . . . . . 3 57 4. DiffServ Model Design . . . . . . . . . . . . . . . . . . . . 3 58 5. Modules Tree Structure . . . . . . . . . . . . . . . . . . . 4 59 6. Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 60 6.1. IETF-QOS-CLASSIFIER . . . . . . . . . . . . . . . . . . . 13 61 6.2. IETF-QOS-POLICY . . . . . . . . . . . . . . . . . . . . . 17 62 6.3. IETF-QOS-ACTION . . . . . . . . . . . . . . . . . . . . . 19 63 6.4. IETF-QOS-TARGET . . . . . . . . . . . . . . . . . . . . . 37 64 6.5. IETF-DIFFSERV . . . . . . . . . . . . . . . . . . . . . . 39 65 6.6. IETF-QUEUE-POLICY . . . . . . . . . . . . . . . . . . . . 49 66 6.7. IETF-SCHEDULER-POLICY . . . . . . . . . . . . . . . . . . 52 67 7. Security Considerations . . . . . . . . . . . . . . . . . . . 55 68 8. Acknowledgement . . . . . . . . . . . . . . . . . . . . . . . 55 69 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 55 70 9.1. Normative References . . . . . . . . . . . . . . . . . . 55 71 9.2. Informative References . . . . . . . . . . . . . . . . . 56 72 Appendix A. Company A, Company B and Company C examples . . . . 56 73 A.1. Example of Company A Diffserv Model . . . . . . . . . . . 56 74 A.2. Example of Company B Diffserv Model . . . . . . . . . . . 65 75 A.3. Example of Company C Diffserv Model . . . . . . . . . . . 79 76 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 86 78 1. Introduction 80 This document defines a base YANG [RFC6020] data module for Quality 81 of Service (QoS) configuration parameters. Differentiated Services 82 (DiffServ) module is an augmentation of the base QoS model. Remote 83 Procedure Calls (RPC) or notification definition is currently not 84 part of this document and will be added later if necessary. QoS base 85 modules define a basic building blocks to define a classifier, 86 policy, action and target. The base modules have been augmented to 87 include packet match fields and action parameters to define the 88 DiffServ module. Queues and schedulers are stitched as part of 89 diffserv policy itself or separate modules are defined for creating 90 Queue policy and Scheduling policy. The DiffServ model is based on 91 DiffServ architecture, and various references have been made to 92 available standard architecture documents. 94 DiffServ is a preferred approach for network service providers to 95 offer services to different customers based on their network Quality- 96 of-Service (QoS) objectives. The traffic streams are differentiated 97 based on DiffServ Code Points (DSCP) carried in the IP header of each 98 packet. The DSCP markings are applied by upstream node or by the 99 edge router on entry to the DiffServ network. 101 2. Terminology 103 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 104 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 105 document are to be interpreted as described in [RFC2119]. 107 3. QoS Model Design 109 A classifier consists of packets which may be grouped when a logical 110 set of rules are applied on different packet header fields. The 111 grouping may be based on different values or range of values of same 112 packet header field, presence or absence of some values or range of 113 values of a packet field or a combination thereof. The QoS 114 classifier is defined in the ietf-qos-classifier module. 116 A classifier entry contains one or more packet conditioning 117 functions. A packet conditioning function is typically based on 118 direction of traffic and may drop, mark or delay network packets. A 119 set of classifier entries with corresponding conditioning functions 120 when arranged in order of priority represents a QoS policy. A QoS 121 policy may contain one or more classifier entries. These are defined 122 in ietf-qos-policy module. 124 Actions are configured in line with respect to the policy module. 125 These include marking, dropping or shaping. Actions are defined in 126 the ietf-qos-action module. 128 A meter qualifies if the traffic arrival rate is based on agreed upon 129 rate and variability. A meter is modeled based on commonly used 130 alogrithms in industry, Single Rate Tri Color Marking (srTCM) 131 [RFC2697] meter, Two Rate Tri Color Marking (trTCM) [RFC2698] meter, 132 and Single Rate Two Color Marking meter. Different vendors can 133 extend it with other types of meters as well. 135 4. DiffServ Model Design 137 DiffServ architecture [RFC3289] and [RFC2475] describe the 138 architecture as a simple model where traffic entering a network is 139 classified and possibly conditioned at the boundary of the network 140 and assigned a different Behavior Aggregate (BA). Each BA is 141 identified by a specific value of DSCP, and is used to select a Per 142 Hop Behavior (PHB). 144 The packet classification policy identifies the subset of traffic 145 which may receive a DiffServ by being conditioned or mapped. Packet 146 classifiers select packets within a stream based on the content of 147 some portion of the packet header. There are two types of 148 classifiers, the BA classifier, and the Multi-Field (MF) classifier 149 which selects packets based on a value which is combination of one or 150 more header fields. In the ietf-diffserv module, this is realized by 151 augmenting the QoS classification module. 153 Traffic conditioning includes metering, shaping and/or marking. A 154 meter is used to measure the traffic against a given traffic profile. 155 The traffic profile specifies the temporal property of the traffic. 156 A packet that arrives is first determined to be in or out of the 157 profile, which will result in the action of marked, dropped or 158 shaped. This is realized in vendor specific modules based on the 159 parameters defined in action module. The metering parameters are 160 augmented to the QoS policy module when metering is defined inline, 161 and to the metering template when metering profile is referred in 162 policy module. 164 5. Modules Tree Structure 166 This document defines five YANG modules - four QoS base modules and 167 one DiffServ module. 169 ietf-qos-classifier consists of classifier entries identified by a 170 classifier entry name. Each entry MAY contain a list of filter 171 entries. When no filter entry is present in a classifier entry, it 172 matches all traffic. 174 module: ietf-qos-classifier 175 +--rw classifiers 176 +--rw classifier-entry* [classifier-entry-name] 177 +--rw classifier-entry-name string 178 +--rw classifier-entry-descr? string 179 +--rw classifier-entry-filter-operation? identityref 180 +--rw filter-entry* [filter-type filter-logical-not] 181 +--rw filter-type identityref 182 +--rw filter-logical-not boolean 184 An ietf-qos-policy module contains list of policy objects identified 185 by a policy name and policy type which MUST be provided. With 186 different values of policy types, each vendor MAY define their own 187 construct of policy for different QoS functionalities. Each vendor 188 MAY augment classifier entry in a policy definition with a set of 189 actions. 191 module: ietf-qos-policy 192 +--rw policies 193 +--rw policy-entry* [policy-name policy-type] 194 +--rw policy-name string 195 +--rw policy-type identityref 196 +--rw policy-descr? string 197 +--rw classifier-entry* [classifier-entry-name] 198 +--rw classifier-entry-name string 199 +--rw classifier-entry-inline? boolean 200 +--rw classifier-entry-filter-oper? identityref 201 +--rw filter-entry* [filter-type filter-logical-not] 202 {policy-inline-classifier-config}? 203 | +--rw filter-type identityref 204 | +--rw filter-logical-not boolean 205 +--rw classifier-action-entry-cfg* [action-type] 206 +--rw action-type identityref 207 +--rw (action-cfg-params)? 209 ietf-qos-action module contains grouping of set of QoS actions. 210 These include metering, marking, dropping and shaping. Marking sets 211 DiffServ codepoint value in the classified packet. Color-aware and 212 Color-blind meters are augmented by vendor specific modules based on 213 the parameters defined in action module. 215 module: ietf-qos-action 216 +--rw meter-template 217 +--rw meter-entry* [meter-name] {meter-template-support}? 218 +--rw meter-name string 219 +--rw (meter-type)? 220 +--:(one-rate-two-color-meter-type) 221 | +--rw one-rate-two-color-meter 222 | +--rw committed-rate-value? uint64 223 | +--rw committed-rate-unit? identityref 224 | +--rw committed-burst-value? uint64 225 | +--rw committed-burst-unit? identityref 226 | +--rw conform-action 227 | | +--rw conform-2color-meter-action-params* 228 [conform-2color-meter-action-type] 229 | | +--rw conform-2color-meter-action-type 230 identityref 231 | | +--rw (conform-2color-meter-action-val)? 232 | +--rw exceed-action 233 | +--rw exceed-2color-meter-action-params* 234 [exceed-2color-meter-action-type] 235 | +--rw exceed-2color-meter-action-type 236 identityref 237 | +--rw (exceed-2color-meter-action-val)? 238 +--:(one-rate-tri-color-meter-type) 239 | +--rw one-rate-tri-color-meter 240 | +--rw committed-rate-value? uint64 241 | +--rw committed-rate-unit? identityref 242 | +--rw committed-burst-value? uint64 243 | +--rw committed-burst-unit? identityref 244 | +--rw excess-burst-value? uint64 245 | +--rw excess-burst-unit? identityref 246 | +--rw conform-action 247 | | +--rw conform-3color-meter-action-params* 248 [conform-3color-meter-action-type] 249 | | +--rw conform-3color-meter-action-type 250 identityref 251 | | +--rw (conform-3color-meter-action-val)? 252 | +--rw exceed-action 253 | | +--rw exceed-3color-meter-action-params* 254 [exceed-3color-meter-action-type] 255 | | +--rw exceed-3color-meter-action-type 256 identityref 257 | | +--rw (exceed-3color-meter-action-val)? 258 | +--rw violate-action 259 | +--rw violate-3color-meter-action-params* 260 [violate-3color-meter-action-type] 261 | +--rw violate-3color-meter-action-type 262 identityref 263 | +--rw (violate-3color-meter-action-val)? 264 +--:(two-rate-tri-color-meter-type) 265 +--rw two-rate-tri-color-meter 266 +--rw committed-rate-value? uint64 267 +--rw committed-rate-unit? identityref 268 +--rw committed-burst-value? uint64 269 +--rw committed-burst-unit? identityref 270 +--rw peak-rate-value? uint64 271 +--rw peak-rate-unit? identityref 272 +--rw peak-burst-value? uint64 273 +--rw peak-burst-unit? identityref 274 +--rw conform-action 275 | +--rw conform-3color-meter-action-params* 276 [conform-3color-meter-action-type] 277 | +--rw conform-3color-meter-action-type 278 identityref 279 | +--rw (conform-3color-meter-action-val)? 280 +--rw exceed-action 281 | +--rw exceed-3color-meter-action-params* 282 [exceed-3color-meter-action-type] 283 | +--rw exceed-3color-meter-action-type 284 identityref 285 | +--rw (exceed-3color-meter-action-val)? 286 +--rw violate-action 287 +--rw violate-3color-meter-action-params* 288 [violate-3color-meter-action-type] 289 +--rw violate-3color-meter-action-type 290 identityref 291 +--rw (violate-3color-meter-action-val)? 293 ietf-qos-target module contains reference of qos-policy and augments 294 ietf-interfaces [RFC7223] module. A single policy of a particular 295 policy-type can be applied on an interface in each direction of 296 traffic. Policy-type is of type identity and is populated in a 297 vendor specific manner. This way it provides greater flexibility for 298 each vendor to define different policy types each with its own 299 capabilities and restrictions. 301 Classifier, metering and queuing counters are associated with a 302 target. 304 module: ietf-qos-target 305 augment /if:interfaces/if:interface: 306 +--rw qos-target-entry* [direction policy-type] 307 +--rw direction identityref 308 +--rw policy-type identityref 309 +--rw policy-name string 311 Diffserv module augments QoS classifier module. Many of the YANG 312 types defined in [RFC6991] are represented as leafs in the classifier 313 module. 315 Metering and marking actions are realized by augmenting the QoS 316 policy-module. Any queuing, AQM and scheduling actions are part of 317 vendor specific augmentation. Statistics are realized by augmenting 318 the QoS target module. 320 module: ietf-diffserv 321 augment /classifier:classifiers/classifier:classifier-entry + 322 /classifier:filter-entry: 323 +--rw (filter-param)? 324 +--:(dscp) 325 | +--rw dscp-cfg* [dscp-min dscp-max] 326 | +--rw dscp-min inet:dscp 327 | +--rw dscp-max inet:dscp 328 +--:(source-ipv4-address) 329 | +--rw source-ipv4-address-cfg* [source-ipv4-addr] 330 | +--rw source-ipv4-addr inet:ipv4-prefix 331 +--:(destination-ipv4-address) 332 | +--rw destination-ipv4-address-cfg* [destination-ipv4-addr] 333 | +--rw destination-ipv4-addr inet:ipv4-prefix 334 +--:(source-ipv6-address) 335 | +--rw source-ipv6-address-cfg* [source-ipv6-addr] 336 | +--rw source-ipv6-addr inet:ipv6-prefix 337 +--:(destination-ipv6-address) 338 | +--rw destination-ipv6-address-cfg* [destination-ipv6-addr] 339 | +--rw destination-ipv6-addr inet:ipv6-prefix 340 +--:(source-port) 341 | +--rw source-port-cfg* [source-port-min source-port-max] 342 | +--rw source-port-min inet:port-number 343 | +--rw source-port-max inet:port-number 344 +--:(destination-port) 345 | +--rw destination-port-cfg* 346 [destination-port-min destination-port-max] 347 | +--rw destination-port-min inet:port-number 348 | +--rw destination-port-max inet:port-number 349 +--:(protocol) 350 | +--rw protocol-cfg* [protocol-min protocol-max] 351 | +--rw protocol-min uint8 352 | +--rw protocol-max uint8 353 +--:(traffic-group) 354 +--rw traffic-group-cfg 355 +--rw traffic-group-name? string 356 augment /policy:policies/policy:policy-entry + 357 /policy:classifier-entry/policy:filter-entry: 358 +--rw (filter-params)? 359 +--:(dscp) 360 | +--rw dscp-cfg* [dscp-min dscp-max] 361 | +--rw dscp-min inet:dscp 362 | +--rw dscp-max inet:dscp 363 +--:(source-ipv4-address) 364 | +--rw source-ipv4-address-cfg* [source-ipv4-addr] 365 | +--rw source-ipv4-addr inet:ipv4-prefix 366 +--:(destination-ipv4-address) 367 | +--rw destination-ipv4-address-cfg* [destination-ipv4-addr] 368 | +--rw destination-ipv4-addr inet:ipv4-prefix 369 +--:(source-ipv6-address) 370 | +--rw source-ipv6-address-cfg* [source-ipv6-addr] 371 | +--rw source-ipv6-addr inet:ipv6-prefix 372 +--:(destination-ipv6-address) 373 | +--rw destination-ipv6-address-cfg* [destination-ipv6-addr] 374 | +--rw destination-ipv6-addr inet:ipv6-prefix 375 +--:(source-port) 376 | +--rw source-port-cfg* [source-port-min source-port-max] 377 | +--rw source-port-min inet:port-number 378 | +--rw source-port-max inet:port-number 379 +--:(destination-port) 380 | +--rw destination-port-cfg* 381 [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-cfg* [protocol-min protocol-max] 387 | +--rw protocol-min uint8 388 | +--rw protocol-max uint8 389 +--:(traffic-group) 390 +--rw traffic-group-cfg 391 +--rw traffic-group-name? string 392 augment /policy:policies/policy:policy-entry + 393 /policy:classifier-entry + 394 /policy:classifier-action-entry-cfg + 395 /policy:action-cfg-params: 396 +--:(dscp-marking) 397 | +--rw dscp-cfg 398 | +--rw dscp? inet:dscp 399 +--:(meter-inline) {action:meter-inline-feature}? 400 | +--rw (meter-type)? 401 | +--:(one-rate-two-color-meter-type) 402 | | +--rw one-rate-two-color-meter 403 | | +--rw committed-rate-value? uint64 404 | | +--rw committed-rate-unit? identityref 405 | | +--rw committed-burst-value? uint64 406 | | +--rw committed-burst-unit? identityref 407 | | +--rw conform-action 408 | | | +--rw conform-2color-meter-action-params* 409 [conform-2color-meter-action-type] 410 | | | +--rw conform-2color-meter-action-type 411 identityref 412 | | | +--rw (conform-2color-meter-action-val)? 413 | | +--rw exceed-action 414 | | +--rw exceed-2color-meter-action-params* 415 [exceed-2color-meter-action-type] 416 | | +--rw exceed-2color-meter-action-type 417 identityref 418 | | +--rw (exceed-2color-meter-action-val)? 419 | +--:(one-rate-tri-color-meter-type) 420 | | +--rw one-rate-tri-color-meter 421 | | +--rw committed-rate-value? uint64 422 | | +--rw committed-rate-unit? identityref 423 | | +--rw committed-burst-value? uint64 424 | | +--rw committed-burst-unit? identityref 425 | | +--rw excess-burst-value? uint64 426 | | +--rw excess-burst-unit? identityref 427 | | +--rw conform-action 428 | | | +--rw conform-3color-meter-action-params* 429 [conform-3color-meter-action-type] 430 | | | +--rw conform-3color-meter-action-type 431 identityref 432 | | | +--rw (conform-3color-meter-action-val)? 433 | | +--rw exceed-action 434 | | | +--rw exceed-3color-meter-action-params* 435 [exceed-3color-meter-action-type] 436 | | | +--rw exceed-3color-meter-action-type 437 identityref 438 | | | +--rw (exceed-3color-meter-action-val)? 439 | | +--rw violate-action 440 | | +--rw violate-3color-meter-action-params* 441 [violate-3color-meter-action-type] 442 | | +--rw violate-3color-meter-action-type 443 identityref 444 | | +--rw (violate-3color-meter-action-val)? 445 | +--:(two-rate-tri-color-meter-type) 446 | +--rw two-rate-tri-color-meter 447 | +--rw committed-rate-value? uint64 448 | +--rw committed-rate-unit? identityref 449 | +--rw committed-burst-value? uint64 450 | +--rw committed-burst-unit? identityref 451 | +--rw peak-rate-value? uint64 452 | +--rw peak-rate-unit? identityref 453 | +--rw peak-burst-value? uint64 454 | +--rw peak-burst-unit? identityref 455 | +--rw conform-action 456 | | +--rw conform-3color-meter-action-params* 457 [conform-3color-meter-action-type] 458 | | +--rw conform-3color-meter-action-type 459 identityref 460 | | +--rw (conform-3color-meter-action-val)? 461 | +--rw exceed-action 462 | | +--rw exceed-3color-meter-action-params* 463 [exceed-3color-meter-action-type] 464 | | +--rw exceed-3color-meter-action-type 465 identityref 466 | | +--rw (exceed-3color-meter-action-val)? 467 | +--rw violate-action 468 | +--rw violate-3color-meter-action-params* 469 [violate-3color-meter-action-type] 470 | +--rw violate-3color-meter-action-type 471 identityref 472 | +--rw (violate-3color-meter-action-val)? 473 +--:(meter-reference) {action:meter-reference-feature}? 474 | +--rw meter-reference-cfg 475 | +--rw meter-reference-name string 476 | +--rw meter-type identityref 477 +--:(traffic-group-marking) {action:traffic-group-feature}? 478 | +--rw traffic-group-cfg 479 | +--rw traffic-group? string 480 +--:(child-policy) {action:child-policy-feature}? 481 | +--rw child-policy-cfg {child-policy-feature}? 482 | +--rw policy-name? string 483 +--:(count) {action:count-feature}? 484 | +--rw count-cfg {count-feature}? 485 | +--rw count-action? empty 486 +--:(named-count) {action:named-counter-feature}? 487 | +--rw named-counter-cfg {named-counter-feature}? 488 | +--rw count-name-action? string 489 +--:(queue-inline) {diffserv-queue-inline-support}? 490 | +--rw queue-cfg 491 | +--rw priority-cfg 492 | | +--rw priority-level? uint8 493 | +--rw min-rate-cfg 494 | | +--rw rate-value? uint64 495 | | +--rw rate-unit? identityref 496 | +--rw max-rate-cfg 497 | | +--rw rate-value? uint64 498 | | +--rw rate-unit? identityref 499 | | +--rw burst-value? uint64 500 | | +--rw burst-unit? identityref 501 | +--rw algorithmic-drop-cfg 502 | +--rw (drop-algorithm)? 503 | +--:(tail-drop) 504 | +--rw tail-drop-cfg 505 | +--rw tail-drop-alg? empty 506 +--:(scheduler-inline) {diffserv-scheduler-inline-support}? 507 +--rw scheduler-cfg 508 +--rw min-rate-cfg 509 | +--rw rate-value? uint64 510 | +--rw rate-unit? identityref 511 +--rw max-rate-cfg 512 +--rw rate-value? uint64 513 +--rw rate-unit? identityref 514 +--rw burst-value? uint64 515 +--rw burst-unit? identityref 517 module: ietf-queue-policy 518 +--rw queue-template {queue-policy-support}? 519 +--rw name? string 520 +--rw queue-cfg 521 +--rw priority-cfg 522 | +--rw priority-level? uint8 523 +--rw min-rate-cfg 524 | +--rw rate-value? uint64 525 | +--rw rate-unit? identityref 526 +--rw max-rate-cfg 527 | +--rw rate-value? uint64 528 | +--rw rate-unit? identityref 529 | +--rw burst-value? uint64 530 | +--rw burst-unit? identityref 531 +--rw algorithmic-drop-cfg 532 +--rw (drop-algorithm)? 533 +--:(tail-drop) 534 +--rw tail-drop-cfg 535 +--rw tail-drop-alg? empty 536 augment /policy:policies/policy:policy-entry + 537 /policy:classifier-entry/policy:filter-entry: 538 +--rw (filter-params)? {queue-policy-support}? 539 +--:(traffic-group-name) 540 +--rw traffic-group-reference-cfg 541 +--rw traffic-group-name string 542 augment /policy:policies/policy:policy-entry + 543 /policy:classifier-entry + 544 /policy:classifier-action-entry-cfg + 545 /policy:action-cfg-params: 546 +--:(queue-template-name) 547 {queue-template-support,queue-policy-support}? 548 | +--rw queue-template-reference-cfg 549 | +--rw queue-template-name string 550 +--:(queue-inline) 551 {queue-inline-support,queue-policy-support}? 552 +--rw queue-cfg 553 +--rw priority-cfg 554 | +--rw priority-level? uint8 555 +--rw min-rate-cfg 556 | +--rw rate-value? uint64 557 | +--rw rate-unit? identityref 558 +--rw max-rate-cfg 559 | +--rw rate-value? uint64 560 | +--rw rate-unit? identityref 561 | +--rw burst-value? uint64 562 | +--rw burst-unit? identityref 563 +--rw algorithmic-drop-cfg 564 +--rw (drop-algorithm)? 565 +--:(tail-drop) 566 +--rw tail-drop-cfg 567 +--rw tail-drop-alg? empty 569 module: ietf-scheduler-policy 570 augment /policy:policies/policy:policy-entry + 571 /policy:classifier-entry/policy:filter-entry: 572 +--rw (filter-params)? 573 +--:(filter-match-all) 574 +--rw match-all-cfg 575 +--rw match-all-action? empty 576 augment /policy:policies/policy:policy-entry + 577 /policy:classifier-entry + 578 /policy:classifier-action-entry-cfg + 579 /policy:action-cfg-params: 580 +--:(scheduler) 581 | +--rw scheduler-cfg 582 | +--rw min-rate-cfg 583 | | +--rw rate-value? uint64 584 | | +--rw rate-unit? identityref 585 | +--rw max-rate-cfg 586 | +--rw rate-value? uint64 587 | +--rw rate-unit? identityref 588 | +--rw burst-value? uint64 589 | +--rw burst-unit? identityref 590 +--:(queue-policy-name) 591 +--rw queue-policy-name 592 +--rw queue-policy string 594 6. Modules 596 6.1. IETF-QOS-CLASSIFIER 598 file "ietf-qos-classifier@2018-03-03.yang" 599 module ietf-qos-classifier { 600 yang-version 1.1; 601 namespace "urn:ietf:params:xml:ns:yang:ietf-qos-classifier"; 602 prefix classifier; 604 organization 605 "IETF RTG (Routing Area) Working Group"; 606 contact 607 "WG Web: 608 WG List: 609 WG Chair: Chris Bowers 610 611 WG Chair: Jeff Tantsura 612 613 Editor: Aseem Choudhary 614 615 Editor: Mahesh Jethanandani 616 618 Editor: Norm Strahle 619 "; 620 description 621 "This module contains a collection of YANG definitions for 622 configuring qos specification implementations. 623 Copyright (c) 2014 IETF Trust and the persons identified as 624 authors of the code. All rights reserved. 625 Redistribution and use in source and binary forms, with or 626 without modification, is permitted pursuant to, and subject 627 to the license terms contained in, the Simplified BSD License 628 set forth in Section 4.c of the IETF Trust's Legal Provisions 629 Relating to IETF Documents 630 (http://trustee.ietf.org/license-info). 631 This version of this YANG module is part of RFC XXXX; see 632 the RFC itself for full legal notices."; 634 revision 2018-03-03 { 635 description 636 "Latest revision of qos base classifier module"; 637 reference "RFC XXXX"; 638 } 640 feature policy-inline-classifier-config { 641 description 642 " This feature allows classifier configuration 643 directly under policy."; 644 } 646 feature classifier-template-feature { 647 description 648 " This feature allows classifier as template configuration 649 in a policy."; 650 } 652 feature match-any-filter-type-support { 653 description 654 " This feature allows classifier configuration 655 directly under policy."; 656 } 658 identity filter-type { 659 description 660 "This is identity of base filter-type"; 661 } 663 identity classifier-entry-filter-operation-type { 664 description 665 "Classifier entry filter logical operation"; 667 } 669 identity match-all-filter { 670 base classifier-entry-filter-operation-type; 671 description 672 "Classifier entry filter logical AND operation"; 673 } 675 identity match-any-filter { 676 base classifier-entry-filter-operation-type; 677 if-feature "match-any-filter-type-support"; 678 description 679 "Classifier entry filter logical OR operation"; 680 } 682 grouping filters { 683 description 684 "Filters types in a Classifier entry"; 685 leaf filter-type { 686 type identityref { 687 base filter-type; 688 } 689 description 690 "This leaf defines type of the filter"; 691 } 692 leaf filter-logical-not { 693 type boolean; 694 description 695 " 696 This is logical-not operator for a filter. When true, it 697 indicates filter looks for absence of a pattern defined 698 by the filter 699 "; 700 } 701 } 703 grouping classifier-entry-generic-attr { 704 description 705 " 706 Classifier generic attributes like name, 707 description, operation type 708 "; 709 leaf classifier-entry-name { 710 type string; 711 description 712 "classifier entry name"; 713 } 714 leaf classifier-entry-descr { 715 type string; 716 description 717 "classifier entry description statement"; 718 } 719 leaf classifier-entry-filter-operation { 720 type identityref { 721 base classifier-entry-filter-operation-type; 722 } 723 default "match-all-filter"; 724 description 725 "Filters are applicable as match-any or match-all filters"; 726 } 727 } 729 grouping classifier-entry-inline-attr { 730 description 731 "attributes of inline classifier in a policy"; 732 leaf classifier-entry-inline { 733 type boolean; 734 default "false"; 735 description 736 "Indication of inline classifier entry"; 737 } 738 leaf classifier-entry-filter-oper { 739 type identityref { 740 base classifier-entry-filter-operation-type; 741 } 742 default "match-all-filter"; 743 description 744 "Filters are applicable as match-any or match-all filters"; 745 } 746 list filter-entry { 747 if-feature "policy-inline-classifier-config"; 748 must " ../classifier-entry-inline = 'true' " { 749 description 750 "For inline filter configuration, inline attributemust 751 be true"; 752 } 753 key "filter-type filter-logical-not"; 754 uses filters; 755 description 756 "Filters configured inline in a policy"; 757 } 758 } 760 container classifiers { 761 if-feature "classifier-template-feature"; 762 description 763 "list of classifier entry"; 764 list classifier-entry { 765 key "classifier-entry-name"; 766 description 767 "each classifier entry contains a list of filters"; 768 uses classifier-entry-generic-attr; 769 list filter-entry { 770 key "filter-type filter-logical-not"; 771 uses filters; 772 description 773 "Filter entry configuration"; 774 } 775 } 776 } 777 } 778 780 6.2. IETF-QOS-POLICY 782 file "ietf-qos-policy@2016-03-03.yang" 783 module ietf-qos-policy { 784 yang-version 1; 785 namespace "urn:ietf:params:xml:ns:yang:ietf-qos-policy"; 786 prefix policy; 787 import ietf-qos-classifier { 788 prefix classifier; 789 } 790 organization "IETF RTG (Routing Area) Working Group"; 791 contact 792 "WG Web: 793 WG List: 794 WG Chair: Chris Bowers 795 796 WG Chair: Jeff Tantsura 797 798 Editor: Aseem Choudhary 799 800 Editor: Mahesh Jethanandani 801 802 Editor: Norm Strahle 803 "; 804 description 805 "This module contains a collection of YANG definitions for 806 configuring qos specification implementations. 807 Copyright (c) 2014 IETF Trust and the persons identified as 808 authors of the code. All rights reserved. 809 Redistribution and use in source and binary forms, with or 810 without modification, is permitted pursuant to, and subject 811 to the license terms contained in, the Simplified BSD License 812 set forth in Section 4.c of the IETF Trust's Legal Provisions 813 Relating to IETF Documents 814 (http://trustee.ietf.org/license-info). 815 This version of this YANG module is part of RFC XXXX; see 816 the RFC itself for full legal notices."; 817 revision 2016-03-03 { 818 description 819 "Latest revision of qos policy"; 820 reference "RFC XXXX"; 821 } 822 identity policy-type { 823 description 824 "This base identity type defines policy-types"; 825 } 826 grouping policy-generic-attr { 827 description 828 "Policy Attributes"; 829 leaf policy-name { 830 type string; 831 description 832 "policy name"; 833 } 834 leaf policy-type { 835 type identityref { 836 base policy-type; 837 } 838 description 839 "policy type"; 840 } 841 leaf policy-descr { 842 type string; 843 description 844 "policy description"; 845 } 846 } 847 identity action-type { 848 description 849 "This base identity type defines action-types"; 850 } 851 grouping classifier-action-entry-cfg { 852 description 853 "List of Configuration of classifier & associated actions"; 854 list classifier-action-entry-cfg { 855 key "action-type"; 856 ordered-by user; 857 description 858 "Configuration of classifier & associated actions"; 860 leaf action-type { 861 type identityref { 862 base action-type; 863 } 864 description 865 "This defines action type "; 866 } 867 choice action-cfg-params { 868 description 869 "Choice of action types"; 870 } 871 } 872 } 873 container policies { 874 description 875 "list of policy templates"; 876 list policy-entry { 877 key "policy-name policy-type"; 878 description 879 "policy template"; 880 uses policy-generic-attr; 881 list classifier-entry { 882 key "classifier-entry-name"; 883 ordered-by user; 884 description 885 "Classifier entry configuration in a policy"; 886 leaf classifier-entry-name { 887 type string; 888 description 889 "classifier entry name"; 890 } 891 uses classifier:classifier-entry-inline-attr; 892 uses classifier-action-entry-cfg; 893 } 894 } 895 } 896 } 897 899 6.3. IETF-QOS-ACTION 901 file "ietf-qos-action@2018-07-13.yang" 902 module ietf-qos-action { 903 yang-version 1.1; 904 namespace "urn:ietf:params:xml:ns:yang:ietf-qos-action"; 905 prefix action; 906 import ietf-inet-types { 907 prefix inet; 909 } 910 import ietf-qos-policy { 911 prefix policy; 912 } 913 organization "IETF RTG (Routing Area) Working Group"; 914 contact 915 "WG Web: 916 WG List: 917 WG Chair: Chris Bowers 918 919 WG Chair: Jeff Tantsura 920 921 Editor: Aseem Choudhary 922 923 Editor: Mahesh Jethanandani 924 925 Editor: Norm Strahle 926 "; 927 description 928 "This module contains a collection of YANG definitions for 929 configuring qos specification implementations. 930 Copyright (c) 2014 IETF Trust and the persons identified as 931 authors of the code. All rights reserved. 932 Redistribution and use in source and binary forms, with or 933 without modification, is permitted pursuant to, and subject 934 to the license terms contained in, the Simplified BSD License 935 set forth in Section 4.c of the IETF Trust's Legal Provisions 936 Relating to IETF Documents 937 (http://trustee.ietf.org/license-info). 938 This version of this YANG module is part of RFC XXXX; see 939 the RFC itself for full legal notices."; 940 revision 2018-07-13 { 941 description 942 "Latest revision for qos actions"; 943 reference "RFC XXXX"; 944 } 945 feature meter-template-support { 946 description 947 " This feature allows support of meter-template."; 948 } 949 feature meter-inline-feature { 950 description 951 "This feature allows support of meter-inline configuration."; 952 } 953 feature meter-reference-feature { 954 description 955 "This feature allows support of meter by reference 956 configuration."; 958 } 959 feature queue-action-support { 960 description 961 " This feature allows support of queue action configuration 962 in policy."; 963 } 964 feature scheduler-action-support { 965 description 966 " This feature allows support of scheduler configuration 967 in policy."; 968 } 969 feature child-policy-feature { 970 description 971 " This feature allows configuration of hierarchical policy."; 972 } 973 feature count-feature { 974 description 975 "This feature allows action configuration to enable 976 counter in a classifier"; 977 } 978 feature named-counter-feature { 979 description 980 "This feature allows action configuration to enable 981 named counter in a classifier"; 982 } 983 feature traffic-group-feature { 984 description 985 "traffic-group action support"; 986 } 987 feature burst-time-unit-support { 988 description 989 "This feature allows burst unit to be configured as 990 time duration."; 991 } 993 identity rate-unit-type { 994 description 995 "base rate-unit type"; 996 } 997 identity bits-per-second { 998 base rate-unit-type; 999 description 1000 "bits per second identity"; 1001 } 1002 identity kilo-bits-per-second { 1003 base rate-unit-type; 1004 description 1005 "kilo bits per second identity"; 1007 } 1008 identity mega-bits-per-second { 1009 base rate-unit-type; 1010 description 1011 "mega bits per second identity"; 1012 } 1013 identity giga-bits-per-second { 1014 base rate-unit-type; 1015 description 1016 "mega bits per second identity"; 1017 } 1018 identity percent { 1019 base rate-unit-type; 1020 description 1021 "percentage"; 1022 } 1023 identity burst-unit-type { 1024 description 1025 "base burst-unit type"; 1026 } 1027 identity bytes { 1028 base burst-unit-type; 1029 description 1030 "bytes"; 1031 } 1032 identity kilo-bytes { 1033 base burst-unit-type; 1034 description 1035 "kilo bytes"; 1036 } 1037 identity mega-bytes { 1038 base burst-unit-type; 1039 description 1040 "mega bytes"; 1041 } 1042 identity millisecond { 1043 base burst-unit-type; 1044 if-feature burst-time-unit-support; 1045 description 1046 "milli seconds"; 1047 } 1048 identity microsecond { 1049 base burst-unit-type; 1050 if-feature burst-time-unit-support; 1051 description 1052 "micro seconds"; 1053 } 1054 identity dscp-marking { 1055 base policy:action-type; 1056 description 1057 "dscp marking action type"; 1058 } 1059 identity meter-inline { 1060 base policy:action-type; 1061 if-feature meter-inline-feature; 1062 description 1063 "meter-inline action type"; 1064 } 1065 identity meter-reference { 1066 base policy:action-type; 1067 if-feature meter-reference-feature; 1068 description 1069 "meter reference action type"; 1070 } 1071 identity queue { 1072 base policy:action-type; 1073 if-feature queue-action-support; 1074 description 1075 "queue action type"; 1076 } 1077 identity scheduler { 1078 base policy:action-type; 1079 if-feature scheduler-action-support; 1080 description 1081 "scheduler action type"; 1082 } 1083 identity discard { 1084 base policy:action-type; 1085 description 1086 "discard action type"; 1087 } 1088 identity child-policy { 1089 base policy:action-type; 1090 if-feature child-policy-feature; 1091 description 1092 "child-policy action type"; 1093 } 1094 identity count { 1095 base policy:action-type; 1096 if-feature count-feature; 1097 description 1098 "count action type"; 1099 } 1100 identity named-counter { 1101 base policy:action-type; 1102 if-feature named-counter-feature; 1103 description 1104 "name counter action type"; 1105 } 1107 identity meter-type { 1108 description 1109 "This base identity type defines meter types"; 1110 } 1111 identity one-rate-two-color-meter-type { 1112 base meter-type; 1113 description 1114 "one rate two color meter type"; 1115 } 1116 identity one-rate-tri-color-meter-type { 1117 base meter-type; 1118 description 1119 "one rate three color meter type"; 1120 } 1121 identity two-rate-tri-color-meter-type { 1122 base meter-type; 1123 description 1124 "two rate three color meter action type"; 1125 } 1127 identity drop-type { 1128 description 1129 "drop algorithm"; 1130 } 1131 identity tail-drop { 1132 base drop-type; 1133 description 1134 "tail drop algorithm"; 1135 } 1137 identity conform-2color-meter-action-type { 1138 description 1139 "action type in a meter"; 1140 } 1141 identity exceed-2color-meter-action-type { 1142 description 1143 "action type in a meter"; 1144 } 1145 identity conform-3color-meter-action-type { 1146 description 1147 "action type in a meter"; 1148 } 1149 identity exceed-3color-meter-action-type { 1150 description 1151 "action type in a meter"; 1152 } 1153 identity violate-3color-meter-action-type { 1154 description 1155 "action type in a meter"; 1156 } 1158 grouping rate-value-unit { 1159 leaf rate-value { 1160 type uint64; 1161 description 1162 "rate value"; 1163 } 1164 leaf rate-unit { 1165 type identityref { 1166 base rate-unit-type; 1167 } 1168 description 1169 "rate unit"; 1170 } 1171 description 1172 "rate value and unit grouping"; 1173 } 1174 grouping burst { 1175 description 1176 "burst value and unit configuration"; 1177 leaf burst-value { 1178 type uint64; 1179 description 1180 "burst value"; 1181 } 1182 leaf burst-unit { 1183 type identityref { 1184 base burst-unit-type; 1185 } 1186 description 1187 "burst unit"; 1188 } 1189 } 1191 grouping threshold { 1192 description 1193 "Threshold Parameters"; 1194 container threshold { 1195 description 1196 "threshold"; 1197 choice threshold-type { 1198 case size { 1199 leaf threshold-size { 1200 type uint64; 1201 units "bytes"; 1202 description 1203 "Threshold size"; 1204 } 1205 } 1206 case interval { 1207 leaf threshold-interval { 1208 type uint64; 1209 units "microsecond"; 1210 description 1211 "Threshold interval"; 1212 } 1213 } 1214 description 1215 "Choice of threshold type"; 1216 } 1217 } 1218 } 1220 grouping drop { 1221 container drop-cfg { 1222 leaf drop-action { 1223 type empty; 1224 description 1225 "always drop algorithm"; 1226 } 1227 description 1228 "the drop action"; 1229 } 1230 description 1231 "always drop grouping"; 1232 } 1234 grouping queuelimit { 1235 container qlimit-thresh { 1236 uses threshold; 1237 description 1238 "the queue limit"; 1239 } 1240 description 1241 "the queue limit beyond which queue will not hold any packet"; 1242 } 1244 grouping conform-2color-meter-action-params { 1245 description 1246 "meter action parameters"; 1248 list conform-2color-meter-action-params { 1249 key "conform-2color-meter-action-type"; 1250 ordered-by user; 1251 description 1252 "Configuration of basic-meter & associated actions"; 1253 leaf conform-2color-meter-action-type { 1254 type identityref { 1255 base conform-2color-meter-action-type; 1256 } 1257 description 1258 "meter action type"; 1259 } 1260 choice conform-2color-meter-action-val { 1261 description 1262 " meter action based on choice of meter action type"; 1263 } 1264 } 1265 } 1267 grouping exceed-2color-meter-action-params { 1268 description 1269 "meter action parameters"; 1270 list exceed-2color-meter-action-params { 1271 key "exceed-2color-meter-action-type"; 1272 ordered-by user; 1273 description 1274 "Configuration of basic-meter & associated actions"; 1275 leaf exceed-2color-meter-action-type { 1276 type identityref { 1277 base exceed-2color-meter-action-type; 1278 } 1279 description 1280 "meter action type"; 1281 } 1282 choice exceed-2color-meter-action-val { 1283 description 1284 " meter action based on choice of meter action type"; 1285 } 1286 } 1287 } 1289 grouping conform-3color-meter-action-params { 1290 description 1291 "meter action parameters"; 1292 list conform-3color-meter-action-params { 1293 key "conform-3color-meter-action-type"; 1294 ordered-by user; 1295 description 1296 "Configuration of basic-meter & associated actions"; 1297 leaf conform-3color-meter-action-type { 1298 type identityref { 1299 base conform-3color-meter-action-type; 1300 } 1301 description 1302 "meter action type"; 1303 } 1304 choice conform-3color-meter-action-val { 1305 description 1306 " meter action based on choice of meter action type"; 1307 } 1308 } 1309 } 1311 grouping exceed-3color-meter-action-params { 1312 description 1313 "meter action parameters"; 1314 list exceed-3color-meter-action-params { 1315 key "exceed-3color-meter-action-type"; 1316 ordered-by user; 1317 description 1318 "Configuration of basic-meter & associated actions"; 1319 leaf exceed-3color-meter-action-type { 1320 type identityref { 1321 base exceed-3color-meter-action-type; 1322 } 1323 description 1324 "meter action type"; 1325 } 1326 choice exceed-3color-meter-action-val { 1327 description 1328 " meter action based on choice of meter action type"; 1329 } 1330 } 1331 } 1333 grouping violate-3color-meter-action-params { 1334 description 1335 "meter action parameters"; 1336 list violate-3color-meter-action-params { 1337 key "violate-3color-meter-action-type"; 1338 ordered-by user; 1339 description 1340 "Configuration of basic-meter & associated actions"; 1341 leaf violate-3color-meter-action-type { 1342 type identityref { 1343 base violate-3color-meter-action-type; 1344 } 1345 description 1346 "meter action type"; 1347 } 1348 choice violate-3color-meter-action-val { 1349 description 1350 " meter action based on choice of meter action type"; 1351 } 1352 } 1353 } 1355 grouping one-rate-two-color-meter { 1356 container one-rate-two-color-meter { 1357 description 1358 "single rate two color marker meter"; 1359 leaf committed-rate-value { 1360 type uint64; 1361 description 1362 "committed rate value"; 1363 } 1364 leaf committed-rate-unit { 1365 type identityref { 1366 base rate-unit-type; 1367 } 1368 description 1369 "committed rate unit"; 1370 } 1371 leaf committed-burst-value { 1372 type uint64; 1373 description 1374 "burst value"; 1375 } 1376 leaf committed-burst-unit { 1377 type identityref { 1378 base burst-unit-type; 1379 } 1380 description 1381 "committed burst unit"; 1382 } 1383 container conform-action { 1384 uses conform-2color-meter-action-params; 1385 description 1386 "conform action"; 1387 } 1388 container exceed-action { 1389 uses exceed-2color-meter-action-params; 1390 description 1391 "exceed action"; 1392 } 1393 } 1394 description 1395 "single rate two color marker meter attributes"; 1396 } 1398 grouping one-rate-tri-color-meter { 1399 container one-rate-tri-color-meter { 1400 description 1401 "single rate three color meter"; 1402 leaf committed-rate-value { 1403 type uint64; 1404 description 1405 "meter rate"; 1406 } 1407 leaf committed-rate-unit { 1408 type identityref { 1409 base rate-unit-type; 1410 } 1411 description 1412 "committed rate unit"; 1413 } 1414 leaf committed-burst-value { 1415 type uint64; 1416 description 1417 "committed burst size"; 1418 } 1419 leaf committed-burst-unit { 1420 type identityref { 1421 base burst-unit-type; 1422 } 1423 description 1424 "committed burst unit"; 1425 } 1426 leaf excess-burst-value { 1427 type uint64; 1428 description 1429 "excess burst size"; 1430 } 1431 leaf excess-burst-unit { 1432 type identityref { 1433 base burst-unit-type; 1434 } 1435 description 1436 "excess burst unit"; 1437 } 1438 container conform-action { 1439 uses conform-3color-meter-action-params; 1440 description 1441 "conform, or green action"; 1442 } 1443 container exceed-action { 1444 uses exceed-3color-meter-action-params; 1445 description 1446 "exceed, or yellow action"; 1447 } 1448 container violate-action { 1449 uses violate-3color-meter-action-params; 1450 description 1451 "violate, or red action"; 1452 } 1453 } 1454 description 1455 "one-rate-tri-color-meter attributes"; 1456 } 1458 grouping two-rate-tri-color-meter { 1459 container two-rate-tri-color-meter { 1460 description 1461 "two rate three color meter"; 1462 leaf committed-rate-value { 1463 type uint64; 1464 units "bits-per-second"; 1465 description 1466 "committed rate"; 1467 } 1468 leaf committed-rate-unit { 1469 type identityref { 1470 base rate-unit-type; 1471 } 1472 description 1473 "committed rate unit"; 1474 } 1475 leaf committed-burst-value { 1476 type uint64; 1477 description 1478 "commited burst size"; 1479 } 1480 leaf committed-burst-unit { 1481 type identityref { 1482 base burst-unit-type; 1483 } 1484 description 1485 "committed burst unit"; 1486 } 1487 leaf peak-rate-value { 1488 type uint64; 1489 description 1490 "peak rate"; 1491 } 1492 leaf peak-rate-unit { 1493 type identityref { 1494 base rate-unit-type; 1495 } 1496 description 1497 "committed rate unit"; 1498 } 1499 leaf peak-burst-value { 1500 type uint64; 1501 description 1502 "commited burst size"; 1503 } 1504 leaf peak-burst-unit { 1505 type identityref { 1506 base burst-unit-type; 1507 } 1508 description 1509 "peak burst unit"; 1510 } 1511 container conform-action { 1512 uses conform-3color-meter-action-params; 1513 description 1514 "conform, or green action"; 1515 } 1516 container exceed-action { 1517 uses exceed-3color-meter-action-params; 1518 description 1519 "exceed, or yellow action"; 1520 } 1521 container violate-action { 1522 uses violate-3color-meter-action-params; 1523 description 1524 "exceed, or red action"; 1525 } 1526 } 1527 description 1528 "two-rate-tri-color-meter attributes"; 1529 } 1531 grouping meter { 1532 choice meter-type { 1533 case one-rate-two-color-meter-type { 1534 uses one-rate-two-color-meter; 1535 description 1536 "basic meter"; 1537 } 1538 case one-rate-tri-color-meter-type { 1539 uses one-rate-tri-color-meter; 1540 description 1541 "one rate tri-color meter"; 1542 } 1543 case two-rate-tri-color-meter-type { 1544 uses two-rate-tri-color-meter; 1545 description 1546 "two rate tri-color meter"; 1547 } 1548 description 1549 " meter action based on choice of meter action type"; 1550 } 1551 description 1552 "meter attributes"; 1553 } 1555 container meter-template { 1556 description 1557 "list of meter templates"; 1558 list meter-entry { 1559 if-feature meter-template-support; 1560 key "meter-name"; 1561 description 1562 "meter entry template"; 1563 leaf meter-name { 1564 type string; 1565 description 1566 "meter identifier"; 1567 } 1568 uses meter; 1569 } 1570 } 1572 grouping meter-reference { 1573 container meter-reference-cfg { 1574 leaf meter-reference-name { 1575 type string ; 1576 mandatory true; 1577 description 1578 "This leaf defines name of the meter referenced"; 1579 } 1580 leaf meter-type { 1581 type identityref { 1582 base meter-type; 1584 } 1585 mandatory true; 1586 description 1587 "This leaf defines type of the meter"; 1588 } 1589 description 1590 "meter reference name"; 1591 } 1592 description 1593 "meter reference"; 1594 } 1596 grouping count { 1597 container count-cfg { 1598 if-feature count-feature; 1599 leaf count-action { 1600 type empty; 1601 description 1602 "count action"; 1603 } 1604 description 1605 "the count action"; 1606 } 1607 description 1608 "the count action grouping"; 1609 } 1611 grouping named-counter { 1612 container named-counter-cfg { 1613 if-feature named-counter-feature; 1614 leaf count-name-action { 1615 type string; 1616 description 1617 "count action"; 1618 } 1619 description 1620 "the count action"; 1621 } 1622 description 1623 "the count action grouping"; 1624 } 1626 grouping discard { 1627 container discard-cfg { 1628 leaf discard { 1629 type empty; 1630 description 1631 "discard action"; 1633 } 1634 description 1635 "discard action"; 1636 } 1637 description 1638 "discard grouping"; 1639 } 1641 grouping priority { 1642 container priority-cfg { 1643 leaf priority-level { 1644 type uint8; 1645 description 1646 "priority level"; 1647 } 1648 description 1649 "priority attributes"; 1650 } 1651 description 1652 "priority attributes grouping"; 1653 } 1654 grouping min-rate { 1655 container min-rate-cfg { 1656 uses rate-value-unit; 1657 description 1658 "min guaranteed bandwidth"; 1659 } 1660 description 1661 "minimum rate grouping"; 1662 } 1663 grouping dscp-marking { 1664 container dscp-cfg { 1665 leaf dscp { 1666 type inet:dscp; 1667 description 1668 "dscp marking"; 1669 } 1670 description 1671 "dscp marking container"; 1672 } 1673 description 1674 "dscp marking grouping"; 1675 } 1676 grouping traffic-group-marking { 1677 container traffic-group-cfg { 1678 leaf traffic-group { 1679 type string; 1680 description 1681 "traffic group marking"; 1682 } 1683 description 1684 "traffic group marking container"; 1685 } 1686 description 1687 "traffic group marking grouping"; 1688 } 1689 grouping child-policy { 1690 container child-policy-cfg { 1691 if-feature child-policy-feature; 1692 leaf policy-name { 1693 type string; 1694 description 1695 "Hierarchical Policy"; 1696 } 1697 description 1698 "Hierarchical Policy configuration container"; 1699 } 1700 description 1701 "Grouping of Hierarchical Policy configuration"; 1702 } 1703 grouping max-rate { 1704 container max-rate-cfg { 1705 uses rate-value-unit; 1706 uses burst; 1707 description 1708 "maximum rate attributes container"; 1709 } 1710 description 1711 "maximum rate attributes"; 1712 } 1713 grouping queue { 1714 container queue-cfg { 1715 uses priority; 1716 uses min-rate; 1717 uses max-rate; 1718 container algorithmic-drop-cfg { 1719 choice drop-algorithm { 1720 case tail-drop { 1721 container tail-drop-cfg { 1722 leaf tail-drop-alg { 1723 type empty; 1724 description 1725 "tail drop algorithm"; 1726 } 1727 description 1728 "Tail Drop configuration container"; 1730 } 1731 description 1732 "Tail Drop choice"; 1733 } 1734 description 1735 "Choice of Drop Algorithm"; 1736 } 1737 description 1738 "Algorithmic Drop configuration container"; 1739 } 1740 description 1741 "Queue configuration container"; 1742 } 1743 description 1744 "Queue grouping"; 1745 } 1746 grouping scheduler { 1747 container scheduler-cfg { 1748 uses min-rate; 1749 uses max-rate; 1750 description 1751 "Schedular configuration container"; 1752 } 1753 description 1754 "Schedular configuration grouping"; 1755 } 1756 } 1757 1759 6.4. IETF-QOS-TARGET 1761 file "ietf-qos-target@2017-12-12.yang" 1762 module ietf-qos-target { 1763 yang-version 1; 1764 namespace "urn:ietf:params:xml:ns:yang:ietf-qos-target"; 1765 prefix target; 1767 import ietf-interfaces { 1768 prefix if; 1769 } 1770 import ietf-qos-policy { 1771 prefix policy; 1772 } 1774 organization "IETF RTG (Routing Area) Working Group"; 1775 contact 1776 "WG Web: 1777 WG List: 1778 WG Chair: Chris Bowers 1779 1780 WG Chair: Jeff Tantsura 1781 1782 Editor: Aseem Choudhary 1783 1784 Editor: Mahesh Jethanandani 1785 1786 Editor: Norm Strahle 1787 "; 1788 description 1789 "This module contains a collection of YANG definitions for 1790 configuring qos specification implementations. 1791 Copyright (c) 2014 IETF Trust and the persons identified as 1792 authors of the code. All rights reserved. 1793 Redistribution and use in source and binary forms, with or 1794 without modification, is permitted pursuant to, and subject 1795 to the license terms contained in, the Simplified BSD License 1796 set forth in Section 4.c of the IETF Trust's Legal Provisions 1797 Relating to IETF Documents 1798 (http://trustee.ietf.org/license-info). 1799 This version of this YANG module is part of RFC XXXX; see 1800 the RFC itself for full legal notices."; 1802 revision 2017-12-12 { 1803 description 1804 "Latest revision qos based policy applied to a target"; 1805 reference "RFC XXXX"; 1806 } 1808 identity direction { 1809 description 1810 "This is identity of traffic direction"; 1811 } 1813 identity inbound { 1814 base direction; 1815 description 1816 "Direction of traffic coming into the network entry"; 1817 } 1819 identity outbound { 1820 base direction; 1821 description 1822 "Direction of traffic going out of the network entry"; 1823 } 1825 augment "/if:interfaces/if:interface" { 1826 description 1827 "Augments Diffserv Target Entry to Interface module"; 1828 list qos-target-entry { 1829 key "direction policy-type"; 1830 description 1831 "policy target for inbound or outbound direction"; 1832 leaf direction { 1833 type identityref { 1834 base direction; 1835 } 1836 description 1837 "Direction fo the traffic flow either inbound or outbound"; 1838 } 1839 leaf policy-type { 1840 type identityref { 1841 base policy:policy-type; 1842 } 1843 description 1844 "Policy entry type"; 1845 } 1846 leaf policy-name { 1847 type string; 1848 mandatory true; 1849 description 1850 "Policy entry name"; 1851 } 1852 } 1853 } 1854 } 1855 1857 6.5. IETF-DIFFSERV 1859 file "ietf-diffserv@2018-06-17.yang" 1860 module ietf-diffserv { 1861 yang-version 1.1; 1862 namespace "urn:ietf:params:xml:ns:yang:ietf-diffserv"; 1863 prefix diffserv; 1865 import ietf-qos-classifier { 1866 prefix classifier; 1867 } 1868 import ietf-qos-policy { 1869 prefix policy; 1870 } 1871 import ietf-qos-action { 1872 prefix action; 1873 } 1874 import ietf-inet-types { 1875 prefix inet; 1876 } 1878 organization "IETF RTG (Routing Area) Working Group"; 1879 contact 1880 "WG Web: 1881 WG List: 1882 WG Chair: Chris Bowers 1883 1884 WG Chair: Jeff Tantsura 1885 1886 Editor: Aseem Choudhary 1887 1888 Editor: Mahesh Jethanandani 1889 1890 Editor: Norm Strahle 1891 "; 1892 description 1893 "This module contains a collection of YANG definitions for 1894 configuring diffserv specification implementations. 1895 Copyright (c) 2014 IETF Trust and the persons identified as 1896 authors of the code. All rights reserved. 1897 Redistribution and use in source and binary forms, with or 1898 without modification, is permitted pursuant to, and subject 1899 to the license terms contained in, the Simplified BSD License 1900 set forth in Section 4.c of the IETF Trust's Legal Provisions 1901 Relating to IETF Documents 1902 (http://trustee.ietf.org/license-info). 1903 This version of this YANG module is part of RFC XXXX; see 1904 the RFC itself for full legal notices."; 1906 revision 2018-06-17 { 1907 description 1908 "Latest revision of diffserv based classifier"; 1909 reference "RFC XXXX"; 1910 } 1912 feature diffserv-queue-inline-support { 1913 description 1914 "Queue inline support in diffserv policy"; 1915 } 1916 feature diffserv-scheduler-inline-support { 1917 description 1918 "scheduler inline support in diffserv policy"; 1919 } 1920 identity diffserv-policy-type { 1921 base policy:policy-type; 1922 description 1923 "This defines ip policy-type"; 1924 } 1925 identity ipv4-diffserv-policy-type { 1926 base policy:policy-type; 1927 description 1928 "This defines ipv4 policy-type"; 1929 } 1930 identity ipv6-diffserv-policy-type { 1931 base policy:policy-type; 1932 description 1933 "This defines ipv6 policy-type"; 1934 } 1936 identity dscp { 1937 base classifier:filter-type; 1938 description 1939 "Differentiated services code point filter-type"; 1940 } 1941 identity source-ipv4-address { 1942 base classifier:filter-type; 1943 description 1944 "source ipv4 address filter-type"; 1945 } 1946 identity destination-ipv4-address { 1947 base classifier:filter-type; 1948 description 1949 "destination ipv4 address filter-type"; 1950 } 1951 identity source-ipv6-address { 1952 base classifier:filter-type; 1953 description 1954 "source ipv6 address filter-type"; 1955 } 1956 identity destination-ipv6-address { 1957 base classifier:filter-type; 1958 description 1959 "destination ipv6 address filter-type"; 1960 } 1961 identity source-port { 1962 base classifier:filter-type; 1963 description 1964 "source port filter-type"; 1965 } 1966 identity destination-port { 1967 base classifier:filter-type; 1968 description 1969 "destination port filter-type"; 1971 } 1972 identity protocol { 1973 base classifier:filter-type; 1974 description 1975 "protocol type filter-type"; 1976 } 1977 identity traffic-group-name { 1978 base classifier:filter-type; 1979 description 1980 "traffic-group filter type"; 1981 } 1983 identity meter-type { 1984 description 1985 "This base identity type defines meter types"; 1986 } 1987 identity one-rate-two-color-meter-type { 1988 base meter-type; 1989 description 1990 "one rate two color meter type"; 1991 } 1992 identity one-rate-tri-color-meter-type { 1993 base meter-type; 1994 description 1995 "one rate three color meter type"; 1996 } 1997 identity two-rate-tri-color-meter-type { 1998 base meter-type; 1999 description 2000 "two rate three color meter action type"; 2001 } 2002 grouping dscp-cfg { 2003 list dscp-cfg { 2004 key "dscp-min dscp-max"; 2005 description 2006 "list of dscp ranges"; 2007 leaf dscp-min { 2008 type inet:dscp; 2009 description 2010 "Minimum value of dscp min-max range"; 2011 } 2012 leaf dscp-max { 2013 type inet:dscp; 2014 description 2015 "maximum value of dscp min-max range"; 2016 } 2017 } 2018 description 2019 "Filter grouping containing list of dscp ranges"; 2020 } 2021 grouping source-ipv4-address-cfg { 2022 list source-ipv4-address-cfg { 2023 key "source-ipv4-addr"; 2024 description 2025 "list of source ipv4 address"; 2026 leaf source-ipv4-addr { 2027 type inet:ipv4-prefix; 2028 description 2029 "source ipv4 prefix"; 2030 } 2031 } 2032 description 2033 "Filter grouping containing list of source ipv4 addresses"; 2034 } 2035 grouping destination-ipv4-address-cfg { 2036 list destination-ipv4-address-cfg { 2037 key "destination-ipv4-addr"; 2038 description 2039 "list of destination ipv4 address"; 2040 leaf destination-ipv4-addr { 2041 type inet:ipv4-prefix; 2042 description 2043 "destination ipv4 prefix"; 2044 } 2045 } 2046 description 2047 "Filter grouping containing list of destination ipv4 address"; 2048 } 2049 grouping source-ipv6-address-cfg { 2050 list source-ipv6-address-cfg { 2051 key "source-ipv6-addr"; 2052 description 2053 "list of source ipv6 address"; 2054 leaf source-ipv6-addr { 2055 type inet:ipv6-prefix; 2056 description 2057 "source ipv6 prefix"; 2058 } 2059 } 2060 description 2061 "Filter grouping containing list of source ipv6 addresses"; 2062 } 2063 grouping destination-ipv6-address-cfg { 2064 list destination-ipv6-address-cfg { 2065 key "destination-ipv6-addr"; 2066 description 2067 "list of destination ipv4 or ipv6 address"; 2068 leaf destination-ipv6-addr { 2069 type inet:ipv6-prefix; 2070 description 2071 "destination ipv6 prefix"; 2072 } 2073 } 2074 description 2075 "Filter grouping containing list of destination ipv6 address"; 2076 } 2077 grouping source-port-cfg { 2078 list source-port-cfg { 2079 key "source-port-min source-port-max"; 2080 description 2081 "list of ranges of source port"; 2082 leaf source-port-min { 2083 type inet:port-number; 2084 description 2085 "minimum value of source port range"; 2086 } 2087 leaf source-port-max { 2088 type inet:port-number; 2089 description 2090 "maximum value of source port range"; 2091 } 2092 } 2093 description 2094 "Filter grouping containing list of source port ranges"; 2095 } 2096 grouping destination-port-cfg { 2097 list destination-port-cfg { 2098 key "destination-port-min destination-port-max"; 2099 description 2100 "list of ranges of destination port"; 2101 leaf destination-port-min { 2102 type inet:port-number; 2103 description 2104 "minimum value of destination port range"; 2105 } 2106 leaf destination-port-max { 2107 type inet:port-number; 2108 description 2109 "maximum value of destination port range"; 2110 } 2111 } 2112 description 2113 "Filter grouping containing list of destination port ranges"; 2114 } 2115 grouping protocol-cfg { 2116 list protocol-cfg { 2117 key "protocol-min protocol-max"; 2118 description 2119 "list of ranges of protocol values"; 2120 leaf protocol-min { 2121 type uint8 { 2122 range "0..255"; 2123 } 2124 description 2125 "minimum value of protocol range"; 2126 } 2127 leaf protocol-max { 2128 type uint8 { 2129 range "0..255"; 2130 } 2131 description 2132 "maximum value of protocol range"; 2133 } 2134 } 2135 description 2136 "Filter grouping containing list of Protocol ranges"; 2137 } 2138 grouping traffic-group-cfg { 2139 container traffic-group-cfg { 2140 leaf traffic-group-name { 2141 type string ; 2142 description 2143 "This leaf defines name of the traffic group referenced"; 2144 } 2145 description 2146 "traffic group container"; 2147 } 2148 description 2149 "traffic group grouping"; 2150 } 2152 augment "/classifier:classifiers/classifier:classifier-entry" + 2153 "/classifier:filter-entry" { 2154 choice filter-param { 2155 description 2156 "Choice of filter types"; 2157 case dscp { 2158 uses dscp-cfg; 2159 description 2160 "Filter containing list of dscp ranges"; 2161 } 2162 case source-ipv4-address { 2163 uses source-ipv4-address-cfg; 2164 description 2165 "Filter containing list of source ipv4 addresses"; 2166 } 2167 case destination-ipv4-address { 2168 uses destination-ipv4-address-cfg; 2169 description 2170 "Filter containing list of destination ipv4 address"; 2171 } 2172 case source-ipv6-address { 2173 uses source-ipv6-address-cfg; 2174 description 2175 "Filter containing list of source ipv6 addresses"; 2176 } 2177 case destination-ipv6-address { 2178 uses destination-ipv6-address-cfg; 2179 description 2180 "Filter containing list of destination ipv6 address"; 2181 } 2182 case source-port { 2183 uses source-port-cfg; 2184 description 2185 "Filter containing list of source-port ranges"; 2186 } 2187 case destination-port { 2188 uses destination-port-cfg; 2189 description 2190 "Filter containing list of destination-port ranges"; 2191 } 2192 case protocol { 2193 uses protocol-cfg; 2194 description 2195 "Filter Type Protocol"; 2196 } 2197 case traffic-group { 2198 uses traffic-group-cfg; 2199 description 2200 "Filter Type traffic-group"; 2201 } 2202 } 2203 description 2204 "augments diffserv filters to qos classifier"; 2205 } 2206 augment "/policy:policies/policy:policy-entry" + 2207 "/policy:classifier-entry/policy:filter-entry" { 2208 choice filter-params { 2209 description 2210 "Choice of action types"; 2212 case dscp { 2213 uses dscp-cfg; 2214 description 2215 "Filter containing list of dscp ranges"; 2216 } 2217 case source-ipv4-address { 2218 when "../../policy:policy-type != 2219 'diffserv:ipv6-diffserv-policy-type'" { 2220 description 2221 "If policy type is v6, this filter cannot be used."; 2222 } 2223 uses source-ipv4-address-cfg; 2224 description 2225 "Filter containing list of source ipv4 addresses"; 2226 } 2227 case destination-ipv4-address { 2228 when "../../policy:policy-type != 2229 'diffserv:ipv6-diffserv-policy-type'" { 2230 description 2231 "If policy type is v6, this filter cannot be used."; 2232 } 2233 uses destination-ipv4-address-cfg; 2234 description 2235 "Filter containing list of destination ipv4 address"; 2236 } 2237 case source-ipv6-address { 2238 when "../../policy:policy-type != 2239 'diffserv:ipv4-diffserv-policy-type'" { 2240 description 2241 "If policy type is v4, this filter cannot be used."; 2242 } 2243 uses source-ipv6-address-cfg; 2244 description 2245 "Filter containing list of source ipv6 addresses"; 2246 } 2247 case destination-ipv6-address { 2248 when "../../policy:policy-type != 2249 'diffserv:ipv4-diffserv-policy-type'" { 2250 description 2251 "If policy type is v4, this filter cannot be used."; 2252 } 2253 uses destination-ipv6-address-cfg; 2254 description 2255 "Filter containing list of destination ipv6 address"; 2256 } 2257 case source-port { 2258 uses source-port-cfg; 2259 description 2260 "Filter containing list of source-port ranges"; 2261 } 2262 case destination-port { 2263 uses destination-port-cfg; 2264 description 2265 "Filter containing list of destination-port ranges"; 2266 } 2267 case protocol { 2268 uses protocol-cfg; 2269 description 2270 "Filter Type Protocol"; 2271 } 2272 case traffic-group { 2273 uses traffic-group-cfg; 2274 description 2275 "Filter Type traffic-group"; 2276 } 2277 } 2278 description 2279 "Augments Diffserv Classifier with common filter types"; 2280 } 2281 augment "/policy:policies/policy:policy-entry" + 2282 "/policy:classifier-entry" + 2283 "/policy:classifier-action-entry-cfg" + 2284 "/policy:action-cfg-params" { 2285 case dscp-marking { 2286 uses action:dscp-marking; 2287 } 2288 case meter-inline { 2289 if-feature action:meter-inline-feature; 2290 uses action:meter; 2291 } 2292 case meter-reference { 2293 if-feature action:meter-reference-feature; 2294 uses action:meter-reference; 2295 } 2296 case child-policy { 2297 if-feature action:child-policy-feature; 2298 uses action:child-policy; 2299 } 2300 case count { 2301 if-feature action:count-feature; 2302 uses action:count; 2303 } 2304 case named-count { 2305 if-feature action:named-counter-feature; 2306 uses action:named-counter; 2307 } 2308 case queue-inline { 2309 if-feature diffserv-queue-inline-support; 2310 uses action:queue; 2311 } 2312 case scheduler-inline { 2313 if-feature diffserv-scheduler-inline-support; 2314 uses action:scheduler; 2315 } 2316 description 2317 "Augments Diffserv Policy with action configuration"; 2318 } 2319 } 2320 2322 6.6. IETF-QUEUE-POLICY 2324 file "ietf-queue-policy@2018-07-13.yang" 2325 module ietf-queue-policy { 2326 yang-version 1.1; 2327 namespace "urn:ietf:params:xml:ns:yang:ietf-queue-policy"; 2328 prefix queue-policy; 2330 import ietf-qos-policy { 2331 prefix policy; 2332 } 2333 import ietf-qos-action { 2334 prefix action; 2335 } 2336 import ietf-diffserv { 2337 prefix diffserv; 2338 } 2340 organization "IETF RTG (Routing Area) Working Group"; 2341 contact 2342 "WG Web: 2343 WG List: 2344 WG Chair: Chris Bowers 2345 2346 WG Chair: Jeff Tantsura 2347 2348 Editor: Aseem Choudhary 2349 2350 Editor: Mahesh Jethanandani 2351 2352 Editor: Norm Strahle 2353 "; 2354 description 2355 "This module contains a collection of YANG definitions for 2356 configuring diffserv specification implementations. 2357 Copyright (c) 2014 IETF Trust and the persons identified as 2358 authors of the code. All rights reserved. 2359 Redistribution and use in source and binary forms, with or 2360 without modification, is permitted pursuant to, and subject 2361 to the license terms contained in, the Simplified BSD License 2362 set forth in Section 4.c of the IETF Trust's Legal Provisions 2363 Relating to IETF Documents 2364 (http://trustee.ietf.org/license-info). 2365 This version of this YANG module is part of RFC XXXX; see 2366 the RFC itself for full legal notices."; 2368 revision 2018-07-13 { 2369 description 2370 "Latest revision of queuing policy module"; 2371 reference "RFC XXXX"; 2372 } 2374 feature queue-policy-support { 2375 description 2376 " This feature allows queue policy configuration 2377 as a separate policy type support."; 2378 } 2380 feature queue-inline-support { 2381 description 2382 "Queue inline support in Queue policy"; 2383 } 2385 feature queue-template-support { 2386 description 2387 "Queue template support in Queue policy"; 2388 } 2390 identity queue-policy-type { 2391 base policy:policy-type; 2392 description 2393 "This defines queue policy-type"; 2394 } 2396 augment "/policy:policies/policy:policy-entry" + 2397 "/policy:classifier-entry/policy:filter-entry" { 2398 when "../../policy:policy-type = 2399 'queue-policy:queue-policy-type'" { 2400 description 2401 "If policy type is v6, this filter cannot be used."; 2402 } 2403 if-feature queue-policy-support; 2404 choice filter-params { 2405 description 2406 "Choice of action types"; 2407 case traffic-group-name { 2408 uses diffserv:traffic-group-cfg; 2409 description 2410 "traffic group name"; 2411 } 2412 } 2413 description 2414 "Augments Queue policy Classifier with common filter types"; 2415 } 2417 identity queue-template-name { 2418 base policy:action-type; 2419 description 2420 "queue template name"; 2421 } 2423 grouping queue-template-reference { 2424 container queue-template-reference-cfg { 2425 leaf queue-template-name { 2426 type string ; 2427 mandatory true; 2428 description 2429 "This leaf defines name of the queue template referenced"; 2430 } 2431 description 2432 "queue template reference"; 2433 } 2434 description 2435 "queue template reference grouping"; 2436 } 2438 container queue-template { 2439 if-feature queue-policy-support; 2440 description 2441 "Queue template"; 2442 leaf name { 2443 type string; 2444 description 2445 "A unique name identifying this queue template"; 2446 } 2447 uses action:queue; 2448 } 2449 augment "/policy:policies/policy:policy-entry" + 2450 "/policy:classifier-entry" + 2451 "/policy:classifier-action-entry-cfg" + 2452 "/policy:action-cfg-params" { 2453 when "../../policy:policy-type = 2454 'queue-policy:queue-policy-type'" { 2455 description 2456 "queue policy actions."; 2457 } 2458 if-feature queue-policy-support; 2459 case queue-template-name { 2460 if-feature queue-template-support; 2461 uses queue-template-reference; 2462 } 2463 case queue-inline { 2464 if-feature queue-inline-support; 2465 uses action:queue; 2466 } 2467 description 2468 "augments queue template reference to queue policy"; 2469 } 2470 } 2471 2473 6.7. IETF-SCHEDULER-POLICY 2475 file "ietf-scheduler-policy@2018-06-17.yang" 2476 module ietf-scheduler-policy { 2477 yang-version 1.1; 2478 namespace "urn:ietf:params:xml:ns:yang:ietf-scheduler-policy"; 2479 prefix scheduler-policy; 2481 import ietf-qos-classifier { 2482 prefix classifier; 2483 } 2484 import ietf-qos-policy { 2485 prefix policy; 2486 } 2487 import ietf-qos-action { 2488 prefix action; 2489 } 2491 organization "IETF RTG (Routing Area) Working Group"; 2492 contact 2493 "WG Web: 2494 WG List: 2495 WG Chair: Chris Bowers 2496 2498 WG Chair: Jeff Tantsura 2499 2500 Editor: Norm Strahle 2501 2502 Editor: Aseem Choudhary 2503 "; 2504 description 2505 "This module contains a collection of YANG definitions for 2506 configuring diffserv specification implementations. 2507 Copyright (c) 2014 IETF Trust and the persons identified as 2508 authors of the code. All rights reserved. 2509 Redistribution and use in source and binary forms, with or 2510 without modification, is permitted pursuant to, and subject 2511 to the license terms contained in, the Simplified BSD License 2512 set forth in Section 4.c of the IETF Trust's Legal Provisions 2513 Relating to IETF Documents 2514 (http://trustee.ietf.org/license-info). 2515 This version of this YANG module is part of RFC XXXX; see 2516 the RFC itself for full legal notices."; 2518 revision 2018-06-17 { 2519 description 2520 "Latest revision of scheduler policy module"; 2521 reference "RFC XXXX"; 2522 } 2523 feature scheduler-policy-support { 2524 description 2525 " This feature allows sheduler policy configuration 2526 as a separate policy type support."; 2527 } 2529 identity scheduler-policy-type { 2530 base policy:policy-type; 2531 description 2532 "This defines scheduler policy-type"; 2533 } 2535 identity filter-match-all { 2536 base classifier:filter-type; 2537 description 2538 "Traffic-group filter type"; 2539 } 2541 grouping filter-match-all-cfg { 2542 container match-all-cfg { 2543 leaf match-all-action { 2544 type empty; 2545 description 2546 "match all packets"; 2547 } 2548 description 2549 "the match-all action"; 2550 } 2551 description 2552 "the match-all filter grouping"; 2553 } 2555 augment "/policy:policies/policy:policy-entry" + 2556 "/policy:classifier-entry/policy:filter-entry" { 2557 when "../../policy:policy-type = 2558 'scheduler-policy:scheduler-policy-type'" { 2559 description 2560 "Only when policy type is scheduler-policy"; 2561 } 2562 choice filter-params { 2563 description 2564 "Choice of action types"; 2565 case filter-match-all { 2566 uses filter-match-all-cfg; 2567 description 2568 "filter match-all"; 2569 } 2570 } 2571 description 2572 "Augments Queue policy Classifier with common filter types"; 2573 } 2575 identity queue-policy-name { 2576 base policy:action-type; 2577 description 2578 "queue policy name"; 2579 } 2581 grouping queue-policy-name-cfg { 2582 container queue-policy-name { 2583 leaf queue-policy { 2584 type string ; 2585 mandatory true; 2586 description 2587 "This leaf defines name of the queue-policy"; 2588 } 2589 description 2590 "container for queue-policy name"; 2591 } 2592 description 2593 "queue-policy name grouping"; 2594 } 2596 augment "/policy:policies/policy:policy-entry" + 2597 "/policy:classifier-entry" + 2598 "/policy:classifier-action-entry-cfg" + 2599 "/policy:action-cfg-params" { 2600 when "../../policy:policy-type = 2601 'scheduler-policy:scheduler-policy-type'" { 2602 description 2603 "Only when policy type is scheduler-policy"; 2604 } 2605 case scheduler { 2606 uses action:scheduler; 2607 } 2608 case queue-policy-name { 2609 uses queue-policy-name-cfg; 2610 } 2611 description 2612 "augments scheduler template reference to scheduler policy"; 2613 } 2614 } 2615 2617 7. Security Considerations 2619 8. Acknowledgement 2621 9. References 2623 9.1. Normative References 2625 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2626 Requirement Levels", BCP 14, RFC 2119, 2627 DOI 10.17487/RFC2119, March 1997, 2628 . 2630 [RFC2697] Heinanen, J. and R. Guerin, "A Single Rate Three Color 2631 Marker", RFC 2697, DOI 10.17487/RFC2697, September 1999, 2632 . 2634 [RFC2698] Heinanen, J. and R. Guerin, "A Two Rate Three Color 2635 Marker", RFC 2698, DOI 10.17487/RFC2698, September 1999, 2636 . 2638 [RFC3289] Baker, F., Chan, K., and A. Smith, "Management Information 2639 Base for the Differentiated Services Architecture", 2640 RFC 3289, DOI 10.17487/RFC3289, May 2002, 2641 . 2643 [RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for 2644 the Network Configuration Protocol (NETCONF)", RFC 6020, 2645 DOI 10.17487/RFC6020, October 2010, 2646 . 2648 [RFC6991] Schoenwaelder, J., Ed., "Common YANG Data Types", 2649 RFC 6991, DOI 10.17487/RFC6991, July 2013, 2650 . 2652 [RFC7223] Bjorklund, M., "A YANG Data Model for Interface 2653 Management", RFC 7223, DOI 10.17487/RFC7223, May 2014, 2654 . 2656 9.2. Informative References 2658 [RFC2475] Blake, S., Black, D., Carlson, M., Davies, E., Wang, Z., 2659 and W. Weiss, "An Architecture for Differentiated 2660 Services", RFC 2475, DOI 10.17487/RFC2475, December 1998, 2661 . 2663 Appendix A. Company A, Company B and Company C examples 2665 Company A, Company B and Company C Diffserv modules augments all the 2666 filter types of the QoS classifier module as well as the QoS policy 2667 module that allow it to define marking, metering, min-rate, max-rate 2668 actions. Queuing and metering counters are realized by augmenting of 2669 the QoS target module. 2671 A.1. Example of Company A Diffserv Model 2673 The following Company A vendor example augments the qos and diffserv 2674 model, demonstrating some of the following functionality: 2676 - use of template based classifier definitions 2678 - use of single policy type modelling queue, scheduler policy, and a 2679 filter policy. All of these policies either augment the qos policy 2680 or the diffserv modules 2682 - use of inline actions in a policy 2684 - flexibility in marking dscp or metadata at ingress and/or egress. 2686 module example-compa-diffserv { 2687 namespace "urn:ietf:params:xml:ns:yang:example-compa-diffserv"; 2688 prefix example; 2690 import ietf-qos-classifier { 2691 prefix classifier; 2692 } 2693 import ietf-qos-policy { 2694 prefix policy; 2695 } 2696 import ietf-qos-action { 2697 prefix action; 2698 } 2699 import ietf-diffserv { 2700 prefix diffserv; 2701 } 2703 organization "Company A"; 2704 contact 2705 "Editor: XYZ 2706 "; 2707 description 2708 "This module contains a collection of YANG definitions of 2709 companyA diffserv specification extension."; 2710 revision 2016-03-03 { 2711 description 2712 "Initial revision for diffserv actions on network packets"; 2713 reference 2714 "RFC 6020: YANG - A Data Modeling Language for the 2715 Network Configuration Protocol (NETCONF)"; 2716 } 2718 identity default-policy-type { 2719 base policy:policy-type; 2720 description 2721 "This defines default policy-type"; 2722 } 2724 identity qos-group { 2725 base classifier:filter-type; 2726 description 2727 "qos-group filter-type"; 2728 } 2730 grouping qos-group-cfg { 2731 list qos-group-cfg { 2732 key "qos-group-min qos-group-max"; 2733 description 2734 "list of dscp ranges"; 2735 leaf qos-group-min { 2736 type uint8; 2737 description 2738 "Minimum value of qos-group range"; 2739 } 2740 leaf qos-group-max { 2741 type uint8; 2742 description 2743 "maximum value of qos-group range"; 2744 } 2745 } 2746 description 2747 "Filter containing list of qos-group ranges"; 2748 } 2750 grouping wred-threshold { 2751 container wred-min-thresh { 2752 uses action:threshold; 2753 description 2754 "Minimum threshold"; 2755 } 2756 container wred-max-thresh { 2757 uses action:threshold; 2758 description 2759 "Maximum threshold"; 2760 } 2761 leaf mark-probability { 2762 type uint32 { 2763 range "1..1000"; 2764 } 2765 description 2766 "Mark probability"; 2767 } 2768 description 2769 "WRED threshold attributes"; 2770 } 2772 grouping randomdetect { 2773 leaf exp-weighting-const { 2774 type uint32; 2775 description 2776 "Exponential weighting constant factor for wred profile"; 2777 } 2778 uses wred-threshold; 2779 description 2780 "Random detect attributes"; 2781 } 2782 augment "/classifier:classifiers/" + 2783 "classifier:classifier-entry/" + 2784 "classifier:filter-entry/diffserv:filter-param" { 2785 case qos-group { 2786 uses qos-group-cfg; 2787 description 2788 "Filter containing list of qos-group ranges. 2789 Qos-group represent packet metadata information 2790 in a device. "; 2791 } 2792 description 2793 "augmentation of classifier filters"; 2794 } 2795 augment "/policy:policies/policy:policy-entry/" + 2796 "policy:classifier-entry/" + 2797 "policy:classifier-action-entry-cfg/" + 2798 "policy:action-cfg-params" { 2799 case random-detect { 2800 uses randomdetect; 2801 } 2802 description 2803 "Augment the actions to policy entry"; 2804 } 2806 augment "/policy:policies" + 2807 "/policy:policy-entry" + 2808 "/policy:classifier-entry" + 2809 "/policy:classifier-action-entry-cfg" + 2810 "/policy:action-cfg-params" + 2811 "/diffserv:meter-inline" + 2812 "/diffserv:meter-type" + 2813 "/diffserv:one-rate-two-color-meter-type" + 2814 "/diffserv:one-rate-two-color-meter" + 2815 "/diffserv:conform-action" + 2816 "/diffserv:conform-2color-meter-action-params" + 2817 "/diffserv:conform-2color-meter-action-val" { 2819 description 2820 "augment the one-rate-two-color meter conform 2821 with actions"; 2822 case meter-action-drop { 2823 description 2824 "meter drop"; 2825 uses action:drop; 2826 } 2827 case meter-action-mark-dscp { 2828 description 2829 "meter action dscp marking"; 2830 uses action:dscp-marking; 2831 } 2832 } 2833 augment "/policy:policies" + 2834 "/policy:policy-entry" + 2835 "/policy:classifier-entry" + 2836 "/policy:classifier-action-entry-cfg" + 2837 "/policy:action-cfg-params" + 2838 "/diffserv:meter-inline" + 2839 "/diffserv:meter-type" + 2840 "/diffserv:one-rate-two-color-meter-type" + 2841 "/diffserv:one-rate-two-color-meter" + 2842 "/diffserv:exceed-action" + 2843 "/diffserv:exceed-2color-meter-action-params" + 2844 "/diffserv:exceed-2color-meter-action-val" { 2846 description 2847 "augment the one-rate-two-color meter exceed 2848 with actions"; 2849 case meter-action-drop { 2850 description 2851 "meter drop"; 2852 uses action:drop; 2853 } 2854 case meter-action-mark-dscp { 2855 description 2856 "meter action dscp marking"; 2857 uses action:dscp-marking; 2858 } 2859 } 2860 augment "/policy:policies" + 2861 "/policy:policy-entry" + 2862 "/policy:classifier-entry" + 2863 "/policy:classifier-action-entry-cfg" + 2864 "/policy:action-cfg-params" + 2865 "/diffserv:meter-inline" + 2866 "/diffserv:meter-type" + 2867 "/diffserv:one-rate-tri-color-meter-type" + 2868 "/diffserv:one-rate-tri-color-meter" + 2869 "/diffserv:conform-action" + 2870 "/diffserv:conform-3color-meter-action-params" + 2871 "/diffserv:conform-3color-meter-action-val" { 2873 description 2874 "augment the one-rate-tri-color meter conform 2875 with actions"; 2876 case meter-action-drop { 2877 description 2878 "meter drop"; 2879 uses action:drop; 2880 } 2881 case meter-action-mark-dscp { 2882 description 2883 "meter action dscp marking"; 2884 uses action:dscp-marking; 2885 } 2886 } 2887 augment "/policy:policies" + 2888 "/policy:policy-entry" + 2889 "/policy:classifier-entry" + 2890 "/policy:classifier-action-entry-cfg" + 2891 "/policy:action-cfg-params" + 2892 "/diffserv:meter-inline" + 2893 "/diffserv:meter-type" + 2894 "/diffserv:one-rate-tri-color-meter-type" + 2895 "/diffserv:one-rate-tri-color-meter" + 2896 "/diffserv:exceed-action" + 2897 "/diffserv:exceed-3color-meter-action-params" + 2898 "/diffserv:exceed-3color-meter-action-val" { 2900 description 2901 "augment the one-rate-tri-color meter exceed 2902 with actions"; 2903 case meter-action-drop { 2904 description 2905 "meter drop"; 2906 uses action:drop; 2907 } 2908 case meter-action-mark-dscp { 2909 description 2910 "meter action dscp marking"; 2911 uses action:dscp-marking; 2912 } 2913 } 2914 augment "/policy:policies" + 2915 "/policy:policy-entry" + 2916 "/policy:classifier-entry" + 2917 "/policy:classifier-action-entry-cfg" + 2918 "/policy:action-cfg-params" + 2919 "/diffserv:meter-inline" + 2920 "/diffserv:meter-type" + 2921 "/diffserv:one-rate-tri-color-meter-type" + 2922 "/diffserv:one-rate-tri-color-meter" + 2923 "/diffserv:violate-action" + 2924 "/diffserv:violate-3color-meter-action-params" + 2925 "/diffserv:violate-3color-meter-action-val" { 2927 description 2928 "augment the one-rate-tri-color meter conform 2929 with actions"; 2930 case meter-action-drop { 2931 description 2932 "meter drop"; 2933 uses action:drop; 2934 } 2935 case meter-action-mark-dscp { 2936 description 2937 "meter action dscp marking"; 2938 uses action:dscp-marking; 2939 } 2940 } 2942 augment "/policy:policies" + 2943 "/policy:policy-entry" + 2944 "/policy:classifier-entry" + 2945 "/policy:classifier-action-entry-cfg" + 2946 "/policy:action-cfg-params" + 2947 "/diffserv:meter-inline" + 2948 "/diffserv:meter-type" + 2949 "/diffserv:two-rate-tri-color-meter-type" + 2950 "/diffserv:two-rate-tri-color-meter" + 2951 "/diffserv:conform-action" + 2952 "/diffserv:conform-3color-meter-action-params" + 2953 "/diffserv:conform-3color-meter-action-val" { 2955 description 2956 "augment the one-rate-tri-color meter conform 2957 with actions"; 2958 case meter-action-drop { 2959 description 2960 "meter drop"; 2961 uses action:drop; 2962 } 2963 case meter-action-mark-dscp { 2964 description 2965 "meter action dscp marking"; 2966 uses action:dscp-marking; 2967 } 2968 } 2969 augment "/policy:policies" + 2970 "/policy:policy-entry" + 2971 "/policy:classifier-entry" + 2972 "/policy:classifier-action-entry-cfg" + 2973 "/policy:action-cfg-params" + 2974 "/diffserv:meter-inline" + 2975 "/diffserv:meter-type" + 2976 "/diffserv:two-rate-tri-color-meter-type" + 2977 "/diffserv:two-rate-tri-color-meter" + 2978 "/diffserv:exceed-action" + 2979 "/diffserv:exceed-3color-meter-action-params" + 2980 "/diffserv:exceed-3color-meter-action-val" { 2982 description 2983 "augment the two-rate-tri-color meter exceed 2984 with actions"; 2985 case meter-action-drop { 2986 description 2987 "meter drop"; 2988 uses action:drop; 2989 } 2990 case meter-action-mark-dscp { 2991 description 2992 "meter action dscp marking"; 2993 uses action:dscp-marking; 2994 } 2995 } 2996 augment "/policy:policies" + 2997 "/policy:policy-entry" + 2998 "/policy:classifier-entry" + 2999 "/policy:classifier-action-entry-cfg" + 3000 "/policy:action-cfg-params" + 3001 "/diffserv:meter-inline" + 3002 "/diffserv:meter-type" + 3003 "/diffserv:two-rate-tri-color-meter-type" + 3004 "/diffserv:two-rate-tri-color-meter" + 3005 "/diffserv:violate-action" + 3006 "/diffserv:violate-3color-meter-action-params" + 3007 "/diffserv:violate-3color-meter-action-val" { 3008 description 3009 "augment the two-rate-tri-color meter violate 3010 with actions"; 3011 case meter-action-drop { 3012 description 3013 "meter drop"; 3014 uses action:drop; 3015 } 3016 case meter-action-mark-dscp { 3017 description 3018 "meter action dscp marking"; 3019 uses action:dscp-marking; 3020 } 3021 } 3022 augment "/policy:policies" + 3023 "/policy:policy-entry" + 3024 "/policy:classifier-entry" + 3025 "/policy:classifier-action-entry-cfg" + 3026 "/policy:action-cfg-params" + 3027 "/diffserv:meter-inline" + 3028 "/diffserv:meter-type" + 3029 "/diffserv:one-rate-two-color-meter-type" + 3030 "/diffserv:one-rate-two-color-meter" { 3031 description 3032 "augment the one-rate-two-color meter with" + 3033 "color classifiers"; 3034 container conform-color { 3035 uses classifier:classifier-entry-generic-attr; 3036 description 3037 "conform color classifier container"; 3038 } 3039 container exceed-color { 3040 uses classifier:classifier-entry-generic-attr; 3041 description 3042 "exceed color classifier container"; 3043 } 3044 } 3045 augment "/policy:policies" + 3046 "/policy:policy-entry" + 3047 "/policy:classifier-entry" + 3048 "/policy:classifier-action-entry-cfg" + 3049 "/policy:action-cfg-params" + 3050 "/diffserv:meter-inline" + 3051 "/diffserv:meter-type" + 3052 "/diffserv:one-rate-tri-color-meter-type" + 3053 "/diffserv:one-rate-tri-color-meter" { 3054 description 3055 "augment the one-rate-tri-color meter with" + 3056 "color classifiers"; 3057 container conform-color { 3058 uses classifier:classifier-entry-generic-attr; 3059 description 3060 "conform color classifier container"; 3061 } 3062 container exceed-color { 3063 uses classifier:classifier-entry-generic-attr; 3064 description 3065 "exceed color classifier container"; 3066 } 3067 container violate-color { 3068 uses classifier:classifier-entry-generic-attr; 3069 description 3070 "violate color classifier container"; 3072 } 3073 } 3074 augment "/policy:policies" + 3075 "/policy:policy-entry" + 3076 "/policy:classifier-entry" + 3077 "/policy:classifier-action-entry-cfg" + 3078 "/policy:action-cfg-params" + 3079 "/diffserv:meter-inline" + 3080 "/diffserv:meter-type" + 3081 "/diffserv:two-rate-tri-color-meter-type" + 3082 "/diffserv:two-rate-tri-color-meter" { 3083 description 3084 "augment the two-rate-tri-color meter with" + 3085 "color classifiers"; 3086 container conform-color { 3087 uses classifier:classifier-entry-generic-attr; 3088 description 3089 "conform color classifier container"; 3090 } 3091 container exceed-color { 3092 uses classifier:classifier-entry-generic-attr; 3093 description 3094 "exceed color classifier container"; 3095 } 3096 container violate-color { 3097 uses classifier:classifier-entry-generic-attr; 3098 description 3099 "violate color classifier container"; 3100 } 3101 } 3102 } 3104 A.2. Example of Company B Diffserv Model 3106 The following vendor example augments the qos and diffserv model, 3107 demonstrating some of the following functionality: 3109 - use of inline classifier definitions (defined inline in the policy 3110 vs referencing an externally defined classifier) 3112 - use of mulitple policy types, e.g. a queue policy, a scheduler 3113 policy, and a filter policy. All of these policies either augment 3114 the qos policy or the diffserv modules 3116 - use of a queue module, which uses and extends the queue grouping 3117 from the ietf-qos-action module 3119 - use of meter templates (v.s. meter inline) 3120 - use of internal meta data for classification and marking 3122 module example-compb-diffserv-filter-policy { 3123 yang-version 1; 3124 namespace "urn:ietf:params:xml:ns:yang:" + 3125 "example-compb-diffserv-filter-policy"; 3126 prefix compb-filter-policy; 3128 import ietf-qos-classifier { 3129 prefix classifier; 3130 } 3131 import ietf-qos-policy { 3132 prefix policy; 3133 } 3134 import ietf-qos-action { 3135 prefix action; 3136 } 3137 import ietf-diffserv { 3138 prefix diffserv; 3139 } 3141 organization "Company B"; 3142 contact 3143 "Editor: XYZ 3144 "; 3146 description 3147 "This module contains a collection of YANG definitions for 3148 configuring diffserv specification implementations. 3150 Copyright (c) 2014 IETF Trust and the persons identified as 3151 authors of the code. All rights reserved. 3153 Redistribution and use in source and binary forms, with or 3154 without modification, is permitted pursuant to, and subject 3155 to the license terms contained in, the Simplified BSD License 3156 set forth in Section 4.c of the IETF Trust's Legal Provisions 3157 Relating to IETF Documents 3158 (http://trustee.ietf.org/license-info). 3160 This version of this YANG module is part of RFC XXXX; see 3161 the RFC itself for full legal notices."; 3163 revision 2015-04-07 { 3164 description 3165 "Latest revision of diffserv policy"; 3166 reference "RFC XXXX"; 3167 } 3168 /************************************************* 3169 * Classification types 3170 *************************************************/ 3172 identity forwarding-class { 3173 base classifier:filter-type; 3174 description 3175 "Forwarding class filter type"; 3176 } 3178 identity internal-loss-priority { 3179 base classifier:filter-type; 3180 description 3181 "Internal loss priority filter type"; 3182 } 3184 grouping forwarding-class-cfg { 3185 list forwarding-class-cfg { 3186 key "forwarding-class"; 3187 description 3188 "list of forwarding-classes"; 3189 leaf forwarding-class { 3190 type string; 3191 description 3192 "Forwarding class name"; 3193 } 3194 } 3195 description 3196 "Filter containing list of forwarding classes"; 3197 } 3199 grouping loss-priority-cfg { 3200 list loss-priority-cfg { 3201 key "loss-priority"; 3202 description 3203 "list of loss-priorities"; 3204 leaf loss-priority { 3205 type enumeration { 3206 enum high { 3207 description "High Loss Priority"; 3208 } 3209 enum medium-high { 3210 description "Medium-high Loss Priority"; 3211 } 3212 enum medium-low { 3213 description "Medium-low Loss Priority"; 3214 } 3215 enum low { 3216 description "Low Loss Priority"; 3217 } 3218 } 3219 description 3220 "Loss-priority"; 3221 } 3222 } 3223 description 3224 "Filter containing list of loss priorities"; 3225 } 3227 augment "/policy:policies" + 3228 "/policy:policy-entry" + 3229 "/policy:classifier-entry" + 3230 "/policy:filter-entry" + 3231 "/diffserv:filter-params" { 3232 case forwarding-class { 3233 uses forwarding-class-cfg; 3234 description 3235 "Filter Type Internal-loss-priority"; 3236 } 3237 case internal-loss-priority { 3238 uses loss-priority-cfg; 3239 description 3240 "Filter Type Internal-loss-priority"; 3241 } 3242 description 3243 "Augments Diffserv Classifier with vendor" + 3244 " specific types"; 3245 } 3247 /************************************************* 3248 * Actions 3249 *************************************************/ 3251 identity mark-fwd-class { 3252 base policy:action-type; 3253 description 3254 "mark forwarding class action type"; 3255 } 3257 identity mark-loss-priority { 3258 base policy:action-type; 3259 description 3260 "mark loss-priority action type"; 3261 } 3263 grouping mark-fwd-class { 3264 container mark-fwd-class-cfg { 3265 leaf forwarding-class { 3266 type string; 3267 description 3268 "Forwarding class name"; 3269 } 3270 description 3271 "mark-fwd-class container"; 3272 } 3273 description 3274 "mark-fwd-class grouping"; 3275 } 3277 grouping mark-loss-priority { 3278 container mark-loss-priority-cfg { 3279 leaf loss-priority { 3280 type enumeration { 3281 enum high { 3282 description "High Loss Priority"; 3283 } 3284 enum medium-high { 3285 description "Medium-high Loss Priority"; 3286 } 3287 enum medium-low { 3288 description "Medium-low Loss Priority"; 3289 } 3290 enum low { 3291 description "Low Loss Priority"; 3292 } 3293 } 3294 description 3295 "Loss-priority"; 3296 } 3297 description 3298 "mark-loss-priority container"; 3299 } 3300 description 3301 "mark-loss-priority grouping"; 3302 } 3304 identity exceed-2color-meter-action-drop { 3305 base action:exceed-2color-meter-action-type; 3306 description 3307 "drop action type in a meter"; 3308 } 3310 identity meter-action-mark-fwd-class { 3311 base action:exceed-2color-meter-action-type; 3312 description 3313 "mark forwarding class action type"; 3314 } 3316 identity meter-action-mark-loss-priority { 3317 base action:exceed-2color-meter-action-type; 3318 description 3319 "mark loss-priority action type"; 3320 } 3322 identity violate-3color-meter-action-drop { 3323 base action:violate-3color-meter-action-type; 3324 description 3325 "drop action type in a meter"; 3326 } 3328 augment "/policy:policies/policy:policy-entry/" + 3329 "policy:classifier-entry/" + 3330 "policy:classifier-action-entry-cfg/" + 3331 "policy:action-cfg-params" { 3332 case mark-fwd-class { 3333 uses mark-fwd-class; 3334 description 3335 "Mark forwarding class in the packet"; 3336 } 3337 case mark-loss-priority { 3338 uses mark-loss-priority; 3339 description 3340 "Mark loss priority in the packet"; 3341 } 3342 case discard { 3343 uses action:discard; 3344 description 3345 "Discard action"; 3346 } 3347 description 3348 "Augments common diffserv policy actions"; 3349 } 3351 augment "/action:meter-template" + 3352 "/action:meter-entry" + 3353 "/action:meter-type" + 3354 "/action:one-rate-tri-color-meter-type" + 3355 "/action:one-rate-tri-color-meter" { 3356 leaf one-rate-color-aware { 3357 type boolean; 3358 description 3359 "This defines if the meter is color-aware"; 3360 } 3361 } 3362 augment "/action:meter-template" + 3363 "/action:meter-entry" + 3364 "/action:meter-type" + 3365 "/action:two-rate-tri-color-meter-type" + 3366 "/action:two-rate-tri-color-meter" { 3367 leaf two-rate-color-aware { 3368 type boolean; 3369 description 3370 "This defines if the meter is color-aware"; 3371 } 3372 } 3374 /* example of augmenting a meter template with a 3375 /* vendor specific action */ 3376 augment "/action:meter-template" + 3377 "/action:meter-entry" + 3378 "/action:meter-type" + 3379 "/action:one-rate-two-color-meter-type" + 3380 "/action:one-rate-two-color-meter" + 3381 "/action:exceed-action" + 3382 "/action:exceed-2color-meter-action-params" + 3383 "/action:exceed-2color-meter-action-val" { 3385 case exceed-2color-meter-action-drop { 3386 description 3387 "meter drop"; 3388 uses action:drop; 3389 } 3390 case meter-action-mark-fwd-class { 3391 uses mark-fwd-class; 3392 description 3393 "Mark forwarding class in the packet"; 3394 } 3395 case meter-action-mark-loss-priority { 3396 uses mark-loss-priority; 3397 description 3398 "Mark loss priority in the packet"; 3399 } 3400 } 3402 augment "/action:meter-template" + 3403 "/action:meter-entry" + 3404 "/action:meter-type" + 3405 "/action:two-rate-tri-color-meter-type" + 3406 "/action:two-rate-tri-color-meter" + 3407 "/action:violate-action" + 3408 "/action:violate-3color-meter-action-params" + 3409 "/action:violate-3color-meter-action-val" { 3410 case exceed-3color-meter-action-drop { 3411 description 3412 "meter drop"; 3413 uses action:drop; 3414 } 3416 description 3417 "Augment the actions to the two-color meter"; 3418 } 3420 augment "/action:meter-template" + 3421 "/action:meter-entry" + 3422 "/action:meter-type" + 3423 "/action:one-rate-tri-color-meter-type" + 3424 "/action:one-rate-tri-color-meter" + 3425 "/action:violate-action" + 3426 "/action:violate-3color-meter-action-params" + 3427 "/action:violate-3color-meter-action-val" { 3428 case exceed-3color-meter-action-drop { 3429 description 3430 "meter drop"; 3431 uses action:drop; 3432 } 3434 description 3435 "Augment the actions to basic meter"; 3436 } 3438 } 3439 module example-compb-queue-policy { 3440 yang-version 1; 3441 namespace "urn:ietf:params:xml:ns:yang:example-compb-queue-policy"; 3442 prefix queue-plcy; 3444 import ietf-qos-classifier { 3445 prefix classifier; 3446 } 3447 import ietf-qos-policy { 3448 prefix policy; 3449 } 3451 organization "Company B"; 3452 contact 3453 "Editor: XYZ 3454 "; 3456 description 3457 "This module defines a queue policy. The classification 3458 is based on aforwarding class, and the actions are queues. 3459 Copyright (c) 2014 IETF Trust and the persons identified as 3460 authors of the code. All rights reserved. 3461 Redistribution and use in source and binary forms, with or 3462 without modification, is permitted pursuant to, and subject 3463 to the license terms contained in, the Simplified BSD License 3464 set forth in Section 4.c of the IETF Trust's Legal Provisions 3465 Relating to IETF Documents 3466 (http://trustee.ietf.org/license-info). 3467 This version of this YANG module is part of RFC XXXX; see 3468 the RFC itself for full legal notices."; 3470 revision 2015-04-07 { 3471 description 3472 "Latest revision of diffserv policy"; 3473 reference "RFC XXXX"; 3474 } 3476 identity forwarding-class { 3477 base classifier:filter-type; 3478 description 3479 "Forwarding class filter type"; 3480 } 3482 grouping forwarding-class-cfg { 3483 leaf forwarding-class-cfg { 3484 type string; 3485 description 3486 "forwarding-class name"; 3487 } 3488 description 3489 "Forwarding class filter"; 3490 } 3492 augment "/policy:policies" + 3493 "/policy:policy-entry" + 3494 "/policy:classifier-entry" + 3495 "/policy:filter-entry" { 3496 /* Does NOT support "logical-not" of forwarding class. 3497 Use "must"? */ 3498 choice filter-params { 3499 description 3500 "Choice of filters"; 3501 case forwarding-class-cfg { 3502 uses forwarding-class-cfg; 3503 description 3504 "Filter Type Internal-loss-priority"; 3505 } 3506 } 3507 description 3508 "Augments Diffserv Classifier with fwd class filter"; 3509 } 3511 identity compb-queue { 3512 base policy:action-type; 3513 description 3514 "compb-queue action type"; 3515 } 3517 grouping compb-queue-name { 3518 container queue-name { 3519 leaf name { 3520 type string; 3521 description 3522 "Queue class name"; 3523 } 3524 description 3525 "compb queue container"; 3526 } 3527 description 3528 "compb-queue grouping"; 3529 } 3531 augment "/policy:policies" + 3532 "/policy:policy-entry" + 3533 "/policy:classifier-entry" + 3534 "/policy:classifier-action-entry-cfg" { 3535 choice action-cfg-params { 3536 description 3537 "Choice of action types"; 3538 case compb-queue { 3539 uses compb-queue-name; 3540 } 3541 } 3542 description 3543 "Augment the queue actions to queue policy entry"; 3544 } 3545 } 3547 module example-compb-queue { 3548 yang-version 1; 3549 namespace "urn:ietf:params:xml:ns:yang:ietf-compb-queue"; 3550 prefix compb-queue; 3551 import ietf-qos-action { 3552 prefix action; 3553 } 3555 organization "Company B"; 3556 contact 3557 "Editor: XYZ 3558 "; 3560 description 3561 "This module describes a compb queue module. This is a 3562 template for a queue within a queue policy, referenced 3563 by name. 3565 This version of this YANG module is part of RFC XXXX; see 3566 the RFC itself for full legal notices."; 3568 revision 2015-04-07 { 3569 description 3570 "Latest revision of diffserv based classifier"; 3571 reference "RFC XXXX"; 3572 } 3574 container compb-queue { 3575 description 3576 "Queue used in compb architecture"; 3577 leaf name { 3578 type string; 3579 description 3580 "A unique name identifying this queue"; 3581 } 3582 uses action:queue; 3583 container excess-rate { 3584 choice excess-rate-type { 3585 case percent { 3586 leaf excess-rate-percent { 3587 type uint32 { 3588 range "1..100"; 3589 } 3590 description 3591 "excess-rate-percent"; 3592 } 3593 } 3594 case proportion { 3595 leaf excess-rate-poroportion { 3596 type uint32 { 3597 range "1..1000"; 3598 } 3599 description 3600 "excess-rate-poroportion"; 3601 } 3602 } 3603 description 3604 "Choice of excess-rate type"; 3605 } 3606 description 3607 "Excess rate value"; 3608 } 3609 leaf excess-priority { 3610 type enumeration { 3611 enum high { 3612 description "High Loss Priority"; 3613 } 3614 enum medium-high { 3615 description "Medium-high Loss Priority"; 3616 } 3617 enum medium-low { 3618 description "Medium-low Loss Priority"; 3619 } 3620 enum low { 3621 description "Low Loss Priority"; 3622 } 3623 enum none { 3624 description "No excess priority"; 3625 } 3626 } 3627 description 3628 "Priority of excess (above guaranted rate) traffic"; 3629 } 3630 container buffer-size { 3631 choice buffer-size-type { 3632 case percent { 3633 leaf buffer-size-percent { 3634 type uint32 { 3635 range "1..100"; 3636 } 3637 description 3638 "buffer-size-percent"; 3639 } 3640 } 3641 case temporal { 3642 leaf buffer-size-temporal { 3643 type uint64; 3644 units "microsecond"; 3645 description 3646 "buffer-size-temporal"; 3648 } 3649 } 3650 case remainder { 3651 leaf buffer-size-remainder { 3652 type empty; 3653 description 3654 "use remaining of buffer"; 3655 } 3656 } 3657 description 3658 "Choice of buffer size type"; 3659 } 3660 description 3661 "Buffer size value"; 3662 } 3663 } 3665 augment 3666 "/compb-queue" + 3667 "/queue-cfg" + 3668 "/algorithmic-drop-cfg" + 3669 "/drop-algorithm" { 3670 case random-detect { 3671 list drop-profile-list { 3672 key "priority"; 3673 description 3674 "map of priorities to drop-algorithms"; 3675 leaf priority { 3676 type enumeration { 3677 enum any { 3678 description "Any priority mapped here"; 3679 } 3680 enum high { 3681 description "High Priority Packet"; 3682 } 3683 enum medium-high { 3684 description "Medium-high Priority Packet"; 3685 } 3686 enum medium-low { 3687 description "Medium-low Priority Packet"; 3688 } 3689 enum low { 3690 description "Low Priority Packet"; 3691 } 3692 } 3693 description 3694 "Priority of guaranteed traffic"; 3695 } 3696 leaf drop-profile { 3697 type string; 3698 description 3699 "drop profile to use for this priority"; 3700 } 3701 } 3702 } 3703 description 3704 "compb random detect drop algorithm config"; 3705 } 3706 } 3708 module example-compb-scheduler-policy { 3709 yang-version 1; 3710 namespace "urn:ietf:params:xml:ns:yang:" + 3711 "example-compb-scheduler-policy"; 3712 prefix scheduler-plcy; 3714 import ietf-qos-action { 3715 prefix action; 3716 } 3718 import ietf-qos-policy { 3719 prefix policy; 3720 } 3722 organization "Company B"; 3723 contact 3724 "Editor: XYZ 3725 "; 3727 description 3728 "This module defines a scheduler policy. The classification 3729 is based on classifier-any, and the action is a scheduler."; 3731 revision 2015-04-07 { 3732 description 3733 "Latest revision of diffserv policy"; 3734 reference "RFC XXXX"; 3735 } 3737 identity queue-policy { 3738 base policy:action-type; 3739 description 3740 "forwarding-class-queue action type"; 3741 } 3743 grouping queue-policy-name { 3744 container compb-queue-policy-name { 3745 leaf name { 3746 type string; 3747 description 3748 "Queue policy name"; 3749 } 3750 description 3751 "compb-queue-policy container"; 3752 } 3753 description 3754 "compb-queue policy grouping"; 3755 } 3757 augment "/policy:policies" + 3758 "/policy:policy-entry" + 3759 "/policy:classifier-entry" + 3760 "/policy:classifier-action-entry-cfg" { 3761 choice action-cfg-params { 3762 case schedular { 3763 uses action:schedular; 3764 } 3765 case queue-policy { 3766 uses queue-policy-name; 3767 } 3768 description 3769 "Augment the scheduler policy with a queue policy"; 3770 } 3771 } 3772 } 3774 A.3. Example of Company C Diffserv Model 3776 Company C vendor augmentation is based on Ericsson's implementation 3777 differentiated QoS. This implementation first sorts traffic based on 3778 a classifier, which can sort traffic into one or more traffic 3779 forwarding classes. Then, a policer or meter policy references the 3780 classifier and its traffic forwarding classes to specify different 3781 service levels for each traffic forwarding class. 3783 Because each classifier sorts traffic into one or more traffic 3784 forwarding classes, this type of classifier does not align with ietf- 3785 qos-classifier.yang, which defines one traffic forwarding class per 3786 classifier. Additionally, Company C's policing and metering policies 3787 relies on the classifier's pre-defined traffic forwarding classes to 3788 provide differentiated services, rather than redefining the patterns 3789 within a policing or metering policy, as is defined in ietf- 3790 diffserv.yang. 3792 Due to these differences, even though Company C uses all the building 3793 blocks of classifier and policy, Company C's augmentation does not 3794 use ietf-diffserv.yang to provide differentiated service levels. 3795 Instead, Company C's augmentation uses the basic building blocks, 3796 ietf-qos-policy.yang to provide differentiated services. 3798 module example-compc-qos-policy { 3799 yang-version 1.1; 3800 namespace "urn:example-compc-qos-policy"; 3801 prefix "compcqos"; 3803 import ietf-qos-policy { 3804 prefix "pol"; 3805 } 3807 import ietf-qos-action { 3808 prefix "action"; 3809 } 3811 organization ""; 3812 contact ""; 3813 description ""; 3815 revision 2016-09-26 { 3816 description ""; 3817 reference ""; 3818 } 3820 /* identities */ 3822 identity compc-qos-policy { 3823 base pol:policy-type; 3824 } 3826 identity mdrr-queuing-policy { 3827 base compc-qos-policy; 3828 } 3830 identity pwfq-queuing-policy { 3831 base compc-qos-policy; 3832 } 3834 identity policing-policy { 3835 base compc-qos-policy; 3836 } 3838 identity metering-policy { 3839 base compc-qos-policy; 3841 } 3843 identity forwarding-policy { 3844 base compc-qos-policy; 3845 } 3847 identity overhead-profile-policy { 3848 base compc-qos-policy; 3849 } 3851 identity resource-profile-policy { 3852 base compc-qos-policy; 3853 } 3855 identity protocol-rate-limit-policy { 3856 base compc-qos-policy; 3857 } 3859 identity compc-qos-action { 3860 base pol:action-type; 3861 } 3863 /* groupings */ 3865 grouping redirect-action-grp { 3866 container redirect { 3867 /* Redirect options */ 3868 } 3869 } 3871 /* deviations */ 3873 deviation "/pol:policies/pol:policy-entry" { 3874 deviate add { 3875 must "pol:type = compc-qos-policy" { 3876 description 3877 "Only policy types drived from compc-qos-policy " + 3878 "are supported"; 3879 } 3880 } 3881 } 3883 deviation "/pol:policies/pol:policy-entry/pol:classifier-entry" { 3884 deviate add { 3885 must "../per-class-action = 'true'" { 3886 description 3887 "Only policies with per-class actions have classifiers"; 3888 } 3889 must "((../sub-type != 'mdrr-queuing-policy') and " + 3890 " (../sub-type != 'pwfq-queuing-policy')) or " + 3891 "(((../sub-type = 'mdrr-queuing-policy') or " + 3892 " (../sub-type = 'pwfq-queueing-policy')) and " + 3893 " ((classifier-entry-name = '0') or " + 3894 " (classifier-entry-name = '1') or " + 3895 " (classifier-entry-name = '2') or " + 3896 " (classifier-entry-name = '3') or " + 3897 " (classifier-entry-name = '4') or " + 3898 " (classifier-entry-name = '5') or " + 3899 " (classifier-entry-name = '6') or " + 3900 " (classifier-entry-name = '7') or " + 3901 " (classifier-entry-name = '8')))" { 3902 description 3903 "MDRR queuing policy's or PWFQ queuing policy's " + 3904 "classifier-entry-name is limited to the listed values"; 3905 } 3906 } 3907 } 3909 deviation "/pol:policies/pol:policy-entry/pol:classifier-entry" + 3910 "/pol:classifier-action-entry-cfg" { 3911 deviate add { 3912 max-elements 1; 3913 must "action-type = 'compc-qos-action'" { 3914 description 3915 "Only compc-qos-action is allowed"; 3916 } 3917 } 3918 } 3920 /* augments */ 3922 augment "/pol:policies/pol:policy-entry" { 3923 when "pol:type = 'compc-qos-policy')" { 3924 description 3925 "Additional nodes only for diffserv-policy"; 3926 } 3927 leaf sub-type { 3928 type identityref { 3929 base compc-qos-policy; 3930 } 3931 mandatory true; 3932 /* The value of this leaf must not change once configured */ 3933 } 3934 leaf per-class-action { 3935 mandatory true; 3936 type boolean; 3937 must "(((. = 'true') and " + 3938 " ((../sub-type = 'policing-policy') or " + 3939 " (../sub-type = 'metering-policy') or " + 3940 " (../sub-type = 'mdrr-queuing-policy') or " + 3941 " (../sub-type = 'pwfq-queuing-policy') or " + 3942 " (../sub-type = 'forwarding-policy'))) or " + 3943 " ((. = 'false') and " + 3944 " ((../sub-type = 'overhead-profile-policy') or " + 3945 " (../sub-type = 'resource-profile-policy') or " + 3946 " (../sub-type = 'protocol-rate-limit-policy')))" { 3947 description 3948 "Only certain policies have per-class action"; 3949 } 3950 } 3951 container traffic-classifier { 3952 presence true; 3953 when "../sub-type = 'policing-policy' or " + 3954 "../sub-type = 'metering-policy' or " + 3955 "../sub-type = 'forwarding-policy'" { 3956 description 3957 "A classifier for policing-policy or metering-policy"; 3958 } 3959 leaf name { 3960 type string; 3961 mandatory true; 3962 description 3963 "Traffic classifier name"; 3964 } 3965 leaf type { 3966 type enumeration { 3967 enum 'internal-dscp-only-classifier' { 3968 value 0; 3969 description 3970 "Classify traffic based on (internal) dscp only"; 3971 } 3972 enum 'ipv4-header-based-classifier' { 3973 value 1; 3974 description 3975 "Classify traffic based on IPv4 packet header fields"; 3976 } 3977 enum 'ipv6-header-based-classifier' { 3978 value 2; 3979 description 3980 "Classify traffic based on IPv6 packet header fields"; 3981 } 3982 } 3983 mandatory true; 3984 description 3985 "Traffic classifier type"; 3986 } 3987 } 3988 container traffic-queue { 3989 when "(../sub-type = 'mdrr-queuing-policy') or " + 3990 "(../sub-type = 'pwfq-queuing-policy')" { 3991 description 3992 "Queuing policy properties"; 3993 } 3994 leaf queue-map { 3995 type string; 3996 description 3997 "Traffic queue map for queuing policy"; 3998 } 3999 } 4000 container overhead-profile { 4001 when "../sub-type = 'overhead-profile-policy'" { 4002 description 4003 "Overhead profile policy properties"; 4004 } 4005 } 4006 container resource-profile { 4007 when "../sub-type = 'resource-profile-policy'" { 4008 description 4009 "Resource profile policy properties"; 4010 } 4011 } 4012 container protocol-rate-limit { 4013 when "../sub-type = 'protocol-rate-limit-policy'" { 4014 description 4015 "Protocol rate limit policy properties"; 4016 } 4017 } 4018 } 4020 augment "/pol:policies/pol:policy-entry/pol:classifier-entry" + 4021 "/pol:classifier-action-entry-cfg/pol:action-cfg-params" { 4022 when "../../../pol:type = 'compc-qos-policy')" { 4023 description 4024 "Configurations for a classifier-policy-type policy"; 4025 } 4026 case metering-or-policing-policy { 4027 when "../../../sub-type = 'policing-policy' or " 4028 + "../../../sub-type = 'metering-policy'" { 4029 } 4030 container dscp-marking { 4031 uses action:dscp-marking; 4032 } 4033 container precedence-marking { 4034 uses action:dscp-marking; 4035 } 4036 container priority-marking { 4037 uses action:priority; 4038 } 4039 container rate-limiting { 4040 uses action:one-rate-two-color-meter; 4041 } 4042 } 4043 case mdrr-queuing-policy { 4044 when "../../../sub-type = 'mdrr-queuing-policy'" { 4045 description 4046 "MDRR queue handling properties for the traffic " + 4047 "classified into current queue"; 4048 } 4049 leaf mdrr-queue-weight { 4050 type uint8 { 4051 range "20..100"; 4052 } 4053 units percentage; 4054 } 4055 } 4056 case pwfq-queuing-policy { 4057 when "../../../sub-type = 'pwfq-queuing-policy'" { 4058 description 4059 "PWFQ queue handling properties for traffic " + 4060 "classified into current queue"; 4061 } 4062 leaf pwfq-queue-weight { 4063 type uint8 { 4064 range "20..100"; 4065 } 4066 units percentage; 4067 } 4068 leaf pwfq-queue-priority { 4069 type uint8; 4070 } 4071 leaf pwfq-queue-rate { 4072 type uint8; 4073 } 4074 } 4075 case forwarding-policy { 4076 when "../../../sub-type = 'forwarding-policy'" { 4077 description 4078 "Forward policy handling properties for traffic " + 4079 "in this classifier"; 4080 } 4081 uses redirect-action-grp; 4082 } 4083 description 4084 "Add the classify action configuration"; 4085 } 4087 } 4089 Authors' Addresses 4091 Aseem Choudhary 4092 Cisco Systems 4093 170 W. Tasman Drive 4094 San Jose, CA 95134 4095 US 4097 Email: asechoud@cisco.com 4099 Mahesh Jethanandani 4100 Cisco Systems 4101 170 W. Tasman Drive 4102 San Jose, CA 95134 4103 US 4105 Email: mjethanandani@gmail.com 4107 Norm Strahle 4108 Juniper Networks 4109 1194 North Mathilda Avenue 4110 Sunnyvale, CA 94089 4111 US 4113 Email: nstrahle@juniper.net 4115 Ebben Aries 4116 Juniper Networks 4117 1194 North Mathilda Avenue 4118 Sunnyvale, CA 94089 4119 US 4121 Email: exa@juniper.net 4122 Ing-Wher Chen 4123 Jabil 4125 Email: ing-wher_chen@jabil.com