gpt4 book ai didi

snmp - TimeTicks 和 TimeInterval SMI 类型之间的区别

转载 作者:行者123 更新时间:2023-12-01 00:25:13 30 4
gpt4 key购买 nike

RFC 2578“管理信息结构版本 2 (SMIv2)”包含类型 TimeTicks,定义为 IMPLICIT INTEGER (0..4294967295) 并描述为“表示时间的非负整数,以 2^32 为模(十进制为 4294967296),以两个纪元之间的百分之一秒为单位。

RFC 2579“SMIv2 的文本约定”包含一个类型 TimeInterval,定义为 TEXTUAL-CONVENTIONSYNTAX INTEGER (0..2147483647) 并描述为“一段时间,以 0.01 秒为单位测量。”。

我看不出这两者之间的区别,或者换句话说,为什么在有 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 }

关于snmp - TimeTicks 和 TimeInterval SMI 类型之间的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28851670/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com