How would Tx/Rx handle maxiumum values causing overflow in Linux platform?

I have a Linux device sending data to remote Cloud services every 1 minute in 7 / 24 environment. To ensure reliability of sending data crossing Internet, not beholding internal kernel buffer, I need to monitor following statistics which I believe the RX / TX represents true numbers of packages coming / going out interfaces, right? If it is correct, what are following maximum numbers, uint32 or uint64? How will it handle when it reaches the maximum number to cause the overflow?

cat /sys/class/net/eth0/statistics/rx_bytes

cat /sys/class/net/eth0/statistics/rx_packets

cat /sys/class/net/eth0/statistics/tx_packets

cat /sys/class/net/eth0/statistics/tx_bytes

Thank you very much.

Kind regards,

jupiter


Solution 1:

To ensure reliability of sending data crossing Internet, not beholding internal kernel buffer, I need to monitor following statistics which I believe the RX / TX represents true numbers of packages coming / going out interfaces, right?

That's a strange and silly way to monitor it.

First of all, if you use TCP/IP you can assume that transmission is reliable. E.g. you'll get a connection failure of some sort, that you can log in your application, if the transmission times out or connection fails. This will provide more accurate information than a mere packet counter.

Second, if you know that you send a message every minute, count the number of received messages. Not the number of packets, which would be layer 2, but the number of messages, which would be somewhere in the Layer 4 - Layer 7 roughly speaking. This will give you a better idea than counting packets.

If you count L2 packets, this includes replies to ping, broadcast traffic and all other kinds of traffic on the network.