home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1997 December / Internet_Info_CD-ROM_Walnut_Creek_December_1997.iso / drafts / draft_ietf_q_t / draft-ietf-snmpv3-v3mpc-model-05.txt < prev    next >
Text File  |  1997-10-10  |  89KB  |  2,402 lines

  1.  
  2.  
  3.  
  4. INTERNET-DRAFT                                                   J. Case
  5.                                                      SNMP Research, Inc.
  6.                                                            D. Harrington
  7.                                                  Cabletron Systems, Inc.
  8.                                                               R. Presuhn
  9.                                                       BMC Software, Inc.
  10.                                                                B. Wijnen
  11.                                                IBM T. J. Watson Research
  12.                                                           9 October 1997
  13.  
  14.  
  15.                Message Processing and Dispatching for the
  16.                Simple Network Management Protocol (SNMP)
  17.                  <draft-ietf-snmpv3-v3mpc-model-05.txt>
  18.  
  19. Status of this Memo
  20.  
  21.    This document is an Internet-Draft.  Internet-Drafts are working
  22.    documents of the Internet Engineering Task Force (IETF), its areas,
  23.    and its working groups.  Note that other groups may also distribute
  24.    working documents as Internet-Drafts.
  25.  
  26.    Internet-Drafts are draft documents valid for a maximum of six months
  27.    and may be updated, replaced, or obsoleted by other documents at any
  28.    time.  It is inappropriate to use Internet-Drafts as reference
  29.    material or to cite them other than as ``work in progress.''
  30.  
  31.    To learn the current status of any Internet-Draft, please check the
  32.    ``1id-abstracts.txt'' listing contained in the Internet-Drafts Shadow
  33.    Directories on ftp.is.co.za (Africa), nic.nordu.net (Europe),
  34.    munnari.oz.au (Pacific Rim), ds.internic.net (US East Coast), or
  35.    ftp.isi.edu (US West Coast).
  36.  
  37. Abstract
  38.  
  39.    This document describes the Message Processing and Dispatching for
  40.    SNMP messages within the SNMP architecture [SNMP-ARCH].  It defines
  41.    the procedures for dispatching potentially multiple versions of SNMP
  42.    messages to the proper SNMP Message Processing Models, and for
  43.    dispatching PDUs to SNMP applications.  This document also describes
  44.    one Message Processing Model - the SNMPv3 Message Processing Model.
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55. SNMPv3 Working Group       Expires March 1998                   [Page 1]
  56.  
  57. Internet Draft     Message Processing and Dispatching     9 October 1997
  58.  
  59.  
  60. 1.  Introduction
  61.  
  62.    The Architecture for describing Internet Management Frameworks
  63.    [SNMP-ARCH] describes that an SNMP engine is composed of:
  64.  
  65.         1) a Dispatcher
  66.         2) a Message Processing Subsystem,
  67.         3) a Security Subsystem, and
  68.         4) an Access Control Subsystem.
  69.  
  70.    Applications make use of the services of these subsystems.
  71.  
  72.    It is important to understand the SNMP architecture and its
  73.    terminology to understand where the Message Processing Subsystem and
  74.    Dispatcher described in this document fit into the architecture and
  75.    interact with other subsystems within the architecture.  The reader
  76.    is expected to have read and understood the description of the SNMP
  77.    architecture, defined in [SNMP-ARCH].
  78.  
  79.    The Dispatcher in the SNMP engine sends and receives SNMP messages.
  80.    It also dispatches SNMP PDUs to SNMP applications. When an SNMP
  81.    message needs to be prepared or when data needs to be extracted from
  82.    an SNMP message, the Dispatcher delegates these tasks to a message
  83.    version-specific Message Processing Model within the Message
  84.    Processing Subsystem.
  85.  
  86.    A Message Processing Model is responsibile for processing a SNMP
  87.    version-specific message and for coordinating the interaction with
  88.    the Security Subsystem to ensure proper security is applied to the
  89.    SNMP message being handled.
  90.  
  91.    Interactions between the Dispatcher, the Message Processing
  92.    Subsystem, and applications are modelled using abstract data elements
  93.    and abstract service interface primitives defined by the SNMP
  94.    architecture.
  95.  
  96.    Similarly, interactions between the Message Processing Subsystem and
  97.    the Security Subsystem are modelled using abstract data elements and
  98.    abstract service interface primitives as defined by the SNMP
  99.    architecture.
  100.  
  101.    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
  102.    "SHOULD", "SHOULD NOT", "RECOMMENDED",  "MAY", and "OPTIONAL" in this
  103.    document are to be interpreted as described in RFC 2119.
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111. SNMPv3 Working Group       Expires March 1998                   [Page 2]
  112.  
  113. Internet Draft     Message Processing and Dispatching     9 October 1997
  114.  
  115.  
  116.  
  117. 2.  Overview
  118.  
  119.    The following illustration depicts the Message Processing in relation
  120.    to  SNMP applications, the Security Subsystem and Transport Mappings.
  121.  
  122.    +-------------------------------------------------------------------+
  123.    | SNMP Entity                                                       |
  124.    |                                                                   |
  125.    | +---------------------------------------------------------------+ |
  126.    | | Applications                                                  | |
  127.    | | +-----------+  +--------------+                               | |
  128.    | | | Command   |  | Notification |                               | |
  129.    | | | Generator |  | Originator   | +-----------+ +--------------+| |
  130.    | | +-----------+  +--------------+ | Proxy     | | Other         | |
  131.    | | +-----------+  +--------------+ | Forwarder | |Application(s)|| |
  132.    | | | Command   |  | Notification | +-----------+ +--------------+| |
  133.    | | | Responder |  | Receiver     |                               | |
  134.    | | +-----------+  +--------------+                               | |
  135.    | +---------------------------------------------------------------+ |
  136.    |        ^                ^               ^           ^             |
  137.    |        |                |               |           |             |
  138.    |        v                v               v           v             |
  139.    |        +--------+-------+---------------+-----------+             |
  140.    |                 ^                                                 |
  141.    |                 |    +---------------------+  +-----------------+ |
  142.    |                 |    | Message Processing  |  | Security        | |
  143.    | Dispatcher      v    | Subsystem           |  | Subsystem       | |
  144.    | +------------------+ |     +------------+  |  |                 | |
  145.    | | PDU Dispatcher   | |  +->| v1MP     * |<--->| +-------------+ | |
  146.    | |                  | |  |  +------------+  |  | | Other       | | |
  147.    | |                  | |  |  +------------+  |  | | Security    | | |
  148.    | |                  | |  +->| v2cMP    * |<--->| | Model       | | |
  149.    | | Message          | |  |  +------------+  |  | +-------------+ | |
  150.    | | Dispatcher  <-------->+                  |  |                 | |
  151.    | |                  | |  |  +------------+  |  | +-------------+ | |
  152.    | |                  | |  +->| v3MP     * |<--->| | User-based  | | |
  153.    | | Transport        | |  |  +------------+  |  | | Security    | | |
  154.    | | Mapping          | |  |  +------------+  |  | | Model       | | |
  155.    | | (e.g RFC1906)    | |  +->| otherMP  * |<--->| +-------------+ | |
  156.    | +------------------+ |     +------------+  |  |                 | |
  157.    |          ^           +---------------------+  +-----------------+ |
  158.    |          |                                                        |
  159.    +----------|--------------------------------------------------------+
  160.               v
  161.      +------------------+
  162.      |   Network        |
  163.      +------------------+
  164.  
  165.  
  166.  
  167. SNMPv3 Working Group       Expires March 1998                   [Page 3]
  168.  
  169. Internet Draft     Message Processing and Dispatching     9 October 1997
  170.  
  171.  
  172.  
  173. 2.1.  The Dispatcher.
  174.  
  175.    The Dispatcher is a key piece of an SNMP engine. There is only one in
  176.    an SNMP engine, and its job is to dispatch tasks to the multiple ver-
  177.    sion-specific Message Processing Models, and to dispatch PDUs to var-
  178.    ious applications.
  179.  
  180.    For outgoing messages, an application provides a PDU to be sent, plus
  181.    the data needed to prepare and send the message, and the application
  182.    specifies which version-specific Message Processing Model will be
  183.    used to prepare the message with the desired security processing.
  184.    Once the message is prepared, the Dispatcher sends the message.
  185.  
  186.    For incoming messages, the Dispatcher determines the SNMP version of
  187.    the incoming message and passes the message to the version-specific
  188.    Message Processing Model to extract the components of the message and
  189.    to coordinate the processing of security services for the message.
  190.    After version-specific processing, the PDU Dispatcher determines
  191.    which application, if any, should receive the PDU for processing and
  192.    forwards it accordingly.
  193.  
  194.    The Dispatcher, while sending and receiving SNMP messages, collects
  195.    statistics about SNMP messages and the behavior of the SNMP engine in
  196.    managed objects to make them accessible to remote SNMP entities.
  197.    This document defines these managed objects, the MIB module which
  198.    contains them, and how these managed objects might be used to provide
  199.    useful management.
  200.  
  201. 2.2.  Message Processing Subsystem
  202.  
  203.    The SNMP Message Processing Subsystem is the part of an SNMP engine
  204.    which interacts with the Dispatcher to handle the version-specific
  205.    SNMP messages. It contains one or more Message Processing Models.
  206.  
  207.    This document describes one Message Processing Model, the SNMPv3
  208.    Message Processing Model, in Section 6. The SNMPv3 Message Processing
  209.    Model is defined in a separate section to show that multiple
  210.    (independent) Message Processing Models can exist at the same time
  211.    and that such Models can be described in different documents. The
  212.    SNMPv3 Message Processing Model can be replaced or supplemented with
  213.    other Message Processing Models in the future. Two Message Processing
  214.    Models which are expected to be developed in the future are the
  215.    SNMPv1 message format [RFC1157] and the SNMPv2c message format
  216.    [RFC1901].  Others may be developed as needed.
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223. SNMPv3 Working Group       Expires March 1998                   [Page 4]
  224.  
  225. Internet Draft     Message Processing and Dispatching     9 October 1997
  226.  
  227.  
  228.  
  229. 3.  Elements of Message Processing and Dispatching
  230.  
  231.    See [SNMP-ARCH] for the definitions of
  232.            contextEngineID
  233.            contextName
  234.            scopedPDU
  235.            maxSizeResponseScopedPDU
  236.            securityModel
  237.            securityName
  238.            securityLevel
  239.            messageProcessingModel
  240.  
  241.    For incoming messages, a version-specific message processing module
  242.    provides these values to the Dispatcher. For outgoing messages, an
  243.    application provides these values to the Dispatcher.
  244.  
  245.    For some version-specific processing, the values may be extracted
  246.    from received messages; for other versions, the values may be
  247.    determined by algorithm, or by an implementation-defined mechanism.
  248.    The mechanism by which the value is determined is irrelevant to the
  249.    Dispatcher.
  250.  
  251.    The following additional or expanded definitions are for use within
  252.    the Dispatcher.
  253.  
  254. 3.1.  messageProcessingModel
  255.  
  256.    The value of messageProcessingModel identifies a Message Processing
  257.    Model.  A Message Processing Model describes the version-specific
  258.    procedures for extracting data from messages, generating messages,
  259.    calling upon a securityModel to apply its security services to mes-
  260.    sages, for converting data from a version-specific message format in-
  261.    to a generic format usable by the Dispatcher, and for converting data
  262.    from Dispatcher format into a version-specific message format.
  263.  
  264. 3.2.  pduVersion
  265.  
  266.    The value of pduVersion represents a specific version of protocol
  267.    operation and its associated PDU formats, such as SNMPv1 or SNMPv2
  268.    [RFC1905].  The values of pduVersion are specific to the version of
  269.    the PDU contained in a message, and the PDUs processed by
  270.    applications. The Dispatcher does not use the value of pduVersion
  271.    directly.
  272.  
  273.    An application specifies the pduVersion when it requests the PDU
  274.    Dispatcher to send a PDU to another SNMP engine. The Dispatcher
  275.    passes the pduVersion to a Message Processing Model, so it knows how
  276.  
  277.  
  278.  
  279. SNMPv3 Working Group       Expires March 1998                   [Page 5]
  280.  
  281. Internet Draft     Message Processing and Dispatching     9 October 1997
  282.  
  283.  
  284.    to handle the PDU properly.
  285.  
  286.    For incoming messages, pduVersion is provided to the Dispatcher by a
  287.    version-specific Message Processing module. The PDU Dispatcher passes
  288.    the pduVersion to the application so it knows how to handle the PDU
  289.    properly.  For example, a command responder application needs to know
  290.    whether to use [RFC1905] elements of procedure and syntax instead of
  291.    those specified for SNMPv1.
  292.  
  293. 3.3.  pduType
  294.  
  295.    A value of pduType represents a specific type of protocol operation.
  296.    The values of pduType are specific to the version of the PDU
  297.    contained in a message.
  298.  
  299.    Applications register to support particular pduTypes for particular
  300.    contextEngineIDs.
  301.  
  302.    For incoming messages, pduType is provided to the Dispatcher by a
  303.    version-specific Message Processing module. It is subsequently used
  304.    to dispatch the PDU to the application which registered for the
  305.    pduType for the contextEngineID of the associated scopedPDU.
  306.  
  307. 3.4.  sendPduHandle
  308.  
  309.    This handle is generated for coordinating the processing of requests
  310.    and responses between the SNMP engine and an application. The handle
  311.    must be unique across all version-specific Message Processing Models,
  312.    and is of local significance only.
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335. SNMPv3 Working Group       Expires March 1998                   [Page 6]
  336.  
  337. Internet Draft     Message Processing and Dispatching     9 October 1997
  338.  
  339.  
  340. 4.  Dispatcher Elements of Procedure
  341.  
  342.    This section describes the procedures followed by the Dispatcher when
  343.    generating and processing SNMP messages.
  344.  
  345. 4.1.  Sending an SNMP Message to the Network
  346.  
  347.    This section describes the procedure followed by an SNMP engine
  348.    whenever it sends an SNMP message.
  349.  
  350. 4.1.1.  Sending a Request or Notification
  351.  
  352.    The following procedures are followed by the Dispatcher when an
  353.    application wants to send an SNMP PDU to another (remote)
  354.    application, i.e., to initiate a communication by originating a
  355.    message, such as one containing a request or a trap.
  356.  
  357.    1) The application requests this using the abstract service
  358.       primitive:
  359.  
  360.        statusInformation =              -- sendPduHandle if success
  361.                                         -- errorIndication if failure
  362.          sendPdu(
  363.          IN   transportDomain           -- transport domain to be used
  364.          IN   transportAddress          -- destination network address
  365.          IN   messageProcessingModel    -- typically, SNMP version
  366.          IN   securityModel             -- Security Model to use
  367.          IN   securityName              -- on behalf of this principal
  368.          IN   securityLevel             -- Level of Security requested
  369.          IN   contextEngineID           -- data from/at this entity
  370.          IN   contextName               -- data from/in this context
  371.          IN   pduVersion                -- the version of the PDU
  372.          IN   PDU                       -- SNMP Protocol Data Unit
  373.          IN   expectResponse            -- TRUE or FALSE
  374.               )
  375.  
  376.    2) If the messageProcessingModel value does not represent a Message
  377.       Processing Model known to the Dispatcher, then an errorIndication
  378.       (implementation-dependent) is returned to the calling application.
  379.       No further processing is performed.
  380.  
  381.    3) The Dispatcher generates a sendPduHandle to coordinate subsequent
  382.       processing.
  383.  
  384.    4) The Message Dispatcher sends the request to the version-specific
  385.       Message Processing module identified by messageProcessingModel
  386.       using the abstract service primitive:
  387.  
  388.  
  389.  
  390.  
  391. SNMPv3 Working Group       Expires March 1998                   [Page 7]
  392.  
  393. Internet Draft     Message Processing and Dispatching     9 October 1997
  394.  
  395.  
  396.       statusInformation =              - success or error indication
  397.         prepareOutgoingMessage(
  398.         IN   transportDomain           -- as specified by application
  399.         IN   transportAddress          -- as specified by application
  400.         IN   messageProcessingModel    -- as specified by application
  401.         IN   securityModel             -- as specified by application
  402.         IN   securityName              -- as specified by application
  403.         IN   securityLevel             -- as specified by application
  404.         IN   contextEngineID           -- as specified by application
  405.         IN   contextName               -- as specified by application
  406.         IN   pduVersion                -- the version of the PDU
  407.         IN   PDU                       -- as specified by application
  408.         IN   expectResponse            -- as specified by application
  409.         IN   sendPduHandle             -- as determined in step 3.
  410.         OUT  destTransportDomain       -- destination transport domain
  411.         OUT  destTransportAddress      -- destination transport address
  412.         OUT  outgoingMessage           -- the message to send
  413.         OUT  outgoingMessageLength     -- the message length
  414.              )
  415.  
  416.    5) If the statusInformation indicates an error, the errorIndication
  417.       is returned to the calling application.  No further processing is
  418.       performed.
  419.  
  420.    6) If the statusInformation indicates success, the sendPduHandle is
  421.       returned to the application, and the outgoingMessage is sent via
  422.       the transport specified by the transportDomain to the address
  423.       specified by the transportAddress.
  424.  
  425.    Outgoing Message Processing is complete.
  426.  
  427.  
  428. 4.1.2.  Sending a Response to the Network
  429.  
  430.    The following procedure is followed when an application wants to
  431.    return a response back to the originator of an SNMP Request.
  432.  
  433.    1) An application can request this using the abstract service
  434.       primitive:
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447. SNMPv3 Working Group       Expires March 1998                   [Page 8]
  448.  
  449. Internet Draft     Message Processing and Dispatching     9 October 1997
  450.  
  451.  
  452.       returnResponsePDU(
  453.        IN   messageProcessingModel   -- typically, SNMP version
  454.        IN   securityModel            -- Security Model in use
  455.        IN   securityName             -- on behalf of this principal
  456.        IN   securityLevel            -- same as on incoming request
  457.        IN   contextEngineID          -- data from/at this SNMP entity
  458.        IN   contextName              -- data from/in this context
  459.        IN   pduVersion               -- the version of the PDU
  460.        IN   PDU                      -- SNMP Protocol Data Unit
  461.        IN   maxSizeResponseScopedPDU -- maximum size of Response PDU
  462.        IN   stateReference           -- reference to state information
  463.                                      -- as presented with the request
  464.        IN   statusInformation        -- success or errorIndication
  465.        )                             -- (error counter OID and value
  466.                                      -- when errorIndication)
  467.  
  468.    2) The Message Dispatcher sends the request to the appropriate
  469.       Message Processing Model indicated by the received value of
  470.       messageProcessingModel using the abstract service primitive:
  471.  
  472.       result =                        -- SUCCESS or errorIndication
  473.        prepareResponseMessage(
  474.        IN   messageProcessingModel   -- specified by application
  475.        IN   securityModel            -- specified by application
  476.        IN   securityName             -- specified by application
  477.        IN   securityLevel            -- specified by application
  478.        IN   contextEngineID          -- specified by application
  479.        IN   contextName              -- specified by application
  480.        IN   pduVersion               -- specified by application
  481.        IN   PDU                      -- specified by application
  482.        IN   maxSizeResponseScopedPDU -- specified by application
  483.        IN   stateReference           -- specified by application
  484.        IN   statusInformation        -- specified by application
  485.        OUT  destTransportDomain      -- destination transport domain
  486.        OUT  destTransportAddress     -- destination transport address
  487.        OUT  outgoingMessage          -- the message to send
  488.        OUT  outgoingMessageLength    -- the message length
  489.             )
  490.  
  491.    3) If the result is an errorIndication, the errorIndication is
  492.       returned to the calling application.  No further processing is
  493.       performed.
  494.  
  495.    4) If the result is success, the outgoingMessage is sent over the
  496.       transport specified by the transportDomain to the address
  497.       specified by the transportAddress.
  498.  
  499.    Message Processing is complete.
  500.  
  501.  
  502.  
  503. SNMPv3 Working Group       Expires March 1998                   [Page 9]
  504.  
  505. Internet Draft     Message Processing and Dispatching     9 October 1997
  506.  
  507.  
  508. 4.2.  Receiving an SNMP Message from the Network
  509.  
  510.    This section describes the procedure followed by an SNMP engine
  511.    whenever it receives an SNMP message.
  512.  
  513.    Please note, that for the sake of clarity and to prevent the text
  514.    from being even longer and more complicated, some details were
  515.    omitted from the steps below.  In particular, The elements of
  516.    procedure do not always explicitly indicate when state information
  517.    needs to be released. The general rule is that if state information
  518.    is available when a message is to be "discarded without further
  519.    processing", then the state information must also be released at that
  520.    same time.
  521.  
  522. 4.2.1.  Message Dispatching of received SNMP Messages
  523.  
  524.    1) The snmpInPkts counter [RFC1907] is incremented.
  525.  
  526.    2) The version of the SNMP message is determined in an
  527.       implementation-dependent manner.  If the packet cannot be
  528.       sufficiently parsed to determine the version of the SNMP message,
  529.       then the snmpInASNParseErrs [RFC1907] counter is incremented, and
  530.       the message is discarded without further processing.  If the
  531.       version is not supported, then the snmpInBadVersions [RFC1907]
  532.       counter is incremented, and the message is discarded without
  533.       further processing.
  534.  
  535.    3) The origin transportDomain and origin transportAddress are
  536.       determined.
  537.  
  538.    4) The message is passed to the version-specific Message Processing
  539.       Model which returns the abstract data elements required by the
  540.       Dispatcher.  This is performed using the abstract service
  541.       primitive:
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559. SNMPv3 Working Group       Expires March 1998                  [Page 10]
  560.  
  561. Internet Draft     Message Processing and Dispatching     9 October 1997
  562.  
  563.  
  564.       result =                        -- SUCCESS or errorIndication
  565.         prepareDataElements(
  566.         IN   transportDomain          -- origin as determined in step 3.
  567.         IN   transportAddress         -- origin as determined in step 3.
  568.         IN   wholeMsg                 -- as received from the network
  569.         IN   wholeMsgLength           -- as received from the network
  570.         OUT  messageProcessingModel   -- typically, SNMP version
  571.         OUT  securityModel            -- Security Model to use
  572.         OUT  securityName             -- on behalf of this principal
  573.         OUT  securityLevel            -- Level of Security requested
  574.         OUT  contextEngineID          -- data from/at this entity
  575.         OUT  contextName              -- data from/in this context
  576.         OUT  pduVersion               -- the version of the PDU
  577.         OUT  PDU                      -- SNMP Protocol Data Unit
  578.         OUT  pduType                  -- SNMP PDU type
  579.         OUT  sendPduHandle            -- handle for a matched request
  580.         OUT  maxSizeResponseScopedPDU -- maximum size of Response PDU
  581.         OUT  statusInformation        -- success or errorIndication
  582.                                       -- (error counter OID and value
  583.                                       -- when errorIndication)
  584.         OUT  stateReference           -- reference to state information
  585.                                       -- to be used for a possible
  586.              )                        -- Response
  587.  
  588.    5) If the result is a FAILURE errorIndication, the message is
  589.       discarded without further processing.
  590.  
  591.    6) At this point, the abstract data elements have been prepared and
  592.       processing continues as described in Section 4.2.2, PDU
  593.       Dispatching for Incoming Messages.
  594.  
  595. 4.2.2.  PDU Dispatching for Incoming Messages
  596.  
  597.    The elements of procedure for the dispatching of PDUs depends on the
  598.    value of sendPduHandle.  If the value of sendPduHandle is <none>,
  599.    then this is a request or notification and the procedures specified
  600.    in Section 4.2.2.1 apply.  If the value of snmpPduHandle is not
  601.    <none>, then this is a response and the procedures specified in
  602.    Section 4.2.2.2 apply.
  603.  
  604. 4.2.2.1.  PDU Dispatching for Incoming Messages: Requests and
  605. Notifications
  606.  
  607.    The following procedures are followed for the dispatching of PDUs
  608.    when the value of sendPduHandle is <none>, indicating this is a
  609.    request or notification.
  610.  
  611.    1) The combination of contextEngineID and pduType is used to
  612.  
  613.  
  614.  
  615. SNMPv3 Working Group       Expires March 1998                  [Page 11]
  616.  
  617. Internet Draft     Message Processing and Dispatching     9 October 1997
  618.  
  619.  
  620.       determine which application has registered for this request or
  621.       notification.
  622.  
  623.    2) If no application has registered for the combination, then
  624.  
  625.       a) The snmpUnknownPDUHandlers counter is incremented.
  626.  
  627.       b) A Response message is generated using the abstract service
  628.          primitive:
  629.  
  630.          result =                         -- SUCCESS or FAILURE
  631.          prepareResponseMessage(
  632.          IN   messageProcessingModel    -- as provided by MP module
  633.          IN   securityModel             -- as provided by MP module
  634.          IN   securityName              -- as provided by MP module
  635.          IN   securityLevel             -- as provided by MP module
  636.          IN   contextEngineID           -- as provided by MP module
  637.          IN   contextName               -- as provided by MP module
  638.          IN   pduVersion                -- as provided by MP module
  639.          IN   PDU                       -- as provided by MP module
  640.          IN   maxSizeResponseScopedPDU  -- as provided by MP module
  641.          IN   stateReference            -- as provided by MP module
  642.          IN   statusInformation         -- errorIndication plus
  643.                                         -- snmpUnknownPDUHandlers OID
  644.                                         -- value pair.
  645.          OUT  transportDomain           -- destination transportDomain
  646.          OUT  transportAddress          -- destination transportAddress
  647.          OUT  outgoingMessage           -- the message to send
  648.          OUT  outgoingMessageLength     -- its length
  649.          )
  650.  
  651.       c) If the result is SUCCESS, then the prepared message is sent to
  652.          the originator of the request as identified by the
  653.          transportDomain and transportAddress.
  654.  
  655.       d) The incoming message is discarded without further processing.
  656.          Message Processing for this message is complete.
  657.  
  658.    3) The PDU is dispatched to the application, using the abstract
  659.       service primitive:
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.  
  669.  
  670.  
  671. SNMPv3 Working Group       Expires March 1998                  [Page 12]
  672.  
  673. Internet Draft     Message Processing and Dispatching     9 October 1997
  674.  
  675.  
  676.       processPdu(                     -- process Request/Notification
  677.         IN   messageProcessingModel   -- as provided by MP module
  678.         IN   securityModel            -- as provided by MP module
  679.         IN   securityName             -- as provided by MP module
  680.         IN   securityLevel            -- as provided by MP module
  681.         IN   contextEngineID          -- as provided by MP module
  682.         IN   contextName              -- as provided by MP module
  683.         IN   pduVersion               -- as provided by MP module
  684.         IN   PDU                      -- as provided by MP module
  685.         IN   maxSizeResponseScopedPDU -- as provided by MP module
  686.         IN   stateReference           -- as provided by MP module
  687.                                       -- needed when sending response
  688.              )
  689.  
  690.       Message processing for this message is complete.
  691.  
  692. 4.2.2.2.  PDU Dispatching for Incoming Messages:  Responses
  693.  
  694.    The following procedures are followed for the dispatching of PDUs
  695.    when the value of sendPduHandle is not <none>, indicating this is a
  696.    response.
  697.  
  698.       1) The value of sendPduHandle is used to determine, in an
  699.          implementation-defined manner, which application is waiting for
  700.          a response PDU associated with this sendPduHandle.
  701.  
  702.       2) If no waiting application is found, the message is discarded
  703.          without further processing, and the stateReference is released.
  704.          The snmpUnknownPDUHandlers counter is incremented.  Message
  705.          Processing is complete for this message.
  706.  
  707.       3) Any cached information, including stateReference, about the
  708.          message is discarded.
  709.  
  710.       4) The response is dispatched to the application using the
  711.          abstract service primitive:
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727. SNMPv3 Working Group       Expires March 1998                  [Page 13]
  728.  
  729. Internet Draft     Message Processing and Dispatching     9 October 1997
  730.  
  731.  
  732.          processResponsePdu(              -- process Response PDU
  733.            IN   messageProcessingModel    -- provided by the MP module
  734.            IN   securityModel             -- provided by the MP module
  735.            IN   securityName              -- provided by the MP module
  736.            IN   securityLevel             -- provided by the MP module
  737.            IN   contextEngineID           -- provided by the MP module
  738.            IN   contextName               -- provided by the MP module
  739.            IN   pduVersion                -- provided by the MP module
  740.            IN   PDU                       -- provided by the MP module
  741.            IN   statusInformation         -- provided by the MP module
  742.            IN   sendPduHandle             -- provided by the MP module
  743.                 )
  744.  
  745.          Message Processing is complete for this message.
  746.  
  747. 4.3.  Application Registration for Handling PDU types
  748.  
  749.    Applications that want to process certain PDUs must register with the
  750.    PDU Dispatcher. Applications specify the combination of
  751.    contextEngineID and pduType(s) for which they want to take
  752.    responsibility
  753.  
  754.    1) An application registers according to the abstract interface
  755.       primitive:
  756.  
  757.       statusInformation =           -- success or errorIndication
  758.         registerContextEngineID(
  759.         IN   contextEngineID        -- take responsibility for this one
  760.         IN   pduType                -- the pduType(s) to be registered
  761.              )
  762.  
  763.       Note: implementations may provide a means of requesting
  764.       registration for simultaneous multiple contextEngineID values,
  765.       e.g., all contextEngineID values, and may also provide means for
  766.       requesting simultaneous registration for multiple values of
  767.       pduType.
  768.  
  769.    2) The parameters may be checked for validity; if they are not, then
  770.       an errorIndication (invalidParameter) is returned to the
  771.       application.
  772.  
  773.    3) Each combination of contextEngineID and pduType can be registered
  774.       only once.  If another application has already registered for the
  775.       specified combination, then an errorIndication (alreadyRegistered)
  776.       is returned to the application.
  777.  
  778.    4) Otherwise, the registration is saved so that SNMP PDUs can be
  779.       dispatched to this application.
  780.  
  781.  
  782.  
  783. SNMPv3 Working Group       Expires March 1998                  [Page 14]
  784.  
  785. Internet Draft     Message Processing and Dispatching     9 October 1997
  786.  
  787.  
  788. 4.4.  Application Unregistration for Handling PDU Types
  789.  
  790.    Applications that no longer want to process certain PDUs must
  791.    unregister with the PDU Dispatcher.
  792.  
  793.    1) An application unregisters using the abstract service primitive:
  794.  
  795.       unregisterContextEngineID(
  796.        IN   contextEngineID        -- give up responsibility for this
  797.        IN   pduType                -- the pduType(s) to be unregistered
  798.              )
  799.       Note: implementations may provide means for requesting
  800.       unregistration for simultaneous multiple contextEngineID values,
  801.       e.g., all contextEngineID values, and may also provide means for
  802.       requesting simultaneous unregistration for multiple values of
  803.       pduType.
  804.  
  805.    2) If the contextEngineID and pduType combination has been
  806.       registered, then the registration is deleted.
  807.  
  808.       If no such registration exists, then the request is ignored.
  809.  
  810. 5.  Definitions
  811.  
  812. 5.1.  Definitions for SNMP Message Processing and Dispatching
  813.  
  814.    SNMP-MPD-MIB DEFINITIONS ::= BEGIN
  815.  
  816.    IMPORTS
  817.        MODULE-COMPLIANCE, OBJECT-GROUP         FROM SNMPv2-CONF
  818.        MODULE-IDENTITY, OBJECT-TYPE,
  819.        snmpModules, Counter32                  FROM SNMPv2-SMI;
  820.  
  821.    snmpMPDMIB MODULE-IDENTITY
  822.        LAST-UPDATED "9710090000Z"              -- 9 October 1997
  823.        ORGANIZATION "SNMPv3 Working Group"
  824.        CONTACT-INFO "WG-email:   snmpv3@tis.com
  825.                      Subscribe:  majordomo@tis.com
  826.                                  In message body:  subscribe snmpv3
  827.  
  828.                      Chair:      Russ Mundy
  829.                                  Trusted Information Systems
  830.                      postal:     3060 Washington Road
  831.                                  Glenwood, MD 21738
  832.                                  USA
  833.                      email:      mundy@tis.com
  834.                      phone:      +1 301-854-6889
  835.  
  836.  
  837.  
  838.  
  839. SNMPv3 Working Group       Expires March 1998                  [Page 15]
  840.  
  841. Internet Draft     Message Processing and Dispatching     9 October 1997
  842.  
  843.  
  844.                      Co-editor:  Jeffrey Case
  845.                                  SNMP Research, Inc.
  846.                      postal:     3001 Kimberlin Heights Road
  847.                                  Knoxville, TN 37920-9716
  848.                                  USA
  849.                      email:      case@snmp.com
  850.                      phone:      +1 423-573-1434
  851.  
  852.                      Co-editor   Dave Harrington
  853.                                  Cabletron Systems, Inc.
  854.                      postal:     Post Office Box 5005
  855.                                  MailStop: Durham
  856.                                  35 Industrial Way
  857.                                  Rochester, NH 03867-5005
  858.                                  USA
  859.                      email:      dbh@cabletron.com
  860.                      phone:      +1 603-337-7357
  861.  
  862.                      Co-editor:  Randy Presuhn
  863.                                  BMC Software, Inc.
  864.                      postal:     1190 Saratoga Ave, Suite 190
  865.                                  San Jose, CA 95120
  866.                                  USA
  867.                      email:      rpresuhn@bmc.com
  868.                      phone:      +1 408-556-0720
  869.  
  870.                      Co-editor:  Bert Wijnen
  871.                                  IBM T. J. Watson Research
  872.                      postal:     Schagen 33
  873.                                  3461 GL Linschoten
  874.                                  Netherlands
  875.                      email:      wijnen@vnet.ibm.com
  876.                      phone:      +31 348-432-794
  877.  
  878.                     "
  879.        DESCRIPTION  "The MIB for Message Processing and Dispatching"
  880.        ::= { snmpModules 8 }  -- check if assignment is OK
  881.  
  882.    -- Administrative assignments ***************************************
  883.  
  884.    snmpMPDAdmin           OBJECT IDENTIFIER ::= { snmpMPDMIB 1 }
  885.    snmpMPDMIBObjects      OBJECT IDENTIFIER ::= { snmpMPDMIB 2 }
  886.    snmpMPDMIBConformance  OBJECT IDENTIFIER ::= { snmpMPDMIB 3 }
  887.  
  888.    -- Statistics for SNMP Messages *************************************
  889.  
  890.    snmpMPDStats           OBJECT IDENTIFIER ::= { snmpMPDMIBObjects 1 }
  891.  
  892.  
  893.  
  894.  
  895. SNMPv3 Working Group       Expires March 1998                  [Page 16]
  896.  
  897. Internet Draft     Message Processing and Dispatching     9 October 1997
  898.  
  899.  
  900.    snmpUnknownSecurityModels OBJECT-TYPE
  901.        SYNTAX       Counter32
  902.        MAX-ACCESS   read-only
  903.        STATUS       current
  904.        DESCRIPTION "The total number of packets received by the SNMP
  905.                     engine which were dropped because they referenced a
  906.                     securityModel that was not known to or supported by
  907.                     the SNMP engine.
  908.                    "
  909.        ::= { snmpMPDStats 1 }
  910.  
  911.    snmpInvalidMsgs OBJECT-TYPE
  912.        SYNTAX       Counter32
  913.        MAX-ACCESS   read-only
  914.        STATUS       current
  915.        DESCRIPTION "The total number of packets received by the SNMP
  916.                     engine which were dropped because there were invalid
  917.                     or inconsistent components in the SNMP message.
  918.                    "
  919.        ::= { snmpMPDStats 2 }
  920.  
  921.    snmpUnknownPDUHandlers OBJECT-TYPE
  922.        SYNTAX       Counter32
  923.        MAX-ACCESS   read-only
  924.        STATUS       current
  925.        DESCRIPTION "The total number of packets received by the SNMP
  926.                     engine which were dropped because the PDU contained
  927.                     in the packet could not be passed to an application
  928.                     responsible for handling the pduType, e.g. no SNMP
  929.                     application had registered for the proper
  930.                     combination of the contextEngineID and the pduType.
  931.                    "
  932.        ::= { snmpMPDStats 3 }
  933.  
  934.    -- Conformance information ******************************************
  935.  
  936.    snmpMPDMIBCompliances OBJECT IDENTIFIER ::= {snmpMPDMIBConformance 1}
  937.    snmpMPDMIBGroups      OBJECT IDENTIFIER ::= {snmpMPDMIBConformance 2}
  938.  
  939.    -- Compliance statements
  940.  
  941.    snmpMPDCompliance MODULE-COMPLIANCE
  942.        STATUS       current
  943.        DESCRIPTION "The compliance statement for SNMP entities which
  944.                     implement the SNMP-MPD-MIB.
  945.                    "
  946.  
  947.        MODULE    -- this module
  948.  
  949.  
  950.  
  951. SNMPv3 Working Group       Expires March 1998                  [Page 17]
  952.  
  953. Internet Draft     Message Processing and Dispatching     9 October 1997
  954.  
  955.  
  956.            MANDATORY-GROUPS { snmpMPDGroup }
  957.  
  958.        ::= { snmpMPDMIBCompliances 1 }
  959.  
  960.    snmpMPDGroup OBJECT-GROUP
  961.        OBJECTS {
  962.                  snmpUnknownSecurityModels,
  963.                  snmpInvalidMsgs,
  964.                  snmpUnknownPDUHandlers
  965.                }
  966.        STATUS       current
  967.        DESCRIPTION "A collection of objects providing for remote
  968.                     monitoring of the SNMP Message Processing and
  969.                     Dispatching process.
  970.                    "
  971.        ::= { snmpMPDMIBGroups 1 }
  972.  
  973.    END
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.  
  998.  
  999.  
  1000.  
  1001.  
  1002.  
  1003.  
  1004.  
  1005.  
  1006.  
  1007. SNMPv3 Working Group       Expires March 1998                  [Page 18]
  1008.  
  1009. Internet Draft     Message Processing and Dispatching     9 October 1997
  1010.  
  1011.  
  1012. 6.  The SNMPv3 Message Format
  1013.  
  1014.    This section defines the SNMPv3 message format and the corresponding
  1015.    SNMP version 3 Message Processing Model (v3MP).
  1016.  
  1017.    SNMPv3MessageSyntax DEFINITIONS IMPLICIT TAGS ::= BEGIN
  1018.  
  1019.        SNMPv3Message ::= SEQUENCE {
  1020.            -- identify the layout of the SNMPv3Message
  1021.            -- this element is in same position as in SNMPv1
  1022.            -- and SNMPv2c, allowing recognition
  1023.            msgVersion INTEGER { snmpv3 (3) },
  1024.            -- administrative parameters
  1025.            msgGlobalData HeaderData,
  1026.  
  1027.            -- security model-specific parameters
  1028.            -- format defined by Security Model
  1029.            msgSecurityParameters OCTET STRING,
  1030.  
  1031.            msgData  ScopedPduData
  1032.        }
  1033.  
  1034.        HeaderData ::= SEQUENCE {
  1035.            msgID      INTEGER (0..2147483647),
  1036.            msgMaxSize INTEGER (484..2147483647),
  1037.  
  1038.            msgFlags   OCTET STRING (SIZE(1)),
  1039.                       --  .... ...1   authFlag
  1040.                       --  .... ..1.   privFlag
  1041.                       --  .... .1..   reportableFlag
  1042.                       --
  1043.                       --              Please observe:
  1044.                       --  .... ..00   is OK, means noAuthNoPriv
  1045.                       --  .... ..01   is OK, means authNoPriv
  1046.                       --  .... ..10   reserved, must NOT be used.
  1047.                       --  .... ..11   is OK, means authPriv
  1048.  
  1049.            msgSecurityModel INTEGER (0..2147483647)
  1050.        }
  1051.  
  1052.        ScopedPduData ::= CHOICE {
  1053.            plaintext    ScopedPDU,
  1054.            encryptedPDU OCTET STRING  -- encrypted scopedPDU value
  1055.        }
  1056.  
  1057.        ScopedPDU ::= SEQUENCE {
  1058.            contextEngineID  OCTET STRING,
  1059.            contextName      OCTET STRING,
  1060.  
  1061.  
  1062.  
  1063. SNMPv3 Working Group       Expires March 1998                  [Page 19]
  1064.  
  1065. Internet Draft     Message Processing and Dispatching     9 October 1997
  1066.  
  1067.  
  1068.            data             ANY -- e.g., PDUs as defined in RFC1905
  1069.        }
  1070.    END
  1071.  
  1072. 6.1.  msgVersion
  1073.  
  1074.    The msgVersion field is set to snmpv3(3) and identifies the message
  1075.    as an SNMP version 3 Message.
  1076.  
  1077. 6.2.  msgID
  1078.  
  1079.    The msgID is used between two SNMP entities to coordinate request
  1080.    messages and responses, and by the v3MP to coordinate the processing
  1081.    of the message by different subsystem models within the architecture.
  1082.  
  1083.    Values for msgID should be generated in a manner that avoids re-use
  1084.    of any outstanding values.  Doing so provides protection against some
  1085.    replay attacks.  One possible implementation strategy would be to use
  1086.    the low-order bits of snmpEngineBoots [SNMP-ARCH] as the high-order
  1087.    portion of the msgID value and a monotonically increasing integer for
  1088.    the low-order portion of msgID.
  1089.  
  1090.    Note that the request-id in a PDU is used by SNMP applications to
  1091.    identify the PDU; the msgID is used by the engine to identify the
  1092.    message which carries a PDU. The engine may need to identify the
  1093.    message even if decrypting of the PDU (and request-id) fails. No
  1094.    assumption should be made that the value of the msgID and the value
  1095.    of the request-id are equivalent.
  1096.  
  1097. 6.3.  msgMaxSize
  1098.  
  1099.    The msgMaxSize field of the message conveys the maximum message size
  1100.    supported by the sender of the message, i.e., the maximum message
  1101.    size that the sender can accept when another SNMP engine sends an
  1102.    SNMP message (be it a response or any other message) to the sender of
  1103.    this message.
  1104.  
  1105.    When an SNMP message is being generated, the msgMaxSize is provided
  1106.    by the SNMP engine which generates the message.  At the receiving
  1107.    SNMP engine, the msgMaxSize is used to determine how big the Response
  1108.    to a Request message can be.
  1109.  
  1110. 6.4.  msgFlags
  1111.  
  1112.    The msgFlags field of the message contains several bit fields which
  1113.    control processing of the message.
  1114.  
  1115.    When the reportableFlag is one, a Report PDU must be returned to the
  1116.  
  1117.  
  1118.  
  1119. SNMPv3 Working Group       Expires March 1998                  [Page 20]
  1120.  
  1121. Internet Draft     Message Processing and Dispatching     9 October 1997
  1122.  
  1123.  
  1124.    sender under those conditions which can cause the generation of
  1125.    Report PDUs.  When the reportableFlag is zero, then a Report PDU must
  1126.    not be sent.  The reportableFlag must always be zero when the message
  1127.    contains a Report PDU, a response-type PDU (such as a Response PDU),
  1128.    or an unacknowledged notification-type PDU (such as an SNMPv2-trap
  1129.    PDU).  The reportableFlag must always be one for a request-type PDU
  1130.    (such as a Get PDU) and an acknowledged notification-type PDU (such
  1131.    as an Inform PDU).
  1132.  
  1133.    If the reportableFlag is set to one for a message containing a Report
  1134.    PDU, a response-type PDU (such as a Response PDU), or an
  1135.    unacknowledged notification-type PDU (such as an SNMPv2-trap PDU),
  1136.    then the receiver of that message must process it as though the
  1137.    reportableFlag had been set to zero.
  1138.  
  1139.    If the reportableFlag is set to zero for a message containing a
  1140.    request-type PDU (such as a Get PDU) or an acknowledged notification-
  1141.    type PDU (such as an Inform PDU), then the receiver of that message
  1142.    must process it as though the reportableFlag had been set to one.
  1143.  
  1144.    Report PDUs are engine-to-engine communications and are processed
  1145.    directly by the SNMPv3 Message Processing Model, and are generally
  1146.    not passed to applications for processing, unlike all other PDU
  1147.    types.
  1148.  
  1149.    Note that the reportableFlag is a secondary aid in determining
  1150.    whether a Report PDU must be sent.  It is only used in cases where
  1151.    the PDU portion of a message cannot be decoded, due to, for example,
  1152.    an incorrect ecryption key.  If the PDU can be decoded, the PDU type
  1153.    forms the basis for decisions on sending Report PDUs.
  1154.  
  1155.    The authFlag and privFlag portions of the msgFlags field are set by
  1156.    the sender to indicate the securityLevel that was applied to the
  1157.    message before it was sent on the wire.  The receiver of the message
  1158.    must apply the same securityLevel when the message is received and
  1159.    the contents are being processed.
  1160.  
  1161.    There are three securityLevels, namely noAuthNoPriv, which is less
  1162.    than authNoPriv, which is in turn less than authPriv.  See the SNMP
  1163.    architecture document [SNMP-ARCH] for details about the
  1164.    securityLevel.
  1165.  
  1166.    a) authFlag
  1167.  
  1168.       If the authFlag is set to one, then the securityModel used by the
  1169.       SNMP engine which sent the message must identify the securityName
  1170.       on whose behalf the SNMP message was generated and must provide,
  1171.       in a securityModel-specific manner, sufficient data for the
  1172.  
  1173.  
  1174.  
  1175. SNMPv3 Working Group       Expires March 1998                  [Page 21]
  1176.  
  1177. Internet Draft     Message Processing and Dispatching     9 October 1997
  1178.  
  1179.  
  1180.       receiver of the message to be able to authenticate that
  1181.       identification.  In general, this authentication will allow the
  1182.       receiver to determine with reasonable certainty that the message
  1183.       was:
  1184.  
  1185.       -  sent on behalf of the principal associated with the
  1186.          securityName,
  1187.  
  1188.       -  was not redirected,
  1189.  
  1190.       -  was not modified in transit, and
  1191.  
  1192.       -  was not replayed.
  1193.  
  1194.       If the authFlag is zero, then the securityModel used by the SNMP
  1195.       engine which sent the message must identify the securityName on
  1196.       whose behalf the SNMP message was generated but it does not need
  1197.       to provide sufficient data for the receiver of the message to
  1198.       authenticate the identification, as there is no need to
  1199.       authenticate the message in this case.
  1200.  
  1201.    b) privFlag
  1202.  
  1203.       If the privFlag is set, then the securityModel used by the SNMP
  1204.       engine which sent the message must also protect the scopedPDU in
  1205.       an SNMP message from disclosure, i.e., must encrypt/decrypt the
  1206.       scopedPDU. If the privFlag is zero, then the securityModel in use
  1207.       does not need to protect the data from disclosure.
  1208.  
  1209.       It is an explicit requirement of the SNMP architecture that if
  1210.       privacy is selected, then authentication is also required.  That
  1211.       means that if the privFlag is set, then the authFlag must also be
  1212.       set to one.
  1213.  
  1214.       The combination of the authFlag and the privFlag comprises a Level
  1215.       of Security as follows:
  1216.          authFlag zero, privFlag zero -> securityLevel is noAuthNoPriv
  1217.          authFlag zero, privFlag one  -> invalid combination
  1218.          authFlag one,  privFlag zero -> securityLevel is authNoPriv
  1219.          authFlag one,  privFlag one  -> securityLevel is authPriv
  1220.  
  1221. 6.5.  msgSecurityModel
  1222.  
  1223.    The v3MP supports the concurrent existence of multiple Security
  1224.    Models to provide security services for SNMPv3 messages.  The
  1225.    msgSecurityModel field in an SNMPv3 Message identifies which Security
  1226.    Model was used by the sender to generate the message and therefore
  1227.    which securityModel must be used by the receiver to perform security
  1228.  
  1229.  
  1230.  
  1231. SNMPv3 Working Group       Expires March 1998                  [Page 22]
  1232.  
  1233. Internet Draft     Message Processing and Dispatching     9 October 1997
  1234.  
  1235.  
  1236.    processing for the message.  The mapping to the appropriate
  1237.    securityModel implementation within an SNMP engine is accomplished in
  1238.    an implementation-dependent manner.
  1239.  
  1240. 6.6.  msgSecurityParameters
  1241.  
  1242.    The msgSecurityParameters field of the SNMPv3 Message is used for
  1243.    communication between the Security Model modules in the sending and
  1244.    receiving SNMP engines. The data in the msgSecurityParameters field
  1245.    is used exclusively by the Security Model, and the contents and
  1246.    format of the data is defined by the Security Model.  This OCTET
  1247.    STRING is not interpreted by the v3MP, but is passed to the local
  1248.    implementation of the Security Model indicated by the
  1249.    msgSecurityModel field in the message.
  1250.  
  1251. 6.7.  scopedPduData
  1252.  
  1253.    The scopedPduData field represents either the plain text scopedPDU if
  1254.    the privFlag in the msgFlags is zero, or it represents an
  1255.    encryptedPDU (encoded as an OCTET STRING) which must be decrypted by
  1256.    the securityModel in use to produce a plaintext scopedPDU.
  1257.  
  1258. 6.8.  scopedPDU
  1259.  
  1260.    The scopedPDU contains information to identify an administratively
  1261.    unique context and a PDU. The object identifiers in the PDU refer to
  1262.    managed objects which are (expected to be) accessible within the
  1263.    specified context.
  1264.  
  1265. 6.8.1.  contextEngineID
  1266.  
  1267.    The contextEngineID in the SNMPv3 message, uniquely identifies,
  1268.    within an administrative domain, an SNMP entity that may realize an
  1269.    instance of a context with a particular contextName.
  1270.  
  1271.    For incoming messages, the contextEngineID is used to determine to
  1272.    which application the scopedPDU will be sent for processing.
  1273.  
  1274.    For outgoing messages, the v3MP sets the contextEngineID to the value
  1275.    provided by the application in the request for a message to be sent.
  1276.  
  1277. 6.8.2.  contextName
  1278.  
  1279.    The contextName field in an SNMPv3 message, in conjunction with the
  1280.    contextEngineID field, identifies the particular context associated
  1281.    with the management information contained in the PDU portion of the
  1282.    message.  The contextName is unique within the SNMP entity specified
  1283.    by the contextEngineID, which may realize the managed objects
  1284.  
  1285.  
  1286.  
  1287. SNMPv3 Working Group       Expires March 1998                  [Page 23]
  1288.  
  1289. Internet Draft     Message Processing and Dispatching     9 October 1997
  1290.  
  1291.  
  1292.    referenced within the PDU.  An application which originates a message
  1293.    provides the value for the contextName field and this value may be
  1294.    used during processing by an application at the receiving SNMP
  1295.    Engine.
  1296.  
  1297. 6.8.3.  data
  1298.  
  1299.    The data field of the SNMPv3 Message contains the PDU.  Among other
  1300.    things, the PDU contains the PDU type that is used by the v3MP to
  1301.    determine the type of the incoming SNMP message.  The v3MP specifies
  1302.    that the PDU must be one of those specified in [RFC1905].
  1303.  
  1304. 7.  Elements of Procedure for v3MP
  1305.  
  1306.    This section describes the procedures followed by an SNMP engine when
  1307.    generating and processing SNMP messages according to the SNMPv3
  1308.    Message Processing Model.
  1309.  
  1310.    Please note, that for the sake of clarity and to prevent the text
  1311.    from being even longer and more complicated, some details were
  1312.    omitted from the steps below.
  1313.  
  1314.       a) Some steps specify that when some error conditions are
  1315.          encountered when processing a received message, a message
  1316.          containing a Report PDU is generated and the received message
  1317.          is discarded without further processing.  However, a Report-PDU
  1318.          must not be generated unless the reportableFlag is set in the
  1319.          received message.
  1320.  
  1321.       b) The elements of procedure do not always explicitly indicate
  1322.          when state information needs to be released. The general rule
  1323.          is that if state information is available when a message is to
  1324.          be "discarded without further processing", then the state
  1325.          information must also be released at that same time.
  1326.  
  1327. 7.1.  Prepare an Outgoing SNMP Message
  1328.  
  1329.    This section describes the procedure followed to prepare an SNMPv3
  1330.    message from the data elements passed by the Message Dispatcher.
  1331.  
  1332.    1) The Message Dispatcher may request that an SNMPv3 message
  1333.       containing a GetRequest-PDU, GetNextRequest-PDU, GetBulkRequest-
  1334.       PDU, SetRequest-PDU, InformRequest-PDU, or SNMPv2-Trap-PDU be
  1335.       prepared for sending.
  1336.  
  1337.  
  1338.  
  1339.  
  1340.  
  1341.  
  1342.  
  1343. SNMPv3 Working Group       Expires March 1998                  [Page 24]
  1344.  
  1345. Internet Draft     Message Processing and Dispatching     9 October 1997
  1346.  
  1347.  
  1348.  
  1349.       a) It makes such a request according to the abstract service
  1350.          primitive:
  1351.  
  1352.          statusInformation =           -- success or errorIndication
  1353.            prepareOutgoingMessage(
  1354.            IN   transportDomain        -- requested transport domain
  1355.            IN   transportAddress       -- requested destination address
  1356.            IN   messageProcessingModel -- typically, SNMP version
  1357.            IN   securityModel          -- Security Model to use
  1358.            IN   securityName           -- on behalf of this principal
  1359.            IN   securityLevel          -- Level of Security requested
  1360.            IN   contextEngineID        -- data from/at this entity
  1361.            IN   contextName            -- data from/in this context
  1362.            IN   pduVersion             -- version of the PDU
  1363.            IN   PDU                    -- SNMP Protocol Data Unit
  1364.            IN   expectResponse         -- TRUE or FALSE
  1365.            IN   sendPduHandle          -- the handle for matching
  1366.                                        -- incoming responses
  1367.            OUT  destTransportDomain    -- destination transport domain
  1368.            OUT  destTransportAddress   -- destination transport address
  1369.            OUT  outgoingMessage        -- the message to send
  1370.            OUT  outgoingMessageLength  -- the length of the message
  1371.            )
  1372.  
  1373.  
  1374.       b) A unique msgID is generated.  The number used for msgID should
  1375.          not have been used recently, and must not be the same as was
  1376.          used for any outstanding request.
  1377.  
  1378.          * SNMPv3 does not use the values of expectResponse or
  1379.          pduVersion.
  1380.  
  1381.    2) The Message Dispatcher may request that an SNMPv3 message
  1382.       containing a Response-PDU or Report-PDU be prepared for sending.
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.  
  1395.  
  1396.  
  1397.  
  1398.  
  1399. SNMPv3 Working Group       Expires March 1998                  [Page 25]
  1400.  
  1401. Internet Draft     Message Processing and Dispatching     9 October 1997
  1402.  
  1403.  
  1404.  
  1405.       a) It makes such a request according to the abstract service
  1406.          primitive:
  1407.  
  1408.          result =                        -- SUCCESS or FAILURE
  1409.          prepareResponseMessage(
  1410.           IN   messageProcessingModel   -- typically, SNMP version
  1411.           IN   securityModel            -- same as on incoming request
  1412.           IN   securityName             -- same as on incoming request
  1413.           IN   securityLevel            -- same as on incoming request
  1414.           IN   contextEngineID          -- data from/at this SNMP entity
  1415.           IN   contextName              -- data from/in this context
  1416.           IN   pduVersion               -- version of the PDU
  1417.           IN   PDU                      -- SNMP Protocol Data Unit
  1418.           IN   maxSizeResponseScopedPDU -- maximum size of Response PDU
  1419.           IN   stateReference           -- reference to state
  1420.                                         -- information presented with
  1421.                                         -- the request
  1422.           IN   statusInformation        -- success or errorIndication
  1423.                                         -- error counter OID and value
  1424.                                         -- when errorIndication
  1425.           OUT  transportDomain          -- destination transport domain
  1426.           OUT  transportAddress         -- destination transport address
  1427.           OUT  outgoingMessage          -- the message to send
  1428.           OUT  outgoingMessageLength    -- the length of the message
  1429.           )
  1430.  
  1431.       b) The cached information for the original request is retrieved
  1432.          via the stateReference, including
  1433.  
  1434.                   - msgID,
  1435.                   - contextEngineID,
  1436.                   - contextName,
  1437.                   - securityModel,
  1438.                   - securityName,
  1439.                   - securityLevel,
  1440.                   - securityStateReference,
  1441.                   - reportableFlag,
  1442.                   - transportDomain, and
  1443.                   - transportAddress.
  1444.  
  1445.          The SNMPv3 Message Processing Model does not allow cached data
  1446.          to be overridden, except by error indications as detailed in
  1447.          (3) below.
  1448.  
  1449.    3) If statusInformation contains values for an OID/value combination
  1450.       (potentially also containing a securityLevel value,
  1451.       contextEngineID value, or contextName value), then
  1452.  
  1453.  
  1454.  
  1455. SNMPv3 Working Group       Expires March 1998                  [Page 26]
  1456.  
  1457. Internet Draft     Message Processing and Dispatching     9 October 1997
  1458.  
  1459.  
  1460.       a) If reportableFlag is zero, then the original message is
  1461.          discarded, and no further processing is done. A result of
  1462.          FAILURE is returned. SNMPv3 Message Processing is complete.
  1463.  
  1464.       b) If a PDU is provided, it is the PDU from the original request.
  1465.          If possible, extract the request-id.
  1466.  
  1467.       c) A Report PDU is prepared:
  1468.  
  1469.          1) the varBindList is set to contain the OID and value from the
  1470.             statusInformation
  1471.  
  1472.          2) error-status is set to 0
  1473.  
  1474.          3) error-index is set to 0.
  1475.  
  1476.          4) request-id is set to the value extracted in step b)
  1477.             Otherwise, request-id is set to 0
  1478.  
  1479.       d) The errorIndication in statusInformation may be accompanied by
  1480.          a securityLevel value, a contextEngineID value, or a
  1481.          contextName value.
  1482.  
  1483.          1) If statusInformation contains a value for securityLevel,
  1484.             then securityLevel is set to that value, otherwise it is set
  1485.             to noAuthNoPriv.
  1486.  
  1487.          2) If statusInformation contains a value for contextEngineID,
  1488.             then contextEngineID is set to that value, otherwise it is
  1489.             set to the value of this entity's snmpEngineID.
  1490.  
  1491.          3) If statusInformation contains a value for contextName, then
  1492.             contextName is set to that value, otherwise it is set to the
  1493.             default context of "" (zero-length string).
  1494.  
  1495.       e) PDU is set to refer to the new Report-PDU.  The old PDU is
  1496.          discarded.
  1497.  
  1498.       f) Processing continues with step 6) below.
  1499.  
  1500.    4) If contextEngineID is not yet determined, then the contextEngineID
  1501.       is determined, in an implementation-dependent manner, possibly
  1502.       using the transportDomain and transportAddress.
  1503.  
  1504.    5) If the contextName is not yet determined, the contextName is set
  1505.       to the default context.
  1506.  
  1507.    6) A scopedPDU is prepared from the contextEngineID, contextName, and
  1508.  
  1509.  
  1510.  
  1511. SNMPv3 Working Group       Expires March 1998                  [Page 27]
  1512.  
  1513. Internet Draft     Message Processing and Dispatching     9 October 1997
  1514.  
  1515.  
  1516.       PDU.
  1517.  
  1518.    7) msgGlobalData is constructed as follows
  1519.  
  1520.       a) The msgVersion field is set to snmpv3(3).
  1521.  
  1522.       b) msgID is set as determined in step 1 or 2 above.
  1523.  
  1524.       c) msgMaxSize is set to an implementation-dependent value.
  1525.  
  1526.       d) msgFlags are set as follows:
  1527.  
  1528.          -  If securityLevel specifies noAuthNoPriv, then authFlag and
  1529.             privFlag are both set to zero.
  1530.  
  1531.          -  If securityLevel specifies authNoPriv, then authFlag is set
  1532.             to one and privFlag is set to zero.
  1533.  
  1534.          -  If securityLevel specifies authPriv, then authFlag is set to
  1535.             one and privFlag is set to one.
  1536.  
  1537.          -  If the PDU is a Response-PDU, Report-PDU or SNMPv2-Trap-PDU,
  1538.             then the reportableFlag is set to zero.
  1539.  
  1540.          -  If the PDU is a GetRequest-PDU, GetNextRequest-PDU,
  1541.             GetBulkRequest-PDU, SetRequest-PDU, or InformRequest-PDU
  1542.             then the reportableFlag is set to one.
  1543.  
  1544.          -  All other msgFlags bits are set to zero.
  1545.  
  1546.       e) msgSecurityModel is set to the value of securityModel
  1547.  
  1548.    8) If the PDU is a Response-PDU or Report-PDU, then
  1549.  
  1550.  
  1551.  
  1552.  
  1553.  
  1554.  
  1555.  
  1556.  
  1557.  
  1558.  
  1559.  
  1560.  
  1561.  
  1562.  
  1563.  
  1564.  
  1565.  
  1566.  
  1567. SNMPv3 Working Group       Expires March 1998                  [Page 28]
  1568.  
  1569. Internet Draft     Message Processing and Dispatching     9 October 1997
  1570.  
  1571.  
  1572.  
  1573.       a) The specified Security Model is called to generate the message
  1574.          according to the primitive:
  1575.  
  1576.          statusInformation =
  1577.            generateResponseMsg(
  1578.            IN   messageProcessingModel -- SNMPv3 Message Processing
  1579.                                        -- Model
  1580.            IN   globalData             -- msgGlobalData from step 7
  1581.            IN   maxMessageSize         -- from msgMaxSize (step 7c)
  1582.            IN   securityModel          -- as determined in step 7e
  1583.            IN   securityEngineID       -- the value of snmpEngineID
  1584.            IN   securityName           -- on behalf of this principal
  1585.            IN   securityLevel          -- for the outgoing message
  1586.            IN   scopedPDU              -- as prepared in step 6)
  1587.            IN   securityStateReference -- as determined in step 2
  1588.            OUT  securityParameters     -- filled in by Security Module
  1589.            OUT  wholeMsg               -- complete generated message
  1590.            OUT  wholeMsgLength         -- length of generated message
  1591.            )
  1592.  
  1593.          If, upon return from the Security Model, the statusInformation
  1594.          includes an errorIndication, then any cached information about
  1595.          the outstanding request message is discarded, and an
  1596.          errorIndication is returned, so it can be returned to the
  1597.          calling application. SNMPv3 Message Processing is complete.
  1598.  
  1599.       b) A SUCCESS result is returned. SNMPv3 Message Processing is
  1600.          complete.
  1601.  
  1602.    9) If the PDU is a GetRequest-PDU, GetNextRequest-PDU,
  1603.       GetBulkRequest-PDU, SetRequest-PDU, InformRequest-PDU, or or
  1604.       SNMPv2-Trap-PDU, then
  1605.  
  1606.       a) If the PDU is an SNMPv2-Trap-PDU, then securityEngineID is set
  1607.          to the value of this entity's snmpEngineID.
  1608.  
  1609.          Otherwise, the snmpEngineID of the target entity is determined,
  1610.          in an implementation-dependent manner, possibly using
  1611.          transportDomain and transportAddress.  The value of
  1612.          securityEngineID is set to the value of the target entity's
  1613.          snmpEngineID.
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.  
  1620.  
  1621.  
  1622.  
  1623. SNMPv3 Working Group       Expires March 1998                  [Page 29]
  1624.  
  1625. Internet Draft     Message Processing and Dispatching     9 October 1997
  1626.  
  1627.  
  1628.  
  1629.       b) The specified Security Model is called to generate the message
  1630.          according to the primitive:
  1631.  
  1632.          statusInformation =
  1633.           generateRequestMsg(
  1634.           IN  messageProcessingModel -- SNMPv3 Message Processing Model
  1635.           IN  globalData             -- msgGlobalData, from step 7
  1636.           IN  maxMessageSize         -- from msgMaxSize in step 7 c)
  1637.           IN  securityModel          -- as provided by caller
  1638.           IN  securityEngineID       -- authoritative SNMP entity
  1639.           IN  securityName           -- as provided by caller
  1640.           IN  securityLevel          -- as provided by caller
  1641.           IN  snmpEngineID           -- as determined in step 9 a)
  1642.           IN  scopedPDU              -- as prepared in step 6
  1643.           OUT securityParameters     -- filled in by Security Module
  1644.           OUT wholeMsg               -- complete generated message
  1645.           OUT wholeMsgLength         -- length of the generated message
  1646.           )
  1647.  
  1648.          If, upon return from the Security Model, the statusInformation
  1649.          includes an errorIndication, then the message is discarded, and
  1650.          the errorIndication is returned, so it can be returned to the
  1651.          calling application, and no further processing is done.
  1652.          SNMPv3 Message Processing is complete.
  1653.  
  1654.       c) Information about the outgoing message is cached, and a
  1655.          stateReference is created (implementation-specific).
  1656.          Information to be cached includes the values of:
  1657.  
  1658.                       - sendPduHandle
  1659.                       - msgID
  1660.                       - snmpEngineID
  1661.                       - securityModel
  1662.                       - securityName
  1663.                       - securityLevel
  1664.                       - contextEngineID
  1665.                       - contextName
  1666.  
  1667.       d) A SUCCESS result is returned.  SNMPv3 Message Processing is
  1668.          complete.
  1669.  
  1670. 7.2.  Prepare Data Elements from an Incoming SNMP Message
  1671.  
  1672.    This section describes the procedure followed to extract data from an
  1673.    SNMPv3 message, and to prepare the data elements required for further
  1674.    processing of the message by the Message Dispatcher.
  1675.  
  1676.  
  1677.  
  1678.  
  1679. SNMPv3 Working Group       Expires March 1998                  [Page 30]
  1680.  
  1681. Internet Draft     Message Processing and Dispatching     9 October 1997
  1682.  
  1683.  
  1684.    1)  The message is passed in from the Message Dispatcher according to
  1685.        the abstract service primitive:
  1686.  
  1687.        result =                         -- SUCCESS or errorIndication
  1688.          prepareDataElements(
  1689.          IN  transportDomain          -- origin transport domain
  1690.          IN  transportAddress         -- origin transport address
  1691.          IN  wholeMsg                 -- as received from the network
  1692.          IN  wholeMsgLength           -- as received from the network
  1693.          OUT messageProcessingModel   -- typically, SNMP version
  1694.          OUT securityModel            -- Security Model to use
  1695.          OUT securityName             -- on behalf of this principal
  1696.          OUT securityLevel            -- Level of Security requested
  1697.          OUT contextEngineID          -- data from/at this entity
  1698.          OUT contextName              -- data from/in this context
  1699.          OUT pduVersion               -- version of the PDU
  1700.          OUT PDU                      -- SNMP Protocol Data Unit
  1701.          OUT pduType                  -- SNMP PDU type
  1702.          OUT sendPduHandle            -- handle for matched request
  1703.          OUT maxSizeResponseScopedPDU -- maximum size of Response PDU
  1704.          OUT statusInformation        -- success or errorIndication
  1705.                                       -- error counter OID and value
  1706.                                       -- when errorIndication
  1707.          OUT stateReference           -- reference to state information
  1708.                                       -- to be used for a possible
  1709.          )                            -- Response
  1710.  
  1711.    2)  If the received message is not the serialization (according to
  1712.        the conventions of [RFC1906]) of an SNMPv3Message value, then the
  1713.        snmpInASNParseErrs counter [RFC1907] is incremented, the message
  1714.        is discarded without further processing, and a FAILURE result is
  1715.        returned. SNMPv3 Message Processing is complete.
  1716.  
  1717.    3)  The values for msgVersion, msgID, msgMaxSize, msgFlags,
  1718.        msgSecurityModel, msgSecurityParameters, and msgData are
  1719.        extracted from the message.
  1720.  
  1721.    4)  If the value of the msgSecurityModel component does not match a
  1722.        supported securityModel, then the snmpUnknownSecurityModels
  1723.        counter is incremented, a Report PDU is generated, the message is
  1724.        discarded without further processing, and a FAILURE result is
  1725.        returned. SNMPv3 Message Processing is complete.
  1726.  
  1727.    5)  The securityLevel is determined from the authFlag and the
  1728.        privFlag bits of the msgFlags component as follows:
  1729.  
  1730.        a) If the authFlag is not set and the privFlag is not set, then
  1731.           securityLevel is set to noAuthNoPriv.
  1732.  
  1733.  
  1734.  
  1735. SNMPv3 Working Group       Expires March 1998                  [Page 31]
  1736.  
  1737. Internet Draft     Message Processing and Dispatching     9 October 1997
  1738.  
  1739.  
  1740.        b) If the authFlag is set and the privFlag is not set, then
  1741.           securityLevel is set to authNoPriv.
  1742.  
  1743.        c) If the authFlag is set and the privFlag is set, then
  1744.           securityLevel is set to authPriv.
  1745.  
  1746.        d) If the authFlag is not set and privFlag is set, then the
  1747.           snmpInvalidMsgs counter is incremented, a Report PDU is
  1748.           generated, the message is discarded without further
  1749.           processing, and a FAILURE result is returned. SNMPv3 Message
  1750.           Processing is complete.
  1751.  
  1752.    6)  The security module implementing the Security Model as specified
  1753.        by the securityModel component is called for authentication and
  1754.        privacy services.  This is done according to the abstract service
  1755.        primitive:
  1756.  
  1757.        statusInformation =            -- errorIndication or success
  1758.                                       -- error counter OID and
  1759.                                       -- value if error
  1760.          processIncomingMsg(
  1761.          IN  messageProcessingModel   -- SNMPv3 Message Processing Model
  1762.          IN  expectResponse           -- TRUE or FALSE
  1763.          IN  maxMessageSize           -- of the sending SNMP entity
  1764.          IN  securityParameters       -- for the received message
  1765.          IN  securityModel            -- for the received message
  1766.          IN  securityLevel            -- Level of Security
  1767.          IN  wholeMsg                 -- as received on the wire
  1768.          IN  wholeMsgLength           -- length as received on the wire
  1769.          OUT securityEngineID         -- authoritative SNMP entity
  1770.          OUT securityName             -- identification of the principal
  1771.          OUT scopedPDU,               -- message (plaintext) payload
  1772.          OUT maxSizeResponseScopedPDU -- maximum size of Response PDU
  1773.          OUT securityStateReference   -- reference to security state
  1774.          )                            -- information, needed for
  1775.                                       -- response
  1776.  
  1777.        If an errorIndication is returned by the security module, then
  1778.  
  1779.        a) If statusInformation contains values for an OID/value pair,
  1780.           then a Report PDU is generated.
  1781.  
  1782.           1) If the scopedPDU has been returned from ProcessIncomingMsg
  1783.              then determine contextEngineID, contextName, and PDU.
  1784.  
  1785.           2) Information about the message is cached and a
  1786.              stateReference is created (implementation-specific).
  1787.              Information to be cached includes the values of:
  1788.  
  1789.  
  1790.  
  1791. SNMPv3 Working Group       Expires March 1998                  [Page 32]
  1792.  
  1793. Internet Draft     Message Processing and Dispatching     9 October 1997
  1794.  
  1795.  
  1796.                           msgVersion,
  1797.                           msgID,
  1798.                           securityLevel,
  1799.                           msgFlags,
  1800.                           msgMaxSize,
  1801.                           securityModel,
  1802.                           maxSizeResponseScopedPDU,
  1803.                           securityStateReference
  1804.  
  1805.           3) Request that a Report-PDU be prepared and sent, according
  1806.              to the abstract service primitive:
  1807.  
  1808.              result =                     -- SUCCESS or FAILURE
  1809.              returnResponsePDU(
  1810.              IN  messageProcessingModel   -- SNMPv3(3)
  1811.              IN  securityModel            -- same as on incoming request
  1812.              IN  securityName             -- from ProcessIncomingMsg
  1813.              IN  securityLevel            -- same as on incoming request
  1814.              IN  contextEngineID          -- from step 6 a) 1)
  1815.              IN  contextName              -- from step 6 a) 1)
  1816.              IN  pduVersion               -- SNMPv2-PDU
  1817.              IN  PDU                      -- from step 6 a) 1)
  1818.              IN  maxSizeResponseScopedPDU -- from ProcessIncomingMsg
  1819.              IN  stateReference           -- from step 6 a) 2)
  1820.              IN  statusInformation        -- from ProcessIncomingMsg
  1821.              OUT transportDomain          -- destination's transport
  1822.                                           -- domain
  1823.              OUT transportAddress         -- destination's transport
  1824.                                           -- address
  1825.              OUT outgoingMessage          -- the message to send
  1826.              OUT outgoingMessageLength    -- the length of the message
  1827.              )
  1828.  
  1829.        b) The incoming message is discarded without further processing,
  1830.           and a FAILURE result is returned. SNMPv3 Message Processing is
  1831.           complete.
  1832.  
  1833.    7)  The scopedPDU is parsed to extract the contextEngineID, the
  1834.        contextName and the PDU.  If any parse error occurs, then the
  1835.        snmpInASNParseErrs counter [RFC1907] is incremented, the security
  1836.        state information is discarded, the message is discarded without
  1837.        further processing, and a FAILURE result is returned. SNMPv3
  1838.        Message Processing is complete.
  1839.  
  1840.    8)  The pduVersion is set to an SNMPv2-PDU.
  1841.  
  1842.    9)  The pduType is determined, in an implementation-dependent manner,
  1843.        to be:
  1844.  
  1845.  
  1846.  
  1847. SNMPv3 Working Group       Expires March 1998                  [Page 33]
  1848.  
  1849. Internet Draft     Message Processing and Dispatching     9 October 1997
  1850.  
  1851.  
  1852.                - a GetRequest-PDU,
  1853.                - a GetNextRequest-PDU,
  1854.                - a GetBulkRequest-PDU,
  1855.                - a SetRequest-PDU,
  1856.                - an InformRequest-PDU,
  1857.                - an SNMPv2-Trap-PDU,
  1858.                - a Response-PDU, or
  1859.                - a Report-PDU.
  1860.  
  1861.    10) If the pduType is a Response-PDU or Report-PDU, then
  1862.  
  1863.        a) The value of the msgID component is used to find the cached
  1864.           information for a corresponding outstanding Request message.
  1865.           If no such outstanding Request message is found, then the
  1866.           security state information is discarded, the message is
  1867.           discarded without further processing, and a FAILURE result is
  1868.           returned. SNMPv3 Message Processing is complete.
  1869.  
  1870.        b) sendPduHandle is retrieved from the cached information.
  1871.  
  1872.        Otherwise, sendPduHandle is set to <none>, an implementation
  1873.        defined value.
  1874.  
  1875.     11) If the pduType is a Report-PDU, then
  1876.  
  1877.         a) statusInformation is created using the contents of the
  1878.            Report-PDU, in an implementation-dependent manner. This
  1879.            statusInformation will be forwarded to the application
  1880.            associated with the sendPduHandle.
  1881.  
  1882.         b) Any cached information about the outstanding Request message
  1883.            message is discarded.
  1884.  
  1885.         c) The security state information for this incoming message is
  1886.            discarded.
  1887.  
  1888.         d) stateReference is set to <none>
  1889.  
  1890.         e) A SUCCESS result is returned. SNMPv3 Message Processing is
  1891.            complete.
  1892.  
  1893.     12) If the pduType is a Response-PDU, then
  1894.  
  1895.         a) The cached data for the outstanding request, referred to by
  1896.            stateReference, is retrieved, including
  1897.  
  1898.                        - snmpEngineID
  1899.                        - securityModel
  1900.  
  1901.  
  1902.  
  1903. SNMPv3 Working Group       Expires March 1998                  [Page 34]
  1904.  
  1905. Internet Draft     Message Processing and Dispatching     9 October 1997
  1906.  
  1907.  
  1908.                        - securityName
  1909.                        - securityLevel
  1910.                        - contextEngineID
  1911.                        - contextName
  1912.  
  1913.         b) If the values extracted from the incoming message differ from
  1914.            the cached data, then the security state information is
  1915.            discarded, any cached information about the outstanding
  1916.            Request message is discarded, the incoming message is
  1917.            discarded without further processing, and a FAILURE result is
  1918.            returned.  SNMPv3 Message Processing is complete.
  1919.  
  1920.         c) Otherwise, any cached information about the outstanding
  1921.            Request message is discarded, and stateReference is set to
  1922.            <none>.
  1923.  
  1924.         d) A SUCCESS result is returned. SNMPv3 Message Processing is
  1925.            complete.
  1926.  
  1927.     13) If the pduType is a GetRequest-PDU, GetNextRequest-PDU,
  1928.         GetBulkRequest-PDU, SetRequest-PDU, or InformRequest-PDU, then
  1929.  
  1930.         a) If the value of securityEngineID is not equal to the value of
  1931.            snmpEngineID, then the security state information is
  1932.            discarded, any cached information about the outstanding
  1933.            Request message is discarded, the incoming message is
  1934.            discarded without further processing, and a FAILURE result is
  1935.            returned.  SNMPv3 Message Processing is complete.
  1936.  
  1937.         b) Information about the message is cached and a stateReference
  1938.            is created (implementation-specific).  Information to be
  1939.            cached includes the values of:
  1940.  
  1941.                         msgVersion,
  1942.                         msgID,
  1943.                         securityLevel,
  1944.                         msgFlags,
  1945.                         msgMaxSize,
  1946.                         securityModel,
  1947.                         maxSizeResponseScopedPDU,
  1948.                         securityStateReference
  1949.  
  1950.         c) A SUCCESS result is returned. SNMPv3 Message Processing is
  1951.            complete.
  1952.  
  1953.     14) If the pduType is an SNMPv2-Trap-PDU, then A SUCCESS result is
  1954.         returned. SNMPv3 Message Processing is complete.
  1955.  
  1956.  
  1957.  
  1958.  
  1959. SNMPv3 Working Group       Expires March 1998                  [Page 35]
  1960.  
  1961. Internet Draft     Message Processing and Dispatching     9 October 1997
  1962.  
  1963.  
  1964. 8.  Security Considerations
  1965.  
  1966.    The Dispatcher coordinates the processing of messages to provide a
  1967.    level of security for management messages and to direct the SNMP PDUs
  1968.    to the proper SNMP application(s).
  1969.  
  1970.    A Message Processing Model, and in particular the V3MP defined in
  1971.    this document, interacts as part of the Message Processing with
  1972.    Security Models in the Security Subsystem via the abstract service
  1973.    interface primitives defined in [SNMP-ARCH] and elaborated above.
  1974.  
  1975.    The level of security actually provided is primarily determined by
  1976.    the specific Security Model implementation(s) and the specific SNMP
  1977.    application implementation(s) incorporated into this framework.
  1978.    Applications have access to data which is not secured. Applications
  1979.    should take reasonable steps to protect the data from disclosure, and
  1980.    when they send data across the network, they should obey the
  1981.    securityLevel and call upon the services of an Access Control Model
  1982.    as they apply access control.
  1983.  
  1984.    The values for the msgID element used in communication between SNMP
  1985.    entities must be chosen to avoid replay attacks.  The values do not
  1986.    need to be unpredictable; it is sufficient that they not repeat.
  1987.  
  1988.  
  1989. 9.  Editors' Addresses
  1990.  
  1991.       Co-editor: Jeffrey Case
  1992.                  SNMP Research, Inc.
  1993.       postal:    3001 Kimberlin Heights Road
  1994.                  Knoxville, TN 37920-9716
  1995.                  USA
  1996.       email:     case@snmp.com
  1997.       phone:     +1 423-573-1434
  1998.  
  1999.  
  2000.       Co-editor   Dave Harrington
  2001.                   Cabletron Systems, Inc
  2002.       postal:     Post Office Box 5005
  2003.                   Mail Stop: Durham
  2004.                   35 Industrial Way
  2005.                   Rochester, NH 03867-5005
  2006.                   USA
  2007.       email:      dbh@cabletron.com
  2008.       phone:      +1 603-337-7357
  2009.  
  2010.  
  2011.  
  2012.  
  2013.  
  2014.  
  2015. SNMPv3 Working Group       Expires March 1998                  [Page 36]
  2016.  
  2017. Internet Draft     Message Processing and Dispatching     9 October 1997
  2018.  
  2019.  
  2020.       Co-editor:  Randy Presuhn
  2021.                   BMC Software, Inc.
  2022.       postal:     1190 Saratoga Avenue
  2023.                   Suite 130
  2024.                   San Jose, CA 95129
  2025.                   USA
  2026.       email:      rpresuhn@bmc.com
  2027.       phone:      +1 408-556-0720
  2028.  
  2029.  
  2030.       Co-editor:  Bert Wijnen
  2031.                   IBM T. J. Watson Research
  2032.       postal:     Schagen 33
  2033.                   3461 GL Linschoten
  2034.                   Netherlands
  2035.       email:      wijnen@vnet.ibm.com
  2036.       phone:      +31 348-432-794
  2037.  
  2038.  
  2039.  
  2040. 10.  Acknowledgements
  2041.  
  2042.    This document is the result of the efforts of the SNMPv3 Working
  2043.    Group.  Some special thanks are in order to the following SNMPv3 WG
  2044.    members:
  2045.  
  2046.        Dave Battle (SNMP Research, Inc.)
  2047.        Uri Blumenthal (IBM T.J. Watson Research Center)
  2048.        Jeff Case (SNMP Research, Inc.)
  2049.        John Curran (BBN)
  2050.        T. Max Devlin (Hi-TECH Connections)
  2051.        John Flick (Hewlett Packard)
  2052.        David Harrington (Cabletron Systems Inc.)
  2053.        N.C. Hien (IBM T.J. Watson Research Center)
  2054.        Dave Levi (SNMP Research, Inc.)
  2055.        Louis A Mamakos (UUNET Technologies Inc.)
  2056.        Paul Meyer (Secure Computing Corporation)
  2057.        Keith McCloghrie (Cisco Systems)
  2058.        Russ Mundy (Trusted Information Systems, Inc.)
  2059.        Bob Natale (ACE*COMM Corporation)
  2060.        Mike O'Dell (UUNET Technologies Inc.)
  2061.        Dave Perkins (DeskTalk)
  2062.        Peter Polkinghorne (Brunel University)
  2063.        Randy Presuhn (BMC Software, Inc.)
  2064.        David Reid (SNMP Research, Inc.)
  2065.        Shawn Routhier (Epilogue)
  2066.        Juergen Schoenwaelder (TU Braunschweig)
  2067.        Bob Stewart (Cisco Systems)
  2068.  
  2069.  
  2070.  
  2071. SNMPv3 Working Group       Expires March 1998                  [Page 37]
  2072.  
  2073. Internet Draft     Message Processing and Dispatching     9 October 1997
  2074.  
  2075.  
  2076.        Bert Wijnen (IBM T.J. Watson Research Center)
  2077.  
  2078.    The document is based on recommendations of the IETF Security and
  2079.    Administrative Framework Evolution for SNMP Advisory Team.  Members
  2080.    of that Advisory Team were:
  2081.  
  2082.        David Harrington (Cabletron Systems Inc.)
  2083.        Jeff Johnson (Cisco Systems)
  2084.        David Levi (SNMP Research Inc.)
  2085.        John Linn (Openvision)
  2086.        Russ Mundy (Trusted Information Systems) chair
  2087.        Shawn Routhier (Epilogue)
  2088.        Glenn Waters (Nortel)
  2089.        Bert Wijnen (IBM T. J. Watson Research Center)
  2090.  
  2091.    As recommended by the Advisory Team and the SNMPv3 Working Group
  2092.    Charter, the design incorporates as much as practical from previous
  2093.    RFCs and drafts. As a result, special thanks are due to the authors
  2094.    of previous designs known as SNMPv2u and SNMPv2*:
  2095.  
  2096.        Jeff Case (SNMP Research, Inc.)
  2097.        David Harrington (Cabletron Systems Inc.)
  2098.        David Levi (SNMP Research, Inc.)
  2099.        Keith McCloghrie (Cisco Systems)
  2100.        Brian O'Keefe (Hewlett Packard)
  2101.        Marshall T. Rose (Dover Beach Consulting)
  2102.        Jon Saperia (BGS Systems Inc.)
  2103.        Steve Waldbusser (International Network Services)
  2104.        Glenn W. Waters (Bell-Northern Research Ltd.)
  2105.  
  2106.  
  2107. 11.  References
  2108.  
  2109.  
  2110. [RFC1901] The SNMPv2 Working Group, Case, J., McCloghrie, K., Rose, M.,
  2111.      and S., Waldbusser, "Introduction to Community-based SNMPv2", RFC
  2112.      1901, January 1996.
  2113.  
  2114. [RFC1902] The SNMPv2 Working Group, Case, J., McCloghrie, K., Rose, M.,
  2115.      and S., Waldbusser, "Structure of Management Information for
  2116.      Version  2 of the Simple Network Management Protocol (SNMPv2)", RFC
  2117.      1902, January 1996.
  2118.  
  2119. [RFC1905] The SNMPv2 Working Group, Case, J., McCloghrie, K., Rose, M.,
  2120.      and S., Waldbusser, "Protocol Operations for Version 2 of the
  2121.      Simple Network Management Protocol (SNMPv2)", RFC 1905, January
  2122.      1996.
  2123.  
  2124.  
  2125.  
  2126.  
  2127. SNMPv3 Working Group       Expires March 1998                  [Page 38]
  2128.  
  2129. Internet Draft     Message Processing and Dispatching     9 October 1997
  2130.  
  2131.  
  2132.  
  2133. [RFC1906] The SNMPv2 Working Group, Case, J., McCloghrie, K., Rose, M.,
  2134.      and S. Waldbusser, "Transport Mappings for Version 2 of the Simple
  2135.      Network Management Protocol (SNMPv2)", RFC 1906, January 1996.
  2136.  
  2137. [RFC1907] The SNMPv2 Working Group, Case, J., McCloghrie, K., Rose, M.,
  2138.      and S. Waldbusser, "Management Information Base for Version 2 of
  2139.      the Simple Network Management Protocol (SNMPv2)", RFC 1907 January
  2140.      1996.
  2141.  
  2142. [RFC1908] The SNMPv2 Working Group, Case, J., McCloghrie, K., Rose, M.,
  2143.      and S. Waldbusser, "Coexistence between Version 1 and Version 2 of
  2144.      the Internet-standard Network Management Framework", RFC 1908,
  2145.      January 1996.
  2146.  
  2147. [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
  2148.      Requirement Levels", RFC 2119, BCP 14, March 1997.
  2149.  
  2150. [SNMP-ARCH] The SNMPv3 Working Group, Harrington, D., Presuhn, R.,
  2151.      Wijnen, B., "An Architecture for describing SNMP Management
  2152.      Frameworks", <draft-ietf-snmpv3-next-gen-arch-05.txt>, September
  2153.      1997.
  2154.  
  2155. [SNMP-USM] The SNMPv3 Working Group, Blumenthal, U., Wijnen, B., "The
  2156.      User-Based Security Model for Version 3 of the Simple Network
  2157.      Management Protocol (SNMPv3)", <draft-ietf-snmpv3-usm-02.txt>,
  2158.      September 1997.
  2159.  
  2160. [SNMP-ACM] The SNMPv3 Working Group, Wijnen, B., Presuhn, R.,
  2161.      McCloghrie, K., "View-based Access Control Model for the Simple
  2162.      Network Management Protocol (SNMP)",
  2163.      <draft-ietf-snmpv3-acm-03.txt>, September 1997.
  2164.  
  2165. [SNMP-APPL] The SNMPv3 Working Group, Levi, D. B., Meyer, P., Stewart,
  2166.      B., "SNMPv3 Applications", <draft-ietf-snmpv3-appl-02.txt>,
  2167.      September 1997.
  2168.  
  2169.  
  2170.  
  2171.  
  2172.  
  2173.  
  2174.  
  2175.  
  2176.  
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182.  
  2183. SNMPv3 Working Group       Expires March 1998                  [Page 39]
  2184.  
  2185. Internet Draft     Message Processing and Dispatching     9 October 1997
  2186.  
  2187.  
  2188.  
  2189. 12.  Issues
  2190.  
  2191.    The revision history in this section will be deleted when this
  2192.    material is submitted for last call.  The remaining material in this
  2193.    section will be deleted in the transition from internet-draft to RFC.
  2194.  
  2195. 12.1.  Open Issues
  2196.  
  2197.    The following open issues need to be resolved.
  2198.  
  2199.       -  The more precise specification of the handling of the
  2200.          reportableFlag begs the question of what an engine is supposed
  2201.          to do when it receives a message with an illegal combination of
  2202.          the reportableFlag and PDU type.
  2203.  
  2204.          The paragraph beginning with "Report PDUs are engine-to-engine
  2205.          communications...."  has been deleted.  The old text was a bit
  2206.          of an overspecification, but in the past the first part of that
  2207.          paragraph has proven valuable in explaining to people just what
  2208.          report PDUs are for.
  2209.  
  2210. 12.2.  Resolved Issues
  2211.  
  2212. 12.3.  Change Log
  2213.  
  2214.    The following change log records major changes.  The version
  2215.    identifiers are for the convenience of the document's editors.
  2216.  
  2217.       [Current]
  2218.  
  2219.       -  updated clause 7.1 to allow context override for error
  2220.          indications
  2221.  
  2222.       -  removed old change logs and resolved issues
  2223.  
  2224.       -  updated draft identifiers in references section
  2225.  
  2226.  
  2227.  
  2228.  
  2229.  
  2230.  
  2231.  
  2232.  
  2233.  
  2234.  
  2235.  
  2236.  
  2237.  
  2238.  
  2239. SNMPv3 Working Group       Expires March 1998                  [Page 40]
  2240.  
  2241.                             Table of Contents
  2242.  
  2243.  
  2244.  
  2245.  
  2246. 1. Introduction ...................................................    2
  2247.  
  2248. 2. Overview .......................................................    2
  2249.  
  2250. 2.1. The Dispatcher.  .............................................    4
  2251.  
  2252. 2.2. Message Processing Subsystem .................................    4
  2253.  
  2254. 3. Elements of Message Processing and Dispatching .................    4
  2255.  
  2256. 3.1. messageProcessingModel .......................................    5
  2257.  
  2258. 3.2. pduVersion ...................................................    5
  2259.  
  2260. 3.3. pduType ......................................................    6
  2261.  
  2262. 3.4. sendPduHandle ................................................    6
  2263.  
  2264. 4. Dispatcher Elements of Procedure ...............................    7
  2265.  
  2266. 4.1. Sending an SNMP Message to the Network .......................    7
  2267.  
  2268. 4.1.1. Sending a Request or Notification ..........................    7
  2269.  
  2270. 4.1.2. Sending a Response to the Network ..........................    8
  2271.  
  2272. 4.2. Receiving an SNMP Message from the Network ...................   10
  2273.  
  2274. 4.2.1. Message Dispatching of received SNMP Messages ..............   10
  2275.  
  2276. 4.2.2. PDU Dispatching for Incoming Messages ......................   11
  2277.  
  2278. 4.2.2.1. PDU Dispatching for Incoming Messages: Requests and
  2279. Notifications .....................................................   11
  2280.  
  2281. 4.2.2.2. PDU Dispatching for Incoming Messages:  Responses ........   13
  2282.  
  2283. 4.3. Application Registration for Handling PDU types ..............   14
  2284.  
  2285. 4.4. Application Unregistration for Handling PDU Types ............   15
  2286.  
  2287.  
  2288.  
  2289. SNMPv3 Working Group       Expires March 1998                   [Page 1]
  2290.  
  2291. Internet Draft     Message Processing and Dispatching     9 October 1997
  2292.  
  2293.  
  2294. 5. Definitions ....................................................   15
  2295.  
  2296. 5.1. Definitions for SNMP Message Processing and Dispatching ......   15
  2297.  
  2298. 6. The SNMPv3 Message Format ......................................   19
  2299.  
  2300. 6.1. msgVersion ...................................................   20
  2301.  
  2302. 6.2. msgID ........................................................   20
  2303.  
  2304. 6.3. msgMaxSize ...................................................   20
  2305.  
  2306. 6.4. msgFlags .....................................................   20
  2307.  
  2308. 6.5. msgSecurityModel .............................................   22
  2309.  
  2310. 6.6. msgSecurityParameters ........................................   23
  2311.  
  2312. 6.7. scopedPduData ................................................   23
  2313.  
  2314. 6.8. scopedPDU ....................................................   23
  2315.  
  2316. 6.8.1. contextEngineID ............................................   23
  2317.  
  2318. 6.8.2. contextName ................................................   23
  2319.  
  2320. 6.8.3. data .......................................................   24
  2321.  
  2322. 7. Elements of Procedure for v3MP .................................   24
  2323.  
  2324. 7.1. Prepare an Outgoing SNMP Message .............................   24
  2325.  
  2326. 7.2. Prepare Data Elements from an Incoming SNMP Message ..........   30
  2327.  
  2328. 8. Security Considerations ........................................   36
  2329.  
  2330. 9. Editors' Addresses .............................................   36
  2331.  
  2332. 10. Acknowledgements ..............................................   37
  2333.  
  2334. 11. References ....................................................   38
  2335.  
  2336. 12. Issues ........................................................   40
  2337.  
  2338. 12.1. Open Issues .................................................   40
  2339.  
  2340. 12.2. Resolved Issues .............................................   40
  2341.  
  2342.  
  2343.  
  2344.  
  2345. SNMPv3 Working Group       Expires March 1998                   [Page 2]
  2346.  
  2347. Internet Draft     Message Processing and Dispatching     9 October 1997
  2348.  
  2349.  
  2350. 12.3. Change Log ..................................................   40
  2351.  
  2352.  
  2353.  
  2354.  
  2355.  
  2356.  
  2357.  
  2358.  
  2359.  
  2360.  
  2361.  
  2362.  
  2363.  
  2364.  
  2365.  
  2366.  
  2367.  
  2368.  
  2369.  
  2370.  
  2371.  
  2372.  
  2373.  
  2374.  
  2375.  
  2376.  
  2377.  
  2378.  
  2379.  
  2380.  
  2381.  
  2382.  
  2383.  
  2384.  
  2385.  
  2386.  
  2387.  
  2388.  
  2389.  
  2390.  
  2391.  
  2392.  
  2393.  
  2394.  
  2395.  
  2396.  
  2397.  
  2398.  
  2399.  
  2400.  
  2401. SNMPv3 Working Group       Expires March 1998                   [Page 3]
  2402.