Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Jul 2005 11:48:19 +0200
From:      Jeremie Le Hen <jeremie@le-hen.org>
To:        Brad Waite <freebsd@wcubed.net>
Cc:        freebsd-ipfw@freebsd.org
Subject:   Re: IPFW + dummynet to lower NNTP traffic priority
Message-ID:  <20050727094819.GR1610@obiwan.tataz.chchile.org>
In-Reply-To: <3265.67.176.75.179.1122435618.squirrel@webmail.wcubed.net>
References:  <3265.67.176.75.179.1122435618.squirrel@webmail.wcubed.net>

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

On Tue, Jul 26, 2005 at 09:40:18PM -0600, Brad Waite wrote:
> I've been working on a way to keep my outbound NNTP traffic from
> interfering with all other traffic.  After reading the ipfw(8) man page
> and several other resources (including Luigi Rizzo's page), I thought I
> had it down:
> 
> ### Outbound
> ipfw pipe 1 config bw 0K
> ipfw queue 1 config weight 1 pipe 1
> ipfw queue 2 config weight 100 pipe 1
> ipfw add 1000 queue 1 all from any to any out dst-port 119 via fxp0
> ipfw add 1001 queue 2 all from any to any out via fxp0
> 
> ### Inbound
> ipfw pipe 2 config bw 0K
> ipfw queue 3 config weight 1 pipe 2
> ipfw queue 4 config weight 100 pipe 2
> ipfw add 1000 queue 3 all from [NNTP server IP] to any in via fxp0
> ipfw add 1001 queue 4 all from any to any in via fxp0

The rule number are the same for outbound and inbound path, this is an
error I think.  I'm not sure about the behaviour of setting the pipe
bandwidth to 0K (further more "K" is not valid in ipfw syntax, and it's
very picky about this, even the case is important IIRC).

You should also be careful if net.inet.ip.fw.one_pass is set to 0,
you will have to use skipto rules.

I advice you to use (values are fictive) :

ipfw pipe 1 config bw 123KBytes/s
ipfw queue 100 config weight 1 pipe 1
ipfw queue 101 config weight 100 pipe 1
ipfw add 100 queue 100 all from any to any out dst-port 119 via fxp0
ipfw add 101 queue 101 all from any to any out via fxp0

ipfw pipe 2 config bw 321KBytes/s
ipfw queue 200 config weight 1 pipe 2
ipfw queue 201 config weight 100 pipe 2
ipfw add 200 queue 200 all from [NNTP server IP] to any in via fxp0
ipfw add 201 queue 201 all from any to any via fxp0

> My thinking here is that both queues (in each direction) will share all
> available bandwidth, but any traffic heading out on port 119 or returning
> from the news serverwill be superseded by all other traffic.  If there's
> no other traffic, NNTP will be able to use all available bandwidth.

Note that if you want to use the whole _interface_ bandwidth (100MBits/s),
you can use something like :
ipfw pipe 1 config bw fxp0

> It would appear I'm not grasping the concepts.  Can anyone tell me what
> I'm doing wrong?

Nothing really wrong, except the pipe bandwidth.

Regards,
-- 
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?20050727094819.GR1610>