Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Sep 2005 14:21:54 +0200
From:      Jeremie Le Hen <jeremie@le-hen.org>
To:        vladone <vladone@spaingsm.com>
Cc:        freebsd-ipfw@freebsd.org
Subject:   Re: dummynet patch
Message-ID:  <20050919122154.GM51142@obiwan.tataz.chchile.org>
In-Reply-To: <97663975.20050917141303@spaingsm.com>
References:  <97663975.20050917141303@spaingsm.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

> Can someone make an patch for dummynet, so an user can't get maximum
> bandwith. Queue work great for sharing same bandwidth, but an user can
> get much banditdth if is not used but anothers.
> So is wonderfull if i can put an paramaters for queue (like for pipe),
> to limit bandwidth:
> For example:
> ipfw pipe 1 congig bw 1mbit/s
> ipfw queue 1 config weight 10 pipe 1 bw 128kbits/s
> ipfw queue 1 config weight 15 pipe 1 bw 256kbits/s
> 
> This mean that i have two queue that share same pipe. Bandwidth is
> given accordint with their weight but no more that value indicated by
> "bw" parameter. In my example queue 1 can get more than 128 kbits/s.
> In this mode bandwidth is well splited but an user can't get all
> bandidth if is alone on network.

You can just set net.inet.ip.fw.one_pass to 0 and use more pipes
to limit the maximum bandwidth.  Let's say you want to limit the
whole pipe to 1MBits/s and then limit user with UID 1001 to 128 KBits/s
on your external interface fxp0 :

% sysctl -w net.inet.ip.fw.one_pass=0

# First skip to the end of the rules if we're not on the outgoing
# path through fxp0.
% ipfw add 100 skipto 65000 all from any to any not xmit fxp0

# Limit user 1001 max bandwidth.
% ipfw pipe 1001 config bw 128KBits/s
% ipfw add 200 pipe 1001 all from any to any

# System-wipe policy.
% ipfw pipe 1 config bw 1MBits/s
% ipfw queue 11 config weight 10 pipe 1
% ipfw queue 12 config weight 20 pipe 2
% ipfw add 210 queue 11 ...
% ipfw add 220 queue 12 ...

-- 
Jeremie Le Hen
< jeremie at le-hen dot org >< ttz at chchile dot org >



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050919122154.GM51142>