altq question

2006-11-26 Thread tony sarendal
Hola,

I'm replacing my Cisco837 with an openbsd box for my home dsl, again.

From src/sys/altq/altq_subr.c tbr_dequeue:
if (m != NULL  op == ALTDQ_REMOVE)
tbr-tbr_token -= TBR_SCALE(m_pktlen(m));

is m_pktlen(m) the length of the IP packet in a routed environment ?

I have some vague memory of it being the length of the data in the mbufs,
but I don't have any real understanding of what actually is being moved
around the kernel.

/Tony

-- 
Tony Sarendal - [EMAIL PROTECTED]
IP/Unix
   -= The scorpion replied,
   I couldn't help it, it's my nature =-



altq question on OpenBSD 3.8

2006-06-22 Thread David Wilk

Howdy folks,

I've been following an example in the Absolute OpenBSD book on how to
setup two separate child queues for traffic going to two different
networks over the same interface.

This server runs OpenBSD 3.8(Generic kernel with raidframe and MP),
has two NICs (internal/external) and serves as a NAT firewall to the
internet for a small private network.  It also has a few local
services like NFS and web.

Here are the relevant portions of /etc/pf.conf:

### queues setup here:
altq on $int_if cbq bandwidth 1000Mb queue { local, internet }

queue local bandwidth 998500Kb cbq
queue internet bandwidth 1500Kb { std_in, ssh_im_in, dns_in, imap_in }

queue std_inbandwidth 65% cbq(borrow, default)
queue ssh_im_in bandwidth 10% priority 4 cbq(ecn, borrow)
queue dns_inbandwidth 5% priority 5 cbq(red, borrow)
queue imap_in  bandwidth 20% priority 6 cbq(red, borrow)

local_net = {172.20.13.0/16 172.22.13.0/16 172.23.13.0/16}
ssh_ports = { 22 2112 }

# filter rules for $int_if outbound
pass  out on $int_if proto { tcp udp } from any port domain to $local_net \
   queue dns_in
pass  out on $int_if proto tcp from any port $ssh_ports to $local_net \
   queue(std_in, ssh_im_in)

pass out on $int_if from any to $local_net queue std_in
pass out on $int_if from $local_net to $local_net keep state queue local


So, because this server serves as both firewall and file server, I
would like to treat local traffic without the same bandwidth
restrictions as internet traffic.

The problem is that with this setup, local http and ssh traffic is
allowed to pass at full speed, but local NFS traffic is restricted to
'queue std_in' rates just like internet traffic is.

somehow, that last filter rule is not getting local NFS traffic into
the 'local' queue.  I don't understand this as the NFS traffic should
look just like the http and ssh traffic with regards to that filter
rule.

I've been banging on this one for a week and feel like I've exhausted
all other resources.  If anyone has any ideas, I'd love to hear'em!

thanks,
Dave



ALTQ question

2005-06-02 Thread Russell Sutherland
I would like to create a traffic shaping scenario as follows:

Establish and queue on an outgoing interface
with the following properties:

1. Total available bandwidth: N Mbps

2. There are n active src IP addresses
   using the queue to send traffic.

3. All src IPs in the queue share
   the bandwith equally. That is each machine gets
   a maximum allocation of N/n Mbps. E.g. If there are 10 src IP
   addresses sending traffic each one gets a maximum
   bandwidth of: N/10 Mbps

4. [optional] One can set a cap for the maximum
   bandwidth (M Mbps) for each active src IP in the queue even
   in the case that N/n  M.

5. The n active src IP addresses all fall within a known
   CIDR block.

Can this be done using ALTQ? I believe its possible using dummynet.

-- 
Russell P. Sutherland   Email: russ @ madhaus.cns.utoronto.ca
4 Bancroft Ave., Rm. 102Voice: +1.416.978.0470
University of Toronto   Fax:   +1.416.978.6620
Toronto, ON  M5S 1C1WWW:   http://madhaus.cns.utoronto.ca/~russ
CANADA