So where would you use polices and where would you use shapers?
Polices are generally used as ingress tools.
In other words, the traffic is dropped before it's processed so that you don't waste a valuable resources.
If a packet is going to be dropped anyway, you might as well drop it on the ingress or incoming interface
of a router so that you don't waste valuable bandwidth and CPU cycles to move it from one interface
to another, do a writing lookup and so forth, and then drop the packet.
Polices can be used on egress to control the amount of traffic sent out of an interface, but are generally
used to enforce a traffic policy on ingress.
As an example, your service provider may have an ingress police to ensure that you don't send too much
traffic.
As an example, you could have paid for 100 megabits per second internet link, but the physical interface
that connects you to your service provider could be gigabit Ethernet.
So to ensure that you don't transmit more than a hundred megabits per second, the service provider
on the ingress interface on the ISP side will implement a police to drop traffic that exceeds 100 megabits
per second when traffic is exceeded.
The police can either drop the traffic or remark the traffic.
The disadvantage of a police is its dropping traffic which results in TCP resents.
TCP is designed to retransmit traffic that's been dropped.
So when a police is dropping a lot of traffic, it causes a lot of TCP transmissions or rescinds polices.
Don't introduce jitter or delay because they simply drop the packet.
They don't delay it with shapers introduce delay and jitter by slowing down packets or buffering them
for a period of time before transmitting them.
Shapers are a lot gentler than polices, so generally they are deployed between an enterprise customer
and the service provider to ensure that you don't exceed the contracted rate.
Again, using the example of a customer connected to a service provider via a gigabit interface, the
customer will slow itself down under the 100 megabits per second threshold to ensure that it doesn't
send traffic to the service provider who will simply drop.
The traffic shapers result in fewer TCP transmissions because they're not dropping the traffic, they
are delaying it or slowing the traffic down.
So in summary, policing drops or remarks.
It doesn't buffer, it causes TCP transmissions, it doesn't introduce data and delay.
Shippers don't drop traffic.
They delay the traffic.
But that can result in additional delay or jitter.
Shaping is a lot gentler on traffic.
Policing is very harsh.
Causes transmissions.