* [LARTC] Weighted packet shaping?
@ 2004-12-21 3:55 Mark Williams (MWP)
2004-12-22 4:53 ` Mark Williams (MWP)
` (17 more replies)
0 siblings, 18 replies; 19+ messages in thread
From: Mark Williams (MWP) @ 2004-12-21 3:55 UTC (permalink / raw)
To: lartc
Hi all,
Im new to all this, and am still trying to get my head qround some of the
concepts of how this all works.
Ive read the howto's, man pages etc.
Ive setup packet shaping on my router/server box using HTB and SFQ, but its not
working the way i would like.
Im after shaping that has "weights" for classes so that a lower priority class
will slow down when a higher class wants to flow more data.
As far as i can see, HTB wont do this...
Ive looked at WRR which i have compiled into my 2.6.8.1 kernel and iproute2, but
it seems this really only works with multiple sources (client PCs), rather than
the iptables MARK system i want to use so i can organise local and client PC
traffic.
Does anyone know how i can do what im after?
Thanks,
Mark Williams.
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [LARTC] Weighted packet shaping?
2004-12-21 3:55 [LARTC] Weighted packet shaping? Mark Williams (MWP)
@ 2004-12-22 4:53 ` Mark Williams (MWP)
2004-12-22 9:07 ` Ed Wildgoose
` (16 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Mark Williams (MWP) @ 2004-12-22 4:53 UTC (permalink / raw)
To: lartc
Anyone?
> Hi all,
>
> Im new to all this, and am still trying to get my head qround some of the
> concepts of how this all works.
> Ive read the howto's, man pages etc.
>
> Ive setup packet shaping on my router/server box using HTB and SFQ, but its not
> working the way i would like.
>
> Im after shaping that has "weights" for classes so that a lower priority class
> will slow down when a higher class wants to flow more data.
> As far as i can see, HTB wont do this...
>
> Ive looked at WRR which i have compiled into my 2.6.8.1 kernel and iproute2, but
> it seems this really only works with multiple sources (client PCs), rather than
> the iptables MARK system i want to use so i can organise local and client PC
> traffic.
>
> Does anyone know how i can do what im after?
>
> Thanks,
> Mark Williams.
> _______________________________________________
> LARTC mailing list / LARTC@mailman.ds9a.nl
> http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
>
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [LARTC] Weighted packet shaping?
2004-12-21 3:55 [LARTC] Weighted packet shaping? Mark Williams (MWP)
2004-12-22 4:53 ` Mark Williams (MWP)
@ 2004-12-22 9:07 ` Ed Wildgoose
2004-12-22 13:49 ` Andy Furniss
` (15 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Ed Wildgoose @ 2004-12-22 9:07 UTC (permalink / raw)
To: lartc
>Im after shaping that has "weights" for classes so that a lower priority class
>will slow down when a higher class wants to flow more data.
>As far as i can see, HTB wont do this...
>
>
I'm not quite sure what you mean? HTB itself dequeues at a rate limited
pace. However, by combining several HTB classes, each with a different
priority and using the tc/mark to filter certain traffic into each
bucket you will achieve what you want I think?
I'm sure wondershaper and all the other example scripts have this kind
of thing setup as well?
However, the problem I think with the "weighting" is that it's not
really designed to be used like this. The idea is that each class
limits traffic to it's stated bandwidth and only the excess is shared
based on priority...
I didn't know there was a WRR module though? Where did you find it?
Perhaps you could describe the real problem a little more and someone
might have a better way for you to do this
Ed W
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [LARTC] Weighted packet shaping?
2004-12-21 3:55 [LARTC] Weighted packet shaping? Mark Williams (MWP)
2004-12-22 4:53 ` Mark Williams (MWP)
2004-12-22 9:07 ` Ed Wildgoose
@ 2004-12-22 13:49 ` Andy Furniss
2004-12-22 15:48 ` Mark Williams (MWP)
` (14 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Andy Furniss @ 2004-12-22 13:49 UTC (permalink / raw)
To: lartc
Mark Williams (MWP) wrote:
> Hi all,
>
> Im new to all this, and am still trying to get my head qround some of the
> concepts of how this all works.
> Ive read the howto's, man pages etc.
>
> Ive setup packet shaping on my router/server box using HTB and SFQ, but its not
> working the way i would like.
>
> Im after shaping that has "weights" for classes so that a lower priority class
> will slow down when a higher class wants to flow more data.
> As far as i can see, HTB wont do this...
As Ed says - I think you probably can do it with rate/ceil/prio - detail
depends on you set up and exactly what you want to happen/
>
> Ive looked at WRR which i have compiled into my 2.6.8.1 kernel
There is a TC options related bug in 2.6.8.1 you'll probably need to
update/patch. This fixed it for me.
http://www.linuxhq.com/kernel/v2.6/9-rc2/net/sched/sch_api.c
Andy.
and iproute2, but
> it seems this really only works with multiple sources (client PCs), rather than
> the iptables MARK system i want to use so i can organise local and client PC
> traffic.
>
> Does anyone know how i can do what im after?
>
> Thanks,
> Mark Williams.
> _______________________________________________
> LARTC mailing list / LARTC@mailman.ds9a.nl
> http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
>
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [LARTC] Weighted packet shaping?
2004-12-21 3:55 [LARTC] Weighted packet shaping? Mark Williams (MWP)
` (2 preceding siblings ...)
2004-12-22 13:49 ` Andy Furniss
@ 2004-12-22 15:48 ` Mark Williams (MWP)
2004-12-22 22:54 ` Andy Furniss
` (13 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Mark Williams (MWP) @ 2004-12-22 15:48 UTC (permalink / raw)
To: lartc
Ok.
My Linux (which is connected to the ADLS modem) box runs HTTP, FTP, etc services and also runs bittorrent, edonkey,
etc.
I have two other PCs (both windows) which connect to the internet via the Linux
box (MASQ).
Now, i want data like SSH, ICMP, DNS from any source to ppp0 to get top priority.
I want the two windows PCs to get 2nd priority.
I want services to get 3rd, and the rest (torrents, etc) to get the lowest
priority.
I have this setup atm using HTB and SFQ.
Now this is what happens:
I have bittorrent going as fast as possible outbound.
I then use my linux box to send FTP data over the same link.
Im finding that packet shaping is splitting the outbound bandwidth (256kbit)
equally between the two.
This is not what im after... want the windows box to take more bandwidth off
bittorrent than 50% like it is atm.
Does this explain my problem better?
Thanks!
> Mark Williams (MWP) wrote:
> >Hi all,
> >
> >Im new to all this, and am still trying to get my head qround some of the
> >concepts of how this all works.
> >Ive read the howto's, man pages etc.
> >
> >Ive setup packet shaping on my router/server box using HTB and SFQ, but
> >its not
> >working the way i would like.
> >
> >Im after shaping that has "weights" for classes so that a lower priority
> >class
> >will slow down when a higher class wants to flow more data.
> >As far as i can see, HTB wont do this...
>
> As Ed says - I think you probably can do it with rate/ceil/prio - detail
> depends on you set up and exactly what you want to happen/
>
> >
> >Ive looked at WRR which i have compiled into my 2.6.8.1 kernel
>
> There is a TC options related bug in 2.6.8.1 you'll probably need to
> update/patch. This fixed it for me.
>
> http://www.linuxhq.com/kernel/v2.6/9-rc2/net/sched/sch_api.c
>
> Andy.
>
> and iproute2, but
> >it seems this really only works with multiple sources (client PCs), rather
> >than
> >the iptables MARK system i want to use so i can organise local and client
> >PC
> >traffic.
> >
> >Does anyone know how i can do what im after?
> >
> >Thanks,
> > Mark Williams.
> >_______________________________________________
> >LARTC mailing list / LARTC@mailman.ds9a.nl
> >http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
> >
>
>
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [LARTC] Weighted packet shaping?
2004-12-21 3:55 [LARTC] Weighted packet shaping? Mark Williams (MWP)
` (3 preceding siblings ...)
2004-12-22 15:48 ` Mark Williams (MWP)
@ 2004-12-22 22:54 ` Andy Furniss
2004-12-23 10:56 ` Mark Williams (MWP)
` (12 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Andy Furniss @ 2004-12-22 22:54 UTC (permalink / raw)
To: lartc
Mark Williams (MWP) wrote:
> Ok.
>
> My Linux (which is connected to the ADLS modem) box runs HTTP, FTP, etc services and also runs bittorrent, edonkey,
> etc.
> I have two other PCs (both windows) which connect to the internet via the Linux
> box (MASQ).
>
> Now, i want data like SSH, ICMP, DNS from any source to ppp0 to get top priority.
> I want the two windows PCs to get 2nd priority.
> I want services to get 3rd, and the rest (torrents, etc) to get the lowest
> priority.
>
> I have this setup atm using HTB and SFQ.
>
> Now this is what happens:
> I have bittorrent going as fast as possible outbound.
> I then use my linux box to send FTP data over the same link.
>
> Im finding that packet shaping is splitting the outbound bandwidth (256kbit)
> equally between the two.
>
> This is not what im after... want the windows box to take more bandwidth off
> bittorrent than 50% like it is atm.
>
> Does this explain my problem better?
Yes, you can do this with htb.
You'll need to back off a bit from 256kbit to allow for overheads - this
is tweakable with patch Ed posted to the list - you could also shape
incoming, but you would need IMQ which involves patching/doing new kernel.
For now try making a parent with rate and ceil 220kbit.
Have 4 child/leaf classes like - (assuming 1 is highest priority)
class 1 rate 120 ceil 220 prio 0
class 2 rate 50 ceil 220 prio 1
class 3 rate 25 ceil 220 prio 2
class 4 rate 25 ceil 220 prio 3
There are other tweaks you can try, it depends how much you care about
latency. You could also share the windows boxes bandwidth by IP.
I don't do it quite like the above - so if it doesn't work, say and I'll
think again.
Andy.
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [LARTC] Weighted packet shaping?
2004-12-21 3:55 [LARTC] Weighted packet shaping? Mark Williams (MWP)
` (4 preceding siblings ...)
2004-12-22 22:54 ` Andy Furniss
@ 2004-12-23 10:56 ` Mark Williams (MWP)
2004-12-24 14:08 ` Andy Furniss
` (11 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Mark Williams (MWP) @ 2004-12-23 10:56 UTC (permalink / raw)
To: lartc
> Mark Williams (MWP) wrote:
> >Ok.
> >
> >My Linux (which is connected to the ADLS modem) box runs HTTP, FTP, etc
> >services and also runs bittorrent, edonkey,
> >etc.
> >I have two other PCs (both windows) which connect to the internet via the
> >Linux
> >box (MASQ).
> >
> >Now, i want data like SSH, ICMP, DNS from any source to ppp0 to get top
> >priority.
> >I want the two windows PCs to get 2nd priority.
> >I want services to get 3rd, and the rest (torrents, etc) to get the lowest
> >priority.
> >
> >I have this setup atm using HTB and SFQ.
> >
> >Now this is what happens:
> >I have bittorrent going as fast as possible outbound.
> >I then use my linux box to send FTP data over the same link.
> >
> >Im finding that packet shaping is splitting the outbound bandwidth
> >(256kbit)
> >equally between the two.
> >
> >This is not what im after... want the windows box to take more bandwidth
> >off
> >bittorrent than 50% like it is atm.
> >
> >Does this explain my problem better?
>
> Yes, you can do this with htb.
>
> You'll need to back off a bit from 256kbit to allow for overheads - this
> is tweakable with patch Ed posted to the list - you could also shape
> incoming, but you would need IMQ which involves patching/doing new kernel.
>
> For now try making a parent with rate and ceil 220kbit.
> Have 4 child/leaf classes like - (assuming 1 is highest priority)
>
> class 1 rate 120 ceil 220 prio 0
> class 2 rate 50 ceil 220 prio 1
> class 3 rate 25 ceil 220 prio 2
> class 4 rate 25 ceil 220 prio 3
>
> There are other tweaks you can try, it depends how much you care about
> latency. You could also share the windows boxes bandwidth by IP.
>
> I don't do it quite like the above - so if it doesn't work, say and I'll
> think again.
Well im currently using:
#root device
$TC qdisc add dev $INTERFACE root handle 1: htb default 25
#root class
$TC class add dev $INTERFACE parent 1: classid 1:1 htb rate 256kbit
#20 - ICMP, DNS, SYN, SSH
$TC class add dev $INTERFACE parent 1:1 classid 1:20 htb rate 128kbit ceil 256kbit prio 1
$TC qdisc add dev $INTERFACE parent 1:20 handle 20: sfq perturb 10
$TC filter add dev $INTERFACE parent 1:0 prio 0 protocol ip handle 20 fw flowid 1:20
#21 - HTTP/FTP out
$TC class add dev $INTERFACE parent 1:1 classid 1:21 htb rate 128kbit ceil 256kbit prio 2
$TC qdisc add dev $INTERFACE parent 1:21 handle 21: sfq perturb 10
$TC filter add dev $INTERFACE parent 1:0 prio 0 protocol ip handle 21 fw flowid 1:21
#22 - All cool.comp traffic
$TC class add dev $INTERFACE parent 1:1 classid 1:22 htb rate 128kbit ceil 256kbit prio 3
$TC qdisc add dev $INTERFACE parent 1:22 handle 22: sfq perturb 10
$TC filter add dev $INTERFACE parent 1:0 prio 0 protocol ip handle 22 fw flowid 1:22
#23 - All ian.comp traffic
$TC class add dev $INTERFACE parent 1:1 classid 1:23 htb rate 64kbit ceil 256kbit prio 4
$TC qdisc add dev $INTERFACE parent 1:23 handle 23: sfq perturb 10
$TC filter add dev $INTERFACE parent 1:0 prio 0 protocol ip handle 23 fw flowid 1:23
#24 - HTTP/FTP in
$TC class add dev $INTERFACE parent 1:1 classid 1:24 htb rate 64kbit ceil 256kbit prio 5
$TC qdisc add dev $INTERFACE parent 1:24 handle 24: sfq perturb 10
$TC filter add dev $INTERFACE parent 1:0 prio 0 protocol ip handle 24 fw flowid 1:24
#25 - Everything else
$TC class add dev $INTERFACE parent 1:1 classid 1:25 htb rate 20kbit ceil 64kbit prio 8
$TC qdisc add dev $INTERFACE parent 1:25 handle 25: sfq perturb 10
$TC filter add dev $INTERFACE parent 1:0 prio 0 protocol ip handle 25 fw flowid 1:25
Ill do some more tests and link to a rates graph when done.
It should illustrate the problem.
Thanks again,
Mark.
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [LARTC] Weighted packet shaping?
2004-12-21 3:55 [LARTC] Weighted packet shaping? Mark Williams (MWP)
` (5 preceding siblings ...)
2004-12-23 10:56 ` Mark Williams (MWP)
@ 2004-12-24 14:08 ` Andy Furniss
2004-12-24 15:19 ` Mark Williams (MWP)
` (10 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Andy Furniss @ 2004-12-24 14:08 UTC (permalink / raw)
To: lartc
Mark Williams (MWP) wrote:
>>For now try making a parent with rate and ceil 220kbit.
>>Have 4 child/leaf classes like - (assuming 1 is highest priority)
>>
>>class 1 rate 120 ceil 220 prio 0
>>class 2 rate 50 ceil 220 prio 1
>>class 3 rate 25 ceil 220 prio 2
>>class 4 rate 25 ceil 220 prio 3
>>
>>There are other tweaks you can try, it depends how much you care about
>>latency. You could also share the windows boxes bandwidth by IP.
>>
>>I don't do it quite like the above - so if it doesn't work, say and I'll
>>think again.
>
>
> Well im currently using:
>
> #root device
> $TC qdisc add dev $INTERFACE root handle 1: htb default 25
>
> #root class
> $TC class add dev $INTERFACE parent 1: classid 1:1 htb rate 256kbit
>
> #20 - ICMP, DNS, SYN, SSH
> $TC class add dev $INTERFACE parent 1:1 classid 1:20 htb rate 128kbit ceil 256kbit prio 1
> $TC qdisc add dev $INTERFACE parent 1:20 handle 20: sfq perturb 10
> $TC filter add dev $INTERFACE parent 1:0 prio 0 protocol ip handle 20 fw flowid 1:20
>
> #21 - HTTP/FTP out
> $TC class add dev $INTERFACE parent 1:1 classid 1:21 htb rate 128kbit ceil 256kbit prio 2
> $TC qdisc add dev $INTERFACE parent 1:21 handle 21: sfq perturb 10
> $TC filter add dev $INTERFACE parent 1:0 prio 0 protocol ip handle 21 fw flowid 1:21
>
> #22 - All cool.comp traffic
> $TC class add dev $INTERFACE parent 1:1 classid 1:22 htb rate 128kbit ceil 256kbit prio 3
> $TC qdisc add dev $INTERFACE parent 1:22 handle 22: sfq perturb 10
> $TC filter add dev $INTERFACE parent 1:0 prio 0 protocol ip handle 22 fw flowid 1:22
>
> #23 - All ian.comp traffic
> $TC class add dev $INTERFACE parent 1:1 classid 1:23 htb rate 64kbit ceil 256kbit prio 4
> $TC qdisc add dev $INTERFACE parent 1:23 handle 23: sfq perturb 10
> $TC filter add dev $INTERFACE parent 1:0 prio 0 protocol ip handle 23 fw flowid 1:23
>
> #24 - HTTP/FTP in
> $TC class add dev $INTERFACE parent 1:1 classid 1:24 htb rate 64kbit ceil 256kbit prio 5
> $TC qdisc add dev $INTERFACE parent 1:24 handle 24: sfq perturb 10
> $TC filter add dev $INTERFACE parent 1:0 prio 0 protocol ip handle 24 fw flowid 1:24
>
> #25 - Everything else
> $TC class add dev $INTERFACE parent 1:1 classid 1:25 htb rate 20kbit ceil 64kbit prio 8
> $TC qdisc add dev $INTERFACE parent 1:25 handle 25: sfq perturb 10
> $TC filter add dev $INTERFACE parent 1:0 prio 0 protocol ip handle 25 fw flowid 1:25
Try to make it look like I said - back off from 256 ceil, make rates add
up to master rate (220), give interactive more rate than it will ever need.
Class 24 does not make sense to me, and you may also find that ftp goes
to default - It can be hard to mark and I can't see how you are marking it.
Andy.
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [LARTC] Weighted packet shaping?
2004-12-21 3:55 [LARTC] Weighted packet shaping? Mark Williams (MWP)
` (6 preceding siblings ...)
2004-12-24 14:08 ` Andy Furniss
@ 2004-12-24 15:19 ` Mark Williams (MWP)
2004-12-24 16:36 ` Andy Furniss
` (9 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Mark Williams (MWP) @ 2004-12-24 15:19 UTC (permalink / raw)
To: lartc
> >>For now try making a parent with rate and ceil 220kbit.
> >>Have 4 child/leaf classes like - (assuming 1 is highest priority)
> >>
> >>class 1 rate 120 ceil 220 prio 0
> >>class 2 rate 50 ceil 220 prio 1
> >>class 3 rate 25 ceil 220 prio 2
> >>class 4 rate 25 ceil 220 prio 3
> >>
> >>There are other tweaks you can try, it depends how much you care about
> >>latency. You could also share the windows boxes bandwidth by IP.
> >>
> >>I don't do it quite like the above - so if it doesn't work, say and I'll
> >>think again.
> >
> > <snip>
>
>
> Try to make it look like I said - back off from 256 ceil, make rates add
> up to master rate (220), give interactive more rate than it will ever need.
Ok, im now trying:
class add dev $INTERFACE parent 1: classid 1:1 htb rate 220kbit
class add dev $INTERFACE parent 1:1 classid 1:20 htb rate 70kbit ceil 220kbit prio 1
class add dev $INTERFACE parent 1:1 classid 1:21 htb rate 50kbit ceil 220kbit prio 2
class add dev $INTERFACE parent 1:1 classid 1:22 htb rate 25kbit ceil 220kbit prio 3
class add dev $INTERFACE parent 1:1 classid 1:23 htb rate 25kbit ceil 220kbit prio 4
class add dev $INTERFACE parent 1:1 classid 1:24 htb rate 25kbit ceil 220kbit prio 5
class add dev $INTERFACE parent 1:1 classid 1:25 htb rate 25kbit ceil 220kbit prio 8
Its simply not working.
Bittorrent is using ~22kb/sec on class 25, leaving the FTP upload (class 22)
sitting on only ~3kb/sec.
Any ideas?
Thanks!
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [LARTC] Weighted packet shaping?
2004-12-21 3:55 [LARTC] Weighted packet shaping? Mark Williams (MWP)
` (7 preceding siblings ...)
2004-12-24 15:19 ` Mark Williams (MWP)
@ 2004-12-24 16:36 ` Andy Furniss
2004-12-26 4:38 ` Mark Williams (MWP)
` (8 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Andy Furniss @ 2004-12-24 16:36 UTC (permalink / raw)
To: lartc
Mark Williams (MWP) wrote:
>>>>For now try making a parent with rate and ceil 220kbit.
>>>>Have 4 child/leaf classes like - (assuming 1 is highest priority)
>>>>
>>>>class 1 rate 120 ceil 220 prio 0
>>>>class 2 rate 50 ceil 220 prio 1
>>>>class 3 rate 25 ceil 220 prio 2
>>>>class 4 rate 25 ceil 220 prio 3
>>>>
>>>>There are other tweaks you can try, it depends how much you care about
>>>>latency. You could also share the windows boxes bandwidth by IP.
>>>>
>>>>I don't do it quite like the above - so if it doesn't work, say and I'll
>>>>think again.
>>>
>>> <snip>
>>
>>
>>Try to make it look like I said - back off from 256 ceil, make rates add
>>up to master rate (220), give interactive more rate than it will ever need.
>
>
> Ok, im now trying:
>
> class add dev $INTERFACE parent 1: classid 1:1 htb rate 220kbit
> class add dev $INTERFACE parent 1:1 classid 1:20 htb rate 70kbit ceil 220kbit prio 1
> class add dev $INTERFACE parent 1:1 classid 1:21 htb rate 50kbit ceil 220kbit prio 2
> class add dev $INTERFACE parent 1:1 classid 1:22 htb rate 25kbit ceil 220kbit prio 3
> class add dev $INTERFACE parent 1:1 classid 1:23 htb rate 25kbit ceil 220kbit prio 4
> class add dev $INTERFACE parent 1:1 classid 1:24 htb rate 25kbit ceil 220kbit prio 5
> class add dev $INTERFACE parent 1:1 classid 1:25 htb rate 25kbit ceil 220kbit prio 8
>
> Its simply not working.
> Bittorrent is using ~22kb/sec on class 25, leaving the FTP upload (class 22)
> sitting on only ~3kb/sec.
>
> Any ideas?
Are you sure that FTP is going to class 22 and not default -
tc -s qdisc ls dev $INTERFACE or tc -s class ls dev $INTERFACE will show
counters.
Andy.
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [LARTC] Weighted packet shaping?
2004-12-21 3:55 [LARTC] Weighted packet shaping? Mark Williams (MWP)
` (8 preceding siblings ...)
2004-12-24 16:36 ` Andy Furniss
@ 2004-12-26 4:38 ` Mark Williams (MWP)
2004-12-26 13:09 ` Andy Furniss
` (7 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Mark Williams (MWP) @ 2004-12-26 4:38 UTC (permalink / raw)
To: lartc
> Mark Williams (MWP) wrote:
> >>>>For now try making a parent with rate and ceil 220kbit.
> >>>>Have 4 child/leaf classes like - (assuming 1 is highest priority)
> >>>>
> >>>>class 1 rate 120 ceil 220 prio 0
> >>>>class 2 rate 50 ceil 220 prio 1
> >>>>class 3 rate 25 ceil 220 prio 2
> >>>>class 4 rate 25 ceil 220 prio 3
> >>>>
> >>>>There are other tweaks you can try, it depends how much you care about
> >>>>latency. You could also share the windows boxes bandwidth by IP.
> >>>>
> >>>>I don't do it quite like the above - so if it doesn't work, say and
> >>>>I'll think again.
> >>>
> >>><snip>
> >>
> >>
> >>Try to make it look like I said - back off from 256 ceil, make rates add
> >>up to master rate (220), give interactive more rate than it will ever
> >>need.
> >
> >
> >Ok, im now trying:
> >
> >class add dev $INTERFACE parent 1: classid 1:1 htb rate 220kbit
> >class add dev $INTERFACE parent 1:1 classid 1:20 htb rate 70kbit ceil
> >220kbit prio 1
> >class add dev $INTERFACE parent 1:1 classid 1:21 htb rate 50kbit ceil
> >220kbit prio 2
> >class add dev $INTERFACE parent 1:1 classid 1:22 htb rate 25kbit ceil
> >220kbit prio 3
> >class add dev $INTERFACE parent 1:1 classid 1:23 htb rate 25kbit ceil
> >220kbit prio 4
> >class add dev $INTERFACE parent 1:1 classid 1:24 htb rate 25kbit ceil
> >220kbit prio 5
> >class add dev $INTERFACE parent 1:1 classid 1:25 htb rate 25kbit ceil
> >220kbit prio 8
> >
> >Its simply not working.
> >Bittorrent is using ~22kb/sec on class 25, leaving the FTP upload (class
> >22)
> >sitting on only ~3kb/sec.
> >
> >Any ideas?
>
>
> Are you sure that FTP is going to class 22 and not default -
>
> tc -s qdisc ls dev $INTERFACE or tc -s class ls dev $INTERFACE will show
> counters.
I am.
I graph using "tc -s qdisc show dev ppp0" with rrdtool.
Thanks,
Mark.
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [LARTC] Weighted packet shaping?
2004-12-21 3:55 [LARTC] Weighted packet shaping? Mark Williams (MWP)
` (9 preceding siblings ...)
2004-12-26 4:38 ` Mark Williams (MWP)
@ 2004-12-26 13:09 ` Andy Furniss
2004-12-28 9:35 ` Mark Williams (MWP)
` (6 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Andy Furniss @ 2004-12-26 13:09 UTC (permalink / raw)
To: lartc
Mark Williams (MWP) wrote:
>>
>>Are you sure that FTP is going to class 22 and not default -
>>
>>tc -s qdisc ls dev $INTERFACE or tc -s class ls dev $INTERFACE will show
>>counters.
>
>
> I am.
> I graph using "tc -s qdisc show dev ppp0" with rrdtool.
Ahh, I assume you patched and recompiled your 2.6.8.1.
I just tried the script below on 2.4.24 and 2.6.8.1 and it works as I
expect.
I checked rates with iptraf and tc -s class ls dev ppp0. If you use
htb's rate counter than be aware it uses a long average >60 sec and I
notice that on my 2.6.8.1 setup it says bit where it probably should say
bps (= bytes per sec).
Does it work for you ?
If you want to graph then add some queues.
Andy.
TC=/sbin/tc
IPTABLES=/usr/local/sbin/iptables
$IPTABLES -t mangle -D POSTROUTING -o ppp0 -p tcp --src 192.168.0.2 -j
MARK --set-mark 21 &>/dev/null
$IPTABLES -t mangle -D POSTROUTING -o ppp0 -p tcp --src 192.168.0.3 -j
MARK --set-mark 22 &>/dev/null
$IPTABLES -t mangle -D POSTROUTING -o ppp0 -p ! tcp -j MARK --set-mark
20 &>/dev/null
$IPTABLES -t mangle -D POSTROUTING -o ppp0 -p tcp -m length --length
:128 -j MARK --set-mark 20 &>/dev/null
$TC qdisc del dev ppp0 root &>/dev/null
if ( [ "$1" = "stop" ] )
then
exit
fi
$TC qdisc add dev ppp0 root handle 1: htb default 23
$TC class add dev ppp0 parent 1: classid 1:1 htb rate 220kbit
$TC class add dev ppp0 parent 1:1 classid 1:20 htb rate 120kbit ceil
220kbit prio 1
$TC class add dev ppp0 parent 1:1 classid 1:21 htb rate 50kbit ceil
220kbit prio 2
$TC class add dev ppp0 parent 1:1 classid 1:22 htb rate 25kbit ceil
220kbit prio 3
$TC class add dev ppp0 parent 1:1 classid 1:23 htb rate 25kbit ceil
220kbit prio 4
$TC filter add dev ppp0 parent 1:0 prio 0 protocol ip handle 20 fw
flowid 1:20
$TC filter add dev ppp0 parent 1:0 prio 1 protocol ip handle 21 fw
flowid 1:21
$TC filter add dev ppp0 parent 1:0 prio 2 protocol ip handle 22 fw
flowid 1:22
$IPTABLES -t mangle -A POSTROUTING -o ppp0 -p tcp --src 192.168.0.2 -j
MARK --set-mark 21
$IPTABLES -t mangle -A POSTROUTING -o ppp0 -p tcp --src 192.168.0.3 -j
MARK --set-mark 22
$IPTABLES -t mangle -A POSTROUTING -o ppp0 -p ! tcp -j MARK --set-mark 20
$IPTABLES -t mangle -A POSTROUTING -o ppp0 -p tcp -m length --length
:128 -j MARK --set-mark 20
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [LARTC] Weighted packet shaping?
2004-12-21 3:55 [LARTC] Weighted packet shaping? Mark Williams (MWP)
` (10 preceding siblings ...)
2004-12-26 13:09 ` Andy Furniss
@ 2004-12-28 9:35 ` Mark Williams (MWP)
2004-12-29 2:46 ` Andy Furniss
` (5 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Mark Williams (MWP) @ 2004-12-28 9:35 UTC (permalink / raw)
To: lartc
> Mark Williams (MWP) wrote:
>
> >>
> >>Are you sure that FTP is going to class 22 and not default -
> >>
> >>tc -s qdisc ls dev $INTERFACE or tc -s class ls dev $INTERFACE will show
> >>counters.
> >
> >
> >I am. I graph using "tc -s qdisc show dev ppp0" with rrdtool.
>
> Ahh, I assume you patched and recompiled your 2.6.8.1.
>
> I just tried the script below on 2.4.24 and 2.6.8.1 and it works as I expect.
>
> I checked rates with iptraf and tc -s class ls dev ppp0. If you use htb's rate
> counter than be aware it uses a long average >60 sec and I notice that on my
> 2.6.8.1 setup it says bit where it probably should say bps (= bytes per sec).
>
> Does it work for you ?
>
> If you want to graph then add some queues.
>
> Andy.
Ok...
Using your script gave the following (from 17:30 onwards):
http://www.overclockers.com.au/~mwp/temp/tc-1hour-yours.png
Purple is class 23; all other traffic, in this case bittorrent.
Blue is class 21; a windows box, in this case an FTP transfer.
Shouldnt class 23 still be dropping off further than that?
It seems HTB is wanting to share traffic equally among on the classes rather than by priority.
You script is pretty much having the same effect as mine :(
BTW... this is now with kernel 2.6.10, not that seems to have changed its behaviour.
Thanks again!
Mark Williams.
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [LARTC] Weighted packet shaping?
2004-12-21 3:55 [LARTC] Weighted packet shaping? Mark Williams (MWP)
` (11 preceding siblings ...)
2004-12-28 9:35 ` Mark Williams (MWP)
@ 2004-12-29 2:46 ` Andy Furniss
2004-12-29 6:52 ` Mark Williams (MWP)
` (4 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Andy Furniss @ 2004-12-29 2:46 UTC (permalink / raw)
To: lartc
Mark Williams (MWP) wrote:
> Ok...
> Using your script gave the following (from 17:30 onwards):
>
> http://www.overclockers.com.au/~mwp/temp/tc-1hour-yours.png
>
This is strange I just tested again and it works for me.
http://www.jessingale.dsl.pipex.com/tc-speed-1.png
Blue is lowest with rate 20kbit green next low with 40kbit Red highest.
It may be worth trying with ceils even lower - just incase you get radsl
adaption and don't really have the bandwidth.
I suppose you should also use tc from new iproute2 that matches your kernel.
rrdtool seems complicated - I suppose it could be averaging strangely, I
used -
#set -x
/usr/local/rrdtool-1.0.49/bin/rrdtool create tcstats1.rrd --step 10 \
DS:cls21:COUNTER:30:U:U \
DS:cls22:COUNTER:30:U:U \
DS:cls23:COUNTER:30:U:U \
RRA:AVERAGE:0.5:1:100
while [ 1 ]
do
C21=`tc -s qdisc ls dev ppp0 | grep "21:" -A 1 | grep Sent |
awk '{print $2}'`
C22=`tc -s qdisc ls dev ppp0 | grep "22:" -A 1 | grep Sent |
awk '{print $2}'`
C23=`tc -s qdisc ls dev ppp0 | grep "23:" -A 1 | grep Sent |
awk '{print $2}'`
/usr/local/rrdtool-1.0.49/bin/rrdtool update tcstats1.rrd
N:$C21:$C22:$C23
sleep 10
done
Andy.
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [LARTC] Weighted packet shaping?
2004-12-21 3:55 [LARTC] Weighted packet shaping? Mark Williams (MWP)
` (12 preceding siblings ...)
2004-12-29 2:46 ` Andy Furniss
@ 2004-12-29 6:52 ` Mark Williams (MWP)
2004-12-29 13:26 ` Francisco Pereira
` (3 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Mark Williams (MWP) @ 2004-12-29 6:52 UTC (permalink / raw)
To: lartc
> >Ok...
> >Using your script gave the following (from 17:30 onwards):
> >
> >http://www.overclockers.com.au/~mwp/temp/tc-1hour-yours.png
>
> This is strange I just tested again and it works for me.
>
> http://www.jessingale.dsl.pipex.com/tc-speed-1.png
>
> Blue is lowest with rate 20kbit green next low with 40kbit Red highest.
The result your getting is exactly what im after.
So whats different with what im doing... hrm.
> It may be worth trying with ceils even lower - just incase you get radsl
> adaption and don't really have the bandwidth.
Nah, i have firm 256kbit up.
> I suppose you should also use tc from new iproute2 that matches your kernel.
Ok, where is the correct place to get it from?
I havnt been able to find the official "release site" for iproute2.
> rrdtool seems complicated - I suppose it could be averaging strangely, I
> used -
>
> #set -x
> /usr/local/rrdtool-1.0.49/bin/rrdtool create tcstats1.rrd --step 10 \
> DS:cls21:COUNTER:30:U:U \
> DS:cls22:COUNTER:30:U:U \
> DS:cls23:COUNTER:30:U:U \
> RRA:AVERAGE:0.5:1:100
>
> while [ 1 ]
> do
> C21=`tc -s qdisc ls dev ppp0 | grep "21:" -A 1 | grep Sent |
> awk '{print $2}'`
> C22=`tc -s qdisc ls dev ppp0 | grep "22:" -A 1 | grep Sent |
> awk '{print $2}'`
> C23=`tc -s qdisc ls dev ppp0 | grep "23:" -A 1 | grep Sent |
> awk '{print $2}'`
> /usr/local/rrdtool-1.0.49/bin/rrdtool update tcstats1.rrd
> N:$C21:$C22:$C23
> sleep 10
> done
Thats very similar to what im doing, nothing too complex about it.
I also know the graph is correct as the estimated rates from TC are the same as
shown on the graph.
So this is becoming an unknown problem?
Thanks.
Mark Williams.
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [LARTC] Weighted packet shaping?
2004-12-21 3:55 [LARTC] Weighted packet shaping? Mark Williams (MWP)
` (13 preceding siblings ...)
2004-12-29 6:52 ` Mark Williams (MWP)
@ 2004-12-29 13:26 ` Francisco Pereira
2004-12-30 0:05 ` Andy Furniss
` (2 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Francisco Pereira @ 2004-12-29 13:26 UTC (permalink / raw)
To: lartc
Mensaje citado por "Mark Williams (MWP)" <mwp@internode.on.net>:
> > I suppose you should also use tc from new iproute2 that matches your
> kernel.
>
> Ok, where is the correct place to get it from?
> I havnt been able to find the official "release site" for iproute2.
>
http://developer.osdl.org/dev/iproute2/
Regards,
Francisco.
-------------------------------------------------------------
La Tienda del Portal esta de fiesta!
http://tienda.montevideo.com.uy
-------------------------------------------------------------
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [LARTC] Weighted packet shaping?
2004-12-21 3:55 [LARTC] Weighted packet shaping? Mark Williams (MWP)
` (14 preceding siblings ...)
2004-12-29 13:26 ` Francisco Pereira
@ 2004-12-30 0:05 ` Andy Furniss
2005-01-03 11:22 ` marco ghidinelli
2005-01-04 13:57 ` Andy Furniss
17 siblings, 0 replies; 19+ messages in thread
From: Andy Furniss @ 2004-12-30 0:05 UTC (permalink / raw)
To: lartc
Mark Williams (MWP) wrote:
> I also know the graph is correct as the estimated rates from TC are the same as
> shown on the graph.
>
> So this is becoming an unknown problem?
There must be something :-)
One thing I thought of, if you are getting any congestion/packet loss on
the ftp upload, then you would expect results more like you see.
I would take a closer look at what is happening to the upload connection.
You could get an idea of whether you are dropping by doing some netstat
-s | grep retrans on the box running the upload.
You could also do a tcpdump to look at what window the server is letting
you use / see drops.
Looking at backlogs with tc -s class ... should show the FTP class as
backloged all the time - if it's empty(not there) sometimes then that's
another sign that something else is limiting it.
Andy.
>
> Thanks.
> Mark Williams.
>
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [LARTC] Weighted packet shaping?
2004-12-21 3:55 [LARTC] Weighted packet shaping? Mark Williams (MWP)
` (15 preceding siblings ...)
2004-12-30 0:05 ` Andy Furniss
@ 2005-01-03 11:22 ` marco ghidinelli
2005-01-04 13:57 ` Andy Furniss
17 siblings, 0 replies; 19+ messages in thread
From: marco ghidinelli @ 2005-01-03 11:22 UTC (permalink / raw)
To: lartc
On Tue, Dec 28, 2004 at 07:53:43PM +1030, Mark Williams (MWP) wrote:
>
> Ok...
> Using your script gave the following (from 17:30 onwards):
>
> http://www.overclockers.com.au/~mwp/temp/tc-1hour-yours.png
>
> Purple is class 23; all other traffic, in this case bittorrent.
> Blue is class 21; a windows box, in this case an FTP transfer.
>
> Shouldnt class 23 still be dropping off further than that?
> It seems HTB is wanting to share traffic equally among on the classes rather than by priority.
>
> You script is pretty much having the same effect as mine :(
ok, maybe i'm wrong, but i try to run the same script, and i think that
the script have problem setting prio 0 on filters:
running:
$TC filter add dev $IFNAME parent 1:0 prio 0 protocol ip handle 22 fw
flowid 1:20
$TC filter add dev $IFNAME parent 1:0 prio 2 protocol ip handle 21 fw
flowid 1:21
gave me:
# tc filter list dev eth0
filter parent 1: protocol ip pref 2 fw
filter parent 1: protocol ip pref 2 fw handle 0x15 classid 1:21
filter parent 1: protocol ip pref 49152 fw
filter parent 1: protocol ip pref 49152 fw handle 0x16 classid 1:20
----------------------------------^^^^^
don't blame me if this is obvious/wrong/stupid. :)
2.6.10, with lastest iproute2
--
BOFH excuse #212:
Of course it doesn't work. We've performed a software upgrade.
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [LARTC] Weighted packet shaping?
2004-12-21 3:55 [LARTC] Weighted packet shaping? Mark Williams (MWP)
` (16 preceding siblings ...)
2005-01-03 11:22 ` marco ghidinelli
@ 2005-01-04 13:57 ` Andy Furniss
17 siblings, 0 replies; 19+ messages in thread
From: Andy Furniss @ 2005-01-04 13:57 UTC (permalink / raw)
To: lartc
marco ghidinelli wrote:
>
> ok, maybe i'm wrong, but i try to run the same script, and i think that
> the script have problem setting prio 0 on filters:
>
> running:
>
> $TC filter add dev $IFNAME parent 1:0 prio 0 protocol ip handle 22 fw
> flowid 1:20
> $TC filter add dev $IFNAME parent 1:0 prio 2 protocol ip handle 21 fw
> flowid 1:21
>
> gave me:
>
> # tc filter list dev eth0
> filter parent 1: protocol ip pref 2 fw
> filter parent 1: protocol ip pref 2 fw handle 0x15 classid 1:21
> filter parent 1: protocol ip pref 49152 fw
> filter parent 1: protocol ip pref 49152 fw handle 0x16 classid 1:20
>
> ----------------------------------^^^^^
>
> don't blame me if this is obvious/wrong/stupid. :)
Well spotted - you are right, I see the same, so it looks like 0 is not
the highest prio when used on filters - I shall use 1 in future.
As for affecting this test - I don't think it will make any difference
in this case because it just affects the order that the matches get
tested against the packets. With only 3 tests and low packets/sec it
should makes no difference.
It's still usefull to know for other setups, though - thanks.
Andy.
>
> 2.6.10, with lastest iproute2
>
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2005-01-04 13:57 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-21 3:55 [LARTC] Weighted packet shaping? Mark Williams (MWP)
2004-12-22 4:53 ` Mark Williams (MWP)
2004-12-22 9:07 ` Ed Wildgoose
2004-12-22 13:49 ` Andy Furniss
2004-12-22 15:48 ` Mark Williams (MWP)
2004-12-22 22:54 ` Andy Furniss
2004-12-23 10:56 ` Mark Williams (MWP)
2004-12-24 14:08 ` Andy Furniss
2004-12-24 15:19 ` Mark Williams (MWP)
2004-12-24 16:36 ` Andy Furniss
2004-12-26 4:38 ` Mark Williams (MWP)
2004-12-26 13:09 ` Andy Furniss
2004-12-28 9:35 ` Mark Williams (MWP)
2004-12-29 2:46 ` Andy Furniss
2004-12-29 6:52 ` Mark Williams (MWP)
2004-12-29 13:26 ` Francisco Pereira
2004-12-30 0:05 ` Andy Furniss
2005-01-03 11:22 ` marco ghidinelli
2005-01-04 13:57 ` Andy Furniss
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.