Ivan Lopez wrote: > > On Mon, 02 Jul 2001 17:09:22 -0500 > Nikolai Vladychevski <niko@xxxxxxxxxxxxxxx> wrote: > > > > ness wrote: > > > experements I understand that it don't prioritize packets AT ALL. > > > (I'll be glad > > > to hear that I'm wrong...) > > > > > > > does not in my tests, I am also looking why .... > > i was playing with net/sched/sch_prio.c, trying to analize what it does > and modifying it just for write some crap in syslog and debug > > i've done a few tests, ie doing a heavy upload and ping another machine > over internet, putting icmp packets into band 0 of the prio qdisc, and the > rest into band 1, and what i see is that the prio qdisc actually > classifies packets into its bands according to filters you define, and in > fact dequeues first all packets from the bands with the most priority... > but the final result is not as expected, and i have the same delay as if i > don't use any qos... i've tried attaching some different qdisc to the > bands of the prio qdisc: tbf, sfq, just fifos... > > it seems to me its that prio does its work just ok, but the problem is > that the networking code is making dequeue the packets more fast than the > link can transmit them, without care about if they are accumulating again > at some point after > This is true. PRIO works. The following is my setup for a LAN that is masqueraded on a 56K modem link: #! /bin/bash -x tc qdisc add dev eth0 root handle 1: prio tc qdisc add dev eth0 parent 1:1 handle 2: tbf limit 1600 burst 2600 rate 28800 tc filter add dev eth0 parent 1:0 protocol ip prio 1 u32 match ip dst 192.168.1.2 classid 1:1 tc filter add dev eth0 parent 1:0 protocol ip prio 7 u32 match ip dst 192.168.1.4 classid 1:1 iptables -A PREROUTING -i eth0 -s 192.168.1.2 -t mangle -j MARK --set-mark 2 iptables -A PREROUTING -i eth0 -s 192.168.1.4 -t mangle -j MARK --set-mark 4 tc qdisc add dev ppp0 root handle 2: prio tc qdisc add dev ppp0 parent 2:1 handle 3: tbf limit 1600 burst 2600 rate 28800 tc filter add dev ppp0 protocol ip parent 2:0 prio 1 handle 2 fw classid 2:1 tc filter add dev ppp0 protocol ip parent 2:0 prio 7 handle 4 fw classid 2:1 This script creates a virutal channel on eth0 that somewhat equal to 56K modem (well, I have to tune the TBF , did not yet finished that part) , so when prio dequeues the packets TBF just drops those that are overloading the bandwidth..... The ip 192.168.1.4 has the highest priority (band 0) , the 192.168.1.2 the lowest (band 2) I tested this with FTP and Web. Since it's a strict priority scheduler, if both machines make the download over ftp, the downloads for 192.168.1.2 just stop after some time and 192.168.1.4 keeps downloading at full. When you stop downloading on 192.168.1.4 and the connection isn't timed out by ftp client on the machine .2, it returns to the normal download rate. The only thing left to do is tune the TBF correctly to be equal to the bandwidth of the outgoing link ... Regards Nikolai