Internet-Draft | YANG Models for QoS | July 2022 |
Choudhary, et al. | Expires 8 January 2023 | [Page] |
This document describes a YANG model for configuration of Quality of Service (QoS) configuration in network devices. This document doesn't describe QoS statistics counters.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 8 January 2023.¶
Copyright (c) 2022 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
This document defines a base YANG [RFC6020] [RFC7950] model for Quality of Service (QoS) configuration parameters. QoS base modules define the basic building blocks to define a classifier, policy, action and target. The base models are augmented to include packet match fields and action parameters to define the Diffrentiated Services (DiffServ) module. Queues and schedulers are stitched as part of diffserv policy model. Separate models have been defined for creating Queue policy and Scheduling policy. The DiffServ model is based on DiffServ architecture, and various references have been made to available standard architecture documents.¶
DiffServ is a preferred approach for network service providers to offer services to different customers based on their network Quality-of-Service (QoS) objectives. The traffic streams are differentiated based on DiffServ Code Points (DSCP) carried in the IP header of each packet. The DSCP markings are applied by upstream node or by the edge router on entry to the DiffServ network.¶
The YANG modules in this document conform to the Network Management Datastore Architecture (NMDA) [RFC8342].¶
Tree diagrams used in this document follow the notation defined in [RFC8340]¶
Editorial Note: (To be removed by RFC Editor)¶
This draft contains several placeholder values that need to be replaced with finalized values at the time of publication. Please apply the following replacements:¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
This document uses definitions and acronyms defined in Definitions of the Differentiated Services Field (DS Field) in the IPv4 and IPv6 Headers [RFC2474], An Architecture for Differentiated Services [RFC2475], and other documents. Here are some of them.¶
A classifier consists of packets which may be grouped when a logical set of rules are applied on different packet header fields. The grouping may be based on different values or range of values of same packet header field, presence or absence of some values or range of values of a packet field or a combination thereof. The QoS classifier is defined in the ietf-qos-classifier module.¶
A classifier entry contains one or more packet conditioning functions. A packet conditioning function is typically based on direction of traffic and may drop, mark or delay network packets. A set of classifier entries with corresponding conditioning functions when arranged in order of priority represents a QoS policy. A QoS policy may contain one or more classifier entries. These are defined in ietf-traffic-policy module.¶
Actions are configured in line with respect to the policy module. These include marking, dropping or shaping. Actions are defined in the ietf-qos-action module.¶
A meter qualifies if the traffic arrival rate is based on agreed upon rate and variability. A meter is modeled based on commonly used alogrithms in industry, Single Rate Tri Color Marking (srTCM) [RFC2697] meter, Two Rate Tri Color Marking (trTCM) [RFC2698] meter, and Single Rate Two Color Marking meter. Different vendors can extend it with other types of meters as well.¶
QoS operational model include QoS policy applied to an interface in each direction of traffic. For each QoS policy applied to an interface the model further includes counters for associated Classifiers, Meters and Queues in a particular direction. To modularize and for reusability, grouping have been defined for various counters of classifier, Meters and Queues. The target is assumed to be interface but the groupings can be used for any other target type where QoS policy is applied.¶
DiffServ architecture [RFC3289] and [RFC2475] describe the architecture as a simple model where traffic entering a network is classified and possibly conditioned at the boundary of the network and assigned a different Behavior Aggregate (BA). Each BA is identified by a specific value of DSCP, and is used to select a Per Hop Behavior (PHB).¶
The packet classification policy identifies the subset of traffic which may receive a DiffServ by being conditioned or mapped. Packet classifiers select packets within a stream based on the content of some portion of the packet header. There are two types of classifiers, the BA classifier, and the Multi-Field (MF) classifier which selects packets based on a value which is combination of one or more header fields. In the ietf-diffserv module, this is realized by augmenting the QoS classification module.¶
Traffic conditioning includes metering, shaping and/or marking. A meter is used to measure the traffic against a given traffic profile. The traffic profile specifies the temporal property of the traffic. A packet that arrives is first determined to be in or out of the profile, which will result in the action of marked, dropped or shaped. This is realized in vendor specific modules based on the parameters defined in action module. The metering parameters are augmented to the QoS policy module when metering is defined inline, and to the metering template when metering profile is referred in policy module.¶
This document defines seven YANG modules - four QoS base modules, a scheduler policy module, a queuing policy module and one DiffServ module.¶
ietf-qos-classifier consists of classifier entries identified by a classifier entry name. Each entry MAY contain a list of filter entries. When no filter entry is present in a classifier entry, it matches all traffic.¶
An ietf-traffic-policy module contains list of policy objects identified by a policy name and policy type which MUST be provided. With different values of policy types, each vendor MAY define their own construct of policy for different QoS functionalities. Each vendor MAY augment classifier entry in a policy definition with a set of actions.¶
ietf-qos-action module contains grouping of set of QoS actions. These include metering, marking, dropping and shaping. Marking sets DiffServ codepoint value in the classified packet. Color-aware and Color-blind meters are augmented by vendor specific modules based on the parameters defined in action module.¶
ietf-qos-target module contains reference of qos-policy and augments ietf-interfaces [RFC8343] module. A single policy of a particular policy-type can be applied on an interface in each direction of traffic. Policy-type is of type identity and is populated in a vendor specific manner. This way it provides greater flexibility for each vendor to define different policy types each with its own capabilities and restrictions.¶
Classifier, metering and queuing counters are associated with a target.¶
Diffserv module augments QoS classifier module. Many of the YANG types defined in [RFC6991] are represented as leafs in the classifier module.¶
Metering and marking actions are realized by augmenting the QoS policy-module. Any queuing, AQM and scheduling actions are part of vendor specific augmentation. Statistics are realized by augmenting the QoS target module.¶
Classifier statistics consist of list of classifier entries identified by a classifier entry name. Classifier counters include matched packets and bytes, and average rate of traffic matching a particular classifier.¶
Metering statistics consist of meters identified by an identifier. Metering counters include conform, exceed, violate, drop packets, and bytes.¶
Queuing counters include instantaneous, peak, average queue length, as well as output conform, exceed, tail drop packets and bytes.¶
Named statistics is defined as statistics which is tagged by a name. This could be aggregated or non-aggregated. Aggregated named statistics is defined as counters which are aggregated across classifier entries in a policy applied to an interface in a particular direction. Non-aggregated named statistics are counters of classifier, metering or queuing which have the same tag name but maintained separately.¶
Modules defined in this draft import definitions from "Common YANG Data Types" [RFC6991] and "A YANG Data Model for Interface Management" [RFC8343].¶
TBD¶
The authors wish to thank Ruediger Geib, Fred Baker, Greg Misky, Tom Petch, Acee Lindem, many others for their helpful comments.¶
MITRE has approved this document for Public Release, Distribution Unlimited, with Public Release Case Number 19-3027.¶
The following people have substantially contributed to the editing of this document:¶
Norm Strahle Email: nstrahle@juniper.net .¶
Company A, Company B and Company C Diffserv modules augments all the filter types of the QoS classifier module as well as the QoS policy module that allow it to define marking, metering, min-rate, max-rate actions. Queuing and metering counters are realized by augmenting of the QoS target module.¶
The following Company A vendor example augments the qos and diffserv model, demonstrating some of the following functionality:¶
- use of template based classifier definitions¶
- use of single policy type modelling queue, scheduler policy, and a filter policy. All of these policies either augment the qos policy or the diffserv modules¶
- use of inline actions in a policy¶
- flexibility in marking dscp or metadata at ingress and/or egress.¶
module example-compa-diffserv { yang-version 1.1; namespace "urn:ietf:params:xml:ns:yang:example-compa-diffserv"; prefix example; import ietf-traffic-policy { prefix policy; reference "RFC XXXX: YANG Model for QoS"; } import ietf-qos-action { prefix action; reference "RFC XXXX: YANG Model for QoS"; } import ietf-diffserv { prefix diffserv; reference "RFC XXXX: YANG Model for QoS"; } organization "Company A"; contact "Editor: XYZ <mailto:xyz@compa.com>"; description "This module contains a collection of YANG definitions of companyA diffserv specification extension."; Copyright (c) 2021 IETF Trust and the persons identified as authors of the code. All rights reserved. Redistribution and use in source and binary forms, with or without modification, is permitted pursuant to, and subject to the license terms contained in, the Simplified BSD License set forth in Section 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info). This version of this YANG module is part of RFC XXXX; see the RFC itself for full legal notices."; revision 2021-07-12 { description "Initial revision for diffserv actions on network packets"; reference "RFC 6020: YANG - A Data Modeling Language for the Network Configuration Protocol (NETCONF)"; } identity default-policy-type { base policy:policy-type; description "This defines default policy-type"; } identity qos-group { base policy:filter-type; description "qos-group filter-type"; } grouping qos-group-cfg { list qos-group-cfg { key "qos-group-min qos-group-max"; description "list of dscp ranges"; leaf qos-group-min { type uint8; description "Minimum value of qos-group range"; } leaf qos-group-max { type uint8; must ". >= ../qos-group-min" { error-message "The qos-group-max must be greater than or equal to qos-group-min"; } description "maximum value of qos-group range"; } } description "Filter containing list of qos-group ranges"; } grouping wred-threshold { container wred-min-thresh { uses action:threshold; description "Minimum threshold"; } container wred-max-thresh { uses action:threshold; description "Maximum threshold"; } leaf mark-probability { type uint32 { range "1..1000"; } description "Mark probability"; } description "WRED threshold attributes"; } grouping randomdetect { leaf exp-weighting-const { type uint32; description "Exponential weighting constant factor for wred profile"; } uses wred-threshold; description "Random detect attributes"; } augment "/policy:classifiers/" + "policy:classifier-entry/" + "policy:filter-entry/diffserv:filter-param" { case qos-group { uses qos-group-cfg; description "Filter containing list of qos-group ranges. Qos-group represent packet metadata information in a device. "; } description "augmentation of classifier filters"; } augment "/policy:policies/policy:policy-entry/" + "policy:classifier-entry/" + "policy:classifier-action-entry-cfg/" + "policy:action-cfg-params" { case random-detect { uses randomdetect; } description "Augment the actions to policy entry"; } augment "/policy:policies" + "/policy:policy-entry" + "/policy:classifier-entry" + "/policy:classifier-action-entry-cfg" + "/policy:action-cfg-params" + "/diffserv:meter-inline" + "/diffserv:meter-type" + "/diffserv:one-rate-two-color-meter-type" + "/diffserv:one-rate-two-color-meter" + "/diffserv:conform-action" + "/diffserv:conform-2color-meter-action-params" + "/diffserv:conform-2color-meter-action-val" { description "augment the one-rate-two-color meter conform with actions"; case meter-action-drop { description "meter drop"; uses action:drop; } case meter-action-mark-dscp { description "meter action dscp marking"; uses action:dscp-marking; } } augment "/policy:policies" + "/policy:policy-entry" + "/policy:classifier-entry" + "/policy:classifier-action-entry-cfg" + "/policy:action-cfg-params" + "/diffserv:meter-inline" + "/diffserv:meter-type" + "/diffserv:one-rate-two-color-meter-type" + "/diffserv:one-rate-two-color-meter" + "/diffserv:exceed-action" + "/diffserv:exceed-2color-meter-action-params" + "/diffserv:exceed-2color-meter-action-val" { description "augment the one-rate-two-color meter exceed with actions"; case meter-action-drop { description "meter drop"; uses action:drop; } case meter-action-mark-dscp { description "meter action dscp marking"; uses action:dscp-marking; } } augment "/policy:policies" + "/policy:policy-entry" + "/policy:classifier-entry" + "/policy:classifier-action-entry-cfg" + "/policy:action-cfg-params" + "/diffserv:meter-inline" + "/diffserv:meter-type" + "/diffserv:one-rate-tri-color-meter-type" + "/diffserv:one-rate-tri-color-meter" + "/diffserv:conform-action" + "/diffserv:conform-3color-meter-action-params" + "/diffserv:conform-3color-meter-action-val" { description "augment the one-rate-tri-color meter conform with actions"; case meter-action-drop { description "meter drop"; uses action:drop; } case meter-action-mark-dscp { description "meter action dscp marking"; uses action:dscp-marking; } } augment "/policy:policies" + "/policy:policy-entry" + "/policy:classifier-entry" + "/policy:classifier-action-entry-cfg" + "/policy:action-cfg-params" + "/diffserv:meter-inline" + "/diffserv:meter-type" + "/diffserv:one-rate-tri-color-meter-type" + "/diffserv:one-rate-tri-color-meter" + "/diffserv:exceed-action" + "/diffserv:exceed-3color-meter-action-params" + "/diffserv:exceed-3color-meter-action-val" { description "augment the one-rate-tri-color meter exceed with actions"; case meter-action-drop { description "meter drop"; uses action:drop; } case meter-action-mark-dscp { description "meter action dscp marking"; uses action:dscp-marking; } } augment "/policy:policies" + "/policy:policy-entry" + "/policy:classifier-entry" + "/policy:classifier-action-entry-cfg" + "/policy:action-cfg-params" + "/diffserv:meter-inline" + "/diffserv:meter-type" + "/diffserv:one-rate-tri-color-meter-type" + "/diffserv:one-rate-tri-color-meter" + "/diffserv:violate-action" + "/diffserv:violate-3color-meter-action-params" + "/diffserv:violate-3color-meter-action-val" { description "augment the one-rate-tri-color meter conform with actions"; case meter-action-drop { description "meter drop"; uses action:drop; } case meter-action-mark-dscp { description "meter action dscp marking"; uses action:dscp-marking; } } augment "/policy:policies" + "/policy:policy-entry" + "/policy:classifier-entry" + "/policy:classifier-action-entry-cfg" + "/policy:action-cfg-params" + "/diffserv:meter-inline" + "/diffserv:meter-type" + "/diffserv:two-rate-tri-color-meter-type" + "/diffserv:two-rate-tri-color-meter" + "/diffserv:conform-action" + "/diffserv:conform-3color-meter-action-params" + "/diffserv:conform-3color-meter-action-val" { description "augment the one-rate-tri-color meter conform with actions"; case meter-action-drop { description "meter drop"; uses action:drop; } case meter-action-mark-dscp { description "meter action dscp marking"; uses action:dscp-marking; } } augment "/policy:policies" + "/policy:policy-entry" + "/policy:classifier-entry" + "/policy:classifier-action-entry-cfg" + "/policy:action-cfg-params" + "/diffserv:meter-inline" + "/diffserv:meter-type" + "/diffserv:two-rate-tri-color-meter-type" + "/diffserv:two-rate-tri-color-meter" + "/diffserv:exceed-action" + "/diffserv:exceed-3color-meter-action-params" + "/diffserv:exceed-3color-meter-action-val" { description "augment the two-rate-tri-color meter exceed with actions"; case meter-action-drop { description "meter drop"; uses action:drop; } case meter-action-mark-dscp { description "meter action dscp marking"; uses action:dscp-marking; } } augment "/policy:policies" + "/policy:policy-entry" + "/policy:classifier-entry" + "/policy:classifier-action-entry-cfg" + "/policy:action-cfg-params" + "/diffserv:meter-inline" + "/diffserv:meter-type" + "/diffserv:two-rate-tri-color-meter-type" + "/diffserv:two-rate-tri-color-meter" + "/diffserv:violate-action" + "/diffserv:violate-3color-meter-action-params" + "/diffserv:violate-3color-meter-action-val" { description "augment the two-rate-tri-color meter violate with actions"; case meter-action-drop { description "meter drop"; uses action:drop; } case meter-action-mark-dscp { description "meter action dscp marking"; uses action:dscp-marking; } } augment "/policy:policies" + "/policy:policy-entry" + "/policy:classifier-entry" + "/policy:classifier-action-entry-cfg" + "/policy:action-cfg-params" + "/diffserv:meter-inline" + "/diffserv:meter-type" + "/diffserv:one-rate-two-color-meter-type" + "/diffserv:one-rate-two-color-meter" { description "augment the one-rate-two-color meter with" + "color classifiers"; container conform-color { uses classifier:classifier-entry-generic-attr; description "conform color classifier container"; } container exceed-color { uses classifier:classifier-entry-generic-attr; description "exceed color classifier container"; } } augment "/policy:policies" + "/policy:policy-entry" + "/policy:classifier-entry" + "/policy:classifier-action-entry-cfg" + "/policy:action-cfg-params" + "/diffserv:meter-inline" + "/diffserv:meter-type" + "/diffserv:one-rate-tri-color-meter-type" + "/diffserv:one-rate-tri-color-meter" { description "augment the one-rate-tri-color meter with" + "color classifiers"; container conform-color { uses classifier:classifier-entry-generic-attr; description "conform color classifier container"; } container exceed-color { uses classifier:classifier-entry-generic-attr; description "exceed color classifier container"; } container violate-color { uses policy:classifier-entry-generic-attr; description "violate color classifier container"; } } augment "/policy:policies" + "/policy:policy-entry" + "/policy:classifier-entry" + "/policy:classifier-action-entry-cfg" + "/policy:action-cfg-params" + "/diffserv:meter-inline" + "/diffserv:meter-type" + "/diffserv:two-rate-tri-color-meter-type" + "/diffserv:two-rate-tri-color-meter" { description "augment the two-rate-tri-color meter with" + "color classifiers"; container conform-color { uses classifier:classifier-entry-generic-attr; description "conform color classifier container"; } container exceed-color { uses policy:classifier-entry-generic-attr; description "exceed color classifier container"; } container violate-color { uses policy:classifier-entry-generic-attr; description "violate color classifier container"; } } }¶
The following vendor example augments the qos and diffserv model, demonstrating some of the following functionality:¶
- use of inline classifier definitions (defined inline in the policy vs referencing an externally defined classifier)¶
- use of mulitple policy types, e.g. a queue policy, a scheduler policy, and a filter policy. All of these policies either augment the qos policy or the diffserv modules¶
- use of a queue module, which uses and extends the queue grouping from the ietf-qos-action module¶
- use of meter templates (v.s. meter inline)¶
- use of internal meta data for classification and marking¶
module example-compb-diffserv-filter-policy { yang-version 1.1; namespace "urn:ietf:params:xml:ns:yang:" + "example-compb-diffserv-filter-policy"; prefix compb-filter-policy; import ietf-traffic-policy { prefix policy; reference "RFC XXXX: YANG Model for QoS"; } import ietf-qos-action { prefix action; reference "RFC XXXX: YANG Model for QoS"; } import ietf-diffserv { prefix diffserv; reference "RFC XXXX: YANG Model for QoS"; } organization "Company B"; contact "Editor: XYZ <mailto:xyz@compb.com>"; description "This module contains a collection of YANG definitions for configuring diffserv specification implementations. Copyright (c) 2021 IETF Trust and the persons identified as authors of the code. All rights reserved. Redistribution and use in source and binary forms, with or without modification, is permitted pursuant to, and subject to the license terms contained in, the Simplified BSD License set forth in Section 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info). This version of this YANG module is part of RFC XXXX; see the RFC itself for full legal notices."; revision 2021-07-12 { description "Initial revision of Company B diffserv policy"; reference "RFC XXXX"; } /************************************************* * Classification types *************************************************/ identity forwarding-class { base policy:filter-type; description "Forwarding class filter type"; } identity internal-loss-priority { base policy:filter-type; description "Internal loss priority filter type"; } grouping forwarding-class-cfg { list forwarding-class-cfg { key "forwarding-class"; description "list of forwarding-classes"; leaf forwarding-class { type string; description "Forwarding class name"; } } description "Filter containing list of forwarding classes"; } grouping loss-priority-cfg { list loss-priority-cfg { key "loss-priority"; description "list of loss-priorities"; leaf loss-priority { type enumeration { enum high { description "High Loss Priority"; } enum medium-high { description "Medium-high Loss Priority"; } enum medium-low { description "Medium-low Loss Priority"; } enum low { description "Low Loss Priority"; } } description "Loss-priority"; } } description "Filter containing list of loss priorities"; } augment "/policy:policies" + "/policy:policy-entry" + "/policy:classifier-entry" + "/policy:filter-entry" + "/diffserv:filter-params" { case forwarding-class { uses forwarding-class-cfg; description "Filter Type Internal-loss-priority"; } case internal-loss-priority { uses loss-priority-cfg; description "Filter Type Internal-loss-priority"; } description "Augments Diffserv Classifier with vendor" + " specific types"; } /************************************************* * Actions *************************************************/ identity mark-fwd-class { base policy:action-type; description "mark forwarding class action type"; } identity mark-loss-priority { base policy:action-type; description "mark loss-priority action type"; } grouping mark-fwd-class { container mark-fwd-class-cfg { leaf forwarding-class { type string; description "Forwarding class name"; } description "mark-fwd-class container"; } description "mark-fwd-class grouping"; } grouping mark-loss-priority { container mark-loss-priority-cfg { leaf loss-priority { type enumeration { enum high { description "High Loss Priority"; } enum medium-high { description "Medium-high Loss Priority"; } enum medium-low { description "Medium-low Loss Priority"; } enum low { description "Low Loss Priority"; } } description "Loss-priority"; } description "mark-loss-priority container"; } description "mark-loss-priority grouping"; } identity exceed-2color-meter-action-drop { base action:exceed-2color-meter-action-type; description "drop action type in a meter"; } identity meter-action-mark-fwd-class { base action:exceed-2color-meter-action-type; description "mark forwarding class action type"; } identity meter-action-mark-loss-priority { base action:exceed-2color-meter-action-type; description "mark loss-priority action type"; } identity violate-3color-meter-action-drop { base action:violate-3color-meter-action-type; description "drop action type in a meter"; } augment "/policy:policies/policy:policy-entry/" + "policy:classifier-entry/" + "policy:classifier-action-entry-cfg/" + "policy:action-cfg-params" { case mark-fwd-class { uses mark-fwd-class; description "Mark forwarding class in the packet"; } case mark-loss-priority { uses mark-loss-priority; description "Mark loss priority in the packet"; } case discard { uses action:discard; description "Discard action"; } description "Augments common diffserv policy actions"; } augment "/action:meter-template" + "/action:meter-entry" + "/action:meter-type" + "/action:one-rate-tri-color-meter-type" + "/action:one-rate-tri-color-meter" { leaf one-rate-color-aware { type boolean; description "This defines if the meter is color-aware"; } } augment "/action:meter-template" + "/action:meter-entry" + "/action:meter-type" + "/action:two-rate-tri-color-meter-type" + "/action:two-rate-tri-color-meter" { leaf two-rate-color-aware { type boolean; description "This defines if the meter is color-aware"; } } /* example of augmenting a meter template with a /* vendor specific action */ augment "/action:meter-template" + "/action:meter-entry" + "/action:meter-type" + "/action:one-rate-two-color-meter-type" + "/action:one-rate-two-color-meter" + "/action:exceed-action" + "/action:exceed-2color-meter-action-params" + "/action:exceed-2color-meter-action-val" { case exceed-2color-meter-action-drop { description "meter drop"; uses action:drop; } case meter-action-mark-fwd-class { uses mark-fwd-class; description "Mark forwarding class in the packet"; } case meter-action-mark-loss-priority { uses mark-loss-priority; description "Mark loss priority in the packet"; } } augment "/action:meter-template" + "/action:meter-entry" + "/action:meter-type" + "/action:two-rate-tri-color-meter-type" + "/action:two-rate-tri-color-meter" + "/action:violate-action" + "/action:violate-3color-meter-action-params" + "/action:violate-3color-meter-action-val" { case exceed-3color-meter-action-drop { description "meter drop"; uses action:drop; } description "Augment the actions to the two-color meter"; } augment "/action:meter-template" + "/action:meter-entry" + "/action:meter-type" + "/action:one-rate-tri-color-meter-type" + "/action:one-rate-tri-color-meter" + "/action:violate-action" + "/action:violate-3color-meter-action-params" + "/action:violate-3color-meter-action-val" { case exceed-3color-meter-action-drop { description "meter drop"; uses action:drop; } description "Augment the actions to basic meter"; } } module example-compb-queue-policy { yang-version 1.1; namespace "urn:ietf:params:xml:ns:yang:example-compb-queue-policy"; prefix queue-plcy; import ietf-traffic-policy { prefix policy; reference "RFC XXXX: YANG Model for QoS"; } organization "Company B"; contact "Editor: XYZ <mailto:xyz@compb.com>"; description "This module defines a queue policy. The classification is based on aforwarding class, and the actions are queues. Copyright (c) 2021 IETF Trust and the persons identified as authors of the code. All rights reserved. Redistribution and use in source and binary forms, with or without modification, is permitted pursuant to, and subject to the license terms contained in, the Simplified BSD License set forth in Section 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info). This version of this YANG module is part of RFC XXXX; see the RFC itself for full legal notices."; revision 2021-07-12 { description "Latest revision of Company B queue policy"; reference "RFC XXXX"; } identity forwarding-class { base policy:filter-type; description "Forwarding class filter type"; } grouping forwarding-class-cfg { leaf forwarding-class-cfg { type string; description "forwarding-class name"; } description "Forwarding class filter"; } augment "/policy:policies" + "/policy:policy-entry" + "/policy:classifier-entry" + "/policy:filter-entry" { /* Does NOT support "logical-not" of forwarding class. Use "must"? */ choice filter-params { description "Choice of filters"; case forwarding-class-cfg { uses forwarding-class-cfg; description "Filter Type Internal-loss-priority"; } } description "Augments Diffserv Classifier with fwd class filter"; } identity compb-queue { base policy:action-type; description "compb-queue action type"; } grouping compb-queue-name { container queue-name { leaf name { type string; description "Queue class name"; } description "compb queue container"; } description "compb-queue grouping"; } augment "/policy:policies" + "/policy:policy-entry" + "/policy:classifier-entry" + "/policy:classifier-action-entry-cfg" { choice action-cfg-params { description "Choice of action types"; case compb-queue { uses compb-queue-name; } } description "Augment the queue actions to queue policy entry"; } } module example-compb-queue { yang-version 1.1; namespace "urn:ietf:params:xml:ns:yang:ietf-compb-queue"; prefix compb-queue; import ietf-qos-action { prefix action; reference "RFC XXXX: YANG Model for QoS"; } organization "Company B"; contact "Editor: XYZ <mailto:xyz@compb.com>"; description "This module describes a compb queue module. This is a template for a queue within a queue policy, referenced by name. This version of this YANG module is part of RFC XXXX; see the RFC itself for full legal notices."; revision 2021-07-12 { description "Latest revision of diffserv based classifier"; reference "RFC XXXX"; } container compb-queue { description "Queue used in compb architecture"; leaf name { type string; description "A unique name identifying this queue"; } uses action:queue; container excess-rate { choice excess-rate-type { case percent { leaf excess-rate-percent { type uint32 { range "1..100"; } description "excess-rate-percent"; } } case proportion { leaf excess-rate-poroportion { type uint32 { range "1..1000"; } description "excess-rate-poroportion"; } } description "Choice of excess-rate type"; } description "Excess rate value"; } leaf excess-priority { type enumeration { enum high { description "High Loss Priority"; } enum medium-high { description "Medium-high Loss Priority"; } enum medium-low { description "Medium-low Loss Priority"; } enum low { description "Low Loss Priority"; } enum none { description "No excess priority"; } } description "Priority of excess (above guaranted rate) traffic"; } container buffer-size { choice buffer-size-type { case percent { leaf buffer-size-percent { type uint32 { range "1..100"; } description "buffer-size-percent"; } } case temporal { leaf buffer-size-temporal { type uint64; units "microsecond"; description "buffer-size-temporal"; } } case remainder { leaf buffer-size-remainder { type empty; description "use remaining of buffer"; } } description "Choice of buffer size type"; } description "Buffer size value"; } } augment "/compb-queue" + "/queue-cfg" + "/algorithmic-drop-cfg" + "/drop-algorithm" { case random-detect { list drop-profile-list { key "priority"; description "map of priorities to drop-algorithms"; leaf priority { type enumeration { enum any { description "Any priority mapped here"; } enum high { description "High Priority Packet"; } enum medium-high { description "Medium-high Priority Packet"; } enum medium-low { description "Medium-low Priority Packet"; } enum low { description "Low Priority Packet"; } } description "Priority of guaranteed traffic"; } leaf drop-profile { type string; description "drop profile to use for this priority"; } } } description "compb random detect drop algorithm config"; } } module example-compb-scheduler-policy { yang-version 1.1; namespace "urn:ietf:params:xml:ns:yang:" + "example-compb-scheduler-policy"; prefix scheduler-plcy; import ietf-qos-action { prefix action; reference "RFC XXXX: YANG Model for QoS"; } import ietf-traffic-policy { prefix policy; reference "RFC XXXX: YANG Model for QoS"; } organization "Company B"; contact "Editor: XYZ <mailto:xyz@compb.com>"; description "This module defines a scheduler policy. The classification is based on classifier-any, and the action is a scheduler."; revision 2021-07-12 { description "Initial revision of Company B Scheduler policy"; reference "RFC XXXX"; } identity queue-policy { base policy:action-type; description "forwarding-class-queue action type"; } grouping queue-policy-name { container compb-queue-policy-name { leaf name { type string; description "Queue policy name"; } description "compb-queue-policy container"; } description "compb-queue policy grouping"; } augment "/policy:policies" + "/policy:policy-entry" + "/policy:classifier-entry" + "/policy:classifier-action-entry-cfg" { choice action-cfg-params { case schedular { uses action:schedular; } case queue-policy { uses queue-policy-name; } description "Augment the scheduler policy with a queue policy"; } } }¶
Company C vendor augmentation is based on Ericsson's implementation differentiated QoS. This implementation first sorts traffic based on a classifier, which can sort traffic into one or more traffic forwarding classes. Then, a policer or meter policy references the classifier and its traffic forwarding classes to specify different service levels for each traffic forwarding class.¶
Because each classifier sorts traffic into one or more traffic forwarding classes, this type of classifier does not align with ietf-qos-classifier.yang, which defines one traffic forwarding class per classifier. Additionally, Company C's policing and metering policies relies on the classifier's pre-defined traffic forwarding classes to provide differentiated services, rather than redefining the patterns within a policing or metering policy, as is defined in ietf-diffserv.yang.¶
Due to these differences, even though Company C uses all the building blocks of classifier and policy, Company C's augmentation does not use ietf-diffserv.yang to provide differentiated service levels. Instead, Company C's augmentation uses the basic building blocks, ietf-traffic-policy.yang to provide differentiated services.¶
module example-compc-qos-policy { yang-version 1.1; namespace "urn:ietf:params:xml:ns:yang:example-compc-qos-policy"; prefix "compcqos"; import ietf-traffic-policy { prefix "pol"; reference "RFC XXXX: YANG Model for QoS"; } import ietf-qos-action { prefix "action"; reference "RFC XXXX: YANG Model for QoS"; } organization "Company C"; contact "Company C Editor: XYZ <mailto:xyz@compc.com>"; description "This module contains a collection of YANG definitions for configuring diffserv specification implementations. Copyright (c) 2021 IETF Trust and the persons identified as authors of the code. All rights reserved. Redistribution and use in source and binary forms, with or without modification, is permitted pursuant to, and subject to the license terms contained in, the Simplified BSD License set forth in Section 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info). This version of this YANG module is part of RFC XXXX; see the RFC itself for full legal notices."; revision 2021-07-12 { description "Initial version"; reference "RFC XXXX"; } /* identities */ identity compc-qos-policy { base pol:policy-type; description "compc-specific policy base type"; } identity mdrr-queuing-policy { base compc-qos-policy; description "compc-specific MDRR policy type"; } identity pwfq-queuing-policy { base compc-qos-policy; description "compc-specific queuing policy type"; } identity policing-policy { base compc-qos-policy; description "compc-specific policing policy type"; } identity metering-policy { base compc-qos-policy; description "compc-specific metering policy type"; } identity forwarding-policy { base compc-qos-policy; description "compc-specific forwarding policy type"; } identity overhead-profile-policy { base compc-qos-policy; description "compc-specific overhead profile policy type"; } identity resource-profile-policy { base compc-qos-policy; description "compc-specific resource profile policy type"; } identity protocol-rate-limit-policy { base compc-qos-policy; description "compc-specific protocol rate limit policy type"; } identity compc-qos-action { base pol:action-type; description "compc-specificc qos action base type"; } /* groupings */ grouping redirect-action-grp { description "Redirection options grouping"; container redirect { description "Redirect options"; } } /* deviations */ deviation "/pol:policies/pol:policy-entry" { deviate add { must "pol:type = compc-qos-policy" { description "Only policy types drived from compc-qos-policy " + "are supported"; } } } deviation "/pol:policies/pol:policy-entry/pol:classifier-entry" { deviate add { must "../per-class-action = 'true'" { description "Only policies with per-class actions have classifiers"; } must "((../compcqos:sub-type != " + "'compcqos:mdrr-queuing-policy') and " + " (../compcqos:sub-type != " + "'compcqos:pwfq-queuing-policy')) or " + "(((../compcqos:sub-type = " + "'compcqos:mdrr-queuing-policy') or " + " (../compcqos:sub-type = " + "'compcqos:pwfq-queueing-policy')) and " + " ((classifier-entry-name = '0') or " + " (classifier-entry-name = '1') or " + " (classifier-entry-name = '2') or " + " (classifier-entry-name = '3') or " + " (classifier-entry-name = '4') or " + " (classifier-entry-name = '5') or " + " (classifier-entry-name = '6') or " + " (classifier-entry-name = '7') or " + " (classifier-entry-name = '8')))" { description "MDRR queuing policy's or PWFQ queuing policy's " + "classifier-entry-name is limited to the listed values"; } } } deviation "/pol:policies/pol:policy-entry/pol:classifier-entry" + "/pol:classifier-action-entry-cfg" { deviate add { must "action-type = 'compcqos:compc-qos-action'" { description "Only compc-qos-action is allowed"; } max-elements 1; } } /* augments */ augment "/pol:policies/pol:policy-entry" { when "pol:policy-type = 'compc-qos-policy'" { description "Additional nodes only for diffserv-policy"; } description "Additional diffserv-policy nodes"; leaf sub-type { type identityref { base compc-qos-policy; } mandatory true; description "Policy sub-type. The value of this leaf must " + "not change once configured"; } leaf per-class-action { type boolean; must "(((. = 'true') and " + " ((../compcqos:sub-type = " + "'compcqos:policing-policy') or " + " (../compcqos:sub-type = " + "'compcqos:metering-policy') or " + " (../compcqos:sub-type = " + "'compcqos:mdrr-queuing-policy') or " + " (../compcqos:sub-type = " + "'compcqos:pwfq-queuing-policy') or " + " (../compcqos:sub-type = " + "'compcqos:forwarding-policy'))) or " + " ((. = 'false') and " + " ((../compcqos:sub-type = " + "'compcqos:overhead-profile-policy') or " + " (../compcqos:sub-type = " + "'compcqos:resource-profile-policy') or " + " (../compcqos:sub-type = " + "'compcqos:protocol-rate-limit-policy'))))" { description "Only certain policies have per-class action"; } mandatory true; description "Per-class action"; } container traffic-classifier { when "../compcqos:sub-type = 'compcqos:policing-policy' or " + "../compcqos:sub-type = 'compcqos:metering-policy' or " + "../compcqos:sub-type = 'compcqos:forwarding-policy'" { description "A classifier for policing-policy or metering-policy"; } presence true; leaf name { type string; mandatory true; description "Traffic classifier name"; } leaf type { type enumeration { enum 'internal-dscp-only-classifier' { value 0; description "Classify traffic based on (internal) dscp only"; } enum 'ipv4-header-based-classifier' { value 1; description "Classify traffic based on IPv4 packet header fields"; } enum 'ipv6-header-based-classifier' { value 2; description "Classify traffic based on IPv6 packet header fields"; } } mandatory true; description "Traffic classifier type"; } description "Traffic classifier"; } container traffic-queue { when "(../compcqos:sub-type = " + "'compcqos:mdrr-queuing-policy') or " + "(../compcqos:sub-type = " + "'compcqos:pwfq-queuing-policy')" { description "Queuing policy properties"; } leaf queue-map { type string; description "Traffic queue map for queuing policy"; } description "Traffic queue"; } container overhead-profile { when "../compcqos:sub-type = " + "'compcqos:overhead-profile-policy'" { description "Overhead profile policy properties"; } description "Overhead profile"; } container resource-profile { when "../compcqos:sub-type = " + "'compcqos:resource-profile-policy'" { description "Resource profile policy properties"; } description "Resource profile"; } container protocol-rate-limit { when "../compcqos:sub-type = " + "'compcqos:protocol-rate-limit-policy'" { description "Protocol rate limit policy properties"; } description "Protocol rate limit"; } } augment "/pol:policies/pol:policy-entry/pol:classifier-entry" + "/pol:classifier-action-entry-cfg/pol:action-cfg-params" { when "../../pol:policy-type = 'compc-qos-policy'" { description "Configurations for a classifier-policy-type policy"; } case metering-or-policing-policy { when "../../compcqos:sub-type = " + "'compcqos:policing-policy' or " + "../../compcqos:sub-type = 'compcqos:metering-policy'" { } container dscp-marking { uses action:dscp-marking; description "DSCP marking"; } container precedence-marking { uses action:dscp-marking; description "Precedence marking"; } container priority-marking { uses action:priority; description "Priority marking"; } container rate-limiting { uses action:one-rate-two-color-meter; description "Rate limiting"; } } case mdrr-queuing-policy { when "../../compcqos:sub-type = " + "'compcqos:mdrr-queuing-policy'" { description "MDRR queue handling properties for the traffic " + "classified into current queue"; } leaf mdrr-queue-weight { type uint8 { range "20..100"; } units percentage; description "MDRR queue weight"; } } case pwfq-queuing-policy { when "../../compcqos:sub-type = " + "'compcqos:pwfq-queuing-policy'" { description "PWFQ queue handling properties for traffic " + "classified into current queue"; } leaf pwfq-queue-weight { type uint8 { range "20..100"; } units percentage; description "Priority-based weighted fair queue weight"; } leaf pwfq-queue-priority { type uint8; description "Priority-based weighted fair queue priority"; } leaf pwfq-queue-rate { type uint8; description "Priority-based weighted fair queue rate"; } } case forwarding-policy { when "../../compcqos:sub-type = 'compcqos:forwarding-policy'" { description "Forward policy handling properties for traffic " + "in this classifier"; } uses redirect-action-grp; } description "Add the classify action configuration"; } }¶