Cisco经典文档

当前位置: 首页Cisco经典文档QoS 服务策略的 bandwidth 与 priority 命令的比较_英文原版


Comparing the bandwidth and priority Commands of a QoS Service Policy

            

 

                                                       文档下载:

切换至中文版


Contents

Introduction
Prerequisites
      Requirements
      Components Used
      Conventions
Summary of Differences
Configuring the bandwidth Command
Configuring the priority Command
Which Traffic Classes Can Use Excess Bandwidth?
How Is Unused Bandwidth Allocated?
Using police Command to Set a Maximum
Understanding the Available Bandwidth Value
 


Introduction

The bandwidth and priority commands both define actions that can be applied within a modular quality of service command-line interface (MQC) policy-map, which you apply to an interface, subinterface or virtual circuit (VC) via the service-policy command. Specifically, these commands provide a bandwidth guarantee to the packets which match the criteria of a traffic class. However, the two commands have important functional differences in those guarantees. This Tech Note explains those differences and explains how the unused bandwidth of a class is distributed to flows that match other classes.

Prerequisites

Requirements

There are no specific requirements for this document.

Components Used

This document is not restricted to specific software and hardware versions.

The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, make sure that you understand the potential impact of any command.

Conventions

For more information on document conventions, refer to the Cisco Technical Tips Conventions.

Summary of Differences

This table lists the functional differences between the bandwidth and priority commands:

Function

bandwidth Command

priority Command

Minimum bandwidth guarantee

Yes

Yes

Maximum bandwidth guarantee

No

Yes

Built-in policer

No

Yes

Provides low latency

No

Yes

 

In addition, the bandwidth and priority commands are designed to meet different quality of service (QoS) policy objectives. This table lists those differing objectives:

Application

bandwidth Command

priority Command

Bandwidth management for WAN links

Yes

Somewhat

Manage delay and variations in delay (jitter)

No

Yes

Improve application response time

No

Yes

 

Even with fast interfaces, most networks still need a strong QoS management model to deal effectively with the congestion points and bottlenecks that inevitably occur due to speed-mismatch or diverse traffic patterns. Real world networks have limited resources and resource bottlenecks, and need QoS policies to ensure proper resource allocation.

Configuring the bandwidth Command

The Cisco IOS® Configuration Guides describe the bandwidth command as the "amount of bandwidth, in kbps, to be assigned to the class. . . .To specify or modify the bandwidth allocated for a class belonging to a policy map."

Look at what these definitions mean.

The bandwidth command provides a minimum bandwidth guarantee during congestion. There are three forms of the command syntax, as illustrated in this table:

Command Syntax

Description

bandwidth {kbps}

Specifies bandwidth allocation as a bit rate.

bandwidth percent {value}

Specifies bandwidth allocation as a percentage of the underlying link rate.

bandwidth remaining percent {value}

Specifies bandwidth allocation as a percentage of the bandwidth that has not been allocated to other classes.

 

Note: The bandwidth command defines a behavior, which is a minimum bandwidth guarantee. Not all Cisco router platforms use weighted-fair queueing (WFQ) as the underlying algorithm to implement this behavior. For more information, refer to Why Use CBWFQ?.

Configuring the priority Command

The Cisco IOS Configuration Guides describe the priority command as reserving "a priority queue with a specified amount of available bandwidth for CBWFQ traffic…To give priority to a traffic class based on the amount of available bandwidth within a traffic policy." Below explains what these definitions mean.

You create a priority queue with these set of commands:

Router(config)# policy-map policy-name
 
Router(config-pmap)# class class-name
 
Router(config-pmap-c)# priority kpbs [bytes]

During congestion conditions, the traffic class is guaranteed bandwidth equal to the specified rate. (Recall that bandwidth guarantees are only an issue when an interface is congested.) In other words, the priority command provides a minimum bandwidth guarantee.

In addition, the priority command implements a maximum bandwidth guarantee. Internally, the priority queue uses a token bucket that measures the offered load and ensures that the traffic stream conforms to the configured rate. Only traffic that conforms to the token bucket is guaranteed low latency. Any excess traffic is sent if the link is not congested or is dropped if the link is congested. For more information, refer to What Is a Token Bucket?.

The purpose of the built-in policer is to ensure that the other queues are serviced by the queueing scheduler. In the original Cisco priority queueing feature, which uses the priority-group and priority-list commands, the scheduler always serviced the highest priority queue first. In extreme cases, the lower priority queues rarely were serviced and effectively were starved of bandwidth.

The real benefit of the priority command—and its major difference from the bandwidth command—is how it provides a strict de-queueing priority to provide a bound on latency. Here is how the Cisco IOS Configuration Guide describes this benefit: "A strict priority queue (PQ) allows delay-sensitive data such as voice to be de-queued and sent before packets in other queues are de-queued." Let's look at what this means.

Every router interface maintains these two sets of queues:

Queue

Location

Queueing Methods

Service Policies Apply

Command to Tune

Hardware queue or transmit ring

Port adapter or network module

FIFO only

No

tx-ring-limit

Layer 3 queue

Layer 3 processor system or interface buffers

Flow-based WFQ, CBWFQ, LLQ

Yes

Varies with queueing method. Use the queue-limit command with a bandwidth class.

 

From the above table, we can see that a service-policy applies only to packets in the Layer 3 queue.

Strict de-queueing refers to the queueing scheduler servicing the priority queue and forwarding its packets to the transmit ring first. The transmit ring is the last stop before the physical media.

In the following illustration, the transmit ring has been configured to hold four packets. If three packets already are on the ring, then at best we can queue to the fourth position and then wait for the other three to empty. Thus, the Low Latency Queueing (LLQ) mechanism simply de-queues the packets to the tail end of the driver-level first-in, first-out (FIFO) queue on the transmit ring.

priorityvsbw1.jpg

Use the tx-ring-limit command to tune the size of the transmit ring to a non-default value. Cisco recommends tuning the transmit ring when transmitting voice traffic. Refer to the Low Latency Queueing Feature Module.

Traffic prioritization is especially important for delay-sensitive, interactive transaction-based applications. To minimize delay and jitter, the network devices must be able to service voice packets as soon as they arrive, or in other words, in strict priority fashion. Nothing short of strict priority works well for voice. Unless the voice packets are immediately de-queued, each hop will introduce more delay.

The International Telecommunications Union (ITU) recommends a maximum 150-millisecond one-way end-to-end delay. Without immediate de-queueing at the router interface, a single router hop can account for most of this delay budget. For more information, refer to the Voice Quality Technical Tips.

Note: With both commands, the kbps value should take the Layer 2 overhead into account. In other words, if a guarantee is made to a class, that guarantee is with respect to Layer 2 throughput. For more information, refer to What Bytes Are Counted by IP to ATM CoS Queueing? and Why Use LLQ?.

Which Traffic Classes Can Use Excess Bandwidth?

Although the bandwidth guarantees provided by the bandwidth and priority commands have been described with words like "reserved" and "bandwidth to be set aside", neither command implements a true reservation. In other words, if a traffic class is not using its configured bandwidth, any unused bandwidth is shared among the other classes.

The queueing system imposes an important exception to this rule with a priority class. As noted above, the offered load of a priority class is metered by a traffic policer. During congestion conditions, a priority class cannot use any excess bandwidth.

This table describes when a bandwidth class and a priority class can use excess bandwidth:

Command

Congestion

Non-Congestion

bandwidth Command

Allowed to exceed the allocated rate.

Allowed to exceed the allocated rate.

priority Command

Cisco IOS meters the packets and applies a traffic measurement system via a token bucket. Matching packets are policed to the configured bps rate, and any excess packets are discarded.

The class can exceed its configured bandwidth.

 

Note: An exception to these guidelines for LLQ is Frame Relay on the Cisco 7200 router and other non-Route/Switch Processor (RSP) platforms. The original implementation of LLQ over Frame Relay on these platforms did not allow the priority classes to exceed the configured rate during periods of non-congestion. Cisco IOS Software Release 12.2 removes this exception and ensures that non-conforming packets are only dropped if there is congestion. In addition, packets smaller than an FRF.12 fragmentation size are no longer sent through the fragmenting process, reducing CPU utilization.

From the above discussion, it is important to understand that since the priority classes are policed during congestion conditions, they are not allocated any remaining bandwidth from the bandwidth classes. Thus, remaining bandwidth is shared by all bandwidth classes and class-default.

How Is Unused Bandwidth Allocated?

This section explains how the queueing system distributes any remaining bandwidth. Here is how the Class-Based Weighted Fair Queueing Feature Overview describes the allocation mechanism: "If excess bandwidth is available, the excess bandwidth is divided amongst the traffic classes in proportion to their configured bandwidths. If not all of the bandwidth is allocated, the remaining bandwidth is proportionally allocated among the classes, based on their configured bandwidth." Let's look at two examples.

In the first example, policy-map foo guarantees 30 percent of the bandwidth to class bar and 60 percent of the bandwidth to class baz.

policy-map foo 
  class bar 
    bandwidth percent 30 
 class baz 
  bandwidth percent 60

