Reply
Regular Member
Posts: 577
Registered: ‎09-10-2012
Kudos: 374
Solutions: 35

fq_codel wizard *DEPRECATED*

[ Edited ]

Hi,

 

***UPDATE***: As of 1.7.0alpha3, fq_codel is available via the EdgeRouter's config, with a GUI as of 1.7.0beta1. This is now the preferred method for using fq_codel. It is not recommended to use this wizard with 1.7.0alpha3 or newer versions. Use traffic-control smart-queue in CLI or the smart-queue feature in the GUI instead.

 

This wizard can be used to apply fq_codel traffic control on any interface of your EdgeRouter.

 

Warning/Disclaimer: This wizard isn't officially supported by UBNT. I take no repsonsibility for any damage done by this software.

 

All this wizard needs is to know is:

- Which interface(s) do you want to run fq_codel on?
- What are those interfaces upload and download speeds?

 

There are a few "advanced settings" of fq_codel. You can leave them empty - those will be defaulted by the wizard on apply. The defaults are based on Dave Taht's ( dtaht2 ) recommendations in his original script and further clarifications in this thread by @dtaht and @moeller0. Unless you know what you're doing or feel like experimenting, don't change those defaults.

EdgeOS-Versions
Supported versions are 1.5.0 final, any 1.6.0-builds except alpha1, 1.7.0alpha1-2.

 

Howto install / upgrade
1. Download the tar file attached to this post
2. Log into the webinterface of your router, click on "wizard", click on the "+"-sign next to "Feature Wizard"
3. Use "fq_codel" as Wizard-Name and select the file you've just downloaded.
4. Click save.

 

FAQ / Comments
- You can leave all the fields that appear by clicking the "show advanced options" empty. Those fields will be defaulted once you click apply. If you want to see the default values, just reload the wizard (F5 in your browser) and click show advanced options again.
- To disable fq_codel, click the delete button or remove all interfaces.
- If you've used the script that is in the forums and comes with EdgeOS-versions >=1.6.0 to set up fq_codel, this wizard will recognize your current configuration and display it properly.
- You can use fq_codel for only one direction of your traffic. Just leave the LineSpeed field empty for the direction that should not use fq_codel
- The wizard will generate a script "fq_codel_wizard" in /config/scritps/post-config.d, so that your fq_codel settings will be automatically applied on boot. If you apply fq_codel on a dynamic interface (such as PPPoE, tun, openvpn etc), this might not work. In that case, those interfaces' fq_codel settings will be lost on reboot.

 

Version
0.5 (current),
2015-01-31, 13:48 UTC: Give error messages in case of illegal input data (failed silently before)
0.4,
2014-08-24, 14:30 UTC: Fixed some things so that the wizard works with 1.5.0.
0.3, 
2014-08-21 10:47 UTC: Added new defaulting algorithms for htb_quantum and target. Also added the possibility to enter line speeds in bit/s, KBit/s or MBit/s
0.2, initial release
0.1, development version that has never been released

 

Download
It seems like one can no longer attach .tar or .tar.gz files to forum posts. Therefore, you can download the latest version here: http://final.skilled.ch/fq_codel.tar

Previous Employee
Posts: 13,551
Registered: ‎06-10-2011
Kudos: 5438
Solutions: 1656
Contributions: 2

Re: fq_codel wizard

Nice work and this should help more people get started testing it! Thanks for your contributions!

SuperUser
Posts: 5,437
Registered: ‎04-17-2008
Kudos: 3110
Solutions: 126

Re: fq_codel wizard

Awesome, thanks for posting that 

 

From what I have been reading, you would put it on customer facing interface, yes?

 

I hope to test it later today. Man Happy

Regular Member
Posts: 577
Registered: ‎09-10-2012
Kudos: 374
Solutions: 35

Re: fq_codel wizard

[ Edited ]

You can put it on any interface (and multiple interfaces if needed), but it makes most sense to put it on the interface that has the least bandwith.

SuperUser
Posts: 5,437
Registered: ‎04-17-2008
Kudos: 3110
Solutions: 126

Re: fq_codel wizard

Can it/should it also be applied to the upstream interfaces?

Regular Member
Posts: 577
Registered: ‎09-10-2012
Kudos: 374
Solutions: 35

Re: fq_codel wizard

