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  Next
Author Message
speed_phreak
DD-WRT Novice


Joined: 06 Nov 2006
Posts: 3

PostPosted: Mon Nov 06, 2006 1:53    Post subject: doh, i fixed it Reply with quote
for some reason it is

/dev/ppp

not /dev/ppp0

change the nested value of ppp0 to ppp at the top of the script, at least if you are me...
Sponsor
CaScAdE
DD-WRT Guru


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

PostPosted: Mon Nov 06, 2006 14:13    Post subject: Reply with quote
well, it is not the dev(ice) but the i(inter)f(ace) you need...

Code:
~ # ifconfig | grep ppp
ppp0      Link encap:Point-to-Point Protocol
~ #


so ppp0 is correct. The script still works for me... no errors or such...

Code:
/jffs/etc # ./shaper.sh start
/jffs/etc #


Which soft- and hardware versions do you use?

_________________
DD-WRT F.A.Q.

Webcam Kiel
speed_phreak
DD-WRT Novice


Joined: 06 Nov 2006
Posts: 3

PostPosted: Mon Nov 06, 2006 19:32    Post subject: Reply with quote
CaScAdE wrote:
well, it is not the dev(ice) but the i(inter)f(ace) you need...

Code:
~ # ifconfig | grep ppp
ppp0      Link encap:Point-to-Point Protocol
~ #


so ppp0 is correct. The script still works for me... no errors or such...

Code:
/jffs/etc # ./shaper.sh start
/jffs/etc #


Which soft- and hardware versions do you use?


I provided this information in my first post

wrt54gs v3.0
dd-wrt v23sp2

using ppp gives no errors but the script doesn't function

using ppp0 seems to make traffic matches, but i'm not so sure what else, not so sure it is really working...

my output of: ifconfig | grep ppp
is also: ppp0 Link encap:Point-to-Point Protocol

not so sure what is happening...
CaScAdE
DD-WRT Guru


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

PostPosted: Mon Nov 06, 2006 23:11    Post subject: Reply with quote
speed_phreak wrote:

I provided this information in my first post

wrt54gs v3.0
dd-wrt v23sp2


Pagebreak, sorry... Did not read your first post completely...

Try watching the output of
./shaper.sh status

And the best way to test it will ever be to play online or talk via VOIP and upload something at full speed...

For further debugging of your problems could you attach the complete output of
ifconfig
and please do some testing...
Did you ran the script when a PPPoE connection was established? Do you use PPPoE?
Give some more information please since firmware version seems to be current...
I know that the switch port-numbers differ for the V1.1 and V3 of the GS series because the 1.1 has a BCM5325 switch and the V3 has it included in the cpu (which means the cpu is different as well) so there are some changes but they all should not matter...

_________________
DD-WRT F.A.Q.

Webcam Kiel
gildenman
DD-WRT Novice


Joined: 25 Oct 2006
Posts: 9

PostPosted: Sat Nov 11, 2006 17:12    Post subject: Reply with quote
Does this mean on my non-PPPoE configuration, I have my cable modem plugged into the WAN port of my WHR-HP-G54, that I should be using device vlan1 as that's the WAN device?
Cheers.
CaScAdE
DD-WRT Guru


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

PostPosted: Sat Nov 11, 2006 17:40    Post subject: Reply with quote
Since you have no ppp0 device you should use vlanX, yes.
_________________
DD-WRT F.A.Q.

Webcam Kiel
gildenman
DD-WRT Novice


Joined: 25 Oct 2006
Posts: 9

PostPosted: Sat Nov 11, 2006 19:16    Post subject: Reply with quote
CaScAdE wrote:
Since you have no ppp0 device you should use vlanX, yes.


Thanks for that.
I'm still having problems getting your script to do anything though. AFAICT the tc command does nothing?

./shaper.sh status

gives no output. Calling tc with no args gives no output.
If I install the tc package and then /jffs/usr/sbin/tc it does appear to do something as I get some output. However, there appear to be some problems:

~ # ./shaper.sh
What is "ms"?
Usage: ... tbf limit BYTES burst BYTES[/BYTES] rate KBPS [ mtu BYTES[/BYTES] ]
[ peakrate KBPS ] [ latency TIME ]
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: Invalid argument
We have an error talking to the kernel
RTNETLINK answers: Invalid argument
We have an error talking to the kernel
RTNETLINK answers: Invalid argument
We have an error talking to the kernel
~ #

Any ideas?
CaScAdE
DD-WRT Guru


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

PostPosted: Sun Nov 12, 2006 15:02    Post subject: Reply with quote
tc without any outputs gives no output, thats normal when using dd-wrt because most of the comments and advices are stripped out of the binarys to save space.

Btw: Which version are you using?

I tried using vlan1 here and there are no errors and no porblems when executing the script.

Edit: Oh, there really was a problem when copying the code out of the forum-post... I edited the firs post. Please try again.

_________________
DD-WRT F.A.Q.

Webcam Kiel
fabfive
DD-WRT Novice


Joined: 13 Nov 2006
Posts: 10

PostPosted: Mon Nov 13, 2006 9:45    Post subject: Reply with quote
Hi all,

first of all, many thanks for providing your script.
I am not a Linux expert and have just a few questions of what I should do with the script?

you posted:

>/jffs/etc/shaper.sh - the script itself
>/jffs/etc/config/shaper.ipup
>#!/bin/sh
>
>/jffs/etc/shaper.sh start
>/jffs/etc/config/shaper.ipdown
>#!/bin/sh
>
>/jffs/etc/shaper.sh stop


What does that all mean?
I do understand that I have to enable jiffs and put the shaper.sh into the etc folder.
That is fine.

But what does the rest mean? What do I have to do then to get it to start?
It would be great if you can explain the other lines for a Linux dummie
gildenman
DD-WRT Novice


Joined: 25 Oct 2006
Posts: 9

PostPosted: Mon Nov 13, 2006 10:47    Post subject: Reply with quote
CaScAdE wrote:
tc without any outputs gives no output, thats normal when using dd-wrt because most of the comments and advices are stripped out of the binarys to save space.

Btw: Which version are you using?


v23SP2

Quote:

I tried using vlan1 here and there are no errors and no porblems when executing the script.


It does nothing for me. As I said,

shaper.sh status

gives no output. However, when I get it to use the OpenWRT package /jffs/usr/sbin/tc then it does give me output. It seems like the tc command does nothing at all?

Quote:

Edit: Oh, there really was a problem when copying the code out of the forum-post... I edited the firs post. Please try again.


I got it directly from the download link you gave on Saturday. Has it changed since then?
Anyway, it appears to be a problem with the tc command and not your script.
Any ideas apart from a nvram reset?
I'm getting another WHR-G54s this week and will try OpenWRT on it instead.
CaScAdE
DD-WRT Guru


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

PostPosted: Mon Nov 13, 2006 12:23    Post subject: Reply with quote
>/jffs/etc/shaper.sh - the script itself

just means that I saved the script using the above filename
(don't forget chmod +x /jffs/etc/shaper.sh afet saving)

>/jffs/etc/config/shaper.ipup

is another script containing just those lines:

>#!/bin/sh
>
>/jffs/etc/shaper.sh start

( dont' forget chmod +x /jffs/etc/shaper.sh )

>/jffs/etc/config/shaper.ipdown

the down script containing the following lines

>#!/bin/sh
>
>/jffs/etc/shaper.sh stop

and chmod as well...


And gildenman:
I reuploaded it yesterday, try downloading again....
shaper.sh status ONLY gives output when there are priority queues, so if the script fails to start it won't list anything...

_________________
DD-WRT F.A.Q.

Webcam Kiel
fabfive
DD-WRT Novice


Joined: 13 Nov 2006
Posts: 10

PostPosted: Mon Nov 13, 2006 12:28    Post subject: Reply with quote
Great!
That sounds logical
Gonna try it tonight and see if I can get a proper setup for my voip lines

Thanks for the help
fabfive
DD-WRT Novice


Joined: 13 Nov 2006
Posts: 10

PostPosted: Mon Nov 13, 2006 22:15    Post subject: Reply with quote
Well, I installed the mini version to have space on the router.
Now maybe a stupid question, but how can I get the script from my XP machine into the /jffs/etc folder???

And also, I had to create the /etc folder
Is that normal? Afer the reboot the folder is gone? Has this something to do with the "clean jffs" option that I enable?

Sorry for all the questions, I hope that I dont bother you too much


Tried to use the ssh file transfer but it does not work as sftp give me an error.
I dont want to input all the script with vi!

Any help?
CaScAdE
DD-WRT Guru


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

PostPosted: Tue Nov 14, 2006 5:45    Post subject: Reply with quote
Well, actually the clean jffs2 option cleans the jffs2 partition every boot...

The need to create the etc folder is normal.

And why not copy and paste? Should work... I uploaded the script to a local webserver and used wget... and I liKe netcat for file transfers as well.
Since the forum download does not work when not logged in you could try
wget http://cascade.dyndns.org/~datagarbage/shaper-07-Nov-2006.sh.gz

_________________
DD-WRT F.A.Q.

Webcam Kiel
gildenman
DD-WRT Novice


Joined: 25 Oct 2006
Posts: 9

PostPosted: Tue Nov 14, 2006 9:58    Post subject: Reply with quote
Ok got over my newbie issues. Now I realise that no command gives error messages. That was where my confusion lay. I can understand removing all errors to save mem, but how about leaving just one generic "Error" message. Instead of calling exit() to leave the command which they have to, they could call a local error() which simply prints error and then itself calls exit. That'd be 6 bytes plus one extra call to a print routine. I know these systems are embedded, but can't spare ~20bytes? Anyway, I digress. Now I know there are no errors it makes sense :)

It's working now. Thanks for your work. This is based on wondershaper, right?
I've removed all the l7 filters tho as I just cannot see the need for them. The 1024 filter suggested by someone else earlier (plus exceptions) is much more efficient and works exactly the same. In fact it works better.
In both emule and utorrent I am using encryption to avoid ISP traffic shaping, so my router can also not determine what they are. Actually it can determine some, cos I have not forced encryption on, so some clients still talk to me without encryption. Therefore all the p2p traffic that is meant to go bulk is instead going default, along with dns, ssh, etc; this breaks the whole design goal.
Now that I have removed all the l7 iptables commands, the l7 detection doesn't get enabled at all by the kernel; "grep l7proto= /proc/net/ip_conntrack" returns nothing.
In the interest of keeping traffic flowing smoothly, considering maintaining that during peak traffic loads & the low cpu power of these routers; I cannot see how I can really warrant turning on any l7 filtering, especially considering that a simple; low cpu load; port filter can do exactly the same thing.
I simply changed all iptables to:

$IPTABLES -t mangle -A POSTROUTING -p icmp -j MARK --set-mark 3
$IPTABLES -t mangle -A POSTROUTING -p tcp --dport :1023 -j MARK --set-mark 3
$IPTABLES -t mangle -A POSTROUTING -p udp --dport :1023 -j MARK --set-mark 3
$IPTABLES -t mangle -A POSTROUTING -p tcp --dport 1024: -j MARK --set-mark 6
$IPTABLES -t mangle -A POSTROUTING -p udp --dport 1024: -j MARK --set-mark 6

No exceptions as yet, cos I don't game nor use voip. I raised the icmp priority whilst I was testing with ping. There are of course icmp based attacks, so eventually disabling icmp may be wise Sad
Can anyone see any problems with this approach? Last thursday was the 1st time I used dd-wrt and the 1st time I've used linux/netfilter; tho I am a full-time UNIX admin Smile; so I may be missing something obvious here.
Goto page Previous  1, 2, 3, 4  Next Display posts from previous:    Page 2 of 4
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