htb use pfifo as leaf qdisc has a burst speed which is double of limit rate

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, lartc gurus

I have a home router, and want to use HTB to limit the upload speed of a user.
I connect my phone to router via wifi, got an ip 192.168.10.28 via DHCP
I limit the upload speed to 500KB/s, here is my config

    # tc qdisc show dev eth0.4
    qdisc htb 1: root refcnt 2 r2q 10 default 0 direct_packets_stat 18 direct_qlen 1000
    qdisc pfifo 11d: parent 1:1d limit 1000p

    # tc class show dev eth0.4
    class htb 1:1d root leaf 11d: prio rate 4Mbit ceil 4Mbit burst 4800b cburst 4800b

    # tc filter show dev eth0.4
    filter parent 1: protocol ip pref 1 flow
    filter parent 1: protocol ip pref 1 flow handle 0x1 map keys nfct-src and 0x000000ff baseclass 1:1

I test upload speed of phone using app, e.g. speedtest5g, or other similar app, the result double the limit.
if I change the leaf qdisc to fq_codel, then the limit is quite accurate.

    # tc qdisc del dev eth0.4 handle 11d: parent 1:1d pfifo
    # tc qdisc add dev eth0.4 handle 11d: parent 1:1d fq_codel

after read lots of documents and source code, I guess the reason:

    qdisc has no traffic shaping when enqueue. so when the queue is empty,
    packets can enqueue without limit, so there's a burst speed,  while speed test app often use the max speed as result.
    if i change the leaf pfifo limit from 1000p to 200p, then the test result is more closing to rate limit, but still bigger than it.

But why fq_codel is accurate?
#/******本邮件及其附件含有小米公司的保密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本邮件! This e-mail and its attachments contain confidential information from XIAOMI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it!******/#




[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux