home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / perl502b.zip / ext / DPI / DOC / rfc1592.txt < prev   
Text File  |  1995-09-26  |  136KB  |  3,028 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. Network Working Group                                          B. Wijnen
  8. Request for Comments: 1592                                  G. Carpenter
  9. Obsoletes: 1228                   T.J. Watson Research Center, IBM Corp.
  10. Category: Experimental                                         K. Curran
  11.                                                                A. Sehgal
  12.                                                                G. Waters
  13.                                             Bell Northern Research, Ltd.
  14.                                                               March 1994
  15.  
  16.  
  17.                    Simple Network Management Protocol
  18.                      Distributed Protocol Interface
  19.                               Version 2.0
  20.  
  21. Status of this Memo
  22.  
  23.    This memo defines an Experimental Protocol for the Internet
  24.    community.  This memo does not specify an Internet standard of any
  25.    kind.  Discussion and suggestions for improvement are requested.
  26.    Distribution of this memo is unlimited.
  27.  
  28. Table of Contents
  29.      1. INTRODUCTION  . . . . . . . . . . . . . . . . . . . . . . . .  2
  30.      1.1  Motivation  . . . . . . . . . . . . . . . . . . . . . . . .  3
  31.      1.2  Summary of Changes  . . . . . . . . . . . . . . . . . . . .  4
  32.      2. THEORY OF OPERATION . . . . . . . . . . . . . . . . . . . . .  5
  33.      2.1  Connection Establishment and Termination  . . . . . . . . .  5
  34.      2.2  Registration  . . . . . . . . . . . . . . . . . . . . . . .  6
  35.      2.3  Normal Operation  . . . . . . . . . . . . . . . . . . . . .  6
  36.      2.4  DPI Architecture  . . . . . . . . . . . . . . . . . . . . .  6
  37.      3. SNMP DPI PROTOCOL . . . . . . . . . . . . . . . . . . . . .   10
  38.      3.1  Connection Establishment  . . . . . . . . . . . . . . . .   10
  39.      3.1.1  SNMP PDU to GET the Agent's DPI port  . . . . . . . . .   11
  40.      3.1.2  SNMP PDU Containing the RESPONSE to the GET   . . . . .   13
  41.      3.2  SNMP DPI Packet Formats   . . . . . . . . . . . . . . . .   15
  42.      3.2.1  DPI Packet Header   . . . . . . . . . . . . . . . . . .   15
  43.      3.2.2  OPEN  . . . . . . . . . . . . . . . . . . . . . . . . .   16
  44.      3.2.3  CLOSE   . . . . . . . . . . . . . . . . . . . . . . . .   18
  45.      3.2.4  ARE_YOU_THERE   . . . . . . . . . . . . . . . . . . . .   19
  46.      3.2.5  REGISTER  . . . . . . . . . . . . . . . . . . . . . . .   20
  47.      3.2.6  UNREGISTER  . . . . . . . . . . . . . . . . . . . . . .   22
  48.      3.2.7  GET   . . . . . . . . . . . . . . . . . . . . . . . . .   23
  49.      3.2.8  GETNEXT   . . . . . . . . . . . . . . . . . . . . . . .   24
  50.      3.2.9  GETBULK   . . . . . . . . . . . . . . . . . . . . . . .   25
  51.      3.2.10  SET, COMMIT and UNDO   . . . . . . . . . . . . . . . .   26
  52.      3.2.11  RESPONSE   . . . . . . . . . . . . . . . . . . . . . .   29
  53.      3.2.12  TRAP   . . . . . . . . . . . . . . . . . . . . . . . .   31
  54.      3.3  Constants and Values  . . . . . . . . . . . . . . . . . .   33
  55.  
  56.  
  57.  
  58. Wijnen, Carpenter, Curran, Sehgal & Waters                      [Page 1]
  59.  
  60. RFC 1592                        SNMP-DPI                      March 1994
  61.  
  62.  
  63.      3.3.1  Protocol Version and Release Values   . . . . . . . . .   33
  64.      3.3.2  Packet Type Values  . . . . . . . . . . . . . . . . . .   34
  65.      3.3.3  Variable Type Values  . . . . . . . . . . . . . . . . .   35
  66.      3.3.4  Value Representation  . . . . . . . . . . . . . . . . .   36
  67.      3.3.5  Character set selection   . . . . . . . . . . . . . . .   36
  68.      3.3.6  Error Code Values for SNMP DPI RESPONSE packets   . . .   37
  69.      3.3.7  UNREGISTER Reason Codes   . . . . . . . . . . . . . . .   40
  70.      3.3.8  CLOSE Reason Codes  . . . . . . . . . . . . . . . . . .   41
  71.      4. DPI 2.0 MIB DEFINITION  . . . . . . . . . . . . . . . . . .   41
  72.      5. SUBAGENT CONSIDERATIONS . . . . . . . . . . . . . . . . . .   42
  73.      5.1  DPI API   . . . . . . . . . . . . . . . . . . . . . . . .   43
  74.      5.2  Overview of Request Processing  . . . . . . . . . . . . .   44
  75.      5.2.1  GET Processing  . . . . . . . . . . . . . . . . . . . .   44
  76.      5.2.2  SET Processing  . . . . . . . . . . . . . . . . . . . .   44
  77.      5.2.3  GETNEXT Processing  . . . . . . . . . . . . . . . . . .   46
  78.      5.2.4  GETBULK Processing  . . . . . . . . . . . . . . . . . .   47
  79.      5.2.5  OPEN Request  . . . . . . . . . . . . . . . . . . . . .   48
  80.      5.2.6  CLOSE Request   . . . . . . . . . . . . . . . . . . . .   49
  81.      5.2.7  REGISTER Request  . . . . . . . . . . . . . . . . . . .   49
  82.      5.2.8  UNREGISTER Request  . . . . . . . . . . . . . . . . . .   50
  83.      5.2.9  TRAP Request  . . . . . . . . . . . . . . . . . . . . .   51
  84.      5.2.10  ARE_YOU_THERE request  . . . . . . . . . . . . . . . .   51
  85.      5.2.11  How to query the DPI port.   . . . . . . . . . . . . .   51
  86.      6. REFERENCES  . . . . . . . . . . . . . . . . . . . . . . . .   51
  87.      7. SECURITY CONSIDERATIONS . . . . . . . . . . . . . . . . . .   52
  88.      8. AUTHORS' ADDRESSES  . . . . . . . . . . . . . . . . . . . .   53
  89.      9. SAMPLE SOURCES FOR ANONYMOUS FTP  . . . . . . . . . . . . .   54
  90.  
  91. 1.  INTRODUCTION
  92.  
  93.    This RFC describes version 2.0 of a protocol that International
  94.    Business Machines Corporation (IBM) has been implementing in most of
  95.    its SNMP agents to allow dynamic extension of supported MIBs.  Bell
  96.    Northern Research (BNR) has also implemented a version of this
  97.    protocol in some of its SNMP agents for the same reason.
  98.  
  99.    The Simple Network Management Protocol (SNMP [1]) Distributed
  100.    Protocol Interface (DPI) is an extension to SNMP agents that permits
  101.    end-users to dynamically add, delete or replace management variables
  102.    in the local Management Information Base without requiring
  103.    recompilation of the SNMP agent.  This is achieved by writing a so-
  104.    called sub-agent that communicates with the agent via the SNMP-DPI.
  105.  
  106.    For the author of a sub-agent, the SNMP-DPI eliminates the need to
  107.    know the details of ASN.1 [2] or SNMP PDU (Protocol Data Unit)
  108.    encoding/decoding [1, 3].
  109.  
  110.    Versions 1.0 and 1.1 of this protocol have been in use within IBM
  111.  
  112.  
  113.  
  114. Wijnen, Carpenter, Curran, Sehgal & Waters                      [Page 2]
  115.  
  116. RFC 1592                        SNMP-DPI                      March 1994
  117.  
  118.  
  119.    since 1989 and is included in the SNMP agents for VM, MVS and OS/2.
  120.    Version 1.2 of this protocol has been in use within BNR since 1992.
  121.  
  122. 1.1  MOTIVATION
  123.  
  124.    The Simple Network Management Protocol [1] defines a protocol that
  125.    permits operations on a collection of variables.  This set of
  126.    variables is called the Management Information Base (MIB) and a core
  127.    set of variables has previously been defined [4, 5]; however, the
  128.    design of the MIB makes provision for extension of this core set.
  129.    Thus, an enterprise or individual can define variables of their own
  130.    which represent information of use to them.  An example of a
  131.    potentially interesting variable which is not in the core MIB would
  132.    be CPU utilization (percent busy).  Unfortunately, conventional SNMP
  133.    agent implementations provide no means for an end-user to make
  134.    available new variables.
  135.  
  136.    Besides this, today there are many MIBs that people want to implement
  137.    on a system.  Without a capability for sub-agents, this requires all
  138.    the MIBs to be implemented in one big monolithic agent, which is in
  139.    many cases undesirable.
  140.  
  141.    The SNMP DPI addresses these issues by providing a light-weight
  142.    mechanism by which a process can register the existence of a MIB
  143.    variable or a MIB sub-tree with the SNMP agent.  Requests for the
  144.    variable(s) that are received by the SNMP agent are passed to the
  145.    process acting as a sub-agent.  The sub-agent then returns an
  146.    appropriate answer to the SNMP agent.  The SNMP agent eventually
  147.    packages an SNMP response packet and sends the answer back to the
  148.    remote network management station that initiated the request.
  149.  
  150.    Remote network management stations have no knowledge that the SNMP
  151.    agent calls on other processes to obtain an answer.  As far as they
  152.    can tell, there is only one network management application (agent)
  153.    running on the host.
  154.  
  155.    At the San Diego IETF (March 1992) a BOF was held on multiplexing
  156.    SNMP agent's requirements.  Both the SMUX [6] and DPI [7] protocols
  157.    were discussed, as well as other unpublished approaches.  There was
  158.    also discussion regarding a need for a standard for multiplexing SNMP
  159.    agents or sub-agent support.  At the end of the BOF, however, there
  160.    was not enough support for defining a standard.  This was due, at
  161.    least partially, to a few well known SNMP authors who stated that the
  162.    proxy and party support for SNMPv2 (SMP at the time) would solve the
  163.    problem.
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170. Wijnen, Carpenter, Curran, Sehgal & Waters                      [Page 3]
  171.  
  172. RFC 1592                        SNMP-DPI                      March 1994
  173.  
  174.  
  175.    Nevertheless, questions continue to be raised about sub-agent support
  176.    (both in SNMP and SNMP2 mail lists) in spite of both SNMPv2 [8] being
  177.    on the standard's track and SMUX being changed to a historic RFC.
  178.    Furthermore, within IBM and BNR we continue to see a substantial and
  179.    expanding use of the DPI protocol.  with positive results.
  180.  
  181.    Therefore, we believe that there is a place for a sub-agent protocol
  182.    and we again offer this new version as an experimental protocol.  We
  183.    encourage people to try it and send us feedback.  Depending on that
  184.    feedback, we may decide to try to get onto the standards track at a
  185.    later time.
  186.  
  187.    During discussions about sub-agent interfaces at the San Diego BOF it
  188.    also became clear that we should reduce the focus on the API for the
  189.    sub-agent programmers.  This RFC, therefore, specifies only the
  190.    protocol to distribute SNMP requests from the main SNMP agent to the
  191.    sub-agents.  Programmers can build one or more Programming APIs on
  192.    top of that protocol as needed, and sample API code is available from
  193.    the authors of this document.
  194.  
  195. 1.2  SUMMARY OF CHANGES
  196.  
  197.    The following changes have been made since the initial definition of
  198.    SNMP-DPI [7].  Some of these resulted from comparing the SMUX [6] and
  199.    DPI [7] protocols.
  200.  
  201.      o   Documentation changes to cleanup and be more specific in some
  202.          areas.  Among other things, this includes:
  203.  
  204.          -   Defining that integers are in network byte order
  205.          -   Defining the character set used for strings
  206.          -   Defining how DisplayStrings are handled.
  207.          -   Including DPI20 MIB definition.
  208.  
  209.      o   Removal of the Programming API from the document.
  210.  
  211.      o   Addition of new DPI packet types:
  212.  
  213.          -   SNMP_DPI_OPEN for a sub-agent to open a "connection" with
  214.              the DPI SNMP capable agent.  The sub-agent must now
  215.              identify itself and optionally provide a "password" for the
  216.              connection.
  217.          -   SNMP_DPI_CLOSE for the agent or sub-agent to close the
  218.              connection in a graceful way.
  219.          -   SNMP_DPI_ARE_YOU_THERE for the sub-agent to verify that the
  220.              agent still knows about the sub-agent.
  221.          -   SNMP_DPI_UNREGISTER for the agent or sub-agent to terminate
  222.              the registration of a MIB variable or MIB sub-tree.
  223.  
  224.  
  225.  
  226. Wijnen, Carpenter, Curran, Sehgal & Waters                      [Page 4]
  227.  
  228. RFC 1592                        SNMP-DPI                      March 1994
  229.  
  230.  
  231.          -   SNMP_DPI_COMMIT which instructs the sub-agent to actually
  232.              commit a previous SNMP_DPI_SET request.  This, together
  233.              with the UNDO, allows DPI sub-agents to be compliant with
  234.              SNMP in the sense that we can now handle the "as if
  235.              simultaneous" requirement.
  236.          -   SNMP_DPI_UNDO which instructs the sub-agent to UNDO a SET
  237.              or COMMIT if such is needed.
  238.  
  239.      o   Changes to DPI packets:
  240.  
  241.          -   Multiple varBinds can now be exchanged in one DPI packet
  242.              (for GET, GETNEXT, SET, TRAP).  The sub-agent can specify
  243.              the maximum it wants to handle per packet.
  244.          -   The packet headers now contain a packet-ID (similar to SNMP
  245.              request ID in SNMP PDU).  This allows to match RESPONSE
  246.              packets to REQUESTS, which is important for UDP based
  247.              DPI-connections.
  248.          -   The SNMP_DPI_REGISTER packet has new fields for time_out
  249.              and for requested priority.
  250.          -   The SNMP_DPI_TRAP packet allows to specify an enterprise
  251.              OID.  In addition, the generic and specific trap types are
  252.              now 4 octets, so that we can pass the types correctly.
  253.          -   In general, the packets have a more consistent layout.
  254.  
  255.      o   The agent now sends a RESPONSE to a REGISTER request
  256.  
  257.      o   Addition of SNMPv2 error codes and value types.
  258.  
  259. 2.  THEORY OF OPERATION
  260.  
  261. 2.1  CONNECTION ESTABLISHMENT AND TERMINATION
  262.  
  263.    Communication between the SNMP Agent and its clients (sub-agents)
  264.    takes place via a communication mechanism.  The communication type
  265.    can be either a logical stream connection (via TCP, for instance) or
  266.    an unreliable datagram connection (UDP, for instance).  It should be
  267.    noted that other stream oriented transport communication mechanisms
  268.    can also be used.  For example, the VM SNMP agent allows DPI
  269.    connections over IUCV (Inter-User Communications Vehicle) [9, 10].
  270.    Other than the connection establishment procedure, the protocol used
  271.    is identical in these environments.
  272.  
  273.    In Unix the number of processes is limited by the number of file-
  274.    descriptors that can be opened.  Since each TCP socket represents a
  275.    file-descriptor, restricting SNMP-DPI protocol to TCP only
  276.    connections would limit the number of sub-agents an agent could
  277.    support.  As a result, the some SNMP-DPI agents support both TCP and
  278.    UDP socket type communication mechanisms for the SNMP-DPI protocol.
  279.  
  280.  
  281.  
  282. Wijnen, Carpenter, Curran, Sehgal & Waters                      [Page 5]
  283.  
  284. RFC 1592                        SNMP-DPI                      March 1994
  285.  
  286.  
  287.    Please note that in the following portion of this text the SNMP-DPI
  288.    agent is referred simply as the agent.
  289.  
  290.    Once the transport connection has been set up, the sub-agent must
  291.    also initialize the logical connection with the agent.  To do so it
  292.    issues an OPEN request to the agent in which the sub-agent uniquely
  293.    identifies itself and passes some other parameters to the agent, such
  294.    as, the maximum number of varBinds per interaction it is prepared to
  295.    handle, and the timeout the agent should use when waiting for a
  296.    response from the sub-agent.
  297.  
  298.    When the sub-agent prepares to stop or cease operations, it first
  299.    issues a CLOSE to shut down the logical connection with the agent,
  300.    and then closes the transport connection.
  301.  
  302. 2.2  REGISTRATION
  303.  
  304.    A sub-agent supports a collection of MIB variables or object
  305.    identifiers (object IDs) that constitute its MIB (sub)tree.  Each of
  306.    these object IDs consists of a group ID and an instance ID.  The
  307.    group ID is the root of the sub-agent's MIB tree that it supports and
  308.    the point of registration to the agent's MIB tree.  The instance ID
  309.    is the piece of the Object Identifier that follows the group ID
  310.    (registration point), so it is not an instance in the terms of the
  311.    SNMP definition of an instance.
  312.  
  313.    Regardless of the transport mechanism used, after establishing a
  314.    connection to the agent, the sub-agent registers a branch (group ID)
  315.    to the Agent's MIB tree.  With the registration request, the sub-
  316.    agent passes some parameters, such as, requested priority and a
  317.    timeout value for this specific sub-tree.
  318.  
  319.    The agent sends back a response to indicate success or failure of the
  320.    registration request.
  321.  
  322. 2.3  NORMAL OPERATION
  323.  
  324.    Once the sub-agent has set up both the physical and logical
  325.    connection to the agent, and once it has successfully registered the
  326.    sub-tree(s) of the MIB(s) that it supports, it waits for requests
  327.    from the SNMP agent or generates traps as required.
  328.  
  329. 2.4  DPI ARCHITECTURE
  330.  
  331.    These are the requests that can be initiated by the SNMP agent:
  332.  
  333.        GET, GETNEXT, GETBULK, SET, COMMIT, UNDO, UNREGISTER, and CLOSE.
  334.  
  335.  
  336.  
  337.  
  338. Wijnen, Carpenter, Curran, Sehgal & Waters                      [Page 6]
  339.  
  340. RFC 1592                        SNMP-DPI                      March 1994
  341.  
  342.  
  343.    The first four of these correspond directly to SNMP requests that a
  344.    network management station can make (By default a GETBULK request
  345.    will be translated into multiple GETNEXT requests by the agent, but a
  346.    sub-agent may request that the GETBULK be passed to it).  The COMMIT,
  347.    UNDO, UNREGISTER, ARE_YOU_THERE and CLOSE requests are specific
  348.    SNMP-DPI requests.  The sub-agent normally responds to a request with
  349.    a RESPONSE packet.  The CLOSE request is an exception for which the
  350.    sub-agent only closes the physical connection.
  351.  
  352.    These are the requests that can be initiated by a sub-agent:
  353.  
  354.        OPEN, REGISTER, TRAP, UNREGISTER, ARE_YOU_THERE and CLOSE.
  355.  
  356.    The agent responds to OPEN, REGISTER, UNREGISTER and ARE_YOU_THERE
  357.    with a RESPONSE packet.  The TRAP packet is just accepted and
  358.    forwarded by the agent without returning any information to the sub-
  359.    agent.  The CLOSE packet is also just accepted by the agent upon
  360.    which it closes the physical connection.
  361.  
  362.    See Figure 1 for an overview of the DPI packet flow.
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394. Wijnen, Carpenter, Curran, Sehgal & Waters                      [Page 7]
  395.  
  396. RFC 1592                        SNMP-DPI                      March 1994
  397.  
  398.  
  399.      -------------------------------------------------------------------
  400.  
  401.      *---------------------------------*
  402.      |                                 |
  403.      |  SNMP Network                   |
  404.      |  Management Station             |
  405.      |                                 |
  406.      |---------------------------------|
  407.      |  SNMP Protocol                  |
  408.      *---------------------------------*
  409.            A      | Get         A
  410.            |      | GetNext     |  GetResponse
  411.       Trap |      | GetBulk     |
  412.            |      | Set         |
  413.            |      V             |
  414.      *------------------------------*             *-------------------*
  415.      |     SNMP Protocol            |             |   DPI Interface   |
  416.      |------------------------------|  Response   |    *--------------|
  417.      |                       |      |<----------->|    |              |
  418.      |                       |      |             |    |              |
  419.      |    SNMP Agent         |      |             |    |              |
  420.      |                       |      | Get,GetNext |    |              |
  421.      |                       |      | (GetBulk)   |    |   Client     |
  422.      |                       |      | Set,Commit  |    |              |
  423.      |     A     *-----------+->    |  Undo       |    |              |
  424.      |     |     | Get/Set   |      |------------>|    |     or       |
  425.      | Trap|     | info      |      |             |    |              |
  426.      |     |     |           | SNMP |             |    |              |
  427.      |-----+-----+-------*   |      |  trap       |    |   SNMP       |
  428.      |     |     V       |   | DPI  |<------------|    |   Sub-Agent  |
  429.      |                   |   |      |             |    |              |
  430.      | Statically Linked |   |      |             |    |              |
  431.      | Instrumentation   |   |      |             |    |              |
  432.      |   (like MIB II)   |   |      |             |    |              |
  433.      |                   |   |      |   close     |    |              |
  434.      |       A           |   |      | unregister  |    |              |
  435.      |-------+-----------|   |      |<----------->|    |              |
  436.      |       V           |   |      |             |    |              |
  437.      |                   |   |      |             |    |              |
  438.      |                   |   |      | AreYouThere |    |              |
  439.      | TCP/IP layers     |   |      |    open     |    |              |
  440.      | Kernel            |   |      |  register   |    |              |
  441.      |                   |   |      |<------------|    |              |
  442.      *------------------------------*             *-------------------*
  443.  
  444.      -------------------------------------------------------------------
  445.      Figure 1. SNMP DPI overview
  446.  
  447.  
  448.  
  449.  
  450. Wijnen, Carpenter, Curran, Sehgal & Waters                      [Page 8]
  451.  
  452. RFC 1592                        SNMP-DPI                      March 1994
  453.  
  454.  
  455.      Remarks for Figure 1:
  456.  
  457.      o   The SNMP agent communicates with the SNMP manager via the
  458.          standard SNMP protocol.
  459.      o   The SNMP agent communicates with some statically linked-in
  460.          instrumentation (potentially for the MIB II), which in turn
  461.          talks to the TCP/IP layers and kernel (operating system) in an
  462.          implementation-dependent manner.
  463.      o   An SNMP sub-agent, running as a separate process (potentially
  464.          on another machine), can set up a connection with the agent.
  465.          The sub-agent has an option to communicate with the SNMP agent
  466.          through UDP or TCP sockets, or even through other mechanisms.
  467.      o   Once the connection is established, the sub-agent issues a DPI
  468.          OPEN and one or more REGISTER requests to register one or more
  469.          MIB sub-trees with the SNMP agent.
  470.      o   The SNMP agent responds to DPI OPEN and REGISTER requests with
  471.          a RESPONSE packet, indicating success or failure.
  472.      o   The SNMP agent will decode SNMP packets.
  473.          If such a packet contains a Get or GetNext request for an
  474.          object in a sub-tree registered by a sub-agent, it sends a
  475.          corresponding DPI packet to the sub-agent.
  476.          If the request is for a GetBulk, then the agent translates it
  477.          into multiple DPI GETNEXT packets and sends those to the
  478.          sub-agent.  However, the sub-agent can request (in the REGISTER
  479.          packet) that a GETBULK be passed to the sub-agent.
  480.          If the request is for a Set, then the agent uses a 2-phase
  481.          commit scheme and sends the sub-agent a sequence of SET/COMMIT,
  482.          SET/UNDO or SET/COMMIT/UNDO DPI packets.
  483.      o   The SNMP sub-agent sends responses back via a RESPONSE packet.
  484.      o   The SNMP agent then encodes the reply into an SNMP packet and
  485.          sends it back to the requesting SNMP manager.
  486.      o   If the sub-agent wants to report an important state change, it
  487.          sends a DPI TRAP packet to the SNMP agent which will encode it
  488.          into an SNMP trap packet and send it to the manager(s).
  489.      o   If the sub-agent wants to stop operations, it sends a DPI
  490.          UNREGISTER and a DPI CLOSE packet to the agent.  The agent
  491.          sends a response to an UNREGISTER request.
  492.      o   There is no RESPONSE to a CLOSE, the agent just closes the DPI
  493.          connection.  A CLOSE implies an UNREGISTER for all
  494.          registrations that exist for the DPI connection being CLOSED.
  495.      o   An agent can send DPI UNREGISTER (if a higher priority
  496.          registration comes in or for other reasons) to the sub-agent,
  497.          the sub-agent then responds with a DPI RESPONSE packet.
  498.      o   An agent can also (for whatever reason) send a DPI CLOSE to
  499.          indicate it is terminating the DPI connection.
  500.      o   A sub-agent can send an ARE_YOU_THERE to verify that the
  501.          "connection" is still open. If so, the agent sends a RESPONSE
  502.          with no error, otherwise, it may send a RESPONSE with an error
  503.  
  504.  
  505.  
  506. Wijnen, Carpenter, Curran, Sehgal & Waters                      [Page 9]
  507.  
  508. RFC 1592                        SNMP-DPI                      March 1994
  509.  
  510.  
  511.          indication, or not react at all.
  512.  
  513. 3.  SNMP DPI PROTOCOL
  514.  
  515.    This section describes the actual protocol used between the SNMP
  516.    agent and sub-agents.
  517.  
  518. 3.1  CONNECTION ESTABLISHMENT
  519.  
  520.    In a TCP/IP environment, the SNMP agent listens on an arbitrary
  521.    TCP/UDP port for a connection request from a sub-agent.  It is
  522.    important to realize that a well-known port is not used: every
  523.    invocation of the SNMP agent will potentially result in a different
  524.    TCP/UDP port being used.
  525.  
  526.    A sub-agent needs to determine this port number to establish a
  527.    connection.  The sub-agent learns the port number from the agent by
  528.    sending it one conventional SNMP get-request PDU.  The port numbers
  529.    are maintained by the SNMP agent as the objects whose identifiers
  530.    are:
  531.  
  532.         1.3.6.1.4.1.2.2.1.1.0    dpiPort.0       (old DPI 1.x form)
  533.         1.3.6.1.4.1.2.2.1.1.1.0  dpiPortForTCP.0
  534.         1.3.6.1.4.1.2.2.1.1.2.0  dpiPortForUDP.0
  535.  
  536.    These variables are registered under the IBM enterprise-specific
  537.    tree.  See 4, "DPI 2.0 MIB definition" for more information.  The
  538.    SNMP agent replies with a conventional SNMP response PDU that
  539.    contains the port number to be used.  This response is examined by
  540.    the sub-agent and the port number is extracted.  The sub-agent then
  541.    establishes the connection to the specified port.
  542.  
  543.    On the surface, this procedure appears to mean that the sub-agent
  544.    must be able to create and parse SNMP packets, but this is not the
  545.    case.  A DPI Application Programming Interface (API) normally
  546.    provides a library routine, query_DPI_port(), which can be used to
  547.    generate and parse the required SNMP packets.  This very small
  548.    routine (under 100 lines of C), does not greatly increase the size of
  549.    any sub-agent.
  550.  
  551.    NOTE: Since this RFC does not define an API, the actual code of and
  552.    interface to a query_DPI_port() type of function depends on the
  553.    implementation.
  554.  
  555.    For completeness, byte-by-byte descriptions of the packets to be
  556.    generated by an SNMP DPI API routine query_DPI_port() are provided
  557.    below.  This is probably of little interest to most readers and
  558.    reading the source of a query_DPI_port() function provides much of
  559.  
  560.  
  561.  
  562. Wijnen, Carpenter, Curran, Sehgal & Waters                     [Page 10]
  563.  
  564. RFC 1592                        SNMP-DPI                      March 1994
  565.  
  566.  
  567.    the same information.
  568.  
  569. 3.1.1  SNMP PDU TO GET THE AGENT'S DPI PORT
  570.  
  571.    As noted, before a TCP/UDP connection to the SNMP agent can be made,
  572.    the sub-agent must learn which port that the agent is listening on.
  573.    To do so, it can issue an SNMP GET for the variable dpiPortForTCP.0
  574.    (1.3.6.1.4.1.2.2.1.1.1.0) or variable dpiPortForUDP.0
  575.    (1.3.6.1.4.1.2.2.1.1.2.0).
  576.  
  577.    The SNMP PDU can be constructed as shown below.  This PDU must be
  578.    sent to UDP port 161 on the host where the agent runs (probably the
  579.    same host where the sub-agent runs).
  580.  
  581.    The (SNMPv1) packet shown below is for the TCP port.
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.  
  602.  
  603.  
  604.  
  605.  
  606.  
  607.  
  608.  
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618. Wijnen, Carpenter, Curran, Sehgal & Waters                     [Page 11]
  619.  
  620. RFC 1592                        SNMP-DPI                      March 1994
  621.  
  622.  
  623.      +-----------------------------------------------------------------+
  624.      | Table 1 (Page 1 of 2). SNMP GET PDU for dpiPortForTCP.0         |
  625.      +---------------+----------------+--------------------------------+
  626.      | OFFSET        | VALUE          | FIELD                          |
  627.      +---------------+----------------+--------------------------------+
  628.      | 0             | 0x30           | ASN.1 header                   |
  629.      +---------------+----------------+--------------------------------+
  630.      | 1             | 37 + len       | PDU_length, see formula below  |
  631.      +---------------+----------------+--------------------------------+
  632.      | 2             | 0x02 0x01 0x00 | SNMP version:                  |
  633.      |               |                | (integer,length=1,value=0)     |
  634.      +---------------+----------------+--------------------------------+
  635.      | 5             | 0x04           | community name (string)        |
  636.      +---------------+----------------+--------------------------------+
  637.      | 6             | len            | length of community name       |
  638.      +---------------+----------------+--------------------------------+
  639.      | 7             | community name | varies                         |
  640.      +---------------+----------------+--------------------------------+
  641.      | 7 + len       | 0xa0 0x1c      | SNMP GET request:              |
  642.      |               |                | request_type=0xa0,length=0x1c  |
  643.      +---------------+----------------+--------------------------------+
  644.      | 7 + len + 2   | 0x02 0x01 0x01 | SNMP request ID:               |
  645.      |               |                | integer,length=1,ID=1          |
  646.      +---------------+----------------+--------------------------------+
  647.      | 7 + len + 5   | 0x02 0x01 0x00 | SNMP error status:             |
  648.      |               |                | integer,length=1,error=0       |
  649.      +---------------+----------------+--------------------------------+
  650.      | 7 + len + 8   | 0x02 0x01 0x00 | SNMP index:                    |
  651.      |               |                | integer,length=1,index=0       |
  652.      +---------------+----------------+--------------------------------+
  653.      | 7 + len + 11  | 0x30 0x11      | varBind list, length=0x11      |
  654.      +---------------+----------------+--------------------------------+
  655.      | 7 + len + 13  | 0x30 0x0f      | varBind, length=0x0f           |
  656.      +---------------+----------------+--------------------------------+
  657.      | 7 + len + 15  | 0x06 0x0b      | Object ID, length=0x0b         |
  658.      +---------------+----------------+--------------------------------+
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.  
  669.  
  670.  
  671.  
  672.  
  673.  
  674. Wijnen, Carpenter, Curran, Sehgal & Waters                     [Page 12]
  675.  
  676. RFC 1592                        SNMP-DPI                      March 1994
  677.  
  678.  
  679.      +-----------------------------------------------------------------+
  680.      | Table 1 (Page 2 of 2). SNMP GET PDU for dpiPortForTCP.0         |
  681.      +---------------+----------------+--------------------------------+
  682.      | OFFSET        | VALUE          | FIELD                          |
  683.      +---------------+----------------+--------------------------------+
  684.      | 7 + len + 17  | 0x2b 0x06 0x01 | Object-ID:                     |
  685.      |               | 0x04 0x01 0x02 | 1.3.6.1.4.1.2.2.1.1.1          |
  686.      |               | 0x02 0x01 0x01 | Object-instance: 0             |
  687.      |               | 0x01 0x00      |                                |
  688.      +---------------+----------------+--------------------------------+
  689.      | 7 + len + 28  | 0x05 0x00      | null value, length=0           |
  690.      +---------------+----------------+--------------------------------+
  691.      | NOTE:  Formula to calculate "PDU_length":                       |
  692.      |                                                                 |
  693.      |   PDU_length =  length of version field and string tag (4 bytes)|
  694.      |              +  length of community length field (1 byte)       |
  695.      |              +  length of community name (depends...)           |
  696.      |              +  length of SNMP GET request (32 bytes)           |
  697.      |                                                                 |
  698.      |              =  37 + length of community name                   |
  699.      +-----------------------------------------------------------------+
  700.  
  701. 3.1.2  SNMP PDU CONTAINING THE RESPONSE TO THE GET
  702.  
  703.    Assuming that no errors occurred, the port is returned in the last
  704.    few octets of the received packet.  In the simple case, where the
  705.    port number will be between 1024 and 16,385, the format of the packet
  706.    is shown below.
  707.  
  708.    Note: In practice, the port number can be any positive number in the
  709.    range from 1 through 65,535.  A port number of 0 means that the agent
  710.    does not have a dpiPort defined for the requested protocol.  So the
  711.    actual port value maybe in the last 1, 2 or 3 octets.  The sample
  712.    implementation code shows how to handle the response to cover all
  713.    those cases, including error conditions.
  714.  
  715.    Note: The (SNMPv1) packet shown below is for the TCP port.
  716.  
  717.      +-----------------------------------------------------------------+
  718.      | Table 2 (Page 1 of 3). SNMP RESPONSE PDU for dpiPortForTCP.0    |
  719.      +---------------+----------------+--------------------------------+
  720.      | OFFSET        | VALUE          | FIELD                          |
  721.      +---------------+----------------+--------------------------------+
  722.      | 0             | 0x30           | ASN.1 header                   |
  723.      +---------------+----------------+--------------------------------+
  724.      | 1             | 39 + len       | length, see formula below      |
  725.      +---------------+----------------+--------------------------------+
  726.  
  727.  
  728.  
  729.  
  730. Wijnen, Carpenter, Curran, Sehgal & Waters                     [Page 13]
  731.  
  732. RFC 1592                        SNMP-DPI                      March 1994
  733.  
  734.  
  735.      +-----------------------------------------------------------------+
  736.      | Table 2 (Page 2 of 3). SNMP RESPONSE PDU for dpiPortForTCP.0    |
  737.      +---------------+----------------+--------------------------------+
  738.      | OFFSET        | VALUE          | FIELD                          |
  739.      +---------------+----------------+--------------------------------+
  740.      | 2             | 0x02 0x01 0x00 | version                        |
  741.      |               |                | (integer,length=1,value=0)     |
  742.      +---------------+----------------+--------------------------------+
  743.      | 5             | 0x04           | community name (string)        |
  744.      +---------------+----------------+--------------------------------+
  745.      | 6             | len            | length of community name       |
  746.      +---------------+----------------+--------------------------------+
  747.      | 7             | community name |                                |
  748.      +---------------+----------------+--------------------------------+
  749.      | 7 + len       | 0xa2 0x1e      | SNMP RESPONSE:                 |
  750.      |               |                | request_type=0xa2,length=0x1e  |
  751.      +---------------+----------------+--------------------------------+
  752.      | 7 + len + 2   | 0x02 0x01 0x01 | SNMP request ID:               |
  753.      |               |                | integer,length=1,ID=1          |
  754.      +---------------+----------------+--------------------------------+
  755.      | 7 + len + 5   | 0x02 0x01 0x00 | SNMP error status:             |
  756.      |               |                | integer,length=1,error=0       |
  757.      +---------------+----------------+--------------------------------+
  758.      | 7 + len + 8   | 0x02 0x01 0x00 | SNMP index:                    |
  759.      |               |                | integer,length=1,index=0       |
  760.      +---------------+----------------+--------------------------------+
  761.      | 7 + len + 11  | 0x30 0x13      | varBind list, length=0x13      |
  762.      +---------------+----------------+--------------------------------+
  763.      | 7 + len + 13  | 0x30 0x11      | varBind, length=0x11           |
  764.      +---------------+----------------+--------------------------------+
  765.      | 7 + len + 15  | 0x06 0x0b      | Object ID, length=0x0b         |
  766.      +---------------+----------------+--------------------------------+
  767.      | 7 + len + 17  | 0x2b 0x06 0x01 | Object-ID:                     |
  768.      |               | 0x04 0x01 0x02 | 1.3.6.1.4.1.2.2.1.1.1          |
  769.      |               | 0x02 0x01 0x01 | Object-instance: 0             |
  770.      |               | 0x01 0x00      |                                |
  771.      +---------------+----------------+--------------------------------+
  772.      | 7 + len + 28  | 0x02 0x02      | integer, length=2              |
  773.      +---------------+----------------+--------------------------------+
  774.      | 7 + len + 30  | MSB LSB        | port number (MSB, LSB)         |
  775.      +---------------+----------------+--------------------------------+
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786. Wijnen, Carpenter, Curran, Sehgal & Waters                     [Page 14]
  787.  
  788. RFC 1592                        SNMP-DPI                      March 1994
  789.  
  790.  
  791.      +-----------------------------------------------------------------+
  792.      | Table 2 (Page 3 of 3). SNMP RESPONSE PDU for dpiPortForTCP.0    |
  793.      +---------------+----------------+--------------------------------+
  794.      | NOTE:  Formula to calculate "PDU_length":                       |
  795.      |                                                                 |
  796.      |   PDU_length =  length of version field and string tag (4 bytes)|
  797.      |              +  length of community length field (1 byte)       |
  798.      |              +  length of community name (depends...)           |
  799.      |              +  length of SNMP RESPONSE (34 bytes)              |
  800.      |                                                                 |
  801.      |              =  39 + length of community name                   |
  802.      +-----------------------------------------------------------------+
  803.  
  804. 3.2  SNMP DPI PACKET FORMATS
  805.  
  806.    Each request to, or response from, the agent or sub-agent is
  807.    constructed as a "packet" and is written to the stream.
  808.  
  809.    Each packet is prefaced with the length of the data remaining in the
  810.    packet.  The length is stored in network byte order, the most
  811.    significant byte (MSB) first, least significant byte (LSB) last.  If
  812.    we consider a stream connection (like TCP), the receiving side will
  813.    read the packet by doing something similar to:
  814.  
  815.           unsigned char len_bfr[2];
  816.           unsigned char *bfr;
  817.           int len;
  818.  
  819.           read(fd,len_bfr,2);
  820.           len = len_bfr[0] * 256 + len_bfr[1];
  821.           bfr = malloc(len);
  822.           read(fd,bfr,len);
  823.  
  824.    Note: The above example makes no provisions for error handling or a
  825.    read returning less than the requested amount of data,and it is not
  826.    intended to be used literally.
  827.  
  828. 3.2.1  DPI PACKET HEADER
  829.  
  830.    The first part of every packet identifies the application protocol
  831.    being used as well as some version information.  The protocol major
  832.    version is intended to indicate, in broad terms, what version of the
  833.    protocol is used.  The protocol minor version is intended to identify
  834.    major incompatible versions of the protocol.  The protocol release is
  835.    intended to indicate incremental modifications to the protocol.  The
  836.    constants that are valid for these fields are defined in Table 15.
  837.  
  838.  
  839.  
  840.  
  841.  
  842. Wijnen, Carpenter, Curran, Sehgal & Waters                     [Page 15]
  843.  
  844. RFC 1592                        SNMP-DPI                      March 1994
  845.  
  846.  
  847.    The next field, present in all packets, is the packet ID.  It
  848.    contains packet identification that can help an agent or sub-agent
  849.    match responses with request.  This is useful with UDP connections
  850.    over which packets can be lost.  The packet ID is a monotonically
  851.    increasing unsigned 16-bit integer which wraps at its maximum value.
  852.  
  853.    The next field, present in all packets, is the packet type.  It
  854.    indicates what kind of packet we're dealing with (OPEN, REGISTER,
  855.    GET, GETNEXT, GETBULK, SET, COMMIT, UNDO, TRAP, RESPONSE, UNREGISTER,
  856.    or CLOSE).  The permitted values for this field are defined in Table
  857.    16.
  858.  
  859.      +-----------------------------------------------------------------+
  860.      | Table 3. SNMP DPI packet header.  Present in all packets.       |
  861.      +------------+----------------------------------------------------+
  862.      | OFFSET     | FIELD                                              |
  863.      +------------+----------------------------------------------------+
  864.      | 0          | packet length to follow (MSB to LSB)               |
  865.      +------------+----------------------------------------------------+
  866.      | 2          | protocol major version                             |
  867.      +------------+----------------------------------------------------+
  868.      | 3          | protocol minor version                             |
  869.      +------------+----------------------------------------------------+
  870.      | 4          | protocol release                                   |
  871.      +------------+----------------------------------------------------+
  872.      | 5          | packet id (MSB to LSB)                             |
  873.      +------------+----------------------------------------------------+
  874.      | 7          | packet type                                        |
  875.      +------------+----------------------------------------------------+
  876.  
  877.    From this point onwards, the contents of the packet are defined by
  878.    the protocol being used.  The remainder of this section describes:
  879.  
  880.      o   Layout of packets for the SNMP DPI protocol, version 2.0.
  881.  
  882.      o   Constants as defined with this version of the protocol.
  883.  
  884. 3.2.2  OPEN
  885.  
  886.    In order for a sub-agent to communicate with a DPI capable SNMP
  887.    agent, it must first send an SNMP DPI OPEN request to the agent to
  888.    setup the "connection" with that agent.
  889.  
  890.    Such a packet contains the standard SNMP DPI header plus OPEN
  891.    specific data.  This data consists of:
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898. Wijnen, Carpenter, Curran, Sehgal & Waters                     [Page 16]
  899.  
  900. RFC 1592                        SNMP-DPI                      March 1994
  901.  
  902.  
  903.      o   a timeout value (in seconds).
  904.          This is a requested timeout value to be used for all requests
  905.          for objects for which there is no timeout value specified for
  906.          the sub-tree under which the object is registered.  If you
  907.          specify a zero timeout value, then the agent will use its own
  908.          default timeout value.  If you want a larger value than the
  909.          default value, then you can specify it here. However, the agent
  910.          may have a maximum value that you can never exceed. If you do
  911.          ask for a larger timeout than that maximum, the agent will set
  912.          it at the maximum it accepts.
  913.      o   the maximum number of varBinds per DPI packet that the
  914.          sub-agent is prepared to handle.
  915.      o   Selected character set to be used for the representation of the
  916.          OBJECT ID strings and DisplayStrings.
  917.          The choices are the native character set (0) or the ASCII
  918.          character set (1).  See 3.3.5, "Character set selection"
  919.          for more information in character set selection.
  920.          An agent may choose to support only the native character set.
  921.      o   null terminated sub-agent ID, which is a unique ASN.1 OBJECT
  922.          identifier, so in dotted ASN.1 notation.  This string is
  923.          represented in the selected character set.
  924.      o   null terminated sub-agent description, which is a DisplayString
  925.          describing the sub-agent.  This string is represented in the
  926.          selected character set.  This may be the null-string if there
  927.          is no description.
  928.      o   optionally a password that the agent uses to validate the
  929.          sub-agent.  It depends on the agent implementation if a
  930.          password is required.  If no password is passed, the length
  931.          must be specified as zero.
  932.  
  933.    The sub-agent must expect a response indicating success or failure.
  934.    See Table 19 for the valid codes in a DPI RESPONSE to a DPI OPEN
  935.    request.
  936.  
  937.    If the error_code in the RESPONSE is not SNMP_ERROR_DPI_noError, then
  938.    the agent closes the connection.
  939.  
  940.  
  941.  
  942.  
  943.  
  944.  
  945.  
  946.  
  947.  
  948.  
  949.  
  950.  
  951.  
  952.  
  953.  
  954. Wijnen, Carpenter, Curran, Sehgal & Waters                     [Page 17]
  955.  
  956. RFC 1592                        SNMP-DPI                      March 1994
  957.  
  958.  
  959.      +-----------------------------------------------------------------+
  960.      | Table 4. Layout SNMP DPI OPEN packet                            |
  961.      +------------+----------------------------------------------------+
  962.      | OFFSET     | FIELD                                              |
  963.      +------------+----------------------------------------------------+
  964.      | 0          | packet length to follow (MSB to LSB)               |
  965.      +------------+----------------------------------------------------+
  966.      | 2          | protocol major version                             |
  967.      +------------+----------------------------------------------------+
  968.      | 3          | protocol minor version                             |
  969.      +------------+----------------------------------------------------+
  970.      | 4          | protocol release                                   |
  971.      +------------+----------------------------------------------------+
  972.      | 5          | packet id (MSB to LSB)                             |
  973.      +------------+----------------------------------------------------+
  974.      | 7          | packet type = SNMP_DPI_OPEN                        |
  975.      +------------+----------------------------------------------------+
  976.      | 8          | requested overall timeout (seconds, MSB to LSB)    |
  977.      +------------+----------------------------------------------------+
  978.      | 10         | max varBinds per DPI packet (MSB to LSB)           |
  979.      +------------+----------------------------------------------------+
  980.      | 12         | Selected character set (0=Native, 1=ASCII)         |
  981.      +------------+----------------------------------------------------+
  982.      | 13         | null terminated sub-agent ID (OID)                 |
  983.      +------------+----------------------------------------------------+
  984.      | 13+L1      | null terminated sub-agent Description              |
  985.      +------------+----------------------------------------------------+
  986.      | 13+L2      | password length (zero if no password, MSB to LSB)  |
  987.      +------------+----------------------------------------------------+
  988.      | 15+L2      | password (if any)                                  |
  989.      +------------+----------------------------------------------------+
  990.      | NOTE:                                                           |
  991.      |                                                                 |
  992.      | o   L1 = strlen(sub-agent ID) + 1                               |
  993.      | o   L2 = L1 + strlen(sub-agent Description) + 1                 |
  994.      | o   OID and Description strings use selected character set      |
  995.      +-----------------------------------------------------------------+
  996.  
  997. 3.2.3  CLOSE
  998.  
  999.    In order for a sub-agent to close the "connection" with the DPI
  1000.    capable SNMP agent, it must send an SNMP DPI CLOSE request to the
  1001.    agent.  The agent will not send a response, but closes the physical
  1002.    connection and implicitly unregisters any sub-trees related to the
  1003.    connection.
  1004.  
  1005.    An agent may also send to the sub-agent an SNMP DPI CLOSE packet that
  1006.    contains the standard SNMP DPI header plus CLOSE specific data.  This
  1007.  
  1008.  
  1009.  
  1010. Wijnen, Carpenter, Curran, Sehgal & Waters                     [Page 18]
  1011.  
  1012. RFC 1592                        SNMP-DPI                      March 1994
  1013.  
  1014.  
  1015.    data consists of:
  1016.  
  1017.      o   a reason code for closing.  See Table 21 for a list
  1018.          of valid reason codes.
  1019.  
  1020.      +-----------------------------------------------------------------+
  1021.      | Table 5. Layout SNMP DPI CLOSE packet                           |
  1022.      +------------+----------------------------------------------------+
  1023.      | OFFSET     | FIELD                                              |
  1024.      +------------+----------------------------------------------------+
  1025.      | 0          | packet length to follow (MSB to LSB)               |
  1026.      +------------+----------------------------------------------------+
  1027.      | 2          | protocol major version                             |
  1028.      +------------+----------------------------------------------------+
  1029.      | 3          | protocol minor version                             |
  1030.      +------------+----------------------------------------------------+
  1031.      | 4          | protocol release                                   |
  1032.      +------------+----------------------------------------------------+
  1033.      | 5          | packet id (MSB to LSB)                             |
  1034.      +------------+----------------------------------------------------+
  1035.      | 7          | packet type = SNMP_DPI_CLOSE                       |
  1036.      +------------+----------------------------------------------------+
  1037.      | 8          | reason code (1 octet)                              |
  1038.      +------------+----------------------------------------------------+
  1039.  
  1040. 3.2.4  ARE_YOU_THERE
  1041.  
  1042.    An ARE_YOU_THERE packet allows a sub-agent to determine if it still
  1043.    has a DPI connection with the agent.  This packet is necessary
  1044.    because a sub-agent passively awaits requests from an agent and
  1045.    normally will not detect problems with an agent connection in a
  1046.    timely manner.  (In contrast, an agent becomes aware of any sub-agent
  1047.    connection problem in a timely manner because it sets a timeout when
  1048.    sending request).
  1049.  
  1050.    A sub-agent can send a SNMP DPI ARE_YOU_THERE packet to an agent
  1051.    which will then return a RESPONSE with a zero error code and a a zero
  1052.    error index if the connection is healthy.  Otherwise, the agent may
  1053.    return a RESPONSE with an error indication.  If the connection is
  1054.    broken, the sub-agent will see no response at all.
  1055.  
  1056.    An ARE_YOU_THERE packet contains the standard SNMP DPI header with no
  1057.    additional data.
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.  
  1064.  
  1065.  
  1066. Wijnen, Carpenter, Curran, Sehgal & Waters                     [Page 19]
  1067.  
  1068. RFC 1592                        SNMP-DPI                      March 1994
  1069.  
  1070.  
  1071.      +-----------------------------------------------------------------+
  1072.      | Table 6. Layout SNMP DPI ARE_YOU_THERE packet                   |
  1073.      +------------+----------------------------------------------------+
  1074.      | OFFSET     | FIELD                                              |
  1075.      +------------+----------------------------------------------------+
  1076.      | 0          | packet length to follow (MSB to LSB)               |
  1077.      +------------+----------------------------------------------------+
  1078.      | 2          | protocol major version                             |
  1079.      +------------+----------------------------------------------------+
  1080.      | 3          | protocol minor version                             |
  1081.      +------------+----------------------------------------------------+
  1082.      | 4          | protocol release                                   |
  1083.      +------------+----------------------------------------------------+
  1084.      | 5          | packet id (MSB to LSB)                             |
  1085.      +------------+----------------------------------------------------+
  1086.      | 7          | packet type = SNMP_DPI_ARE_YOU_THERE               |
  1087.      +------------+----------------------------------------------------+
  1088.  
  1089. 3.2.5  REGISTER
  1090.  
  1091.    In order to register a branch in the MIB tree, an SNMP sub-agent
  1092.    sends an SNMP DPI REGISTER packet to the agent.
  1093.  
  1094.    Such a packet contains the standard SNMP DPI header plus REGISTER
  1095.    specific data.  This data consists of:
  1096.  
  1097.      o   a requested priority.
  1098.          There are 2 special values, namely minus one (-1, requests best
  1099.          available priority) and zero (0, requests next better priority
  1100.          than the highest priority in use).  Any other value requests a
  1101.          specific priority or the next best priority if already in use).
  1102.          The lower the number, the better the priority.  An agent will
  1103.          send requests to only the one sub-agent that has registered
  1104.          with the best priority.  The agent returns the actual priority
  1105.          assigned in the RESPONSE packet in the error_index field.
  1106.      o   a requested timeout.
  1107.          If a zero value is specified, then the agent uses the timeout
  1108.          value specified in the DPI OPEN request.
  1109.          If you want a shorter or longer timeout value for this specific
  1110.          sub-tree, then you specify it here.  The agent has a maximum
  1111.          timeout it will allow in this field.  The agent will use this
  1112.          value (or its maximum) to await a response to requests for this
  1113.          sub-tree.
  1114.      o   an indication as to whether the sub-agent wishes to handle MIB
  1115.          view selection (SNMPv1 community string authentication)
  1116.          in subsequent GET, GETNEXT or SET, COMMIT, UNDO requests.  Not
  1117.          all DPI capable agents need to support this feature, but they
  1118.          must at least recognize this indication and give an appropriate
  1119.  
  1120.  
  1121.  
  1122. Wijnen, Carpenter, Curran, Sehgal & Waters                     [Page 20]
  1123.  
  1124. RFC 1592                        SNMP-DPI                      March 1994
  1125.  
  1126.  
  1127.          response if they do not support it.
  1128.      o   an indication as to whether the sub-agent wishes to handle the
  1129.          GETBULK itself.  If not, then the agent will translate a
  1130.          GETBULK into multiple GETNEXT requests.
  1131.          Not all DPI capable agents need to support this feature.  They
  1132.          may opt to always translate a GETBULK into multiple GETNEXT
  1133.          requests.  In this case the agent will send the appropriate
  1134.          RESPONSE to indicate this.
  1135.      o   the group ID (sub-tree) to be registered (with trailing dot).
  1136.          The group ID is represented in the selected character set as
  1137.          specified in DPI OPEN packet.
  1138.  
  1139.    The agent will respond with an SNMP DPI RESPONSE packet indicating
  1140.    registration error or success.  The packet ID of the response will be
  1141.    the same as that for the REGISTER request to which this is a
  1142.    response.
  1143.  
  1144.    The group ID will be the same as that specified in the REGISTER
  1145.    request.  There will be no instance returned (e.g. NULL string for
  1146.    instance ID).  The value will be an SNMP_TYPE_NULL value with a zero
  1147.    length.
  1148.  
  1149.  
  1150.  
  1151.  
  1152.  
  1153.  
  1154.  
  1155.  
  1156.  
  1157.  
  1158.  
  1159.  
  1160.  
  1161.  
  1162.  
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178. Wijnen, Carpenter, Curran, Sehgal & Waters                     [Page 21]
  1179.  
  1180. RFC 1592                        SNMP-DPI                      March 1994
  1181.  
  1182.  
  1183.      +-----------------------------------------------------------------+
  1184.      | Table 7. Layout SNMP DPI REGISTER packet                        |
  1185.      +------------+----------------------------------------------------+
  1186.      | OFFSET     | FIELD                                              |
  1187.      +------------+----------------------------------------------------+
  1188.      | 0          | packet length to follow (MSB to LSB)               |
  1189.      +------------+----------------------------------------------------+
  1190.      | 2          | protocol major version                             |
  1191.      +------------+----------------------------------------------------+
  1192.      | 3          | protocol minor version                             |
  1193.      +------------+----------------------------------------------------+
  1194.      | 4          | protocol release                                   |
  1195.      +------------+----------------------------------------------------+
  1196.      | 5          | packet id (MSB to LSB)                             |
  1197.      +------------+----------------------------------------------------+
  1198.      | 7          | packet type = SNMP_DPI_REGISTER                    |
  1199.      +------------+----------------------------------------------------+
  1200.      | 8          | requested priority (MSB to LSB)                    |
  1201.      +------------+----------------------------------------------------+
  1202.      | 12         | timeout in seconds (MSB to LSB)                    |
  1203.      +------------+----------------------------------------------------+
  1204.      | 14         | view selection (0 = you (agent) do, 1 = I do)      |
  1205.      +------------+----------------------------------------------------+
  1206.      | 15         | getbulk selection (0=use GetNext, 1=use GetBulk)   |
  1207.      +------------+----------------------------------------------------+
  1208.      | 16         | null terminated group ID (with trailing dot)       |
  1209.      +------------+----------------------------------------------------+
  1210.      | NOTE:                                                           |
  1211.      |                                                                 |
  1212.      | o   group ID string uses selected character set                 |
  1213.      +-----------------------------------------------------------------+
  1214.  
  1215. 3.2.6  UNREGISTER
  1216.  
  1217.    In order to unregister a branch in the MIB tree, an SNMP sub-agent
  1218.    sends an SNMP DPI UNREGISTER packet to the agent.
  1219.  
  1220.    Such a packet contains the standard SNMP DPI header plus UNREGISTER
  1221.    specific data: a null terminated string (represented in the selected
  1222.    character set) representing the group ID in ASN.1 dotted notation and
  1223.    an indication as to the reason for the unregister (see table 14).
  1224.  
  1225.    The agent will respond with an SNMP DPI RESPONSE packet indicating
  1226.    error or success.  The packet ID of the response will be the same as
  1227.    that for the UNREGISTER request to which this is a response.
  1228.  
  1229.    The group ID will be the same as that specified in the UNREGISTER
  1230.    request.  There will be no instance returned (e.g. NULL string for
  1231.  
  1232.  
  1233.  
  1234. Wijnen, Carpenter, Curran, Sehgal & Waters                     [Page 22]
  1235.  
  1236. RFC 1592                        SNMP-DPI                      March 1994
  1237.  
  1238.  
  1239.    instance ID).  The value will be an SNMP_TYPE_NULL value with a zero
  1240.    length.
  1241.  
  1242.      +-----------------------------------------------------------------+
  1243.      | Table 8. Layout SNMP DPI UNREGISTER packet                      |
  1244.      +------------+----------------------------------------------------+
  1245.      | OFFSET     | FIELD                                              |
  1246.      +------------+----------------------------------------------------+
  1247.      | 0          | packet length to follow (MSB to LSB)               |
  1248.      +------------+----------------------------------------------------+
  1249.      | 2          | protocol major version                             |
  1250.      +------------+----------------------------------------------------+
  1251.      | 3          | protocol minor version                             |
  1252.      +------------+----------------------------------------------------+
  1253.      | 4          | protocol release                                   |
  1254.      +------------+----------------------------------------------------+
  1255.      | 5          | packet id (MSB to LSB)                             |
  1256.      +------------+----------------------------------------------------+
  1257.      | 7          | packet type = SNMP_DPI_UNREGISTER                  |
  1258.      +------------+----------------------------------------------------+
  1259.      | 8          | reason code                                        |
  1260.      +------------+----------------------------------------------------+
  1261.      | 9          | null terminated group ID (with trailing dot)       |
  1262.      +------------+----------------------------------------------------+
  1263.      | NOTE:                                                           |
  1264.      |                                                                 |
  1265.      | o   group ID string uses selected character set                 |
  1266.      +-----------------------------------------------------------------+
  1267.  
  1268. 3.2.7  GET
  1269.  
  1270.    When the SNMP agent receives a PDU containing an SNMP GET request for
  1271.    a variable that resides in a sub-tree registered by a sub-agent, it
  1272.    passes an SNMP DPI GET packet to the sub-agent.
  1273.  
  1274.    Such a packet contains the standard SNMP DPI header plus GET specific
  1275.    data:
  1276.  
  1277.      o   the community name used in the SNMP PDU.  The length is zero
  1278.          unless view handling was selected by the sub-agent.  The length
  1279.          is also zero if the SNMP PDU was not in SNMPv1 format.
  1280.      o   per varBind two null terminated strings (in the selected
  1281.          character set) representing the group and instance ID in ASN.1
  1282.          dotted notation.
  1283.  
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290. Wijnen, Carpenter, Curran, Sehgal & Waters                     [Page 23]
  1291.  
  1292. RFC 1592                        SNMP-DPI                      March 1994
  1293.  
  1294.  
  1295.      +-----------------------------------------------------------------+
  1296.      | Table 9. Layout SNMP DPI GET packet                             |
  1297.      +------------+----------------------------------------------------+
  1298.      | OFFSET     | FIELD                                              |
  1299.      +------------+----------------------------------------------------+
  1300.      | 0          | packet length to follow (MSB to LSB)               |
  1301.      +------------+----------------------------------------------------+
  1302.      | 2          | protocol major version                             |
  1303.      +------------+----------------------------------------------------+
  1304.      | 3          | protocol minor version                             |
  1305.      +------------+----------------------------------------------------+
  1306.      | 4          | protocol release                                   |
  1307.      +------------+----------------------------------------------------+
  1308.      | 5          | packet id (MSB to LSB)                             |
  1309.      +------------+----------------------------------------------------+
  1310.      | 7          | packet type = SNMP_DPI_GET                         |
  1311.      +------------+----------------------------------------------------+
  1312.      | 8          | community name length (MSB to LSB)                 |
  1313.      +------------+----------------------------------------------------+
  1314.      | 10         | community name (if any)                            |
  1315.      +------------+----------------------------------------------------+
  1316.      | 10+L1      | null terminated group ID (with trailing dot)       |
  1317.      +------------+----------------------------------------------------+
  1318.      | 10+L2      | null terminated instance ID (no trailing dot)      |
  1319.      +------------+----------------------------------------------------+
  1320.      | 10+L3      | optionally more varBinds (group/instance ID pairs) |
  1321.      +------------+----------------------------------------------------+
  1322.      | NOTE:                                                           |
  1323.      |                                                                 |
  1324.      | o   L1 = length of community name                               |
  1325.      | o   L2 = L1 +  strlen(group ID) + 1                             |
  1326.      | o   L3 = L2 +  strlen(instance ID) + 1                          |
  1327.      | o   group and instance ID strings use selected character set    |
  1328.      +-----------------------------------------------------------------+
  1329.  
  1330. 3.2.8  GETNEXT
  1331.  
  1332.    When the SNMP agent receives a PDU containing an SNMP GETNEXT request
  1333.    for a variable for which a sub-agent may be authoritative, it passes
  1334.    an SNMP DPI GETNEXT packet to the sub-agent.
  1335.  
  1336.    Such a packet contains the standard SNMP DPI header plus GETNEXT
  1337.    specific data:
  1338.  
  1339.      o   the community name used in the SNMP PDU.  The length is zero
  1340.          unless view handling was selected by the sub-agent.  The length
  1341.          is also zero if the SNMP PDU was not in SNMPv1 format.
  1342.      o   per varBind two null terminated strings (in the selected
  1343.  
  1344.  
  1345.  
  1346. Wijnen, Carpenter, Curran, Sehgal & Waters                     [Page 24]
  1347.  
  1348. RFC 1592                        SNMP-DPI                      March 1994
  1349.  
  1350.  
  1351.          character set) representing the group and instance ID in ASN.1
  1352.          dotted notation.
  1353.  
  1354.      +-----------------------------------------------------------------+
  1355.      | Table 10. Layout SNMP DPI GETNEXT packet                        |
  1356.      +------------+----------------------------------------------------+
  1357.      | OFFSET     | FIELD                                              |
  1358.      +------------+----------------------------------------------------+
  1359.      | 0          | packet length to follow (MSB to LSB)               |
  1360.      +------------+----------------------------------------------------+
  1361.      | 2          | protocol major version                             |
  1362.      +------------+----------------------------------------------------+
  1363.      | 3          | protocol minor version                             |
  1364.      +------------+----------------------------------------------------+
  1365.      | 4          | protocol release                                   |
  1366.      +------------+----------------------------------------------------+
  1367.      | 5          | packet id (MSB to LSB)                             |
  1368.      +------------+----------------------------------------------------+
  1369.      | 7          | packet type = SNMP_DPI_GETNEXT                     |
  1370.      +------------+----------------------------------------------------+
  1371.      | 8          | community name length (MSB to LSB)                 |
  1372.      +------------+----------------------------------------------------+
  1373.      | 10         | community name                                     |
  1374.      +------------+----------------------------------------------------+
  1375.      | 10+L1      | null terminated group ID (with trailing dot)       |
  1376.      +------------+----------------------------------------------------+
  1377.      | 10+L2      | null terminated instance ID (no trailing dot)      |
  1378.      +------------+----------------------------------------------------+
  1379.      | 10+L3      | optionally more varBinds (group/instance ID pairs) |
  1380.      +------------+----------------------------------------------------+
  1381.      | NOTE:                                                           |
  1382.      |                                                                 |
  1383.      | o   L1 = length of community name                               |
  1384.      | o   L2 = L1 +  strlen(group ID) + 1                             |
  1385.      | o   L3 = L2 +  strlen(instance ID) + 1                          |
  1386.      | o   group and instance ID strings use selected character set    |
  1387.      +-----------------------------------------------------------------+
  1388.  
  1389. 3.2.9  GETBULK
  1390.  
  1391.    When the SNMP agent receives a PDU containing an SNMP GETBULK request
  1392.    that includes variables for which a sub-agent may be authoritative,
  1393.    it checks if the sub-agent wants to handle the GETBULK itself (as
  1394.    specified at registration time).  If so, it sends an SNMP DPI GETBULK
  1395.    packet to the sub-agent.
  1396.  
  1397.    Such a packet contains the standard SNMP DPI header plus GETBULK
  1398.    specific data:
  1399.  
  1400.  
  1401.  
  1402. Wijnen, Carpenter, Curran, Sehgal & Waters                     [Page 25]
  1403.  
  1404. RFC 1592                        SNMP-DPI                      March 1994
  1405.  
  1406.  
  1407.      o   non-repeaters
  1408.      o   max repetitions
  1409.      o   per varBind two null terminated strings (in the selected
  1410.          character set) representing the group and instance ID in ASN.1
  1411.          dotted notation.
  1412.  
  1413.      +-----------------------------------------------------------------+
  1414.      | Table 11. Layout SNMP DPI GETBULK packet                        |
  1415.      +------------+----------------------------------------------------+
  1416.      | OFFSET     | FIELD                                              |
  1417.      +------------+----------------------------------------------------+
  1418.      | 0          | packet length to follow (MSB to LSB)               |
  1419.      +------------+----------------------------------------------------+
  1420.      | 2          | protocol major version                             |
  1421.      +------------+----------------------------------------------------+
  1422.      | 3          | protocol minor version                             |
  1423.      +------------+----------------------------------------------------+
  1424.      | 4          | protocol release                                   |
  1425.      +------------+----------------------------------------------------+
  1426.      | 5          | packet id (MSB to LSB)                             |
  1427.      +------------+----------------------------------------------------+
  1428.      | 7          | packet type = SNMP_DPI_GETBULK                     |
  1429.      +------------+----------------------------------------------------+
  1430.      | 8          | non-repeaters (4 octets, MSB to LSB)               |
  1431.      +------------+----------------------------------------------------+
  1432.      | 12         | max-repetitions (4 octets, MSB to LSB)             |
  1433.      +------------+----------------------------------------------------+
  1434.      | 16         | null terminated group ID (with trailing dot)       |
  1435.      +------------+----------------------------------------------------+
  1436.      | 16+L1      | null terminated instance ID (no trailing dot)      |
  1437.      +------------+----------------------------------------------------+
  1438.      | 16+L2      | optionally more varBinds (group/instance ID pairs) |
  1439.      +------------+----------------------------------------------------+
  1440.      | NOTE:                                                           |
  1441.      |                                                                 |
  1442.      | o   L1 = strlen(group ID) + 1                                   |
  1443.      | o   L2 = L1 +  strlen(instance ID) + 1                          |
  1444.      | o   group and instance ID strings use selected character set    |
  1445.      +-----------------------------------------------------------------+
  1446.  
  1447. 3.2.10  SET, COMMIT AND UNDO
  1448.  
  1449.    When the SNMP agent receives a PDU containing an SNMP SET request for
  1450.    a variable that is in a sub-tree registered by a sub-agent, it passes
  1451.    one of 3 sequences of SNMP DPI packets to the sub-agent:
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458. Wijnen, Carpenter, Curran, Sehgal & Waters                     [Page 26]
  1459.  
  1460. RFC 1592                        SNMP-DPI                      March 1994
  1461.  
  1462.  
  1463.      o   SET, COMMIT
  1464.          This is the normal sequence.  The SET request is the first
  1465.          phase.  The sub-agent must verify that the SET request is valid
  1466.          and that the resources needed are available.  The COMMIT
  1467.          request comes next.  The sub-agent must now effectuate the SET
  1468.          request.
  1469.      o   SET, UNDO
  1470.          If an SNMP packet has a SET request for multiple varBinds that
  1471.          reside in different sub-trees, then the agent first sends a SET
  1472.          to all sub-agents.  If any sub-agent returns an error on the
  1473.          SET, then the agent sends UNDO to those sub-agents that
  1474.          returned no error on the SET, meaning the SET is being
  1475.          canceled.
  1476.      o   SET, COMMIT, UNDO
  1477.          In the very rare circumstance where all sub-agents have
  1478.          responded error-free to a SET and where one of them fails to
  1479.          perform the COMMIT, then the agent sends an UNDO to all
  1480.          involved sub-agents (also those who completed COMMIT).
  1481.          Sub-agents should try, to the best of their ability, to never
  1482.          let a commit fail and to undo an already committed set if asked
  1483.          to do so.
  1484.  
  1485.    Such packets contain the standard SNMP DPI header plus SET specific
  1486.    data:
  1487.  
  1488.      o   the community name used in the SNMP PDU.  The length is zero
  1489.          unless view handling was selected by the sub-agent.  The length
  1490.          is also zero if the SNMP PDU was not in SNMPv1 format.
  1491.      o   per varBind:
  1492.  
  1493.          -   two null terminated strings (in the selected character set)
  1494.              representing the group and instance ID in ASN.1 dotted
  1495.              notation.
  1496.          -   the type, value length and value to be set.
  1497.  
  1498.          The permitted types for the type field are defined in Table 17.
  1499.  
  1500.          See 3.3.4, "Value Representation" for information on how the
  1501.          value data is represented in the packet value field.
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514. Wijnen, Carpenter, Curran, Sehgal & Waters                     [Page 27]
  1515.  
  1516. RFC 1592                        SNMP-DPI                      March 1994
  1517.  
  1518.  
  1519.      +-----------------------------------------------------------------+
  1520.      | Table 12. Layout SNMP DPI SET, COMMIT, UNDO packet              |
  1521.      +------------+----------------------------------------------------+
  1522.      | OFFSET     | FIELD                                              |
  1523.      +------------+----------------------------------------------------+
  1524.      | 0          | packet length to follow (MSB to LSB)               |
  1525.      +------------+----------------------------------------------------+
  1526.      | 2          | protocol major version                             |
  1527.      +------------+----------------------------------------------------+
  1528.      | 3          | protocol minor version                             |
  1529.      +------------+----------------------------------------------------+
  1530.      | 4          | protocol release                                   |
  1531.      +------------+----------------------------------------------------+
  1532.      | 5          | packet id (MSB to LSB)                             |
  1533.      +------------+----------------------------------------------------+
  1534.      | 7          | packet type = SNMP_DPI_SET/COMMIT/UNDO             |
  1535.      +------------+----------------------------------------------------+
  1536.      | 8          | community name length (MSB to LSB)                 |
  1537.      +------------+----------------------------------------------------+
  1538.      | 10         | community name                                     |
  1539.      +------------+----------------------------------------------------+
  1540.      | 10+L1      | null terminated group ID (with trailing dot)       |
  1541.      +------------+----------------------------------------------------+
  1542.      | 10+L2      | null terminated instance ID (no trailing dot)      |
  1543.      +------------+----------------------------------------------------+
  1544.      | 10+L3      | SNMP Variable Type Value                           |
  1545.      +------------+----------------------------------------------------+
  1546.      | 10+L3+1    | Length of value (2 octets, MSB to LSB)             |
  1547.      +------------+----------------------------------------------------+
  1548.      | 10+L3+3    | Value                                              |
  1549.      +------------+----------------------------------------------------+
  1550.      | 10+L4      | optionally more varBinds (sequences of group ID,   |
  1551.      |            | instance ID, Type, Length and Value)               |
  1552.      +------------+----------------------------------------------------+
  1553.      | NOTE:                                                           |
  1554.      |                                                                 |
  1555.      | o   L1 = length of community name                               |
  1556.      | o   L2 = L1 + strlen(group ID) + 1                              |
  1557.      | o   L3 = L2 + strlen(instance ID) + 1                           |
  1558.      | o   L4 = L3 + 3 + length of value                               |
  1559.      | o   group and instance ID strings use selected character set    |
  1560.      | o   OID and DisplayString values use selected character set     |
  1561.      | o   Integer values are in network byte order                    |
  1562.      +-----------------------------------------------------------------+
  1563.  
  1564.  
  1565.  
  1566.  
  1567.  
  1568.  
  1569.  
  1570. Wijnen, Carpenter, Curran, Sehgal & Waters                     [Page 28]
  1571.  
  1572. RFC 1592                        SNMP-DPI                      March 1994
  1573.  
  1574.  
  1575. 3.2.11  RESPONSE
  1576.  
  1577.    An SNMP sub-agent must respond to a GET, GETNEXT, GETBULK, SET,
  1578.    COMMIT, UNDO or UNREGISTER request that it has received from the
  1579.    agent (unless it fails or has a bug ;-)).  To do so, it sends an SNMP
  1580.    DPI RESPONSE packet to the agent.
  1581.  
  1582.    Such a packet contains the standard SNMP DPI header plus RESPONSE
  1583.    specific data:
  1584.  
  1585.      o   an error_code,
  1586.      o   an error_index,
  1587.      o   plus for a successful GET, GETNEXT, or GETBULK, the
  1588.          name/type/length/value tuple(s) representing the returned
  1589.          object(s).  For each varBind this is described as:
  1590.  
  1591.          -   two null terminated strings (in the selected character set)
  1592.              representing the group and instance ID in ASN.1 dotted
  1593.              notation.
  1594.          -   the type, value length and value of the object that is
  1595.              returned.
  1596.  
  1597.          The permitted types for the type field are defined in Table 17.
  1598.  
  1599.          See 3.3.4, "Value Representation" for information on how the
  1600.          value data is represented in the packet value field.
  1601.  
  1602.    For an unsuccessful GET, GETNEXT or GETBULK, the sub-agent does not
  1603.    need to return any name/type/length/value tuple(s), because by
  1604.    definition, the varBind information is the same as in the request to
  1605.    which this is a response, and the agent still has that information.
  1606.  
  1607.    The group ID and the packet ID must always be the same as the
  1608.    corresponding fields in request PDU which has prompted the RESPONSE.
  1609.  
  1610.    If the response is to a SET, COMMIT or UNDO request, there is no need
  1611.    to return any varBind information, because by definition, the varBind
  1612.    information is the same as in the request to which this is a
  1613.    response, and the agent still has that information.
  1614.  
  1615.    If the response is to a REGISTER or UNREGISTER, no variable
  1616.    (instance) is being returned, so the instance ID is the NULL string
  1617.    (one 0x00 byte).  In the response to a REGISTER request indicating
  1618.    success, the error index contains the priority assigned by the agent.
  1619.  
  1620.    If the response is to an OPEN, ARE_YOU_THERE or CLOSE, no varBind
  1621.    data will be passed, so no group ID, instance ID or value data. The
  1622.    packet will only include the header, the error code and the error
  1623.  
  1624.  
  1625.  
  1626. Wijnen, Carpenter, Curran, Sehgal & Waters                     [Page 29]
  1627.  
  1628. RFC 1592                        SNMP-DPI                      March 1994
  1629.  
  1630.  
  1631.    index.
  1632.  
  1633.      +-----------------------------------------------------------------+
  1634.      | Table 13. Layout SNMP DPI RESPONSE packet                       |
  1635.      +------------+----------------------------------------------------+
  1636.      | OFFSET     | FIELD                                              |
  1637.      +------------+----------------------------------------------------+
  1638.      | 0          | packet length to follow (MSB to LSB)               |
  1639.      +------------+----------------------------------------------------+
  1640.      | 2          | protocol major version                             |
  1641.      +------------+----------------------------------------------------+
  1642.      | 3          | protocol minor version                             |
  1643.      +------------+----------------------------------------------------+
  1644.      | 4          | protocol release                                   |
  1645.      +------------+----------------------------------------------------+
  1646.      | 5          | packet id (MSB to LSB)                             |
  1647.      +------------+----------------------------------------------------+
  1648.      | 7          | packet type = SNMP_DPI_RESPONSE                    |
  1649.      +------------+----------------------------------------------------+
  1650.      | 8          | error code (1 octet)                               |
  1651.      +------------+----------------------------------------------------+
  1652.      | 9          | error index (4 octets, MSB to LSB)                 |
  1653.      +------------+----------------------------------------------------+
  1654.      | 15         | null terminated group ID (with trailing dot)       |
  1655.      +------------+----------------------------------------------------+
  1656.      | 15+L1      | null terminated instance ID (no trailing dot)      |
  1657.      +------------+----------------------------------------------------+
  1658.      | 15+L2      | SNMP Variable Type Value                           |
  1659.      +------------+----------------------------------------------------+
  1660.      | 15+L2+1    | Length of value (MSB to LSB)                       |
  1661.      +------------+----------------------------------------------------+
  1662.      | 15+L2+3    | Value                                              |
  1663.      +------------+----------------------------------------------------+
  1664.      | 15+L3      | optionally more varBinds (sequences of group ID,   |
  1665.      |            | instance ID, Type, Length and Value)               |
  1666.      +------------+----------------------------------------------------+
  1667.      | NOTE:                                                           |
  1668.      |                                                                 |
  1669.      | o   L1 = strlen(group ID) + 1                                   |
  1670.      | o   L2 = L1 + strlen(instance ID) + 1                           |
  1671.      | o   L3 = L2 + 3 + length of value                               |
  1672.      | o   group and instance ID strings use selected character set    |
  1673.      | o   OID and DisplayString values use selected character set     |
  1674.      | o   Integer values are in network byte order                    |
  1675.      +-----------------------------------------------------------------+
  1676.  
  1677.  
  1678.  
  1679.  
  1680.  
  1681.  
  1682. Wijnen, Carpenter, Curran, Sehgal & Waters                     [Page 30]
  1683.  
  1684. RFC 1592                        SNMP-DPI                      March 1994
  1685.  
  1686.  
  1687. 3.2.12  TRAP
  1688.  
  1689.    An SNMP sub-agent can request the agent to generate an SNMPv1 or
  1690.    SNMPv2 TRAP (depending on the trap destinations defined at the agent)
  1691.    by sending an SNMP DPI TRAP packet to the agent.
  1692.  
  1693.    Such a packet contains the standard SNMP DPI header plus TRAP
  1694.    specific data:
  1695.  
  1696.      o   the generic and specific trap codes
  1697.      o   optionally a null terminated string (in the selected character
  1698.          set) representing the enterprise ID in ASN.1 dotted notation.
  1699.          This enterprise ID will be sent with the TRAP.  If the null
  1700.          string is passed, then the agent uses the sub-agent Identifier
  1701.          (OID as passed with the DPI OPEN packet) as the Enterprise ID.
  1702.      o   optionally a set of one or more name/type/length/value tuples.
  1703.          representing varBinds to be sent with the trap.  Each varBind
  1704.          consists of:
  1705.  
  1706.          -   two null terminated strings (in the selected character set)
  1707.              representing the group and instance ID in ASN.1 dotted
  1708.              notation.
  1709.          -   the type, value length and value of the object that is
  1710.              returned.
  1711.  
  1712.          The permitted types for the type field are defined in Table 17.
  1713.  
  1714.          See 3.3.4, "Value Representation" for information on how the
  1715.          value data is represented in the packet value field.
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  
  1721.  
  1722.  
  1723.  
  1724.  
  1725.  
  1726.  
  1727.  
  1728.  
  1729.  
  1730.  
  1731.  
  1732.  
  1733.  
  1734.  
  1735.  
  1736.  
  1737.  
  1738. Wijnen, Carpenter, Curran, Sehgal & Waters                     [Page 31]
  1739.  
  1740. RFC 1592                        SNMP-DPI                      March 1994
  1741.  
  1742.  
  1743.      +-----------------------------------------------------------------+
  1744.      | Table 14. Layout SNMP DPI TRAP packet                           |
  1745.      +------------+----------------------------------------------------+
  1746.      | OFFSET     | FIELD                                              |
  1747.      +------------+----------------------------------------------------+
  1748.      | 0          | packet length to follow (MSB to LSB)               |
  1749.      +------------+----------------------------------------------------+
  1750.      | 2          | protocol major version                             |
  1751.      +------------+----------------------------------------------------+
  1752.      | 3          | protocol minor version                             |
  1753.      +------------+----------------------------------------------------+
  1754.      | 4          | protocol release                                   |
  1755.      +------------+----------------------------------------------------+
  1756.      | 5          | packet id (MSB to LSB)                             |
  1757.      +------------+----------------------------------------------------+
  1758.      | 7          | packet type - SNMP_DPI_TRAP                        |
  1759.      +------------+----------------------------------------------------+
  1760.      | 8          | SNMP generic trap code                             |
  1761.      +------------+----------------------------------------------------+
  1762.      | 12         | SNMP specific trap code                            |
  1763.      +------------+----------------------------------------------------+
  1764.      | 14         | null terminated enterprise ID (no trailing dot)    |
  1765.      +------------+----------------------------------------------------+
  1766.      | 14+L1      | null terminated group ID (with trailing dot)       |
  1767.      +------------+----------------------------------------------------+
  1768.      | 14+L2      | null terminated instance ID (no trailing dot)      |
  1769.      +------------+----------------------------------------------------+
  1770.      | 14+L3      | SNMP Variable Type Value                           |
  1771.      +------------+----------------------------------------------------+
  1772.      | 14+L3+1    | Length of value (MSB to LSB)                       |
  1773.      +------------+----------------------------------------------------+
  1774.      | 14+L3+3    | Value                                              |
  1775.      +------------+----------------------------------------------------+
  1776.      | 14+L4      | optionally more varBinds (sequences of group ID,   |
  1777.      |            | instance ID, Type, Length and Value)               |
  1778.      +------------+----------------------------------------------------+
  1779.      | NOTE:                                                           |
  1780.      |                                                                 |
  1781.      | o   L1 = strlen(enterprise ID) + 1                              |
  1782.      | o   L2 = L1 + strlen(group ID) + 1                              |
  1783.      | o   L3 = L1 + L2 + strlen(instance ID) + 1                      |
  1784.      | o   L4 = L1 + L2 + L3 + 3 + length of Value                     |
  1785.      | o   enterprise, group and instance ID strings use selected      |
  1786.      |     character set                                               |
  1787.      | o   OID and DisplayString values use selected character set     |
  1788.      | o   Integer values are in network byte order                    |
  1789.      +-----------------------------------------------------------------+
  1790.  
  1791.  
  1792.  
  1793.  
  1794. Wijnen, Carpenter, Curran, Sehgal & Waters                     [Page 32]
  1795.  
  1796. RFC 1592                        SNMP-DPI                      March 1994
  1797.  
  1798.  
  1799. 3.3  CONSTANTS AND VALUES
  1800.  
  1801.    This section describes the constants that have been defined for this
  1802.    version of the SNMP DPI Protocol.
  1803.  
  1804. 3.3.1  PROTOCOL VERSION AND RELEASE VALUES
  1805.  
  1806.      +-----------------------------------------------------------------+
  1807.      | Table 15. Protocol version and release values                   |
  1808.      +--------------------------------+--------------------------------+
  1809.      | FIELD                          | VALUE                          |
  1810.      +--------------------------------+--------------------------------+
  1811.      | protocol major version         | 2 (SNMP DPI protocol)          |
  1812.      +--------------------------------+--------------------------------+
  1813.      | protocol minor version         | 2 (version 2)                  |
  1814.      +--------------------------------+--------------------------------+
  1815.      | protocol release               | 0 (release 0)                  |
  1816.      +--------------------------------+--------------------------------+
  1817.  
  1818.    Previous versions of this protocol exist and should preferably be
  1819.    supported by an agent:
  1820.  
  1821.      o   version 1, release 0, described in [7]
  1822.  
  1823.    Previous internal versions of this protocol exist and may or may not
  1824.    be supported by an agent:
  1825.  
  1826.      o   version 1, release 1, experimental within IBM.
  1827.      o   version 1, release 2, experimental within BNR.
  1828.  
  1829.  
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850. Wijnen, Carpenter, Curran, Sehgal & Waters                     [Page 33]
  1851.  
  1852. RFC 1592                        SNMP-DPI                      March 1994
  1853.  
  1854.  
  1855. 3.3.2  PACKET TYPE VALUES
  1856.  
  1857.      +-----------------------------------------------------------------+
  1858.      | Table 16. Valid values for the packet type field                |
  1859.      +-------+---------------------------------------------------------+
  1860.      | VALUE | PACKET TYPE                                             |
  1861.      +-------+---------------------------------------------------------+
  1862.      | 1     | SNMP_DPI_GET                                            |
  1863.      +-------+---------------------------------------------------------+
  1864.      | 2     | SNMP_DPI_GETNEXT                                        |
  1865.      +-------+---------------------------------------------------------+
  1866.      | 3     | SNMP_DPI_SET                                            |
  1867.      +-------+---------------------------------------------------------+
  1868.      | 4     | SNMP_DPI_TRAP                                           |
  1869.      +-------+---------------------------------------------------------+
  1870.      | 5     | SNMP_DPI_RESPONSE                                       |
  1871.      +-------+---------------------------------------------------------+
  1872.      | 6     | SNMP_DPI_REGISTER                                       |
  1873.      +-------+---------------------------------------------------------+
  1874.      | 7     | SNMP_DPI_UNREGISTER                                     |
  1875.      +-------+---------------------------------------------------------+
  1876.      | 8     | SNMP_DPI_OPEN                                           |
  1877.      +-------+---------------------------------------------------------+
  1878.      | 9     | SNMP_DPI_CLOSE                                          |
  1879.      +-------+---------------------------------------------------------+
  1880.      | 10    | SNMP_DPI_COMMIT                                         |
  1881.      +-------+---------------------------------------------------------+
  1882.      | 11    | SNMP_DPI_UNDO                                           |
  1883.      +-------+---------------------------------------------------------+
  1884.      | 12    | SNMP_DPI_GETBULK                                        |
  1885.      +-------+---------------------------------------------------------+
  1886.      | 13    | SNMP_DPI_TRAPV2 (not yet used)                          |
  1887.      +-------+---------------------------------------------------------+
  1888.      | 14    | SNMP_DPI_INFORM (not yet used)                          |
  1889.      +-------+---------------------------------------------------------+
  1890.      | 15    | SNMP_DPI_ARE_YOU_THERE                                  |
  1891.      +-------+---------------------------------------------------------+
  1892.  
  1893.  
  1894.  
  1895.  
  1896.  
  1897.  
  1898.  
  1899.  
  1900.  
  1901.  
  1902.  
  1903.  
  1904.  
  1905.  
  1906. Wijnen, Carpenter, Curran, Sehgal & Waters                     [Page 34]
  1907.  
  1908. RFC 1592                        SNMP-DPI                      March 1994
  1909.  
  1910.  
  1911. 3.3.3  VARIABLE TYPE VALUES
  1912.  
  1913.      +-----------------------------------------------------------------+
  1914.      | Table 17. Valid values for the Value Type field                 |
  1915.      +-------+---------------------------------------------------------+
  1916.      | VALUE | VALUE TYPE                                              |
  1917.      +-------+---------------------------------------------------------+
  1918.      | 129   | SNMP_TYPE_Integer32                                     |
  1919.      +-------+---------------------------------------------------------+
  1920.      | 2     | SNMP_TYPE_OCTET_STRING                                  |
  1921.      +-------+---------------------------------------------------------+
  1922.      | 3     | SNMP_TYPE_OBJECT_IDENTIFIER                             |
  1923.      +-------+---------------------------------------------------------+
  1924.      | 4     | SNMP_TYPE_NULL (empty, no value)                        |
  1925.      +-------+---------------------------------------------------------+
  1926.      | 5     | SNMP_TYPE_IpAddress                                     |
  1927.      +-------+---------------------------------------------------------+
  1928.      | 134   | SNMP_TYPE_Counter32                                     |
  1929.      +-------+---------------------------------------------------------+
  1930.      | 135   | SNMP_TYPE_Gauge32                                       |
  1931.      +-------+---------------------------------------------------------+
  1932.      | 136   | SNMP_TYPE_TimeTicks (1/100ths seconds)                  |
  1933.      +-------+---------------------------------------------------------+
  1934.      | 9     | SNMP_TYPE_DisplayString                                 |
  1935.      +-------+---------------------------------------------------------+
  1936.      | 10    | SNMP_TYPE_BIT_STRING                                    |
  1937.      +-------+---------------------------------------------------------+
  1938.      | 11    | SNMP_TYPE_NsapAddress                                   |
  1939.      +-------+---------------------------------------------------------+
  1940.      | 140   | SNMP_TYPE_UInteger32                                    |
  1941.      +-------+---------------------------------------------------------+
  1942.      | 13    | SNMP_TYPE_Counter64                                     |
  1943.      +-------+---------------------------------------------------------+
  1944.      | 14    | SNMP_TYPE_Opaque                                        |
  1945.      +-------+---------------------------------------------------------+
  1946.      | 15    | SNMP_TYPE_noSuchObject                                  |
  1947.      +-------+---------------------------------------------------------+
  1948.      | 16    | SNMP_TYPE_noSuchInstance                                |
  1949.      +-------+---------------------------------------------------------+
  1950.      | 17    | SNMP_TYPE_endOfMibView                                  |
  1951.      +-------+---------------------------------------------------------+
  1952.  
  1953.      Notes:
  1954.  
  1955.      1.  A 32-bit integer value has its base base type ORed with 128.
  1956.      2.  DisplayString is a textual convention.  An SNMP PDU shows a
  1957.          type of OCTET_STRING for the value.  An agent can handle such
  1958.          an object as DisplayString if the object is included in some
  1959.  
  1960.  
  1961.  
  1962. Wijnen, Carpenter, Curran, Sehgal & Waters                     [Page 35]
  1963.  
  1964. RFC 1592                        SNMP-DPI                      March 1994
  1965.  
  1966.  
  1967.          form of a compiled MIB for the agent.  If not, the agent passes
  1968.          the value as an OCTET_STRING.
  1969.  
  1970. 3.3.4  VALUE REPRESENTATION
  1971.  
  1972.    Values in the DPI packets are represented as follows:
  1973.  
  1974.      o   32-bit integers are 4-byte elements in network byte order, MSB
  1975.          (most significant byte) first, LSB (least significant byte)
  1976.          last.  Example: '00000001'h represents 1.
  1977.      o   64-bit integers are 8-byte elements in network byte order, MSB
  1978.          first, LSB last.
  1979.          Example: '0000000100000001'h represents 4,294,967,297.
  1980.      o   Object Identifiers are NULL terminated strings in the selected
  1981.          character set, representing the OID in ASN.1 dotted notation.
  1982.          The length includes the terminating NULL.
  1983.          Example ASCII: '312e332e362e312e322e312e312e312e3000'h
  1984.          represents "1.3.6.1.2.1.1.1.0" which is sysDescr.0.
  1985.          Example EBCDIC: 'f14bf34bf64bf14bf24bf14bf14bf14bf000'h
  1986.          represents "1.3.6.1.2.1.1.1.0" which is sysDescr.0.
  1987.      o   DisplayStrings are in the selected character set.  The length
  1988.          specifies the length of the string.
  1989.          Example ASCII: '6162630d0a'h represents "abc\r\n", no NULL.
  1990.          Example EBCDIC: '8182830d25'h represents "abc\r\n", no NULL.
  1991.      o   IpAddress, NsapAddress and Opaque are implicit OCTET_STRING, so
  1992.          they are octets (e.g. IpAddress in network byte order).
  1993.      o   NULL has a zero length for the value, no value data.
  1994.      o   noSuchObject, noSuchInstance and endOfMibView are implicit NULL
  1995.          and represented as such.
  1996.      o   BIT_STRING is an OCTET_STRING of the form uubbbb...bb, where
  1997.          the first octet (uu) is 0x00-0x07 and indicates the number of
  1998.          unused bits in the last octet (bb). The bb octets represent the
  1999.          bit string itself, where bit zero (0) comes first and so on.
  2000.  
  2001. 3.3.5  CHARACTER SET SELECTION
  2002.  
  2003.    In the DPI OPEN packet, the sub-agent can specify the character set
  2004.    to be used for the representation of:
  2005.  
  2006.      o   group and instance ID in the DPI REGISTER, UNREGISTER, GET,
  2007.          GETNEXT, GETBULK, SET, UNDO, COMMIT, RESPONSE and TRAP packets.
  2008.      o   sub-agent ID and sub-agent Description in DPI OPEN packet.
  2009.      o   Object Identifiers in the value field for a value of type
  2010.          SNMP_TYPE_OBJECT_IDENTIFIER.
  2011.      o   DisplayString in the value field for a value of type
  2012.          SNMP_TYPE_DPI_DisplayString.
  2013.  
  2014.    The choice is the native character set or the ASCII character set.
  2015.  
  2016.  
  2017.  
  2018. Wijnen, Carpenter, Curran, Sehgal & Waters                     [Page 36]
  2019.  
  2020. RFC 1592                        SNMP-DPI                      March 1994
  2021.  
  2022.  
  2023.    The native set is the set native to the platform where the agent
  2024.    runs.  If the native set is ASCII, then character set selection is a
  2025.    moot point.  On non-ASCII based platforms, the agent must convert
  2026.    between native and ASCII if the native character set is chosen.
  2027.  
  2028. 3.3.6  ERROR CODE VALUES FOR SNMP DPI RESPONSE PACKETS
  2029.  
  2030.    When the RESPONSE packet is a response to a GET, GETNEXT, GETBULK,
  2031.    SET, COMMIT, or UNDO, then the error code can have one of the
  2032.    following values:
  2033.  
  2034.  
  2035.  
  2036.  
  2037.  
  2038.  
  2039.  
  2040.  
  2041.  
  2042.  
  2043.  
  2044.  
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050.  
  2051.  
  2052.  
  2053.  
  2054.  
  2055.  
  2056.  
  2057.  
  2058.  
  2059.  
  2060.  
  2061.  
  2062.  
  2063.  
  2064.  
  2065.  
  2066.  
  2067.  
  2068.  
  2069.  
  2070.  
  2071.  
  2072.  
  2073.  
  2074. Wijnen, Carpenter, Curran, Sehgal & Waters                     [Page 37]
  2075.  
  2076. RFC 1592                        SNMP-DPI                      March 1994
  2077.  
  2078.  
  2079.      +-----------------------------------------------------------------+
  2080.      | Table 18. Valid SNMP_ERROR values for RESPONSE error code       |
  2081.      +-------+---------------------------------------------------------+
  2082.      | VALUE | ERROR CODE                                              |
  2083.      +-------+---------------------------------------------------------+
  2084.      | 0     | SNMP_ERROR_noError                                      |
  2085.      +-------+---------------------------------------------------------+
  2086.      | 1     | SNMP_ERROR_tooBig                                       |
  2087.      +-------+---------------------------------------------------------+
  2088.      | 2     | SNMP_ERROR_noSuchName (SNMPv1, do not use)              |
  2089.      +-------+---------------------------------------------------------+
  2090.      | 3     | SNMP_ERROR_badValue (SNMPv1, do not use)                |
  2091.      +-------+---------------------------------------------------------+
  2092.      | 4     | SNMP_ERROR_readOnly (SNMPv1 do not use)                 |
  2093.      +-------+---------------------------------------------------------+
  2094.      | 5     | SNMP_ERROR_genErr                                       |
  2095.      +-------+---------------------------------------------------------+
  2096.      | 6     | SNMP_ERROR_noAccess                                     |
  2097.      +-------+---------------------------------------------------------+
  2098.      | 7     | SNMP_ERROR_wrongType                                    |
  2099.      +-------+---------------------------------------------------------+
  2100.      | 8     | SNMP_ERROR_wrongLength                                  |
  2101.      +-------+---------------------------------------------------------+
  2102.      | 9     | SNMP_ERROR_wrongEncoding                                |
  2103.      +-------+---------------------------------------------------------+
  2104.      | 10    | SNMP_ERROR_wrongValue                                   |
  2105.      +-------+---------------------------------------------------------+
  2106.      | 11    | SNMP_ERROR_noCreation                                   |
  2107.      +-------+---------------------------------------------------------+
  2108.      | 12    | SNMP_ERROR_inconsistentValue                            |
  2109.      +-------+---------------------------------------------------------+
  2110.      | 13    | SNMP_ERROR_resourceUnavailable                          |
  2111.      +-------+---------------------------------------------------------+
  2112.      | 14    | SNMP_ERROR_commitFailed                                 |
  2113.      +-------+---------------------------------------------------------+
  2114.      | 15    | SNMP_ERROR_undoFailed                                   |
  2115.      +-------+---------------------------------------------------------+
  2116.      | 16    | SNMP_ERROR_authorizationError                           |
  2117.      +-------+---------------------------------------------------------+
  2118.      | 17    | SNMP_ERROR_notWritable                                  |
  2119.      +-------+---------------------------------------------------------+
  2120.      | 18    | SNMP_ERROR_inconsistentName                             |
  2121.      +-------+---------------------------------------------------------+
  2122.  
  2123.  
  2124.  
  2125.  
  2126.  
  2127.  
  2128.  
  2129.  
  2130. Wijnen, Carpenter, Curran, Sehgal & Waters                     [Page 38]
  2131.  
  2132. RFC 1592                        SNMP-DPI                      March 1994
  2133.  
  2134.  
  2135.    When the RESPONSE packet is a response to an OPEN, REGISTER or
  2136.    UNREGISTER, then the error code can have one of the following values:
  2137.  
  2138.      +-----------------------------------------------------------------+
  2139.      | Table 19. Valid SNMP_ERROR_DPI values for RESPONSE error code   |
  2140.      +-------+---------------------------------------------------------+
  2141.      | VALUE | ERROR CODE                                              |
  2142.      +-------+---------------------------------------------------------+
  2143.      | 0     | SNMP_ERROR_DPI_noError                                  |
  2144.      +-------+---------------------------------------------------------+
  2145.      | 101   | SNMP_ERROR_DPI_otherError                               |
  2146.      +-------+---------------------------------------------------------+
  2147.      | 102   | SNMP_ERROR_DPI_notFound                                 |
  2148.      +-------+---------------------------------------------------------+
  2149.      | 103   | SNMP_ERROR_DPI_alreadyRegistered                        |
  2150.      +-------+---------------------------------------------------------+
  2151.      | 104   | SNMP_ERROR_DPI_higherPriorityRegistered                 |
  2152.      +-------+---------------------------------------------------------+
  2153.      | 105   | SNMP_ERROR_DPI_mustOpenFirst                            |
  2154.      +-------+---------------------------------------------------------+
  2155.      | 106   | SNMP_ERROR_DPI_notAuthorized                            |
  2156.      +-------+---------------------------------------------------------+
  2157.      | 107   | SNMP_ERROR_DPI_viewSelectionNotSupported                |
  2158.      +-------+---------------------------------------------------------+
  2159.      | 108   | SNMP_ERROR_DPI_getBulkSelectionNotSupported             |
  2160.      +-------+---------------------------------------------------------+
  2161.      | 109   | SNMP_ERROR_DPI_duplicateSubAgentIdentifier              |
  2162.      +-------+---------------------------------------------------------+
  2163.      | 110   | SNMP_ERROR_DPI_invalidDisplayString                     |
  2164.      +-------+---------------------------------------------------------+
  2165.      | 111   | SNMP_ERROR_DPI_characterSetSelectionNotSupported        |
  2166.      +-------+---------------------------------------------------------+
  2167.  
  2168.  
  2169.  
  2170.  
  2171.  
  2172.  
  2173.  
  2174.  
  2175.  
  2176.  
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182.  
  2183.  
  2184.  
  2185.  
  2186. Wijnen, Carpenter, Curran, Sehgal & Waters                     [Page 39]
  2187.  
  2188. RFC 1592                        SNMP-DPI                      March 1994
  2189.  
  2190.  
  2191. 3.3.7  UNREGISTER REASON CODES
  2192.  
  2193.    The following are valid reason codes in an UNREGISTER packet.
  2194.  
  2195.      +-----------------------------------------------------------------+
  2196.      | Table 20. Valid UNREGISTER reason codes                         |
  2197.      +-------+---------------------------------------------------------+
  2198.      | VALUE | REASON CODE                                             |
  2199.      +-------+---------------------------------------------------------+
  2200.      | 1     | SNMP_UNREGISTER_otherReason                             |
  2201.      +-------+---------------------------------------------------------+
  2202.      | 2     | SNMP_UNREGISTER_goingDown                               |
  2203.      +-------+---------------------------------------------------------+
  2204.      | 3     | SNMP_UNREGISTER_justUnregister                          |
  2205.      +-------+---------------------------------------------------------+
  2206.      | 4     | SNMP_UNREGISTER_newRegistration                         |
  2207.      +-------+---------------------------------------------------------+
  2208.      | 5     | SNMP_UNREGISTER_higherPriorityRegistered                |
  2209.      +-------+---------------------------------------------------------+
  2210.      | 6     | SNMP_UNREGISTER_byManager                               |
  2211.      +-------+---------------------------------------------------------+
  2212.      | 7     | SNMP_UNREGISTER_timeout                                 |
  2213.      +-------+---------------------------------------------------------+
  2214.  
  2215.  
  2216.  
  2217.  
  2218.  
  2219.  
  2220.  
  2221.  
  2222.  
  2223.  
  2224.  
  2225.  
  2226.  
  2227.  
  2228.  
  2229.  
  2230.  
  2231.  
  2232.  
  2233.  
  2234.  
  2235.  
  2236.  
  2237.  
  2238.  
  2239.  
  2240.  
  2241.  
  2242. Wijnen, Carpenter, Curran, Sehgal & Waters                     [Page 40]
  2243.  
  2244. RFC 1592                        SNMP-DPI                      March 1994
  2245.  
  2246.  
  2247. 3.3.8  CLOSE REASON CODES
  2248.  
  2249.    The following are valid reason codes in a CLOSE packet.
  2250.  
  2251.      +-----------------------------------------------------------------+
  2252.      | Table 21. Valid CLOSE reason codes                              |
  2253.      +-------+---------------------------------------------------------+
  2254.      | VALUE | REASON CODE                                             |
  2255.      +-------+---------------------------------------------------------+
  2256.      | 1     | SNMP_CLOSE_otherReason                                  |
  2257.      +-------+---------------------------------------------------------+
  2258.      | 2     | SNMP_CLOSE_goingDown                                    |
  2259.      +-------+---------------------------------------------------------+
  2260.      | 3     | SNMP_CLOSE_unsupportedVersion                           |
  2261.      +-------+---------------------------------------------------------+
  2262.      | 4     | SNMP_CLOSE_protocolError                                |
  2263.      +-------+---------------------------------------------------------+
  2264.      | 5     | SNMP_CLOSE_authenticationFailure                        |
  2265.      +-------+---------------------------------------------------------+
  2266.      | 6     | SNMP_CLOSE_byManager                                    |
  2267.      +-------+---------------------------------------------------------+
  2268.      | 7     | SNMP_CLOSE_timeout                                      |
  2269.      +-------+---------------------------------------------------------+
  2270.      | 8     | SNMP_CLOSE_openError                                    |
  2271.      +-------+---------------------------------------------------------+
  2272.  
  2273. 4.  DPI 2.0 MIB DEFINITION
  2274.  
  2275.      DPI20-MIB DEFINITIONS ::= BEGIN
  2276.  
  2277.      -- Objects in this MIB are implemented in the local SNMP agent.
  2278.  
  2279.         IMPORTS
  2280.                 MODULE-IDENTITY, OBJECT-TYPE, snmpModules, enterprises
  2281.                         FROM SNMPv2-SMI
  2282.  
  2283.         ibm      OBJECT IDENTIFIER ::= { enterprises 2 }
  2284.         ibmDPI   OBJECT IDENTIFIER ::= { ibm 2 }
  2285.         dpi20MIB OBJECT IDENTIFIER ::= { ibmDPI 1 }
  2286.  
  2287.      -- dpi20MIB MODULE-IDENTITY
  2288.      --   LAST-UPDATED "9401210000Z"
  2289.      --   ORGANIZATION "IBM Research - T.J. Watson Research Center"
  2290.      --   CONTACT-INFO "           Bert Wijnen
  2291.      --                 Postal:    IBM International Operations
  2292.      --                            Watsonweg 2
  2293.      --                            1423 ND Uithoorn
  2294.      --                            The Netherlands
  2295.  
  2296.  
  2297.  
  2298. Wijnen, Carpenter, Curran, Sehgal & Waters                     [Page 41]
  2299.  
  2300. RFC 1592                        SNMP-DPI                      March 1994
  2301.  
  2302.  
  2303.      --                 Tel:       +31 2975 53316
  2304.      --                 Fax:       +31 2975 62468
  2305.      --                 E-mail:    wijnen@vnet.ibm.com"
  2306.      --   DESCRIPTION "MIB module describing DPI objects."
  2307.      --   ::= { snmpModules x }
  2308.  
  2309.         dpiPort  OBJECT IDENTIFIER ::= { dpi20MIB 1 }
  2310.  
  2311.         dpiPortForTCP   OBJECT-TYPE
  2312.                 SYNTAX  INTEGER (0..65535)
  2313.                 ACCESS  read-only
  2314.                 STATUS  mandatory
  2315.                 DESCRIPTION "The TCP port number on which the agent
  2316.                              listens for DPI connections. A zero value
  2317.                              means the agent has no DPI TCP port."
  2318.                 ::= { dpiPort 1 }
  2319.  
  2320.         dpiPortForUDP   OBJECT-TYPE
  2321.                 SYNTAX  INTEGER (0..65535)
  2322.                 ACCESS  read-only
  2323.                 STATUS  mandatory
  2324.                 DESCRIPTION "The UDP port number on which the agent
  2325.                              listens for DPI packets. A zero value
  2326.                              means the agent has no DPI UDP port."
  2327.                 ::= { dpiPort 2 }
  2328.      END
  2329.  
  2330. 5.  SUBAGENT CONSIDERATIONS
  2331.  
  2332.    When implementing a sub-agent, it is strongly recommended to use the
  2333.    DPI version 2 approach (SNMPv2 based).  This means:
  2334.  
  2335.      o   Use SNMPv2 error codes only (even though we have definitions
  2336.          for the old SNMPv1 error codes).
  2337.      o   Do implement SET, COMMIT, UNDO processing properly.
  2338.      o   For GET requests, use the SNMPv2 approach and pass back
  2339.          noSuchInstance or noSuchObject value if such is the case.
  2340.          Continue to process all remaining varBinds in this case.
  2341.      o   For GETNEXT, use the SNMPv2 approach and pass back endOfMibView
  2342.          value if such is the case.  Continue to process all remaining
  2343.          varBinds in this case.
  2344.      o   When you are processing a request from the agent (GET, GETNEXT,
  2345.          GETBULK, SET, COMMIT, UNDO) you are supposed to respond within
  2346.          the timeout period (which you can specify in the OPEN and
  2347.          REGISTER packets). If you fail to respond within that timeout
  2348.          period, the agent will most probably close your DPI connection
  2349.          and then discard your RESPONSE packet if it comes in later.  If
  2350.          you can detect that the response is not going to make it in
  2351.  
  2352.  
  2353.  
  2354. Wijnen, Carpenter, Curran, Sehgal & Waters                     [Page 42]
  2355.  
  2356. RFC 1592                        SNMP-DPI                      March 1994
  2357.  
  2358.  
  2359.          time, then you might decide to abort the request and return an
  2360.          SNMP_ERROR_genErr in the RESPONSE.
  2361.      o   If you have a UDP "connected" sub-agent, or one that uses
  2362.          another unreliable protocol, you may want to issue an SNMP DPI
  2363.          ARE_YOU_THERE request once in a while to ensure that the agent
  2364.          is still alive and still knows about you.
  2365.      o   When you are running on an EBCDIC based machine, and you use
  2366.          the (default) native character set, then all OID strings (as
  2367.          used for things like group ID, instance ID, Enterprise ID,
  2368.          sub-agent ID) and also all variable values of type
  2369.          OBJECT_IDENTIFIER or DisplayString will be passed to you in
  2370.          EBCDIC format.  When you return a response, you should then
  2371.          also use EBCDIC FORMAT.
  2372.      o   When you are running on an EBCDIC based machine, and you use
  2373.          the ASCII character set (specified in DPI OPEN), then all OID
  2374.          strings (as used for things like group ID, instance ID,
  2375.          Enterprise ID, sub-agent ID) and also all variable values of
  2376.          type OBJECT_IDENTIFIER or DisplayString will be passed to you
  2377.          in ASCII format.  When you return a response, you should then
  2378.          also use ASCII FORMAT.
  2379.      o   When you are running on an ASCII machine, then the character
  2380.          set selection for you basically is moot.  Except maybe when you
  2381.          connect to an EBCDIC based agent, in which case you may want to
  2382.          specify in the DPI OPEN packet that you want to use ASCII
  2383.          character set. After that, all this is transparent to you and
  2384.          the burden of conversion is on the EBCDIC based agent.
  2385.      o   Please realize that DisplayString is only a textual convention.
  2386.          In the SNMP PDU (SNMP packet), the type is just an
  2387.          OCTET_STRING, and from that it is not clear if this is a
  2388.          DisplayString or any arbitrary data.  This means that the agent
  2389.          can only know about an object being a DisplayString if the
  2390.          object is included in some sort of a compiled MIB.  If it is,
  2391.          then the agent will use SNMP_TYPE_DisplayString in the type
  2392.          field of the varBind in a DPI SET packet.  When you send a
  2393.          DisplayString in a RESPONSE packet, the agent will handle it as
  2394.          such (e.g. translate EBCDIC to ASCII if needed).
  2395.  
  2396. 5.1  DPI API
  2397.  
  2398.    The primary goal of this document is to specify the SNMP DPI, a
  2399.    protocol by which sub-agents can exchange SNMP related information
  2400.    with an agent. On top of this protocol, one can imagine one or
  2401.    possibly many Application Programming Interfaces, but those are not
  2402.    addressed in this document.
  2403.  
  2404.  
  2405.  
  2406.  
  2407.  
  2408.  
  2409.  
  2410. Wijnen, Carpenter, Curran, Sehgal & Waters                     [Page 43]
  2411.  
  2412. RFC 1592                        SNMP-DPI                      March 1994
  2413.  
  2414.  
  2415.    However, in order to provide an environment that is more or less
  2416.    platform independent, we strongly suggest to also define a DPI API.
  2417.    We have a sample DPI API available, see 9, "Sample Sources for
  2418.    Anonymous FTP" for a place to obtain that sample DPI API.
  2419.  
  2420. 5.2  OVERVIEW OF REQUEST PROCESSING
  2421.  
  2422. 5.2.1  GET PROCESSING
  2423.  
  2424.    A GET request is the easiest to process.  The DPI GET packet holds
  2425.    one or more varBinds that the sub-agent has taken responsibility for.
  2426.  
  2427.    If the sub-agent encounters an error while processing the request, it
  2428.    creates a DPI RESPONSE packet with an appropriate error indication in
  2429.    the error_code field and sets the error_index to the position of the
  2430.    varBind at which the error occurs (first varBind is index 1, second
  2431.    varBind is index 2, and so on).  No name/type/length/value
  2432.    information needs to be provided in the packet, because by
  2433.    definition, the varBind information is the same as in the request to
  2434.    which this is a response, and the agent still has that information.
  2435.  
  2436.    If there are no errors, then the sub-agent creates a DPI RESPONSE
  2437.    packet in which the error_code is set to SNMP_ERROR_noError (zero)
  2438.    and error_index is set to zero.  The packet must also include the
  2439.    name/type/length/value of each varBind requested.  When you get a
  2440.    request for a non-existing object or a non-existing instance of an
  2441.    object, then you must return a NULL value with a type of
  2442.    SNMP_TYPE_noSuchObject or SNMP_TYPE_noSuchInstance respectively.
  2443.  
  2444.    These two values are not considered errors, so the error_code and
  2445.    error_index should be zero.
  2446.  
  2447.    The DPI RESPONSE packet is then sent back to the agent.
  2448.  
  2449. 5.2.2  SET PROCESSING
  2450.  
  2451.    Processing a DPI SET request is more difficult than a DPI GET
  2452.    request.  In the case of a DPI SET packet, additional information is
  2453.    available in the packet, namely the value type, value length and
  2454.    value to be set.
  2455.  
  2456.    If the sub-agent encounters an error while processing the request, it
  2457.    creates a DPI RESPONSE packet with an appropriate error indication in
  2458.    the error_code field and an error_index listing the position of the
  2459.    varBind at which the error occurs (first varBind is index 1, second
  2460.    varBind is index 2, and so on).  No name/type/length/value
  2461.    information needs to provided in the packet, because by definition,
  2462.    the varBind information is the same as in the request to which this
  2463.  
  2464.  
  2465.  
  2466. Wijnen, Carpenter, Curran, Sehgal & Waters                     [Page 44]
  2467.  
  2468. RFC 1592                        SNMP-DPI                      March 1994
  2469.  
  2470.  
  2471.    is a response, and the agent still has that information.
  2472.  
  2473.    If there are no errors, then the sub-agent creates a DPI RESPONSE
  2474.    packet in which the error_code is set to SNMP_ERROR_noError (zero)
  2475.    and error_index is set to zero.  No name/type/length/value
  2476.    information is needed; by definition the RESPONSE to a SET should
  2477.    contain exactly the same varBind data as the data present in the
  2478.    request, so the agent can use the values it already has.  (This
  2479.    suggests that the agent must keep state information, and that is
  2480.    indeed the case.  It needs to do that anyway in order to be able to
  2481.    later pass the data with a DPI COMMIT or DPI UNDO packet).  The sub-
  2482.    agent must have allocated the required resources and prepared itself
  2483.    for the SET.  It does not yet effectuate the set, that will be done
  2484.    at COMMIT time.
  2485.  
  2486.    The sub-agent sends a DPI RESPONSE packet (indicating success or
  2487.    failure for the preparation phase) back to the agent.
  2488.  
  2489.    The agent will then issue a SET request for all other varBinds in the
  2490.    same original SNMP request it received.  This may be to the same or
  2491.    to one or more different sub-agents.  Once all SET requests have
  2492.    returned a "no error" condition, the agent starts sending DPI COMMIT
  2493.    packets to the sub-agent(s).  If any SET request returns an error,
  2494.    then the agent sends DPI UNDO packets to those sub-agents that
  2495.    indicated successful processing of the SET preparation phase.
  2496.  
  2497.    When the sub-agent receives the DPI COMMIT packet, again all the
  2498.    varBind information will be available in the packet.  The sub-agent
  2499.    can now effectuate the SET request.
  2500.  
  2501.    If the sub-agent encounters an error while processing the COMMIT
  2502.    request, it creates a DPI RESPONSE packet with value
  2503.    SNMP_ERROR_commitFailed in the error_code field and an error_index
  2504.    that lists at which varBind the error occurs (first varBind is index
  2505.    1 and so on).  No name/type/length/value information is needed.  The
  2506.    fact that a commitFailed error exists does not mean that this error
  2507.    should be returned easily.  A sub-agent should do all that is
  2508.    possible to make a COMMIT succeed.
  2509.  
  2510.    If there are no errors, and the SET/COMMIT has been effectuated with
  2511.    success, then the sub-agent creates a DPI RESPONSE packet in which
  2512.    the error_code is set to SNMP_ERROR_noError (zero) and error_index is
  2513.    set to zero.  No name/type/length/value information is needed.
  2514.  
  2515.    So far we have discussed a SET, COMMIT sequence.  That happens if all
  2516.    goes well.  However, after a successful SET, the sub-agent may
  2517.    receive a DPI UNDO packet.  The sub-agent must now undo any
  2518.    preparations it made during the SET processing (like free allocated
  2519.  
  2520.  
  2521.  
  2522. Wijnen, Carpenter, Curran, Sehgal & Waters                     [Page 45]
  2523.  
  2524. RFC 1592                        SNMP-DPI                      March 1994
  2525.  
  2526.  
  2527.    memory and such).  Even after a COMMIT, a sub-agent may still receive
  2528.    a DPI UNDO packet.  This is the case if some other sub-agent could
  2529.    not complete a COMMIT request.  Because of the SNMP-requirement that
  2530.    all varBinds in a single SNMP SET request must be changed "as if
  2531.    simultaneous", all committed changes must be undone if any of the
  2532.    COMMIT requests fail.  In this case the sub-agent must try and undo
  2533.    the committed SET operation.
  2534.  
  2535.    If the sub-agent encounters an error while processing the UNDO
  2536.    request, it creates a DPI RESPONSE packet with value
  2537.    SNMP_ERROR_undoFailed in the error_code field and an error_index that
  2538.    lists at which varBind the error occurs (first varBind is index 1 and
  2539.    so on).  No name/type/length/value information is needed.  The fact
  2540.    that an undoFailed error exists does not mean that this error should
  2541.    be returned easily.  A sub-agent should do all that is possible to
  2542.    make an UNDO succeed.
  2543.  
  2544.    If there are no errors, and the UNDO has been effectuated with
  2545.    success, then the sub-agent creates a DPI RESPONSE packet in which
  2546.    the error_code is set to SNMP_ERROR_noError (zero) and error_index is
  2547.    set to zero.  No name/type/length/value information is needed.
  2548.  
  2549. 5.2.3  GETNEXT PROCESSING
  2550.  
  2551.    GETNEXT requests are a bit more complicated to process than a GET.
  2552.    The DPI GETNEXT packet contains the object(s) on which the GETNEXT
  2553.    operation must be performed.  The semantics of the operation are that
  2554.    the sub-agent is to return the name/type/length/value of the next
  2555.    variable it supports whose (ASN.1) name lexicographically follows the
  2556.    one passed in the group ID (sub-tree) and instance ID.
  2557.  
  2558.    In this case, the instance ID may not be present (NULL) implying that
  2559.    the NEXT object must be the first instance of the first object in the
  2560.    sub-tree that was registered.
  2561.  
  2562.    It is important to realize that a given sub-agent may support several
  2563.    discontiguous sections of the MIB tree.  In such a situation it would
  2564.    be incorrect to jump from one section to another.  This problem is
  2565.    correctly handled by examining the group ID in the DPI packet.  This
  2566.    group ID represents the "reason" why the sub-agent is being called.
  2567.    It holds the prefix of the tree that the sub-agent had indicated it
  2568.    supported (registered).
  2569.  
  2570.    If the next variable supported by the sub-agent does not begin with
  2571.    that prefix, the sub-agent must return the same object instance as in
  2572.    the request (e.g. group ID and instance ID) with a value of
  2573.    SNMP_TYPE_endOfMibView (implied NULL value).  This endOfMibView is
  2574.    not considered an error, so the error_code and error_index should be
  2575.  
  2576.  
  2577.  
  2578. Wijnen, Carpenter, Curran, Sehgal & Waters                     [Page 46]
  2579.  
  2580. RFC 1592                        SNMP-DPI                      March 1994
  2581.  
  2582.  
  2583.    zero.  If required, the SNMP agent will call upon the sub-agent
  2584.    again, but pass it a different group ID (prefix).  This is
  2585.    illustrated in the discussion below.
  2586.  
  2587.    Assume there are two sub-agents.  The first sub-agent registers two
  2588.    distinct sections of the tree, A and C.  In reality, the sub-agent
  2589.    supports variables A.1 and A.2, but it correctly registers the
  2590.    minimal prefix required to uniquely identify the variable class it
  2591.    supports.
  2592.  
  2593.    The second sub-agent registers a different section, B, which appears
  2594.    between the two sections registered by the first agent.
  2595.  
  2596.    If a management station begins dumping the MIB, starting from A, the
  2597.    following sequence of queries of the form get-next(group ID, instance
  2598.    ID) would be performed:
  2599.  
  2600.        Sub-agent 1 gets called:
  2601.               get-next(A,none) = A.1
  2602.               get-next(A,1)    = A.2
  2603.               get-next(A,2)    = endOfMibView
  2604.  
  2605.        Sub-agent 2 is then called:
  2606.               get-next(B,none) = B.1
  2607.               get-next(B,1)    = endOfMibView
  2608.  
  2609.        Sub-agent 1 gets called again:
  2610.               get-next(C,none) = C.1
  2611.  
  2612. 5.2.4  GETBULK PROCESSING
  2613.  
  2614.    You can ask the agent to translate GETBULK requests into multiple
  2615.    GETNEXT requests.  This is basically the default and it is specified
  2616.    in the DPI REGISTER packet.  In principle, we expect the majority of
  2617.    DPI sub-agents to run on the same machine as the agent (or otherwise,
  2618.    on the same physical network), so repetitive GETNEXT requests stay
  2619.    local and in general should not be a problem.
  2620.  
  2621.    If experience tells us different, the sub-agent can tell the agent to
  2622.    pass on a DPI GETBULK packet.
  2623.  
  2624.    When a GETBULK request is received, the sub-agent must process the
  2625.    request and send a RESPONSE that sends back as many varBinds as
  2626.    requested by the request, as long as they fit with in the buffers.
  2627.  
  2628.    The GETBULK requires similar processing as a GETNEXT with regard to
  2629.    endOfMibView handling.
  2630.  
  2631.  
  2632.  
  2633.  
  2634. Wijnen, Carpenter, Curran, Sehgal & Waters                     [Page 47]
  2635.  
  2636. RFC 1592                        SNMP-DPI                      March 1994
  2637.  
  2638.  
  2639. 5.2.5  OPEN REQUEST
  2640.  
  2641.    As the very first step, a DPI sub-agent must open a "connection" with
  2642.    the agent.  To do so, it must send a DPI OPEN packet in which these
  2643.    things must be specified:
  2644.  
  2645.      o   The max timeout value in seconds.  The agent is requested to
  2646.          wait this long for a response to any request for an object
  2647.          being handled by this sub-agent.  The agent may have an
  2648.          absolute maximum timeout value which will be used if the
  2649.          sub-agent asks for too big a timeout value.  A value of zero
  2650.          can be used to indicate that the agent's own default timeout
  2651.          value should be used.  A sub-agent is advised to use a
  2652.          reasonably short interval of a few seconds or so.  If a
  2653.          specific sub-tree needs a (much) longer time, then a specific
  2654.          REGISTER can be done for that sub-tree with a longer timeout
  2655.          value.
  2656.      o   The maximum number of varBinds that the sub-agent is prepared
  2657.          to handle per DPI packet.  Specifying 1 would result in DPI
  2658.          version 1 behavior of one varBind per DPI packet that the agent
  2659.          sends to the sub-agent.
  2660.      o   The character set you want to use. By default (value 0) this is
  2661.          the native character set of the machine (platform) where the
  2662.          agent runs.
  2663.          Since the sub-agent and agent normally run on the same system
  2664.          or platform, you want to use the native character set (which on
  2665.          many platforms is ASCII anyway).
  2666.          If your platform is EBCDIC based, then using the native
  2667.          character set of EBCDIC makes it easy to recognize the string
  2668.          representations of the fields like group ID, instance ID, etc.
  2669.  
  2670.          At the same time, the agent will translate the value from ASCII
  2671.          NVT to EBCDIC (and vice versa) for objects that it knows (from
  2672.          a compiled MIB) to have a textual convention of DisplayString.
  2673.          Be aware that this fact cannot be determined from the SNMP PDU
  2674.          encoding because in the PDU the object is only known to be an
  2675.          OCTET_STRING.
  2676.          If your sub-agent runs on an ASCII based platform and the agent
  2677.          runs on an EBCDIC based platform (or the other way around),
  2678.          then you can specify that you want to use the ASCII character
  2679.          set, and so you both know how to handle the string-based data.
  2680.          Beware that not all agents need to support other than native
  2681.          character set selection.  See 5, "Subagent Considerations"
  2682.          and 3.3.5, "Character set selection" for more information on
  2683.          character set usage.
  2684.      o   The sub-agent ID.  This an ASN.1 Object Identifier that
  2685.          uniquely identifies the sub-agent.  This OID is represented as
  2686.          a null terminated string using the selected character set.
  2687.  
  2688.  
  2689.  
  2690. Wijnen, Carpenter, Curran, Sehgal & Waters                     [Page 48]
  2691.  
  2692. RFC 1592                        SNMP-DPI                      March 1994
  2693.  
  2694.  
  2695.          Example: "1.3.5.1.2.3.4.5".
  2696.      o   The sub-agent Description.  This is a DisplayString describing
  2697.          the sub-agent.  This is a character string using the selected
  2698.          character set.  Example: "DPI sample sub-agent version 2.0"
  2699.  
  2700.    Once a sub-agent has sent a DPI OPEN packet to an agent, it should
  2701.    expect a DPI RESPONSE packet that informs the sub-agent about the
  2702.    result of the request.  The packet ID of the RESPONSE packet should
  2703.    be the same as that of the OPEN request to which the RESPONSE packet
  2704.    is the response.  See Table 19 for a list of valid DPI RESPONSE error
  2705.    codes that may be expected.  If you receive an error RESPONSE on the
  2706.    OPEN packet, then you will also receive a DPI CLOSE packet with an
  2707.    SNMP_CLOSE_openError code, and then the agent closes the
  2708.    "connection".
  2709.  
  2710.    If the OPEN is accepted, then the next step is to REGISTER one or
  2711.    more MIB sub-trees.
  2712.  
  2713. 5.2.6  CLOSE REQUEST
  2714.  
  2715.    When a sub-agent is finished and wants to terminate it should first
  2716.    UNREGISTER its sub-trees and then close the "connection" with the
  2717.    agent.  To do so, it must send a DPI CLOSE packet in which it
  2718.    specifies a reason for the closing.  See Table 21 for a list of valid
  2719.    CLOSE reason codes.  You should not expect a response to the CLOSE
  2720.    request.
  2721.  
  2722.    A sub-agent should also be prepared to handle an incoming DPI CLOSE
  2723.    packet from the agent.  Again, the packet will contain a reason code
  2724.    for the CLOSE request.  A sub-agent need not send a response to a
  2725.    CLOSE request. The agent just assumes that the sub-agent will handle
  2726.    it appropriately.  The close takes place, no matter what the sub-
  2727.    agent does with it.
  2728.  
  2729. 5.2.7  REGISTER REQUEST
  2730.  
  2731.    Before a sub-agent will receive any requests for MIB variables it
  2732.    must first register the variables or sub-tree it supports with the
  2733.    SNMP agent.  The sub-agent must specify a number of things in the
  2734.    REGISTER request:
  2735.  
  2736.      o   The sub-tree to be registered.  This is a null terminated
  2737.          string in the selected character set.  The sub-tree must have a
  2738.          trailing dot (example: "1.3.6.1.2.3.4.5.").
  2739.      o   The requested priority for the registration, one of:
  2740.          -1  Request for best available priority.
  2741.          0   Request for next better available priority than highest
  2742.              priority currently registered for this sub-tree.
  2743.  
  2744.  
  2745.  
  2746. Wijnen, Carpenter, Curran, Sehgal & Waters                     [Page 49]
  2747.  
  2748. RFC 1592                        SNMP-DPI                      March 1994
  2749.  
  2750.  
  2751.          NNN Any other positive value requests that specific priority if
  2752.              available or the first worse priority that is available.
  2753.      o   The max timeout value in seconds.  The agent is requested to
  2754.          wait this long for a response to any request for an object in
  2755.          this sub-tree.  The agent may have an absolute maximum timeout
  2756.          value which will be used if the sub-agents asks for too big a
  2757.          timeout value.  A value of zero can be used to indicate that
  2758.          the DPI OPEN value should be used for timeout.
  2759.      o   A specification if the sub-agent wants to do view selection.
  2760.          If it does, then the community name (from SNMPv1 packets) will
  2761.          be passed in the DPI GET, GETNEXT, SET packets).
  2762.      o   A specification if the sub-agent wants to receive GETBULK
  2763.          packets or if it just prefers that the agent converts a GETBULK
  2764.          into multiple GETNEXT requests.
  2765.  
  2766.    Once a sub-agent has sent a DPI REGISTER packet to the agent, it
  2767.    should expect a DPI RESPONSE packet that informs the sub-agent about
  2768.    the result of the request.  The packet ID of the RESPONSE packet
  2769.    should be the same as that of the REGISTER packet to which the
  2770.    RESPONSE packet is the response.  If the response indicates success,
  2771.    then the error_index field in the RESPONSE packet contains the
  2772.    priority that the agent assigned to the sub-tree registration.  See
  2773.    Table 19 for a list of valid DPI RESPONSE error codes that may be
  2774.    expected.
  2775.  
  2776. 5.2.8  UNREGISTER REQUEST
  2777.  
  2778.    A sub-agent may unregister a previously registered sub-tree.  The
  2779.    sub-agent must specify a few things in the UNREGISTER request:
  2780.  
  2781.      o   The sub-tree to be unregistered.  This is a null terminated
  2782.          string in the selected character set.  The sub-tree must have a
  2783.          trailing dot (example: "1.3.6.1.2.3.4.5.").
  2784.      o   The reason for the unregister.  See Table 20 for a
  2785.          list of valid reason codes.
  2786.  
  2787.    Once a sub-agent has sent a DPI UNREGISTER packet to the agent, it
  2788.    should expect a DPI RESPONSE packet that informs the sub-agent about
  2789.    the result of the request.  The packet ID of the RESPONSE packet
  2790.    should be the same as that of the REGISTER packet to which the
  2791.    RESPONSE packet is the response.  See Table 19 for a list of valid
  2792.    DPI RESPONSE error codes that may be expected.
  2793.  
  2794.    A sub-agent should also be prepared to handle incoming DPI UNREGISTER
  2795.    packets from the agent.  Again, the DPI packet will contain a reason
  2796.    code for the UNREGISTER.  A sub-agent need not send a response to an
  2797.    UNREGISTER request.  The agent just assumes that the sub-agent will
  2798.    handle it appropriately.  The registration is removed, no matter what
  2799.  
  2800.  
  2801.  
  2802. Wijnen, Carpenter, Curran, Sehgal & Waters                     [Page 50]
  2803.  
  2804. RFC 1592                        SNMP-DPI                      March 1994
  2805.  
  2806.  
  2807.    the sub-agent returns.
  2808.  
  2809. 5.2.9  TRAP REQUEST
  2810.  
  2811.    A sub-agent can request that the SNMP agent generates a trap for it.
  2812.    The sub-agent must provide the desired values for the generic and
  2813.    specific parameters of the trap.  It may optionally provide a set of
  2814.    one or more name/type/length/value tuples that will be included in
  2815.    the trap packet.  Also, it may optionally specify an Enterprise ID
  2816.    (Object Identifier) for the trap to be generated.  If a NULL value is
  2817.    specified for the Enterprise ID, then the agent will use the sub-
  2818.    agent Identifier (from the DPI OPEN packet) as the Enterprise ID to
  2819.    be sent with the trap.
  2820.  
  2821. 5.2.10  ARE_YOU_THERE REQUEST
  2822.  
  2823.    A sub-agent can send an ARE_YOU_THERE packet to the agent.  This may
  2824.    be useful to do if you have a DPI "connection" over an unreliable
  2825.    transport protocol (like UDP).
  2826.  
  2827.    If the "connection" is in a healthy state, the agent responds with a
  2828.    RESPONSE packet with SNMP_ERROR_DPI_noError.
  2829.  
  2830.    If the "connection" is not in a healthy state, the agent may respond
  2831.    with a RESPONSE packet with an error indication, but the agent might
  2832.    not react at all, so you would timeout while waiting for a response.
  2833.  
  2834. 5.2.11  HOW TO QUERY THE DPI PORT.
  2835.  
  2836.    The DPI API implementations are encouraged to provide a facility that
  2837.    helps DPI sub-agent programmers to dynamically find the port that the
  2838.    agent is using for the TCP and/or UDP DPI port(s).  A suggested name
  2839.    for such a function is: query_DPI_port().
  2840.  
  2841. 6.  REFERENCES
  2842.  
  2843.    [1] Case, J., Fedor, M., Schoffstall M., and J. Davin, "Simple
  2844.        Network Management Protocol (SNMP)", STD 15, RFC 1157, SNMP
  2845.        Research, Performance Systems International, MIT Laboratory for
  2846.        Computer Science, May 1990.
  2847.  
  2848.    [2] Information processing systems - Open Systems Interconnection,
  2849.        "Specification of Abstract Syntax Notation One (ASN.1)",
  2850.        International Organization for Standardization, International
  2851.        Standard 8824, December 1987.
  2852.  
  2853.  
  2854.  
  2855.  
  2856.  
  2857.  
  2858. Wijnen, Carpenter, Curran, Sehgal & Waters                     [Page 51]
  2859.  
  2860. RFC 1592                        SNMP-DPI                      March 1994
  2861.  
  2862.  
  2863.    [3] Information processing systems - Open Systems Interconnection,
  2864.        "Specification of Basic Encoding Rules for Abstract Syntax
  2865.        Notation One (ASN.1)", International Organization for
  2866.        Standardization, International Standard 8825, December 1987.
  2867.  
  2868.    [4] McCloghrie, K., and M. Rose, "Management Information Base for
  2869.        Network Management of TCP/IP-based internets: MIB II", STD 17,
  2870.        RFC 1213, Hughes LAN Systems, Performance Systems International,
  2871.        March 1991.
  2872.  
  2873.    [5] Rose, M., and K. McCloghrie, "Structure and Identification of
  2874.        Management Information for TCP/IP-based internets", STD 16, RFC
  2875.        1155, Performance Systems International, Hughes LAN Systems, May
  2876.        1990.
  2877.  
  2878.    [6] Rose, M., "SNMP MUX Protocol and MIB", RFC 1227, Performance
  2879.        Systems International, RFC 1227, May 1991.
  2880.  
  2881.    [7] Carpenter G., and B. Wijnen, "SNMP-DPI, Simple Network Management
  2882.        Protocol Distributed Program Interface", RFC 1228, International
  2883.        Business Machines, Inc., May 1991.
  2884.  
  2885.    [8] Case, J., McCloghrie, K., Rose, M., and S. Waldbusser, "SNMPv2
  2886.        RFCs (RFC 1441 through RFC 1452)", SNMP Research Inc, Hughes LAN
  2887.        Systems, Dover Beach Consulting Inc, Carnegie Mellon University,
  2888.        Trusted Information Systems, April 1993.
  2889.  
  2890.    [9] International Business Machines, Inc., TCP/IP for VM:
  2891.        Programmer's Reference, SC31-6084-0, 1990.
  2892.  
  2893.   [10] International Business Machines, Inc., Virtual Machine System
  2894.        Facilities for Programming, Release 6, SC24-5288-01, 1988.
  2895.  
  2896. 7.  SECURITY CONSIDERATIONS
  2897.  
  2898.    Security issues are not discussed in this memo.
  2899.  
  2900.  
  2901.  
  2902.  
  2903.  
  2904.  
  2905.  
  2906.  
  2907.  
  2908.  
  2909.  
  2910.  
  2911.  
  2912.  
  2913.  
  2914. Wijnen, Carpenter, Curran, Sehgal & Waters                     [Page 52]
  2915.  
  2916. RFC 1592                        SNMP-DPI                      March 1994
  2917.  
  2918.  
  2919. 8.  AUTHORS' ADDRESSES
  2920.  
  2921.    Bert Wijnen
  2922.    IBM International Operations
  2923.    Watsonweg 2
  2924.    1423 ND Uithoorn
  2925.    The Netherlands
  2926.  
  2927.    Phone: +31-2975-53316
  2928.    Fax:   +31-2975-62468
  2929.    EMail: wijnen@vnet.ibm.com
  2930.  
  2931.  
  2932.    Geoffrey C. Carpenter
  2933.    IBM T.J. Watson Research Center
  2934.    P.O. Box 218
  2935.    Yorktown Heights, NY 10598
  2936.    USA
  2937.  
  2938.    Phone: +1-914-945-1970
  2939.    EMail: gcc@watson.ibm.com
  2940.  
  2941.  
  2942.    Kim Curran
  2943.    Bell Northern Research Ltd.
  2944.    P.O. Box 3511 Station C
  2945.    Ottawa, Ontario K1Y 4HY
  2946.    Canada
  2947.  
  2948.    Phone: +1-613-763-5283
  2949.    EMail: kcurran@bnr.ca
  2950.  
  2951.  
  2952.    Aditya Sehgal
  2953.    Bell Northern Research Ltd.
  2954.    P. O. Box 3511 Station C
  2955.    Ottawa, Ontario K1Y 4HY
  2956.    Canada
  2957.  
  2958.    Phone: +1-613-763-8821
  2959.    EMail: asehgal@bnr.ca
  2960.  
  2961.  
  2962.  
  2963.  
  2964.  
  2965.  
  2966.  
  2967.  
  2968.  
  2969.  
  2970. Wijnen, Carpenter, Curran, Sehgal & Waters                     [Page 53]
  2971.  
  2972. RFC 1592                        SNMP-DPI                      March 1994
  2973.  
  2974.  
  2975.    Glen Waters
  2976.    Bell Northern Research Ltd.
  2977.    P.O. Box 3511 Station C
  2978.    Ottawa, Ontario K1Y 4HY
  2979.    Canada
  2980.  
  2981.    Phone: +1-613-763-3933
  2982.    EMail: gwaters@bnr.ca
  2983.  
  2984. 9.  SAMPLE SOURCES FOR ANONYMOUS FTP
  2985.  
  2986.    An implementation sample of a DPI API (as used at the agent and sub-
  2987.    agent side) plus sample sub-agent code and documentation are
  2988.    available for anonymous FTP from:
  2989.  
  2990.           software.watson.ibm.com  (129.34.139.5)
  2991.  
  2992.    To obtain the source, perform the following steps:
  2993.  
  2994.           ftp software.watson.ibm.com
  2995.           user:     anonymous
  2996.           password: your_e-mail_address
  2997.           cd /public/dpi
  2998.           get README
  2999.           binary
  3000.           get dpi_api.tar (or compressed dpi_api.tar.Z)
  3001.           quit
  3002.  
  3003.  
  3004.  
  3005.  
  3006.  
  3007.  
  3008.  
  3009.  
  3010.  
  3011.  
  3012.  
  3013.  
  3014.  
  3015.  
  3016.  
  3017.  
  3018.  
  3019.  
  3020.  
  3021.  
  3022.  
  3023.  
  3024.  
  3025.  
  3026. Wijnen, Carpenter, Curran, Sehgal & Waters                     [Page 54]
  3027.  
  3028.