LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Need explanation of /proc/net/dev bytes counters (https://www.linuxquestions.org/questions/linux-networking-3/need-explanation-of-proc-net-dev-bytes-counters-4175458860/)

waddles 04-20-2013 03:24 AM

Need explanation of /proc/net/dev bytes counters
 
Would like to know the exact working of /proc/net/dev under Slackware 13.37?
As I perceive the "bytes" columns that at some undefined point in time they get the number of bytes transmitted and bytes received. I have not been able to find when that time is and need to know. Also I see that it must not be reset to zero as when there is NO activity the byte values go unchanged. Do I have that correct? Are these aggregation values? If they are as they seem, are they ever reset to lower values and under what conditions?
Thanks for the help in advance

273 04-20-2013 04:17 AM

The "bytes" column for "Receive" and "Transmit" are the number of bytes received and sent since the machine was last booted up -- in other words in the period given by "uptime".
At least that is what they represent on my machine at present.

waddles 04-20-2013 04:34 AM

That may be but it doesn't explain why when I monitor ppp0 the numbers go up (haven't seen them go down) which makes me want to agree but when I look at it later (after dropping the link) I see low byte counts for lo interface than had been there.
I also just looked at is -p link and ifconfig which showed different values albeit i did not bring up the web link. Still in a quandery?

273 04-20-2013 04:41 AM

I'm not sure I understand. Isn't lo the local loopback device so I would expect only a low byte count if any depending on what you're running? Are you saying ppp0 goes down also?
I'm using a wireless card wlan0 and the numbers I get for both match perfectly.
I've not used ppp connections so perhaps they're dealt with differently?

waddles 04-20-2013 05:23 PM

When I mentioned the lo byte counts, I was flagging the point that when there was no activity there that byte counts never went to zero. I expected that if there was no activity for a period that that would be so reflected but I guess not.
I am beginning to think that the byte counts are reflective of current activity not since bootup otherwise the byte count I see from different sessions using the browser would increase astronomically and that does not seem to happen.
Hence, I have gathered the there must 1st be a transmission or upload count then a download count until the next upload, i.e. request data, receive data, and repeat. Would you all agree with that?

273 04-20-2013 05:32 PM

I'm not sure what you mean. The count never goes down at is it cumulative.
The counts are the number of bytes transmitted and the number of bytes received received on that interface since the interface was brought up.
So:
The count will never go down because you cannot un-transmit or un-receive bytes without going back in time.
The count will go up, and stay up, every time a byte is received or transmitted, respectively.
The count will be reset to zero when you reboot.

waddles 04-21-2013 01:20 AM

I totally agree with UR last statement. Although it probably doesn't read like it but that is what I was saying while trying not to be direct as I was having difficulty finding documents stating it directly. Will mark this solved.


All times are GMT -5. The time now is 09:55 PM.