alex@pilosoft.com
2004-Feb-06 05:43 UTC
Paid project/Netfilter target to match queue backlog
Hello, If any of kernel hackers wants to make some money: For 300$: What I need is a netfilter match rule that would match on depth of a queue on a given device. Example: iptables -t mangle -I PREROUTING -m queue_backlog --device eth0.1 --depth-gt 10 -j <chain> If you can complete this in a reasonable time (2-3 days), let me know. This does not need to be very complicated: The only qdiscs that this needs to work with is HTB and pfifo. I envision this as adding a function query_backlog to relevant qdiscs, and a simple match on dev->qdisc->query_backlog For someone who has done this before, I''m sure should take about a day :) This *must* be optimized (i.e. pointer to device struct must be cached, number of packets in backlog must be cached or otherwise computed at O(1) time). To those wondering "why in the world would someone want to do that": Consider router connected to many uplinks (possibly of varying speeds). Due to "political reasons" reasons (example, one link being "paid for completely", others being "pay per use"), I only want to send packets over the other link when the first link is "full". Backlog length provides the best measure of the "fullness" of a given device. Now (use of ''recent'' match necessary because TCP really dislikes multipath within a given session): -A PREROUTING -m recent --rdest -j MARK --seconds 60 --set-mark 1 -A PREROUTING -m queue_backlog --device eth0.1 --depth-gt 10 -j OVERFLOW -A OVERFLOW -j MARK --set-mark 1 -A OVERFLOW -m recent --rdest --set -j ACCEPT ...ip rule add fwmark 1 table 2 Yes, I know its somewhat fugly (essentially, I''m doing RPDB as netfilter rules), but seems simplest and more flexible to me. _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
<arek@chelmnet.pl>
2004-Feb-06 09:32 UTC
RE: Paid project/Netfilter target to match queue backlog - Traffic Engineering
> -A PREROUTING -m recent --rdest -j MARK --seconds 60 --set-mark 1 > -A PREROUTING -m queue_backlog --device eth0.1 --depth-gt 10 -j OVERFLOW > -A OVERFLOW -j MARK --set-mark 1 > -A OVERFLOW -m recent --rdest --set -j ACCEPTIsn''t the same possible in /lartc.org 12.3.2. Overlimit actions / and "reclassify" option /which i din''t used yet/. Consider you have linux which has 2 default routes - one with TOS=0x0, and one with tos 0x10. so: 0.0.0.0/0 tos 0 via eth0 0.0.0.0/0 tos 0x10 via eth1 your_source=eth2 next, you must use IMQ to pass every traffic from eth2, /because as i''m thinking there isn''t possible to do reclassify packet which is already routed to some interface, and next put the same packet over other interface based on some policy - PLEASE CORRECT ME!!! / I don''t know how to put all traffic which is destined for eth0, to some IMQ device, next police packets there by "reclassify" options. All the settings must be according to your full bandwidth of eth0, so all which is overlimit eth0 speed get reclassify to other TOS. After all packets which leaves imq, are routed again by system, if you have differented TOS routing, /if your IGP routing domain create such Traffic Engineered path/ then packets with such other TOS will get outside from eth1. /this is my teory, to correct or discuss / This what you are trying to do is somehow Traffic Engineering or Contraint Based Routing. I''m very pleased to be with contact with somebody who is intend/or already done with some work with linux in this topic. Now i elaborate how to control distribution of MPLS labels which must be according to current interface load or even interface load with each QoS class /in linux/. Feel free to contact me with this topic. Arkadiusz Binder _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
alex@pilosoft.com
2004-Feb-06 13:28 UTC
RE: Paid project/Netfilter target to match queue backlog - Traffic Engineering
> Isn''t the same possible in /lartc.org 12.3.2. Overlimit actions / and > "reclassify" option /which i din''t used yet/.Interesting idea - Let me try if this works first.> next, you must use IMQ to pass every traffic from eth2, /because as i''m > thinking there isn''t possible to do reclassify packet which is already > routed to some interface, and next put the same packet over other > interface based on some policy - PLEASE CORRECT ME!!! /Only way to find out is to try it, I think.> I don''t know how to put all traffic which is destined for eth0, to some IMQ > device, next police packets there by "reclassify" options. > All the settings must be according to your full bandwidth of eth0, so all > which is overlimit eth0 speed get reclassify to other TOS. > After all packets which leaves imq, are routed again by system, > if you have differented TOS routing, /if your IGP routing domain create > such Traffic Engineered path/ then packets with such other TOS will get > outside from eth1. > > /this is my teory, to correct or discuss / > > This what you are trying to do is somehow Traffic Engineering or > Contraint Based Routing. I''m very pleased to be with contact with > somebody who is intend/or already done with some work with linux in this > topic.Correct - that''s exactly what I''m trying to do.> Now i elaborate how to control distribution of MPLS labels which must be > according to current interface load or even interface load with each QoS > class /in linux/.That''s slightly above the scope of what I need right now - but it is something I will need soon. _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/