Cloud concept · Updated

Traffic Shaping - Traffic shaping regulates the rate and timing of packet transmission by buffering traffic and scheduling its release to match a defined bandwidth policy.

In short

Traffic shaping smooths bursts and controls how applications share constrained network capacity. It helps protect latency-sensitive traffic and avoid downstream congestion, but introduces queueing delay and requires careful measurement to distinguish shaping problems from packet loss, policing, or infrastructure limits.

Cloud Concepts Hub →

6 key aspects of Traffic Shaping

Effective traffic shaping combines rate and burst policies, deliberate queue management, appropriate placement, and packet-level validation.

01
Rate and burst control

A shaper defines a sustained transmission rate and an allowance for short bursts. Size the burst allowance for the downstream path rather than assuming that an acceptable average rate prevents congestion.

02
Buffering and queueing delay

Excess traffic waits in a queue instead of being immediately discarded. Larger queues absorb longer bursts but can increase latency substantially, and finite queues still drop packets under sustained overload.

03
Traffic classification and scheduling

Policies can classify traffic by attributes such as addresses, ports, or packet markings and schedule classes differently. Validate that priority traffic benefits without starving lower-priority workloads.

04
Placement at the bottleneck

Shaping is most effective when it controls traffic before a constrained link or downstream policer. A policy on one sender cannot control aggregate traffic from other senders sharing the same bottleneck.

05
Packet-level diagnosis

Analyze packet spacing, loss, retransmissions, and latency alongside queue counters to identify shaping-related problems. Account for capture location and capture loss before attributing an observed gap to the production network.

06
Separation from policing and capacity limits

Shaping schedules transmission, while policing generally drops or remarks excess traffic. Cloud bandwidth limits and packet-per-second limits must also be checked because a guest operating system policy cannot override provider-enforced limits.

Cloud services for Traffic Shaping

Amazon EC2 provides a controllable location for operating system or appliance-based shaping, while VPC Traffic Mirroring supplies packet copies for investigating supported interfaces. A monitoring appliance can analyze those copies for timing and transport behavior. CloudWatch adds historical context through network metrics and custom queue or application measurements. Together, these services support a configure, observe, and validate workflow: apply a policy, test realistic traffic, compare packet evidence with counters, and adjust rate, burst, or queue settings. Mirroring and monitoring diagnose the policy; they do not enforce it.

Amazon EC2Amazon EC2

EC2 instances can implement traffic shaping through guest operating system controls such as Linux traffic control or through virtual network appliances. Guest-level policies remain subject to the instance's network bandwidth and packet-processing limits.

Amazon CloudWatchAmazon CloudWatch

CloudWatch provides network metrics and can collect custom operating system or appliance metrics to correlate throughput, queue drops, and application latency. Aggregate metrics support diagnosis but do not replace packet captures for analyzing packet spacing or TCP behavior.

Traffic Shaping exam questions

Real practice exam questions on Traffic Shaping, with the correct answer and its explanation. Answer them with every option in the exam simulator.

SAA-C03

A company sends backups from an Amazon EC2 instance to its data center over an existing hybrid network connection with 200 Mbps of usable capacity. Latency-sensitive application traffic shares the connection and peaks at 50 Mbps. Backup traffic averages 80 Mbps but briefly bursts above the connection's capacity, causing packet loss and application latency spikes. Backups can tolerate additional transfer time.

Testing confirms that limiting backup transmissions to 120 Mbps with a small burst allowance leaves sufficient capacity for application traffic and protocol overhead. The EC2 instance has enough buffer capacity to absorb the measured backup bursts. The company wants to avoid upgrading the connection and minimize congestion-related retransmissions.

Which solution meets these requirements?

Show answerCORRECT ANSWER

Configure an outbound traffic-control queue on the backup EC2 instance that buffers backup packets and releases them at 120 Mbps with a small burst allowance.

Sender-side traffic shaping delays excess backup packets before they enter the constrained connection. The validated rate and burst allowance preserve capacity for application traffic, while buffering the measured bursts avoids intentional packet drops and unnecessary retransmissions without requiring a connection upgrade.

ANS-C01

A company sends bulk data from Amazon EC2 instances through a Linux network appliance in a VPC. The appliance shapes traffic before forwarding it onto a constrained hybrid connection. After a configuration change, long-lived TCP transfers show periodic throughput reductions even though no packet loss is detected.

A network engineer uses VPC Traffic Mirroring to capture traffic on both sides of the appliance and correlates the captures with sender TCP telemetry. The engineer observes the following:

• Explicit Congestion Notification (ECN) was negotiated during connection establishment.
• As the appliance's shaping queue grows, forwarded data packets have the Congestion Experienced (CE) codepoint set in their inner IP headers.
• The receiver subsequently sends ACKs with ECN-Echo (ECE) set, and the sender responds with Congestion Window Reduced (CWR).
• The sender's congestion window decreases after this exchange. The receiver's advertised window remains large, and the sending application continuously has data available.

Which explanation BEST accounts for the throughput reductions?

Show answerCORRECT ANSWER

The sender is responding to congestion signaled by the appliance's queue, reducing its sending allowance without requiring packet drops.

With ECN negotiated, a congested queue can mark packets CE instead of dropping them. The receiver echoes that signal with ECE, and the sender reduces its congestion window and signals its response with CWR. This explains the throughput reductions despite the absence of packet loss.

Practice Traffic Shaping in a full exam

Questions on Traffic Shaping in each practice exam, with every answer option and an explanation for each:

Start a free practice exam

What is Traffic Shaping

3 min read

Traffic shaping controls when packets leave a network interface or queue. Instead of transmitting every packet immediately, a shaper buffers packets and releases them according to a configured rate and burst allowance. This makes traffic more predictable when a fast sender feeds a slower connection, such as a cloud workload transferring backups across a constrained hybrid link.

A common implementation uses a token bucket. Tokens accumulate at a configured rate, and transmitting packets consumes tokens. The bucket capacity determines how much traffic can burst above the sustained rate. When insufficient tokens are available, a shaper delays packets until transmission is permitted. Buffers are finite, however, so sustained overload can eventually cause drops. A large burst allowance can overwhelm a downstream bottleneck, while an unnecessarily small allowance can impair throughput.

In cloud environments, engineers can implement shaping in operating systems, virtual routers, or network appliances they control. For example, Linux traffic control on an Amazon EC2 instance can limit backup traffic before it enters a shared network path. Classification and scheduling can give interactive traffic preferential access while keeping bulk transfers within a defined budget. These controls apply only where configured; they do not create an end-to-end bandwidth guarantee across a provider network.

Consider a cloud sender using a 1 Gbit/s hybrid connection that also carries business applications. An engineer might initially cap backup traffic at 700 Mbit/s, then validate whether the remaining capacity is sufficient for application bursts and protocol overhead. The correct setting depends on the actual bottleneck, other senders, packet sizes, and the units used by the shaping implementation. Increasing the queue size may reduce immediate drops but can also create bufferbloat, where interactive requests wait behind bulk traffic.

Troubleshooting requires packet-level evidence alongside counters and application measurements. Capture traffic before and after the suspected shaping point when possible, using synchronized clocks for comparisons across hosts. Examine packet spacing, short-interval throughput, round-trip time, retransmissions, duplicate acknowledgments, and advertised TCP receive windows. A stable departure rate with increasing delay can indicate queueing, whereas repeated loss near a rate boundary can suggest policing or buffer exhaustion. Neither pattern alone proves the cause; receiver limitations, congestion control, and CPU saturation can produce similar symptoms.

Amazon VPC Traffic Mirroring can copy traffic from supported network interfaces to a packet-analysis appliance. It supports investigation but does not shape production traffic. Its observation point matters: a mirrored capture does not necessarily show what happened at a downstream queue. Mirror-path congestion, capture-system overload, filtering, and packet truncation can also limit the evidence. A packet missing from a mirrored capture is not, by itself, proof that the production path dropped it.

Distinguish shaping from policing: shaping normally delays excess traffic, while policing typically drops or remarks traffic that exceeds a policy. Also distinguish both from routing, load balancing, and firewall filtering. Aggregate flow records can identify large conversations, but they cannot reveal individual packet timing or TCP sequence behavior. Correlate packet captures with queue statistics, interface counters, instance bandwidth limits, and application latency before changing a shaping policy.

Learn Traffic Shaping in lessons

2 short lessons on Traffic Shaping in 1 certification course.

Open the lessons