Date: Tue, 14 May 2002 22:10:03 -0700 (PDT) From: "Crist J. Clark" <crist.clark@attbi.com> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/37602: netstat -i -b does not count outgoing packets for ip aliases Message-ID: <200205150510.g4F5A3g51656@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/37602; it has been noted by GNATS. From: "Crist J. Clark" <crist.clark@attbi.com> To: james brown <jbsd@syndicate.net> Cc: FreeBSD-gnats-submit@FreeBSD.ORG Subject: Re: bin/37602: netstat -i -b does not count outgoing packets for ip aliases Date: Tue, 14 May 2002 15:48:25 -0700 On Mon, May 13, 2002 at 04:45:04PM -0700, james brown wrote: > > > It doesn't make a lot of sense to track outgoing packets by source IP > > address on an interface. The destination IP address determines which > > i think in our situation it does make sense. here is our setup: > > - a single network interface. > > - multiple ip address aliases on that interface. > > - multiple http and ftp daemons bound to those ip addresses. > > we want to measure the network traffic for each ip address using > netstat -i -b in order to get statistics on how much traffic is moving > in and out of these daemons. But as you've found, you're not going to get it with netstat(1). That information simply isn't tracked. Figuring out what alias address a packet might be "leaving" simply isn't required in the IP output code, so it is not convenient to track it (since it is a bunch of extra code to run for every packet). And as I mentioned, in the case where you have multiple interfaces, trying to track it would be confusing. > > If you are playing with ipfw(8) accounting, you can see this by adding > > rules like, > > i am aware that we can count bytes using ipfw accounting but this only > produces the total in/out combined. we were hoping to use netstat > because it displays in and out separately. You can make ipfw(8) track in and out separately. In fact, I really don't see how you could get it to track in and out combined, pass ip from <alias> to any out pass ip from any to <alias> in > the bottom line is netstat -i -b does not appear to be working properly > for ip aliases, this is why i submitted the gnats report. The netstat(1) utility is working fine. It's just dumping the counters in various in-kernel data structures. The fact is, the data you desire is simply not and never has been tracked in the BSD stack. Feel free to take a look in sys/netinet/ip_output.c and see if you can find a place to do the accounting without creating too much additional overhead. -- Crist J. Clark | cjclark@alum.mit.edu | cjclark@jhu.edu http://people.freebsd.org/~cjc/ | cjc@freebsd.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200205150510.g4F5A3g51656>