[Netem] How to shape traffic while maintaining a constant RTT?

Stephen Hemminger shemminger at linux-foundation.org
Wed Oct 13 08:17:51 PDT 2010

On Wed, 13 Oct 2010 16:21:39 +0200
Dominik Kaspar <dokaspar.ietf at gmail.com> wrote:

> Hello,
> My goal is to emulate a link with a given bandwidth AND latency. At
> the moment I combine tc-htb and netem for this purpose and it
> basically it works all fine. Using "iperf", I can easily verify the
> specified bandwidth and "ping" shows precisely the latency I set with
> netem.
> The problem is, however, that the bandwidth and latency settings do
> not hold at the same time. When a TCP flow is running, it tries to
> occupy the whole bandwidth and the traffic shaping queue gradually
> fills up to its limit. As a consequence, the observed
> application-layer latency grows to levels that are completely
> different than what was specified with netem. The RTT can easily grow
> up to several seconds, depending on the size of the queue. On the
> other hand, reducing the queue size causes more frequent packet drops
> and lowers the TCP throughput below the desired capacity.
> It appears to be simply impossible to shape traffic to a given rate
> while maintaining a constant RTT. How is this dilemma/tradeoff solved?
> Does anyone know about references that target this problem?
> Best regards,
> Dominik Kaspar
> _______________________________________________
> Netem mailing list
> Netem at lists.linux-foundation.org
> https://lists.linux-foundation.org/mailman/listinfo/netem

You could try using traffic limiting (also known as policing)
rather than shaping. This would cause all traffic over the limit
to be dropped.


More information about the Netem mailing list