In theory, you can / should apply it to any interface. in practice, it shows that the ER Lite and PoE can handle about 70-90Mbit/s, and the ER and ER-Pros around 200MBit/s - this is why you might not want to add it to every interface (unless you know you're below that bandwith at all times).

 

generally, I recommend that you identify the "bottleneck" in your links and apply it to that interface first. See what that does for you.

SuperUser
Posts: 5,437
Registered: ‎04-17-2008
Kudos: 3110
Solutions: 126

Re: fq_codel wizard

ok...my uplink has gig connection...and is never bottleneck

SuperUser
Posts: 5,437
Registered: ‎04-17-2008
Kudos: 3110
Solutions: 126

Re: fq_codel wizard

I get error that it can't find sch_ingress.ko.gz

codel error.JPG

Regular Member
Posts: 577
Registered: ‎09-10-2012
Kudos: 374
Solutions: 35

Re: fq_codel wizard

does your router have a nameserver configured? That means, if you click on System (bottom), do you have a "system name server" that is valid? If not, enter 8.8.8.8 and try again.

SuperUser
Posts: 5,437
Registered: ‎04-17-2008
Kudos: 3110
Solutions: 126

Re: fq_codel wizard

ahhh....that fixed it. Success

SuperUser
Posts: 5,437
Registered: ‎04-17-2008
Kudos: 3110
Solutions: 126

Re: fq_codel wizard

And so far router is not bricked Man Wink

Regular Member
Posts: 577
Registered: ‎09-10-2012
Kudos: 374
Solutions: 35

Re: fq_codel wizard

[ Edited ]

Man Happy I would have been surprised if it did, but you never know, right?
It's good practice to check the "show advanced options" box after clicking apply and a gui refresh and see if there are values in the (before) empty boxes. If there are, then it's a very good indication that everything is working as it should (because those values are read directly from the system's traffic control settings, so if they're there, then the rules are most likely active)

SuperUser
Posts: 5,437
Registered: ‎04-17-2008
Kudos: 3110
Solutions: 126

Re: fq_codel wizard

Somehow it pretty much killed throughput on the interfaces. I had to take them out. I'll play again later

SuperUser
Posts: 5,437
Registered: ‎04-17-2008
Kudos: 3110
Solutions: 126

Re: fq_codel wizard

Hah, guess it would be helpful to set the correct amount of bits per second Man Tongue

 

Seems to be working fine

Regular Member
Posts: 335
Registered: ‎03-26-2012
Kudos: 261
Solutions: 2

Re: fq_codel wizard

[ Edited ]

This looks awesome I may get to play with this next weekend.

Member
Posts: 266
Registered: ‎06-20-2011
Kudos: 18

Re: fq_codel wizard

While Wizarded LB and fake IP/def gateway on one eth to turn off LB I got this error:

Invalid result data: {"FEATURE":startGatewayUpdate [G] timer already running gatewayUpdate [G] e = 0 name [eth1] find_group_intf(G, eth1) name [eth1] status [inactive] table [201] gateway [192.168.253.254] find_gateway(G, eth1) new_gateway [192.168.253.254] gateway_find_type [192.168.253.254] = via change_table_gateway(G, 201, 192.168.253.254) replacing [201] with [201] name [pppoe0] find_group_intf(G, pppoe0) name [pppoe0] status [active] table [202] gateway [pppoe0] status is reachable run_ip_commands: 3 [sudo /sbin/ip route flush table 201] = 0 [sudo /sbin/ip route add 0.0.0.0/0 via 192.168.253.254 table 201] = 0 [sudo /sbin/ip route add blackhole 0.0.0.0/0 table 201 metric 256] = 0 { "success": "1", "deletable": "1", "data": { "fq_codel_config": [{ "interface": "eth1", "codel_quantum_up": "300", "target_up": "5", "target_down": "5", "speed_down": "20000000", "codel_quantum_down": "300", "speed_up": "1000000", "htb_quantum_up": "1500", "htb_quantum_down": "1500"}, { "interface": "eth0", "codel_quantum_up": "300", "target_up": "5", "target_down": "5", "speed_down": "21000000", "codel_quantum_down": "300", "speed_up": "4000000", "htb_quantum_up": "1500", "htb_quantum_down": "1500"}]}, "definition":{"interface":{"options":["eth0","eth1","eth2","eth2.100","eth2.22","eth2.220","eth2.223","eth2.224","eth2.225","eth2.24","eth2.25","pppoe0"],"other":"true"}}}}

 

Regular Member
Posts: 577
Registered: ‎09-10-2012
Kudos: 374
Solutions: 35

Re: fq_codel wizard

when does this error happen? when you click apply on the fq_codel wizard?

 

It's very strange indeed because the output you get before the { "success" : 1 ... part does not come from the fq_codel wizard at all, but from what it looks like to be the wizard engine backend. might be that you've discovered a bug in the wizard engine ...

Member
Posts: 266
Registered: ‎06-20-2011
Kudos: 18

Re: fq_codel wizard

[ Edited ]

It appear exacly after click link in wizards menu.

It looks like wizard wants to check actual status of settings but cannot.

It occured as I mention before after put fake default gateway on one of loadbalanced interface.

Regular Member
Posts: 577
Registered: ‎09-10-2012
Kudos: 374
Solutions: 35

Re: fq_codel wizard

[ Edited ]

can you log into the console (via ssh or webgui) and execute the following command:

sudo -s -- sh -c 'for intf in /sys/class/net/*; do intf=`basename $intf`; echo -e "$intf\n-----"; tc qdisc show dev $intf; tc -d class show dev $intf; done'

 and post the output here?

 

those are the commands that are executed by the fq_codel wizard upon loading the wizard. I don't see how these could produce the output you're seeing.

Member
Posts: 266
Registered: ‎06-20-2011
Kudos: 18

Re: fq_codel wizard

[ Edited ]

I have to change it to Wizarded LB but with eth1 as failover only. Then your wizard works well.

 

anyway here is output:

 

eth0
----- qdisc htb 1: root refcnt 2 r2q 10 default 10 direct_packets_stat 64 qdisc fq_codel 100: parent 1:10 limit 10240p flows 1024 quantum 300 target 5.0ms interval 100.0ms ecn qdisc ingress ffff: parent ffff:fff1 ---------------- class htb 1:10 parent 1:1 leaf 100: prio 0 quantum 1500 rate 4096Kbit ceil 4096Kbit burst 1599b/1 mpu 0b overhead 0b cburst 1599b/1 mpu 0b overhead 0b level 0 class htb 1:1 root rate 4096Kbit ceil 4096Kbit burst 1599b/1 mpu 0b overhead 0b cburst 1599b/1 mpu 0b overhead 0b level 7 class fq_codel 100:132 parent 100: class fq_codel 100:175 parent 100: class fq_codel 100:180 parent 100: class fq_codel 100:249 parent 100: class fq_codel 100:2ae parent 100: class fq_codel 100:2ee parent 100: class fq_codel 100:3bd parent 100: eth1 ----- qdisc htb 1: root refcnt 2 r2q 10 default 10 direct_packets_stat 0 qdisc fq_codel 100: parent 1:10 limit 10240p flows 1024 quantum 300 target 5.0ms interval 100.0ms ecn qdisc ingress ffff: parent ffff:fff1 ---------------- class htb 1:10 parent 1:1 leaf 100: prio 0 quantum 1500 rate 896000bit ceil 896000bit burst 1599b/1 mpu 0b overhead 0b cburst 1599b/1 mpu 0b overhead 0b level 0 class htb 1:1 root rate 896000bit ceil 896000bit burst 1599b/1 mpu 0b overhead 0b cburst 1599b/1 mpu 0b overhead 0b level 7 class fq_codel 100:31c parent 100: eth2 ----- ifb_eth0 ----- qdisc htb 1: root refcnt 2 r2q 10 default 10 direct_packets_stat 0 qdisc fq_codel 100: parent 1:10 limit 10240p flows 1024 quantum 300 target 5.0ms interval 100.0ms ecn class htb 1:10 parent 1:1 leaf 100: prio 0 quantum 1500 rate 20480Kbit ceil 20480Kbit burst 1597b/1 mpu 0b overhead 0b cburst 1597b/1 mpu 0b overhead 0b level 0 class htb 1:1 root rate 20480Kbit ceil 20480Kbit burst 1597b/1 mpu 0b overhead 0b cburst 1597b/1 mpu 0b overhead 0b level 7 class fq_codel 100:d parent 100: class fq_codel 100:c4 parent 100: class fq_codel 100:170 parent 100: class fq_codel 100:392 parent 100: class fq_codel 100:3fe parent 100: ifb_eth1 ----- qdisc htb 1: root refcnt 2 r2q 10 default 10 direct_packets_stat 0 qdisc fq_codel 100: parent 1:10 limit 10240p flows 1024 quantum 300 target 5.0ms interval 100.0ms ecn class htb 1:10 parent 1:1 leaf 100: prio 0 quantum 1500 rate 18432Kbit ceil 18432Kbit burst 1596b/1 mpu 0b overhead 0b cburst 1596b/1 mpu 0b overhead 0b level 0 class htb 1:1 root rate 18432Kbit ceil 18432Kbit burst 1596b/1 mpu 0b overhead 0b cburst 1596b/1 mpu 0b overhead 0b level 7 class fq_codel 100:4b parent 100: class fq_codel 100:e3 parent 100: class fq_codel 100:216 parent 100: class fq_codel 100:30c parent 100: lo ----- pppoe0 ----- qdisc pfifo_fast 0: root refcnt 2 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1

 To try reproduce my issue try like this:

1. make wizarded LB with eth0 as pppoe and eth1 as static IP (eg. 10.10.10.2/24)

2. change eth1 ip to fake (eg. 10.100.100.2/24) on which is not providing Internet access from source you have it connected - check if your wizard is working

3. change default route for for eth1 to fake one that match with fake IP (eg. 0.0.0.0/0 gw 10.100.100.1) then eth1 ll appear in interface column - and check if your wizard is working

 

That was exacly how I had it before. Codel was implemented by script then fixed by your wizard then I have to had turn off WAN2 somehow due to sessions issue. 

Reply