Policing Versus Shaping

Traffic policing propagates bursts. When the traffic rate reaches the configured maximum rate, excess traffic is dropped (or remarked). The result is an output rate that appears as a saw-tooth with crests and troughs. In contrast to policing, traffic shaping retains excess packets in a queue and then schedules the excess for later transmission over increments of time. The result of traffic shaping is a smoothed packet output rate.

 

he following table lists the differences between shaping and policing to help you choose the best solution.

Shaping Policing
Objective Buffer and queue excess packets above the committed rates. Drop (or remark) excess packets above the committed rates. Does not buffer.*
Token Refresh Rate Incremented at the start of a time interval. (Minimum number of intervals is required.) Continuous based on formula: 1 / committed information rate
Token Values Configured in bits per second. Configured in bytes.
Configuration Options
  • shape command in the modular quality of service command-line interface (MQC) to implement class-based shaping.
  • frame-relay traffic-shapecommand to implement Frame Relay Traffic Shaping (FRTS).
  • traffic-shapecommand to implement Generic Traffic Shaping (GTS).
  • police command in the MQC to implement class-based policing.
  • rate-limit command to implement committed access rate (CAR).
Applicable on Inbound No Yes
Applicable on Outbound Yes Yes
Bursts Controls bursts by smoothing the output rate over at least eight time intervals. Uses a leaky bucket to delay traffic, which achieves a smoothing effect. Propagates bursts. Does no smoothing.
Advantages Less likely to drop excess packets since excess packets are buffered. (Buffers packets up to the length of the queue. Drops may occur if excess traffic is sustained at high rates.) Typically avoids retransmissions due to dropped packets. Controls the output rate through packet drops. Avoids delays due to queuing.
Disadvantages Can introduce delay due to queuing, particularly deep queues. Drops excess packets (when configured), throttling TCP window sizes and reducing the overall output rate of affected traffic streams. Overly aggressive burst sizes may lead to excess packet drops and throttle the overall output rate, particularly with TCP-based flows.
Optional Packet Remarking No Yes (with legacy CAR feature).