jow- / nlbwmon

Simple conntrack based traffic accounting
ISC License
147 stars 33 forks source link

Wrong values with OpenWRT 22.03.0-rc0 #49

Closed schuettecarsten closed 2 years ago

schuettecarsten commented 2 years ago

With OpenWrt 22.03.0-rc0, nwlbmon does not show any useful information. It mainly tracks upload connections from the OpenWRT router itself, but only a few download connections from the network devices. For example, after a Fire TV session, it shows 45.13 MiB upload for the stick, but only 29.85 KiB download - should be more than a few gigabytes.

Config file:

config nlbwmon
        option netlink_buffer_size '524288'
        option database_interval '1'
        option protocol_database '/usr/share/nlbwmon/protocols'
        option refresh_interval '60s'
        option database_directory '/mnt/sda1/data/nlbwmon'
        option commit_interval '10m'
        option database_generations '60'
        list local_network '192.168.0.0/16'
        list local_network '172.16.0.0/12'
        list local_network '10.0.0.0/8'
        list local_network 'guest'
        list local_network 'lan'
        option database_limit '10000'
        option database_compress '1'
jow- commented 2 years ago

Do you use any kind of offloading? If so it might interfere. nlbwmon pulls its data from conntrack accounting, if those counters are inaccurate, there's nothing we can do about it in the software. It would have to be fixed on the Kernel side.

schuettecarsten commented 2 years ago

No, I do not use offloading, but regardless if I turn it off or on, it does not change anything. And it works with OpenWRT version 21.02, but fails with 22.03-rc. Maybe some dependencies are missing?

jow- commented 2 years ago

I have no idea, sorry. I can only suggest to cross check with cat /proc/net/nf_conntrack if that shows invalid counter values as well, the issue likely is not in nlbwmon.

schuettecarsten commented 2 years ago

The same problem is for 22.03-rc4. But you are right, it looks like it is not a nlbwmon issue, but a general netlink issue with bridged devices. When using the collectd-mod-netlink module, it also shows wrong staticstics for my br-lan device, but correct values for the eth0.1, eth0.2,... devices.

And it looks like this is caused by Software Flow offloading, which is turned on here.