* [LARTC] HTB problem
@ 2001-12-11 2:46 yangrunhua
2001-12-11 9:21 ` bert hubert
` (33 more replies)
0 siblings, 34 replies; 41+ messages in thread
From: yangrunhua @ 2001-12-11 2:46 UTC (permalink / raw)
To: lartc
[-- Attachment #1: Type: text/plain, Size: 159 bytes --]
tc class add dev eth1 parent 1: classid 1:1 htb rate 10kbps ceil 10kbps
burst 2k
why the client run into 1:1 can keep 430 KB/s ?
PC+ patch HTB + linux2.4.16
[-- Attachment #2: Type: text/html, Size: 5109 bytes --]
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [LARTC] HTB problem
2001-12-11 2:46 [LARTC] HTB problem yangrunhua
@ 2001-12-11 9:21 ` bert hubert
2001-12-11 9:34 ` yangrunhua
` (32 subsequent siblings)
33 siblings, 0 replies; 41+ messages in thread
From: bert hubert @ 2001-12-11 9:21 UTC (permalink / raw)
To: lartc
On Tue, Dec 11, 2001 at 10:46:08AM +0800, yangrunhua wrote:
> tc class add dev eth1 parent 1: classid 1:1 htb rate 10kbps ceil 10kbps
> burst 2k
> why the client run into 1:1 can keep 430 KB/s ?
Show your entire configuration, please.
Regards,
bert hubert
--
http://www.PowerDNS.com Versatile DNS Software & Services
Trilab The Technology People
Netherlabs BV / Rent-a-Nerd.nl - Nerd Available -
'SYN! .. SYN|ACK! .. ACK!' - the mating call of the internet
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/lartc/
^ permalink raw reply [flat|nested] 41+ messages in thread
* RE: [LARTC] HTB problem
2001-12-11 2:46 [LARTC] HTB problem yangrunhua
2001-12-11 9:21 ` bert hubert
@ 2001-12-11 9:34 ` yangrunhua
2001-12-11 9:35 ` yangrunhua
` (31 subsequent siblings)
33 siblings, 0 replies; 41+ messages in thread
From: yangrunhua @ 2001-12-11 9:34 UTC (permalink / raw)
To: lartc
tc qdisc add dev eth0 root handle 1: htb default 2
tc class add dev eth0 parent 1: classid 1:1 htb rate 5kbps ceil 5kbps
burst 2k tc class add dev eth0 parent 1: classid 1:2 htb rate 10mbps
ceil 10mbps burst 2k
tc filter add dev eth0 protocol ip fw
and use iptables to mark every packet 0x10001,but up to 200KB/s. # tc
-s -d qdisc qdisc htb 1: dev eth0 r2q 10 default 2 dcache 0
deq_util 1/1000000 deq_rate 10 trials_per_deq 0 dcache_hits 0
Sent 1213554 bytes 13996 pkts (dropped 0, overlimits 3924)
# tc -s -d class show dev eth0
class htb 1:1 root prio 0 rate 40Kbit ceil 40Kbit burst 2Kb/8 mpu 0b
cburst 2Kb
Sent 209473 bytes 3364 pkts (dropped 0, overlimits 3367)
rate 73bps 1pps
lended: 3364 borrowed: 0 giants: 0 injects: 0
tokens: 316161 ctokens: 316161
class htb 1:2 root prio 0 rate 80Mbit ceil 80Mbit burst 2Kb/8 mpu 0b
cburst 2Kb Sent 1011846 bytes 10712 pkts (dropped 0, overlimits 151)
rate 258bps 1pps
lended: 10712 borrowed: 0 giants: 0 injects: 0
tokens: 155 ctokens: 155
why?
PII400 + 64M + 2.4.16
-----Original Message-----
From: lartc-admin@mailman.ds9a.nl [mailto:lartc-admin@mailman.ds9a.nl]
On Behalf Of bert hubert
Sent: 2001Äê12ÔÂ11ÈÕ 17:21
To: lartc@mailman.ds9a.nl
Subject: Re: [LARTC] HTB problem
On Tue, Dec 11, 2001 at 10:46:08AM +0800, yangrunhua wrote:
> tc class add dev eth1 parent 1: classid 1:1 htb rate 10kbps ceil
10kbps
> burst 2k
> why the client run into 1:1 can keep 430 KB/s ?
Show your entire configuration, please.
Regards,
bert hubert
--
http://www.PowerDNS.com Versatile DNS Software & Services
Trilab The Technology People
Netherlabs BV / Rent-a-Nerd.nl - Nerd Available -
'SYN! .. SYN|ACK! .. ACK!' - the mating call of the internet
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO:
http://ds9a.nl/lartc/
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/lartc/
^ permalink raw reply [flat|nested] 41+ messages in thread
* RE: [LARTC] HTB problem
2001-12-11 2:46 [LARTC] HTB problem yangrunhua
2001-12-11 9:21 ` bert hubert
2001-12-11 9:34 ` yangrunhua
@ 2001-12-11 9:35 ` yangrunhua
2001-12-11 11:10 ` bert hubert
` (30 subsequent siblings)
33 siblings, 0 replies; 41+ messages in thread
From: yangrunhua @ 2001-12-11 9:35 UTC (permalink / raw)
To: lartc
Sorry,forget sth.
Ifconfig sees:
RX bytes:22970234 (21.9 Mb) TX bytes:1741892 (1.6 Mb)
But:
# tc -s -d qdisc
qdisc htb 1: dev eth0 r2q 10 default 2 dcache 0
deq_util 1/1000000 deq_rate 11 trials_per_deq 0 dcache_hits 0 Sent
1301198 bytes 14448 pkts (dropped 0, overlimits 3944)
Why?
-----Original Message-----
From: lartc-admin@mailman.ds9a.nl [mailto:lartc-admin@mailman.ds9a.nl]
On Behalf Of bert hubert
Sent: 2001Äê12ÔÂ11ÈÕ 17:21
To: lartc@mailman.ds9a.nl
Subject: Re: [LARTC] HTB problem
On Tue, Dec 11, 2001 at 10:46:08AM +0800, yangrunhua wrote:
> tc class add dev eth1 parent 1: classid 1:1 htb rate 10kbps ceil
10kbps
> burst 2k
> why the client run into 1:1 can keep 430 KB/s ?
Show your entire configuration, please.
Regards,
bert hubert
--
http://www.PowerDNS.com Versatile DNS Software & Services
Trilab The Technology People
Netherlabs BV / Rent-a-Nerd.nl - Nerd Available -
'SYN! .. SYN|ACK! .. ACK!' - the mating call of the internet
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO:
http://ds9a.nl/lartc/
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/lartc/
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [LARTC] HTB problem
2001-12-11 2:46 [LARTC] HTB problem yangrunhua
` (2 preceding siblings ...)
2001-12-11 9:35 ` yangrunhua
@ 2001-12-11 11:10 ` bert hubert
2001-12-12 5:47 ` yangrunhua
` (29 subsequent siblings)
33 siblings, 0 replies; 41+ messages in thread
From: bert hubert @ 2001-12-11 11:10 UTC (permalink / raw)
To: lartc
On Tue, Dec 11, 2001 at 05:34:22PM +0800, yangrunhua wrote:
> tc qdisc add dev eth0 root handle 1: htb default 2
> tc class add dev eth0 parent 1: classid 1:1 htb rate 5kbps ceil 5kbps
> burst 2k tc class add dev eth0 parent 1: classid 1:2 htb rate 10mbps
> ceil 10mbps burst 2k
> tc filter add dev eth0 protocol ip fw
I still have a very hard time figuring out your configuration. Please list
the following:
* your iptables commands
* your tc qdisc add commands
* your tc class add commands
* what kind of traffic you are generating
Thanks.
--
http://www.PowerDNS.com Versatile DNS Software & Services
Trilab The Technology People
Netherlabs BV / Rent-a-Nerd.nl - Nerd Available -
'SYN! .. SYN|ACK! .. ACK!' - the mating call of the internet
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/lartc/
^ permalink raw reply [flat|nested] 41+ messages in thread
* RE: [LARTC] HTB problem
2001-12-11 2:46 [LARTC] HTB problem yangrunhua
` (3 preceding siblings ...)
2001-12-11 11:10 ` bert hubert
@ 2001-12-12 5:47 ` yangrunhua
2001-12-12 10:02 ` yangrunhua
` (28 subsequent siblings)
33 siblings, 0 replies; 41+ messages in thread
From: yangrunhua @ 2001-12-12 5:47 UTC (permalink / raw)
To: lartc
Now, I know the where the problem is.
If I already use SNAT, how could I limit the inbound bandwidth of
Every intra-network ip protected by SNAT( with the help of iptables
nfmark)?
But mangle at PREROUTING goes before NAT translate.
Is there any method?
Thanks.
-----Original Message-----
From: bert hubert [mailto:ahu@ds9a.nl]
Sent: 2001Äê12ÔÂ11ÈÕ 19:10
To: yangrunhua
Cc: lartc@mailman.ds9a.nl
Subject: Re: [LARTC] HTB problem
On Tue, Dec 11, 2001 at 05:34:22PM +0800, yangrunhua wrote:
> tc qdisc add dev eth0 root handle 1: htb default 2
> tc class add dev eth0 parent 1: classid 1:1 htb rate 5kbps ceil 5kbps
> burst 2k tc class add dev eth0 parent 1: classid 1:2 htb rate 10mbps
> ceil 10mbps burst 2k
> tc filter add dev eth0 protocol ip fw
I still have a very hard time figuring out your configuration. Please
list
the following:
* your iptables commands
* your tc qdisc add commands
* your tc class add commands
* what kind of traffic you are generating
Thanks.
--
http://www.PowerDNS.com Versatile DNS Software & Services
Trilab The Technology People
Netherlabs BV / Rent-a-Nerd.nl - Nerd Available -
'SYN! .. SYN|ACK! .. ACK!' - the mating call of the internet
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/lartc/
^ permalink raw reply [flat|nested] 41+ messages in thread
* RE: [LARTC] HTB problem
2001-12-11 2:46 [LARTC] HTB problem yangrunhua
` (4 preceding siblings ...)
2001-12-12 5:47 ` yangrunhua
@ 2001-12-12 10:02 ` yangrunhua
2001-12-12 11:40 ` Martin Devera
` (27 subsequent siblings)
33 siblings, 0 replies; 41+ messages in thread
From: yangrunhua @ 2001-12-12 10:02 UTC (permalink / raw)
To: lartc
I could manage it now, modified the netfilter src, add another table not
mangle,
Which runs after NAT_SRC. :-)
Another problem: We know HTB is a tree structure, does it permit to jump
to the
leaf directly?(I use cls_fw which attached to the root, and with no
options, so cls_fw would use nfmark of skb as classid and jump directly
into leaf, no traverse)
but when I use these:
tc qdisc add dev eth0 root handle 1: htb default 12
tc class add dev eth0 parent 1: classid 1:1 htb rate 100kbps ceil
100kbps burst 2k
tc class add dev eth0 parent 1:1 classid 1:10 htb rate 30kbps ceil
100kbps burst 2k
tc class add dev eth0 parent 1:1 classid 1:11 htb rate 10kbps ceil
100kbps burst 2k
tc class add dev eth0 parent 1:1 classid 1:12 htb rate 60kbps ceil
100kbps burst 2k
tc filter add dev eth0 protocol ip fw
that, packets marked with 0x1000a don't jump into 1:10, why?
But when I use these:
tc qdisc add dev eth0 root handle 1: htb default 2
tc class add dev eth0 parent 1: classid 1:1 htb rate 5kbps ceil 5kbps
burst 2k
tc class add dev eth0 parent 1: classid 1:2 htb rate 10kbps ceil 10kbps
burst 2k
tc filter add dev eth0 protocol ip fw
in this situation, packets marked with 0x10001 succeeded in jumping into
1:1.
Why?
-----Original Message-----
From: lartc-admin@mailman.ds9a.nl [mailto:lartc-admin@mailman.ds9a.nl]
On Behalf Of yangrunhua
Sent: 2001年12月12日 13:47
To: lartc@mailman.ds9a.nl
Subject: RE: [LARTC] HTB problem
Now, I know the where the problem is.
If I already use SNAT, how could I limit the inbound bandwidth of
Every intra-network ip protected by SNAT( with the help of iptables
nfmark)?
But mangle at PREROUTING goes before NAT translate.
Is there any method?
Thanks.
-----Original Message-----
From: bert hubert [mailto:ahu@ds9a.nl]
Sent: 2001年12月11日 19:10
To: yangrunhua
Cc: lartc@mailman.ds9a.nl
Subject: Re: [LARTC] HTB problem
On Tue, Dec 11, 2001 at 05:34:22PM +0800, yangrunhua wrote:
> tc qdisc add dev eth0 root handle 1: htb default 2
> tc class add dev eth0 parent 1: classid 1:1 htb rate 5kbps ceil 5kbps
> burst 2k tc class add dev eth0 parent 1: classid 1:2 htb rate 10mbps
> ceil 10mbps burst 2k
> tc filter add dev eth0 protocol ip fw
I still have a very hard time figuring out your configuration. Please
list
the following:
* your iptables commands
* your tc qdisc add commands
* your tc class add commands
* what kind of traffic you are generating
Thanks.
--
http://www.PowerDNS.com Versatile DNS Software & Services
Trilab The Technology People
Netherlabs BV / Rent-a-Nerd.nl - Nerd Available -
'SYN! .. SYN|ACK! .. ACK!' - the mating call of the internet
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO:
http://ds9a.nl/lartc/
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/lartc/
^ permalink raw reply [flat|nested] 41+ messages in thread
* RE: [LARTC] HTB problem
2001-12-11 2:46 [LARTC] HTB problem yangrunhua
` (5 preceding siblings ...)
2001-12-12 10:02 ` yangrunhua
@ 2001-12-12 11:40 ` Martin Devera
2001-12-12 13:50 ` bert hubert
` (26 subsequent siblings)
33 siblings, 0 replies; 41+ messages in thread
From: Martin Devera @ 2001-12-12 11:40 UTC (permalink / raw)
To: lartc
try replace 0x0001000a by 0x00010010. IIRC in 1:10
the "10" is in hex.
devik
On Wed, 12 Dec 2001, yangrunhua wrote:
> I could manage it now, modified the netfilter src, add another table not
> mangle,
> Which runs after NAT_SRC. :-)
> Another problem: We know HTB is a tree structure, does it permit to jump
> to the
> leaf directly?(I use cls_fw which attached to the root, and with no
> options, so cls_fw would use nfmark of skb as classid and jump directly
> into leaf, no traverse)
>
> but when I use these:
> tc qdisc add dev eth0 root handle 1: htb default 12
> tc class add dev eth0 parent 1: classid 1:1 htb rate 100kbps ceil
> 100kbps burst 2k
> tc class add dev eth0 parent 1:1 classid 1:10 htb rate 30kbps ceil
> 100kbps burst 2k
> tc class add dev eth0 parent 1:1 classid 1:11 htb rate 10kbps ceil
> 100kbps burst 2k
> tc class add dev eth0 parent 1:1 classid 1:12 htb rate 60kbps ceil
> 100kbps burst 2k
> tc filter add dev eth0 protocol ip fw
>
> that, packets marked with 0x1000a don't jump into 1:10, why?
> But when I use these:
> tc qdisc add dev eth0 root handle 1: htb default 2
> tc class add dev eth0 parent 1: classid 1:1 htb rate 5kbps ceil 5kbps
> burst 2k
> tc class add dev eth0 parent 1: classid 1:2 htb rate 10kbps ceil 10kbps
> burst 2k
> tc filter add dev eth0 protocol ip fw
>
> in this situation, packets marked with 0x10001 succeeded in jumping into
> 1:1.
>
> Why?
>
> -----Original Message-----
> From: lartc-admin@mailman.ds9a.nl [mailto:lartc-admin@mailman.ds9a.nl]
> On Behalf Of yangrunhua
> Sent: 2001年12月12日 13:47
> To: lartc@mailman.ds9a.nl
> Subject: RE: [LARTC] HTB problem
>
> Now, I know the where the problem is.
> If I already use SNAT, how could I limit the inbound bandwidth of
> Every intra-network ip protected by SNAT( with the help of iptables
> nfmark)?
> But mangle at PREROUTING goes before NAT translate.
> Is there any method?
> Thanks.
>
>
> -----Original Message-----
> From: bert hubert [mailto:ahu@ds9a.nl]
> Sent: 2001年12月11日 19:10
> To: yangrunhua
> Cc: lartc@mailman.ds9a.nl
> Subject: Re: [LARTC] HTB problem
>
> On Tue, Dec 11, 2001 at 05:34:22PM +0800, yangrunhua wrote:
> > tc qdisc add dev eth0 root handle 1: htb default 2
> > tc class add dev eth0 parent 1: classid 1:1 htb rate 5kbps ceil 5kbps
>
> > burst 2k tc class add dev eth0 parent 1: classid 1:2 htb rate 10mbps
> > ceil 10mbps burst 2k
> > tc filter add dev eth0 protocol ip fw
>
> I still have a very hard time figuring out your configuration. Please
> list
> the following:
>
> * your iptables commands
> * your tc qdisc add commands
> * your tc class add commands
> * what kind of traffic you are generating
>
> Thanks.
> --
> http://www.PowerDNS.com Versatile DNS Software & Services
> Trilab The Technology People
> Netherlabs BV / Rent-a-Nerd.nl - Nerd Available -
> 'SYN! .. SYN|ACK! .. ACK!' - the mating call of the internet
>
>
> _______________________________________________
> LARTC mailing list / LARTC@mailman.ds9a.nl
> http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO:
> http://ds9a.nl/lartc/
>
>
> _______________________________________________
> LARTC mailing list / LARTC@mailman.ds9a.nl
> http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/lartc/
>
>
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/lartc/
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [LARTC] HTB problem
2001-12-11 2:46 [LARTC] HTB problem yangrunhua
` (6 preceding siblings ...)
2001-12-12 11:40 ` Martin Devera
@ 2001-12-12 13:50 ` bert hubert
2001-12-12 23:48 ` yangrunhua
` (25 subsequent siblings)
33 siblings, 0 replies; 41+ messages in thread
From: bert hubert @ 2001-12-12 13:50 UTC (permalink / raw)
To: lartc
On Wed, Dec 12, 2001 at 12:40:57PM +0100, Martin Devera wrote:
> try replace 0x0001000a by 0x00010010. IIRC in 1:10
> the "10" is in hex.
True. Even the 1 is hex!
Regards,
bert
--
http://www.PowerDNS.com Versatile DNS Software & Services
Trilab The Technology People
Netherlabs BV / Rent-a-Nerd.nl - Nerd Available -
'SYN! .. SYN|ACK! .. ACK!' - the mating call of the internet
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/lartc/
^ permalink raw reply [flat|nested] 41+ messages in thread
* RE: [LARTC] HTB problem
2001-12-11 2:46 [LARTC] HTB problem yangrunhua
` (7 preceding siblings ...)
2001-12-12 13:50 ` bert hubert
@ 2001-12-12 23:48 ` yangrunhua
2001-12-13 10:07 ` bert hubert
` (24 subsequent siblings)
33 siblings, 0 replies; 41+ messages in thread
From: yangrunhua @ 2001-12-12 23:48 UTC (permalink / raw)
To: lartc
Thanks to everyone, my problem has been solved.
Here is my description:
for BIG ISP, if you have broadband for every client and use NAT_SRC to
let them out, and you want to divide bandwidth among all clients. My
solution is iproute2 + netfilter.
I've modified netfilter framework's src to hash every client (not like
originally,line by line) and also do some accounting based on flow, and
add a table(which hacks after NAT_SRC, not like mangle. Mangle hacks
before NAT_SRC), then mark the packets with it's classid related with
it's intra-network ipaddr, so the dev attached with filter fw with no
option will classify directly into the class with that classid, finally
control it's bandwidth(I use HTB).
Every step is O(1) in complexity. Excellent!
Thanks for all. Thanks for all the people here and from netfilter
mail-list.
Iproute2+ netfilter seems pretty good! I've got good performance!
I'm a new here, so very nice to hear from you, you are so kind.
-----Original Message-----
From: lartc-admin@mailman.ds9a.nl [mailto:lartc-admin@mailman.ds9a.nl]
On Behalf Of bert hubert
Sent: 2001Äê12ÔÂ12ÈÕ 21:51
To: Martin Devera
Cc: yangrunhua; lartc@mailman.ds9a.nl
Subject: Re: [LARTC] HTB problem
On Wed, Dec 12, 2001 at 12:40:57PM +0100, Martin Devera wrote:
> try replace 0x0001000a by 0x00010010. IIRC in 1:10
> the "10" is in hex.
True. Even the 1 is hex!
Regards,
bert
--
http://www.PowerDNS.com Versatile DNS Software & Services
Trilab The Technology People
Netherlabs BV / Rent-a-Nerd.nl - Nerd Available -
'SYN! .. SYN|ACK! .. ACK!' - the mating call of the internet
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO:
http://ds9a.nl/lartc/
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/lartc/
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [LARTC] HTB problem
2001-12-11 2:46 [LARTC] HTB problem yangrunhua
` (8 preceding siblings ...)
2001-12-12 23:48 ` yangrunhua
@ 2001-12-13 10:07 ` bert hubert
2002-06-26 0:22 ` [LARTC] htb problem Omar Armas
` (23 subsequent siblings)
33 siblings, 0 replies; 41+ messages in thread
From: bert hubert @ 2001-12-13 10:07 UTC (permalink / raw)
To: lartc
On Thu, Dec 13, 2001 at 07:48:56AM +0800, yangrunhua wrote:
> Thanks for all. Thanks for all the people here and from netfilter
> mail-list.
> Iproute2+ netfilter seems pretty good! I've got good performance!
> I'm a new here, so very nice to hear from you, you are so kind.
Glad we could help!
--
http://www.PowerDNS.com Versatile DNS Software & Services
Trilab The Technology People
Netherlabs BV / Rent-a-Nerd.nl - Nerd Available -
'SYN! .. SYN|ACK! .. ACK!' - the mating call of the internet
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/lartc/
^ permalink raw reply [flat|nested] 41+ messages in thread
* [LARTC] htb problem
2001-12-11 2:46 [LARTC] HTB problem yangrunhua
` (9 preceding siblings ...)
2001-12-13 10:07 ` bert hubert
@ 2002-06-26 0:22 ` Omar Armas
2002-06-26 0:32 ` Tomasz Wrona
` (22 subsequent siblings)
33 siblings, 0 replies; 41+ messages in thread
From: Omar Armas @ 2002-06-26 0:22 UTC (permalink / raw)
To: lartc
[-- Attachment #1: Type: text/plain, Size: 1033 bytes --]
I have a doubt. What's the correct use of mangle for the next network:
eth0: 200.39.190.249 (public)
eth1: 192.168.101.254 (private)
I make nat with iptables and have the following htb script:
tc qdisc add dev eth1 root handle 1: htb default 30
tc class add dev eth1 parent 1: classid 1:1 htb rate 10mbit burst 15k
tc class add dev eth1 parent 1:1 classid 1:10 htb rate 15kbit ceil
10mbit burst 15k
tc filter add dev eth1 protocol ip parent 1:0 prio 1 handle 1 fw classid
1:10
(did the same rules for eth0), htb2, kernel 2.4.18
next mangle:
iptables -I PREROUTING -t mangle -i eth1 -j MARK --set-mark 1
Well, I've spent hours changing values to mangle: PREROUTING, FORWARD,
POSTROUTING, etc.
But I can't make it work. I want that all packets marked as "1" be
limited to 15kb.
Is it a mangle or script problem?
What would be the correct mangle rule?
Thanks,
_______________________
Omar Armas
MPSNet
Telefono: 5559-1211
email: oarmas@mpsnet.com.mx
web: http://jabber.mpsnet.net.mx/~oarmas
_______________________
[-- Attachment #2: Type: text/html, Size: 2225 bytes --]
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [LARTC] htb problem
2001-12-11 2:46 [LARTC] HTB problem yangrunhua
` (10 preceding siblings ...)
2002-06-26 0:22 ` [LARTC] htb problem Omar Armas
@ 2002-06-26 0:32 ` Tomasz Wrona
2002-12-09 18:19 ` [LARTC] HTB Problem lartc
` (21 subsequent siblings)
33 siblings, 0 replies; 41+ messages in thread
From: Tomasz Wrona @ 2002-06-26 0:32 UTC (permalink / raw)
To: lartc
On 25 Jun 2002, Omar Armas wrote:
> tc class add dev eth1 parent 1:1 classid 1:10 htb rate 15kbit ceil
> 10mbit burst 15k
>
> But I can't make it work. I want that all packets marked as "1" be
> limited to 15kb.
>
> Is it a mangle or script problem?
> What would be the correct mangle rule?
You have inproper ceil rate pointing to 10mbit. Dont touch ceil parameter
or setup it at 15kbit value not 10mbit ;)
Regards
tw
--
----------------
ck.eter.tym.pl
"Never let shooling disturb Your education"
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 41+ messages in thread
* [LARTC] HTB Problem
2001-12-11 2:46 [LARTC] HTB problem yangrunhua
` (11 preceding siblings ...)
2002-06-26 0:32 ` Tomasz Wrona
@ 2002-12-09 18:19 ` lartc
2002-12-09 18:57 ` Stef Coene
` (20 subsequent siblings)
33 siblings, 0 replies; 41+ messages in thread
From: lartc @ 2002-12-09 18:19 UTC (permalink / raw)
To: lartc
Hello,
I am shaping traffic for ~250 users and i have noticed something is wrong:
Each user is being shaped from 32kbit/s to 2mbit/s.
When i run the script which creates the classes the following error is printed to syslog:
Dec 9 19:53:34 p1 kernel: HTB: quantum of class 10009 is small. Consider r2q
change.<4>HTB: quantum of class 10055 is small. Consider r2q change.<4>HTB: quantum of
class 10082 is small. Consider r2q change.<4>HTB: quantum of class 10103 is small. Consider
r2q change.<4>HTB: quantum of class 10106 is small. Consider r2q change.<4>HTB: quantum
of class 10109 is small. Consider r2q change.
... etc etc.
I searched google and found some posts on this error, they said to change the r1q quantum
value, tho it wasnt clearly said how big the value should be.
Could anyone tell me what r2q value to set if thaffic is shaped to 32kbit, 64 kbit and 128kbit/s?
I read the manual of HTB and it says:
'Normaly you don't need to specify quantums manualy as HTB chooses precomputed values. It
computes classe's quantum (when you add or change it) as its rate divided by r2q global
parameter. Its default value is 10 and because typical MTU is 1500 the default is good for rates
from 15 kBps (120 kbit). For smaller minimal rates specify r2q 1 when creating qdisc - it is good
from 12 kbit which should be enough'
So, is
'r2q 3' enough for 32kbit/s
'r2q 6' enough for 64kbit/s
and
'r2q 10' (default) enough for 128kbit/s+?
Soon after the 'HTB: quantum of class <class> is small' messages in syslog i get the following
errors from HTB:
(around 10 minutes after the warnings of 'quantum of class <class> is small':
Dec 9 20:04:43 p1 kernel: HTB: bad diff in events, cl\x10345 diffFCE0000 now\x1187872768
thenB94934528 j\x10106476
Dec 9 20:04:48 p1 kernel: NET: 189 messages suppressed.
Dec 9 20:04:48 p1 kernel: HTB: bad diff in events, cl\x10054 diffG0D0000 now\x1191976960
thenB94909952 j\x10106977
Dec 9 20:04:53 p1 kernel: NET: 190 messages suppressed.
Dec 9 20:04:53 p1 kernel: HTB: bad diff in events, cl\x10054 diffG4C0000 now\x1196105728
thenB94909952 j\x10107481
And it seems the classes start dying one after other, cause the clients start calling me and
screaming 'internet doesnt work'.
as soon as i flush qdisc, everything works perfect again.
So for now i have put the traffic script in crontab flushing and adding classes every 15 minutes.
Any suggestions?
I am using HTB 3.6 and Linux 2.4.19
I tried Linux 2.4.20 with HTB included, tho the results were much more poor - if i shaped traffic
to 256kbit/s on 2.4.19 the ping was around 200ms (constant), tho on 2.4.20 it was increasing
and decreasing dramatically - from 6000ms to 80ms.
P.Krumins
____________________________________________________________
Reìistrç un lieto savu Apollo e-pastu www.e-apollo.lv
www.apollo.lv
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [LARTC] HTB Problem
2001-12-11 2:46 [LARTC] HTB problem yangrunhua
` (12 preceding siblings ...)
2002-12-09 18:19 ` [LARTC] HTB Problem lartc
@ 2002-12-09 18:57 ` Stef Coene
2003-01-23 22:47 ` [LARTC] HTB problem Jay Wineinger
` (19 subsequent siblings)
33 siblings, 0 replies; 41+ messages in thread
From: Stef Coene @ 2002-12-09 18:57 UTC (permalink / raw)
To: lartc
On Monday 09 December 2002 19:19, lartc@e-apollo.lv wrote:
> Hello,
>
> I am shaping traffic for ~250 users and i have noticed something is wrong:
> Each user is being shaped from 32kbit/s to 2mbit/s.
>
> When i run the script which creates the classes the following error is
> printed to syslog: Dec 9 19:53:34 p1 kernel: HTB: quantum of class 10009
> is small. Consider r2q change.<4>HTB: quantum of class 10055 is small.
> Consider r2q change.<4>HTB: quantum of class 10082 is small. Consider r2q
> change.<4>HTB: quantum of class 10103 is small. Consider r2q change.<4>HTB:
> quantum of class 10106 is small. Consider r2q change.<4>HTB: quantum of
> class 10109 is small. Consider r2q change.
> ... etc etc.
>
> I searched google and found some posts on this error, they said to change
> the r1q quantum value, tho it wasnt clearly said how big the value should
> be.
>
> Could anyone tell me what r2q value to set if thaffic is shaped to 32kbit,
> 64 kbit and 128kbit/s?
Quantum = rate / r2q. Quantum should be > 1500 and smaller then 60.000.
I have some more info on www.docum.org on the faq page.
> I read the manual of HTB and it says:
> 'Normaly you don't need to specify quantums manualy as HTB chooses
> precomputed values. It computes classe's quantum (when you add or change
> it) as its rate divided by r2q global parameter. Its default value is 10
> and because typical MTU is 1500 the default is good for rates from 15 kBps
> (120 kbit). For smaller minimal rates specify r2q 1 when creating qdisc -
> it is good from 12 kbit which should be enough'
>
> So, is
> 'r2q 3' enough for 32kbit/s
> 'r2q 6' enough for 64kbit/s
> and
> 'r2q 10' (default) enough for 128kbit/s+?
>
>
> Soon after the 'HTB: quantum of class <class> is small' messages in syslog
> i get the following errors from HTB:
> (around 10 minutes after the warnings of 'quantum of class <class> is
> small':
>
> Dec 9 20:04:43 p1 kernel: HTB: bad diff in events, cl=10345 diff=46CE0000
> now=1187872768 then=4294934528 j=10106476
> Dec 9 20:04:48 p1 kernel: NET: 189 messages suppressed.
> Dec 9 20:04:48 p1 kernel: HTB: bad diff in events, cl=10054 diff=470D0000
> now=1191976960 then=4294909952 j=10106977
> Dec 9 20:04:53 p1 kernel: NET: 190 messages suppressed.
> Dec 9 20:04:53 p1 kernel: HTB: bad diff in events, cl=10054 diff=474C0000
> now=1196105728 then=4294909952 j=10107481
>
> And it seems the classes start dying one after other, cause the clients
> start calling me and screaming 'internet doesnt work'.
> as soon as i flush qdisc, everything works perfect again.
> So for now i have put the traffic script in crontab flushing and adding
> classes every 15 minutes.
>
> Any suggestions?
>
> I am using HTB 3.6 and Linux 2.4.19
>
> I tried Linux 2.4.20 with HTB included, tho the results were much more poor
> - if i shaped traffic to 256kbit/s on 2.4.19 the ping was around 200ms
> (constant), tho on 2.4.20 it was increasing and decreasing dramatically -
> from 6000ms to 80ms.
2.4.20 has htb 3.6. So it's the same version. It's strange that you have
different results.
Stef
--
stef.coene@docum.org
"Using Linux as bandwidth manager"
http://www.docum.org/
#lartc @ irc.oftc.net
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 41+ messages in thread
* [LARTC] HTB problem
2001-12-11 2:46 [LARTC] HTB problem yangrunhua
` (13 preceding siblings ...)
2002-12-09 18:57 ` Stef Coene
@ 2003-01-23 22:47 ` Jay Wineinger
2003-01-24 2:15 ` mingching.tiew
` (18 subsequent siblings)
33 siblings, 0 replies; 41+ messages in thread
From: Jay Wineinger @ 2003-01-23 22:47 UTC (permalink / raw)
To: lartc
Hi,
Ive been looking at tinkering with the linux traffic control stuff
lately and decided to try out the htb qdisc. My setup is as follows:
2 interfaces: eth0 goes to internet, and eth1 goes to a NAT'd subnet. eth0
has a 7mbit link, but only a 4.5 mbit link to the internet while eth1 is a
100 mbit link to the internal subnet. The box that is doing the routing
(and tc soon, hopefully) acts as webserver,dhcp,firewall,NAT,and fileserver
for the internal subnet. The internal network (at a college) has heavy
kazaa and other filesharing usage over the internet. I want to use the
lartc utilities to make the bulk traffic from filesharing,etc to be the
lowest priority and have interactive (ssh), mail, and http be higher prios
(in that order).
Anyway, I dont want to limit the traffic that is going TO the server only,
ie. people taking files off my server, and I dont really care who is
creating the traffic, I just want priorities on types of traffic. That
being the case, I decided to do the shaping on the eth0 interface. Ive
setup rules in iptables to mark the different kinds of traffic.
With that done, I created the root htb qdisc with the following:
$TC qdisc add dev eth0 root handle 1: htb default 20
However, I get an error about illegal rate when I try to create a class
with:
$TC class add dev eth0 parent 1:1 classid 1:10 htb rate 30kpbs burst 2k
prio 1 ceil 100kbps
I wondered if my tc version wasnt up-to date enough to work with htb, but it
was the one downloaded from the htb homepage at
http://luxik.cdi.cz/~devik/qos/htb/v3/htb3.6-020525.tgz
# ./tc -V
tc utility, iproute2-ss991023
is there anything else that might need updating, or is my syntax wrong? any
suggestions about my setup would be welcome as well, since this is my first
attempt at this
thanks,
jay
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [LARTC] HTB problem
2001-12-11 2:46 [LARTC] HTB problem yangrunhua
` (14 preceding siblings ...)
2003-01-23 22:47 ` [LARTC] HTB problem Jay Wineinger
@ 2003-01-24 2:15 ` mingching.tiew
2003-01-24 2:39 ` Jay Wineinger
` (17 subsequent siblings)
33 siblings, 0 replies; 41+ messages in thread
From: mingching.tiew @ 2003-01-24 2:15 UTC (permalink / raw)
To: lartc
You have a typo :- kpbs
Also, it seems that the parent 1:1 is not created yet.
----- Original Message -----
From: "Jay Wineinger" <shad@wnoc.com>
>
> However, I get an error about illegal rate when I try to create a class
> with:
> $TC class add dev eth0 parent 1:1 classid 1:10 htb rate 30kpbs burst
2k
> prio 1 ceil 100kbps
>
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [LARTC] HTB problem
2001-12-11 2:46 [LARTC] HTB problem yangrunhua
` (15 preceding siblings ...)
2003-01-24 2:15 ` mingching.tiew
@ 2003-01-24 2:39 ` Jay Wineinger
2003-06-12 19:21 ` [LARTC] htb problem Ratel
` (16 subsequent siblings)
33 siblings, 0 replies; 41+ messages in thread
From: Jay Wineinger @ 2003-01-24 2:39 UTC (permalink / raw)
To: lartc
grr, I thought i had checked everything close. Thanks =)
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 41+ messages in thread
* [LARTC] htb problem
2001-12-11 2:46 [LARTC] HTB problem yangrunhua
` (16 preceding siblings ...)
2003-01-24 2:39 ` Jay Wineinger
@ 2003-06-12 19:21 ` Ratel
2003-06-12 19:23 ` Esteban
` (15 subsequent siblings)
33 siblings, 0 replies; 41+ messages in thread
From: Ratel @ 2003-06-12 19:21 UTC (permalink / raw)
To: lartc
Hi,
I have some interesting problem with htb , I set up root class and
sub-classess:
$TC qdisc add dev eth0 root handle 1: htb
$TC class add dev eth0 parent 1: classid 1:1 htb rate 1990kbit ceil 2000kbit
$TC class add dev eth0 parent 1:1 classid 1:10 htb rate 190kbit ceil 200kbit
$TC class add dev eth0 parent 1:1 classid 1:11 htb rate 1400kbit ceil
1600kbit
$TC class add dev eth0 parent 1:1 classid 1:12 htb rate 1000kbit ceil
1500kbit
$TC class add dev eth0 parent 1:1 classid 1:13 htb rate 1000kbit ceil
1500kbit
$TC class add dev eth0 parent 1:1 classid 1:14 htb rate 1000kbit ceil
1200kbit
, filters and queuing disciplines :
#filter
$TC filter add dev eth0 protocol ip parent 1:0 prio 1 handle 2 fw flowid
1:10 classid 1:10
$TC filter add dev eth0 protocol ip parent 1:0 prio 1 handle 3 fw flowid
1:11 classid 1:11
$TC filter add dev eth0 protocol ip parent 1:0 prio 2 handle 4 fw flowid
1:12 classid 1:12
$TC filter add dev eth0 protocol ip parent 1:0 prio 3 handle 5 fw flowid
1:13 classid 1:13
$TC filter add dev eth0 protocol ip parent 1:0 prio 1 handle 6 fw flowid
1:14 classid 1:14
(note the packet marking classifier)
adequate lines from firewall script :
[...]
# ftp
$IPTABLES -A FORWARD -p tcp -s 0/0 -d 0/0 --dport 21 -m state --state
NEW,ESTABLISHED -t mangle -j MARK --set-mark 3
# ssh
$$IPTABLES -A FORWARD -p tcp -s 0/0 -d 0/0 --dport 22 -m state --state
NEW,ESTABLISHED -t mangle -j MARK --set-mark 2
# smtp
$IPTABLES -A FORWARD -p tcp -s 0/0 -d 0/0 --dport 25 -m state --state
NEW,ESTABLISHED -t mangle -j MARK --set-mark 4
[...]
#qdisc
$TC qdisc add dev eth0 parent 1:10 handle 20: sfq perturb 10
$TC qdisc add dev eth0 parent 1:11 handle 30: sfq perturb 10
$TC qdisc add dev eth0 parent 1:12 handle 40: sfq perturb 10
$TC qdisc add dev eth0 parent 1:13 handle 50: sfq perturb 10
$TC qdisc add dev eth0 parent 1:14 handle 60: sfq perturb 10
the problem is - all the traffic goes only through root class '1:'
#tc -s qdisc ls dev eth0
qdisc sfq 60: quantum 1514b perturb 10sec
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
qdisc pfifo 50: limit 5p
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
qdisc pfifo 40: limit 5p
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
qdisc pfifo 30: limit 5p
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
qdisc pfifo 20: limit 5p
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
qdisc htb 1: r2q 10 default 0 direct_packets_stat 671
Sent 392890 bytes 671 pkts (dropped 0, overlimits 0)
I'd be very grateful , if you could help me with this.
thanks in advance.
Ratel .at. aonet.pl
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [LARTC] htb problem
2001-12-11 2:46 [LARTC] HTB problem yangrunhua
` (17 preceding siblings ...)
2003-06-12 19:21 ` [LARTC] htb problem Ratel
@ 2003-06-12 19:23 ` Esteban
2003-06-12 19:35 ` Stef Coene
` (14 subsequent siblings)
33 siblings, 0 replies; 41+ messages in thread
From: Esteban @ 2003-06-12 19:23 UTC (permalink / raw)
To: lartc
do you have two nics? the 2megas internet is eth0 right? so you are tc'ing packets going out of interface eth0.
paquets are comming from eth1 for example?
in such case you coutlf -t mangle -I PREROUTING -i eth1 -j MARK --set-mark {1|2|4|}
??
so packets going from internal (eth1) going out (eth0) are previusly marked.
im pretty sure about this.
hope it helps, good luck.
Quoting Ratel <ratel@aonet.pl>:
> Hi,
>
> I have some interesting problem with htb , I set up root class and
> sub-classess:
>
> $TC qdisc add dev eth0 root handle 1: htb
> $TC class add dev eth0 parent 1: classid 1:1 htb rate 1990kbit ceil 2000kbit
> $TC class add dev eth0 parent 1:1 classid 1:10 htb rate 190kbit ceil 200kbit
> $TC class add dev eth0 parent 1:1 classid 1:11 htb rate 1400kbit ceil
> 1600kbit
> $TC class add dev eth0 parent 1:1 classid 1:12 htb rate 1000kbit ceil
> 1500kbit
> $TC class add dev eth0 parent 1:1 classid 1:13 htb rate 1000kbit ceil
> 1500kbit
> $TC class add dev eth0 parent 1:1 classid 1:14 htb rate 1000kbit ceil
> 1200kbit
>
> , filters and queuing disciplines :
> #filter
> $TC filter add dev eth0 protocol ip parent 1:0 prio 1 handle 2 fw flowid
> 1:10 classid 1:10
> $TC filter add dev eth0 protocol ip parent 1:0 prio 1 handle 3 fw flowid
> 1:11 classid 1:11
> $TC filter add dev eth0 protocol ip parent 1:0 prio 2 handle 4 fw flowid
> 1:12 classid 1:12
> $TC filter add dev eth0 protocol ip parent 1:0 prio 3 handle 5 fw flowid
> 1:13 classid 1:13
> $TC filter add dev eth0 protocol ip parent 1:0 prio 1 handle 6 fw flowid
> 1:14 classid 1:14
> (note the packet marking classifier)
>
> adequate lines from firewall script :
> [...]
> # ftp
> $IPTABLES -A FORWARD -p tcp -s 0/0 -d 0/0 --dport 21 -m state --state
> NEW,ESTABLISHED -t mangle -j MARK --set-mark 3
> # ssh
> $$IPTABLES -A FORWARD -p tcp -s 0/0 -d 0/0 --dport 22 -m state --state
> NEW,ESTABLISHED -t mangle -j MARK --set-mark 2
> # smtp
> $IPTABLES -A FORWARD -p tcp -s 0/0 -d 0/0 --dport 25 -m state --state
> NEW,ESTABLISHED -t mangle -j MARK --set-mark 4
> [...]
>
> #qdisc
> $TC qdisc add dev eth0 parent 1:10 handle 20: sfq perturb 10
> $TC qdisc add dev eth0 parent 1:11 handle 30: sfq perturb 10
> $TC qdisc add dev eth0 parent 1:12 handle 40: sfq perturb 10
> $TC qdisc add dev eth0 parent 1:13 handle 50: sfq perturb 10
> $TC qdisc add dev eth0 parent 1:14 handle 60: sfq perturb 10
>
> the problem is - all the traffic goes only through root class '1:'
>
> #tc -s qdisc ls dev eth0
> qdisc sfq 60: quantum 1514b perturb 10sec
> Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
>
> qdisc pfifo 50: limit 5p
> Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
>
> qdisc pfifo 40: limit 5p
> Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
>
> qdisc pfifo 30: limit 5p
> Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
>
> qdisc pfifo 20: limit 5p
> Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
>
> qdisc htb 1: r2q 10 default 0 direct_packets_stat 671
> Sent 392890 bytes 671 pkts (dropped 0, overlimits 0)
>
>
> I'd be very grateful , if you could help me with this.
>
> thanks in advance.
>
> Ratel .at. aonet.pl
>
>
> _______________________________________________
> 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] 41+ messages in thread
* Re: [LARTC] htb problem
2001-12-11 2:46 [LARTC] HTB problem yangrunhua
` (18 preceding siblings ...)
2003-06-12 19:23 ` Esteban
@ 2003-06-12 19:35 ` Stef Coene
2003-06-12 20:04 ` Morten Isaksen
` (13 subsequent siblings)
33 siblings, 0 replies; 41+ messages in thread
From: Stef Coene @ 2003-06-12 19:35 UTC (permalink / raw)
To: lartc
On Thursday 12 June 2003 21:21, Ratel wrote:
> Hi,
>
> I have some interesting problem with htb , I set up root class and
> sub-classess:
>
> $TC qdisc add dev eth0 root handle 1: htb
> $TC class add dev eth0 parent 1: classid 1:1 htb rate 1990kbit ceil
> 2000kbit $TC class add dev eth0 parent 1:1 classid 1:10 htb rate 190kbit
> ceil 200kbit $TC class add dev eth0 parent 1:1 classid 1:11 htb rate
> 1400kbit ceil 1600kbit
> $TC class add dev eth0 parent 1:1 classid 1:12 htb rate 1000kbit ceil
> 1500kbit
> $TC class add dev eth0 parent 1:1 classid 1:13 htb rate 1000kbit ceil
> 1500kbit
> $TC class add dev eth0 parent 1:1 classid 1:14 htb rate 1000kbit ceil
> 1200kbit
The sum of the rates of the childs should be <= rate of parent. In your case
1400 + 1000 + 1000 + 1000 = 4400 and your parent rate is 1990. It's not
needed, but I recommend it.
> , filters and queuing disciplines :
> #filter
> $TC filter add dev eth0 protocol ip parent 1:0 prio 1 handle 2 fw flowid
> 1:10 classid 1:10
> $TC filter add dev eth0 protocol ip parent 1:0 prio 1 handle 3 fw flowid
> 1:11 classid 1:11
> $TC filter add dev eth0 protocol ip parent 1:0 prio 2 handle 4 fw flowid
> 1:12 classid 1:12
> $TC filter add dev eth0 protocol ip parent 1:0 prio 3 handle 5 fw flowid
> 1:13 classid 1:13
> $TC filter add dev eth0 protocol ip parent 1:0 prio 1 handle 6 fw flowid
> 1:14 classid 1:14
> (note the packet marking classifier)
And I also note the different prios. That's not needed. Prio determines the
order the filters are checked. In your case it doesn't matter.
> adequate lines from firewall script :
> [...]
> # ftp
> $IPTABLES -A FORWARD -p tcp -s 0/0 -d 0/0 --dport 21 -m state --state
> NEW,ESTABLISHED -t mangle -j MARK --set-mark 3
> # ssh
> $$IPTABLES -A FORWARD -p tcp -s 0/0 -d 0/0 --dport 22 -m state --state
> NEW,ESTABLISHED -t mangle -j MARK --set-mark 2
> # smtp
> $IPTABLES -A FORWARD -p tcp -s 0/0 -d 0/0 --dport 25 -m state --state
> NEW,ESTABLISHED -t mangle -j MARK --set-mark 4
> [...]
Mhh. Can you check with iptables -L -v -n that your packets are marked? And
can you tell us what's your setup ? I mean wich nic is connected to the
internet, what do you want to shape, is this also a firewall? And try
marking in the PREROUTING tables.
Stef
--
stef.coene@docum.org
"Using Linux as bandwidth manager"
http://www.docum.org/
#lartc @ irc.oftc.net
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 41+ messages in thread
* RE: [LARTC] htb problem
2001-12-11 2:46 [LARTC] HTB problem yangrunhua
` (19 preceding siblings ...)
2003-06-12 19:35 ` Stef Coene
@ 2003-06-12 20:04 ` Morten Isaksen
2003-06-12 20:51 ` Stef Coene
` (12 subsequent siblings)
33 siblings, 0 replies; 41+ messages in thread
From: Morten Isaksen @ 2003-06-12 20:04 UTC (permalink / raw)
To: lartc
> -----Original Message-----
> From: lartc-admin@mailman.ds9a.nl [mailto:lartc-admin@mailman.ds9a.nl] On
> Behalf Of Stef Coene
> Sent: 12. juni 2003 21:35
> To: Ratel; lartc@mailman.ds9a.nl
> Subject: Re: [LARTC] htb problem
>
> > adequate lines from firewall script :
> > [...]
> > # ftp
> > $IPTABLES -A FORWARD -p tcp -s 0/0 -d 0/0 --dport 21 -m state --state
> > NEW,ESTABLISHED -t mangle -j MARK --set-mark 3
> > # ssh
> > $$IPTABLES -A FORWARD -p tcp -s 0/0 -d 0/0 --dport 22 -m state --state
> > NEW,ESTABLISHED -t mangle -j MARK --set-mark 2
> > # smtp
> > $IPTABLES -A FORWARD -p tcp -s 0/0 -d 0/0 --dport 25 -m state --state
> > NEW,ESTABLISHED -t mangle -j MARK --set-mark 4
> > [...]
> Mhh. Can you check with iptables -L -v -n that your packets are marked?
> And
> can you tell us what's your setup ? I mean wich nic is connected to the
> internet, what do you want to shape, is this also a firewall? And try
> marking in the PREROUTING tables.
I have the same problem. According to iptables the packets are marked but
all the traffic goes to the root htb class.
--
Morten Isaksen
misak@aub.dk - http://www.aub.dk/~misak
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [LARTC] htb problem
2001-12-11 2:46 [LARTC] HTB problem yangrunhua
` (20 preceding siblings ...)
2003-06-12 20:04 ` Morten Isaksen
@ 2003-06-12 20:51 ` Stef Coene
2003-06-12 20:54 ` Stef Coene
` (11 subsequent siblings)
33 siblings, 0 replies; 41+ messages in thread
From: Stef Coene @ 2003-06-12 20:51 UTC (permalink / raw)
To: lartc
On Thursday 12 June 2003 22:04, Morten Isaksen wrote:
> > -----Original Message-----
> > From: lartc-admin@mailman.ds9a.nl [mailto:lartc-admin@mailman.ds9a.nl] On
> > Behalf Of Stef Coene
> > Sent: 12. juni 2003 21:35
> > To: Ratel; lartc@mailman.ds9a.nl
> > Subject: Re: [LARTC] htb problem
> >
> > > adequate lines from firewall script :
> > > [...]
> > > # ftp
> > > $IPTABLES -A FORWARD -p tcp -s 0/0 -d 0/0 --dport 21 -m state --state
> > > NEW,ESTABLISHED -t mangle -j MARK --set-mark 3
> > > # ssh
> > > $$IPTABLES -A FORWARD -p tcp -s 0/0 -d 0/0 --dport 22 -m state --state
> > > NEW,ESTABLISHED -t mangle -j MARK --set-mark 2
> > > # smtp
> > > $IPTABLES -A FORWARD -p tcp -s 0/0 -d 0/0 --dport 25 -m state --state
> > > NEW,ESTABLISHED -t mangle -j MARK --set-mark 4
> > > [...]
> >
> > Mhh. Can you check with iptables -L -v -n that your packets are marked?
> > And
> > can you tell us what's your setup ? I mean wich nic is connected to the
> > internet, what do you want to shape, is this also a firewall? And try
> > marking in the PREROUTING tables.
>
> I have the same problem. According to iptables the packets are marked but
> all the traffic goes to the root htb class.
Mhh. Some commands that works for me :
tc filter add dev eth0 parent 1: protocol ip handle 1 fw classid 1:100
iptables -A OUTPUT -t mangle -p tcp --dport 2000 -j MARK --set-mark 1
Stef
--
stef.coene@docum.org
"Using Linux as bandwidth manager"
http://www.docum.org/
#lartc @ irc.oftc.net
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [LARTC] htb problem
2001-12-11 2:46 [LARTC] HTB problem yangrunhua
` (21 preceding siblings ...)
2003-06-12 20:51 ` Stef Coene
@ 2003-06-12 20:54 ` Stef Coene
2003-06-12 21:15 ` Stef Coene
` (10 subsequent siblings)
33 siblings, 0 replies; 41+ messages in thread
From: Stef Coene @ 2003-06-12 20:54 UTC (permalink / raw)
To: lartc
On Thursday 12 June 2003 21:46, Esteban wrote:
> Stef! please explain me this:
> When i use traffic shaper, i apply the root to the innterface i want to
> controll the packets that are leaving right?
Yes.
> The sum of classes "should"
> not be greater than the root one.
> Supossing i have 2 nics. One for internal (eth1) and other for internet
> (eth0). i can mangle packets:
> -t mangle -I PREROUTING -i eth1 -j MARK --set-mark 1
>
> and then filter them all on the eth0 device with:
> tc filter add dev $DEV protocol ip parent 1:0 prio 1 handle 0x1 fw flowid
> 1:20 is this okay?
Yes.
> Cause for me, is not working.
> jeje..i see packets accounting on the right class, but they dont go to the
> speed i want (i see that in that class are much packets "lended")..that
> might be that that class is asking for BW to greater classes? if you can
> would be a great help to clear out this doubts!
So your filters are working. The lended packets are not important.
For your htb setup, have you read the docs I collected on www.docum.org ?
Stef
--
stef.coene@docum.org
"Using Linux as bandwidth manager"
http://www.docum.org/
#lartc @ irc.oftc.net
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [LARTC] htb problem
2001-12-11 2:46 [LARTC] HTB problem yangrunhua
` (22 preceding siblings ...)
2003-06-12 20:54 ` Stef Coene
@ 2003-06-12 21:15 ` Stef Coene
2003-06-14 21:46 ` terahz
` (9 subsequent siblings)
33 siblings, 0 replies; 41+ messages in thread
From: Stef Coene @ 2003-06-12 21:15 UTC (permalink / raw)
To: lartc
On Thursday 12 June 2003 23:08, Esteban wrote:
> my set up is like this:
>
> #!/bin/bash
> DEV=eth1
>
> tc qdisc del dev $DEV root 2> /dev/null > /dev/null
> tc qdisc del dev $DEV ingress 2> /dev/null > /dev/null
>
> tc qdisc add dev $DEV root handle 1: htb
>
> tc class add dev $DEV parent 1: classid 1:1 htb rate 512kbit burst 6k
> tc class add dev $DEV parent 1:1 classid 1:10 htb rate 512kbit burst 6k
> prio 1 tc class add dev $DEV parent 1:1 classid 1:20 htb rate 50kbit burst
> 6k prio 3
>
> tc qdisc add dev $DEV parent 1:10 handle 10: sfq perturb 10
> tc qdisc add dev $DEV parent 1:20 handle 20: sfq perturb 10
>
> tc filter add dev $DEV protocol ip parent 1:0 prio 1 handle 0x1 fw flowid
> 1:20
>
>
> iptables -t mangle -A FORWARD -i eth1 -j MARK --set-mark 1
>
> os?? any idea?
Remove burst and prio parameter from your commands. And make sure the sum of
child rates <= parent rate. In your case 512 + 50 >> 512.
And all non-classified packets have to go somewhere. This can be done with
the default parameter if you add the htb root disc or a catch all filter
rule.
Stef
--
stef.coene@docum.org
"Using Linux as bandwidth manager"
http://www.docum.org/
#lartc @ irc.oftc.net
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [LARTC] htb problem
2001-12-11 2:46 [LARTC] HTB problem yangrunhua
` (23 preceding siblings ...)
2003-06-12 21:15 ` Stef Coene
@ 2003-06-14 21:46 ` terahz
2003-06-15 18:14 ` Stef Coene
` (8 subsequent siblings)
33 siblings, 0 replies; 41+ messages in thread
From: terahz @ 2003-06-14 21:46 UTC (permalink / raw)
To: lartc
Hey I hve the same problem. My packets are marked, my classes are OK
my filters are set OK
and all packets are passing through the root class!!
I think that this is a big problem. A know 1 more person that has the same
problem!<br><br>
------------------- изпратено от mail.bG<br>
<li>Силна Анти-спам защита
<li>12MB Място за поща
<li>SMS за нов емeйл и към двата оператора!
<li>POP3/WAP Достъп<br>
_________________________________________<br>
<a target='_blank' href="/ads/adclick.php?banneridg1&zoneid\x13&source=&dest=http%3A%2F%2Fmail.bg%2F&ismap=">HOB БEЗПЛATEH AДPEC</a>
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [LARTC] htb problem
2001-12-11 2:46 [LARTC] HTB problem yangrunhua
` (24 preceding siblings ...)
2003-06-14 21:46 ` terahz
@ 2003-06-15 18:14 ` Stef Coene
2003-06-25 11:14 ` Ratel
` (7 subsequent siblings)
33 siblings, 0 replies; 41+ messages in thread
From: Stef Coene @ 2003-06-15 18:14 UTC (permalink / raw)
To: lartc
On Saturday 14 June 2003 23:46, terahz@mail.bg wrote:
> Hey I hve the same problem. My packets are marked, my classes are OK
> my filters are set OK
> and all packets are passing through the root class!!
> I think that this is a big problem. A know 1 more person that has the same
> problem!
Ok. I don't understand. I do all my test using iptables and fw filter. This
works for me :
tc filter add dev eth0 parent 1: protocol ip handle 1 fw classid 1:100
iptables -A OUTPUT -t mangle -p tcp --dport 2000 -j MARK --set-mark 1
This is on a simple pc. No router, no bridge, no firewall. It's only used to
shape outgoing locally bandwidth.
Stef
--
stef.coene@docum.org
"Using Linux as bandwidth manager"
http://www.docum.org/
#lartc @ irc.oftc.net
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [LARTC] htb problem
2001-12-11 2:46 [LARTC] HTB problem yangrunhua
` (25 preceding siblings ...)
2003-06-15 18:14 ` Stef Coene
@ 2003-06-25 11:14 ` Ratel
2003-07-24 14:26 ` Delcho
` (6 subsequent siblings)
33 siblings, 0 replies; 41+ messages in thread
From: Ratel @ 2003-06-25 11:14 UTC (permalink / raw)
To: lartc
Thx a lot for help , I finally managed to rebuild my firewall script,
for people who have same problem as I had, I can say that
the problem lies in propper packet marking (iptables) , sample lines from my
firewall script :
iptables -t mangle -I PREROUTING -i eth0 -p tcp --dport 21 -j
MARK --set-mark 2
iptables -t mangle -I PREROUTING -i eth0 -p tcp --dport 443 -j
MARK --set-mark 3
it's ofcourse not the only way to mark them,
http://www.docum.org/stef.coene/qos/kptd/ is very useful with that.
regards, Ratel <ratel@aonet.pl>
----- Original Message -----
From: "Stef Coene" <stef.coene@docum.org>
To: "Ratel" <ratel@aonet.pl>; <lartc@mailman.ds9a.nl>
Sent: Thursday, June 12, 2003 9:35 PM
Subject: Re: [LARTC] htb problem
> On Thursday 12 June 2003 21:21, Ratel wrote:
> > Hi,
> >
> > I have some interesting problem with htb , I set up root class and
> > sub-classess:
> >
> > $TC qdisc add dev eth0 root handle 1: htb
> > $TC class add dev eth0 parent 1: classid 1:1 htb rate 1990kbit ceil
> > 2000kbit $TC class add dev eth0 parent 1:1 classid 1:10 htb rate 190kbit
> > ceil 200kbit $TC class add dev eth0 parent 1:1 classid 1:11 htb rate
> > 1400kbit ceil 1600kbit
> > $TC class add dev eth0 parent 1:1 classid 1:12 htb rate 1000kbit ceil
> > 1500kbit
> > $TC class add dev eth0 parent 1:1 classid 1:13 htb rate 1000kbit ceil
> > 1500kbit
> > $TC class add dev eth0 parent 1:1 classid 1:14 htb rate 1000kbit ceil
> > 1200kbit
> The sum of the rates of the childs should be <= rate of parent. In your
case
> 1400 + 1000 + 1000 + 1000 = 4400 and your parent rate is 1990. It's not
> needed, but I recommend it.
>
> > , filters and queuing disciplines :
> > #filter
> > $TC filter add dev eth0 protocol ip parent 1:0 prio 1 handle 2 fw flowid
> > 1:10 classid 1:10
> > $TC filter add dev eth0 protocol ip parent 1:0 prio 1 handle 3 fw flowid
> > 1:11 classid 1:11
> > $TC filter add dev eth0 protocol ip parent 1:0 prio 2 handle 4 fw flowid
> > 1:12 classid 1:12
> > $TC filter add dev eth0 protocol ip parent 1:0 prio 3 handle 5 fw flowid
> > 1:13 classid 1:13
> > $TC filter add dev eth0 protocol ip parent 1:0 prio 1 handle 6 fw flowid
> > 1:14 classid 1:14
> > (note the packet marking classifier)
> And I also note the different prios. That's not needed. Prio determines
the
> order the filters are checked. In your case it doesn't matter.
>
> > adequate lines from firewall script :
> > [...]
> > # ftp
> > $IPTABLES -A FORWARD -p tcp -s 0/0 -d 0/0 --dport 21 -m state --state
> > NEW,ESTABLISHED -t mangle -j MARK --set-mark 3
> > # ssh
> > $$IPTABLES -A FORWARD -p tcp -s 0/0 -d 0/0 --dport 22 -m state --state
> > NEW,ESTABLISHED -t mangle -j MARK --set-mark 2
> > # smtp
> > $IPTABLES -A FORWARD -p tcp -s 0/0 -d 0/0 --dport 25 -m state --state
> > NEW,ESTABLISHED -t mangle -j MARK --set-mark 4
> > [...]
> Mhh. Can you check with iptables -L -v -n that your packets are marked?
And
> can you tell us what's your setup ? I mean wich nic is connected to the
> internet, what do you want to shape, is this also a firewall? And try
> marking in the PREROUTING tables.
>
>
> Stef
>
> --
>
> stef.coene@docum.org
> "Using Linux as bandwidth manager"
> http://www.docum.org/
> #lartc @ irc.oftc.net
>
> _______________________________________________
> 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] 41+ messages in thread
* [LARTC] htb problem
2001-12-11 2:46 [LARTC] HTB problem yangrunhua
` (26 preceding siblings ...)
2003-06-25 11:14 ` Ratel
@ 2003-07-24 14:26 ` Delcho
2003-07-28 17:49 ` Stef Coene
` (5 subsequent siblings)
33 siblings, 0 replies; 41+ messages in thread
From: Delcho @ 2003-07-24 14:26 UTC (permalink / raw)
To: lartc
Hello,
I have a problem with my htb in linux gateway machine.
Wana make this borrow to and from internet:
every user must be shaped to 32Kbit,max number of users are 6 in one
subnet /29
and all subnet must be shaped to 92Kbit,e.i every user will download
with 32Kbit,but when
all 6 user download do not over 92Kbit! I make some classes /attache
them/ but every user download with 32Kbit and over many up 92Kbit.
The script:
tc qdisc add dev eth1 root handle 1: htb default 2
tc class add dev eth1 parent 1: classid 1:2 htb rate 100Mbit
ceil 100Mbit burst 1k
tc class add dev eth1 parent 1:2 classid 1:11 htb rate
92Kbit ceil 92Kbit burst 1k
tc qdisc add dev eth1 parent 1:11 handle 11 sfq perturb 10
tc class add dev eth1 parent 1:11 classid 1:30 htb rate
32Kbit ceil 32Kbit burst 1k
tc qdisc add dev eth1 parent 1:30 handle 30 sfq perturb 10
tc filter add dev eth1 parent 1:0 protocol ip prio 1 u32
match ip dst 192.168.1.17 classid 1:30
tc class add dev eth1 parent 1:11 classid 1:40 htb rate
32Kbit ceil 32Kbit burst 1k
tc qdisc add dev eth1 parent 1:40 handle 40 sfq perturb 10
tc filter add dev eth1 parent 1:0 protocol ip prio 1 u32
match ip dst 192.168.1.18 classid 1:40
........
tc class add dev eth1 parent 1:11 classid 1:80 htb rate
32Kbit ceil 32Kbit burst 1k
tc qdisc add dev eth1 parent 1:80 handle 80 sfq perturb 10
tc filter add dev eth1 parent 1:0 protocol ip prio 1 u32
match ip dst 192.168.1.22 classid 1:80
May be there is mistake but where.....?
Please help and thanks!
Reagrds
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [LARTC] htb problem
2001-12-11 2:46 [LARTC] HTB problem yangrunhua
` (27 preceding siblings ...)
2003-07-24 14:26 ` Delcho
@ 2003-07-28 17:49 ` Stef Coene
2003-09-30 13:44 ` [LARTC] HTB Problem Guilherme Benkenstein
` (4 subsequent siblings)
33 siblings, 0 replies; 41+ messages in thread
From: Stef Coene @ 2003-07-28 17:49 UTC (permalink / raw)
To: lartc
On Thursday 24 July 2003 16:26, Delcho wrote:
> Hello,
> I have a problem with my htb in linux gateway machine.
> Wana make this borrow to and from internet:
> every user must be shaped to 32Kbit,max number of users are 6 in one
> subnet /29
> and all subnet must be shaped to 92Kbit,e.i every user will download
> with 32Kbit,but when
> all 6 user download do not over 92Kbit! I make some classes /attache
> them/ but every user download with 32Kbit and over many up 92Kbit.
> The script:
>
> tc qdisc add dev eth1 root handle 1: htb default 2
> tc class add dev eth1 parent 1: classid 1:2 htb rate 100Mbit
> ceil 100Mbit burst 1k
> tc class add dev eth1 parent 1:2 classid 1:11 htb rate
> 92Kbit ceil 92Kbit burst 1k
> tc qdisc add dev eth1 parent 1:11 handle 11 sfq perturb 10
> tc class add dev eth1 parent 1:11 classid 1:30 htb rate
> 32Kbit ceil 32Kbit burst 1k
> tc qdisc add dev eth1 parent 1:30 handle 30 sfq perturb 10
> tc filter add dev eth1 parent 1:0 protocol ip prio 1 u32
> match ip dst 192.168.1.17 classid 1:30
> tc class add dev eth1 parent 1:11 classid 1:40 htb rate
> 32Kbit ceil 32Kbit burst 1k
> tc qdisc add dev eth1 parent 1:40 handle 40 sfq perturb 10
> tc filter add dev eth1 parent 1:0 protocol ip prio 1 u32
> match ip dst 192.168.1.18 classid 1:40
> ........
> tc class add dev eth1 parent 1:11 classid 1:80 htb rate
> 32Kbit ceil 32Kbit burst 1k
> tc qdisc add dev eth1 parent 1:80 handle 80 sfq perturb 10
> tc filter add dev eth1 parent 1:0 protocol ip prio 1 u32
> match ip dst 192.168.1.22 classid 1:80
>
> May be there is mistake but where.....?
Take a look at the faq pages on docum.org. There is a section with htb rules.
The problem is that the rate is a minium and the parent ceil is not respected
if the child classes are asking more then the ceil.
Stef
--
stef.coene@docum.org
"Using Linux as bandwidth manager"
http://www.docum.org/
#lartc @ irc.oftc.net
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 41+ messages in thread
* [LARTC] HTB Problem
2001-12-11 2:46 [LARTC] HTB problem yangrunhua
` (28 preceding siblings ...)
2003-07-28 17:49 ` Stef Coene
@ 2003-09-30 13:44 ` Guilherme Benkenstein
2003-09-30 19:59 ` Stef Coene
` (3 subsequent siblings)
33 siblings, 0 replies; 41+ messages in thread
From: Guilherme Benkenstein @ 2003-09-30 13:44 UTC (permalink / raw)
To: lartc
Hi all!!
I'm new in the list.
I'm using Slackware 9.0 with 2.4.21
HTB 0.8.3
eth0
DEFAULT0
eth0-2:30.dfl
RATE%6Kbit
BURST2Kb
LEAF=sfq
This is my configuration, but, the shaper dosen't works in 32Kbps...
Anybody can help me?
Thanks
Guilherme
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [LARTC] HTB Problem
2001-12-11 2:46 [LARTC] HTB problem yangrunhua
` (29 preceding siblings ...)
2003-09-30 13:44 ` [LARTC] HTB Problem Guilherme Benkenstein
@ 2003-09-30 19:59 ` Stef Coene
2003-12-02 23:08 ` [LARTC] HTB problem Mihai Tanasescu
` (2 subsequent siblings)
33 siblings, 0 replies; 41+ messages in thread
From: Stef Coene @ 2003-09-30 19:59 UTC (permalink / raw)
To: lartc
On Tuesday 30 September 2003 15:44, Guilherme Benkenstein wrote:
> Hi all!!
>
> I'm new in the list.
>
> I'm using Slackware 9.0 with 2.4.21
>
> HTB 0.8.3
>
> eth0
>
> DEFAULT0
>
> eth0-2:30.dfl
>
> RATE%6Kbit
> BURST2Kb
> LEAF=sfq
>
> This is my configuration, but, the shaper dosen't works in 32Kbps...
>
> Anybody can help me?
Yes and no.
I think you are using htb.init and this is not the htb.init mailing list.
Stef
--
stef.coene@docum.org
"Using Linux as bandwidth manager"
http://www.docum.org/
#lartc @ irc.openprojects.net
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 41+ messages in thread
* [LARTC] HTB problem
2001-12-11 2:46 [LARTC] HTB problem yangrunhua
` (30 preceding siblings ...)
2003-09-30 19:59 ` Stef Coene
@ 2003-12-02 23:08 ` Mihai Tanasescu
2003-12-04 5:16 ` Mihai Tanasescu
2003-12-04 7:40 ` Catalin BOIE
33 siblings, 0 replies; 41+ messages in thread
From: Mihai Tanasescu @ 2003-12-02 23:08 UTC (permalink / raw)
To: lartc
Hello,
I'm having some problems using HTB to prioritize traffic on my linux router.
The main problem is as follows:
I have a 6Mbits channel on the metropolitan network and a 64kbps link
for the sites outside my country.
These 64kbps are dynamically allocated by my ISP so I usually get
something like 128kbps , sometimes 512kbps and even 1 Mbit; it varies
all the time.
Because of this I don't know how to automatically adjust my HTB script
depending on the total bandwidth available on the external link (without
specifying the maximum to 64kbps thus limitting every connection even if
my ISP grants me more than this bandwidth).
Anyone got any ideas ?
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [LARTC] HTB problem
2001-12-11 2:46 [LARTC] HTB problem yangrunhua
` (31 preceding siblings ...)
2003-12-02 23:08 ` [LARTC] HTB problem Mihai Tanasescu
@ 2003-12-04 5:16 ` Mihai Tanasescu
2003-12-04 7:40 ` Catalin BOIE
33 siblings, 0 replies; 41+ messages in thread
From: Mihai Tanasescu @ 2003-12-04 5:16 UTC (permalink / raw)
To: lartc
Doesn't anyone have any ideas regarding my problem ?
Mihai Tanasescu wrote:
> Hello,
>
> I'm having some problems using HTB to prioritize traffic on my linux
> router.
> The main problem is as follows:
> I have a 6Mbits channel on the metropolitan network and a 64kbps link
> for the sites outside my country.
>
> These 64kbps are dynamically allocated by my ISP so I usually get
> something like 128kbps , sometimes 512kbps and even 1 Mbit; it varies
> all the time.
>
> Because of this I don't know how to automatically adjust my HTB script
> depending on the total bandwidth available on the external link
> (without specifying the maximum to 64kbps thus limitting every
> connection even if my ISP grants me more than this bandwidth).
>
> Anyone got any ideas ?
>
>
>
> _______________________________________________
> 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] 41+ messages in thread
* Re: [LARTC] HTB problem
2001-12-11 2:46 [LARTC] HTB problem yangrunhua
` (32 preceding siblings ...)
2003-12-04 5:16 ` Mihai Tanasescu
@ 2003-12-04 7:40 ` Catalin BOIE
33 siblings, 0 replies; 41+ messages in thread
From: Catalin BOIE @ 2003-12-04 7:40 UTC (permalink / raw)
To: lartc
> > Hello,
> >
> > I'm having some problems using HTB to prioritize traffic on my linux
> > router.
> > The main problem is as follows:
> > I have a 6Mbits channel on the metropolitan network and a 64kbps link
> > for the sites outside my country.
> >
> > These 64kbps are dynamically allocated by my ISP so I usually get
> > something like 128kbps , sometimes 512kbps and even 1 Mbit; it varies
> > all the time.
> >
> > Because of this I don't know how to automatically adjust my HTB script
> > depending on the total bandwidth available on the external link
> > (without specifying the maximum to 64kbps thus limitting every
> > connection even if my ISP grants me more than this bandwidth).
> >
> > Anyone got any ideas ?
You cannot have a variable bandwidth with htb.
Count on the minimum bandwidth.
> >
> >
> >
> > _______________________________________________
> > 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/
>
---
Catalin(ux) BOIE
catab@deuroconsult.ro
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 41+ messages in thread
* [LARTC] HTB problem...
@ 2004-09-06 21:56 Cow
2004-09-07 11:08 ` zytek
` (4 more replies)
0 siblings, 5 replies; 41+ messages in thread
From: Cow @ 2004-09-06 21:56 UTC (permalink / raw)
To: lartc
Hi folks.
Let's say I would like to make some bandwidth control on my network
using HTB. I have 2 clients:
PC1: 192.168.100.2
PC2: 192.168.100.3
Server:
192.168.100.1
This has 2 NIC's eth1 is local and eth2 is connected to the internet.
It could be nice to have a script, where you could specify, how much
bandwidth you want for a specific host on a network, like, PC1 has
10/100 MBit network, but only has 256/128, when surfing the net. PC2 has
the same network ofc, but 768/384 when surfing/downloading assuming the
shared connection is 1024/512.
I am currently running wondershaper1.1a which works prefectly, but i
wish, it could be more specific.
Could also be nice, if it would be someway possible to check on the
clients IP or MAC address to verify, if it's "really them". Like it's
only PC1 and PC2 who have access to the server in the 192.168.*.*
segment. Hope i make myself clear.
My server runs redhat 9 in cmd mode/no GUI.
Iptables installed script, as firewall.
I think a script as i described, could be very complex to write,
therefore i ask, whoever is here, for help.
Thank you all in advance.
Regards
Rune Johannesen
Denmark
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [LARTC] HTB problem...
2004-09-06 21:56 Cow
@ 2004-09-07 11:08 ` zytek
2004-09-07 20:28 ` Cow
` (3 subsequent siblings)
4 siblings, 0 replies; 41+ messages in thread
From: zytek @ 2004-09-07 11:08 UTC (permalink / raw)
To: lartc
Dnia poniedzia³ek 06 wrzesieñ 2004 23:56, Cow napisa³:
> Hi folks.
>
> Let's say I would like to make some bandwidth control on my network
> using HTB. I have 2 clients:
[...]
> I think a script as i described, could be very complex to write,
> therefore i ask, whoever is here, for help.
> Thank you all in advance.
Hello all, my first post here, maybe even I will help someone;)
I assume that you want somethink like:
data from server to LAN (PC1,PC2) unshaped (full 100mbit)
data from Internet to LAN shaped
Then all you need to do is make classes with source 192.168.0.1 and
destination 192.168.0.2(3) and 100mbit rate and then make classes with
destination 192.168.0.2(3) with download rate. I believe that you understand
what I am thinkig of.
Or you can use iptables and mark traffic going from server to LAN, and other
mark for traffic in FORWARD chain. (iptables -t mangle -A FORWARD -j MARK
--set-mark SOME_MARK)
When using iptables you will be able to shape upload speed, just mark traffic
in forward going from PC1/2 with output interface eth2 (-o eth2) - it will be
hosts upload.
I won't write you full script, make it yourself, visit LARTC and firstly try
"htb.init" for simple class creation. Good fun!
--
.: Jakub G³azik (zytek)
.: email:zytek@ostrow-wlkp.net
.: JID:zytek@azazel.ostrow-wlkp.net
.: http://www.misiaj.sie.pl [obsolete]
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 41+ messages in thread
* [LARTC] HTB problem...
2004-09-06 21:56 Cow
2004-09-07 11:08 ` zytek
@ 2004-09-07 20:28 ` Cow
2004-09-07 21:16 ` [LARTC] HTB Problem Cow
` (2 subsequent siblings)
4 siblings, 0 replies; 41+ messages in thread
From: Cow @ 2004-09-07 20:28 UTC (permalink / raw)
To: lartc
I've tryed to make a script, some of you, who thinks it looks ok?
DEV=eth2
DOWNLINK\x1024
UPLINKQ2
DOWN1v8
UP184
DOWN2%6
UP2\x128
tc qdisc add dev $DEV root handle 1: htb default 20
tc class add dev $DEV parent 1: classid 1:1 htb rate ${UPLINK}kbit burst
6k
tc class add dev $DEV parent 1:1 classid 1:10 htb rate ${UPLINK}kbit \
burst 6k prio 1
tc class add dev $DEV parent 1:1 classid 1:20 htb rate ${UP1}kbit \
burst 6k prio 2
tc class add dev $DEV parent 1:1 classid 1:30 htb rate ${UP2}kbit \
burst 6k prio 2
tc qdisc add dev $DEV parent 1:10 handle 10: sfq perturb 10
tc qdisc add dev $DEV parent 1:20 handle 20: sfq perturb 10
tc qdisc add dev $DEV parent 1:30 handle 30: sfq perturb 10
tc filter add dev $DEV parent 1: protocol ip prio 16 u32 \
match ip src 192.168.0.2 flowid 1:20
tc filter add dev $DEV parent 1: protocol ip prio 16 u32 \
match ip src 192.168.0.3 flowid 1:30
Not tested yet...
If it works, feel free to letting me know, how to make something like
this, just for download rate.
If it doesn't work, please let me know, what you think is wrong.
- Rune Johannesen
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 41+ messages in thread
* [LARTC] HTB Problem...
2004-09-06 21:56 Cow
2004-09-07 11:08 ` zytek
2004-09-07 20:28 ` Cow
@ 2004-09-07 21:16 ` Cow
2004-09-07 21:18 ` [LARTC] HTB problem Cow
2004-09-07 21:53 ` Andreas Klauer
4 siblings, 0 replies; 41+ messages in thread
From: Cow @ 2004-09-07 21:16 UTC (permalink / raw)
To: lartc
> You might want to check out this script
> http://www.geocities.com/jame_sj I just noticed a bug (that I need to
> figure out...) in it but this should give a start..
Looks nice, want to share the bug with me? :-)
>
> James
>
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 41+ messages in thread
* [LARTC] HTB problem...
2004-09-06 21:56 Cow
` (2 preceding siblings ...)
2004-09-07 21:16 ` [LARTC] HTB Problem Cow
@ 2004-09-07 21:18 ` Cow
2004-09-07 21:53 ` Andreas Klauer
4 siblings, 0 replies; 41+ messages in thread
From: Cow @ 2004-09-07 21:18 UTC (permalink / raw)
To: lartc
>by zytek
>Hello all, my first post here, maybe even I will help someone;)
>I assume that you want somethink like:
>data from server to LAN (PC1,PC2) unshaped (full 100mbit)
>data from Internet to LAN shaped
Correct.
>Then all you need to do is make classes with source 192.168.0.1 and
>destination 192.168.0.2(3) and 100mbit rate and then make classes with
>destination 192.168.0.2(3) with download rate. I believe that you
understand
>what I am thinkig of.
I do, but could you write an example please, so i have something to make
it from? :-)
>Or you can use iptables and mark traffic going from server to LAN, and
other
>mark for traffic in FORWARD chain. (iptables -t mangle -A FORWARD -j
MARK
>--set-mark SOME_MARK)
>When using iptables you will be able to shape upload speed, just mark
traffic
>in forward going from PC1/2 with output interface eth2 (-o eth2) - it
will be
>hosts upload.
Again, an example would be nice.. i have no idea on how to use MARK
command with iptables, even i know a great deal about iptables in
general.
>I won't write you full script, make it yourself, visit LARTC and
firstly try
>"htb.init" for simple class creation. Good fun!
Fair enough, i wouldn't exspect anyone to write a full script for me,
but i would exspect someone to make me an example for instance, how i
can shape PC1's download/upload rate to 256/128 KBit, so i atleast have
something to help me going.
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [LARTC] HTB problem...
2004-09-06 21:56 Cow
` (3 preceding siblings ...)
2004-09-07 21:18 ` [LARTC] HTB problem Cow
@ 2004-09-07 21:53 ` Andreas Klauer
4 siblings, 0 replies; 41+ messages in thread
From: Andreas Klauer @ 2004-09-07 21:53 UTC (permalink / raw)
To: lartc
Am Tuesday 07 September 2004 23:18 schrieb Cow:
> zytec: (?)
> > I assume that you want somethink like:
> > data from server to LAN (PC1,PC2) unshaped (full 100mbit)
> > data from Internet to LAN shaped
>
> Correct.
Not really an example, but you may have a look at my script [1].
It solves the 100Mbit LAN vs internet traffic by using a class setup which
looks like [2], which reminds me that I did a modification to wondershaper
once [3] that does the same. I think this modification was reported to
work, however I haven't tested it nor do I support it. Maybe it serves as
an example...
I'm using a fat HTB class which knows the true interface bandwidth (100MBit
isn't actually right, you should measure what rates you really get). Then
there's a child class for the internet traffic and one for the actual LAN
traffic. If HTB works correctly, this way you get full speed for LAN-only
transfers, without letting them interfere with the internet traffic.
The script [1] is the one I'm (more or less) actively working on; it
doesn't support custom rates per user yet, but that's something that'll be
added for sure in one of the next releases.
HTH
Andreas
[1] http://www.metamorpher.de/fairnat/
[2] http://www.metamorpher.de/files/wshaper-over-lan.png
[3] http://www.metamorpher.de/files/wshaper-over-lan.htb
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 41+ messages in thread
end of thread, other threads:[~2004-09-07 21:53 UTC | newest]
Thread overview: 41+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-12-11 2:46 [LARTC] HTB problem yangrunhua
2001-12-11 9:21 ` bert hubert
2001-12-11 9:34 ` yangrunhua
2001-12-11 9:35 ` yangrunhua
2001-12-11 11:10 ` bert hubert
2001-12-12 5:47 ` yangrunhua
2001-12-12 10:02 ` yangrunhua
2001-12-12 11:40 ` Martin Devera
2001-12-12 13:50 ` bert hubert
2001-12-12 23:48 ` yangrunhua
2001-12-13 10:07 ` bert hubert
2002-06-26 0:22 ` [LARTC] htb problem Omar Armas
2002-06-26 0:32 ` Tomasz Wrona
2002-12-09 18:19 ` [LARTC] HTB Problem lartc
2002-12-09 18:57 ` Stef Coene
2003-01-23 22:47 ` [LARTC] HTB problem Jay Wineinger
2003-01-24 2:15 ` mingching.tiew
2003-01-24 2:39 ` Jay Wineinger
2003-06-12 19:21 ` [LARTC] htb problem Ratel
2003-06-12 19:23 ` Esteban
2003-06-12 19:35 ` Stef Coene
2003-06-12 20:04 ` Morten Isaksen
2003-06-12 20:51 ` Stef Coene
2003-06-12 20:54 ` Stef Coene
2003-06-12 21:15 ` Stef Coene
2003-06-14 21:46 ` terahz
2003-06-15 18:14 ` Stef Coene
2003-06-25 11:14 ` Ratel
2003-07-24 14:26 ` Delcho
2003-07-28 17:49 ` Stef Coene
2003-09-30 13:44 ` [LARTC] HTB Problem Guilherme Benkenstein
2003-09-30 19:59 ` Stef Coene
2003-12-02 23:08 ` [LARTC] HTB problem Mihai Tanasescu
2003-12-04 5:16 ` Mihai Tanasescu
2003-12-04 7:40 ` Catalin BOIE
-- strict thread matches above, loose matches on Subject: below --
2004-09-06 21:56 Cow
2004-09-07 11:08 ` zytek
2004-09-07 20:28 ` Cow
2004-09-07 21:16 ` [LARTC] HTB Problem Cow
2004-09-07 21:18 ` [LARTC] HTB problem Cow
2004-09-07 21:53 ` Andreas Klauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox