From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Ulitskiy Date: Wed, 25 Jun 2003 20:18:21 +0000 Subject: Re: [LARTC] u32 clarification...limits on 2000>??? MIME-Version: 1 Content-Type: multipart/mixed; boundary="Boundary-00=_NOg++LdAmy4LAZi" Message-Id: List-Id: References: In-Reply-To: To: lartc@vger.kernel.org --Boundary-00=_NOg++LdAmy4LAZi Content-Type: text/plain; charset="windows-1251" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, This is the script I'm using to create tc configuration to shape currently about 8000 ips separately so that each ip has guaranteed bandwith and cannot exceed it. The script can be used to shape up to class B. The configuration is using double hashing for filtering rules. I haven't used it in production yet, but it shows pretty good result on a testbed. To test it further I've created configuration to shape range 192.168.1.0-192.168.254.0 (almost class B), i.e.about 65000 classes and about 65000 filters. It takes very long time to apply on my rather slow (P166mmx) test machine, but it doesn't throw a word of complaint. Creating configuration: root@test:~/perl/qos# time ./qos.conf real 0m42.733s user 0m40.950s sys 0m0.490s It creates file rc.qos. Applying configuration: root@test:~/perl/qos# time . ./rc.qos real 125m48.033s user 28m40.660s sys 95m59.420s root@radtest:~/perl/qos# tc qdisc ls | wc -l 64520 root@radtest:~/perl/qos# tc filter ls dev eth0 parent 13:0 | wc -l 129042 (2 output lines for a filter). So the answer to your question most likely is no. There's no limit. Hint: I've experienced something like that when I tried to use precompiled binary (actually I compiled it myself but on different machine). The errors were gone after I recompiled tc from the same sources on the machine where it's being used. Could be some libraries incompatibilities or changes made to some header files. So look at the script if you're interested. Michael p.s. I'm not sure that larts list manager will allow attachment through. If it doesn't and you want the script - email me. On Tuesday 24 June 2003 06:13 pm, Trevor Warren wrote: > Hello, > > If this isn't a limit of U32 filters then whats wrong with the way i > have set things up???. The issue has to be somewhere right. > > Also, i do appreciate you not wanting to give me your config. But at > least give me a couple of lines of your U32 filter usage such that i can > make 5000> filters using it and test. Only passing your u32 filter > config.....if its your equivalent to IP then its fine with me...:) > > I will have the test script mailed across to all. I am in DESPERATE > need for help on this part......:( > > Trevor > > > On Wed, 2003-06-25 at 12:55, Catalin BOIE wrote: > > > Hello, > > Hello! > > > > > I do understand that limits on u32 filters > 2000 have never been > > > encountered. Run this script which is base on htb and lemme know. You > > > will need 2.4.20 > and tc compiled for htb. > > > > It gives me a lot of "RTNETLINK answers: File exists". > > This doesn't seems to be a limit. > > > > > Can you please send me your config and lemme compare the same against > > > mine. > > I have main in a database. I cannot give it to you, but trust me that are > > 50000 filters. > > > > Try to use hashes to reduce the kernel pressure. > > > > > > > > Trevor > > > > > > > > > On Tue, 2003-06-24 at 15:49, Catalin BOIE wrote: > > > > On Tue, 24 Jun 2003, Trevor Warren wrote: > > > > > > > > > > > > > > Can some one please confirm which would be the best place to clarify > > > > > these U32 issues and 2048 U32 filter limitations as i had posted in my > > > > > previous mail. > > > > > > > > > > Trevor > > > > > > > > We have 50000 filters and still working. > > > > I don't think there is a limit. --Boundary-00=_NOg++LdAmy4LAZi Content-Type: application/x-perl; name="qos.conf" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="qos.conf" #!/usr/bin/perl -w use strict; my $OUTFILE='rc.qos'; my $RANGESTART='192.168.1'; my $RANGEEND='192.168.254'; my @EXCLUDE; #my @EXCLUDE=('192.168.10.0-192.168.10.255','192.168.15.192-192.168.15.255', # '192.168.21.25'); my $IPSTART='1'; my $IPEND='254'; my $IF='eth0'; my $TC='/root/bin/tc'; my $RATE='30kbps'; sub init(); sub exclude($); my ($oct12,$oct3start,$oct3end,$oct4start,$oct4end); init(); open(FH,">$OUTFILE") or die("cannot create $OUTFILE: $!"); print FH </dev/null $TC filter del dev $IF protocol ip parent 1:0 prio 4 2>/dev/null $TC qdisc del dev $IF root 2>/dev/null #--- End cleaning --- #root qdisc $TC qdisc add dev $IF root handle 1: prio bands 3 $TC qdisc add dev $IF parent 1:1 handle 11: pfifo $TC qdisc add dev $IF parent 1:2 handle 12: pfifo $TC qdisc add dev $IF parent 1:3 handle 13: htb EOF print FH "#--- classes for user ips ---\n"; for(my $i=$oct3start;$i<=$oct3end;$i++) { for(my $j=$oct4start;$j<=$oct4end;$j++) { next if (exclude("$oct12.$i.$j")); printf FH "$TC class add dev $IF parent 13: classid 13:%02x%02x htb rate $RATE\n", $i,$j; printf FH "$TC qdisc add dev $IF parent 13:%02x%02x handle %02x%02x pfifo\n", $i,$j,$i,$j; } } print FH "#--- end of classes for user ips ---\n"; print FH <=$s3 and $c3<=$e3) { if ( $c4>=$s4 and $c4 <=$e4 ) { return 1; } } } return 0; } --Boundary-00=_NOg++LdAmy4LAZi-- _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/