8.3 Traffic Shaping and Policing Explained
Key Concepts
Traffic Shaping and Policing are techniques used to manage and control network traffic to ensure efficient and fair use of bandwidth. Key concepts include:
- Traffic Shaping: Smoothing out traffic flow by delaying packets to meet a specified rate.
- Policing: Enforcing a traffic rate by dropping packets that exceed a specified limit.
- Token Bucket Algorithm: A method used by both shaping and policing to manage traffic rates.
- Burst Size: The maximum amount of traffic that can be sent or received in a short period.
- CIR (Committed Information Rate): The guaranteed rate at which traffic is allowed to flow.
Traffic Shaping
Traffic Shaping is a technique used to smooth out traffic flow by delaying packets to meet a specified rate. This ensures that traffic does not exceed the agreed-upon rate, preventing congestion and ensuring fair use of bandwidth.
Example: In a corporate network, a department might have a guaranteed bandwidth of 10 Mbps. Traffic Shaping ensures that even if the department's traffic spikes, it does not exceed this 10 Mbps limit, preventing congestion for other departments.
Policing
Policing is a technique used to enforce a traffic rate by dropping packets that exceed a specified limit. Unlike Traffic Shaping, which delays packets, Policing immediately drops excess packets, ensuring that the traffic rate remains within the agreed-upon limits.
Example: In a service provider network, a customer might have a contracted bandwidth of 5 Mbps. Policing ensures that if the customer's traffic exceeds this 5 Mbps limit, the excess traffic is immediately dropped, maintaining the agreed-upon service level.
Token Bucket Algorithm
The Token Bucket Algorithm is a method used by both Traffic Shaping and Policing to manage traffic rates. It involves a bucket that fills with tokens at a specified rate. Each packet consumes tokens, and if there are enough tokens, the packet is sent or received. If not, the packet is delayed (in shaping) or dropped (in policing).
Example: Imagine a bucket filling with tokens at a rate of 1 token per second. Each packet requires 1 token to be sent. If the bucket has 10 tokens, it can send 10 packets immediately. If the bucket is empty, packets must wait until tokens are available (shaping) or are dropped (policing).
Burst Size
Burst Size is the maximum amount of traffic that can be sent or received in a short period. It allows for temporary spikes in traffic without triggering shaping or policing mechanisms, ensuring that short bursts of traffic are accommodated.
Example: In a network with a CIR of 1 Mbps and a Burst Size of 2 Mbps, the network can handle short bursts of up to 2 Mbps without triggering any shaping or policing actions. This ensures that occasional high traffic volumes are accommodated without disruption.
CIR (Committed Information Rate)
The Committed Information Rate (CIR) is the guaranteed rate at which traffic is allowed to flow. It is the baseline rate that Traffic Shaping and Policing aim to maintain, ensuring that traffic does not exceed this rate.
Example: In a leased line connection, the CIR might be set at 10 Mbps. Traffic Shaping ensures that the traffic does not exceed this 10 Mbps rate, while Policing drops any traffic that exceeds this limit, maintaining the agreed-upon service level.