traffic shaping

Traffic shaping, also known as packet shaping, is a congestion management method that regulates network data transfer by delaying the flow of less important or less desired packets. It is used to optimize network performance by prioritizing certain traffic flows and ensuring the traffic rate doesn't exceed the bandwidth limit.

Regulating the flow of packets into a network is known as data transfer throttling. Regulation of the flow of packets out of a network is known as rate limiting.

In addition to bandwidth, three major factors affect the quality of a network: latency, jitter and loss.

Traffic shaping attempts to prevent delay, jitter and loss by controlling the burst size and using a leaky bucket algorithm to smooth the output rate over at least eight time intervals. If traffic is arriving at a rate lower than the configured rate, then it will be forwarded normally. If traffic arrives faster than the configured rate, then it will be delayed and held in a buffer until it can be sent without going over the limit.

What is traffic shaping used for?

Traffic shaping is a quality of service (QoS) technique that is configured on network interfaces to allow higher-priority traffic to flow at optimal levels even when the link becomes overutilized. By creating a bandwidth limit for less critical packets, traffic shaping lessens the possibility that more important packets will be delayed or dropped as they leave the interface.

Common uses of traffic shaping include:

  • Time-sensitive data may be given priority over traffic that can be delayed briefly, often with little-to-no ill effect.
  • In a corporate environment, business-related traffic may be given priority over other traffic.
  • A large internet service provider (ISP) may shape traffic based on customer priority.
  • An ISP may limit maximum bandwidth consumption for certain applications to reduce costs and create the capacity to take on additional subscribers. This practice can effectively limit a subscriber's "unlimited connection" and is often imposed without notification.
  • Traffic shaping is an integral component of the proposed two-tiered internet, in which certain customers or services receive traffic priority for a premium charge.

Importance of traffic shaping

Traffic shaping is important when network uplinks become overwhelmed with data being sent out of an interface. Without traffic shaping, any excess traffic that cannot be sent out of an interface will either be dropped or queued, which can cause delays in all packets. This can result in poor performance of mission-critical applications. The enablement of traffic shaping allows administrators to specify certain applications that are considered less important -- and, therefore, creates intelligence around which packets will be dropped or delayed first.

Overall, traffic shaping is one of the most important traffic management techniques for ensuring high network performance.

Traffic shaping methods

Shaping can only occur on packets that are leaving an interface as opposed to coming into the interface. The network device can use several different methods to identify the application that an IP packet exiting an interface belongs to. Based on this information, the interface can drop or hold these specific packets inside a temporary queue until a certain bandwidth limit has been reached. Shaping uses a leaky bucket algorithm to eventually release the delayed packets for delivery. While this may increase latency, it's usually more efficient compared to dropping the packets.

Traffic shaping methods include:

Generic traffic shaping (GTS). This method supports traffic shaping of most media and encapsulation data types on a router. GTS will:

  • perform traffic shaping on a per-interface basis and use access control lists (ACLs) to choose what traffic to shape;
  • dynamically adapt to the available bandwidth by integrating shapes and backward explicit congestion notifications (BECNs) at a defined rate; and
  • respond to resource reservation protocol (RSVP) features that are signaled over statically configured asynchronous transfer mode (ATM) permanent virtual circuits (PVCs).

Frame relay traffic shaping (FRTS). Similar to GTS, FRTS eliminates bottlenecks occurring in frame relay networks with high-speed connections at the central site and low speeds at the branch sites.

Class-based traffic shaping. This method allows users to configure traffic shaping on a per-traffic-class basis, meaning the shaping can be specified to one or more categories of data. Class-based shaping also enables users to optimize the available bandwidth by specifying an average or peak rate for shaping. This will allow more data than the configured rate to be sent if bandwidth is available. Finally, the class-based shaping method allows users to create a hierarchical policy map structure. This means traffic shaping can be placed in a primary policy map while other QoS features are placed in a secondary policy map.

Traffic shaping vs. traffic policing

Traffic shaping impacts packets leaving an interface. Packets determined to be less important are temporarily stored in a buffer queue and sent more slowly using a leaky bucket technique. Traffic policing, on the other hand, can be configured for both traffic exiting and entering an interface. Policing will simply drop packets as opposed to storing them in a temporary queue. Thus, policing is considered less efficient in most cases.

Traffic shaping and net neutrality

Traffic shaping is a frequent topic of debate between advocates of net neutrality and proponents of a two-tiered system. Advocates of net neutrality argue that internet data packets should be treated impartially, without regard to their content, destination or source, and that it is difficult to delay some types of traffic without unintentionally hampering others. On the other hand, proponents of a two-tiered system argue that there have always been different levels of internet service and that a two-tiered system would enable more freedom of choice and promote internet-based commerce.

This was last updated in February 2020

Continue Reading About traffic shaping

Dig Deeper on Network application performance