QoS

Introduction to QoS

Quality of Service (QoS) network tools improve service to selected network traffic by the following methods:

  • Supporting dedicated bandwidth
  • Improving loss characteristics
  • Avoiding and managing network congestion
  • Shaping network traffic
  • Setting traffic priorities across the network

QOS configuration comprises defining a traffic class, creating a traffic policy, and attaching the traffic policy to an interface.

Policing and Shaping

QoS offers two kinds of traffic regulation mechanisms—policing and shaping. Packet classification tools enable partitioning network traffic into multiple priority levels or classes of service.

  • Policing features limit the input or output transmission rate of a class of traffic based on user­defined criteria.
  • Shaping features manage traffic and congestion on the network.

Hierarchical Policies

A hierarchical policy is a QoS model that enables specifying QoS behavior at multiple levels of hierarchy. Multiple policy maps can be configured to shape multiple queues together. For hierarchical policies, the service-policy command is used to attach:

  • Child policies to child policies
  • Child policies to parent policies
  • Parent policies to interfaces, subinterfaces, and virtual circuits

A parent policy contains only the class-default class. It cannot contain any other classes.

There are numerous restrictions on parent and child policies. For more information, see:
http://www.cisco.com/c/en/us/td/docs/routers/10000/10008/configuration/guides/qos/qoscf.pdf

Resource Summary for QoS

 

HTTP Method
Resource
URL (BaseURL)
GET
POST
PUT
DELETE

QoS: Traffic classes (class-maps)

/api/v1/qos/class-map

Y

Y

N

N

/api/v1/qos/class-map/{class-map-name}

Y

N

Y

Y

QoS: Traffic policies (policy-maps)

/api/v1/qos/policy-map

Y

Y

N

N

/api/v1/qos/policy-map/{policy-map-name}

Y

N

Y

Y

QoS Class Maps

History

 

Release
Modification

IOS XE 3.13

Introduced for the CSR1000V platform

IOS XE 3.14

Introduced for ASR1001-X and ASR1002-X platforms

Properties for class-map

 

Property
Type
Required for POST and PUT
Description

kind

string

Not applicable

Object Type:" object#class-map"

cmap-name

string

mandatory

Name for the class

description

string

optional

Description of the class

match-type

string

optional

match-any/match-all (default is match-all)

match-criteria

object

mandatory

Object of protocol, dscp, or acl

protocol

List of strings

optional

(sub-property of match-criteria)

Can specify multiple protocols together:
ftp, http, ipv6, netbios, rtp, sftp, sip, skinny, snmp, telnet, sftp, udp

dscp

List of objects

optional

(sub-property of match-criteria)

Matching dscp field

Possible values: af11, af12, af13, af21,af22, af23,af31, af32, af33, cs1, cs2, cs3, cs4, cs5, cs6, cs7, ef

The "ip" sub-property is boolean.

acl

List of strings

optional

(sub-property of match-criteria)

String defining access list

JSON Representation for Class Map

{
"kind":"object#class-map",
"match-type":{string},
"cmap-name":{string},
"description":{string},
"match-criteria":{
"protocol":[{string}],
"dscp":[{
"value":{string},
"ip":{boolean}
}
],
"acl":[{string}]
}
}
 

Create a Class Map

Resource URI

 

Verb
URI

POST

/api/v1/qos/class-map

Example

JSON Request

POST /api/v1/qos/class-map
Content-Type: application/json
 
{
"match-type":"match-any",
"cmap-name":"qos-voice",
"match-criteria":{
"protocol":["rtp"],
"dscp":[{"value":"af11"},{"value":"af21"}],
"acl":["ac121"]
}
}
 

JSON Response

201 Created
Location: https://host//api/v1/qos/class-map/qos-voice
 

Retrieve All Class Maps

Resource URI

 

Verb
URI

GET

/api/v1/qos/class-map

Example

JSON Request

GET /api/v1/qos/class-map
Accept: application/json
 

JSON Response

200 OK
Content-Type: application/json
[
"kind":"collection# class-map",
"items":[
{
"kind":"object#class-map",
"match-type":"match-any",
"cmap-name":"qos-voice",
"description":"Voice",
"match-criteria":{
"protocol":["rtp"],
"dscp":[{"value":"af11"},
"acl":["acl1"]
}
}
{
"kind":"object#class-map",
"match-type":"match-all",
"cmap-name":"qos-bulk",
"match-criteria":{
"protocol":["sftp"],
"dscp":[{"ip":true,"value":"af11"}, {"value":"af21"}],
"acl":["ac21"]
}
}
]
]
 

Retrieve a Class Map

Resource URI

 

Verb
URI

GET

/api/v1/qos/class-map/{class-map-name}

Example

JSON Request

GET /api/v1/qos/class-map/qos-voice
Accept: application/json
 

JSON Response

200 OK
Content-Type: application/json
 
{
"kind":"object#class-map",
"match-type":"match-any",
"cmap-name":"qos-voice",
"match-criteria":{
"protocol":["rtp"],
"dscp":[{"value":"af11"},{"value":"af21"}],
"acl":["ac121"]
}
}
 

Modify a Class Map

Resource URI

 

Verb
URI

PUT

/api/v1/qos/class-map/{class-map-name}

Example

JSON Request

PUT /api/v1/qos/class-map/qos-voice
Content-Type: application/json
{
"match-type":"match-any",
"match-criteria":{
"dscp":[{"value":"af21"}],
}
}
 

JSON Response

204 No Content
 

Delete a Class Map

Resource URI

 

Verb
URI

DELETE

/api/v1/qos/class-map/{class-map-name}

Example

JSON Request

DELETE /api/v1/qos/class-map/qos-voice
 

JSON Response

204 No Content
 

QoS Policy Map

History

 

Release
Modification

IOS XE 3.13

Introduced for the CSR1000V platform

IOS XE 3.14

Introduced for ASR1001-X and ASR1002-X platforms

Properties: Configuring a Policy Map

 

Property
Type
Required for POST and PUT
Description

pmap-name

string

mandatory

Name for the policy-map

description

string

optional

Description of the policy

interface-list

List of objects

optional

Interface to attach the policy-map

direction

string

optional

(sub-property of interface-list)

Assign a policy-map to the input or output of an interface.

Possible values: "input" or "output"

name

string

optional

(sub-property of interface-list)

Name of the interface

Supported interfaces: 'gigabitethernet', 'loopback', 'lisp', 'tunnel', 'virtual-template'

class-list

List of objects

mandatory

List of class-maps with names.

For each class-map, can:

  • Configure dscp value or bandwidth
  • Configure shaping/policing
  • Set a pre-defined service policy as a sub-policy under the class-map

Specifying a class that does not exist or a policy-name under the service-policy attribute that does not exist results in an error.

Properties: Configuring a Class Object under a Policy Map

 

Property
Type
Required for POST and PUT
Description

cmap-name

string

mandatory

Name of the pre-defined class

queue-limit

number

optional

Queue max threshold for tail drop

priority

object

optional

Strict scheduling priority for the class

enable

boolean

mandatory

(sub-property of priority)

Prioritize the traffic

unit

string

optional

(sub-property of priority)

Possible values: "percent", "kbps"

value

number

optional

(sub-property of priority)

Range: 1 to 100% or

1 to 10000000 kbps

level

boolean

optional

(sub-property of priority)

Enter level of Multi-Level Priority Queue

burst-bytes

number

optional

(sub-property of priority)

Range: 32 to 2000000

set-dscp

object

optional

 

tunnel

boolean

optional

(sub-property of set-dscp)

Enable configuring tunnel traffic

value

string

optional

(sub-property of set-dscp)

DSCP value

set-precedence

object

optional

Precedence type

tunnel

boolean

optional

(sub-property of set-precedence)

Enable configuring tunnel traffic

value

string

optional

(sub-property of set-precedence)

Possible values: 0 to 7

set-mpls-experimental

object

optional

Set mpls

imposition

number

optional

(sub-property of set-mpls-experimental)

Range: 0 to 7

topmost

number

optional

(sub-property of set-mpls-experimental)

Range: 0 to 7

set-cos

number

optional

IEEE 802.1Q/ISL class of service/user priority

set-cos-inner

number

optional

Inner CoS

set-qos-group

number

optional

QoS Group

set-discard-class

number

optional

Discard behavior identifier

bandwidth

object

optional

Specify bandwidth

unit

string

mandatory

(sub-property of bandwidth)

Possible values: "percent", "remaining-percent", "kbps"

value

number

mandatory

(sub-property of bandwidth)

Range: 1 to 10000000

shape

object

optional

Both average values can be specified or both peak values, but not a combination of average and peak.

shape-type

string

mandatory

(sub-property of shape)

Possible values: "peak", "average"

unit

string

mandatory

(sub-property of shape)

Possible values: "percent", "kbps"

value

number

mandatory

(sub-property of shape)

Range: range 1 to 100 percent

or 8000 to 10000000000 kbps

random-detect

List of objects

optional

Configure random detect

Sets dscp values and min and max threshold in packets.

dscp

string

mandatory

(sub-property of random-detect)

dscp

min-threshold

number

mandatory

(sub-property of random-detect)

Range: 1 to 512000000

max-threshold

number

mandatory

(sub-property of random-detect)

Range: 1 to 512000000

service-policy

string

optional

To specify hierarchical policies, add a previously-defined policy under the class using this string.

police

object

optional

Instead of shaping, if policing is required, use this object to configure. This object property listed below.

Properties: Policy Map Policing—Rate/CIR Configuration Properties

Policy-map policing rate can be configured using one of the following (not both):

  • Committed Information Rate (CIR)
  • Rate object

 

Property
Type
Required for POST and PUT
Description

cir-target-bit-rate

object

optional

Committed information rate
Raw bitrate input fields

bit-rate

number

mandatory

(sub-property of cir-target-bit-rate)

Target bit rate

Range: 8000 to 10000000000

conform-burst

number

optional

(sub-property of cir-target-bit-rate)

Conformed burst

Range: 1000 to 512000000

excess-burst

number

optional

(sub-property of cir-target-bit-rate)

Excess burst

Range: 1000 to 512000000

peak-info-rate

number

optional

(sub-property of cir-target-bit-rate)

Peak information rate

Range: 8000 to 10000000000

cir-percent

object

optional

Committed information rate (in percentage)

percent

number

mandatory

(sub-property of cir-percent)

Percent of interface bandwidth for committed information rate

Range: 1 to 100

conform-burst-ms

number

optional

(sub-property of cir-percent)

Conformed burst

Range: 1 to 2000 (milliseconds)

excess-burst-ms

number

optional

(sub-property of cir-percent)

Excess burst

Range: 1 to 2000 (milliseconds)

Properties: Policy Map Policing—Rate Configuration Properties

Policy-map policing rate can be configured using one of the following (not both):

  • Committed Information Rate (CIR)
  • Rate object

 

Property
Type
Required for POST and PUT
Description

rate-target-bit-rate

object

optional

Police rate

Raw bitrate input

bit-rate

number

mandatory

(sub-property of rate-target-bit-rate)

Rate value

Range: 1 to 10000000000

burst-bytes

number

optional

(sub-property of rate-target-bit-rate)

Conformed bit rate

Range: 1000 to 512000000

peak-burst-bytes

number

optional

(sub-property of rate-target-bit-rate)

Specify 'peak-burst' parameter for 'peak-rate'

Range: 1000 to 512000000

peak-rate-bytes

number

optional

(sub-property of rate-target-bit-rate)

Peak rate in bytes

Range: 1 to 10000000000

bits-per-sec

boolean

optional

(sub-property of rate-target-bit-rate)

Treat 'rate' value in bits-per-second - "bps" if this is set to 1, else regular

rate-percent

object

optional

Police rate (in percentage)

percent

number

mandatory

(sub-property of rate-percent)

Percent of interface bandwidth for committed information rate.

Range: 1 to 100 (%)

burst-ms

number

optional

(sub-property of rate-percent)

Specifies 'burst' parameter

Range: 1 to 2000 ms (milli seconds)

peak-burst-ms

number

optional

(sub-property of rate-percent)

Specifies 'peak-burst' parameter for 'peak-rate'

Range: 1 to 2000 ms (milli seconds)

peak-rate-percent

number

optional

(sub-property of rate-percent)

Specifies peak rate or PCR for single-level ATM 4.0 policies

Range: 1 to 100

Properties: Policy Map Policing—Action Configuration

 

Property
Type
Required for POST and PUT
Description

action-list

List of objects

optional

List of actions

action-type

string

Mandatory

(sub-property of action-list)

Possible values: conform-action, exceed-action, violate-action

action

string

mandatory

(sub-property of action-list)

The following values for action require specifying a value for the value property:

set-cos-inner-transmit, set-cos-transmit, set-discard-class-transmit, set-dscp-transmit, set-dscp-tunnel-transmit, set-mpls-exp-imposition-transmit, set-mpls-exp-topmost-transmit, set-prec-transmit, set-prec-tunnel-transmit, set-qos-transmit

The following values for action do not require specifying a value for the value property:

drop, transmit, set-clp-transmit

value

string

optional

(sub-property of action-list)

Possible values (depending on the value of the action property):

  • 0 to 7
  • 0 to 99
  • "af11"

JSON Representation: Policy Map Policing

{
"kind":"object#policy-map",
"pmap-name":{string},
"description":{string},
"interface-list":[{"name":{string},"direction":{string}}],
 
"class-list":
[
{
"cmap-name":{string},
"queue-limit":number,
"priority": {
"enable":{boolean},
"unit":{string},
"value":number,
"level":{boolean},
"burst-bytes":number
},
 
"set-dscp":{
"tunnel":{boolean},
"value":{string}
},
"set-precedence":{
"tunnel":{boolean},
"value":{string}
},
"set-cos":number,
"set-cos-inner":number,
"set-qos-group":number,
"set-discard-class":number,
"set-mpls-experimental":{
"imposition":number,
"topmost":number
},
 
"bandwidth":{
"unit":{string},
"value":number
},
"shape":{
"shape-type":{string},
"unit":{string},
"value":number
},
"random-detect":[
{
"dscp":{string},
"min-threshold":number,
"max-threshold":number
},
]
"service-policy":{string},
"police":POLICE_OBJECT
}
]
}
 

Expansion of POLICE_OBJECT Above

"police":{
"cir-target-bit-rate":{
"bit-rate":number,
"conform-burst":number,
"excess-burst":number,
"peak-info-rate":number
},
"cir-percent":{
"percent":number,
"conform-burst-ms":number,
"excess-burst-ms":number,
},
"rate-target-bit-rate":{
"bit-rate":number,
"bits-per-sec":"boolean",
"burst-bytes":number,
"peak-burst-bytes":number,
"peak-rate-bytes":number
},
"rate-percent":{
"percent":number,
"burst-ms":number,
"peak-burst-ms":number,
"peak-rate-percent":number
},
"action-list":[
{
"action-type":{string},
"action":{string},
"value":{string}
}
]
}
 

Create a Policy Map

Resource URI

 

Verb
URI

POST

/api/v1/qos/policy-map

Example

JSON Request

POST /api/v1/qos/policy-map
Content-Type: application/json
 
{
"pmap-name":"OUTBAND-LEARNING",
"interface-list":[{"name":"gigabitethernet1",
"direction":"output"}],
"class-list":
[
{"cmap-name":"qos-control",
"set-mpls-experimental":{"imposition":4},
"set-precedence":{"tunnel":true,"value":4}
},
{ "cmap-name":"qos-bulkdata",
"police":{
"cir-target-bit-rate":
{ "bit-rate":100000,
"conform-burst":1000,
"excess-burst":1000,
"peak-info-rate":100000
}
}
},
{"cmap-name":"qos-cos",
"police":{
"rate-percent":
{ "percent":95,
"burst-ms":250,
"peak-burst-ms":250,
"action-list":
[
{
"action-type":"conform-action",
"action":"set-prec-tunnel-transmit",
"value":"4"
},
{
"action-type":"exceed-action",
"action":"set-mpls-exp-imposition-transmit",
"value":"3"
},
{
"action-type":"violate-action",
"action":"drop"
}
]
}
}
},
{"cmap-name":"routing",
"bandwidth":{"unit":"percent","value":40}
},
{"cmap-name":"class-default",
"shape":{"shape-type":"peak","unit":"percent","value":10}
}
]
}
 

JSON Response

201 Created
Location: http://host/api/v1/qos/policy-map/OUTBOUND-LEARNING
 

Retrieve All Policy Maps

Resource URI

 

Verb
URI

GET

/api/v1/qos/policy-map

Example

JSON Request

GET /api/v1/qos/policy-map
Accept: application/json
 

JSON Response

{
"kind":"collection# policy-map policy-map",
"items":
[
{
"kind":"object#policy-map",
"pmap-name":"OUTBAND-CLASSIFY",
"class-list":
[
{"cmap-name":"qos-voice","set-dscp": {"value":"af11"}},
{"cmap-name":"qos-buldata",
"bandwidth":{"unit":"percent","value":20},
},
{"cmap-name":"routing",
"bandwidth":{"unit":"kbps","value":5000},
},
{
"cmap-name":"class-default",
"shape":{"shape-type":"average",
"unit":"percent",
"value":30
},
"random-detect": [
{
"dscp":"af11",
"min-threshold":100,
"max-threshold":100000
}
]
}
]
},
{
"kind":"object#policy-map",
"pmap-name":"OUTBOUND-LEARNING",
"interface-list":[{"name":"gigabitethernet1","direction":"output"},}
{"name":"gigabitethernet2","direction":"output"}],
"class-list":
[
{"cmap-name":"qos-voice","set-dscp": {"value":"af11"}},
{"cmap-name":"qos-buldata",
"bandwidth":{"unit":"percent","value":50}
},
{"cmap-name":"routing",
"bandwidth":{"unit":"kbps","value":8000}
{"cmap-name":"class-default",
"shape":{"shape-type":"peak","unit":"percent","value":10},
"service-policy":"OUTBAND-CLASSIFY"
},
]
}
 
]
}
 

Retrieve a Policy Map

Resource URI

 

Verb
URI

GET

/api/v1/qos/policy-map/{policy-map-name}

Example

JSON Request

GET /api/v1/qos/policy-map/OUTBAND-LEARNING
Accept: application/json
 

JSON Response

200 OK
Content-Type: application/json
 
{
"kind":"object#policy-map",
"pmap-name":"OUTBAND-LEARNING",
"interface-list":[{"name":"gigabitethernet1",
"direction":"input"}],
"class-list":[
{"cmap-name":"qos-voice","set-dscp":{"value":"af11"}},
{"cmap-name":"qos-buldata",
"bandwidth":{"unit":"percent","value":50}
}
{"cmap-name":"routing",
"bandwidth":{"unit":"kbps","value":8000}
},
{"cmap-name":"class-default",
"shape":{"shape-type":"peak","unit":"percent","value":10}
"service-policy":"OUTBAND-CLASSIFY"
}
]
}
 

Modify a Policy Map

A policy map can be applied to a list of interfaces while creating the policy map. Alternatively, the policy map can be applied to an interface after creating the policy map by specifying only the policy map name and interface name(s) (see Example 2: Applying Policy map to an Existing Configuration).

Resource URI

 

Verb
URI

PUT

/api/v1/qos/policy-map/{policy-map-name}

Example 1

JSON Request

PUT /api/v1/qos/policy-map/OUTBAND-LEARNING
Content-Type: application/json
{
"interface-list":[{"name":"gigabitethernet1",
"direction":"output"}],
"class-list":
[
{"cmap-name":"qos-voice","set-dscp":{"value":"af11"}},
{"cmap-name":"qos-bulkdata",
"bandwidth":{"unit":"percent","value":50}
},
{"cmap-name":"routing",
"bandwidth":{"unit":"percent","value":40}
},
{"cmap-name":"class-default",
"shape":{"shape-type":"peak","unit":"percent","value":10}
}
]
}
 

JSON Response

204 No Content
 

Example 2: Applying Policy map to an Existing Configuration

The following example updates a policy map by applying the "OUTBAND-CLASSIFY" policy map to the interface "gigabitethernet2". Doing so does not delete the existing configuration; it only adds the policy to the interface.

PUT /api/v1/qos/policy-map/OUTBAND-LEARNING
Content-Type: application/json
{
"interface-list": [ {
"name":"gigabitethernet2",
"direction":"output"
}
]
}
 

Delete a Policy Map

Resource URI

 

Verb
URI

DELETE

/api/v1/qos/policy-map/{policy-map-name}

JSON Request

DELETE /api/v1/qos/policy-map/OUTBAND-CLASSIFY
 

JSON Response

204 No Content