Date: Thu, 17 Jan 2002 09:39:11 -0800 From: Luigi Rizzo <rizzo@icir.org> To: ipfw@freebsd.org Subject: dummynet byte counters Message-ID: <20020117093911.C98289@iguana.icir.org>
next in thread | raw e-mail | index | archive | help
Hi, i got request from some people on how can i know how many bytes were used by a dummynet pipe -- essentially i guess for accounting reasons, or to export these values with mrtg as some people do, etc. For this to work you would need to count packets and bytes coming out of the queue. But at the moment, dummynet pipes only count packets and bytes _in_, plus packet drops. There are two ways to implement this feature (which i think is useful): + add to struct dn_flow_queue a counter for bytes dropped (and while we are at it, extend the packet drop counter to 64 bits). This has the problem of requiring a reinstallation of /sbin/ipfw because the size of structures passed with getsockopt changes; + use the tot_pkts/tot_bytes field to count traffic _out_ of the pipe instead of traffic going in. This way the size of dn_flow_queue does not change, but the meaning of these two fields changes; on the other hand, some people who wrote me already thought these field counted data out. For what is worth, the wording in /sbin/ipfw's output is sufficiently vague not to require any change in that program. Obviously I am not thinking of changing before 4.5 is released, but right after that it is definitely something to do. Any preference on the solution to use ? I see some good in both of them, and the second one is to some degree a bit more transparet than the first one. cheers luigi To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020117093911.C98289>