[Codel] Floating an Idea. ip_fq_codel

Dave Taht dave.taht at gmail.com
Fri Jun 20 13:04:18 EDT 2014


On Fri, Jun 20, 2014 at 2:35 AM, Richard Edmands <thesirdmz at gmail.com> wrote:
> With the tc filter flow hash keys i've been having problems verifying if
> they've been installed. I've searched the man pages and haven't found the
> solution. It "should" be tc filter show dev *insert dev*
> but that doesn't list them :(
> any ideas what i've missed.
>
>
>
> tc filter add dev eth0 protocol ip parent 1: handle 1 \
>         flow hash keys dst divisor 8192

modprobe cls_flow # or, insmod
tc qdisc add dev eth0 root handle 1 fq_codel flows 8182
tc filter add dev eth0 protocol ip parent 1:0 handle 1 prio 1 flow
hash keys dst divisor 8192

If you don't do this, you will get back errors from the kernel. tc is
quite unforgiving. the flows
parameter and the divisor need to be a power of two and match the
fq_codel flows parameter.

And you probably need to match more than just "ip" filters for a working config.

netperf -H 172.21.0.1 -l 60 & # run a couple times to fill up the queue -

root at nuc-client:~# tc -s class show dev eth0
class fq_codel 1:1962 parent 1:
 (dropped 0, overlimits 0 requeues 0)
 backlog 6056b 4p requeues 0
  deficit 0 count 1 lastcount 1 ldelay 3.5ms

tc -s filter show doesn't anything useful, but does show these filters
installed.

filter parent 1: protocol ip pref 1 flow
filter parent 1: protocol ip pref 1 flow handle 0x1 hash keys dst
divisor 8192 baseclass 1:1

Running netperf to 2 different destinations, I get, 2 queues in use.

root at nuc-client:~# tc -s class show dev eth0
class fq_codel 1:b7c parent 1:
 (dropped 0, overlimits 0 requeues 0)
 backlog 7570b 5p requeues 0
  deficit 1514 count 2 lastcount 1 ldelay 5.2ms
class fq_codel 1:1962 parent 1:
 (dropped 2, overlimits 0 requeues 0)
 backlog 6056b 4p requeues 0
  deficit 0 count 1 lastcount 1 ldelay 7.2ms


fiddling with wifi is harder as you have 4 hw queues. This appears to
be working correctly, but
I can seem to print any of the filter rules. (?) Something I had been
experimenting with as
a ¨good¨ value to improve aggregation behavior on an wifi access point was:

cat debloat_wifi_ap.sh

#!/bin/sh
IFACE=wlan0
QDISC=fq_codel
FLOWS=1024
TARGET="target 20ms interval 300ms" # wifi buffering and scheduling is a PITA

wifi() {
        tc qdisc add dev $IFACE handle 1 root mq
        tc qdisc add dev $IFACE parent 1:1 handle 10 $QDISC flows
$FLOWS noecn quantum 1514
        tc qdisc add dev $IFACE parent 1:2 handle 20 $QDISC flows
$FLOWS quantum 4542
        tc qdisc add dev $IFACE parent 1:3 handle 30 $QDISC flows
$FLOWS $TARGET quantum 4542
        tc qdisc add dev $IFACE parent 1:4 handle 40 $QDISC flows
$FLOWS $TARGET noecn quantum 4542

        tc filter add dev wlan0 protocol ip parent 10:0 handle 1 prio
1 flow hash keys dst divisor $FLOWS
        tc filter add dev wlan0 protocol ip parent 20:0 handle 1 prio
1 flow hash keys dst divisor $FLOWS
        tc filter add dev wlan0 protocol ip parent 30:0 handle 1 prio
1 flow hash keys dst divisor $FLOWS
        tc filter add dev wlan0 protocol ip parent 40:0 handle 1 prio
1 flow hash keys dst divisor $FLOWS

# pretty sure you need to do icmp, ipv6, arp, and other protocols like ESP.
}

wifi

# I need to get around to benchmarking this sort of stuff again. Or
someone does.

>
>
> On Sat, Jun 7, 2014 at 11:56 AM, Dan Siemon <dan at coverfire.com> wrote:
>>
>> On Tue, 2014-05-20 at 19:15 +1000, Richard Edmands wrote:
>> > In my environment we've got a fair chunk of torrent usage happening (+
>> > gaming) and with fq_codel giving the advantage to whichever individual
>> > could open up as many connections as possible the entire situation
>> > imploded very quickly.
>> >
>> > So to balance this out I used htb to implement the IP part of this
>> > (actually not really, i made groups of ip's which belonged to
>> > individuals) and stuck fq_codel on top of the divided setup.
>> >
>> > With this system what now happens is each IP now gets equal
>> > utilization of the link (actually, i'm a lazy hack. I only implemented
>> > the uplink section) which prevents the advantage of opening up as many
>> > connections as possible.
>> > Now when an individual decides to go nuts, they're limited to what is
>> > available to them without harming everyone else, without compromising
>> > maximum possible speed.
>> >
>> >
>> > I have had this running in my environment for the past month and WOW.
>>
>> I did something similar as well. You can find the script and results
>> below. Let me know if you find any bugs.
>>
>>
>> http://git.coverfire.com/?p=linux-qos-scripts.git;a=blob;f=src-3tos.sh;hb=HEAD
>>
>>
>> http://www.coverfire.com/archives/2013/01/01/improving-my-home-internet-performance/
>>
>
>
> _______________________________________________
> Codel mailing list
> Codel at lists.bufferbloat.net
> https://lists.bufferbloat.net/listinfo/codel
>



-- 
Dave Täht

NSFW: https://w2.eff.org/Censorship/Internet_censorship_bills/russell_0296_indecent.article



More information about the Codel mailing list