TimeTicks 和 TimeInterval SMI 类型之间的区别
Difference between TimeTicks and TimeInterval SMI types
RFC 2578 "Structure of Management Information Version 2 (SMIv2)" 包含定义为 IMPLICIT INTEGER (0..4294967295)
并描述为 "non-negative integer which represents the time, modulo 2^32 (4294967296 decimal), in hundredths of a second between two epochs".
的类型 TimeTicks
RFC 2579 "Textual Conventions for SMIv2" 包含类型 TimeInterval
,定义为 TEXTUAL-CONVENTION
和 SYNTAX INTEGER (0..2147483647)
并描述为 "A period of time, measured in units of 0.01 seconds.".
我看不出这两者之间的区别,或者换句话说,为什么在有 TimeTicks
的情况下需要 TimeInterval
(除了可能出于历史原因)。如果存在实际差异,它们是什么以及我应该使用什么类型?
我认为 TimeTicks 是指通过引用两个已知纪元来表示时间点,而 TimeInterval 表示没有引用的时间段。
对于TimeTicks,注意定义的最后一句:
The TimeTicks type represents a non-negative integer which represents
the time, modulo 2^32 (4294967296 decimal), in hundredths of a second
between two epochs. When objects are defined which use this ASN.1
type, the description of the object identifies both of the reference
epochs.
下一段描述了 TimeStamp 如何定义这两个时期:
For example, [3] defines the TimeStamp textual convention which is
based on the TimeTicks type. With a TimeStamp, the first reference
epoch is defined as the time when sysUpTime [5] was zero, and the
second reference epoch is defined as the current value of sysUpTime.
TimeInterval 不是用来计算时间的,而是用来定义时间长度的。看一下 CISCO 中使用 TimeInterval 的这个对象:
snmpTargetAddrTimeout OBJECT-TYPE
SYNTAX TimeInterval
MAX-ACCESS read-create
STATUS current
DESCRIPTION "This object should reflect the expected maximum round
trip time for communicating with the transport address
defined by this row. When a message is sent to this
address, and a response (if one is expected) is not
received within this time period, an implementation
may assume that the response will not be delivered.
Note that the time interval that an application waits
for a response may actually be derived from the value
of this object. The method for deriving the actual time
interval is implementation dependent. One such method
is to derive the expected round trip time based on a
particular retransmission algorithm and on the number
of timeouts which have occurred. The type of message may
also be considered when deriving expected round trip
times for retransmissions. For example, if a message is
being sent with a securityLevel that indicates both
authentication and privacy, the derived value may be
increased to compensate for extra processing time spent
during authentication and encryption processing.
"
DEFVAL { 1500 }
::= { snmpTargetAddrEntry 4 }
RFC 2578 "Structure of Management Information Version 2 (SMIv2)" 包含定义为 IMPLICIT INTEGER (0..4294967295)
并描述为 "non-negative integer which represents the time, modulo 2^32 (4294967296 decimal), in hundredths of a second between two epochs".
TimeTicks
RFC 2579 "Textual Conventions for SMIv2" 包含类型 TimeInterval
,定义为 TEXTUAL-CONVENTION
和 SYNTAX INTEGER (0..2147483647)
并描述为 "A period of time, measured in units of 0.01 seconds.".
我看不出这两者之间的区别,或者换句话说,为什么在有 TimeTicks
的情况下需要 TimeInterval
(除了可能出于历史原因)。如果存在实际差异,它们是什么以及我应该使用什么类型?
我认为 TimeTicks 是指通过引用两个已知纪元来表示时间点,而 TimeInterval 表示没有引用的时间段。
对于TimeTicks,注意定义的最后一句:
The TimeTicks type represents a non-negative integer which represents the time, modulo 2^32 (4294967296 decimal), in hundredths of a second between two epochs. When objects are defined which use this ASN.1 type, the description of the object identifies both of the reference epochs.
下一段描述了 TimeStamp 如何定义这两个时期:
For example, [3] defines the TimeStamp textual convention which is based on the TimeTicks type. With a TimeStamp, the first reference epoch is defined as the time when sysUpTime [5] was zero, and the second reference epoch is defined as the current value of sysUpTime.
TimeInterval 不是用来计算时间的,而是用来定义时间长度的。看一下 CISCO 中使用 TimeInterval 的这个对象:
snmpTargetAddrTimeout OBJECT-TYPE
SYNTAX TimeInterval
MAX-ACCESS read-create
STATUS current
DESCRIPTION "This object should reflect the expected maximum round
trip time for communicating with the transport address
defined by this row. When a message is sent to this
address, and a response (if one is expected) is not
received within this time period, an implementation
may assume that the response will not be delivered.
Note that the time interval that an application waits
for a response may actually be derived from the value
of this object. The method for deriving the actual time
interval is implementation dependent. One such method
is to derive the expected round trip time based on a
particular retransmission algorithm and on the number
of timeouts which have occurred. The type of message may
also be considered when deriving expected round trip
times for retransmissions. For example, if a message is
being sent with a securityLevel that indicates both
authentication and privacy, the derived value may be
increased to compensate for extra processing time spent
during authentication and encryption processing.
"
DEFVAL { 1500 }
::= { snmpTargetAddrEntry 4 }