Message Processing and Dispatching for the Simple Network Management Protocol (SNMP)
obsoleted by
- rfc-2272 — Message Processing and Dispatching for the Simple Network Management Protocol (SNMP)
Extracted elements (28)
A recommended msgID generation strategy uses the low-order bits of snmpEngineBoots as the high-order portion and a monotonically increasing integer for the low-order portion. This avoids reuse of outstanding values and provides replay protection without requiring unpredictable values.
msgID and the PDU's request-id are intentionally distinct. The msgID identifies the message and must be accessible even if PDU decryption fails; the request-id in the PDU is used by SNMP applications to identify the PDU. No assumption should be made that their values are equivalent.
The v3MP is defined in a separate section of the document to demonstrate that multiple independent Message Processing Models (v1MP, v2cMP, v3MP, and others) can coexist simultaneously within the architecture and can be described in separate documents.
The Message Processing Subsystem is designed to support multiple concurrent version-specific MP models. SNMPv1 (RFC 1157) and SNMPv2c (RFC 1901) message formats are identified as future models; the architecture does not restrict the number or types of models that can coexist.
A unique msgID MUST be generated for each outgoing request; the value MUST NOT be the same as any outstanding request. Values should not have been used recently to provide protection against some replay attacks.
Each combination of contextEngineID and pduType can be registered with the PDU Dispatcher only once; a second registration attempt for the same combination returns an errorIndication of alreadyRegistered.
For an incoming Response-PDU, the v3MP MUST compare the message's securityEngineID, securityModel, securityName, securityLevel, contextEngineID, and contextName against cached values from the original request; if any differ, the message MUST be discarded without further processing.
For incoming GetRequest, GetNextRequest, GetBulkRequest, SetRequest, or InformRequest PDUs, if the value of securityEngineID is not equal to the local snmpEngineID, the message MUST be discarded without further processing and a FAILURE result returned.
If an incoming message cannot be parsed to determine the SNMP version, snmpInASNParseErrs MUST be incremented and the message discarded. If the version is not supported, snmpInBadVersions MUST be incremented and the message discarded.
If the privFlag is set in msgFlags, the authFlag MUST also be set to one. The SNMP architecture explicitly requires that if privacy is selected, authentication is also required; the combination authFlag=0/privFlag=1 is invalid.
The reportableFlag MUST be zero for messages containing a Report PDU, a Response PDU, or an SNMPv2-Trap PDU; it MUST be one for Request-type PDUs and InformRequest PDUs. If the flag is incorrectly set, the receiver MUST process the message as if it were set correctly.
Upon receiving a message where authFlag=0 and privFlag=1, the v3MP MUST increment snmpInvalidMsgs, generate a Report PDU, discard the message without further processing, and return FAILURE.
When no application has registered for the contextEngineID/pduType combination of an incoming request or notification, snmpUnknownPDUHandlers MUST be incremented and a Response containing the snmpUnknownPDUHandlers OID/value pair MUST be sent back to the originator.
PDU dispatch after message processing is determined by sendPduHandle: a value of <none> indicates an incoming request or notification (dispatched via processPdu), while a non-<none> value indicates a response matched to an outstanding request (dispatched via processResponsePdu).
Report PDUs are engine-to-engine communications processed directly by the SNMPv3 Message Processing Model and are generally not passed to applications, unlike all other PDU types. They carry OID/value pairs from statusInformation (e.g., error counters).
sendPduHandle is a locally significant handle generated by the Dispatcher to coordinate the processing of requests and responses between the SNMP engine and an application. It must be unique across all version-specific Message Processing Models.
The Dispatcher is the sole dispatch component in an SNMP engine. It routes outgoing PDUs to version-specific Message Processing Models for message preparation, and routes incoming messages to the appropriate MP Model for extraction, then forwards extracted PDUs to registered applications.
The SNMPv3Message wire structure is a SEQUENCE containing msgVersion (snmpv3(3)), msgGlobalData (HeaderData with msgID, msgMaxSize, msgFlags, msgSecurityModel), msgSecurityParameters (OCTET STRING), and msgData (ScopedPduData, either plaintext ScopedPDU or encryptedPDU OCTET STRING).
This document defines the SNMP-MPD-MIB (OID snmpModules 3) containing the snmpMPDStats group with three mandatory Counter32 objects: snmpUnknownSecurityModels, snmpInvalidMsgs, and snmpUnknownPDUHandlers, used for remote monitoring of the message processing subsystem.
Applications have access to data that is not secured by the messaging layer. Applications should take reasonable steps to protect data from disclosure, and when sending data across the network they should obey the securityLevel and invoke Access Control Model services.
The actual level of security provided by the framework is primarily determined by the specific Security Model and SNMP application implementations incorporated. The Dispatcher and v3MP interact with Security Models via abstract service interface primitives but do not themselves implement security algorithms.
Values for msgID used in communication between SNMP entities must be chosen to avoid replay attacks. The values do not need to be unpredictable; it is sufficient that they not repeat across outstanding requests.
msgFlags is an OCTET STRING of SIZE(1) with three defined bits: authFlag (bit 0), privFlag (bit 1), and reportableFlag (bit 2). The combination authFlag=0/privFlag=1 is reserved and must NOT be used; the three valid combinations map to noAuthNoPriv, authNoPriv, and authPriv.
msgID is an INTEGER (0..2147483647) used between two SNMP entities to coordinate request messages and responses, and by the v3MP to coordinate processing across subsystem models. It is distinct from the PDU's request-id field.
msgMaxSize is an INTEGER (484..2147483647) that conveys the maximum message size the sender can accept when another SNMP engine sends it a message; used by the receiver to bound the size of any generated Response.
msgSecurityModel is an INTEGER (0..2147483647) that identifies which Security Model was used by the sender; the receiver MUST apply the same Security Model when processing the message.
msgSecurityParameters is an OCTET STRING whose content and format are defined entirely by the Security Model indicated by msgSecurityModel; the v3MP passes it opaquely to the appropriate Security Model implementation without interpretation.
ScopedPDU is a SEQUENCE of contextEngineID (OCTET STRING), contextName (OCTET STRING), and data (ANY, e.g., PDUs per RFC 1905). It is either carried as plaintext in scopedPduData or as an encryptedPDU OCTET STRING when privacy is applied.