OcNOS-DC : Quality of Service Guide : Quality of Service Configuration Guide : Weights for Queues Configuration
Weights for Queues Configuration
This chapter contains a complete sample of configuring WRR weights for queues.
Topology
Simple configuration of QoS
Configuring WRR Weights for Queues
Do the following to configure WRR weights for queues.
 
#configure terminal
Enter configure mode.
(config)#qos enable
Enable QoS globally.
(config)#qos statistics
Enable QoS statistics.
(config)#class-map cmap1
Enter class-map mode
(config-cmap-qos)#match cos 2
Configure match criteria as cos 2
(config-cmap-qos)#exit
Exit out of class-map mode
(config)#class-map cmap2
Enter class-map mode
(config-cmap-qos)#match cos 3
Configure match criteria as cos 3
(config-cmap-qos)#exit
Exit out of class-map mode
(config)#policy-map pmap1
Enter policy-map mode.
(config-pmap-qos)#class cmap1
Assign class cmap1.
(config-pmap-c-qos)#set qos-group 1
Remark matched traffic to qos-group 1
(config-pmap-c-qos)#exit
Exit out of pmap-c mode
(config-pmap-qos)#exit
Exit pmap mode.
(config)#policy-map pmap1
Enter policy-map mode.
(config-pmap-qos)#class cmap2
Assign class cmap2.
(config-pmap-c-qos)#set qos-group 2
Remark matched traffic to qos-group 2
(config-pmap-c-qos)#exit
Exit out of pmap-c mode
(config-pmap-qos)#exit
Exit pmap mode.
(config)#class-map type queuing cq1
Configure class-map of type queuing with name cq1, and enter into class-map mode
(config-cmap-que)#match qos-group 1
Configure match criteria as qos-group 1
(config-cmap-que)#exit
Exit out of class-map mode.
(config)#class-map type queuing cq2
Configure class-map of type queuing with name cq2, and enter into class-map mode.
(config-cmap-que)#match qos-group 2
Configure match criteria as qos-group 2.
(config-cmap-que)#exit
Exit out of class-map mode.
(config)#policy-map type queuing pq1
Configure policy-map of type queuing with name pq1, and enter into policy-map mode.
(config-pmap-que)#class cq1
Attach class cq1 to Policy-map pq1.
(config-pmap-c-que)#wrr-queue weight 2
Configure WRR Weight of 2.
(config-pmap-c-que)#exit
Exit from pmap-c mode.
(config-pmap-que)#class cq2
Assign class (queue) cq2 to pq1.
(config-pmap-c-que)#wrr-queue weight 4
Configure WRR weight of 4.
(config-pmap-c-que)#exit
Exit from pmap-c mode.
(config-pmap-que)#exit
Exit from pmap mode.
(config)#interface xe2
Enter into interface xe2.
(config-if)#service-policy type queuing output pq1
Assign service policy pq1 of type queueing on out direction.
(config-if)#exit
Exit interface mode
(config)#exit
Exit configure mode.
(config)#bridge 1 protocol rstp vlan-bridge
Specify VLAN for bridge 1.
(config)#vlan database
Enter the VLAN configuration mode.
(config-vlan)#vlan 2-3 bridge 1 state enable
Enable VLAN (2-3) on bridge 1. Specifying the enable state.
(config-vlan)#exit
Exit the VLAN configuration mode.
(config)#interface vlan1.2
Enter interface mode.
(config-if)# ip address 10.1.1.1/24
Configure the IP address.
(config-if)#exit
Exit the interface mode.
(config)#interface xe2
Enter interface mode.
(config-if)#switchport
Configure xe2 as a Layer 2 port.
(config-if)#bridge-group 1
Associate the interface with bridge group 1.
(config-if)#switchport mode trunk
Configure port as a trunk.
(config-if)#switchport trunk allowed vlan all
Allow all the VLANs on the xe3 interface.
(config-if)#exit
Exit the interface mode.
(config)#interface xe3
Enter interface mode.
(config-if)#switchport
Configure xe3 as a Layer 2 port.
(config-if)#bridge-group 1
Associate the interface with bridge group 1.
(config-if)#switchport mode trunk
Configure port as a trunk.
(config-if)#switchport trunk allowed vlan all
Allow all the VLANs on the xe3 interface.
(config-if)# service-policy type qos input pmap1
Assign service-policy to interface on in-direction
(config-if)#exit
Exit the interface mode.
Validation
Enter the commands listed in the sections below to confirm the configurations.
#show running-config qos
qos enable
!
qos statistics
!
class-map cmap1
match cos 2
!
class-map cmap2
match cos 3
!
class-map type queuing match-any cq1
match qos-group 1
!
class-map type queuing match-any cq2
match qos-group 2
!
policy-map pmap1
class cmap1
set qos-group 1
exit
class cmap2
set qos-group 2
exit
!
!
policy-map type queuing pq1
class type queuing cq1
wrr-queue weight 2
exit
class type queuing cq2
wrr-queue weight 4
exit
!
!
interface xe2
service-policy type queuing output pq1
!
interface xe3
service-policy type qos input pmap1
!
 
 
#show policy-map
 
Type qos policy-maps
====================
 
policy-map pmap1
class cmap1
set qos-group 1
exit
class cmap2
set qos-group 2
exit
 
 
Type queuing policy-maps
========================
 
policy-map type queuing default default-out-policy
class type queuing default q0
priority level 1
exit
class type queuing default q1
priority level 1
exit
class type queuing default q2
priority level 1
exit
class type queuing default q3
priority level 1
exit
class type queuing default q4
priority level 1
exit
class type queuing default q5
priority level 1
exit
class type queuing default q6
priority level 1
exit
class type queuing default q7
priority level 1
exit
 
policy-map type queuing pq1
class type queuing cq1
wrr-queue weight 2
exit
class type queuing cq2
wrr-queue weight 4
exit
 
 
#show class-map
 
Type qos class-maps
===================
class-map type qos match-any class-default
 
class-map cmap1
match cos 2
 
class-map cmap2
match cos 3
 
 
Type queuing class-maps
=======================
class-map type queuing match-any cq1
match qos-group 1
 
class-map type queuing match-any cq2
match qos-group 2
 
class-map match-any q0
 
class-map match-any q1
 
class-map match-any q2
 
class-map match-any q3
 
class-map match-any q4
 
class-map match-any q5
 
class-map match-any q6
 
class-map match-any q7
 
 
Type Vlan-Queuing class-maps
============================
 
#show policy-map interface xe2
Interface xe2
Global statistics status : enabled
 
Service-policy (queuing) output: pq1
-----------------------------------
Class-map (queuing): cq1
match qos-group 1
wrr-queue weight 2
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): cq2
match qos-group 2
wrr-queue weight 4
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
 
Service-policy (queuing) output: default-out-policy
-----------------------------------
Class-map (queuing): q0
priority level 1
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): q1
priority level 1
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): q2
priority level 1
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): q3
priority level 1
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): q4
priority level 1
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): q5
priority level 1
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): q6
priority level 1
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): q7
priority level 1
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): mc-q0
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): mc-q1
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): mc-q2
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): mc-q3
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): mc-q4
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): mc-q5
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): mc-q6
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): mc-q7
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
 
Wred Drop Statistics :
----------------------
green : 0 packets
yellow : 0 packets
red : 0 packets
 
#show policy-map interface xe3
 
Interface xe3
Global statistics status : enabled
 
Service-policy (qos) input : pmap1
--------------------------------
Class-map (qos): cmap1 (match all)
match cos 2
set qos-group 1
matched : 209681694 packets, 15097081968 bytes
transmitted : 209681694 packets, 15097081968 bytes
 
Class-map (qos): cmap2 (match all)
match cos 3
set qos-group 2
matched : 0 packets, 0 bytes
transmitted : 0 packets, 0 bytes
 
 
Service-policy (queuing) output: default-out-policy
-----------------------------------
Class-map (queuing): q0
priority level 1
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): q1
priority level 1
output : 11789 packets, 754820 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): q2
priority level 1
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): q3
priority level 1
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): q4
priority level 1
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): q5
priority level 1
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): q6
priority level 1
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): q7
priority level 1
output : 1460 packets, 93914 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): mc-q0
output : 39311112 packets, 2830400048 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): mc-q1
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): mc-q2
output : 78930334 packets, 5051541376 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): mc-q3
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): mc-q4
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): mc-q5
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): mc-q6
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): mc-q7
output : 21 packets, 1428 bytes
dropped : 0 packets, 0 bytes
 
Wred Drop Statistics :
----------------------
green : 0 packets
yellow : 0 packets
red : 0 packets