BandwidthD - inaccurate logging to PostgreSQL database
-
Following on Tracking bandwidth usage per ip per day and vnstat "like" package to monitor bandwidth usage PER LAN IP {NOW $280USD} I've set up BandwidthD on my pfSense box with logging to a remote PostgreSQL database.
This is working pretty well, except for the amount of data which has been logged to the database.In order to test accuracy, I downloaded a 100mb test bin file from a speedtest site. Record in database is showing as:
id ip timestamp sample_duration total icmp udp tcp ftp http p2p
1 192.168.0.2 2011-11-30 20:43:13.392453+01 200 105830 0 0 105829 0 105321 0
I presume all measurements are in kilobytes. 105321 kilobytes logged for http actually is 102.85254 megabyte.
This is only 2,85% off, but when I tried to replicate this bug I found values that were 6% and more off, which to me is quite significant.Does someone know what might cause this deviation?
-
Might be due to retransmission of packets to deal with lost, delayed or damaged packets during the file transfer.
And there is overhead…
The amount of data transferred and reported by BandwidthD will always be a little more than the size of the file transferred.
--brock