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.
- Conforming Traffic: This is traffic that stays within the configured rate limit. Such traffic is transmitted immediately without any delay.
- 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 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:
- Dropping Packets: Excess traffic is discarded to ensure the network does not become overloaded.
- 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 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.

ā 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.