views:

476

answers:

1

I am trying to find some example code to build a bandwidth monitor to keep tabs on my daily on/off peek download usage. I have a semi working solution but the data it shows includes all data transferred over my LAN as well as via my ISP.

Is there some way to separate out LAN from ISP bound traffic in data totals.

Thanks.

A: 

Simply include only the traffic where either the source or the destination IP address is non-local. 192.168.*.* and 10.*.*.* are two such "local" address patterns.

romkyns
That would mean tracking all data transferred via the application, aside from any impact on the data transfer itself this would cause I was hoping to use the system counters to provide me with the data if its already been stored; don't want to remake the wheel.Maybe manually tracking the data transfers is the only way to do it but I really hope not :/
F3Speech
I suspect the system counters don't let you see this. SharpPCap lets you see the IP addresses with relative ease (although probably not the best way to start coding again after a long break). In any case, if you don't want to reinvent the wheel then why not use a bandwidth tracker made by someone else - people at superuser.com should be able to recommend you a bunch.
romkyns
I want to take the monitor a step further after getting it running one one PC, i'd like to have it scan the local network for other LAN users with it running and share its information. This would allow true monitoring of a shared line; atm I cant find anything already made to do this. I will give superuser.com a try though, ty for the pointer.
F3Speech
http://superuser.com/questions/40518/are-there-any-free-bandwidth-meters-available BWMeter looks like it will do the job shame its $30
F3Speech