2

Am I correct that HC SNMP interface counters like ifHCInOctets/ifHCOutOctets or ifHCInUcastPkts/ifHCOutUcastPkts wrap after such a long period that applications using those counters do not need to take this wrapping into account (not including situations where the counters might reset such as a switch reloading).

For example, even if 100GigE interface is fully utilized 24/7, the counter would wrap after 46 years and 9 months:

$ echo "((2^64-1)/(100*10^9/8))/60/60/24/365" | bc -l
46.79539338840576259512
$ 
3

Need to? Not in a day-to-day sense, but you're going to have some serious unhappy customers if your widget fails to deal with it properly. There are plenty of examples of "shouldn't happen" events programmers ignore that do happen and breaks all kinds of things. (you if you're Tivo, the system crashes/panics/etc.)

(I know, one cannot program for every possibility, but this isn't one of those times. Counter overflows / resets WILL happen; be prepared for it.)

  • I understand. However, strictly the counter wrap of a 64 bit counter will happen in 46.795 years in case of 100GigE interface? – Martin Jun 29 '15 at 6:49
  • It is an event that will happen per design, ignore it at your peril – Ricky Beam Jun 29 '15 at 20:21
-4

An SNMP object defined as a Counter must abide by RFC1155:

"3.2.3.3. Counter

This application-wide type represents a non-negative integer which monotonically increases until it reaches a maximum value, when it wraps around and starts increasing again from zero. This memo specifies a maximum value of 2^32-1 (4294967295 decimal) for counters."

  • 1
    "HC" counters are 64 bit. See RFC 2233 (3.1.6) – Ron Trunk Jun 27 '15 at 11:51
  • The wrapping behavior is established in 1155. – Ron Royston Jun 27 '15 at 18:07
  • ifHC* are Counter64 not Counter (or Counter32 these days) – Ricky Beam Jun 30 '15 at 1:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.