Compare the Difference Between Similar Terms

Difference Between Traffic Shaping and Policing

Traffic Shaping vs Policing
 

Traffic policing and traffic shaping are two similar approaches initiated to regulate the flow of traffic from one network to another. This is done in compliance to the traffic contract made between the networks. Traffic contract is an agreement made between two networks. It defines the kind of traffic to be transported and the performance requirements of that traffic, such as bandwidth and Quality of service. In traffic engineering, both traffic shaping and policing is widely used as a method of providing Quality of service, and are commonly applied at the edges of the network, but can also be applied at the traffic source.

What is Traffic Policing?

Traffic policing is the process of monitoring traffic in a network and taking steps to conform it to the agreed traffic parameters. It basically measures the flow of data and monitors each packet, and when a violation is found, it simply drops the packet. It marks each of the packets with a particular level of conformance (also called coloring). This continuous process helps to control the maximum rate of traffic sent or received on each interface in multiple priority levels. This is also known as classes of service.

Policing is done at many different levels in a network; it can be done at either port level or for Ethernet Service or a particular class of service. Traffic policing uses a special algorithm called “token bucket” algorithm for regulating the flow of traffic. It is a comprehensive mathematical model developed for controlling the maximum traffic rate allowed for an interface at a particular time. This has two basic components.

1) Tokens: Represents the permission to send a fixed number of bits from one network to another.

2) The bucket: Used to hold a specified amount of tokens at a time.

Operating system runs in the network put the Tokens into the bucket at a certain rate. Each packet come into the network takes tokens from the bucket accordingly to their packet size when it is prepared to be forwarded to another network. When the bucket is full, all the newly arriving tokens will be rejected. These rejected tokens are also not available for future packets. All the tokens are generated based on the peak transmission rate defined in the traffic agreement. The number of available tokens determines the number of packets selected for transmission over the packet data network.

There is several traffic policing mechanisms available for optimizing the policing such as traffic Single Rate Color Marker for Traffic Policing, Two-Rate Three-Color Marker for Traffic Policing, Percent-Based Policing, etc.

What is Traffic Shaping?

Traffic shaping is a technique used in traffic management for delaying some or all packets in order to confirm with a desired traffic data profile. Actually it is a form of rate limiting which works by monitoring and queuing IP packets in transition mode, in accordance with a number of parameters that are can be configured in advance. Thus, it allows implementing a specific policy that alters legacy way in which data is queued for transmission.

Basically, traffic shaping works according to two principles. The first one is that applying bandwidth limitations based on the configured traffic limits, and then by queuing the packets for sending them later when the bandwidth has a lower demand. The second principle is by dropping packets when the packet buffers are full. Here, the dropped packet is selected from those packets, which are responsible for creating a “jam”. Similarly, in traffic policing, shaping also prioritize traffic. In contrast, shaping prioritize traffic according to the administrator’s choice. When the traffic in a higher priority is increased by large amounts while a communications line is full, the lower prioritized traffic is temporarily limited for some time in order to give the chance for the high priority traffic.

This task is typically implemented by treating a certain amount of traffic (the guaranteed amount of traffic in traffic contract) as higher priority traffic, and the traffic that exceeds this limit which have the same priority as any other traffic, then competes with the rest of the traffic which is non-prioritized.

Generally, good traffic shapers do not let to queue up large amounts of data when determining the exact traffic to be sent based on prioritization of traffic. They rather first make an attempt to measure the amount of prioritized traffic and based on that they limit the non prioritized traffic dynamically. Thus, it won’t disturb the throughput of the prioritized traffic at all.

 Traffic Policing vs Shaping

• Both traffic policing and shaping use a token bucket mechanism for their operation.

• Traffic policing is used for controlling traffic on inbound or outbound on an interface, whereas traffic shaping can be used only for controlling outbound traffic.

• Both traffic policing and shaping use a token bucket mechanism for their operation.

• Traffic policing can be used inbound or outbound on an interface, whereas traffic shaping can be used for outbound traffic only.

• In both mechanisms, it is needed to measure the rate of data transmission and receive, and take action based on the agreed rate of traffic according to the traffic contract.

• In policing, it propagates traffic bursts whereas traffic shaping provides a smoothed packet output rate.

• Shaping supports queuing and provides sufficient memory to buffer the delayed packets whereas, policing does not.

• A special scheduling function is needed for traffic shaping for later transmission of any number of delayed packets, while policing does not.

• In shaping, token values are configured in bits per second whereas in policing configured in bytes.

• Queuing in traffic shaping causes delaying; particularly creates very long queues, whereas policing Controls the output packet rate by dropping packets. This avoids the delay caused by packet queuing.

• In traffic shaping, token values are configured as bits per second whereas in policing it is configured as bytes per second.