Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

What is the difference between Traffic Policing and Traffic Shaping ?

user-image
Question added by Irfan Ahmed Khan , Senior Network Engineer , Oman Electricity and Transmission Company
Date Posted: 2017/02/23
Waqas Rana
by Waqas Rana , Senior Network Engineer CCIE R&S (#61878) , Saudi Aramco Total Refining And Petrochemical Company - Satorp

Traffic Shapping typically delays excess traffic using a buffer, or queueing mechanism, to hold packets and shape the flow when the data rate of the source is higher than expected Whereas the other hand, policer behaves in a much simpler manner. It achieves the same average traffic rate by dropping a packet that could exceed the policed rate

Getachew Aynalem
by Getachew Aynalem , Escalation Network Engineer , Verizon/ Terremark

Policing is a strict rule which drops traffic when a threshold reaches a limit while shaping is utilization of mechanisms like buffer and queuing to tame packet traffic for a successful passage.

Ramakant Gupta
by Ramakant Gupta , Principle infrastructure engineer , Mphasis Limited

The main difference between Traffic Shaping and Traffic Policy is that Traffic Shaping buffers the packets which exceed the traffic limits. When there are enough tokens in the Token Bucket, these buffered packets are sent out at a uniform rate.

Another difference is that Traffic Shaping may increase delay but Traffic Policy causes almost no extra delay

ANUP RAUT
by ANUP RAUT , SR customer service Executive , TATA Communications Ltd.

Shaping applicable fro both in & out traffic.

Salman Khan
by Salman Khan , IP/MPLS Senior Network Engineer , Mobily

Traffic Policing

Traffic policing is used to monitor the specifications of the traffic that enters a network and keep it within a reasonable range. Furthermore Traffic Policing optimizes network resources and protects the interests of carriers by restricting the traffic that exceeds the rate limit.

CAR

The Committed Access Rate (CAR) is applied to limit certain categories of traffic. For example, Hypertext Transfer Protocol (HTTP) packets can be kept from taking up more than% of the network bandwidth. Packets are first classified according to the pre-defined matching rules. Packets that comply with the specified rate limit are forwarded directly. Packets that exceed the specifications are dropped or have their priorities re-set.

Token Bucket

CAR uses token buckets (TBs) to implement traffic policing. The token bucket is like a container of tokens with a pre-defined capacity. The system puts tokens into the bucket at a defined rate. If the token bucket is full, no more tokens can be added.

The process is as follows:

1.     If there are enough tokens in the bucket, packets are forwarded. At the same time, the amount of tokens in the bucket decreases based on the length of the packets.

2.     If the token bucket does not hold enough tokens for sending packets, the packets are dropped or their priority values are re-set.

 

Traffic Policing Action

According to different evaluation results, TP implements the pre-configured policing actions, which are described as follows:

1    Pass: Forwards the packets evaluated as "compliant" or re-forwards the service marked Differentiated Services Code Point (DSCP) for DiffServ.

2    Discard: Drops the packets evaluated as "noncompliant "

3    Remark: Changes the precedence of the packet that is evaluated as "partly compliant" and then forwards it.

Traffic Shaping

Traffic shaping is an active way to adjust the traffic output rate. A typical application of Traffic Shaping is to control the volume and burst of outgoing traffic based on the network connection. Thus the packets can be transmitted at a uniform rate. Traffic Shaping is implemented by using the buffer and token bucket.

After classification, packets are processed as follows:

1       For packets not involved in Traffic shaping, the packets are forwarded directly.

2        For packets involved in traffic shaping, when no General Traffic Shaping (GTS) queue exists, the length of packets is compared with the number of tokens in the token bucket. If there are sufficient tokens to send packets, packets are sent; if there are insufficient tokens, the GTS queue is enabled where packets are cached. Tokens are placed in the token bucket at the user-defined rate. Packets in the GTS queue are removed and sent periodically. As packets are sent, the number of tokens reduces based on the number of packets. During the course of sending packets, the number of packets is compared with the number of tokens in the token bucket. The number of tokens in the token bucket stops decreasing when all the packets in the GTS queue are sent or can no longer be sent.

3        For packets involved in Traffic Shaping, packets enter the GTS queue to wait before being sent periodically, if the GTS queue is enabled.

·         If the GTS queue is full when new packets arrive at the queue, the packets are dropped.

 

 

The main difference between Traffic Shaping and Traffic Policy is that Traffic Shaping buffers the packets which exceed the traffic limits. When there are enough tokens in the Token Bucket, these buffered packets are sent out at a uniform rate.

Another difference is that Traffic Shaping may increase delay but Traffic Policy causes almost no extra delay.

More Questions Like This