Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Jan 2001 20:03:47 +0800
From:      Erwan Arzur <erwan@netvalue.com>
To:        Roman Le Houelleur <roman@IPricot.com>
Cc:        freebsd-ipfw <freebsd-ipfw@FreeBSD.ORG>, freebsd-net <freebsd-net@FreeBSD.ORG>
Subject:   Re: bandwidth analyser
Message-ID:  <3A755C23.AE8D79E1@netvalue.com>
References:  <3A6C7FD0.7E2ABD65@IPricot.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Roman Le Houelleur wrote:
> 
> hi,
> 
>  I use FreeBSD 4.2 stable + bridge + dummynet + ipfw.
>  I would like to calculate the bandwidth of each
> authorized IP source flowing through the bridge from a
> user program.
>  As this bandwidth calculation should be done very often
> (10 to 20 times per second) I first tried to use the if_data
> structure from sysctl. But it seems the packet counter is
> only incremented for packets destinated to the specified
> interface, and moreover I wouldn't be able to separate the
> incoming flows depending on their source addresses.
> 
>  Anybody has an advice on the best way to achieve this
> calculation ? what about the counter capabilities of ipfw ?
> 
>  Moreover, concerning the bridge, I was wondering if
> there is a way not to put a third interface in promiscous
> mode. As this third nic exists only for management purposes
> I don't want it to participate to the bridge in any way.
> 
> Thanks,
> 

Never did this, but without the 10-20 times/sec requirement (don't do
this 10 times/sec !), you could easily hack something like this :

* add some rules with <count> actions
* write a little perl script that will output the value of the counter
for the given rule (exec'ing ipfw show)
* associate it with your choice of mrtg or RDDTool and you've got your
bandwidth analyser with nice graphs and so forth ...

There is something similar done for ipfilter in some mrtg contrib
package, if i remember well ...

Another solution would be to use /usr/ports/net/snmpd with the
contributed ipfw MIB ... 

Why this 10 times/sec requirement ? Load balancing ? 
--
Erwan Arzur
NetValue ltd.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ipfw" in the body of the message




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