TimeTicks和TimeInterval SMI类型之间的差异

时间:2015-03-04 10:09:44

标签: snmp mib

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

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

我没有看到这两件事之间的差异,换句话说,当TimeInterval时,为什么TimeTicks需要{{1}}(除了历史原因)。如果存在实际差异,我应该使用什么类型和哪些类型?

1 个答案:

答案 0 :(得分:2)

我相信TimeTicks是通过引用两个已知时期来表示时间点,而TimeInterval表示没有引用的时间段。

对于TimeTicks,请注意定义的最后一句:

  

TimeTicks类型表示表示的非负整数   时间,模2 ^ 32(小数4294967296),以百分之一秒为单位   在两个时代之间。 定义使用此ASN.1的对象时   类型,对象的描述标识两个引用   时期。

下一段描述了TimeStamp如何定义这两个时代:

  

例如,[3]定义了TimeStamp文本约定   基于TimeTicks类型。使用TimeStamp,第一个引用   epoch定义为sysUpTime [5]为零的时间,以及   第二个参考时期被定义为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 }