While I'm going to be switching to a slightly saner plan soon, being stuck on a 5GB monthly bandwidth cap has made me very data-conscious, and I'm looking for a way to log my Internet usage in such a way that I can see how much I've uploaded, and how much I've downloaded, to each port on each host/IP I visit; seeing you downloaded 823.64MB and uploaded 92.12MB last Tuesday on my ISP's web portal isn't especially insightful...I have a couple of extra considerations I'd like to take into account:I would like the monitoring system to be as lightweight as possible. While existing software would be preferred, at the most extreme I'd consider a simple homemade C libpcap program, if there are examples that I could get up and running from with less than 150 lines of trivial modifications.Since just about everything that works with a domain name is going to do a DNS lookup to find the IP address, a system which sniffs for the DNS lookup response and uses that to associate IP addresses with hostnames - rather than making an indepentant/spurious call - would be nice to have.
How might I log my Internet traffic, grouped by IP address/hostname, port, etc?
networking;monitoring;bandwidth;packet