How to do ensure a class not lended and not borrowed each other. I do cburst burst 0b ,but ctokens tokens go to negative! --------------------------------- Do You Yahoo!? "更多惊喜,同样精彩,NetVista A30 热卖" --0-611462377-1048485942=:33792 Content-Type: text/html; charset=gb2312 Content-Transfer-Encoding: 8bit <P>How to do ensure a class not lended and not borrowed each other.</P> <P>I do cburst burst 0b ,but ctokens tokens go to negative!</P><p><br><hr size=1><b>Do You Yahoo!?</b><br> <a href="http://ad.cn.doubleclick.net/clk;5313999;7930402;p?http://www.ibm.com/cn/promotion/pc/netvista_a30/index.shtml">"更多惊喜,同样精彩,NetVista A30 热卖"</a> --0-611462377-1048485942=:33792-- _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
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/
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 热卖"
--0-1747638489-1048558718=:622
Content-Type: text/html; charset=gb2312
Content-Transfer-Encoding: 8bit
<P>Htb tree:
<P>                     
20:1
<P>      
20:10                
20:11
<P>20:200  20:201    
20:210  20:211
<P>http stream ensure 4Mbps
<P>ftp stream ensure 2Mbps
<P>smtp stream ensure 2MMbps
<P>other stream ensure 2Mbps
<P>so I want ensure 20:200 have 4Mbps for http
<P>20:201 have 2Mbps for ftp and 20:210 have 2Mbps for smtp 
<P>20:211 have 2Mbps for other stream(default class )
<P>Each class don''t permit lended or borrowed bandwith from each
other.
<P>This is I want to get.
<P>> <B><I>Stef Coene
<stef.coene@docum.org></I></B> wrote:
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT:
#1010ff 2px solid">>On Monday 24 March 2003 07:05, liang jian
wrote:<BR>>> How to do ensure a class not lended and not
borrowed each other.<BR>>That also depends on the setup of the
other classes. Can you give us >more <BR>>information like
htb or cbq? What do you want to do? What have you tried >so
<BR>>far?<BR><BR>> I do cburst burst 0b ,but
ctokens tokens go to negative!<BR>>You always needs a minimum burst
and cburst. If you use htb and if you >don''t
<BR>>specify it on the command line, htb will calculate it for
you.<BR><BR>>Stef<BR><BR><BR>>--
<BR><BR>>stef.coene@docum.org<BR>>"Using
Linux as bandwidth
manager"<BR>>http://www.docum.org/<BR>>#lartc @
irc.oftc.net<BR><BR></BLOCKQUOTE><p><br><hr
size=1><b>Do You Yahoo!?</b><br>
<a
href="http://ad.cn.doubleclick.net/clk;5313999;7930402;p?http://www.ibm.com/cn/promotion/pc/netvista_a30/index.shtml">"更多惊喜,同样精彩,NetVista
A30 热卖"</a>
--0-1747638489-1048558718=:622--
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
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/
>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.netYes ,that is my means :),my english is poor --------------------------------- Do You Yahoo!? "雅虎通网络KTV, 随时随地免费卡拉OK~~" --0-1938692027-1048656632=:59020 Content-Type: text/html; charset=gb2312 Content-Transfer-Encoding: 8bit <P>  <P> ><B><I>Stef Coene <stef.coene@docum.org></I></B> wrote: <BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">>On Tuesday 25 March 2003 03:18, liang jian wrote:<BR>>> Htb tree:<BR>>> 20:1<BR>>> 20:10 20:11<BR>>> 20:200 20:201 20:210 20:211<BR>>> http stream ensure 4Mbps<BR>>> ftp stream ensure 2Mbps<BR>>> smtp stream ensure 2MMbps<BR>>> other stream ensure 2Mbps<BR>>> so I want ensure 20:200 have 4Mbps for http<BR>>> 20:201 have 2Mbps for ftp and 20:210 have 2Mbps for smtp<BR>>> 20:211 have 2Mbps for other stream(default class )<BR>>> Each class don''t permit lended or borrowed bandwith from each other.<BR>>> This is I want to get.<BR>>Can you try to explain it a bit more? <BR><BR>>You created 4 classes, (200, 201, 210, 211) so I suppose you want :<BR>>200 : http traffic, 4Mbps<BR>>201 : ftp traffic, 2Mbps<BR>>210 : smtp traffic, 2Mbps<BR>>211 : other trafic, 2Mbps<BR><BR>>Each class is isolated so it never lends it unused bandwidth to other >classes. <BR>>And each class is never using unused bandwidth from other classes. So >as <BR>>example, http has 4Mbps and it never can use the bandwidth of ftp (2Mbps) if <BR>>there is no ftp traffic. So the 4Mbps is a maximum bandwidth.<BR><BR>>What''s the total bandiwidth available? You have 4Mbps for http and >3x2Mbps <BR>>for ftp,smtp,other. So the total bandwidth available on the link is 10Mbps?<BR><BR>>Stef<BR><BR>>-- <BR><BR>>stef.coene@docum.org<BR>>"Using Linux as bandwidth manager"<BR>>http://www.docum.org/<BR><STRONG>>#</STRONG>lartc @ irc.oftc.net<BR><BR>Yes ,that is my means :),my english is poor</BLOCKQUOTE><p><br><hr size=1><b>Do You Yahoo!?</b><br> <a href="http://rd.yahoo.com/mail_cn/tag/?http://cn.messenger.yahoo.com//chat/index.html ">"雅虎通网络KTV, 随时随地免费卡拉OK~~"</a> --0-1938692027-1048656632=:59020-- _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
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 poorNo 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/
> Yes ,that is my means :),my english is poorNo 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~~" --0-1457748674-1049101946=:20655 Content-Type: text/html; charset=gb2312 Content-Transfer-Encoding: 8bit <P><BR>> Yes ,that is my means :),my english is poor<BR>No problem.<BR><BR>I have some remarks. Why not let the 4 classes borrow unused bandwidth from <BR>each other? So if there is no other traffic then ftp, ftp can get 10Mbps. <BR>But as soone as there is some other traffic, the ftp traffic goes down.<BR><BR>And if you want 4 isolated classes, why not just creating the 4 classes like <BR>this :<BR><BR>20:1<BR>20:200 20:201 20:210 20:211<BR><BR>You have to create the htb (or cbq) classes. FIltering the traffic and <BR>placing in the classes is easy (you can filter on ports). Except maybe for <BR>the ftp traffic because that uses dynamic ports.<BR><BR><BR>Stef:<BR>Thanks for your answer me quickly!<BR>I have others question :)<BR>I apologize that it will take time.<BR>My topological look like this:<BR>Local:192.168.1.2----------|eth0:192.168.1.1 Linux Box eth1:172.16.1.1|------Internet</P> <P>I have create a default 200</P> <P>             20:1 (4kbps)<BR>200:200 200:201 200:210 200:211<BR>(1kbps) (1kbps) (1kbps) (1kbps)</P> <P>I have 10Mbps on the eth1,but I want to test htb,so I do that:<BR>tc class add dev eth0 parent 20: classid 20:1 htb rate 4kbps ceil 4kbps<BR> </P> <P>200:201 mark with 7,then <BR>iptables -t mangle -A FORWARD -p tcp -o eth0 -s 0/0 --dport 80 -d 0/0 -j MARK --set-mark 7<BR>iptables -t mangle -A PREROUTING -p tcp -i eth0 -s 0/0 --dport 80 -d 0/0 -j MARK --set-mark 7</P> <P>why all traffic from default 200 to Internet.(the iptables rules like no use)</P> <P><BR>------------------------------------------------</P> <P>If I use it on eth1 interface iptables rules work!?(though I have default class 200 but all traffice <BR>from 200:201 to Internet.) other question it that:<BR>In this settings use Local machine 192.168.1.2 download some soft from Internet.why it rate overrun 1kbps?<BR> <BR>Rules like this:<BR>tc class add dev eth1 parent 20: classid 20:1 htb rate 4kbps ceil 4kbps</P> <P>iptables -t mangle -A FORWARD -p tcp -o eth1 -s 0/0 --dport 80 -d 0/0 -j MARK --set-mark 7<BR>iptables -t mangle -A PREROUTING -p tcp -i eth1 -s 0/0 --dport 80 -d 0/0 -j MARK --set-mark 7</P> <P>tc can only shape outgoing traffic(My settings which is my outgoing traffic,eth1 or eth0?) Maybe I mix them<BR>I need path kernel with IMQ?<BR></P><p><br><hr size=1><b>Do You Yahoo!?</b><br> <a href="http://rd.yahoo.com/mail_cn/tag/?http://cn.messenger.yahoo.com//chat/index.html ">"雅虎通网络KTV, 随时随地免费卡拉OK~~"</a> --0-1457748674-1049101946=:20655-- _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
>> 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~~" --0-177854834-1049101979=:64622 Content-Type: text/html; charset=gb2312 Content-Transfer-Encoding: 8bit <P><BR>>> Yes ,that is my means :),my english is poor<BR>>No problem.<BR><BR>>I have some remarks. Why not let the 4 classes borrow unused bandwidth from <BR>>each other? So if there is no other traffic then ftp, ftp can get 10Mbps. <BR>>But as soone as there is some other traffic, the ftp traffic goes down.<BR><BR>>And if you want 4 isolated classes, why not just creating the 4 classes like <BR>>this :<BR><BR>>20:1<BR>>20:200 20:201 20:210 20:211<BR><BR>>You have to create the htb (or cbq) classes. FIltering the traffic and <BR>>placing in the classes is easy (you can filter on ports). Except maybe for <BR>>the ftp traffic because that uses dynamic ports.<BR><BR><BR>Stef:<BR>Thanks for your answer me quickly!<BR>I have others question :)<BR>I apologize that it will take time.<BR>My topological look like this:<BR>Local:192.168.1.2----------|eth0:192.168.1.1 Linux Box eth1:172.16.1.1|------Internet</P> <P>I have create a default 200</P> <P>             20:1 (4kbps)<BR>200:200 200:201 200:210 200:211<BR>(1kbps) (1kbps) (1kbps) (1kbps)</P> <P>I have 10Mbps on the eth1,but I want to test htb,so I do that:<BR>tc class add dev eth0 parent 20: classid 20:1 htb rate 4kbps ceil 4kbps<BR> </P> <P>200:201 mark with 7,then <BR>iptables -t mangle -A FORWARD -p tcp -o eth0 -s 0/0 --dport 80 -d 0/0 -j MARK --set-mark 7<BR>iptables -t mangle -A PREROUTING -p tcp -i eth0 -s 0/0 --dport 80 -d 0/0 -j MARK --set-mark 7</P> <P>why all traffic from default 200 to Internet.(the iptables rules like no use)</P> <P><BR>------------------------------------------------</P> <P>If I use it on eth1 interface iptables rules work!?(though I have default class 200 but all traffice <BR>from 200:201 to Internet.) other question it that:<BR>In this settings use Local machine 192.168.1.2 download some soft from Internet.why it rate overrun 1kbps?<BR> <BR>Rules like this:<BR>tc class add dev eth1 parent 20: classid 20:1 htb rate 4kbps ceil 4kbps</P> <P>iptables -t mangle -A FORWARD -p tcp -o eth1 -s 0/0 --dport 80 -d 0/0 -j MARK --set-mark 7<BR>iptables -t mangle -A PREROUTING -p tcp -i eth1 -s 0/0 --dport 80 -d 0/0 -j MARK --set-mark 7</P> <P>tc can only shape outgoing traffic(My settings which is my outgoing traffic,eth1 or eth0?) Maybe I mix them<BR>I need path kernel with IMQ?<BR></P><p><br><hr size=1><b>Do You Yahoo!?</b><br> <a href="http://rd.yahoo.com/mail_cn/tag/?http://cn.messenger.yahoo.com//chat/index.html ">"雅虎通网络KTV, 随时随地免费卡拉OK~~"</a> --0-177854834-1049101979=:64622-- _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
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 4kbps4 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/
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~~" --0-1228484467-1049247083=:83376 Content-Type: text/html; charset=gb2312 Content-Transfer-Encoding: 8bit <P>hi:<BR>Stef<BR>>> Stef:<BR>>> Thanks for your answer me quickly!<BR>>> I have others question :)<BR>>I have some problems understanding your english.  Can you post your htb and <BR>>iptabels script so I can understand what you did?</P> <P>>> I apologize that it will take time.<BR>>> My topological look like this:<BR>>> Local:192.168.1.2----------|eth0:192.168.1.1 Linux Box<BR>>> eth1:172.16.1.1|------Internet<BR>>><BR>>> I have create a default 200</P> <P>>>              20:1 (10Mbps)<BR>>> 20:20 20:21 20:22 20:23 20:24<BR>>>(20Mbps) (20Mbps) (20Mbps) (20Mbps) (20Mbps)</P> <P><BR>>> 20:22 mark with 3,then<BR>>>iptables -t mangle -A FORWARD -p tcp -o eth0 -s 0/0 --dport 80 -d 0/0 -j<BR>>>MARK --set-mark 7 <BR>>> iptables -t mangle -A PREROUTING -p tcp -i eth0 -s 0/0<BR>>>--dport 80 -d 0/0 -j MARK --set-mark 7</P> <P>>> why all traffic from default 20 to Internet.(the iptables rules like no<BR>>>use)<BR>>So all traffic ends up in 20:20 ??<BR>yes.blew my scripts.<BR>tc qdisc del dev eth0 root<BR>tc qdisc add dev eth0 root handle 20: htb default 20<BR>tc class add dev eth0 parent 20: classid 20:1 htb rate 10240kbps ceil 10240kbps<BR>tc class add dev eth0 parent 20:1 classid 20:20 htb rate 2048kbps ceil 2048kbps<BR>tc qdisc add dev eth0 parent 20:20 sfq<BR>tc class add dev eth0 parent 20:1 classid 20:21 htb rate 2048kbps ceil 2048kbps<BR>tc qdisc add dev eth0 parent 20:21 sfq<BR>tc class add dev eth0 parent 20:1 classid 20:22 htb rate 2048kbps ceil 2048kbps<BR>tc qdisc add dev eth0 parent 20:22 sfq<BR>tc class add dev eth0 parent 20:1 classid 20:23 htb rate 2048kbps ceil 2048kbps<BR>tc qdisc add dev eth0 parent 20:23 sfq<BR>tc class add dev eth0 parent 20:1 classid 20:24 htb rate 2048kbps ceil 2048kbps<BR>tc qdisc add dev eth0 parent 20:24 sfq<BR>tc filter add dev eth0 pare nt 20: protocol ip  handle 1 fw classid  20:20<BR>tc filter add dev eth0 parent 20: protocol ip  handle 2 fw classid  20:21<BR>tc filter add dev eth0 parent 20: protocol ip  handle 3 fw classid  20:22<BR>tc filter add dev eth0 parent 20: protocol ip  handle 4 fw classid  20:23<BR>tc filter add dev eth0 parent 20: protocol ip  handle 5 fw classid  20:24</P> <P>iptables -t mangle -A FORWARD -p tcp -o eth0 -s 0/0 --dport 80 -d 0/0 -j MARK --set-mark 3<BR>iptables -t mangle -A PREROUTING -p tcp -i eth0 -s 0/0 --dport 80 -d 0/0 -j MARK --set-mark 3</P> <P>>You can check with iptables -L -v -n if your iptables rules are matched.  If <BR>>the iptables rule match, the byte and packet counters will increase.</P> <P>when I use iptable -L -v -n -t mangle,I have below infor<BR>PREROUTING chain:<BR> pkts bytes target     prot opt in     out     source               destination<BR> 305 40889  MARK       tcp  --  eth0   *       0.0.0.0/0            0.0.0.0/0          tcp dpt:80 MARK set 0x3<BR>FORWARD chain:<BR> pkts bytes target     prot opt in     out     source               destination<BR> 0     0    MARK       tcp  --  *      eth0     0.0.0.0/0            0.0.0.0/0          tcp dpt:80 MARK set 0x3</P> <P>why not stream through ForWard chain ? beacause this all traffic into 20:20(default class)?</P><p><br><hr size=1><b>Do You Yahoo!?</b><br> <a href="http://rd.yahoo.com/mail_cn/tag/?http://cn.messenger.yahoo.com//chat/index.html ">"雅虎通网络KTV, 随时随地免费卡拉OK~~"</a> --0-1228484467-1049247083=:83376-- _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
> 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 3Your 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 0x3So 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/
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~~"
--0-1052141136-1049339453=:84722
Content-Type: text/html; charset=gb2312
Content-Transfer-Encoding: 8bit
<P>hi:<BR>Stef and everybody<BR>I use tc with htb more than
one month.<BR>This is my Network settings
<P>Local Network 192.168.1.0/24 ---| eth0:192.168.1.1 Linux Box
eth1:172.16.1.1 | -- Internet
<P>In order to ensure bandwidth<BR>on eth1 I have create a default
20
<P>             
20:1 (10Mbps)<BR> 20:20 20:21 20:22 20:23 20:24<BR>(20Mbps)
(20Mbps) (20Mbps) (20Mbps) (20Mbps)
<P>on eth0 I have create only a default
20<BR>    30:1
(10Mbps)<BR> 30:20<BR>(10Mbps)
<P>Each class is isolated so it never lends it unused bandwidth to other
classes.  <BR>And each class is never using unused bandwidth from
other classes.
<P>first,eth1 and eth0 with same bandwith,I use eth1 Interface ensure
totoal bandwith with 10Mbps. then I part eth1 with fine
<BR>qdisc.<BR>My script that:
<P>tc qdisc add dev eth0 root handle 20: htb default 20<BR>tc class
add dev eth0 parent 20: classid 20:1 htb rate 10240kbps ceil
10240kbps<BR>tc class add dev eth0 parent 20:1 classid 20:20 htb rate
10240kbps ceil 10240kbps<BR>tc qdisc add dev eth0 parent 20:20 sfq
<P>tc qdisc del dev eth1 root<BR>tc qdisc add dev eth1 root handle
30: htb default 20<BR>tc class add dev eth1 parent 30: classid 30:1 htb
rate 10240kbps ceil 10240kbps<BR>tc class add dev eth1 parent 30:1 classid
30:20 htb rate 2048kbps ceil 2048kbps<BR>tc qdisc add dev eth1 parent
30:20 sfq<BR>tc class add dev eth1 parent 30:1 classid 30:21 htb rate
2048kbps ceil 2048kbps<BR>tc qdisc add dev eth1 parent 30:21
sfq<BR>tc class add dev eth1 parent 30:1 classid 30:22 htb rate 2048kbps
ceil 2048kbps<BR>tc qdisc add dev eth1 parent 30:22 sfq<BR>tc class
add dev eth1 parent 30:1 classid 30:23 htb rate 2048kbps ceil
2048kbps<BR>tc qdisc add dev eth1 parent 30:23 sfq<BR>tc class add
dev eth1 parent 30:1 classid 30:24 htb rate 2048kbps ceil 2048kbps<BR>tc
qdisc add dev eth1 parent 30:24 sfq<BR>tc filter add dev eth1 parent 30:
protocol ip  handle 1 fw classid  30:20<BR>tc filter add
dev eth1 parent 30: protocol ip  handle 2 fw classid 
30:21<BR>tc filter add dev e
 
 th1 parent 30: protocol ip  handle 3 fw classid 
30:22<BR>tc filter add dev eth1 parent 30: protocol ip  handle 4
fw classid  30:23<BR>tc filter add dev eth1 parent 30: protocol
ip  handle 5 fw classid  30:24 
<P><BR>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<BR>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<BR>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<BR>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<BR>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<BR>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
<P><BR>I think that all traffic must thro eth0,then it will thro
eth1 of one qdisc.
<P>If my script is right ,I hope it will help newbie of tc.<BR>If it
mistake ,please everyone tell me :)</P><p><br><hr
size=1><b>Do You Yahoo!?</b><br>
<a
href="http://rd.yahoo.com/mail_cn/tag/?http://cn.messenger.yahoo.com//chat/index.html
">"雅虎通网络KTV, 随时随地免费卡拉OK~~"</a>
--0-1052141136-1049339453=:84722--
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/