Configure QoS directory

QoS queue configuration

Configure Weighted Fair Queuing (WFQ)

Configure the policy-map used by an interface (CBWFQ)

Configure Weighted Random Early Detection (WRED)

Configure Custom Queuing (CQ)

Configure Priority Queuing (PQ)

QoS Display

Display the situation of interface queue

Display the configuration of custom list

Display the configuration of priority list

Display the configuration of class-map

Display the configuration of policy-map

QoS configuration scheme

   

To make QoS configuration, you need to configure the queuing algorithm on interface, QoS signaling, and QoS link efficiency mechanism. The last two are optional, and the first configuration has a default value on every physical interface, and can be changed according to practical situations.

 

QoS queue configuration

Configure Weighted Fair Queuing (WFQ)

If you need to configure fair queuing on an interface, you can use the following commands in the interface configuration mode after specifying the interface:

command

Usage

fair-queue

Apply fair queuing policy to an interface

NOTICE: On interfaces whose speed is 2.048Mbps or lower, WFQ is the default queuing method. WFQ is not available for Encapsulation LAPB or X.25 interfaces.

Configure the policy-map used by an interface (CBWFQ)

Configuring a policy-map on an interface makes CBWFQ available on this interface. If you need to configure a policy-map on an interface, you can use the following command in the interface configuration mode after specifying the interface:

command

Usage

service-policy  policy-name

Allow the interface to use a policy-map

NOTICE: This command is only available on interfaces that have been configured WFQ algorithm.

Configure Policy-Map

Configuring policy-map and its class-map can specify a different class of stream. When an interface uses this policy-map, it can get some level of service quality guarantee based on the specified class.

To configure a policy-map, first, you need to use the following command in the global mode to enter the policy-map configuration mode:

command

Usage

policy-map  policy-name

Configure a policy-map and enter the policy-map configuration mode

After entering the policy-map configuration mode, you can configure the class-map name used by the current policy-map, the bandwidth and the queue’s upper limit. To make these configurations, you can use the following command in the policy-map configuration mode:

command

Usage

class class-name bandwidth bandwidth(kbps) [queue-limit packet-number]

Configure the bandwidth used by a class-map and its queue upper limit in the current policy-map

Configure Class-Map

Configuring class-map can define some class of stream. When the policy-map used by an interface contains this class-map, it can get some level of service quality guarantee based on the specified class.

To configure the class-map, you can use the following commands in the global configuration mode:

command

Usage

class-map class-name match protocol protocol-type

Configure a class-map classified by protocol

class-map class-name match interface interface-type interface-number

Configure a class-map classified by interface

class-map class-name match access-group list-name

Configure a class-map classified by visit list

 

Configure Weighted Random Early Detection (WRED)

If you need to configure weighted random early detection on an interface, you can use the following command in the interface configuration mode after specifying the interface:

 

command

Usage

random-detect

Apply weighted random early detection to an interface

 

Configure Custom Queuing (CQ)

If you need to configure custom queuing on an interface, you can use the following command in the interface configuration mode after specifying the interface:

command

Usage

custom-queue-list  list-number

Apply CQ algorithm to this interface, parameter “list-number” is the custom list number that is used. Its range is 1-16, without any default value.

Configure Custom List

You can use custom list to define the classification method of the corresponding queue, the number of sending bytes, and the queues upper limit. When an interface uses this custom list, it can make scheduling based on the list.

To configure the queue’s upper limit and the sending byte number of the custom list, you can use the following commands in the global configuration mode:

command

Usage

queue-list list-number queue queue-number limit limit-number

Specify the upper limit of every custom queue. Parameter “limit-number” specifies the number of packets that can be hold in the queue. Its range is 0-32,767, and the default value is 20.

queue-list list-number queue queue-number byte-count byte-count-number

Specify the sending byte number of every queue. Parameter “byte-count-number” specifies the minimum number of bytes that the system can send out from a specified queue in one cycle, and its default value is 1500.

To configure the classification method of custom list, you can use the following commands in the global configuration mode:

command

Usage

queue-list list-number protocol protocol-type queue-number [keyword  key-value]

Create custom queue based on protocol

queue-list list-number interface interface-type interface-number queue-number

Create custom queue based on packets from a specified interface

queue-list list-number default queue-number

Assign a queue number for packets that don’t comply with any rule of custom list, and the default value is 1

Example:

Assign the matching IP visit list “aaa” to queue No.1:

queue-list 1 protocol ip 1 list aaa

This example assigns Telnet packets to queue No.2:

queue-list 4 protocols ip 2 tcp telenet

Assign UDP Domain Name Service packets to queue No.3:

queue-list 4 protocol ip 3 udp dns

Assign packets with more than 1000 bytes to queue No.6:

queue-list 5 protocol ip 6 gt 1000

 

Configure Priority Queuing (PQ)

If you need to configure priority queuing on an interface, you can use the following command in the interface configuration mode after specifying the interface:

command

Usage

