bandwidth (QoS)
To specify the minimum bandwidth allocated to a class belonging to a policy map, use the bandwidth command in policy map class configuration mode. To remove the bandwidth specified for a class, use the no form of this command.
bandwidth {rate [units] | percent percentage-value}
no bandwidth {rate [units] | percent percentage-value}
Syntax Description
rate |
Minimum bandwidth, in the units specified, to be assigned to the class. Range is from 1 to 4294967295. |
units |
Specifies the units for the bandwidth. Values can be:
|
percent percentage-value |
Specifies the amount of guaranteed bandwidth, based on an absolute percentage of available bandwidth. Range is from 1 to 100. |
Command Default
The default units is kbps.
Command Modes
Policy map class configuration
Command History
Release |
Modification |
---|---|
Release 2.0 |
This command was introduced. |
Release 3.3.0 |
The ability to select the units for the bandwidth was added. The range of bandwidth values was changed from 8 to 4000000 to 1 to 4294967295. |
Release 3.3.1 |
Minimum rate value changed from 128 kbps to 256 kbps. |
Usage Guidelines
The bandwidth command is used to specify the minimum guaranteed bandwidth allocated for traffic matching a particular class. Bandwidth may be defined as a specific value or may be set as a percentage of the interface bandwidth.
Note |
By default, and without any QoS configuration, the default group of an interface is allowed a minimum bandwidth of either 1 percent of the interface rate or 10 Mbps. This is applicable only on the egress. |
The actual bandwidth used is calculated in multiples of 256 kbps, the minimum bandwidth rate. The configured value is rounded to the nearest multiple of 256 kbps. The value shown in the output of the running-configuration shows the configured value as entered by the user.
If a percentage value is set, the accuracy that can be expected is 1 percent.
The bandwidth command can be used only within egress service policies. Use within an ingress policy is not supported.
Note |
The bandwidth value takes into account the Layer 2 encapsulation that is applied to traffic leaving the interface. For POS/SDH transmission, the encapsulation is considered to be 4 bytes. For Ethernet, the encapsulation is 14 bytes; whereas for IEEE 802.1Q, the encapsulation is 18 bytes. The actual bandwidth assigned to a class can be seen in the output of the show qos interface command. |
Be careful when specifying bandwidth guarantees close to 100 percent, because the Layer 2 encapsulation considered does not include the entire Layer 2 header. This can lead to oversubscription, particularly in the case of small packet sizes.
For bundled interfaces, bandwidth can be configured only as a percentage.
A policy map can have a single bandwidth statement per class. Both percentage and actual value bandwidth configurations can be used within a policy map.
The bandwidth command does not specify how the bandwidth is to be shared. Instead it specifies how much bandwidth is guaranteed per class, by setting the number of tokens that are assigned to the token bucket of a particular class. For configured behavior to work correctly, you must ensure that the sum of the bandwidths plus any priority traffic is not greater than the bandwidth of the interface itself. If the interface is oversubscribed, unpredictable behavior results.
The bandwidth of the interface is set to be that of the physical interface, unless a hierarchical policy is defined that reduces the bandwidth available to the traffic. The following example shows a hierarchical policy being used to shape traffic to the specified value. The child policy then determines how the shaped bandwidth should be apportioned between the specified classes:
policy-map parent
class match_all
shape average 1000000
bandwidth 1000000
service-policy child
policy-map child
class gold
bandwidth percent 20
class silver
bandwidth percent 40
class default
bandwidth percent 40
Note |
The bandwidth command is part of the parent policy. In this instance, the bandwidth command not only sets the minimum bandwidth for the class but also resets the reference point for the bandwidth percent statements in the child policy. |
For main interface service policies:
-
If bandwidth is configured in the parent class, parent minimum bandwidth is used as a reference for the child bandwidth percentages.
- If bandwidth is not configured in the parent class, the implicit minimum
bandwidth, which is a portion of the total unallocated bandwidth allocated to
the class based on the explicit or implicit bandwidth remaining, is used as a
reference.
Implicit bandwidth remaining is an equal share of unallocated bandwidth among all queuing classes without either bandwidth or bandwidth remaining actions.
For subinterface policies:
-
If bandwidth is configured in the parent class, parent minimum bandwidth is used as a reference for child bandwidth percentages.
-
If bandwidth remaining is configured in the parent class, bandwidth-remaining-percent * interface-rate is used as a reference.
-
If bandwidth is not configured in the parent class, shape rate is used as a reference.
In this example, the hierarchical policy is attached to the main interface, and the parent classes are a mix of bandwidth and shape only classes:
policy-map hqos
class c1
bandwidth percent 40
service-policy child
class c2
shape average 500000000
service-policy child
The reference for the child policy in class c2 is the implicit bandwidth of class c2 bounded by the shape rate of class c2. Therefore, the reference = (60 percent * interface bandwidth) / 3 bounded by 500000000 kbps.
In this example, the hierarchical policy is a class-default only parent shape configured on subinterfaces:
policy-map sub_int_hqos
class c1ass-default
shape average 40
service-policy child
The class-default parent shape rate is used as reference.
When the percent keyword is used with the bandwidth command, the bandwidth of the interface is defined as being the Layer 2 capacity excluding the Gigabit Ethernet or POS encapsulation but including the High-Level Data Link Control (HDLC) flags, frame check sequence (FCS), and so on. These have to be included because they are applied per packet, and the system cannot predict how many packets of a particular packet size are being sent out.
policy-map oc-192
class c1
bandwidth percent 50
The resulting bandwidth reservation for class c1 is 4,792,320 kbps. This equates to 50 percent of the OC-192 bandwidth excluding the GE or POS overhead.
For Clear Channel ATM subinterfaces, the bandwidth percent command uses the VC shaping rate as the reference rate. On ATM subinterfaces, only one bandwidth action can be configured in a class.
Task ID
Task ID |
Operations |
---|---|
qos |
read, write |
Examples
This example shows how to guarantee 50 percent of the interface bandwidth to a class called class1 and 10 percent of the interface bandwidth to a class called class2:
RP/0/RP0/CPU0:router(config)# policy-map policy1
RP/0/RP0/CPU0:router(config-pmap)# class class1
RP/0/RP0/CPU0:router(config-pmap-c)# bandwidth percent 50
RP/0/RP0/CPU0:router(config-pmap-c)# exit
RP/0/RP0/CPU0:router(config-pmap)# class class2
RP/0/RP0/CPU0:router(config-pmap-c)# bandwidth percent 10