Thread View: bit.listserv.openbsd-pf
5 messages
5 total messages
Started by Andy Lemin
Wed, 11 Apr 2012 13:02
inbound queueing on external interface due to multiple internal interfaces
Author: Andy Lemin
Date: Wed, 11 Apr 2012 13:02
Date: Wed, 11 Apr 2012 13:02
64 lines
4371 bytes
4371 bytes
Hello, I know this has been discussed before, but I am not a developer (I wish I did have the skills as I would code this myself otherwise). I have a huge respect for all that the OpenBSD community does and this is not a winge or a moan, please hear our woes. Yes, of course downstream queuing is only of benefit for TCP to get the sender to slow down etc etc, but that is exactly what we need. IF we don't queue downstream traffic, our downstream link gets saturated and our ISP starts to drop random packets. If we do the downstream queuing here, we pre-emptively drop low priority packets before saturation thus slowing the sender down before saturating the WAN's downstream leaving headroom for VoIP etc. We have a firewall with 4 internal interfaces for various different subnets and 1 external WAN interface like many users have. Queuing upload traffic is easy on the WAN interface, but downstream traffic needs to be queued on each of the internal interfaces. Initially this would seem fine, until you realise that if 3 of the 4 internal interfaces are idle the busy 4th interface cannot use the entire download bandwidth available on the WAN. This is because you can only assign a 'slice' of the total download bandwidth (summing to 100% of WAN speed) to each of the internal interfaces resulting in very inefficient download utilisation across the internal zones. I appreciate that we could buy 'another' 2 boxes with only two interfaces to sit on the WAN link (both running CARP etc) but this seems extremely inefficient, wasteful, harder to manage and simply ugly when compared to other features of OpenBSD, to end up with 4 boxes (2 multi-zone firewalls, and 2 queue servers) to achieve resilient download queuing shared across multiple local subnets. So, their is a clear need to be able to queue inbound traffic on the WAN interface when there are multiple internal local interfaces. I appreciate this is a feature that would need to be added to ALTQ than PF. So far my thinking is to create a second virtual loop-back interface 'lo1', and divert (divert-to not redirect (rdr-to)) all inbound traffic on the WAN interface to lo1. Then set-up a queue on lo1 which represents the desired shared 'inbound queue' for all internal interfaces. Naturally after the traffic passes through lo1 it will get queued, and the packets should then get routed as normal via their respective internal local interfaces etc. Would this work? We have to use inbound queuing, without it our WAN link saturates with low priority traffic, and we need to maintain headroom for high priority VoIP traffic etc. But we also want any internal local network to be able to fully utilise the WAN downstream bandwidth instead of only 1/4 of it even when the others are idle. Thanks for your thoughts and ideas in advance :) Andy If we had to bounty this, how much? I might be able to get £100 for a bounty? Cheers.
Re: inbound queueing on external interface due to multiple internal interfaces
Author: Karl O. Pinc
Date: Wed, 11 Apr 2012 19:04
Date: Wed, 11 Apr 2012 19:04
57 lines
3105 bytes
3105 bytes
On 04/11/2012 08:02:41 AM, Andy Lemin wrote:
> Hello,
> I know this has been discussed before,
You will want to see this thread:
Working example of bi-directional asymmetric ALTQ + NAT ruleset?
http://marc.info/?t=129472965800001&r=1&w=2
It talks about being able to have a single queue
on more than one interface, so you'd use a single
outbound queue on all your internal interfaces to
effectively rate-limit your inbound wan traffic.
You'll want to use the hfsc scheduler because
you're trading bandwidth for latency. And hfsc has
sub-queues too so that might help allocate the
traffic per internal interface. I haven't thought
about this in quite some time but I think that this approach
will work. But because I've not thought about
it I could be all wrong. :-)
It's not a perfect solution; it won't work in the
general case where you've more than one interface
you want to limit inbound traffic on.
If sharing a queue on your internal
interfaces does not do it you could get ugly and
use an extra 2 real interfaces (instead of the loopback interface
as you suggest) and a separate routing table and physically
loop the traffic back. This is less ugly than having another box.
I suspect the loopback interface approach won't work, but that's
a total guess. If it does work I'm not sure I'd want
to count on such a kludge continuing to work long-term.
I'm very interested in what works and what doesn't so
it would be good to hear back from you.
> We have to use inbound queuing, without it our WAN link saturates
> with
> low priority traffic, and we need to maintain headroom for high
> priority VoIP traffic etc.
Don't forget the "empty" ack packets.
> If we had to bounty this, how much? I might be able to get =A3100 for
> a
> bounty?
I heard the number $20,000 (US) thrown around. I have no idea if
that's a realistic number.
Karl <kop@meme.com>
Free Software: "You don't pay back, you pay forward."
-- Robert A. Heinlein
Re: inbound queueing on external interface due to multiple internal interfaces
Author: Andy Lemin
Date: Thu, 12 Apr 2012 09:48
Date: Thu, 12 Apr 2012 09:48
83 lines
4742 bytes
4742 bytes
Hi, thanks very much for your suggestion. > You will want to see this thread: > Working example of bi-directional asymmetric ALTQ + NAT ruleset? > http://marc.info/?t=129472965800001&r=1&w=2 > > It talks about being able to have a single queue > on more than one interface, so you'd use a single > outbound queue on all your internal interfaces to > effectively rate-limit your inbound wan traffic. I read through that archive but the problem it seems to be discussing seems pretty trivial as its discussing semantics of queuing downstream traffic which you just do by queuing on the internal interface (which works perfectly if you only have one internal interface). It does suggest creating a queue structure without assigning a specific interface as you suggest, however when you do this I believe PF simply creates copy's of the queue structure and creates instances per interfaces? I.e. the different interfaces are not sharing the same physical queue in memory. Is this true? I need to be able to perform downstream queuing pre-routing effectively so that all the downstream traffic (regardless of the internal zone) is all queued equally as one, allowing all internal interfaces to share the total downstream bandwidth. > If sharing a queue on your internal > interfaces does not do it you could get ugly and > use an extra 2 real interfaces (instead of the loopback interface > as you suggest) and a separate routing table and physically > loop the traffic back. This is less ugly than having another box. Sadly we don't have enough ports/slots on our firewall to add a physical loop back and so it has to be a virtual interface :( > I suspect the loopback interface approach won't work, but that's > a total guess. If it does work I'm not sure I'd want > to count on such a kludge continuing to work long-term. Can you tell me why you feel it's a hack to do it using a virtual interface (assuming it works)? It seems like a legitimate solution for queuing downstream traffic pre-routing (altq processing is done during the last stage of egress processing) as this would allow you to define unique downstream queues on any/multiple sources (WAN or VPN) etc. Or do you think it would be better to allow multiple internal interfaces to share the same physical queue in memory? Whilst its an ALTQ thing, I would assume both solutions would be best implemented in PF? I'm just looking for ideas to try as I'm genuinely surprised BSD can't do this :( > I'm very interested in what works and what doesn't so > it would be good to hear back from you. Yes I'll keep my progress posted, as I know their are a lot of other people out there who also want this functionality considering the number of threads I have come across on this, some dating back years. > Don't forget the "empty" ack packets. Indeed ;) > > If we had to bounty this, how much? I might be able to get =A3100 for > > a > > bounty? > > I heard the number $20,000 (US) thrown around. I have no idea if > that's a realistic number. > That's a little out of my budget of a few hundred dollars! :( Cheers for your time, Andy.
Re: inbound queueing on external interface due to multiple internal interfaces
Author: Stuart Henderson
Date: Thu, 12 Apr 2012 13:34
Date: Thu, 12 Apr 2012 13:34
61 lines
4173 bytes
4173 bytes
On 2012/04/12 02:48, Andy Lemin wrote: > Hi, thanks very much for your suggestion. > > > You will want to see this thread: > > Working example of bi-directional asymmetric ALTQ + NAT ruleset? > > http://marc.info/?t=3D129472965800001&r=3D1&w=3D2 > >=20 > > It talks about being able to have a single queue > > on more than one interface, so you'd use a single > > outbound queue on all your internal interfaces to > > effectively rate-limit your inbound wan traffic. > > I read through that archive but the problem it seems to be discussing seems= > pretty trivial as its discussing semantics of queuing downstream traffic w= > hich you just do by queuing on the internal interface (which works perfectl= > y if you only have one internal interface). > > It does suggest creating a queue structure without assigning a specific int= > erface as you suggest, however when you do this I believe PF simply creates= > copy's of the queue structure and creates instances per interfaces? I.e. t= > he different interfaces are not sharing the same physical queue in memory. = > Is this true? Yes, that thread is talking about creating multiple queues with the same name, this is good for traffic classification but it is not a single queue shared between multiple interfaces. > I need to be able to perform downstream queuing pre-routing effectively so = > that all the downstream traffic (regardless of the internal zone) is all qu= > eued equally as one, allowing all internal interfaces to share the total do= > wnstream bandwidth. Currently two machines is the cleanest (and maybe only) way to do this, I have a feeling you'll get better results making these route rather than bridge. altq's queues are all per-interface. Anything to change this would be major work. Plan is for the queue code to be completely replaced so working on this before that happens would get in the way. > > If sharing a queue on your internal=20 > > interfaces does not do it you could get ugly and > > use an extra 2 real interfaces (instead of the loopback interface > > as you suggest) and a separate routing table and physically > > loop the traffic back. This is less ugly than having another box. > > Sadly we don't have enough ports/slots on our firewall to add a physical lo= > op back and so it has to be a virtual interface :( lo(4) is a bit of a specialist interface to be trying this with. You might get somewhere with vether(4), the uncommitted diff "virtual crossover link with vether(4)" on tech@openbsd.org could be of interest. Another option might be to route things to a userland daemon via tun(4) that reinjects the packets then you can queue on the tun interface instead. I have some old code from kjc sitting in my inbox that might be useful here, I'll try and find time to dust it off. Higher overhead but somewhere that is going to need to 'borrow' downstream bandwidth between interfaces is likely to not be seeing super-high-speed traffic anyway so this might not be a problem.
Re: inbound queueing on external interface due to multiple internal interfaces
Author: Karl O. Pinc
Date: Thu, 12 Apr 2012 16:34
Date: Thu, 12 Apr 2012 16:34
12 lines
1573 bytes
1573 bytes
On 04/12/2012 07:40:47 AM, Stuart Henderson wrote:
> Yes, that thread is talking about creating multiple queues with the
> same name, this is good for traffic classification but it is not a
> single queue shared between multiple interfaces.
I am all wet then. Isn't the first time. Sorry to distract you.
Karl <kop@meme.com>
Free Software: "You don't pay back, you pay forward."
-- Robert A. Heinlein
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads