For anyone who's interested, I updated my traffic shaping script to fix some problems I noticed. The biggest problem was that I didn't notice that sshd generates all of its outbound traffic as ToS type 16 (minimize-delay) and my script was honoring ToS before doing anything else, so all the ssh traffic was getting a much higher priority that it was supposed to, and my later rules for ssh were being ignored. Ooops. That'll teach me to write a script and not sniff the wire to see what was happening...
Since there doesn't seem to be any configuration option to change the way sshd marks its packets, I've resorted to modifying the ToS bits on the ssh packets before classifying them. Kind of a shame to have to mangle the same packet twice, but my WRT can handle it. You'll notice I'm doing it inbound on the br0 interface which means that even internal ssh traffic is getting mangled. This certainly isn't neccesary as I could just do it on the POSTROUTING chain on vlan1 prior to my other rules, but I prefer to keep it that way for no particular reason. Probably lack of coffee. :-)
So my primary changes are:
* [bug] - Fixed how I handled ssh traffic to properly give interactive traffic higher priority than bulk traffic
* [feature] - Switched udp to highest priority for SIP and games
* [bug] - Included an /etc/services file so the script will actually work
The last bit is optional, and is only for convenience. If you have the space on your device, you can add the services file so you can use text descriptions of ports in the script like I do, but the file is rather large. Those short on space should not use the file, and instead change the text to actual port numbers. I have a GS so I've got room. :-)
To recap my last few notes...
I've put the new version here:
http://blues.gotdns.org/traffic-shaping-1.3.tar.bz
and the classify modules for WR-RC3 are still here:
http://blues.gotdns.org/ipt_classify.tar.bz
The files are as follows:
services -> /etc (standard services file taken from Fedora Core 3, allows text descriptions of ports in script)
75-ts -> /etc/modules.d/ (loads all the proper modules on bootup. I like the way OpenWrt does this; very clean!)
traffic-shaper.conf -> /etc (configures your bandwidth settings, and your percentages for the different classes)
S61traffic-shaping -> /etc/init.d (sets up the classes, categorizes with iptables classify, starts, stops, restart, status, etc.)
ipt_CLASSIFY.o -> /lib/modules/2.4.30/ (kernel module for classifying packets)
libipt_CLASSIFY.so -> /usr/lib/iptables/ (iptables interface to kernel module)
What you need installed:
You'll need the classify modules.
You'll need bc (available via the tracker) to do some calculations.
You need all the normal stuff for traffic shaping that can be found via the tracker (tc, iptables-extra, kmod-iptables-extra)
-----------
So the result is that I've written and customized this to shape my traffic that I see on my network, but it should be a really useful starting point for anyone looking to do the same on the their network. I just think it's cleaner and more understandable than the various versions of wondershaper that are out there. It's at least a very good learning tool, if nothing else.
Maybe someone would like to help me make an ipkg of this? Anyone have any feedback or suggestions?
Greg