rfc2572.txt

来自「RFC 的详细文档!」· 文本 代码 · 共 1,614 行 · 第 1/5 页

TXT
1,614
字号

   The value of pduVersion represents a specific version of protocol
   operation and its associated PDU formats, such as SNMPv1 or SNMPv2
   [RFC1905].  The values of pduVersion are specific to the version of
   the PDU contained in a message, and the PDUs processed by
   applications. The Dispatcher does not use the value of pduVersion
   directly.







SNMPv3 Working Group        Standards Track                     [Page 6]

RFC 2572           Message Processing and Dispatching           April 1999


   An application specifies the pduVersion when it requests the PDU
   Dispatcher to send a PDU to another SNMP engine. The Dispatcher
   passes the pduVersion to a Message Processing Model, so it knows how
   to handle the PDU properly.

   For incoming messages, pduVersion is provided to the Dispatcher by a
   version-specific Message Processing module. The PDU Dispatcher passes
   the pduVersion to the application so it knows how to handle the PDU
   properly.  For example, a command responder application needs to know
   whether to use [RFC1905] elements of procedure and syntax instead of
   those specified for SNMPv1.

3.3.  pduType

   A value of pduType represents a specific type of protocol operation.
   The values of pduType are specific to the version of the PDU
   contained in a message.

   Applications register to support particular pduTypes for particular
   contextEngineIDs.

   For incoming messages, pduType is provided to the Dispatcher by a
   version-specific Message Processing module. It is subsequently used
   to dispatch the PDU to the application which registered for the
   pduType for the contextEngineID of the associated scopedPDU.

3.4.  sendPduHandle

   This handle is generated for coordinating the processing of requests
   and responses between the SNMP engine and an application. The handle
   must be unique across all version-specific Message Processing Models,
   and is of local significance only.

4.  Dispatcher Elements of Procedure

   This section describes the procedures followed by the Dispatcher when
   generating and processing SNMP messages.

4.1.  Sending an SNMP Message to the Network

   This section describes the procedure followed by an SNMP engine
   whenever it sends an SNMP message.









SNMPv3 Working Group        Standards Track                     [Page 7]

RFC 2572           Message Processing and Dispatching           April 1999



4.1.1.  Sending a Request or Notification

   The following procedures are followed by the Dispatcher when an
   application wants to send an SNMP PDU to another (remote)
   application, i.e., to initiate a communication by originating a
   message, such as one containing a request or a trap.

   1) The application requests this using the abstract service
      primitive:

       statusInformation =              -- sendPduHandle if success
                                        -- errorIndication if failure
         sendPdu(
         IN   transportDomain           -- transport domain to be used
         IN   transportAddress          -- destination network address
         IN   messageProcessingModel    -- typically, SNMP version
         IN   securityModel             -- Security Model to use
         IN   securityName              -- on behalf of this principal
         IN   securityLevel             -- Level of Security requested
         IN   contextEngineID           -- data from/at this entity
         IN   contextName               -- data from/in this context
         IN   pduVersion                -- the version of the PDU
         IN   PDU                       -- SNMP Protocol Data Unit
         IN   expectResponse            -- TRUE or FALSE
              )

   2) If the messageProcessingModel value does not represent a Message
      Processing Model known to the Dispatcher, then an errorIndication
      (implementation-dependent) is returned to the calling application.
      No further processing is performed.

   3) The Dispatcher generates a sendPduHandle to coordinate subsequent
      processing.

   4) The Message Dispatcher sends the request to the version-specific
      Message Processing module identified by messageProcessingModel
      using the abstract service primitive:













SNMPv3 Working Group        Standards Track                     [Page 8]

RFC 2572           Message Processing and Dispatching           April 1999


      statusInformation =              - success or error indication
        prepareOutgoingMessage(
        IN   transportDomain           -- as specified by application
        IN   transportAddress          -- as specified by application
        IN   messageProcessingModel    -- as specified by application
        IN   securityModel             -- as specified by application
        IN   securityName              -- as specified by application
        IN   securityLevel             -- as specified by application
        IN   contextEngineID           -- as specified by application
        IN   contextName               -- as specified by application
        IN   pduVersion                -- as specified by application
        IN   PDU                       -- as specified by application
        IN   expectResponse            -- as specified by application
        IN   sendPduHandle             -- as determined in step 3.
        OUT  destTransportDomain       -- destination transport domain
        OUT  destTransportAddress      -- destination transport address
        OUT  outgoingMessage           -- the message to send
        OUT  outgoingMessageLength     -- the message length
             )

   5) If the statusInformation indicates an error, the errorIndication
      is returned to the calling application.  No further processing is
      performed.

   6) If the statusInformation indicates success, the sendPduHandle is
      returned to the application, and the outgoingMessage is sent via
      the transport specified by the transportDomain to the address
      specified by the transportAddress.

   Outgoing Message Processing is complete.


4.1.2.  Sending a Response to the Network

   The following procedure is followed when an application wants to
   return a response back to the originator of an SNMP Request.

   1) An application can request this using the abstract service
      primitive:












SNMPv3 Working Group        Standards Track                     [Page 9]

RFC 2572           Message Processing and Dispatching           April 1999


      result =
      returnResponsePdu(
       IN   messageProcessingModel   -- typically, SNMP version
       IN   securityModel            -- Security Model in use
       IN   securityName             -- on behalf of this principal
       IN   securityLevel            -- same as on incoming request
       IN   contextEngineID          -- data from/at this SNMP entity
       IN   contextName              -- data from/in this context
       IN   pduVersion               -- the version of the PDU
       IN   PDU                      -- SNMP Protocol Data Unit
       IN   maxSizeResponseScopedPDU -- maximum size of Response PDU
       IN   stateReference           -- reference to state information
                                     -- as presented with the request
       IN   statusInformation        -- success or errorIndication
       )                             -- (error counter OID and value
                                     -- when errorIndication)

   2) The Message Dispatcher sends the request to the appropriate
      Message Processing Model indicated by the received value of
      messageProcessingModel using the abstract service primitive:

      result =                        -- SUCCESS or errorIndication
       prepareResponseMessage(
       IN   messageProcessingModel   -- specified by application
       IN   securityModel            -- specified by application
       IN   securityName             -- specified by application
       IN   securityLevel            -- specified by application
       IN   contextEngineID          -- specified by application
       IN   contextName              -- specified by application
       IN   pduVersion               -- specified by application
       IN   PDU                      -- specified by application
       IN   maxSizeResponseScopedPDU -- specified by application
       IN   stateReference           -- specified by application
       IN   statusInformation        -- specified by application
       OUT  destTransportDomain      -- destination transport domain
       OUT  destTransportAddress     -- destination transport address
       OUT  outgoingMessage          -- the message to send
       OUT  outgoingMessageLength    -- the message length
            )

   3) If the result is an errorIndication, the errorIndication is
      returned to the calling application.  No further processing is
      performed.

   4) If the result is success, the outgoingMessage is sent over the
      transport specified by the transportDomain to the address
      specified by the transportAddress.




SNMPv3 Working Group        Standards Track                    [Page 10]

RFC 2572           Message Processing and Dispatching           April 1999


   Message Processing is complete.

4.2.  Receiving an SNMP Message from the Network

   This section describes the procedure followed by an SNMP engine
   whenever it receives an SNMP message.

   Please note, that for the sake of clarity and to prevent the text
   from being even longer and more complicated, some details were
   omitted from the steps below.  In particular, The elements of
   procedure do not always explicitly indicate when state information
   needs to be released. The general rule is that if state information
   is available when a message is to be "discarded without further
   processing", then the state information must also be released at that
   same time.

4.2.1.  Message Dispatching of received SNMP Messages

   1) The snmpInPkts counter [RFC1907] is incremented.

   2) The version of the SNMP message is determined in an
      implementation-dependent manner.  If the packet cannot be
      sufficiently parsed to determine the version of the SNMP message,
      then the snmpInASNParseErrs [RFC1907] counter is incremented, and
      the message is discarded without further processing.  If the
      version is not supported, then the snmpInBadVersions [RFC1907]
      counter is incremented, and the message is discarded without
      further processing.

   3) The origin transportDomain and origin transportAddress are
      determined.

   4) The message is passed to the version-specific Message Processing
      Model which returns the abstract data elements required by the
      Dispatcher.  This is performed using the abstract service
      primitive:















SNMPv3 Working Group        Standards Track                    [Page 11]

RFC 2572           Message Processing and Dispatching           April 1999


      result =                        -- SUCCESS or errorIndication
        prepareDataElements(
        IN   transportDomain          -- origin as determined in step 3.
        IN   transportAddress         -- origin as determined in step 3.
        IN   wholeMsg                 -- as received from the network
        IN   wholeMsgLength           -- as received from the network
        OUT  messageProcessingModel   -- typically, SNMP version
        OUT  securityModel            -- Security Model specified
        OUT  securityName             -- on behalf of this principal
        OUT  securityLevel            -- Level of Security specified
        OUT  contextEngineID          -- data from/at this entity
        OUT  contextName              -- data from/in this context
        OUT  pduVersion               -- the version of the PDU
        OUT  PDU                      -- SNMP Protocol Data Unit
        OUT  pduType                  -- SNMP PDU type
        OUT  sendPduHandle            -- handle for a matched request
        OUT  maxSizeResponseScopedPDU -- maximum size of Response PDU
        OUT  statusInformation        -- success or errorIndication
                                      -- (error counter OID and value
                                      -- when errorIndication)
        OUT  stateReference           -- reference to state information
                                      -- to be used for a possible
             )                        -- Response

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?