public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Yang Yingliang <yangyingliang@huawei.com>
Cc: Eric Dumazet <edumazet@google.com>,
	netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>
Subject: Re: net_sched: precision problem of TBF/HTB
Date: Mon, 15 Jul 2013 21:50:01 -0700	[thread overview]
Message-ID: <1373950201.10804.103.camel@edumazet-glaptop> (raw)
In-Reply-To: <51E4C815.9000408@huawei.com>

On Tue, 2013-07-16 at 12:12 +0800, Yang Yingliang wrote:
> Hi, Eric
> Commit 1def9238d4aa2 (net_sched: more precise pkt_len computation)
> makes more precise transfer bytes by taking account of headers in
> qdisc_skb_cb(skb)->pkt_len, but this introduces a problem with
> calculating bandwidth in userland.
> 
This changed nothing to userland.

> When calculating bandwidth in userland, it's not include headers'
> bytes. From the user's perspective, it's not a correct bandwidth.
> 


> Shall we need take account of headers in qdisc_skb_cb(skb)->pkt_len or
> just skb->len?
> 
These values are not accessible from userland, unless you capture
packets with a sniffer (tcpdump or something like that)

> Example:
> tc qdisc add dev $DEV root handle 1: tbf latency 50ms burst 500kB rate
> 500mbit mtu 64k
> 
> iperf -c host -t 30 -i 10
> [ ID] Interval       Transfer     Bandwidth
> [  3]  0.0-10.0 sec   571 MBytes   479 Mbits/sec
> [  3] 10.0-20.0 sec   570 MBytes   478 Mbits/sec
> [  3] 20.0-30.0 sec   570 MBytes   478 Mbits/sec
> [  3]  0.0-30.0 sec  1.67 GBytes   478 Mbits/sec


iperf only measures the amount of payload, and probably do not care of
headers.

You cannot accurately measure bandwidth from userland, unless making
assumptions (or getting them from the stack) on header sizes (IP + TCP),
MSS value, and retransmits.

  reply	other threads:[~2013-07-16  4:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-16  4:12 net_sched: precision problem of TBF/HTB Yang Yingliang
2013-07-16  4:50 ` Eric Dumazet [this message]
2013-07-17  1:41   ` Ding Tianhong
2013-07-17  3:18     ` John Fastabend

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=1373950201.10804.103.camel@edumazet-glaptop \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=yangyingliang@huawei.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