64 bit network counters on a 32 bit Linux

Started by
1 comment, last by klems 17 years, 7 months ago
I'm trying to get some network traffic stats from my router. It's a humble 32-bit machine, so unfortunately, the kernel's network counters are all 32 bit, causing them to wrap around every 2³² bytes/packets. Is there a patch or workaround for this? I found a patch for an older kernel, but since I'm no kernel hacker I don't believe I could rewrite it for my kernel without screwing something up. I though about writing a userspace program that checks the counters every 10 minutes or so, summing up all overflows, but perhaps something like this already exists? Anyway, what I need is something that'll let me collect network traffic stats over a long period of time, and that has counters of at least 64 bits. Any suggestions? The router is running Debian Stable, with kernel 2.6.8-3.
Advertisement
You can get 64-bit counts from iptables. The netfilter code apparently has its own 64-bit counters independent of the (interface?) counters elsewhere in the kernel.

Steve Bougerollehttp://www.imperialrealms.com | http://www.sebgitech.com | http://www.bougerolle.net
I had no idea, but when I checked I saw you were right. Writing a script to extract the information should be easy now that I know where it is. Thanks!

This topic is closed to new replies.

Advertisement