jow- / nlbwmon

Simple conntrack based traffic accounting
ISC License
150 stars 34 forks source link

Why are bandwidth numbers from nlbwmon tiny, especially compared to vnstat's numbers? #7

Closed hub2git closed 7 years ago

hub2git commented 7 years ago

Let's look solely on the wlan0 (2.4 gHz) bandwidth, which is used by only one device, a Satellite laptop.

In nlbwmon's info, the Satellite's total bandwidth is less than 300 MB. But in vnstat, wlan0's total bandwidth is 1.42 GB.

Can someone kindly help me understand the discrepancy? Please know that both have the same billing cycle (same cutoff date).

192 168 1 1-cgi-bin-luci-admin-status-vnstat-style m 1 192 168 1 1-cgi-bin-luci-admin-nlbw-display 1

192 168 1 1-cgi-bin-luci-admin-status-vnstat-config

jow- commented 7 years ago

Vnstat looks at interface traffic counters which also factor in things like local broadcast traffic, protocol overhead etc. while nlbwmon solely counts connections which are destined from the local network to remote destinations.

hub2git commented 7 years ago

@jow- Thank you for replying. Based on the differences as you describe, your program, nlbwmon, is what I want.

If I understand you correctly, nlbwmon will tell me how much bandwidth I've used, as seen from the point of view of the ISP. Is this correct?

jow- commented 7 years ago

Yes, that is the basic idea.

hub2git commented 7 years ago

@jow- thank you again for your reply.

Could there be other reasons for the discrepancy, though? For instance, (I understand that) nlbwmon has issues monitoring ipv6 stats.

sages commented 7 years ago

Is there a requirement to have 'Force Connection Tracking' enabled in iptables to correct the discrepancy between vnstat and nlbwmon?

hub2git commented 7 years ago

@sages

I don't want nlbwmon to have the same figures as vnstat, merely for the sake of removing the discrepancy. Nlbwmon and vnstat measure different things. There may be overlap in what they measure, but their "nets" don't cover exactly the same "area".

What I do wish, however, is for nlbwmon​ to fulfill its intended goal of counting the ”connections which are destined from the local network to remote destinations”. Because, at the moment, nlbwmon seems to be deficient in fulfilling its stated job description.