Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Hagen Paul Pfeifer <hagen@jauu.net>
Cc: netdev@vger.kernel.org, Stephen Hemminger <shemminger@vyatta.com>
Subject: Re: [PATCH net-next 1/2] netem: rate-latency extension
Date: Thu, 24 Nov 2011 23:14:58 +0100	[thread overview]
Message-ID: <1322172898.2872.7.camel@edumazet-laptop> (raw)
In-Reply-To: <1322156378-23257-1-git-send-email-hagen@jauu.net>

Le jeudi 24 novembre 2011 à 18:39 +0100, Hagen Paul Pfeifer a écrit :
> Currently netem is not in the ability to emulate channel bandwidth. Only static
> delay (and optional random jitter) can be configured.
> 
> To emulate the channel rate the token bucket filter (sch_tbf) can be used.  But
> TBF has some major emulation flaws. The buffer (token bucket depth/rate) cannot
> be 0. Also the idea behind TBF is that the credit (token in buckets) fills if
> no packet is transmitted. So that there is always a "positive" credit for new
> packets. In real life this behavior contradicts the law of nature where
> nothing can travel faster as speed of light. E.g.: on an emulated 1000 byte/s
> link a small IPv4/TCP SYN packet with ~50 byte require ~0.05 seconds - not 0
> seconds.
> 
> Netem is an excellent place to implement a rate limiting feature: static
> delay is already implemented, tfifo already has time information and the
> user can skip TBF configuration completely.
> 
> This patch implement rate latency feature which can be configured via
> tc. e.g:
> 
> 	tc qdisc add dev eth0 root netem ratelatency 10kbit
> 
> To emulate a link of 5000byte/s and add an additional static delay of 10ms:
> 
> 	tc qdisc add dev eth0 root netem delay 10ms ratelatency 5KBps
> 
> Note: similar to TBF the rate-latency extension is bounded to the kernel timing
> system. Depending on the architecture timer granularity, higher rates (e.g.
> 10mbit/s and higher) tend to transmission bursts. Also note: further queues
> living in network adaptors; see ethtool(8).
> 
> Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>
> ---
>  include/linux/pkt_sched.h |    5 +++++
>  net/sched/sch_netem.c     |   40 ++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 45 insertions(+), 0 deletions(-)

I like this patch, this is a useful extension.

Only point is why you chose ratelatency instead of rate ?

We want to emulate a real link, and yes, a 1000 bytes packet must be
delayed _before_ we deliver it to the device, but its a detail of how
works netem.

The usual word we use to describe a 1Mbps link is "1Mbps rate" ;)

  parent reply	other threads:[~2011-11-24 22:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-24 17:39 [PATCH net-next 1/2] netem: rate-latency extension Hagen Paul Pfeifer
2011-11-24 17:39 ` [PATCH net-next 2/2] netem: add cell concept to simulate special MAC behavior Hagen Paul Pfeifer
2011-11-24 22:14 ` Eric Dumazet [this message]
2011-11-24 22:31   ` [PATCH net-next 1/2] netem: rate-latency extension Hagen Paul Pfeifer
2011-11-25  1:06     ` Bill Fink
2011-11-25  1:23       ` Hagen Paul Pfeifer
2011-11-25  5:09   ` Stephen Hemminger
2011-11-25  6:13     ` Eric Dumazet
2011-11-25 12:02       ` Hagen Paul Pfeifer
2011-11-25  2:22 ` [PATCH v2 net-next 1/2] netem: rate extension Hagen Paul Pfeifer
2011-11-25  2:22   ` [PATCH v2 net-next 2/2] netem: add cell concept to simulate special MAC behavior Hagen Paul Pfeifer
2011-11-28 23:01     ` Eric Dumazet
2011-11-28 23:30       ` Hagen Paul Pfeifer
2011-11-28 23:48         ` Eric Dumazet
2011-11-29  0:07           ` Hagen Paul Pfeifer
2011-11-26 11:00   ` [PATCH v2 net-next 1/2] netem: rate extension Eric Dumazet
2011-11-25  2:23 ` [PATCH v2 iproute2 1/2] utils: add s32 parser Hagen Paul Pfeifer
2011-11-25  2:23   ` [PATCH v2 iproute2 2/2] tc: netem rate shaping and cell extension Hagen Paul Pfeifer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1322172898.2872.7.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=hagen@jauu.net \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@vyatta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox