Hallo list,

I'm running a small hosting company, and we have a 10Mb leased line. We
don't use anywhere like all of it yet, but it was the smallest we could
get where we are. To offset the costs a bit, we sell off portions of
this to other companies in our building, using an OpenBSD router and a
Cisco switch. Just like a large ISP we put multiple people in the same
slice of bandwidth, and they 'contend'. I say contend, as at the moment
all our ADSL-grade customers just go in the same queue, which has 256Kb
upstream and 2Mb downstream.

What we would like to do is to have them all contend properly, such that
in a 1:20 contention block, each of the 20 users is guaranteed 1/20th of
the up- and down-stream bandwidth, but they all fight with equal
priority over any bandwidth not currently being used by other peers in
their block.

Here's what I've got so far:

altq on $vl_bt cbq bandwidth 9.1Mb qlimit 200 queue { adsl_up }
altq on $vl_dsl cbq bandwidth 9.1Mb qlimit 200 queue { adsl_dn }

# $vl_bt is the vlan interface that has our net connection on it.
# $vl_dsl is the vlan interface that our 'DSL' subscribers come in on.
# We have a 10Mb leased line in both directions.


queue adsl_up  bandwidth 256Kb cbq {client1_up, client2_up, client3_up}
queue adsl_dn  bandwidth 2Mb   cbq {client1_dn, client2_dn, client3_dn}

queue client1_up  bandwidth 13Kb  cbq (borrow)
queue client1_dn  bandwidth 120Kb cbq (borrow)
queue client2_up  bandwidth 13Kb  cbq (borrow)
queue client2_dn  bandwidth 120Kb cbq (borrow)
queue client3_up  bandwidth 13Kb  cbq (borrow)
queue client3_dn  bandwidth 120Kb cbq (borrow)
# And so on, up to a maximum of 20 in this block

pass in on $vl_dsl from $client1_net to any queue adsl_up
pass out on $vl_dsl from any to $client1_net queue adsl_down
pass in on $vl_dsl from $client2_net to any queue adsl_up
pass out on $vl_dsl from any to $client2_net queue adsl_down
pass in on $vl_dsl from $client3_net to any queue adsl_up
pass out on $vl_dsl from any to $client3_net queue adsl_dn


I *think* it should work, but I'm not sure I've understood how cbq and
pf actually work. I'm a little confused about what will happen to the
traffic to and from our hosting servers, which have no queuing in their
pass rules.

Also, at the moment the sdsl block (not shown, but just the same only
with different numbers) had the default keyword. It just happened to be
the first one I did. I'm worried that this means that any traffic
without a queue is going in the SDSL queue, including that to our web
servers, and so we're not properly using all our bandwidth. I think I
might have happened to get away with it, because the servers aren't on
$vl_dsl, but if that's the case its broken, and I should fix it.

In summary, I think I've got somewhere, but I'm probably going about it
the wrong way...

I throw myself upon the collective wisdom of misc@ :-)

-- 

Richard 'Dave' Wilson
Systems Administrator

Senokian Solutions Ltd.
Business Innovation Centre,
Binley Business Park, Coventry,
United Kingdom
CV3 2TX
T: +44 (0)24 76 233 400
DDI: +44 (0)24 76 233 416
F: +44 (0)24 76 233 401

Reply via email to