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