Hi Junus Junarto D, I still have the same problem of limiting the outgoing traffic. I''m limiting the incoming traffic perfectily with the script: tc qdisc add dev eth1 root handle 1:0 cbq bandwidth 256Kbit avpkt 1000 cell 8 tc class add dev eth1 parent 1:0 classid 1:1 cbq bandwidth 256Kbit rate \ 256Kbit weight 20Kbit prio 8 allot 1514 cell 8 maxburst 20 avpkt 1000 tc class add dev eth1 parent 1:1 classid 1:10 cbq bandwidth 256Kbit rate \ 64Kbit weight 6Kbit prio 5 allot 1514 cell 8 maxburst 20 avpkt 1000 bounded tc qdisc add dev eth1 parent 1:10 tbf rate 64Kbit buffer 10Kb/8 limit 15Kb \ mtu 1500 tc filter add dev eth1 parent 1:0 protocol ip prio 100 u32 match ip dst \ 10.0.5.2 flowid 1:10 But when I try to limit the incoming traffic I still have the same problem that it does not limit. And I still doesn''t know why. I used your and my script and everything happens like there is no shaper... The outgoing traffic script is: tc qdisc add dev eth0 root handle 2:0 cbq bandwidth 256Kbit avpkt 1000 \ cell 8 tc class add dev eth0 parent 2:0 classid 2:1 cbq bandwidth 256Kbit rate \ 256Kbit weight 20Kbit prio 8 allot 1514 cell 8 maxburst 20 avpkt 1000 tc class add dev eth0 parent 2:1 classid 2:10 cbq bandwidth 256Kbit rate \ 64Kbit weight 6Kbit prio 5 allot 1514 cell 8 maxburst 20 avpkt 1000 bounded tc qdisc add dev eth0 parent 2:10 tbf rate 64Kbit buffer 10Kb/8 limit \ 15Kb mtu 1500 tc filter add dev eth0 parent 2:0 protocol ip prio 100 u32 match ip src \ 10.0.5.2 flowid 2:10 But, thanx a lot... Bruno
I''m sorry, I forget that you use masquerade so it makes src 10.0.5.2 will not appear in the outgoing packet. So this is the correct your outgoing script: ipchains -A forward -s 10.0.5.0/24 -j MASQ -m 0x1 tc qdisc add dev eth0 root handle 2:0 cbq bandwidth 256Kbit avpkt 1000 \ cell 8 tc class add dev eth0 parent 2:0 classid 2:1 cbq bandwidth 256Kbit rate \ 256Kbit weight 20Kbit prio 8 allot 1514 cell 8 maxburst 20 avpkt 1000 tc class add dev eth0 parent 2:1 classid 2:10 cbq bandwidth 256Kbit rate \ 64Kbit weight 6Kbit prio 5 allot 1514 cell 8 maxburst 20 avpkt 1000 bounded tc qdisc add dev eth0 parent 2:10 tbf rate 64Kbit buffer 10Kb/8 limit \ 15Kb mtu 1500 tc filter add dev eth0 parent 2:0 protocol ip prio 100 handle 1 fw classid 2:10> But when I try to limit the incoming traffic I still have the same problem > that it does not limit. And I still doesn''t know why. I used your and my > script and everything happens like there is no shaper... > The outgoing traffic script is: > > tc qdisc add dev eth0 root handle 2:0 cbq bandwidth 256Kbit avpkt 1000 \ > cell 8 > > tc class add dev eth0 parent 2:0 classid 2:1 cbq bandwidth 256Kbit rate \ > 256Kbit weight 20Kbit prio 8 allot 1514 cell 8 maxburst 20 avpkt 1000 > > tc class add dev eth0 parent 2:1 classid 2:10 cbq bandwidth 256Kbit rate \ > 64Kbit weight 6Kbit prio 5 allot 1514 cell 8 maxburst 20 avpkt 1000 > bounded > > tc qdisc add dev eth0 parent 2:10 tbf rate 64Kbit buffer 10Kb/8 limit \ > 15Kb mtu 1500 > > tc filter add dev eth0 parent 2:0 protocol ip prio 100 u32 match ip src \ > 10.0.5.2 flowid 2:10 > > But, thanx a lot... > > Bruno
Hi, I''ve done some tests with some differents implementations, here are some problems and solutions :), I had.. First I tried to use my first script to limit the outgoing traffic (with little changes) : tc qdisc add dev eth0 root handle 1:0 cbq bandwidth 256Kbit avpkt 1000 tc class add dev eth0 parent 1:0 classid 1:1 cbq bandwidth 256Kbit rate \ 64Kbit allot 1514 weight 6Kbit prio 8 maxburst 20 avpkt 1000 tc class add dev eth0 parent 1:1 classid 1:11 cbq bandwidth 256Kbit rate \ 64Kbit allot 1514 weight 6Kbit prio 5 maxburst 20 avpkt 1000 split 1:1 tc qdisc add dev eth0 parent 1:11 sfq quantum 1514b perturb 15 tc filter add dev eth0 parent 1:0 protocol ip prio 100 handle 1 fw classid \ 1:11 As I know it didn''t work. For me it was normal because I''ve done many tests with it... Then I decided to change the line you told me was wrong, so I used this script: tc qdisc add dev eth0 root handle 1:0 cbq bandwidth 256Kbit avpkt 1000 tc class add dev eth0 parent 1:0 classid 1:1 cbq bandwidth 256Kbit rate \ 64Kbit allot 1514 weight 6Kbit prio 8 maxburst 20 avpkt 1000 tc class add dev eth0 parent 1:1 classid 1:11 cbq bandwidth 256Kbit rate \ 64Kbit allot 1514 weight 6Kbit prio 5 maxburst 20 avpkt 1000 bounded tc qdisc add dev eth0 parent 1:11 sfq quantum 1514b perturb 15 tc filter add dev eth0 parent 1:0 protocol ip prio 100 handle 1 fw classid \ 1:11 And again it didn''t work. Then I remembered that you told me that tbf is better than sfq to use, so I used that last script changing the sfq''s line to: tc qdisc add dev eth0 parent 1:11 tbf rate 64kbit buffer 10Kb/8 limit 15Kb \mtu 1500 So it work as I''ve known (because I''ve tested a script like that an it worked). Then to a final test I changed back the bounded to split in the third line and it limited the traffic. After all, my doubt is if the problem is the sfq, because tbf worked perfectily (in the two cases!!). So if you or someone has a good documentation about the both please send me... thanks a lot, Bruno On Monday 08 January 2001 16:47, you wrote:> Your welcome. I glad to hear that :) > It should work, if it don''t work, then I will be wondering too :) > > Hey.. I tried to analyze your first script that use with ipchains fw too. > Maybe the wrong command is at this command: > > tc class add dev eth0 parent 1:2 classid 1:11 cbq bandwidth 128Kbit rate > 128Kbit allot 1514 weight 2Kbit prio 5 maxburst 20 avpkt 1000 split 1:2 > > I think if you use ''split'', your filtered client (ip 10.0.5.2) can still > use reserve bandwidth if it''s the only client used the traffic at that > time. But if you use ''bounded'', the traffic of filtered client will be > strictly bounded at that rate. > Please tried your first outgoing script with ipchains fw with another > client that use the traffic too. > I''m still learning this things too, so let me know if it doesn''t work. > I''m glad that I can learn this QoS with you. > > Best Regards, > Junus Junarto D.