Before I started my QOS studies I had always had a trouble distinguishing between policing and shaping. I generally knew what they were, but I didn’t know when to use them or how they worked. Lets give a brief definition of both and I’ll follow up with a configuration example of both in the next two posts.
Policing to me, was the easier of the two. The Cisco Press book used the analogy of a policeman enforcing the law. With Policing, you can ‘police’ the traffic to a certain rate. Basically you are setting a hard limit and saying if you go above this, the policer will take action. There are generally two things a policer can do with the traffic once it goes over the defined limit. The policer can drop the traffic or ‘mark down’ or retag the traffic with a lower priority. Policing can be done on egress or ingress traffic.
Shaping was the topic I always had a issue with. Shaping allows you to ‘shape’ the traffic to a particular speed. If too much traffic is arriving at an interface the traffic can be shaped to an allowed rate with excess traffic being queued. Shaping can only be used on egress traffic which makes sense.
Policing is pretty straight forward. If interface X goes over limit Y drop the traffic or mark it down. Shaping on the other hand, can be a lot more complicated especially when you start talking about the details.