Network transition complete + PF question

Previous thread: pkgbox returned to service by Matthew Dillon on Wednesday, April 2, 2008 - 9:01 pm. (1 message)

Next thread: Re: Network transition complete + PF question by Matthew Dillon on Thursday, April 3, 2008 - 1:42 pm. (2 messages)
To: <kernel@...>
Date: Thursday, April 3, 2008 - 2:08 am

The network move is complete.

I have a question for the PF/ALTQ masters out there. I am trying to
configure PF in a manner similar to what Cisco's fair-queue algorithm
does. Cisco's algorithm basically hashes TCP and UDP traffic based
on the port/IP pairs, creating a bunch of lists of backlogged packets
and then schedules the packets at the head of each list.

I am trying to find something equivalent with PF and not having much
luck. Neither CBQ nor HFSC seem to work well. I can separate certain
types of traffic but the real problem is when there are multiple
TCP connections that are essentially classified the same, and one is
hogging the outgoing bandwidth.

So the question is, is there a PF solution for that or do I need to
write a new ALTQ mechanic to implement fair queueing ?

If there is no current solution I have a pretty good idea how to
implement it. I can use PF's 'keep state' mechanism and then hash
the state structure pointer and store it in the packet header, then
implement a new ALTQ that takes that hash code and throws it into an
array of queues from which it fair-dequeues packets for output.

-Matt

To: <kernel@...>
Date: Thursday, April 3, 2008 - 9:40 am

I don't think any of the OS solutions will do that. What you can do for
this kind of application is put all downloads into one class with borrow
property and limit the source connections to a small value. Use a second
rule to drop all the other connections into.

Joerg

To: <kernel@...>
Date: Thursday, April 3, 2008 - 9:25 am

I'm not an export about ALTQ, but how about creating N similar queues,
and assigning a new TCP connection to one of these queues at random
using the "probability X%" keyword?

Cedric

To: <kernel@...>
Date: Thursday, April 3, 2008 - 7:45 am

Matthew Dillon wrote:

Not sure if I fit in the former category, but I don't *think*
there's anything that does this .. I've thought about someday trying to
rig something up - it would be nice e.g. to lower the priority of HTTP
sessions after some amount of data is travelling - that way my
interactive bw would not be hogged by big downloads..

it might be possible to hook up pfctl or pfflowd into some kind of table
modifying script some how

If we had tagging support, this might be easier

http://www.openbsd.org/faq/pf/tagging.html

(e.g. monitor state table every N & retag high bandwidth traffic,
using the tags to assign traffic different priorities)

ideally the 'pf' config would allow some kind of 'rate' designator

Previous thread: pkgbox returned to service by Matthew Dillon on Wednesday, April 2, 2008 - 9:01 pm. (1 message)

Next thread: Re: Network transition complete + PF question by Matthew Dillon on Thursday, April 3, 2008 - 1:42 pm. (2 messages)