If you apply this policy to a 1 Mbps link, it means that 300 kbps is guaranteed to class bar, and 600 kbps is guaranteed to class baz. Importantly, 100 kbps is leftover for class-default. If class-default does not need it, the unused 100 kbps is available for use by class bar and class baz. If both classes need the bandwidth, they share it in proportion to the configured rates. In this configuration, the sharing ratio is 30:60 or 1:2.

The next sample configuration contains three policy maps—bar, baz, and poli. In the policy map called bar and the policy map called baz, the bandwidth is specified by percentage. However, in the policy map called poli, bandwidth is specified in kbps.

Remember that the class maps should already be created before you create the policy maps.

 
 policy-map bar
  class voice
   priority percent 10
  class data
   bandwidth percent 30
  class video
   bandwidth percent 20
 policy-map baz
  class voice
   priority percent 10
  class data
   bandwidth remaining percent 30
  class video
   bandwidth remaining percent 20
 policy-map poli
  class voice
  class data
   bandwidth 30
  class video
   bandwidth 20

Note: The bandwidth remaining percent command was introduced in Cisco IOS version 12.2(T). Refer to Low Latency Queueing with Priority Percentage Support for a detailed description of the bandwidth command.

Using police Command to Set a Maximum

If a bandwidth or priority class should not exceed its allocated bandwidth during periods of no congestion, you can combine the priority command with the police command. This configuration imposes a maximum rate that is always active on the class. Choosing to configure a police statement in this configuration depends on the policy's objective.

Understanding the Available Bandwidth Value

This section explains how the queueing system derives the Available Bandwidth value, as displayed in the output of the show interface or show queueing commands.

We created this policy-map named leslie:

7200-16# show policy-map leslie 
  Policy Map leslie 
    Class voice 
      Weighted Fair Queueing 
            Strict Priority 
            Bandwidth 1000 (kbps) Burst 25000 (Bytes) 
    Class data 
      Weighted Fair Queueing 
            Bandwidth 2000 (kbps) Max Threshold 64 (packets)

We then created an ATM permanent virtual circuit (PVC), assigned it to the variable bit rate non-real-time ATM service category, and configured a sustained cell rate of 6 Mbps. We then applied the policy-map to the PVC with the service-policy output leslie command.

7200-16(config)# interface atm 4/0.10 point 
7200-16(config-subif)# pvc 0/101 
7200-16(config-if-atm-vc)# vbr-nrt 6000 6000 
7200-16(config-if-atm-vc)# service-policy output leslie

The show queueing interface atm command displays "Available Bandwidth 1500 kilobits/sec."

7200-16# show queueing interface atm 4/0.10 
  Interface ATM4/0.10 VC 0/101 
  Queueing strategy: weighted fair 
  Output queue: 0/512/64/0 (size/max total/threshold/drops) 
     Conversations  0/0/128 (active/max active/max total) 
     Reserved Conversations 1/1 (allocated/max allocated) 
     Available Bandwidth 1500 kilobits/sec

Let us look at how this value is derived:

  1. 6 Mbps is the sustained cell rate (SCR). By default 75 percent of this is reservable:

    0.75 * 6000000 = 4500000
    
  2. 3000 kbps is already used by the voice and data classes:

    4500000 - 3000000 = 1500000 bps
    
  3. Available bandwidth is 1500000 bps.

The default maximum reservable bandwidth value of 75 percent is designed to leave sufficient bandwidth for overhead traffic, such as routing protocol updates and Layer 2 keepalives. It also covers Layer 2 overhead for packets matching defined traffic classes or the class-default class. You now can increase the maximum reservable bandwidth value on ATM PVCs using the max-reserved-bandwidth command. For supported IOS releases and further background information, refer to Understanding the max-reserved-bandwidth Command on ATM PVCs.

On Frame Relay PVCs, the bandwidth and priority commands calculate the total amount of available bandwidth in one of these ways:

  • If a Minimum Acceptable Committed Information Rate (minCIR) is not configured, the CIR is divided by two.

  • If a minCIR is configured, the minCIR setting is used in the calculation. The full bandwidth from the above rate can be assigned to bandwidth and priority classes.

Thus, the max-reserved-bandwidth command is not supported on Frame Relay PVCs, although you should ensure that the amount of bandwidth configured is large enough to accommodate Layer 2 overhead. For more information, refer to Configuring CBWFQ on Frame Relay PVCs.


 

 

注:本人能力有限,如遇不足之处,还请指正!

China-CCIE  QQ交流群:106155045   点击与作者QQ交谈