Shaping and Policing

1. What is Shaping?

šŸ” Shaping is a traffic rate-limiting technique that buffers traffic exceeding a configured rate limit, rather than dropping it.

You might wonder, what is a configured rate limit? Good question! A configured rate limit is the maximum amount of traffic, in terms of bandwidth, that a network device is allowed to send or receive over an interface.

This limit is often determined by an agreement, such as the one between a customer and their service provider. For instance, if you’ve agreed with your service provider to send traffic at a maximum of 400 Mbps, this becomes your configured rate limit.

Now, shaping ensures that traffic exceeding this limit isn’t simply discarded. Instead, it’s temporarily held in a buffer and sent later at a rate that conforms to the configured limit. This approach prevents packet loss while keeping your traffic within the agreed limits.

šŸ” How Shaping Works

To understand shaping, you need to focus on two key concepts: conforming traffic and exceeding traffic.

  1. Conforming Traffic: This is traffic that stays within the configured rate limit. Such traffic is transmitted immediately without any delay.
  2. Exceeding Traffic: Traffic that goes beyond the configured rate limit is queued in a shaping buffer. Instead of being dropped, it waits in the buffer and is transmitted at the configured rate when bandwidth becomes available.

Here’s a simple illustration of shaping in action:

Shaping Quality of Service

Shaping is often used to smooth traffic bursts. This ensures that your traffic flow conforms to the rate agreed upon with your service provider while minimizing packet loss and maintaining a steady flow of data.

2. What is Policing?

šŸ” Policing is a traffic rate-limiting technique that takes immediate action when the traffic exceeds the configured rate limit. Unlike shaping, which buffers the excess traffic, policing either drops the packets or re-marks them with a lower priority.

Here’s how it works when the rate limit is exceeded:

  1. Dropping Packets: Excess traffic is discarded to ensure the network does not become overloaded.
  2. Re-Marking Packets: Instead of dropping them, excess packets can be re-marked with a lower priority. This means they may still be transmitted but are now treated as less important compared to conforming traffic.

šŸ” How Policing Works

  • Traffic that stays within the rate limit is considered conforming and is forwarded as usual.
  • Traffic that exceeds the rate limit is either dropped or re-marked immediately, with no buffering.

Here’s a visual example showing how policing handles excess traffic by dropping packets that surpass the agreed rate:

Policing Quality of Service

Policing is commonly used to enforce strict bandwidth limits and ensure compliance with network policies, especially in service provider environments where traffic needs to stay within agreed limits. It’s a more rigid approach compared to shaping, as it doesn’t provide the flexibility to buffer traffic bursts.

3. Real-World Example

šŸ” Now that you understand the basics of shaping and policing, let’s focus on a real-world scenario to see how these techniques are applied in practice.

Imagine this: you’ve set up a network and need to connect to a service provider to access the internet. As part of your agreement with the ISP, you decide on a 400 Mbps bandwidth limit. This means the ISP expects your traffic to remain within this agreed rate. But how can you ensure that your network doesn’t exceed this limit, and what happens if it does?

This is where shaping and policing come into play. Let’s see how they are used in this specific scenario.

šŸ› ļø LAN to WAN Interconnection

Let’s consider the following situation:

  • A customer has an agreement with an ISP to send traffic at a maximum rate of 400 Mbps.
  • The customer’s router connects to the ISP using a Gigabit Ethernet interface, which can send traffic at up to 1 Gbps.

āš ļø Without proper traffic management, the customer’s router could potentially send more traffic than the agreed 400 Mbps. If this happens, the ISP will need to take action by dropping excess traffic, leading to packet loss and degraded network performance.

šŸ” Role of Shaping and Policing

To manage this, both shaping and policing are applied, each serving a specific purpose:

āœ… Customer Router (Shaping)

The customer’s router applies shaping to ensure traffic sent to the ISP does not exceed 400 Mbps.

šŸ”¹ Traffic exceeding the rate limit is queued in a buffer and transmitted later at the agreed rate.

šŸ”¹ This prevents excess traffic from being sent to the ISP and ensures compliance with the agreed bandwidth.

Shaping and Policing Quality of Service

āœ… ISP Router (Policing)

On the ISP’s side, policing is applied to enforce the 400 Mbps limit.

šŸ”¹ If traffic exceeds this rate, the ISP takes immediate action: – Drops the excess traffic to maintain network stability. – Or re-marks the traffic with a lower priority to de-prioritize it for delivery.

4. Conclusion

In this course, we explored two essential traffic rate-limiting techniques: shaping and policing.

āœ… Shaping: This technique is used to respect the configured rate limit by queuing excess packets instead of dropping them. It helps smooth traffic bursts and ensures compliance with agreed bandwidth limits.

āœ… Policing: This method enforces the rate limit by taking immediate action when traffic exceeds the limit, either by dropping the excess packets or re-marking them with a lower priority.

šŸ“¢ Next Steps: Now, let’s move on to Congestion Avoidance, where we’ll explore techniques to ensure smoother traffic flows and prevent network congestion.