25.3 Structure of Management Information

25.3 Structure of Management Information

SNMP uses only a few different types of data. In this section we'll look at those data types, without worrying about how the data is actually encoded (that is, the bit pattern used to store the data).

  • INTEGER. Some variables are declared as an integer with no restrictions (e.g., the MTU of an interface), some are defined as taking on specific values (e.g., the IP forwarding flag is 1 if forwarding is enabled or 2 if forwarding is disabled), and others are defined with a minimum and maximum value (e.g., UDP and TCP port numbers are between 0 and 65535).

  • OCTET STRING. A string of 0 or more 8-bit bytes. Each byte has a value between 0 and 255. In the BER encoding used for this data type and the next , a count of the number of bytes in the string precedes the string. These strings are not null- terminated strings.

  • DisplayString. A string of 0 or more 8-bit bytes, but each byte must be a character from the NVT ASCII set (Section 26.4). All variables of this type in the MIB-II must contain no more than 255 characters . (A 0-length string is OK.)

  • OBJECT IDENTIFIER. We describe these in the next section.

  • NULL. This indicates that the corresponding variable has no value. It is used, for example, as the value of all the variables in a get or get “next request, since the values are being queried, not set.

  • IpAddress. An OCTET STRING of length 4, with 1 byte for each byte of the IP address.

  • PhysAddress. An OCTET STRING specifying a physical address (e.g., a 6-byte Ethernet address).

  • Counter. A nonnegative integer whose value increases monotonically from 0 to 2 32 “ 1 (4,294,967,295), and then wraps back to 0.

  • Gauge. A nonnegative integer between 0 and 2 32 “ 1, whose value can increase or decrease, but latches at its maximum value. That is, if the value increments to 2 32 “ 1, it stays there until reset. The MIB variable tcpCurrEstab is an example: it is the number of TCP connections currently in the ESTABLISHED or CLOSE_WAIT state.

  • TimeTicks. A counter that counts the time in hundredths of a second since some epoch. Different variables can specify this counter from a different epoch, so the epoch used for each variable of this type is specified when the variable is declared in the MIB. For example, the variable sysUpTime is the number of hundredths of a second that the agent has been up.

  • SEQUENCE. This is similar to a structure in the C programming language. For example, we'll see that the MIB defines a SEQUENCE named UdpEntry containing information about an agent's active UDP end points. (By "active" we mean ports currently in use by an application.) Two entries are in the structure:

    1. udpLocalAddress, of type IpAddress, containing the local IP address.

    2. udpLocalPort, of type INTEGER, in the range 0 through 65535, specifying the local port number.

  • SEQUENCE OF. This is the definition of a vector, with all elements having the same data type. If each element has a simple data type, such as an integer, then we have a simple vector (a one-dimensional array). But we'll see that SNMP uses this data type with each element of the vector being a SEQUENCE (structure). We can then think of it as a two-dimensional array or table.

    For example, the UDP listener table is named udpTable and it is a SEQUENCE OF the 2-element SEQUENCE (structure) UdpEntry that we just described. Figure 25.5 shows this two-dimensional array.

    Figure 25.5. UDP listener table (udpTable) as a two-dimensional array in SNMP.
    graphics/25fig05.gif

The number of rows in these tables is not specified by SNMP, but we'll see that a manager using the get “next operator (Section 25.7) can determine when the final row of a table has been returned. Also, in Section 25.6 we'll see how the manager specifies which row of a table it wants to get or set.



TCP.IP Illustrated, Volume 1. The Protocols
TCP/IP Illustrated, Vol. 1: The Protocols (Addison-Wesley Professional Computing Series)
ISBN: 0201633469
EAN: 2147483647
Year: 1993
Pages: 378

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net