Previous Table of Contents Next


5.5.2 SNMPv2 PDU syntax

The SNMPv2 message consists of the wrapper that encapsulates an SNMPv2 PDU. The wrapper is determined by the administrative framework and may contain the authentication and privacy information. The syntax of the SNMPv2 PDUs is similar to the structures defined in SNMPv1. Significant enhancements include error status codes that detail why protocol operations were unsuccessful.

The PDU consists of four fields—the PDU Type field, the Request ID field, the Error Status field, and the Error Index field (see Figure 5-2)—plus the variable bindings. The PDU Type field specifies which one of the eight PDUs is being transmitted. The Request ID correlates the request and response PDUs.

The Error Status field includes new exception conditions. When errors occur in the processing of the GetRequest, GetNextRequest, GetBulkRequest, SetRequest, or InformRequest PDUs, the SNMPv2 entity prepares a Response PDU with the Error Status field set to help the manager identify and correct the problem. The following table shows how the PDUs use these error codes:

SNMPv2 Error Get GetNext GetBulk Set Inform

noError x x x x x
tooBig x x x x
noSuchName1
badValue1
readOnly1
genErr x x x x
noAccess x
wrongType x
wrongLength x
wrongEncoding x
wrongValue x
noCreation x
inconsistentValue x
resourceUnavailable x
commitFailed x
undoFailed x
authorizationError x2x2x2x2x2
notWritable x
inconsistentName x


1Never generated by an SNMPv2 entity (proxy capability only), per RFC 1905, pages 6 and 18, and RFC 1908, page 7.
2Unused with SNMPv2, per RFC 1901, page 5.

The Error Index field is used with the Error Status code. When errors occur in the processing of the variable bindings, the Error Index field identifies the binding that caused the error. An error in the first binding would have Index = 1, an error in the second binding would have Index = 2, and so on.

5.5.2.1 The GetBulkRequest PDU

The GetBulkRequest (which some literature calls the “awesome GetBulkRequest”) retrieves large amounts of data. The GetBulkRequest PDU enhances the GetNext PDU; it essentially executes multiple GetNext requests (lexicographically ordered) with a single PDU. The structure of the GetBulkRequest PDU resembles that of the other PDUs, but changes the syntax of two fields. It replaces Error Status with Non-Repeaters, and Error Index with Max-Repetitions.

The values of the Non-Repeaters and Max-Repetitions fields indicate the processing requested. The Non-Repeaters field defines the number of requested variables that will not be processed repeatedly; it is used when some of the variables are scalar objects with only one variable. The Max-Repetitions field defines the maximum number of repeated executions that retrieve specific variables.

The retrieved variables return in the Response PDU that corresponds to the request. One variable binding in the Response PDU is requested for the first N variable bindings in the GetBulkRequest. M variable bindings are requested for each of the R remaining variable bindings in the GetBulkRequest. The following expression gives the total number of requested variable bindings:

  Total Variable Bindings = N + (M * R), where

  N = the minimum of:

      (a) the value of the Non-Repeaters field

      and

      (b) the number of variable bindings in the GetBulkRequest

  M = the value of the Max-Repetitions field in the GetBulkRequest

  R = the minimum of

      (a) the number of variable bindings in the GetBulkRequest less N

      and

      (b) zero

Processing continues until all of the requested variables have been retrieved or the maximum size of the Response PDU is reached. The maximum size is determined by the smallest maximum message size that the source can generate or by the maximum message size that the destination can accept. The Response PDU then returns with the variables that the GetBulk requested.

5.5.2.2 InformRequest PDU

The InformRequest PDU performs manager-to-manager, not agent-to-manager, communication. The requesting application specifies the destination(s) to which an InformRequest PDU will be sent. The first two variable bindings that the PDU transmits are the sysUpTime.0 (from MIB-II) and the snmpTrapOID.i (from the SNMP Trap group in the SNMPv2 MIB—RFC 1907). Subsequent variable bindings contain information in the MIB view of a party, which is local to the manager that transmitted the InformRequest.


Previous Table of Contents Next