SNMP Protocol Table Traversal Using GetNextRequest and GetBulkRequest Messages
(Page 1 of 2)
The GetRequest-PDU message we examined last topic is the one used by applications to request values for regular, single variables in an SNMP managed object's management information base. As I mentioned in the topic describing MIB objects, however, the Structure of Management Information (SMI) also allows a management information base to contain tabular data.
MIB tables are a useful way for a device to store and organize a set of related data items. It would be rather inefficient to try to structure these items just as collections of regular objects. For example, a device may have multiple IP addresses. It would be inefficient to define one MIB object called ipAddr1, and another called ipAddr2, and so on to store IP address information. Instead, an object called ipAddrTable is defined in the original SNMPv1 MIB, which specifies a table containing one or more entries called ipAddrEntry. Each entry contains the IP address and subnet mask for one of the interfaces of the device.
There needs to be a way to let an SNMP manager may wish to read the contents of these tables from a device. This can be done using the regular GetRequest-PDU message, by specifying each entry in the table one after the other. However, this is somewhat crude, and it leaves a problem: the SNMP manager may not know how many entries are in the table, and therefore, how many entries it should request.
The problem of table traversal was addressed in SNMPv1 through the creation of a new message type called GetNextRequest-PDU. You can think of this as a relative version of the regular GetRequest-PDU. The GetNextRequest-PDU contains the name of a tabular variable, as well as a particular entry in the table. The device receiving the GetNextRequest-PDU uses this to look up the next value in the table and return it in a GetResponse-PDU message.
The actual protocol exchange is about the same as that described in the previous topic: a request is sent by the SNMP manager and a reply returned by the SNMP agent. The difference is that instead of the SNMP agent returning the value for the variable specified, it returns the value of the next variable in the table. This is then used as the value for the next request, and so on, until the last entry in the table is reached. Once this happens and a GetNextRequest-PDU is sent that contains this last entry, the responding device indicates this by returning the MIB object that conceptually follows the table in the implementation of the management information base. This signals to the SNMP manager that the table has been fully traversed.
Home - Table Of Contents - Contact Us
The TCP/IP Guide (http://www.TCPIPGuide.com)
Version 3.0 - Version Date: September 20, 2005
© Copyright 2001-2005 Charles M. Kozierok. All Rights Reserved.
Not responsible for any loss resulting from the use of this site.