Is there an API for ipfw?

Luigi Rizzo rizzo at icir.org
Sat Apr 1 20:57:35 UTC 2006


On Fri, Mar 31, 2006 at 05:17:07PM -0500, Mikhail Teterin wrote:
> ÞÅÔ×ÅÒ 30 ÂÅÒÅÚÅÎØ 2006 17:06, Luigi Rizzo ÎÁÐÉÓÁ×:
> > If you are doing it a lot more often, you should probably
> > also consider the effect of such frequent changes to the
> > pipe's configuration - e.g. pipes respond with a delay
> > which is inversely proportional to the bandwidth, so in
> > many cases still doesn't make sense to change the pipe's
> > rate 100 times per second.
> 
> So far I'm just playing with the rules manually. I create a pipe with:
> 
> 	ipfw pipe 1 config bandwidth 22200KByte/s
> 
> and send all NFS traffic through it with:
> 
> 	ipfw add 100 pipe 1 ip from any to 172.21.128.43 dst-port 2049
> 
> This works most of the times, but if sometimes, when I try to change the 
> bandwidth from command line:
> 
> 	ipfw pipe 1 config bandwidth 24MByte/s
> 
> the NFS clients stops writing ALTOGETHER and begins logging complaints about 
> the NFS server (172.21.128.43) not responding. At that point, I must delete 
> the rule 100. The other rules are simply:
> 
> 	65533 allow ip from any to any
> 	65535 deny ip from any to any
> 
> Why would altering the bandwidth slightly (up) freeze all traffic through the 
> pipe? Thanks!

i don't know on which version of freebsd is this occurring,
it would help knowning - as well as knowing if this is an
UP/SMP and whether it is working as a bridge or router.

Internally, dummynet computes the next tick when the pipe should
be processed based on the current bandwidth (see the SET_TICKS
macro in ip_dummynet.c), and when the time
arrives, the computations are done using the 'new' bandwidth value
(see near the beginning of funcrion 'ready_event()'.
As far as i can tell (at least on 4.x) the code seems to
handle changes in the bandwidth in the correct way, so the
only thing i can suspect is some bug related to insufficient
locking between the setsockopt and the soft interrupt handler.

	cheers
	luigi


More information about the freebsd-net mailing list