How to Configure Hierarchical QoS
When configuring hierarchical QoS, consider the following guidelines:
-
When defining polices, start at the bottom level of the hierarchy. For example, for a two-level hierarchical policy, define the bottom-level policy and then the top-level policy. For a three-level hierarchical policy, define the bottom-level policy, the middle-level policy, and then the top-level policy.
-
Do not specify the input or output keyword in the service-policy command when configuring a bottom-level policy within a top-level policy.
-
Configure bottom-level policies only in middle-level and top-level policies.
-
When you attach an undefined policy as a child policy, a policy-map (with only class-default) is created.
Service Fragment on LACP
-
Supports only physical and bundle interfaces. No support on BVI, Satellite, and BNG.
-
All sub interface policys in a port with service-fragment policy must refer to one of the service fragments in port policy.
-
You must perform removal of sub-interface policy before port policy.
Port policy configurations - Defining a service fragment
This configuration task explains how to define a service fragment in a port policy. The service-fragment command, in the policy map configuration mode helps define the service fragment.
Aspects need to be considered while defining a service-fragment are:
-
All service fragment names must be unique in a port policy. However, same names can be reused across policies.
-
A class in a port policy which defines a service fragment can only specify shape, BWRR (Budgeted Weighted Round Robin), and child policy actions. Only flat policies are supported at port level.
-
In a 2-level policy, only a child policy can define service fragments. A parent policy can not define service fragments and should have one class with only shape actions.
SUMMARY STEPS
- configure
- policy-map policy-map-name
- class class-name
- service-fragment name
- exit
- Use the commit or end command.
DETAILED STEPS
Command or Action | Purpose | |
---|---|---|
Step 1 |
configure Example:
|
Enters global configuration mode. |
Step 2 |
policy-map policy-map-name Example:
|
Enters policy map configuration mode.
|
Step 3 |
class class-name Example:
|
Enters policy map class configuration mode.
|
Step 4 |
service-fragment name Example:
|
Defines a service-fragment. The defined service fragment (s1) will be referred to for the sub-interface policy configuration. |
Step 5 |
exit Example:
|
Returns the router to policy map configuration mode. |
Step 6 |
Use the commit or end command. |
commit —Saves the configuration changes, and remains within the configuration session.
|
Configuring sub-interface policy
This configuration task explains configuring sub-interface policy using the fragment command. The fragment command refers to the previously configured service-fragment and has to be applied on the corresponding port.
Sub-interface policy limitations:
-
Sub-interface policies need to refer to a service-fragment in the parent policy in a 2-level sub-interface policy.
-
The sub-interface policy actions in a parent policy should not have shape, policy, bandwidth actions in percentages (only in absolute numbers).
SUMMARY STEPS
- configure
- policy-map policy-map-name
- class class-name
- fragment name
- exit
- Use the commit or end command.
DETAILED STEPS
Command or Action | Purpose | |
---|---|---|
Step 1 |
configure Example:
|
Enters global configuration mode. |
Step 2 |
policy-map policy-map-name Example:
|
Enters policy map configuration mode.
|
Step 3 |
class class-name Example:
|
Enters policy map class configuration mode.
|
Step 4 |
fragment name Example:
|
Refers to a previously defined service-fragment (here, s1 is the defined service-fragment). |
Step 5 |
exit Example:
|
Returns the router to policy map configuration mode. |
Step 6 |
Use the commit or end command. |
commit —Saves the configuration changes and remains within the configuration session.
|
Applying a service fragment policy on a physical interface
To apply a qos policy on an interface, use the service-fragment-parent command. This can be used only after a service-fragment policy is defined on a port.
SUMMARY STEPS
- configure
- interface interface-path-id
- service-policy { input | output | type } service-fragment-parent
- Use the commit or end command.
DETAILED STEPS
Command or Action | Purpose | |
---|---|---|
Step 1 |
configure Example:
|
Enters global configuration mode. |
Step 2 |
interface interface-path-id Example:
|
Specifies the interface for which the service-policy is being defined. |
Step 3 |
service-policy { input | output | type } service-fragment-parent Example:
|
Applies the service policy on the defined service-fragment. |
Step 4 |
Use the commit or end command. |
commit —Saves the configuration changes, and remains within the configuration session.
|
Configuring the Three-Parameter Scheduler
When configuring the Three-Parameter Scheduler, consider the following guidelines:
-
To use the three-parameter scheduler, a queueing class must be enabled. To enable a queueing class, you must configure at least one of the three parameters. When at least one parameter is configured, a queue is assigned to the class.
-
If you configure only one parameter, the scheduler uses default values for the other two parameters.
-
You can configure all 3 parameters in the same class.
-
Minimum bandwidth must be less than maximum bandwidth.
-
You can configure the three-parameter scheduler on the second generation of ASR 9000 Series Carrier Ethernet line cards and the third generation of ASR 9000 Series High Density Ethernet line cards.
ASR 9000 Ethernet Line Cards
SUMMARY STEPS
- configure
- policy-map policy-name
- class class-name
- shape average {percent percentage | rate [units]}
- exit
- policy-map policy-name
- class class-default
- bandwidth {rate [units] | percent percentage-value} or bandwidth remaining [percent percentage-value | ratio ratio-value] or shape average {percent percentage | rate [units]}
- service-policy policy-map-name
- end
- or commit
DETAILED STEPS
Command or Action | Purpose | |||
---|---|---|---|---|
Step 1 |
configure Example:
|
Enters global configuration mode. |
||
Step 2 |
policy-map policy-name Example:
|
Creates or modifies the bottom-level policy. |
||
Step 3 |
class class-name Example:
|
Assigns the traffic class that you specify to the policy map. Enters policy map class configuration mode. |
||
Step 4 |
shape average {percent percentage | rate [units]} Example:
|
Shapes traffic to the indicated bit rate. |
||
Step 5 |
exit Example:
|
Exits policy map class configuration mode. |
||
Step 6 |
policy-map policy-name Example:
|
Creates or modifies the top-level policy. |
||
Step 7 |
class class-default Example:
|
Configures or modifies the parent class-default class.
|
||
Step 8 |
bandwidth {rate [units] | percent percentage-value} or bandwidth remaining [percent percentage-value | ratio ratio-value] or shape average {percent percentage | rate [units]} Example:
|
Specifies the minimum bandwidth allocated to a class as a percentage of link bandwidth. Specifies how to allocate excess bandwidth to a class. Specifies maximum bandwidth as a percentage of link bandwidth (when other classes are not using all of their bandwidth share).
|
||
Step 9 |
service-policy policy-map-name Example:
|
Applies a bottom-level policy to the top-level class-default class. |
||
Step 10 |
end |
|||
Step 11 |
or commit Example:
or
|
Saves configuration changes.
|
SIP 700 for the ASR 9000
SUMMARY STEPS
- configure
- policy-map policy-name
- class class-name
- bandwidth {rate [units] | percent percentage-value} or bandwidth remaining [percent percentage-value | ratio ratio-value] or shape average {percent percentage | rate [units]}
- exit
- policy-map policy-name
- class class-default
- shape average {percent percentage | rate [units]}
- service-policy policy-map-name
- end
- or commit
DETAILED STEPS
Command or Action | Purpose | |||
---|---|---|---|---|
Step 1 |
configure Example:
|
Enters global configuration mode. |
||
Step 2 |
policy-map policy-name Example:
|
Creates or modifies the bottom-level policy. |
||
Step 3 |
class class-name Example:
|
Assigns the traffic class that you specify to the policy map. Enters policy map class configuration mode. |
||
Step 4 |
bandwidth {rate [units] | percent percentage-value} or bandwidth remaining [percent percentage-value | ratio ratio-value] or shape average {percent percentage | rate [units]} Example:
|
Specifies the minimum bandwidth allocated to a class as a percentage of link bandwidth. Specifies how to allocate excess bandwidth to a class. Specifies maximum bandwidth as a percentage of link bandwidth (when other classes are not using all of their bandwidth share).
|
||
Step 5 |
exit Example:
|
Exits policy map class configuration mode. |
||
Step 6 |
policy-map policy-name Example:
|
Creates or modifies the top-level policy. |
||
Step 7 |
class class-default Example:
|
Configures or modifies the parent class-default class.
|
||
Step 8 |
shape average {percent percentage | rate [units]} Example:
|
(Optional) Shapes traffic to the indicated bit rate. |
||
Step 9 |
service-policy policy-map-name Example:
|
Applies a bottom-level policy to the top-level class-default class. |
||
Step 10 |
end |
|||
Step 11 |
or commit Example:
or
|
Saves configuration changes.
|
Attaching Hierarchical Policies to Physical and Virtual Links
To attach hierarchical policies to interfaces, subinterfaces, virtual circuits, and virtual LANs, use the service-policy {input | output} policy-map-name command.
SUMMARY STEPS
- configure
- interface type interface-path-id
- service-policy {input | output} policy-map-name
- end
- or commit
DETAILED STEPS
Command or Action | Purpose | |
---|---|---|
Step 1 |
configure Example:
|
Enters global configuration mode. |
Step 2 |
interface type interface-path-id Example:
|
Specifies the interface to attach the hierarchical policy. |
Step 3 |
service-policy {input | output} policy-map-name Example:
|
Attaches the policy map you specify.
|
Step 4 |
end |
|
Step 5 |
or commit Example:
or
|
Saves configuration changes.
|
Configuring Enhanced Hierarchical Ingress Policing
The difference between configuring enhanced hierarchical ingress policing and configuring hierarchical ingress policing is the addition of the child-conform-aware command.
When used in the parent policer, the child-conform-aware command prevents the parent policer from dropping any ingress traffic that conforms to the maximum rate specified in the child policer.
Restrictions
Enhanced Hierarchical Ingress Policing has the following limitations:
-
Sum of all child policer rates cannot be greater than the parent policer rate.
-
Single-rate two-color policer (color blind) only.
-
Configurations that specify burst size in the police rate command are supported; configurations that specify peak burst become single-rate three-color policers and are therefore rejected.
-
Configure the child-conform-aware command only in the parent policer.
SUMMARY STEPS
- configure
- policy-map policy-name
- class class-name
- service-policy policy-map-name
- police rate {value [units] | percent percentage} [burst burst-size [burst-units]] [peak-rate value [units]] [peak-burst peak-burst [burst-units]]
- child-conform-aware
- conform-action [drop | set options | transmit]
- exceed-action [drop | set options | transmit]
- end or commit
DETAILED STEPS
Command or Action | Purpose | |||
---|---|---|---|---|
Step 1 |
configure Example:
|
Enters global configuration mode. |
||
Step 2 |
policy-map policy-name Example:
|
Enters policy map configuration mode. Creates or modifies a policy map that can be attached to one or more interfaces to specify a service policy. |
||
Step 3 |
class class-name Example:
|
Enters policy map class configuration mode. Specifies the name of the class whose policy you want to create or change. |
||
Step 4 |
service-policy policy-map-name Example:
|
Applies the bottom-level policy map to the parent class-default class.
|
||
Step 5 |
police rate {value [units] | percent percentage} [burst burst-size [burst-units]] [peak-rate value [units]] [peak-burst peak-burst [burst-units]] Example:
|
Configures traffic policing and enters policy map police configuration mode. |
||
Step 6 |
child-conform-aware Example:
|
Prevents the parent policer from dropping any ingress traffic that conforms to the maximum rate specified in a child policer. |
||
Step 7 |
conform-action [drop | set options | transmit] Example:
|
Configures the action to take on packets that conform to the rate limit. The allowed action is: transmit —Transmits the packets. |
||
Step 8 |
exceed-action [drop | set options | transmit] Example:
|
Configures the action to take on packets that exceed the rate limit. The allowed action is: drop —Drops the packet. |
||
Step 9 |
end or commit Example:
or
|
Saves configuration changes.
|
Two-Level Hierarchical Queueing Policy: Example
The following example shows a two-level policy applied at the Multilink Frame Relay main interface. The same policy can be applied at Multilink PPP main interface.
class-map match-any video
match precedence 1
end-class-map
!
class-map match-any premium
match precedence 2 3
end-class-map
!
class-map match-any voice-ip
match precedence 0
end-class-map
!
class-map match-any best-effort
match precedence 4
end-class-map
policy-map parent_shape
class class-default
service-policy child_policy
shape average percent 90
!
end-policy-map
!
policy-map child_policy
class voice-ip
priority level 1
police rate percent 20
!
!
class video
bandwidth percent 40
!
class premium
bandwidth percent 10
random-detect precedence 2 10 ms 100 ms
random-detect precedence 3 20 ms 200 ms
queue-limit 200 ms
!
class best-effort
bandwidth percent 20
queue-limit 200 ms
!
class class-default
!
end-policy-map
!
interface Multilink0/2/1/0/1
service-policy output parent_shape
encapsulation frame-relay
frame-relay intf-type dce
Three-Level Hierarchical Queueing Policy: Examples
Three-Level Hierarchical Queueing Policy: Examples
In this example, policy grand-parent is applied to the main Ethernet interface. The grand-parent policy limits all outbound traffic of the interface up to 500 Mbps. The parent policy has class vlan1 and vlan2, and traffic in vlan1 or vlan2 is limited to 40 percent of 500 Mbps. The policy child_policy classifies traffic based on different services and allocates bandwidth for each class accordingly.
class-map match-any video
match precedence 1
end-class-map
!
class-map match-any premium
match precedence 2 3
end-class-map
!
class-map match-any voice-ip
match precedence 0
end-class-map
!
class-map match-any best-effort
match precedence 4
end-class-map
class-map match-any vlan1
match vlan 1
end-class-map
class-map match-any vlan2
match vlan 2
end-class-map
policy-map grand-parent
class class-default
shape average 500 Mbps
service-policy parent
!
end-policy-map
policy-map parent
class vlan1
service-policy child_policy
shape average percent 40
!
class vlan2
service-policy child_policy
shape average percent 40
!
end-policy-map
!
policy-map child_policy
class voice-ip
priority level 1
police rate percent 20
!
!
class video
bandwidth percent 40
!
class premium
bandwidth percent 10
random-detect precedence 2 10 ms 100 ms
random-detect precedence 3 20 ms 200 ms
queue-limit 200 ms
!
class best-effort
bandwidth percent 20
queue-limit 200 ms
!
class class-default
!
end-policy-map
interface GigabitEthernet0/0/0/9
service-policy output grand-parent
SIP 700 for the ASR 9000
In this example, the policy parent_policy is applied to the Multilink Frame Relay main interface. The policy parent_policy has two classes, which match on Frame Relay DLCIs. The Multilink Frame Relay main interface has two Frame Relay PVCs configured (DLCI 16, DLCI 17).
interface Multilink0/2/1/0/1
mtu 1504
service-policy output parent_policy
encapsulation frame-relay
frame-relay intf-type dce
!
policy-map parent_policy
class parentQ_1
service-policy child_queuing_policy
shape average 64 kbps
!
class parentQ_2
service-policy child_queuing_policy
shape average 1 mbps
!
class class-default
!
end-policy-map
!
class-map match-any parentQ_1 <----- class map parent class dlci=16
match frame-relay dlci 16
end-class-map
!
class-map match-any parentQ_2 <----- class map parent class dlci=17
match frame-relay dlci 17
end-class-map
!
interface Multilink0/2/1/0/1.16 point-to-point <------ dlci 16 pvc config
ipv4 address 192.1.1.1 255.255.255.0
pvc 16
encap cisco
!
!
interface Multilink0/2/1/0/1.17 point-to-point <------ dlci 17 pvc config
ipv4 address 192.1.2.1 255.255.255.0
pvc 17
encap cisco
!
!
policy-map child_queuing_policy <--------- child policy map
class voice-ip
priority level 1
police rate percent 20
!
!
class video
bandwidth percent 40
!
class premium
service-policy gchild_policy
bandwidth percent 10
random-detect discard-class 2 10 ms 100 ms
random-detect discard-class 3 20 ms 200 ms
queue-limit 200 ms
!
class best-effort
bandwidth percent 20
queue-limit 200 ms
!
class class-default
!
end-policy-map
!
policy-map gchild_policy <-------- grandchild policy map
class premium_g1
police rate percent 10
!
set discard-class 2
!
class premium_g2
police rate percent 50
!
set discard-class 3
!
class class-default
!
end-policy-map
!
show run class-map <----------- shows all class-map configs
Mon Aug 2 11:35:19.479 UTC
class-map match-any video
match precedence 1
end-class-map
!
class-map match-any premium
match precedence 2 3
end-class-map
!
class-map match-any voice-ip
match precedence 0
end-class-map
!
class-map match-any parentQ_1
match frame-relay dlci 16
end-class-map
!
class-map match-any parentQ_2
match frame-relay dlci 17
end-class-map
!
class-map match-any premium_g1
match precedence 2
end-class-map
!
class-map match-any premium_g2
match precedence 3
end-class-map
!
class-map match-any best-effort
match precedence 4
end-class-map
Three-Parameter Scheduler: Examples
Three-Parameter Scheduler: Examples
This example shows how to configure a three-parameter scheduler in a two-level hierarchical policy.
policy-map Bottom-ChildA
class A1
shape average 400 kbps
class A2
shape average 400 kbps
policy-map Bottom-ChildB
class B1
shape average 250 kbps
class B2
shape average 450 kbps
policy-map Top-Parent
class parentA
shape average 500 kbps
bandwidth percent 30
bandwidth remaining percent 80
service-policy Bottom-ChildA
class parentB
shape average 500 kbps
bandwidth percent 60
bandwidth remaining percent 10
service-policy Bottom-ChildB
SIP 700 for the ASR 9000
This example shows how to configure a three-parameter scheduler in a two-level hierarchical policy.
policy-map Bottom-Child
class A
bandwidth percent 30
bandwidth remaining percent 80
shape average percent 50
class B
bandwidth percent 60
bandwidth remaining percent 10
class class-default
exit
policy-map Top-Parent
class-default
shape average 1 mbps
service-policy Bottom-Child
Hierarchical Policing: Examples
Hierarchical Policing: Examples
This example shows a two-level policy with police actions at each level. There are two classes in the top level, one for each customer. Aggregated traffic from each customer is subject to a rate limit as specified by the police rate command in the top level. Traffic in different classes in the bottom level is limited by an additional set of police actions to control different types of traffic for each customer.
class-map match-any customera
match vlan 10-14
class-map match-any customerb
match vlan 15-19
class-map match-any prec1
match precedence 1
class-map match-any prec3
match precedence 3
policy-map parent
class customera
service-policy childa
bandwidth remaining ratio 10
police rate percent 50
conform-action transmit
exceed-action drop
class customerb
service-policy childb
bandwidth remaining ratio 100
police rate percent 70
conform-action transmit
exceed-action drop
policy-map childa
class prec1
police rate percent 25
conform-action transmit
exceed-action drop
class prec3
police rate percent 25
conform-action transmit
exceed-action drop
policy-map childb
class prec1
police rate percent 30
conform-action transmit
exceed-action drop
class prec3
police rate percent 30
conform-action transmit
exceed-action drop
SIP 700 for the ASR 9000
In this example, policers are specified in the policy child in class Prec1 and class Prec3, and also in the class-default in the policy parent. The policers in the child policy, police traffic in class Prec1 at 30 percent (of 50 percent), police traffic in class Prec3 at 60 percent (of 50 percent) and police any other traffic at 10 percent (of 50 percent). Cumulatively, all traffic on the interface is policed at 50 percent of the interface rate by the policer in the parent policy.
class-map match-any prec1
match precedence 1
class-map match-any prec3
match precedence 3
policy-map parent
class class-default
service-policy child
police rate percent 50
conform-action transmit
exceed-action drop
policy-map child
class prec1
police rate percent 30
conform-action transmit
exceed-action drop
class prec3
police rate percent 60
conform-action transmit
exceed-action drop
class class-default
police rate percent 10
conform-action transmit
exceed-action drop
Attaching Service Policies to Physical and Virtual Links: Examples
Physical Link: Example
In this example, the p1 policy is applied to a Gigabit Ethernet interface:
interface gigabitethernet 0/2/0/0
service-policy input p1
Virtual Link: Example
In this example, the p2 policy is applied to the private virtual circuit (PVC) under a multilink Frame Relay subinterface. A QoS policy can be applied only to a PVC under a Frame Relay subinterface; it cannot be applied directly to a Frame Relay subinterface.
interface Multilink0/2/1/0/1.16 point-to-point
encapsulation frame-relay
ipv4 address 192.1.1.1 255.255.255.0
pvc 16
service-policy output p2
encap cisco
Service Fragment on LACP: Examples
The following example displays the service-fragment premium being created on LACP.
policy-map tsqos-port-policy
class class-default
shape 500 mbps
class dscp1
shape 1 Gbps
service-fragment premium
class dscp0
shape average 100 mbps
service-fragment sga
This example shows the service-fragment premium being referred (at the sub-interface):
policy-map tsqos-subif-policy-premium
class class-default
fragment premium
shape 20 mbps
bandwidth remaining ratio 20
service-policy subif-child
end-policy
exit
Service Fragment Configurations: Example
policy-map tsqos-port-policy
class class-default
shape 500 mbps
class dscp1
shape 1 Gbps
service-fragment premium
end-policy
exit
policy-map tsqos-subif-policy-premium
class class-default
fragment premium
shape 20 mbps
bandwidth remaining ratio 20
service-policy subif-child
end-policy
exit
Enhanced Hierarchical Ingress Policing: Example
This example shows parent and child policies in which two classes are defined in the child policy. In class AF1, the exceed action is set to an action other than to drop traffic.
If the child-conform-aware command were not configured in the parent policy, the parent policer would drop traffic that matches the conform rate of the child policer but exceeds the conform rate of the parent policer.
When used in the parent policer, the child-conform-aware command prevents the parent policer from dropping any ingress traffic that conforms to the committed rate specified in the child policer.
In this example, class EF in the child policy is configured with a committed rate of 1 Mbps, a conform action and an exceed action. The traffic that is below 1 Mbps is presented to the parent policer with the MPLS EXP bit set to 4, and traffic that exceeds 1 Mbps is dropped.
Class AF1 in the child policy is configured with a committed rate of 1 Mbps, a conform action and an exceed action. The traffic that is below 1 Mbps is presented to the parent policer with the MPLS EXP bit set to 3, and traffic that exceeds 1 Mbps is presented to the parent policer with the MPLS EXP bit set to 2.
With this child policy configuration, the parent policer sees traffic from the child classes as exceeding its committed rate of 2 Mbps. Without the child-conform-aware command in the parent policer, the parent polices to 2 Mbps, which can result into dropping some conformed traffic from class EF in the child policy. When the child-conform-aware command is configured in the parent policer, the parent policer does not drop any traffic that conforms under the child policy.
policy-map parent
class class-default
service-policy child
police rate 2 mbps
child-conform-aware
conform-action transmit
exceed-action drop
policy-map child
class EF
police rate 1 mbps
conform-action set mpls experimental imposition 4
exceed-action drop
class AF1
police rate 1 mbps
conform-action set mpls experimental imposition 3
exceed-action set mpls experimental imposition 2