132 Chapter 5: Introduction to the Modular QoS Command-Line Interface
The output from show class-map displays all the configured classes (in this case, there is
only one), whether classes are a match-any or a match-all class, what the name of each
class is, and which traffic belongs in those classes. Overall, this is a very useful command.
Also notice the class-default, which is automatically created whenever any other class is
created. The purpose of class-default is to give all traffic that does not belong to any other
class a place to go.
The ID numbers that are given in parentheses next to each class cannot be changed and have
no meaning, other than to assist Cisco IOS Software in keeping the classes organized.
Going back to the Accounting department example, a total of four classes are needed: one
to match HTTP traffic from 10.1.1.1, one to match FTP traffic from 10.1.1.1, one to match
HTTP traffic from 10.1.1.2, and one to match FTP traffic from 10.1.1.2. Example 5-12
shows the complete configuration of the classes. Notice that the classes have been renamed
for clarity.
Now all four of the traffic source/type pairs that were presented earlier in the chapter have
been classified, allowing for differentiated treatment to be given to each.
Step 2: The Policy Map
The function of the class map is only to identify traffic, based on the characteristics given
within the class map; the actual treatment of that traffic is specified in a policy map. As
discussed earlier in the chapter, many different QoS mechanisms can be configured via the
MQC, so the policy map has quite a few options. Note that, on switching platforms, not all
Example 5-12 Displaying the Class Configuration
R1# show class-map
Class Map match-any class-default (id 0)
Match any
Class Map match-all ACCOUNTING-HTTP (id 2)
Match access-group 101
Match access-group 103
Class Map match-all DEVELOPMENT-FTP (id 5)
Match access-group 102
Match access-group 104
Class Map match-all DEVELOPMENT-HTTP (id 4)
Match access-group 101
Match access-group 104
Class Map match-all ACCOUNTING-FTP (id 3)
Match access-group 102
Match access-group 103
Step 2: The Policy Map 133
of these options are supported in hardware. Switching platforms, such as the Catalyst 6500,
may support some options in software. For performance reasons, you should not configure
policies that are not supported in hardware unless absolutely necessary, because there could
be a severe performance penalty for doing so. Cisco constantly adds new hardware support
for features and the hardware support is different for different hardware (such as, PFC1
versus PFC2). As such, you should always check the hardware support for these actions
before configuring them. NBAR was discussed earlier in this chapter and is a good example
of something that was not supported in hardware on the 6500 at the time of this writing.
Configuring the Policy Map
Like the class map, the policy map is configured from the global configuration mode in
Cisco IOS Software and requires a name.
R1(config)#policy-map ?
WORD policy-map name
R1(config)#policy-map ACCOUNTING-POLICY
R1(config-pmap)#
The policy map ACCOUNTING-POLICY is now configured, and the router automatically
moves into policy map configuration mode, as indicated by the config-pmap in the router’s
prompt. This configuration mode allows for the configuration of the specific policy map
that was created and has several options, as demonstrated in Example 5-13.
As with the class map configuration, it is recommended that a description be configured for
all policy maps, but this is not required. Again there is a rename option, which is just a
convenient way of renaming the policy map without losing the configuration. Before the
rename option was available, the only way to change the name of a policy map was to delete
the policy map and then re-add the same configuration under the new name. For anyone
who works with QoS on a daily basis, this was a great addition. The main purpose of the
policy map is, however, to create the policy or policies that will be applied to traffic of a
given class. As such, the option for selecting a class is of the most interest. For more compli-
cated QoS configurations, using meaningful names for classes and policies along with the
description feature is of great operational value.
Example 5-13 Policy Map Options
R1(config-pmap)# ?
QoS policy-map configuration commands:
class policy criteria
description Policy-Map description
exit Exit from QoS policy-map configuration mode
no Negate or set default values of a command
rename Rename this policy-map
134 Chapter 5: Introduction to the Modular QoS Command-Line Interface
The only option listed under the class command is for you to enter the name of the class for
which you want to configure a policy. A list of available classes is not given, but the
supported classes include those that have been configured manually plus class-default.
Example 5-14 shows the options available under class-default.
Notice that a new prompt appears, after a class has been selected, to indicate that you have
entered the class configuration submode within the policy map configuration. The options
shown, other than the fair-queue option, are the same for all classes. The fair-queue option
is available on some classes, but not all. A discussion of the details of this behavior is
beyond the scope of this text but can be found at Cisco.com.
Policy Map Options: A Closer Look
Because the policy map is the portion of the configuration that dictates the actual treatment
of traffic by the router, a more detailed explanation of the behavior of each option is
provided here. exit and no are not covered because their behavior is the same as elsewhere
in Cisco IOS Software.
bandwidth—Allows for the configuration of CBWFQ. The specifics of CBWFQ
operation are beyond the scope of this explanation, but this command provides a
minimum bandwidth guarantee to this class of traffic.
fair-queue—Not available in all classes. This command enables Flow-based
Weighted Fair Queuing within this class.
police—Allows for the configuration of a policer, also known as rate limiting. The
police command, when used within a class, is called class-based policing.
priority—Designates that this class is a Low Latency Queuing (LLQ) class, which
should receive strict scheduling priority to minimize delay, jitter and packet loss. Also
specifies the amount of bandwidth for this class.
queue-limit—Designates the maximum number of packets that can be in this queue.
Example 5-14 Policy Map Options Available Under class-default
R1(config)# policy-map ACCOUNTING-POLICY
R1(config-pmap)# class class-default
R1config-pmap-c)# ?
QoS policy-map class configuration commands:
bandwidth Bandwidth
exit Exit from QoS class action configuration mode
fair-queue Enable Flow-based Fair Queuing in this Class
no Negate or set default values of a command
police Police
priority Strict Scheduling Priority for this Class
queue-limit Queue Max Threshold for Tail Drop
random-detect Enable Random Early Detection as drop policy
service-policy Configure QoS Service Policy
shape Traffic Shaping
set Set QoS values
Step 2: The Policy Map 135
random-detect—Enables Weighted Random Early Detection (WRED) for
congestion avoidance. By default, IP precedence is used for weight determination, but
additional options within this command allow for the WRED algorithm to look at the
DSCP. This command also provides an option for enabling explicit congestion
notification (ECN) on this class.
service-policy—Allows for the configuration of hierarchical policies (policy within a
policy), which may be used to achieve functionality not possible in a single policy. For
example, a T1 can be shaped to 512 kbps via a top-level policy, and then that 512 kbps
can be divided (using CBWFQ/LLQ) within a second-level policy. Top-level policies
are sometimes called parent policies, and second-level policies are sometimes called
child policies.
shape—Allows for the configuration of class-based shaping, which is generic traffic
shaping performed on a per-class basis. In this case, only the traffic in this class would
be shaped. This is in contrast to interface-based shaping, in which all traffic on the
entire interface is shaped.
set—Allows for the marking of packets. Several fields can be marked through the use
of the set command, including IP precedence, IP DSCP, MPLS experimental bits,
Layer 2 CoS, the ATM cell loss priority (CLP) bit, and the QoS group.
Back to the Accounting department example again, because it is time to configure the actual
policies for the classes that have been defined. In this example, the only parameter that is
used is bandwidth. This is not necessarily the policy that you would use in your production
environment and is intended only as a sample of the configuration parameters.
Policy Map Configuration Example
Assuming that the link speed is 1.544 Mbps, and the intent is to give 128 kbps to each of
the production classes, 64 kbps to the DEVELOPMENT-HTTP class, and 32 kbps to the
DEVELOPMENT-FTP class, the configuration would look like Example 5-15.
Notice that between the bandwidth statement for DEVELOPMENT-HTTP and the class
name for DEVELOPMENT-FTP that there is no exit command. It is acceptable to exit from
Example 5-15 Configuring a Policy Map with Class Maps
R1(config-pmap)# policy-map ACCOUNTING-POLICY
R1(config-pmap)# class ACCOUNTING-HTTP
R1(config-pmap-c)# bandwidth 128
R1(config-pmap-c)# exit
R1(config-pmap)# class ACCOUNTING-FTP
R1(config-pmap-c)# bandwidth 128
R1(config-pmap-c)# exit
R1(config-pmap)# class DEVELOPMENT-HTTP
R1(config-pmap-c)# bandwidth 64
R1(config-pmap-c)# class DEVELOPMENT-FTP
R1(config-pmap-c)# bandwidth 32
136 Chapter 5: Introduction to the Modular QoS Command-Line Interface
each class after configuring it, but not necessary. When you type a new class name, the
MQC automatically moves to the configuration mode for that class.
You can confirm the configuration that has been entered through the use of the show policy-
map command, as shown in Example 5-16.
As indicated by the output, the queue limit for each of these classes is set to 64 packets (the
default). This output also shows the policy map’s name, the names of all the class maps
within the policy, and the policy that has actually been configured for each class. Notice that
this command does not show any information about the traffic that will belong to each class
or whether each class is a match-any or a match-all.
As discussed previously, one of the greatest benefits to the MQC structure is the lack of a
learning curve for configuring new options. Suppose, for instance, that you now need to add
traffic shaping to the ACCOUNTING-FTP class, to prevent the class from using more than
256 kbps under any conditions. If you were not using the MQC, it would be necessary to
learn an entirely new command structure. Because the MQC uses the same structure to
configure many QoS components, however, the configuration requires only one additional
line of configuration.
Example 5-17 is the same example configuration as Example 5-15, but with the addition of
traffic shaping.
Example 5-16 Verifying the Policy Map
R1# show policy-map
Policy Map ACCOUNTING-POLICY
Class ACCOUNTING-HTTP
Bandwidth 128 (kbps) Max Threshold 64 (packets)
Class ACCOUNTING-FTP
Bandwidth 128 (kbps) Max Threshold 64 (packets)
Class DEVELOPMENT-HTTP
Bandwidth 64 (kbps) Max Threshold 64 (packets)
Class DEVELOPMENT-FTP
Bandwidth 32 (kbps) Max Threshold 64 (packets)
Class class-default
Example 5-17 Traffic Shaping Within a Class Map
R1(config-pmap)# policy-map ACCOUNTING-POLICY
R1(config-pmap)# class ACCOUNTING-HTTP
R1(config-pmap-c)# bandwidth 128
R1(config-pmap-c)# exit
R1(config-pmap)# class ACCOUNTING-FTP
R1(config-pmap-c)# bandwidth 128
R1(config-pmap-c)# shape average 256000
R1(config-pmap-c)# exit
R1(config-pmap)# class DEVELOPMENT-HTTP
R1(config-pmap-c)# bandwidth 64
R1(config-pmap-c)# class DEVELOPMENT-FTP
R1(config-pmap-c)# bandwidth 32
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset