Previous | Table of Contents | Next |
As documented in RFC 1902 [5-3], module definitions are used when describing information modules. An ASN.1 macro, called MODULE-IDENTITY, is used to convey the semantics of an information module. More specifically, it conveys the contact and revision history for each information module, using the following clauses: LAST-UPDATED, ORGANIZATION, CONTACT-INFO, DESCRIPTION, and REVISION. The SMI definition in RFC 1902 explicitly defines the MODULE-IDENTITY macro. Other module definitions will be discussed in the following sections on textual conventions and conformance statements.
The object definitions in SNMPv2 are enhanced from SNMPv1 through the use of the new OBJECT-IDENTITY module, some new data types that were not used in SNMPv1, and a revised OBJECT-TYPE module. The OBJECT-IDENTITY module is used to define information about an OBJECT IDENTIFIER assignment. This module includes the following clauses: STATUS, DESCRIPTION, and REFERENCE.
The SNMPv2 SMI has added support for ASN.1 data types that SNMPv1 did not use, and it has also defined new data types. ASN.1 data types that remain unchanged from RFC 1155 include INTEGER, OCTET STRING, and OBJECT IDENTIFIER. Application-wide data types from RFC 1155 that have not changed are IpAddress, TimeTicks, and Opaque. New SNMPv2 data types include:
Data Type | Description |
---|---|
Integer32 | A defined type that represents integer-valued information between -231 and 231-1 inclusive (-2147483648 and 2147483647 decimal). (Note: This type is indistinguishable from the INTEGER type, although the INTEGER type may have different numerical constraints.) |
Counter32 | A defined type that represents a non-negative integer that monotonically increases until it reaches a maximum value of 232-1 (4294967295 decimal) then wraps around and starts increasing again from zero. |
Counter64 | A defined type that represents a nonnegative integer that monotonically increases until it reaches a maximum value of 264-1 (18446744073709551615 decimal), then wraps around and starts increasing again from zero. Counter64 is used for objects for which the 32-bit counter (Counter32) is too small, or which would wrap around too quickly. RFC 1902 states that the Counter64 type may be used only if the information being modeled would wrap in less than one hour using the Counter32 type. |
Unsigned32 | A defined type that represents integer-valued information between 0 and 232-1 (4294967295 decimal), inclusive. |
Gauge32 | A defined type that represents a nonnegative integer which may increase or decrease, but which never exceeds a maximum value (232-1, as above). |
BITS | A construct which represents an enumeration of named bits. |
It should be noted that three data typesBIT STRING, NsapAddress, and UInteger32were defined in the original version of the SNMPv2 SMI (RFC 1442), but were removed from the current version of the SNMPv2 SMI (RFC 1902).
The SNMPv2 SMI extends the OBJECT-TYPE macro (discussed in Section 3.2.3), which conveys the syntax and semantics of a managed object. Because of the OBJECT-TYPE macros global significance, this section describes it in detail. The OBJECT-TYPE macro from RFC 1902 is as follows:
OBJECT-TYPE MACRO ::= BEGIN TYPE NOTATION ::= "SYNTAX" Syntax UnitsPart "MAX-ACCESS" Access "STATUS" Status "DESCRIPTION" Text ReferPart IndexPart DefValPart VALUE NOTATION ::= value(VALUE ObjectName) Syntax ::= type(ObjectSyntax) | "BITS" "{" Kibbles "}" Kibbles ::= Kibble | Kibbles "," Kibble Kibble ::= identifier "(" nonNegativeNumber ")" UnitsPart ::= "UNITS" Text | empty Access ::= "not-accessible" | "accessible-for-notify" | "read-only" | "read-write" | "read-create" Status ::= "current" | "deprecated" | "obsolete" ReferPart ::= "REFERENCE" Text | empty IndexPart ::= "INDEX" "{" IndexTypes "}" | "AUGMENTS" "{" Entry "}" | empty IndexTypes ::= IndexType | IndexTypes "," IndexType IndexType ::= "IMPLIED" Index | Index Index ::= -- use the SYNTAX value of the -- correspondent OBJECT-TYPE invocation value(Indexobject ObjectName) Entry ::= -- use the INDEX value of the -- correspondent OBJECT-TYPE invocation value(Entryobject ObjectName) DefValPart ::= "DEFVAL" "{" value(Defval Syntax) "}" | empty -- uses the NVT ASCII character set Text ::= """" string """" END
Note that the OBJECT-TYPE macro has been enhanced from versions defined in RFC 1155 and RFC 1212. In the TYPE NOTATION, a new UNITS clause contains a textual definition of the units associated with that object. Examples include packets, messages, or seconds. The MAX-ACCESS clause defines the maximum level of access for an object. In other words, this clause determines whether it makes sense within the proper operation of the protocol to read, write, and/or create an instance of an object. The values are ordered from least to greatest accessibility: not-accessible, accessible-for-notify, read-only, read-write, and read-create (where read-create is a superset of read-write).
The revised STATUS clause of the OBJECT-TYPE macro eliminates the optional value in earlier versions of the macro. The DESCRIPTION clause is now mandatory, and the REFERENCE clause can provide a textual cross reference to another module. The INDEX clause, which identifies instances of columnar objects within a table, can now be replaced with the AUGMENTS clause if the object corresponds to a conceptual row. The AUGMENTS clause thus augments (or extends) a conceptual row within a table. Finally, the DEFVAL clause defines a default value for the object.
Previous | Table of Contents | Next |