Defining and Limiting CBWFQ Bandwidth

Defining and Limiting CBWFQ Bandwidth
Cisco IOS checks a CBWFQ policy map to ensure that it does not allocate too much bandwidth.
IOS performs the check when the service-policy output command is added; if the policy map
defines too much bandwidth for that interface, the service-policy command is rejected. IOS
defines the allowed bandwidth based on two interface subcommands: the bandwidth command
and the reserved bandwidth implied by the max-reserved-bandwidth command (abbreviated
444 Chapter 13: Congestion Management and Avoidance
hereafter as int-bw and max-res, respectively). The nonreservable bandwidth is meant for
overhead traffic, much like CQ’s system queue.
IOS allows a policy map to allocate bandwidth based on the product of int-bw and max-res. In
other words, with a default max-res setting of 75 (75 percent), on an interface with int-bw of 256
(256 kbps), the policy map could allocate at most 192 kbps of bandwidth with its various
bandwidth commands. Example 13-3 shows a simple example with a policy map that contains
one class that has 64 kbps configured. The service-policy command is rejected on an interface
whose bandwidth is set to 64 kbps.
To overcome such problems, the engineer can simply pay attention to details and ensure that the
policy map’s configured bandwidth commands do not total more than max-res × int-bw.
Alternatively, max-res can be defined to a higher number, up to a value of 100; however, Cisco
does not recommend changing max-res.
The bandwidths can also be defined as percentages using either the bandwidth percent or
bandwidth remaining percent command. By using percentages, it is easier to ensure that a policy
map does not attempt to allocate too much bandwidth.
The two percentage-based bandwidth command options work in slightly different ways. Figure
13-2 shows the concept for each.
Example 13-3 CBWFQ Rejected Due to Request for Too Much Bandwidth
! max-res was defaulted to 75, so only 75% of 64 kbps, or 48 kbps,
! is available. Note that the 48 kbps is mentioned in the error message.
R3(config-cmap)# policy-map explicit-bw
R3(config-pmap)# class class1
R3(config-pmap-c)# bandwidth 64
R3(config-pmap-c)# int s 0/1
R3(config-if)# bandwidth 64
R3(config-if)# service-policy output explicit-bw
I/f Serial0/1 class class1 requested bandwidth 64 (kbps), available only 48 (kbps)
Queuing Tools: CBWFQ and LLQ 445
Figure 13-2 Bandwidth Percent and Bandwidth Remaining Percent Concepts
The bandwidth percent bw-percent command sets a class’s reserved bandwidth as a percentage
of int-bw. For instance, in Example 13-2, if the bandwidth percent 50 command had been used
instead of bandwidth 64, the voip-rtp class would have used 50% × 128 kbps, or 64 kbps. IOS
checks all the bandwidth percent commands in a single policy map to ensure that the total does
not exceed the max-res setting for the interface—in other words, with a default setting for maxres,
all the bandwidth percent commands in a single policy map cannot total more than 75.
The bandwidth remaining percent bw-percent command sets a class’s reserved bandwidth as a
percentage of remaining bandwidth. Remaining bandwidth is the reservable bandwidth, calculated
as int-bw × max-res. This method allows a policy map to allocate percentages that total 100
12(100 percent). Using Example 13-2 again, the remaining bandwidth would be 75% × 128 kbps,
or
96 kbps, and the command bandwidth remaining percent 50 would allocate 48 kbps for a class.
NOTE Using the bandwidth remaining percent command is particularly useful with LLQ
and will be explained in that context later in the chapter. The reason is that the remaining
bandwidth calculation is changed by the addition of LLQ.
Interface
Bandwidth
Σ Bandwidths <= max-res %
Bandwidth Percent:
Percentages of int-bw
Bandwidth remaining percent:
Percentages of max-res * int-bw
Σ Bandwidths <= 100
100%
0%
Max-res %
Unreservable
Bandwidth
Reservable
Bandwidth
Note that in a single policy map, only one of the three variations of the bandwidth command can
be used. Table 13-5 summarizes the three methods for reserving bandwidth with CBWFQ.
Reference for CBWFQ Bandwidth Reservation
Method
Amount of Bandwidth
Reserved by the bandwidth
Command
The Sum of Values in a Single
Policy Map Must Be <= …
Explicit bandwidth As listed in commands max-res × int-bw
Percent A percentage of the int-bw max-res setting
Remaining percent A percentage of the reservable
bandwidth (int-bw × max-res)
100