Traffic shaping is an attempt to control computer network traffic in order to optimize or guarantee performance, low latency, and/or bandwidth. Traffic shaping deals with concepts of classification, queue disciplines, enforcing policies, congestion management, Quality of service (QoS), and fairness. Traffic shaping provides a mechanism to control the volume of traffic being sent into a network (bandwidth throttling), and the rate at which the traffic is being sent (rate limiting). For this reason, traffic shaping schemes need to be implemented at the network edges to control the traffic entering the network. It also may be necessary to identify traffic flows at the ingress point (the point at which traffic enters the network) with a granularity that allows the traffic-shaping control mechanism to separate traffic into individual flows and shape them differently. Two pre-dominate methods for shaping traffic exist: a leaky bucket implementation and a token bucket implementation. Both these schemes have distinctly different properties and are used for distinctly different purposes. In computer networking, traffic shaping works by debursting traffic flows, i.e. smoothing the peaks and troughs of data transmission. A before-and-after example of how traffic shaping works is as follows.
Benefits
When lots of traffic flows past a packet bottleneck (logical or physical) the benefits of traffic shaping are:
- Less jitter.
- Reduced packet loss.
- Lower latency.
- half-duplex — link collisions make delay variations (jitter), because the packets are delayed with each collision by the backoff-time.
- Port queue buffer IEEE 802.3x "flow"-control.
Technologies commonly using traffic shaping
Traffic shaping is often used in combination with:
- Differentiated services, Integrated services — including traffic classification and prioritization.
- Weighted round robin (WRR).
- Random early detection (RED), Weighted RED (WRED) and RED In/Out (RIO) — Lessens the possibility of port queue buffer tail drops and this lowers the likelihood of TCP global synchronization.
- A number of port queue buffers.
- VLAN IEEE 802.1p and IEEE 802.1D.




