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.
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)标记:Represents the permission to send a fixed number of bits from one network to another.
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.
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
• 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.
• Traffic policing can be used inbound or outbound on an interface, whereas traffic shaping can be used for outbound traffic only.
• 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.