My "custom" QoS that really works

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Contributions Upload
Goto page Previous  1, 2, 3, 4, 5  Next
Author Message
CaScAdE
DD-WRT Guru


Joined: 18 Jun 2006
Posts: 1110
Location: Kiel (54.4247,10.1721)

PostPosted: Tue Nov 14, 2006 11:23    Post subject: Reply with quote
You're right, it is in fact based on the wondershaper...
Actually I started my own, much more complex script, but then found it and replaced my one :)

Regarding to the error messaged: Some output would be cool, but you can still test syntax of your scripts on a full featured sytem or install unstripped binaries for testing...

There is one big problem with the port pased stuff: some users who are a little more advanced than the average know those mechanism. They pull down their ports to numbers lower than 1024 and get speed again. If you are admin of all PCs in your net and have a sight on programs running it is ok, but I have 15-20 people here online at once and have no access to theis pcs ;( So l7 was the choice. And I choosed before the encryption and obfuscation were available...
Additionally I am blocking conections to the std ports of p2p programms that the people here use which makes it more difficult for them to get speed...
There is just too much to much playing cat and mouse between users and administrators around that I am working on a script that forces voip and some games to the highest category, default traffic by some "special" pcs (like mine *g*) to the next class, default traffic by the rest to the third and p2p and other "bad" or non time critical stuff to the lowest... But since I am not at home and do not want to do the testing in a productive environment I did not get that far that I could post some better examples....

_________________
DD-WRT F.A.Q.

Webcam Kiel
Sponsor
gildenman
DD-WRT Novice


Joined: 25 Oct 2006
Posts: 9

PostPosted: Fri Nov 17, 2006 13:45    Post subject: Reply with quote
CaScAdE wrote:
You're right, it is in fact based on the wondershaper...
Actually I started my own, much more complex script, but then found it and replaced my one :)

Regarding to the error messaged: Some output would be cool, but you can still test syntax of your scripts on a full featured sytem or install unstripped binaries for testing...


I've since moved to OpenWrt and find it much more to my liking. The binaries on there have error messages which makes everything much more logical. I think dd-wrt has gone too far in it's byte saving. Though I appreciate that 2Mb flash users might not agree with me. However, strip the errors in micro, but there's no need in mini or standard?

Quote:

There is one big problem with the port pased stuff: some users who are a little more advanced than the average know those mechanism. They pull down their ports to numbers lower than 1024 and get speed again. If you are admin of all PCs in your net and have a sight on programs running it is ok, but I have 15-20 people here online at once and have no access to theis pcs ;(


Well we definately have different needs. I'm only setting up devices for home use with 1-3 users.

Quote:

So l7 was the choice. And I choosed before the encryption and obfuscation were available...


But they are available now and your users will start to or already be using them. This little WHR-HP-G54 has surprised me in how much throughput it can handle. However, l7 filtering is looking at the 1st 8 packets of every connection to determine type. That is a dramatic increase in cpu load. The extra processing required is orders of magnitude greater than port filtering. Surely that is not sustainable? I found turning off all l7 filtering gave me a slight speed increase. That was not even on a very large load as my uplink is only 512k. I'd expect on a faster link that l7 filtering would really limit throughput due to lack of cpu to process all those extra packets.

Quote:

Additionally I am blocking conections to the std ports of p2p programms that the people here use which makes it more difficult for them to get speed...


Wouldn't it be better to allow the normal ports, but throttle them? You are forcing users to become aware that there are blocks in effect and making them learn from the start that they have to avoid your blocks to get anything to work. Then in that learning process they become aware of doing bittorrent on port 80 and turning on encryption and then you are back at square one?

Quote:
There is just too much to much playing cat and mouse between users and administrators around that I am working on a script that forces voip and some games to the highest category, default traffic by some "special" pcs (like mine *g*) to the next class, default traffic by the rest to the third and p2p and other "bad" or non time critical stuff to the lowest... But since I am not at home and do not want to do the testing in a productive environment I did not get that far that I could post some better examples....


Since moving to OpenWrt, I've been much happier with the qos. There's nbd's qos-scripts, but there is also qos-re which I find even better. Not only does the author, rudy, provide two versions; htb & hfsc; but his methodology is well explained and thought out. The incoming traffic is also properly shaped and he even goes to the length of putting a htb qdisc on the outgoing LAN traffic to effectively act as an ingress discipline for the WAN port.
Works very well here, but I've not tried anything really time sensitive like voip.
As QOS is probably the main reason for using 3rd party firmware, I'm going to stay with OpenWrt as it definately has the best qos.

BTW no offence to you and the effore you've put into writing and releasing your script Smile
fabfive
DD-WRT Novice


Joined: 13 Nov 2006
Posts: 10

PostPosted: Wed Nov 22, 2006 11:40    Post subject: Reply with quote
I slightly modified the script.
Now based on IP address I set the priorities.
My ATA the highest, my filesharing flatmate lowest and the rest of us medium.
It just works!!
Thanks that is a great script, just a few lines that really make the difference.
Why is it so difficult to implement something like this into the firmware so anyone can use it.
Filesharing, surfing and always enough bandwidth and speed for voip!
I love it
JustRob
DD-WRT Novice


Joined: 20 Nov 2006
Posts: 14

PostPosted: Sat Nov 25, 2006 2:20    Post subject: FreeWrt vs DD-wrt QoS? Reply with quote
It looks like, at least from the names, that both DD-WRT and OpenWrt both have QoS based on HTB and HFSC. With that being said, is it possible to modify DD-WRT to implement the features from Ruby in this forum:

http://forum.openwrt.org/viewtopic.php?id=4112&p=17
larsrya8
DD-WRT Novice


Joined: 09 Dec 2006
Posts: 13

PostPosted: Tue Dec 12, 2006 7:45    Post subject: Reply with quote
I found this thread while searching for instructions for setting up QoS. I have Azureus set at Bulk, my Xbox's at Express, and everything else is Standard. L7 was using too much CPU, so I kept it simple with port- and MAC-based assignments.

At first I was using DD-WRT's HFSC and it didn't seem like it was working. I would have Azureus downloading at ~250K/sec (I have 3 Mbit cable), and would try to watch a movie trailer on Apple's website. Azureus lost some speed, but not more than half (between 120K/sec and 100K/sec) and the video wouldn't buffer fast enough. I then tried the HTB option. When viewing trailers (or downloading anything at full speed), Azureus almost completely bottoms out at 3K/sec.

So, my question is this: Was HFSC actually doing what it was supposed to do? Or is HTB the only working part of DD-WRT's QoS? Or, did I completely miss something?
larsrya8
DD-WRT Novice


Joined: 09 Dec 2006
Posts: 13

PostPosted: Sat Dec 23, 2006 2:11    Post subject: Reply with quote
Also, when that custom code says "drop anything that is coming in too fast", how does it drop it? Does it tell the remote machine not to send it? Or does it just drop it once it has already been received by the router?
_________________
WRT54G v2
DD-WRT v23 SP3 12/18/06
CaScAdE
DD-WRT Guru


Joined: 18 Jun 2006
Posts: 1110
Location: Kiel (54.4247,10.1721)

PostPosted: Sat Dec 23, 2006 21:18    Post subject: Reply with quote
larsrya8 wrote:
Also, when that custom code says "drop anything that is coming in too fast", how does it drop it? Does it tell the remote machine not to send it? Or does it just drop it once it has already been received by the router?


Well, it gets dropped when it is already received, that's right. But it is not nonsense since intelligent servers lower the speed when packets get dropped...
And I mentioned it: You cannot change anything when the package is already in the line... it is just some kind of voodoo together with a lot of hope.

_________________
DD-WRT F.A.Q.

Webcam Kiel
larsrya8
DD-WRT Novice


Joined: 09 Dec 2006
Posts: 13

PostPosted: Sun Dec 24, 2006 4:38    Post subject: Reply with quote
CaScAdE wrote:
Well, it gets dropped when it is already received, that's right. But it is not nonsense since intelligent servers lower the speed when packets get dropped...
And I mentioned it: You cannot change anything when the package is already in the line... it is just some kind of voodoo together with a lot of hope.

I thought there was a prettier way of doing it... something like requesting the data slower (delaying ACKs maybe?). Speaking of intelligent servers, does this include P2P applications as well? Or just webservers?

Anyway, thank you for your explanation. Sorry if I annoyed you, I'm just trying to determine what kind of QoS implementation would be best for me. Basically, I want bittorrent, P2P, FTP and HTTP (HTTP over 512KB or so) as bulk; my Xbox's and other games as highest, and everything else in between. I also don't want anyone to notice that the services prioritized below them are using bandwidth.

P.S. I noticed that even though http requests are sent from different ports on my computer, they all end up at port 80 on the remote machine. Perhaps filtering by destination port would be a nice way to overcome the use of L7 for things like http and ftp? Would this be something that a script could use, or would DD-WRT need to add it?

_________________
WRT54G v2
DD-WRT v23 SP3 12/18/06
ayamaguc
DD-WRT Novice


Joined: 30 Dec 2006
Posts: 2

PostPosted: Sat Dec 30, 2006 20:40    Post subject: Reply with quote
fabfive wrote:
I slightly modified the script.
Now based on IP address I set the priorities.
My ATA the highest, my filesharing flatmate lowest and the rest of us medium.
It just works!!


Would someone please be kind enough to post an example set of iptable settings that executes this? I'm having a really hard time finding a tutorial I understand..

Thank in advance.
ayamaguc
DD-WRT Novice


Joined: 30 Dec 2006
Posts: 2

PostPosted: Sat Dec 30, 2006 22:32    Post subject: Reply with quote
I think I got this to work by..

-tuning the script to my link speeds
-commenting out the status and stop commands
-commenting out all of the iptable stuff (except kept the flush in -- probably no effect)
-changing the 10:2 and 10:3 limits to 125
-changing the filtering section to this
# 10:1
$TC filter add dev ${DEV} parent 10:0 protocol ip prio 10 u32 \
match ip dst 192.168.1.51/32 flowid 10:1

# default
$TC filter add dev ${DEV} parent 10:0 prio 30 protocol ip u32 \
match ip src 0.0.0.0/0 \
flowid 10:3
-and plugging this into the firewall rules section of the diagnostics tab.

i tried enabling jffs but my router must not have enough ram.

i don't know what i'm doing, so it's a hack, but things appear much better!
lovingHDTV
DD-WRT Novice


Joined: 05 Jan 2007
Posts: 15

PostPosted: Fri Jan 05, 2007 21:55    Post subject: Reply with quote
I started a new thread about QOS before I saw this one.

I downloaded and installed and it works great!

My one question is how do I ensure this gets started after a reboot?

thanks,
David

EDIT: after reading some more (lots to read). I changed my /jffs/etc/config/shaper.ipup script to be /jffs/etc/config/shaper.wanup as I don't use a PPP interface, but a cable modem instead.

This did survive a reboot.
pokinwilly
DD-WRT Novice


Joined: 31 Jan 2007
Posts: 2

PostPosted: Wed Jan 31, 2007 13:15    Post subject: Reply with quote
CaScAdE wrote:
You're right, it is in fact based on the wondershaper...


Hello,

I found this very interesting thread by looking at criteria "QoS with DD-WRT" in google.
And I'm looking at QoS because I rarely get a good quality with skype, even if I'm not running heavy trafic apps. My ADSL is 1024(down)/512(up), so should be more than sufficient.

Thanks to this thread, I managed to install/configure shaper.sh (with default rules, and interface set to br0 because ppp0 is not available in my list, 'cause my DD-WRT is in "client bridge" mode).

However, I've no clue of the result from shaper.sh status command. Could one expert comment and explain? BTW, I've no idea of what the parameters/instructions within shaper.sh is supposed to do ...
Code:
/jffs/etc # ./shaper.sh status
qdisc ingress ffff: ----------------
 Sent 551544 bytes 5196 pkts (dropped 0, overlimits 0)
qdisc pfifo 300: limit 700p
 Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
qdisc pfifo 200: limit 200p
 Sent 2038844 bytes 4825 pkts (dropped 0, overlimits 0)
qdisc pfifo 100: limit 1p
 Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
qdisc prio 10: bands 3 priomap  1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
 Sent 2038844 bytes 4825 pkts (dropped 0, overlimits 0)
qdisc tbf 1: rate 435000bit burst 4Kb lat 19.4ms
 Sent 2038844 bytes 4825 pkts (dropped 0, overlimits 1166)
class prio 10:1 parent 10: leaf 100:
class prio 10:2 parent 10: leaf 200:
class prio 10:3 parent 10: leaf 300:
class tbf 1:1 parent 1: leaf 10:


Thanks in advance!
Maldoror
DD-WRT Novice


Joined: 20 Jan 2007
Posts: 2

PostPosted: Wed Feb 28, 2007 21:39    Post subject: Reply with quote
Hi there,

I'm just wondering why this is not implemented in dd-wrt v24 as an option in the web interface? My knowledge of Linux is too miserable for me to even try this script, but we're having massive problems with one of our clients who has VoIP and a WRT54GL running dd-wrt v24 - as soon as they start uploading something on FTP, the voice conversations are garbled. Even without FTP traffic, sometimes you hear Echo on the line or get garbled robotic voices.

Would anyone be available for professional help on this issue? We could pay for help by Paypal and the router could be made accessible remotely. Please also reply by email at online at tektonik dot com

Thank you,
Alain
Maldoror
DD-WRT Novice


Joined: 20 Jan 2007
Posts: 2

PostPosted: Sun Mar 04, 2007 17:40    Post subject: Reply with quote
Sorry guys, but can someone tell me if my WRT54GL has enough space for the jffs partition? Here's what I have:

Memory

Total Available
86%
14080 kB / 16384 kB

Free
7%
1016 kB / 14080 kB

Used
93%
13064 kB / 14080 kB

Buffers
13%
1732 kB / 13064 kB

Cached
30%
3868 kB / 13064 kB

Active
27%
3476 kB / 13064 kB

Inactive
17%
2160 kB / 13064 kB

Thank you,
Maldoror


CaScAdE wrote:
Did you read: http://www.dd-wrt.com/wiki/index.php/Jffs ?

You need a device with >4MB flash or the mini version when havin =4MB flash. Otherwise there is not space left on the jffs partition.

And if you jamm you downstream this script won't help that mouch cause whatever is in the queue at your ISP is there and you cannot handle the ISP's side of the line. This script just does what you can do (afair), dropping the rate to enable smaller packages to get through.

As I said, it works for me (and for my brother, who is using native linux and not embedded, as well). Since many others have problems with built in QoS I posted it.

In addition we could rewrite the script so it fits in the "Save Firewall" box, but there the size is limited and so I did not try it.

But for first tests:
Disable you QoS in the web interface.
SSH into your router.
put the script in /tmp and execute it.
( vi, chmod +x, ./foo.sh )
Will still works, no matter where you place it.
CaScAdE
DD-WRT Guru


Joined: 18 Jun 2006
Posts: 1110
Location: Kiel (54.4247,10.1721)

PostPosted: Tue Jul 03, 2007 4:54    Post subject: Reply with quote
@Maldoror:
this is a rather inflexible way to implement it in a web interface, it is not that easy to make a click able gui for it that makes it easier...

@larsrya8:
Since not all htttp-servers are listening on port80 i took the l7 filter, but you still could use dest-port filtering, it is possible, just get familiar with iptables and you should get it going.
regarding to the dropping: it would be cool to delay the acks, but imagine the complexity of analyzing every package, remember where it came from and then waiting for the matching ack and delaying it, there is no way doing it on a router imho...

@pokinwilly:
the main use of the status stuff is looking if the traffic gets categorized well, you can watch the classes fill and stuff... the rest is not important for you as far as you do not know the whole iptables and tc interaction...

@gildenman:
you are right, the main reason to take third party stuff was QoS as well, but since I have the script up and running that well I did not think about changing, it works like I want and fine, sounds familiar to you, right? Smile Two users of different software each one happy with his choice, something I can live with Very Happy
btw: tomato has the nicest gui and good working qos as well but did not run on my asus wl500gp (i know that it should be supported but i did not manage it some time ago and now i stick to "never touch a running system") so it's out of choice...

_________________
DD-WRT F.A.Q.

Webcam Kiel
Goto page Previous  1, 2, 3, 4, 5  Next Display posts from previous:    Page 3 of 5
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Contributions Upload All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum