• Advertisement
Sign in to follow this  

64 bit network counters on a 32 bit Linux

This topic is 4184 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement