What's new

N14/N56/N65 QOS UP/DOWN + BFQ with Padavan's F/W builds

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

moonman

Regular Contributor
Hello everyone,

I adopted OpenWRT QOS script for this firmware as we know Padavan's f/w lacked this featere.
QOS script works for Uploads and Downloads and is integrated into the firmware build itself (NO GUI though).

Other modifications:
- BFQ I/O scheduler for better USB storage peformance.
- included ftdi_sio kernel module.

For the more technical:
- Base toolchain (gcc 4.4.7) is patched to be compiled on a modern debian (ubuntu).
- Added GCC 4.7.3, GCC 4.8.2(3), GCC 4.91 [GCC 4.8.3 is now upstream] [PLEASE DO NOT USE ANY OF THESE FOR NOW]
- Kernels are patched for >= GCC 4.8.2(3) toolchain (still compile fine with any older toolchain).[ Merged/implemented upstream.]
- QOS kernel modules are built in if you want to use your own scripts.
- Probably more things I forgot to mention.

Source code and small how-to.

My Changelog.

Official Padavan's Changelog.

Download prebuilt images.
Hint: sort by "Modified" date.

Any suggestions and/or Pull Requests on github are welcome.
 
Last edited:
qos.sh
Code:
# Small UDP packets (most likely games) get high priority
  [ "$UDP_LENGTH" -gt 0 ] && iptables -t mangle -A mark_chain -p udp -m length --length :$UDP_LENGTH -j MARK --set-mark 1

In qos.conf file is option UDP_LENGTH=256. Is it possible to put also "TCP_LENGTH" option?
example for ports 80 and 443.
 
Last edited:
It should be possible with a similar rule, but you can just add those ports to the priority queue. You would only benefit from this if you were hosting some service on those ports though, otherwise when you browse the internet you connect to remote port 80 from a random port on your network
 
Last edited:
I just wanted that if it could make diffence between file transfer and browsing.

#1: WWW*
Class: High*
TCP Dst Port: 80,443*
Transferred: 0 - 512KB*

#2: WWW (512K+)*
Class:Low*
TCP Dst Port: 80,443*
Transferred: 512KB+*
 
Last edited:
Those look like the rules in tomato :) i might be able to hack something up, but again my knowledge of iptables/tc/imq is pretty limited, that's why i borrowed the script from openwrt.
 
Maybe like this? I'm not sure.


iptables -t mangle -A mark_chain -p tcp -m multiport --dports 80,443 -m length --length 0:512 -j MARK --set-mark 1
 
Last edited:
I'll test your proposal tonight. It should be easy to test if you copy the script from sbin to /etc/storage, modify and run it again. The script is smart enough to remove all the old rules before applying new ones. Of course after reboot the script from sbin will run again.
 
New build are up.

Again reset the /etc/storage or add the new variables by hand in qos.conf

Code:
TCP_LENGTH=512
TCP_LENGTH_PORTS="80,443"

There's something wrong with github, but the changes should be available here when they fix it.
 
Last edited:
I didn't notice that Padavan updated the toolchain, specifically added more patches for uClibc. So I have now recompiled the toolchain and updated the images. Also fixed the N65 configs to not include the 2.4GHz config because apparantly on N65 it has a completely separate CPU+radio for 2.4 band which is loaded with its own proprietary firmware blob and is autonomous so no driver needed for it.

Would be nice if somebody could test N14U and N65U images, because I only have the N56U.
 
You are a legend. This is working beautifully. Uploading to Youtube plus watching 1080p Youtube would usually result in 500ms-1000ms to google.co.nz. It's now 15ms-30ms. Just changed eth1 to eth3 and set my up/down speeds and qos to YES. Added some gaming ports to the udp express rule too but haven't tested that.
 
You should not need to set the interface as the script gets it from nvram automatically. The variable is there in case it fails to do so for some weird reason.
 
Found a small caveat in the script. Bulk traffic was limited to 3/4 of the connection speed (download only). *3.8-080-moonman-8 builds fix this. Now there's no artificial limit
 
Last edited:
I posted test builds compiled with gcc 4.8.2 which includes optimizations for mips74kc found in n56u and n65u. Please let me know if you have any problems so I will revert to 4.7.3, otherwise all next builds will be compiled with 4.8.2
 
I posted test builds compiled with gcc 4.8.2 which includes optimizations for mips74kc found in n56u and n65u. Please let me know if you have any problems so I will revert to 4.7.3, otherwise all next builds will be compiled with 4.8.2

No problems yet. I don't use any USB-applications or VPN client/server. But Wireless (2,4 and 5 GHz) and everything else is working ok. I'll test couple more days and let you know if there'll be any problems.
 
My connection is 30/5... My sustained download speed from steam will initially peak at 3MB/s then go down to 1.1 should I setup on my sustained speed? I don't know what my sustained upload would be.
 
My connection is 30/5... My sustained download speed from steam will initially peak at 3MB/s then go down to 1.1 should I setup on my sustained speed? I don't know what my sustained upload would be.

Turn on WAN -> Hardware offload NAT/Routing IPv4 (then QOS is disabled)

Make speedtest example http://www.speedtest.net/

then disable WAN -> Hardware offload NAT/Routing IPv4

then edit /etc/storage/qos.conf

Hope that helps!
 
No problems yet. I don't use any USB-applications or VPN client/server. But Wireless (2,4 and 5 GHz) and everything else is working ok. I'll test couple more days and let you know if there'll be any problems.

Yeah, that's the thing, I don't use these extra features either. I'll stick with 4.8.2 for now, if people start complaining then we will know :)
 
FYI: I've removed all images from github because I'am going over the repository quota. All images are now uploaded to mediafire.com. There is no wait queues or limits on how much you can download on this hosting. Download link is updated in the OP.
 
FYI: I've removed all images from github because I'am going over the repository quota. All images are now uploaded to mediafire.com. There is no wait queues or limits on how much you can download on this hosting. Download link is updated in the OP.

Other good file hosting websites are Ge.tt, Dropcanvas, Dropbox and Mega.

This should be implemented straight into Padavans version. More people need to know of this firmware because it's amazing.
 
How this work, I change script but i do nothing more. The speed is the same,and offload nat need to stay disabled? Cose i have 500 megabits speed and without nat i have 220 megabits speed. Anyway my question is if this qos apply only for specific ports? For activate script need retart router? Noobie here :D!
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top