General list for discussing Bufferbloat
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: xnor <xnoreq@gmail.com>
Cc: bloat@lists.bufferbloat.net
Subject: Re: [Bloat] Inaccurate rates with HTB/HFSC+fq_codel on router due to VLAN?
Date: Fri, 17 Mar 2017 14:15:03 -0700	[thread overview]
Message-ID: <1489785303.28631.318.camel@edumazet-glaptop3.roam.corp.google.com> (raw)
In-Reply-To: <em3ad8e362-c6bf-46a9-a149-0e160d15aec9@gaming>

On Thu, 2017-03-16 at 22:14 +0000, xnor wrote:
> Hello,
> 
> I have a tl-wdr3600 router with openwrt (linux 3.18, config at [1]) and 
> want to shape ingress traffic.
> 
> The WAN port, interface eth0.2, is connected to a cable modem.
> I use the following script:
> 
> tc qdisc add dev eth0.2 handle ffff: ingress
> ifconfig ifb0 up txqueuelen 1000
> tc qdisc add dev ifb0 root        handle 1: htb default 10
> tc class add dev ifb0 parent 1: classid 1:1 htb rate 18000kbit
> tc class add dev ifb0 parent 1:1 classid 1:10 htb rate 18000kbit ceil 
> 18000kbit
> tc filter add dev eth0.2 parent ffff: protocol all prio 1 u32 match u32 
> 0 0 action mirred egress redirect dev ifb0
> tc qdisc add dev ifb0 parent 1:10 handle 100: fq_codel limit 1000 
> quantum 1514 noecn
> 
> Now the problem is that it is very inaccurate, and this inaccuracy 
> increases with number of TCP download connections.
> With HTB (it's worse with HFSC) and 20 connections (rates calculated 
> with /sys/class/net/eth0.2/statistics/rx_bytes over 5 seconds each):
> 19012.610 kbit
> 19266.877 kbit
> 19303.923 kbit

Sure, but you shape on ifb0, so the rate you observe on the ingress
interface is before any rate limit...

This could be 77.77 Mbit, and the tc scripts have no say about that.


> 
> With a single connection and HTB, I only get about 17.2 Mbit. Curiously, 
> /sys/class/net/ifb0/statistics show about 18.1 +/- 0.1 Mbit
> 
> So I did a tcpdump of eth0.2 and ifb0:
> eth0.2's largest frames are 1514 bytes ethernet type IP.
> ifb0's are 1518 bytes (including the VLAN tag I guess) with some unknown 
> type.
> 
> 
> What do I need to change to make shaping with ifb accurate? Ideally with 
> both HTB and HFSC.
> 

Have you checked your syslog ?

It seems you would need 'quantum 8000' or something like that.

tc class add dev ifb0 parent 1: classid 1:1 htb rate 18000kbit \
     quantum 8000
tc class add dev ifb0 parent 1:1 classid 1:10 htb rate 18000kbit \
     ceil 18000kbit quantum 8000




  parent reply	other threads:[~2017-03-17 21:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-16 22:14 xnor
     [not found] ` <57A046A6-C0F2-4209-93E5-CA728F4C64EE@gmx.de>
2017-03-17 19:15   ` xnor
2017-03-17 19:22     ` Jonathan Morton
2017-03-17 20:11     ` Sebastian Moeller
2017-03-17 21:15 ` Eric Dumazet [this message]
2017-03-18 15:34   ` xnor
2017-03-18 15:46     ` Jonathan Morton
2017-03-24 18:18       ` xnor
2017-03-25  0:10         ` Jonathan Morton

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

  List information: https://lists.bufferbloat.net/postorius/lists/bloat.lists.bufferbloat.net/

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

  git send-email \
    --in-reply-to=1489785303.28631.318.camel@edumazet-glaptop3.roam.corp.google.com \
    --to=eric.dumazet@gmail.com \
    --cc=bloat@lists.bufferbloat.net \
    --cc=xnoreq@gmail.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