* Re: [LARTC] How to do ensure bandwith
2003-03-24 6:05 [LARTC] How to do ensure bandwith liang jian
@ 2003-03-24 9:09 ` Stef Coene
2003-03-25 2:18 ` liang jian
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Stef Coene @ 2003-03-24 9:09 UTC (permalink / raw)
To: lartc
On Monday 24 March 2003 07:05, liang jian wrote:
> How to do ensure a class not lended and not borrowed each other.
That also depends on the setup of the other classes. Can you give us more
information like htb or cbq? What do you want to do? What have you tried so
far?
> I do cburst burst 0b ,but ctokens tokens go to negative!
You always needs a minimum burst and cburst. If you use htb and if you don't
specify it on the command line, htb will calculate it for you.
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] 12+ messages in thread* Re: [LARTC] How to do ensure bandwith
2003-03-24 6:05 [LARTC] How to do ensure bandwith liang jian
2003-03-24 9:09 ` Stef Coene
@ 2003-03-25 2:18 ` liang jian
2003-03-25 17:23 ` Stef Coene
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: liang jian @ 2003-03-25 2:18 UTC (permalink / raw)
To: lartc
[-- Attachment #1: Type: text/plain, Size: 1190 bytes --]
Htb tree:
20:1
20:10 20:11
20:200 20:201 20:210 20:211
http stream ensure 4Mbps
ftp stream ensure 2Mbps
smtp stream ensure 2MMbps
other stream ensure 2Mbps
so I want ensure 20:200 have 4Mbps for http
20:201 have 2Mbps for ftp and 20:210 have 2Mbps for smtp
20:211 have 2Mbps for other stream(default class )
Each class don't permit lended or borrowed bandwith from each other.
This is I want to get.
> Stef Coene <stef.coene@docum.org> wrote:>On Monday 24 March 2003 07:05, liang jian wrote:
>> How to do ensure a class not lended and not borrowed each other.
>That also depends on the setup of the other classes. Can you give us >more
>information like htb or cbq? What do you want to do? What have you tried >so
>far?
> I do cburst burst 0b ,but ctokens tokens go to negative!
>You always needs a minimum burst and cburst. If you use htb and if you >don't
>specify it on the command line, htb will calculate it for you.
>Stef
>--
>stef.coene@docum.org
>"Using Linux as bandwidth manager"
>http://www.docum.org/
>#lartc @ irc.oftc.net
---------------------------------
Do You Yahoo!?
"更多惊喜,同样精彩,NetVista A30 热卖"
[-- Attachment #2: Type: text/html, Size: 1837 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [LARTC] How to do ensure bandwith
2003-03-24 6:05 [LARTC] How to do ensure bandwith liang jian
2003-03-24 9:09 ` Stef Coene
2003-03-25 2:18 ` liang jian
@ 2003-03-25 17:23 ` Stef Coene
2003-03-26 5:30 ` liang jian
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Stef Coene @ 2003-03-25 17:23 UTC (permalink / raw)
To: lartc
On Tuesday 25 March 2003 03:18, liang jian wrote:
> Htb tree:
> 20:1
> 20:10 20:11
> 20:200 20:201 20:210 20:211
> http stream ensure 4Mbps
> ftp stream ensure 2Mbps
> smtp stream ensure 2MMbps
> other stream ensure 2Mbps
> so I want ensure 20:200 have 4Mbps for http
> 20:201 have 2Mbps for ftp and 20:210 have 2Mbps for smtp
> 20:211 have 2Mbps for other stream(default class )
> Each class don't permit lended or borrowed bandwith from each other.
> This is I want to get.
Can you try to explain it a bit more?
You created 4 classes, (200, 201, 210, 211) so I suppose you want :
200 : http traffic, 4Mbps
201 : ftp traffic, 2Mbps
210 : smtp traffic, 2Mbps
211 : other trafic, 2Mbps
Each class is isolated so it never lends it unused bandwidth to other classes.
And each class is never using unused bandwidth from other classes. So as
example, http has 4Mbps and it never can use the bandwidth of ftp (2Mbps) if
there is no ftp traffic. So the 4Mbps is a maximum bandwidth.
What's the total bandiwidth available? You have 4Mbps for http and 3x2Mbps
for ftp,smtp,other. So the total bandwidth available on the link is 10Mbps?
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] 12+ messages in thread* Re: [LARTC] How to do ensure bandwith
2003-03-24 6:05 [LARTC] How to do ensure bandwith liang jian
` (2 preceding siblings ...)
2003-03-25 17:23 ` Stef Coene
@ 2003-03-26 5:30 ` liang jian
2003-03-26 19:18 ` Stef Coene
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: liang jian @ 2003-03-26 5:30 UTC (permalink / raw)
To: lartc
[-- Attachment #1: Type: text/plain, Size: 1460 bytes --]
>Stef Coene <stef.coene@docum.org> wrote:>On Tuesday 25 March 2003 03:18, liang jian wrote:
>> Htb tree:
>> 20:1
>> 20:10 20:11
>> 20:200 20:201 20:210 20:211
>> http stream ensure 4Mbps
>> ftp stream ensure 2Mbps
>> smtp stream ensure 2MMbps
>> other stream ensure 2Mbps
>> so I want ensure 20:200 have 4Mbps for http
>> 20:201 have 2Mbps for ftp and 20:210 have 2Mbps for smtp
>> 20:211 have 2Mbps for other stream(default class )
>> Each class don't permit lended or borrowed bandwith from each other.
>> This is I want to get.
>Can you try to explain it a bit more?
>You created 4 classes, (200, 201, 210, 211) so I suppose you want :
>200 : http traffic, 4Mbps
>201 : ftp traffic, 2Mbps
>210 : smtp traffic, 2Mbps
>211 : other trafic, 2Mbps
>Each class is isolated so it never lends it unused bandwidth to other >classes.
>And each class is never using unused bandwidth from other classes. So >as
>example, http has 4Mbps and it never can use the bandwidth of ftp (2Mbps) if
>there is no ftp traffic. So the 4Mbps is a maximum bandwidth.
>What's the total bandiwidth available? You have 4Mbps for http and >3x2Mbps
>for ftp,smtp,other. So the total bandwidth available on the link is 10Mbps?
>Stef
>--
>stef.coene@docum.org
>"Using Linux as bandwidth manager"
>http://www.docum.org/
>#lartc @ irc.oftc.net
Yes ,that is my means :),my english is poor
---------------------------------
Do You Yahoo!?
"雅虎通网络KTV, 随时随地免费卡拉OK~~"
[-- Attachment #2: Type: text/html, Size: 1967 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [LARTC] How to do ensure bandwith
2003-03-24 6:05 [LARTC] How to do ensure bandwith liang jian
` (3 preceding siblings ...)
2003-03-26 5:30 ` liang jian
@ 2003-03-26 19:18 ` Stef Coene
2003-03-31 9:12 ` liang jian
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Stef Coene @ 2003-03-26 19:18 UTC (permalink / raw)
To: lartc
On Wednesday 26 March 2003 06:30, liang jian wrote:
> >Stef Coene <stef.coene@docum.org> wrote:>On Tuesday 25 March 2003 03:18,
> > liang jian wrote:
> >
> >> Htb tree:
> >> 20:1
> >> 20:10 20:11
> >> 20:200 20:201 20:210 20:211
> >> http stream ensure 4Mbps
> >> ftp stream ensure 2Mbps
> >> smtp stream ensure 2MMbps
> >> other stream ensure 2Mbps
> >> so I want ensure 20:200 have 4Mbps for http
> >> 20:201 have 2Mbps for ftp and 20:210 have 2Mbps for smtp
> >> 20:211 have 2Mbps for other stream(default class )
> >> Each class don't permit lended or borrowed bandwith from each other.
> >> This is I want to get.
> >
> >Can you try to explain it a bit more?
> >
> >You created 4 classes, (200, 201, 210, 211) so I suppose you want :
> >200 : http traffic, 4Mbps
> >201 : ftp traffic, 2Mbps
> >210 : smtp traffic, 2Mbps
> >211 : other trafic, 2Mbps
> >
> >Each class is isolated so it never lends it unused bandwidth to other
> > >classes. And each class is never using unused bandwidth from other
> > classes. So >as example, http has 4Mbps and it never can use the
> > bandwidth of ftp (2Mbps) if there is no ftp traffic. So the 4Mbps is a
> > maximum bandwidth.
> >
> >What's the total bandiwidth available? You have 4Mbps for http and
> > >3x2Mbps for ftp,smtp,other. So the total bandwidth available on the link
> > is 10Mbps?
> >
> >Stef
> >
> >--
> >
> >stef.coene@docum.org
> >"Using Linux as bandwidth manager"
> >http://www.docum.org/
> >#lartc @ irc.oftc.net
>
> Yes ,that is my means :),my english is poor
No problem.
I have some remarks. Why not let the 4 classes borrow unused bandwidth from
each other? So if there is no other traffic then ftp, ftp can get 10Mbps.
But as soone as there is some other traffic, the ftp traffic goes down.
And if you want 4 isolated classes, why not just creating the 4 classes like
this :
20:1
20:200 20:201 20:210 20:211
You have to create the htb (or cbq) classes. FIltering the traffic and
placing in the classes is easy (you can filter on ports). Except maybe for
the ftp traffic because that uses dynamic ports.
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] 12+ messages in thread* Re: [LARTC] How to do ensure bandwith
2003-03-24 6:05 [LARTC] How to do ensure bandwith liang jian
` (4 preceding siblings ...)
2003-03-26 19:18 ` Stef Coene
@ 2003-03-31 9:12 ` liang jian
2003-03-31 9:12 ` liang jian
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: liang jian @ 2003-03-31 9:12 UTC (permalink / raw)
To: lartc
[-- Attachment #1: Type: text/plain, Size: 2191 bytes --]
> Yes ,that is my means :),my english is poor
No problem.
I have some remarks. Why not let the 4 classes borrow unused bandwidth from
each other? So if there is no other traffic then ftp, ftp can get 10Mbps.
But as soone as there is some other traffic, the ftp traffic goes down.
And if you want 4 isolated classes, why not just creating the 4 classes like
this :
20:1
20:200 20:201 20:210 20:211
You have to create the htb (or cbq) classes. FIltering the traffic and
placing in the classes is easy (you can filter on ports). Except maybe for
the ftp traffic because that uses dynamic ports.
Stef:
Thanks for your answer me quickly!
I have others question :)
I apologize that it will take time.
My topological look like this:
Local:192.168.1.2----------|eth0:192.168.1.1 Linux Box eth1:172.16.1.1|------Internet
I have create a default 200
20:1 (4kbps)
200:200 200:201 200:210 200:211
(1kbps) (1kbps) (1kbps) (1kbps)
I have 10Mbps on the eth1,but I want to test htb,so I do that:
tc class add dev eth0 parent 20: classid 20:1 htb rate 4kbps ceil 4kbps
200:201 mark with 7,then
iptables -t mangle -A FORWARD -p tcp -o eth0 -s 0/0 --dport 80 -d 0/0 -j MARK --set-mark 7
iptables -t mangle -A PREROUTING -p tcp -i eth0 -s 0/0 --dport 80 -d 0/0 -j MARK --set-mark 7
why all traffic from default 200 to Internet.(the iptables rules like no use)
------------------------------------------------
If I use it on eth1 interface iptables rules work!?(though I have default class 200 but all traffice
from 200:201 to Internet.) other question it that:
In this settings use Local machine 192.168.1.2 download some soft from Internet.why it rate overrun 1kbps?
Rules like this:
tc class add dev eth1 parent 20: classid 20:1 htb rate 4kbps ceil 4kbps
iptables -t mangle -A FORWARD -p tcp -o eth1 -s 0/0 --dport 80 -d 0/0 -j MARK --set-mark 7
iptables -t mangle -A PREROUTING -p tcp -i eth1 -s 0/0 --dport 80 -d 0/0 -j MARK --set-mark 7
tc can only shape outgoing traffic(My settings which is my outgoing traffic,eth1 or eth0?) Maybe I mix them
I need path kernel with IMQ?
---------------------------------
Do You Yahoo!?
"雅虎通网络KTV, 随时随地免费卡拉OK~~"
[-- Attachment #2: Type: text/html, Size: 2527 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [LARTC] How to do ensure bandwith
2003-03-24 6:05 [LARTC] How to do ensure bandwith liang jian
` (5 preceding siblings ...)
2003-03-31 9:12 ` liang jian
@ 2003-03-31 9:12 ` liang jian
2003-03-31 17:22 ` Stef Coene
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: liang jian @ 2003-03-31 9:12 UTC (permalink / raw)
To: lartc
[-- Attachment #1: Type: text/plain, Size: 2203 bytes --]
>> Yes ,that is my means :),my english is poor
>No problem.
>I have some remarks. Why not let the 4 classes borrow unused bandwidth from
>each other? So if there is no other traffic then ftp, ftp can get 10Mbps.
>But as soone as there is some other traffic, the ftp traffic goes down.
>And if you want 4 isolated classes, why not just creating the 4 classes like
>this :
>20:1
>20:200 20:201 20:210 20:211
>You have to create the htb (or cbq) classes. FIltering the traffic and
>placing in the classes is easy (you can filter on ports). Except maybe for
>the ftp traffic because that uses dynamic ports.
Stef:
Thanks for your answer me quickly!
I have others question :)
I apologize that it will take time.
My topological look like this:
Local:192.168.1.2----------|eth0:192.168.1.1 Linux Box eth1:172.16.1.1|------Internet
I have create a default 200
20:1 (4kbps)
200:200 200:201 200:210 200:211
(1kbps) (1kbps) (1kbps) (1kbps)
I have 10Mbps on the eth1,but I want to test htb,so I do that:
tc class add dev eth0 parent 20: classid 20:1 htb rate 4kbps ceil 4kbps
200:201 mark with 7,then
iptables -t mangle -A FORWARD -p tcp -o eth0 -s 0/0 --dport 80 -d 0/0 -j MARK --set-mark 7
iptables -t mangle -A PREROUTING -p tcp -i eth0 -s 0/0 --dport 80 -d 0/0 -j MARK --set-mark 7
why all traffic from default 200 to Internet.(the iptables rules like no use)
------------------------------------------------
If I use it on eth1 interface iptables rules work!?(though I have default class 200 but all traffice
from 200:201 to Internet.) other question it that:
In this settings use Local machine 192.168.1.2 download some soft from Internet.why it rate overrun 1kbps?
Rules like this:
tc class add dev eth1 parent 20: classid 20:1 htb rate 4kbps ceil 4kbps
iptables -t mangle -A FORWARD -p tcp -o eth1 -s 0/0 --dport 80 -d 0/0 -j MARK --set-mark 7
iptables -t mangle -A PREROUTING -p tcp -i eth1 -s 0/0 --dport 80 -d 0/0 -j MARK --set-mark 7
tc can only shape outgoing traffic(My settings which is my outgoing traffic,eth1 or eth0?) Maybe I mix them
I need path kernel with IMQ?
---------------------------------
Do You Yahoo!?
"雅虎通网络KTV, 随时随地免费卡拉OK~~"
[-- Attachment #2: Type: text/html, Size: 2575 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [LARTC] How to do ensure bandwith
2003-03-24 6:05 [LARTC] How to do ensure bandwith liang jian
` (6 preceding siblings ...)
2003-03-31 9:12 ` liang jian
@ 2003-03-31 17:22 ` Stef Coene
2003-04-02 1:31 ` liang jian
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Stef Coene @ 2003-03-31 17:22 UTC (permalink / raw)
To: lartc
On Monday 31 March 2003 11:12, liang jian wrote:
> >> Yes ,that is my means :),my english is poor
> >
> >No problem.
> >
> >I have some remarks. Why not let the 4 classes borrow unused bandwidth
> > from each other? So if there is no other traffic then ftp, ftp can get
> > 10Mbps. But as soone as there is some other traffic, the ftp traffic goes
> > down.
> >
> >And if you want 4 isolated classes, why not just creating the 4 classes
> > like this :
> >
> >20:1
> >20:200 20:201 20:210 20:211
> >
> >You have to create the htb (or cbq) classes. FIltering the traffic and
> >placing in the classes is easy (you can filter on ports). Except maybe for
> >the ftp traffic because that uses dynamic ports.
>
> Stef:
> Thanks for your answer me quickly!
> I have others question :)
I have some problems understanding your english. Can you post your htb and
iptabels script so I can understand what you did?
> I apologize that it will take time.
> My topological look like this:
> Local:192.168.1.2----------|eth0:192.168.1.1 Linux Box
> eth1:172.16.1.1|------Internet
>
> I have create a default 200
>
> 20:1 (4kbps)
> 200:200 200:201 200:210 200:211
> (1kbps) (1kbps) (1kbps) (1kbps)
>
> I have 10Mbps on the eth1,but I want to test htb,so I do that:
> tc class add dev eth0 parent 20: classid 20:1 htb rate 4kbps ceil 4kbps
4 and 1 kbps is __very__ low. It's too low for htb to get some results.
> 200:201 mark with 7,then
> iptables -t mangle -A FORWARD -p tcp -o eth0 -s 0/0 --dport 80 -d 0/0 -j
> MARK --set-mark 7
> iptables -t mangle -A PREROUTING -p tcp -i eth0 -s 0/0
> --dport 80 -d 0/0 -j MARK --set-mark 7
>
> why all traffic from default 200 to Internet.(the iptables rules like no
> use)
So all traffic ends up in 200:200 ??
You can check with iptables -L -v -n if your iptables rules are matched. If
the iptables rule match, the byte and packet counters will increase.
> ------------------------------------------------
>
> If I use it on eth1 interface iptables rules work!?(though I have default
> class 200 but all traffice from 200:201 to Internet.) other question it
> that:
> In this settings use Local machine 192.168.1.2 download some soft from
> Internet.why it rate overrun 1kbps?
Because 1kbps is too low for htb. And you have to mark packets in
POSTROUTING. Local generated packets don't travel thru forward or
prerouting. See kptd on www.docum.org.
> Rules like this:
> tc class add dev eth1 parent 20: classid 20:1 htb rate 4kbps ceil 4kbps
>
> iptables -t mangle -A FORWARD -p tcp -o eth1 -s 0/0 --dport 80 -d 0/0 -j
> MARK --set-mark 7 iptables -t mangle -A PREROUTING -p tcp -i eth1 -s 0/0
> --dport 80 -d 0/0 -j MARK --set-mark 7
>
> tc can only shape outgoing traffic(My settings which is my outgoing
> traffic,eth1 or eth0?) Maybe I mix them I need path kernel with IMQ?
You can indeed only shape outgoing traffic. Or you need the imq device. But
if you shape on eth0 and eth1 you control both directions. So you don't need
the imq device.
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] 12+ messages in thread* RE:[LARTC] How to do ensure bandwith
2003-03-24 6:05 [LARTC] How to do ensure bandwith liang jian
` (7 preceding siblings ...)
2003-03-31 17:22 ` Stef Coene
@ 2003-04-02 1:31 ` liang jian
2003-04-02 20:08 ` [LARTC] " Stef Coene
2003-04-03 3:10 ` liang jian
10 siblings, 0 replies; 12+ messages in thread
From: liang jian @ 2003-04-02 1:31 UTC (permalink / raw)
To: lartc
[-- Attachment #1: Type: text/plain, Size: 3005 bytes --]
hi:
Stef
>> Stef:
>> Thanks for your answer me quickly!
>> I have others question :)
>I have some problems understanding your english. Can you post your htb and
>iptabels script so I can understand what you did?
>> I apologize that it will take time.
>> My topological look like this:
>> Local:192.168.1.2----------|eth0:192.168.1.1 Linux Box
>> eth1:172.16.1.1|------Internet
>>
>> I have create a default 200
>> 20:1 (10Mbps)
>> 20:20 20:21 20:22 20:23 20:24
>>(20Mbps) (20Mbps) (20Mbps) (20Mbps) (20Mbps)
>> 20:22 mark with 3,then
>>iptables -t mangle -A FORWARD -p tcp -o eth0 -s 0/0 --dport 80 -d 0/0 -j
>>MARK --set-mark 7
>> iptables -t mangle -A PREROUTING -p tcp -i eth0 -s 0/0
>>--dport 80 -d 0/0 -j MARK --set-mark 7
>> why all traffic from default 20 to Internet.(the iptables rules like no
>>use)
>So all traffic ends up in 20:20 ??
yes.blew my scripts.
tc qdisc del dev eth0 root
tc qdisc add dev eth0 root handle 20: htb default 20
tc class add dev eth0 parent 20: classid 20:1 htb rate 10240kbps ceil 10240kbps
tc class add dev eth0 parent 20:1 classid 20:20 htb rate 2048kbps ceil 2048kbps
tc qdisc add dev eth0 parent 20:20 sfq
tc class add dev eth0 parent 20:1 classid 20:21 htb rate 2048kbps ceil 2048kbps
tc qdisc add dev eth0 parent 20:21 sfq
tc class add dev eth0 parent 20:1 classid 20:22 htb rate 2048kbps ceil 2048kbps
tc qdisc add dev eth0 parent 20:22 sfq
tc class add dev eth0 parent 20:1 classid 20:23 htb rate 2048kbps ceil 2048kbps
tc qdisc add dev eth0 parent 20:23 sfq
tc class add dev eth0 parent 20:1 classid 20:24 htb rate 2048kbps ceil 2048kbps
tc qdisc add dev eth0 parent 20:24 sfq
tc filter add dev eth0 parent 20: protocol ip handle 1 fw classid 20:20
tc filter add dev eth0 parent 20: protocol ip handle 2 fw classid 20:21
tc filter add dev eth0 parent 20: protocol ip handle 3 fw classid 20:22
tc filter add dev eth0 parent 20: protocol ip handle 4 fw classid 20:23
tc filter add dev eth0 parent 20: protocol ip handle 5 fw classid 20:24
iptables -t mangle -A FORWARD -p tcp -o eth0 -s 0/0 --dport 80 -d 0/0 -j MARK --set-mark 3
iptables -t mangle -A PREROUTING -p tcp -i eth0 -s 0/0 --dport 80 -d 0/0 -j MARK --set-mark 3
>You can check with iptables -L -v -n if your iptables rules are matched. If
>the iptables rule match, the byte and packet counters will increase.
when I use iptable -L -v -n -t mangle,I have below infor
PREROUTING chain:
pkts bytes target prot opt in out source destination
305 40889 MARK tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 MARK set 0x3
FORWARD chain:
pkts bytes target prot opt in out source destination
0 0 MARK tcp -- * eth0 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 MARK set 0x3
why not stream through ForWard chain ? beacause this all traffic into 20:20(default class)?
---------------------------------
Do You Yahoo!?
"雅虎通网络KTV, 随时随地免费卡拉OK~~"
[-- Attachment #2: Type: text/html, Size: 4224 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [LARTC] How to do ensure bandwith
2003-03-24 6:05 [LARTC] How to do ensure bandwith liang jian
` (8 preceding siblings ...)
2003-04-02 1:31 ` liang jian
@ 2003-04-02 20:08 ` Stef Coene
2003-04-03 3:10 ` liang jian
10 siblings, 0 replies; 12+ messages in thread
From: Stef Coene @ 2003-04-02 20:08 UTC (permalink / raw)
To: lartc
> yes.blew my scripts.
> tc qdisc del dev eth0 root
> tc qdisc add dev eth0 root handle 20: htb default 20
> tc class add dev eth0 parent 20: classid 20:1 htb rate 10240kbps ceil
> 10240kbps tc class add dev eth0 parent 20:1 classid 20:20 htb rate 2048kbps
> ceil 2048kbps tc qdisc add dev eth0 parent 20:20 sfq
> tc class add dev eth0 parent 20:1 classid 20:21 htb rate 2048kbps ceil
> 2048kbps tc qdisc add dev eth0 parent 20:21 sfq
> tc class add dev eth0 parent 20:1 classid 20:22 htb rate 2048kbps ceil
> 2048kbps tc qdisc add dev eth0 parent 20:22 sfq
> tc class add dev eth0 parent 20:1 classid 20:23 htb rate 2048kbps ceil
> 2048kbps tc qdisc add dev eth0 parent 20:23 sfq
> tc class add dev eth0 parent 20:1 classid 20:24 htb rate 2048kbps ceil
> 2048kbps tc qdisc add dev eth0 parent 20:24 sfq
> tc filter add dev eth0 parent 20: protocol ip handle 1 fw classid 20:20
> tc filter add dev eth0 parent 20: protocol ip handle 2 fw classid 20:21
> tc filter add dev eth0 parent 20: protocol ip handle 3 fw classid 20:22
> tc filter add dev eth0 parent 20: protocol ip handle 4 fw classid 20:23
> tc filter add dev eth0 parent 20: protocol ip handle 5 fw classid 20:24
>
> iptables -t mangle -A FORWARD -p tcp -o eth0 -s 0/0 --dport 80 -d 0/0 -j
> MARK --set-mark 3 iptables -t mangle -A PREROUTING -p tcp -i eth0 -s 0/0
> --dport 80 -d 0/0 -j MARK --set-mark 3
Your script seems ok to me.
> >You can check with iptables -L -v -n if your iptables rules are matched.
> > If the iptables rule match, the byte and packet counters will increase.
>
> when I use iptable -L -v -n -t mangle,I have below infor
> PREROUTING chain:
> pkts bytes target prot opt in out source
> destination 305 40889 MARK tcp -- eth0 * 0.0.0.0/0
> 0.0.0.0/0 tcp dpt:80 MARK set 0x3 FORWARD chain:
> pkts bytes target prot opt in out source
> destination 0 0 MARK tcp -- * eth0 0.0.0.0/0
> 0.0.0.0/0 tcp dpt:80 MARK set 0x3
So the packets get marked.
> why not stream through ForWard chain ? beacause this all traffic into
> 20:20(default class)?
I suppose you execute
tc -s -d class show dev eth0
to see the counters increase for the 20:20 class and not for the other class?
If you didn't execute that command before, can you do so and check the
counters for the different classes?
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] 12+ messages in thread* Re: [LARTC] How to do ensure bandwith
2003-03-24 6:05 [LARTC] How to do ensure bandwith liang jian
` (9 preceding siblings ...)
2003-04-02 20:08 ` [LARTC] " Stef Coene
@ 2003-04-03 3:10 ` liang jian
10 siblings, 0 replies; 12+ messages in thread
From: liang jian @ 2003-04-03 3:10 UTC (permalink / raw)
To: lartc
[-- Attachment #1: Type: text/plain, Size: 3080 bytes --]
hi:
Stef and everybody
I use tc with htb more than one month.
This is my Network settings
Local Network 192.168.1.0/24 ---| eth0:192.168.1.1 Linux Box eth1:172.16.1.1 | -- Internet
In order to ensure bandwidth
on eth1 I have create a default 20
20:1 (10Mbps)
20:20 20:21 20:22 20:23 20:24
(20Mbps) (20Mbps) (20Mbps) (20Mbps) (20Mbps)
on eth0 I have create only a default 20
30:1 (10Mbps)
30:20
(10Mbps)
Each class is isolated so it never lends it unused bandwidth to other classes.
And each class is never using unused bandwidth from other classes.
first,eth1 and eth0 with same bandwith,I use eth1 Interface ensure totoal bandwith with 10Mbps. then I part eth1 with fine
qdisc.
My script that:
tc qdisc add dev eth0 root handle 20: htb default 20
tc class add dev eth0 parent 20: classid 20:1 htb rate 10240kbps ceil 10240kbps
tc class add dev eth0 parent 20:1 classid 20:20 htb rate 10240kbps ceil 10240kbps
tc qdisc add dev eth0 parent 20:20 sfq
tc qdisc del dev eth1 root
tc qdisc add dev eth1 root handle 30: htb default 20
tc class add dev eth1 parent 30: classid 30:1 htb rate 10240kbps ceil 10240kbps
tc class add dev eth1 parent 30:1 classid 30:20 htb rate 2048kbps ceil 2048kbps
tc qdisc add dev eth1 parent 30:20 sfq
tc class add dev eth1 parent 30:1 classid 30:21 htb rate 2048kbps ceil 2048kbps
tc qdisc add dev eth1 parent 30:21 sfq
tc class add dev eth1 parent 30:1 classid 30:22 htb rate 2048kbps ceil 2048kbps
tc qdisc add dev eth1 parent 30:22 sfq
tc class add dev eth1 parent 30:1 classid 30:23 htb rate 2048kbps ceil 2048kbps
tc qdisc add dev eth1 parent 30:23 sfq
tc class add dev eth1 parent 30:1 classid 30:24 htb rate 2048kbps ceil 2048kbps
tc qdisc add dev eth1 parent 30:24 sfq
tc filter add dev eth1 parent 30: protocol ip handle 1 fw classid 30:20
tc filter add dev eth1 parent 30: protocol ip handle 2 fw classid 30:21
tc filter add dev eth1 parent 30: protocol ip handle 3 fw classid 30:22
tc filter add dev eth1 parent 30: protocol ip handle 4 fw classid 30:23
tc filter add dev eth1 parent 30: protocol ip handle 5 fw classid 30:24
iptables -t mangle -A FORWARD -p tcp -o eth1 -s 192.168.1.2/32 --dport 80 -d 202.197.240.6/32 -j MARK --set-mark 3
iptables -t mangle -A PREROUTING -p tcp -i eth1 -s 192.168.1.2/32 --dport 80 -d 202.197.240.6/32 -j MARK --set-mark 3
iptables -t mangle -A FORWARD -p tcp -o eth1 -s 192.168.1.2/32 --dport 80 -d 195.27.176.155/32 -j MARK --set-mark 4
iptables -t mangle -A PREROUTING -p tcp -i eth1 -s 192.168.1.2/32 --dport 80 -d 195.27.176.155/32 -j MARK --set-mark 4
iptables -t mangle -A FORWARD -p tcp -o eth1 -s 192.168.1.2/32 --dport 80 -d 218.104.154.19/32 -j MARK --set-mark 5
iptables -t mangle -A PREROUTING -p tcp -i eth1 -s 192.168.1.2/32 --dport 80 -d 218.104.154.19/32 -j MARK --set-mark 5
I think that all traffic must thro eth0,then it will thro eth1 of one qdisc.
If my script is right ,I hope it will help newbie of tc.
If it mistake ,please everyone tell me :)
---------------------------------
Do You Yahoo!?
"雅虎通网络KTV, 随时随地免费卡拉OK~~"
[-- Attachment #2: Type: text/html, Size: 3477 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread