I needed router that can do "bidirectional" shaping in interface. I''m using IMQ + TBF for that at the moment. One ethernet interface is connected to "backbone", other has many vlan''s. Every vlan is "connected" to IMQ device. I have wrapper scripts for maintaining this stuff and it works like a charm. But there is problem though - router can handle more, but I''m running out of IMQ devices. Default is 16 devices, but it is possible to change it in linux/include/imq.h. Theoretical maximum is 127. There is bug is imq module btw, it refuses to accept bigger number of numdevs argument than 99. But router really can handle more. So, any ideas? 1) It is router, nothing more. No any services here. 2) Solution should be really simple because configuration changes really often. 3) Shaping "upload" only in backbone interface isn''t solution. 4) No need for obvious "solutions" like - buy another box ;). regards, PS. I posted with wrong from address at first. Sorry if it would be duplicate. -- Hasso Tepper Elion Enterprises Ltd. WAN administrator _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Hasso Tepper wrote:>But there is problem though - router can handle more, but I''m running >out of IMQ devices. Default is 16 devices, but it is possible to >change it in linux/include/imq.h. Theoretical maximum is 127. There >is bug is imq module btw, it refuses to accept bigger number of >numdevs argument than 99. But router really can handle more. >The default is 2 devices. I can not imagine why there should be a 99 device limit, there is one such limit in net/core/dev.c:dev_alloc_name, but imq doesn''t use that function. I can''t really imagine alloc_netdev calling dev_alloc_name because the caller chooses it''s own name, but i haven''t checked. if you want to make sure, change dev_alloc_name to support more than 100 devices (trivial) and try again. Please inform me in case of success. Bye, Patrick _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
May you need mark packets with iptables and one IMQ device with htb queue Something like iptables -t mangle -A PREROUTING -i intf1 -j MARK --set-mark 1 ..... iptables -t mangle -A PREROUTING -i intfN -j MARK --set-mark N iptables -t mangle -A PREROUTING -j IMQ And to imq0 attach HTB qdisc with shaping according to mark value On Mon, Jul 07, 2003 at 11:32:25PM +0300, Hasso Tepper wrote: HT>I needed router that can do "bidirectional" shaping in interface. I''m HT>using IMQ + TBF for that at the moment. One ethernet interface is HT>connected to "backbone", other has many vlan''s. Every vlan is HT>"connected" to IMQ device. I have wrapper scripts for maintaining HT>this stuff and it works like a charm. HT>But there is problem though - router can handle more, but I''m running HT>out of IMQ devices. Default is 16 devices, but it is possible to HT>change it in linux/include/imq.h. Theoretical maximum is 127. There HT>is bug is imq module btw, it refuses to accept bigger number of HT>numdevs argument than 99. But router really can handle more. HT>So, any ideas? HT>1) It is router, nothing more. No any services here. HT>2) Solution should be really simple because configuration changes HT>really often. HT>3) Shaping "upload" only in backbone interface isn''t solution. HT>4) No need for obvious "solutions" like - buy another box ;). HT>regards, HT>PS. I posted with wrong from address at first. Sorry if it would be HT>duplicate. HT>-- HT>Hasso Tepper HT>Elion Enterprises Ltd. HT>WAN administrator HT>_______________________________________________ HT>LARTC mailing list / LARTC@mailman.ds9a.nl HT>http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/ -- Best regard, Aleksander Trotsai aka MAGE-RIPE aka MAGE-UANIC My PGP key at ftp://blackhole.adamant.ua/pgp/trotsai.key[.asc] Big trouble - Quantum dynamics are affecting the transistors _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Alexander Trotsai wrote:> May you need mark packets with iptables and one IMQ device > with htb queue > Something like > iptables -t mangle -A PREROUTING -i intf1 -j MARK --set-mark 1 > ..... > iptables -t mangle -A PREROUTING -i intfN -j MARK --set-mark N > iptables -t mangle -A PREROUTING -j IMQ > > And to imq0 attach HTB qdisc with shaping according to mark > valueYes, I thought about it, but it will make management a lot more complicated. If I have to change rate on one vlan only? At the moment: Up: iptables -t mangle -A PREROUTING -i eth1.$d+ -j IMQ --todev $d tc qdisc add dev eth1.$d root tbf rate ... tc qdisc add dev imq$d root tbf rate ... ip link set imq$d up Down: iptables -t mangle -D PREROUTING -i eth1.$d+ -j IMQ --todev $d tc qdisc del dev eth1.$d root tc qdisc del dev imq$d root ip link set imq$d down I made wrapper script, which takes device number and shaping parameters from command line. I can change shaping parameters on any vlan without affecting others. regards, -- Hasso Tepper Elion Enterprises Ltd. WAN administrator _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
On Tue, Jul 08, 2003 at 12:50:26PM +0300, Hasso Tepper wrote: HT>Alexander Trotsai wrote: HT>> May you need mark packets with iptables and one IMQ device HT>> with htb queue HT>> Something like HT>> iptables -t mangle -A PREROUTING -i intf1 -j MARK --set-mark 1 HT>> ..... HT>> iptables -t mangle -A PREROUTING -i intfN -j MARK --set-mark N HT>> iptables -t mangle -A PREROUTING -j IMQ HT>> HT>> And to imq0 attach HTB qdisc with shaping according to mark HT>> value HT>Yes, I thought about it, but it will make management a lot more HT>complicated. If I have to change rate on one vlan only? At the HT>moment: HT>Up: HT>iptables -t mangle -A PREROUTING -i eth1.$d+ -j IMQ --todev $d HT>tc qdisc add dev eth1.$d root tbf rate ... HT>tc qdisc add dev imq$d root tbf rate ... HT>ip link set imq$d up HT>Down: HT>iptables -t mangle -D PREROUTING -i eth1.$d+ -j IMQ --todev $d HT>tc qdisc del dev eth1.$d root HT>tc qdisc del dev imq$d root HT>ip link set imq$d down HT>I made wrapper script, which takes device number and shaping HT>parameters from command line. I can change shaping parameters on any HT>vlan without affecting others. Set mark equal to vlan number Then If you need change rate tell tc class change classid <MAJOR>:<VLANID> rate <new rate> -- Best regard, Aleksander Trotsai aka MAGE-RIPE aka MAGE-UANIC My PGP key at ftp://blackhole.adamant.ua/pgp/trotsai.key[.asc] Big trouble - clock speed _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Hi Hasso, just to correct some wrong information i gave, imq _does_ use that function indirectly through alloc_netdev, the caller sets the format string not the name. Must have been too late. Anyway, this patch should fix your problem. Bye Patrick Patrick McHardy wrote:> Hasso Tepper wrote: > >> But there is problem though - router can handle more, but I''m running >> out of IMQ devices. Default is 16 devices, but it is possible to >> change it in linux/include/imq.h. Theoretical maximum is 127. There >> is bug is imq module btw, it refuses to accept bigger number of >> numdevs argument than 99. But router really can handle more. >> > The default is 2 devices. I can not imagine why there should be a 99 > device > limit, there is one such limit in net/core/dev.c:dev_alloc_name, but imq > doesn''t use that function. I can''t really imagine alloc_netdev calling > dev_alloc_name > because the caller chooses it''s own name, but i haven''t checked. if > you want > to make sure, change dev_alloc_name to support more than 100 devices > (trivial) > and try again. Please inform me in case of success. > > Bye, > Patrick >