priority-group  list-number

Apply PQ algorithm to this interface, parameter “list-number” is the custom list number that is used. Its range is 1-16, without any default value.

Configure Priority List

You can use priority list to define the classification method of the corresponding queue and the queues upper limit. When an interface uses this priority list, it can make scheduling based on the list.

To configure the queue’s upper limit of priority list, you can use the following commands in the global configuration mode:

command

Usage

priority-list list-number queue-limit high-limit middle-limit normal-limit low-limit

Specify the upper limit of every priority queue, the default values are high 20, middle 40, normal 60, low 80

Example:

Set the upper limit of queue to 15 50 70 100

prority-list 4 queue-limit 15 50 70 100

To configure the classification method of the priority list, you can use the following commands in the global configuration mode:

command

Usage

priority-list list-number protocol protocol-type {high | medium | normal | low} [keyword key-value]

Set queuing priority based on protocol type

priority-list list-number interface interface-type interface-number {high | medium | normal | low}

Set the queuing priority for packets entering a specified interface

priority-list list-number default queue-number

Assign a priority queue for packets that doesn’t comply with any rule of priority list, and the default queue is Normal

 

QoS Display

Display the situation of interface queue

To display the situation of an interface queue, you can use the following command:

command

Usage

show queue interface-type interface-number

Display the information of queues on this interface

 

Display the configuration of custom list

To display the configuration of a custom list, you can use the following command:

command

Usage

show  queueing  custom

Display the configuration of custom list

 

Display the configuration of priority list

To display the configuration of a priority list, you can use the following command:

command

Usage

show  queueing  priority

Display the configuration of priority list

Display the configuration of class-map

To display the configuration of a class-map, you can use the following command:

command

Usage

show class-map [class-name]

Display the configuration of class-map

Display the configuration of policy-map

To display the configuration of a policy-map, you can use the following command:

command

Usage

show policy-map [policy-name]

Display the configuration of policy-map

 

QoS configuration scheme

If a user has four kinds of applications A, B, C and D, their expected bandwidth ratios are 10/20/40/30, and packet lengths are 1428/582/371/1525 respectively.  Every time this queue is serviced, the number of bytes that the system sends is an integral multiple of packet length. So, you must consider the length of packet when you configure the total number of bytes, and you should not simply set them to 100/200/400/300; if you do this, the actual bandwidth assignment will be 1428/582/371/1525. To achieve ideal results, please follow the procedures hereafter:

Step 1: for every queue, divide the bandwidth percent you want to assign to this queue by the packet size (in bytes). In this example, the ratio should be: 10/1428, 20/582, 40/371, 30/1525 or 0.007, 0.03436, 0.10782, 0.01967.

Step 2: use the minimum number to normalize the four numbers listed above: 1, 4.9, 15.4, 2.8, and this result is the ratio of packet number that must be sent.

Step 3: the mantissa of any ratio value means that the system needs to send an additional packet. Round up the ratio value to get an integer, which is the total number of packets that should be actually sent. In this example, the actual ratio of sent packets will be 1:5:16:3.

Step 4: multiply the total number of packets of every protocol by the corresponding packet size in order to convert the packet number ratio into the total number of bytes. In this example, the total number of sent packets is 1 1428-byte packet, 5 582-byte packets, 16 371-byte packets and 3 1525-byte packets; i.e. send out 1428, 2910, 5936 and 4575 bytes from these queues respectively. This is the total number of bytes that you will specify in your custom queue configuration.

Step 5: to determine the bandwidth assignment represented by this ratio, you should first calculate the total number of bytes sent by the system every time it services these four queues: (1×1428) + (5×582) + (16×371) + (3×1525) = 1428+2910+5936+4575 = 14849. Then, you can determine the percent of the total number of bytes sent by every queue: 1428/14849, 2910/14849, 5936/14849, 4575/14849 = 9.6%, 19.5%, 39.8%, and 30.8%. As you can see, these 4 percentages are very close to our expected ratio 10/20/40/30.

Step 6: if the actual bandwidth ratio is not close to the expected bandwidth ratio, you can multiply the original ratio by an optimal value in order to make the actual bandwidth ratio as close to these 4 integers as it can. NOTICE, the multiplier that you use doesnt have to be an integer.

The detailed configuration is listed below: (suppose that these 4 kinds of applications UDP ports are 100, 200, 400, and 700 respectively; and they use custom list No.1)

First, assign the corresponding queues for these 4 kinds of applications (2, 3, 4, 5)

queue-list 1 p ip 2 udp 100

queue-list 1 p ip 3 udp 200

queue-list 1 p ip 4 udp 400

queue-list 1 p ip 5 udp 700

Specify the sending byte number of every queue

queue-list 1 queue 2 byte-count 1428

queue-list 1 queue 3 byte-count 2910

queue-list 1 queue 4 byte-count 5936

queue-list 1 queue 5 byte-count 4575

Assign this custom list to the interface

interface s1/0

custom-queue-list 1