cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
829
Views
5
Helpful
2
Replies

whats the difference and between shaping and policing.

dolanduck.
Level 1
Level 1

i am confused policing drops data that exceeds the set amount in bandwidth, and can resend data but shaping slows down data and can resend data ? I Was reading the Cisco cert guild can you apply shaping and policing on the queues?

 

2 Replies 2

ngkin2010
Level 7
Level 7

Hi,

 

Actually, you have point out the key different between Traffic Policing and Traffic Shaping, where the former one (Policing) will drop the packet when the traffic rate beyond the CIR. 

 

Whereas, for the traffic shaping; router will try to store the packet in their buffer (like a fifo queue) when the traffic rate beyond the CIR. Router will then forward those buffered packets whenever the traffic rate is under the CIR.

 

When policing is adopted and under congestion, receiver side may receive #1st packet, but may not receive #2nd packet (dropped by Policing), so it may request TCP transmission, and the TCP window size may be reduced in half due to packet lost. Therefore, you would expect something like:

 

When shaping is adopted and under congestion, receiver side may receive #1st packet, #2nd packet may be delayed, but less likely be dropped, so there will less likely a TCP re-transmission (no reduce in TCP window size). Therefore, you would expect something like:

 

 

Clearly, traffic shaping will use more resource. You could configure the shaping buffer size as follow:

 

 

shape max-buffers [number-of-buffers]

You configure this command under a class in a policy map. However, the shape max-buffers command is not supported for HQF in Cisco IOS Release 12.4(20)T. Use the queue-limit command, which provides similar functionality.

 

 

 

Hope you have read the document from Cisco which talk about Traffic Policing and Traffic Sharping.

 

Ref: https://www.cisco.com/c/en/us/support/docs/quality-of-service-qos/qos-policing/19645-policevsshape.html

https://www.cisco.com/c/en/us/td/docs/ios/qos/command/reference/qos_book/qos_s1.html

Joseph W. Doherty
Hall of Fame
Hall of Fame
Generally, policing doesn't work with queues because its drops overrate traffic, not like shaping which queues overrate traffic. Since shaping queues overrate traffic, if the transmission rate the shaper is receiving is under its specified rate, and it has queued traffic, it will drain the queue at its maximum specified rate. Again, a policer will just drop overrate traffic, it doesn't queue it. A shaper will never transmit its (actually an average) rate faster than specified. If it receives overate traffic, the queue extends (until it fills, then it will also drop packets). If it receives underrate traffic, it will shrink its queue (if there is one).

A shaper's actual transmission rate isn't quite as smooth as the other poster shows, as transmission speed is always full physical line rate. What a shaper actual does is transmit, or not, during some time period, such that the transmitted data would not exceed the same volume as physical link of the specified bandwidth would provide.