RFC2741 - Agent Extensibility (AgentX) Protocol Version 1(3)

时间:2005-02-16 来源: 作者: 点击:
(hrSWRunTable) is indexed by the system's native process identifier (pid). A subagent implementing the row of hrSWRunTable corresponding to its own process would simply register the region defining t
  
(hrSWRunTable) is indexed by the system's native process identifier
(pid). A subagent implementing the row of hrSWRunTable corresponding
to its own process would simply register the region defining that
row's object instances without allocating index values.

7.1.4.2.3. Examples

Example 1:

A subagent implements an interface, and wishes to register a
single row of the RFC2233 ifTable. It requests an allocation for
the index object "ifIndex", for a value that has never been
allocated (since ifIndex values must be unique). The master agent
returns the value "7".

The subagent now attempts to register row 7 of ifTable, by
specifying a MIB region in the agentx-Register-PDU of
1.3.6.1.2.1.2.2.1.[1-22].7. If the registration succeeds, no
further processing is required. The master agent will dispatch to
this subagent correctly.

If the registration failed with `duplicateRegistration', the
subagent should deallocate the failed index, request allocation of
a new index i, and attempt to register ifTable.[1-22].i, until
successful.

Example 2:

This same subagent wishes to register ipNetToMediaTable rows
corresponding to its interface (ifIndex i). Due to the structure
of this table, no further index allocation need be done. The
subagent can register the MIB region ipNetToMediaTable.[1-4].i, It
is claiming responsibility for all rows of the table whose value
of ipNetToMediaIfIndex is i.

Example 3:

A network device consists of a set of processors, each of which
accepts network connections for a unique set of IP addresses.
Further, each processor contains a subagent that implements
tcpConnTable. In order to represent tcpConnTable for the entire
managed device, the subagents need to share tcpConnTable.

In this case, no index allocation need be done at all. Each
subagent can register a MIB region of tcpConnTable.[1-5].a.b.c.d,
where a.b.c.d represents an unique IP address of the individual
processor.

Each subagent is claiming responsibility for the region of
tcpConnTable where the value of tcpConnLocalAddress is a.b.c.d.

Example 4:

The Application Management MIB (RFC2564 [22]) uses two objects to
index several tables. A partial description of them is:

applSrvIndex OBJECT-TYPE
SYNTAX Unsigned32 (1..'ffffffff'h)
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"An applSrvIndex is the system-unique identifier
of an instance of a service. The value is unique
not only across all instances of a given service,
but also across all services in a system."

applSrvName OBJECT-TYPE
SYNTAX SnmpAdminString
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"The human-readable name of a service. Where
appropriate, as in the case where a service can
be identified in terms of a single protocol, the
strings should be established names such as those
assigned by IANA and found in STD 2 [23], or
defined by some other authority. In some cases
private conventions apply and the string should
in these cases be consistent with these
non-standard conventions. An applicability
statement may specify the service name(s) to be
used."

Since applSrvIndex is an arbitrary value, it would be reasonable
for subagents to allocate values for this index. applSrvName
however has intrinsic meaning and any values a subagent would use
should be known a priori, hence it is not reasonable for subagents
to allocate values of this index.

7.1.5. Processing the agentx-Unregister-PDU

When the master agent receives an agentx-Unregister-PDU, it performs
the common processing described in section 7.1, "Processing AgentX
Administrative Messages". If as a result res.error is `
noAgentXError', processing continues as follows:

1) If u.subtree, u.priority, u.range_subid (and if u.range_subid is
not 0, u.upper_bound), and the indicated context do not match an
existing registration made during this session, the agentx-
Response-PDU is returned with res.error set to `
unknownRegistration'.

2) Otherwise, the agentx-Response-PDU is sent in reply with res.error
set to `noAgentXError', and the previous registration is removed
from the registration data store.

7.1.6. Processing the agentx-AddAgentCaps-PDU

When the master agent receives an agentx-AddAgentCaps-PDU, it
performs the common processing described in section 7.1, "Processing
AgentX Administrative Messages". If as a result res.error is `
noAgentXError', processing continues as follows:

1) The master agent adds this agent capabilities information to the
sysORTable for the indicated context. An agentx-Response-PDU is
sent in reply with res.error set to `noAgentXError'.

7.1.7. Processing the agentx-RemoveAgentCaps-PDU

When the master agent receives an agentx-RemoveAgentCaps-PDU, it
performs the common processing described in section 7.1, "Processing
AgentX Administrative Messages". If as a result res.error is
`noAgentXError', processing continues as follows:

1) If the combination of a.id and the optional a.context does not
represent a sysORTable entry that was added by this subagent
during this session, the agentx-Response-PDU is returned with
res.error set to `unknownAgentCaps'.

2) Otherwise the master agent deletes the corresponding sysORTable
entry and sends in reply the agentx-Response-PDU, with res.error
set to `noAgentXError'.

7.1.8. Processing the agentx-Close-PDU

When the master agent receives an agentx-Close-PDU, it performs the
common processing described in section 7.1, "Processing AgentX
Administrative Messages", with the exception that step 4) is not
performed since the agentx-Close-PDU does may not contain a context
field. If as a result res.error is `noAgentXError', processing
continues as follows:

1) The master agent closes the AgentX session as described below, and
sends in reply the agentx-Response-PDU with res.error set to
`noAgentXError':

- All MIB regions that have been registered during this session
are unregistered, as described in section 7.1.5, "Processing
the agentx-Unregister-PDU".

- All index values allocated during this session are freed, as
described in section 7.1.3, "Processing the agentx-
IndexDeallocate-PDU".

- All sysORID values that were registered during this session are
removed, as described in section 7.1.7, "Processing the
agentx-RemoveAgentCaps-PDU".

The master agent does not maintain state for closed sessions. If a
subagent wishes to re-establish a session after it has been closed,
it needs to re-register MIB regions, agent capabilities, etc.

7.1.9. Detecting Connection Loss

If a master agent is able to detect (from the underlying transport)
that a subagent cannot receive AgentX PDUs, it should close all
affected AgentX sessions as described in section 7.1.8, "Processing
the agentx-Close-PDU", step 1).

7.1.10. Processing the agentx-Notify-PDU

A subagent sending SNMPv1 trap information must map this into
(minimally) a value of snmpTrapOID.0, as described in 3.1.2 of RFC
1908 [24].

When the master agent receives an agentx-Notify-PDU, it performs the
common processing described in section 7.1, "Processing AgentX
Administrative Messages". If as a result res.error is
`noAgentXError', processing continues as follows:

1) If the first VarBind is sysUpTime.0;

(a) if the second VarBind is not snmpTrapOID.0, res.error is set
to `processingError' and res.index to 2

(b) otherwise these two VarBinds are used as the first two
VarBinds within the generated notification.

2) If the first VarBind is not sysUpTime.0;

(a) if the first VarBind is not snmpTrapOID.0, res.error is set
to `processingError' and res.index to 1

(b) otherwise this VarBind is used for snmpTrapOID.0 within the
generated notification, and the master agent uses the current
value of sysUpTime.0 for the indicated context as sysUpTime.0
within the notification.

3) An agentx-Response-PDU is sent containing the original
VarBindList, and with res.error and res.index set as described
above. If res.error is `noAgentXError', notifications are sent
according to the implementation-specific configuration of the
master agent. If SNMPv1 Trap PDUs are generated, the recommended
mapping is as described in RFC2089 [25]. If res.error indicates
an error in processing, no notifications are generated.

Note that the master agent's successful response indicates the
agentx-Notify-PDU was received and validated. It does not
indicate that any particular notifications were actually generated
or received by notification targets.

7.1.11. Processing the agentx-Ping-PDU

When the master agent receives an agentx-Ping-PDU, it performs the
common processing described in section 7.1, "Processing AgentX
Administrative Messages". If as a result res.error is `
noAgentXError', processing continues as follows:

1) An agentx-Response-PDU is sent in reply.

If a subagent does not receive a response to its pings, or if it is
able to detect (from the underlying transport) that the master agent
is not able to receive AgentX messages, then it eventually must
initiate a new AgentX session, re-register its MIB regions, etc.

7.2. Processing Received SNMP Protocol Messages

When an SNMP GetRequest, GetNextRequest, GetBulkRequest, or
SetRequest protocol message is received by the master agent, the
master agent applies its access control policy.

In particular, for SNMPv1 or SNMPv2c protocol messages, the master
agent applies the Elements of Procedure defined in section 4.1 of STD
15, RFC1157 [8] that apply to receiving entities. For SNMPv3, the
master agent applies an Access Control Model, possibly the View-based
Access Control Model (see RFC2575 [15]), as described in section
3.1.2 and section 4.3 of RFC2571 [1].

For SNMPv1 and SNMPv2c, the master agent uses the community string as
an index into a local repository of configuration information that
may include community profiles or more complex context information.
For SNMPv3, the master agent uses the SNMP Context (see section 3.3.1
of RFC2571 [1]) for these purposes.

If application of the access control policy results in a valid SNMP
request PDU, then an SNMP Response-PDU is constructed from
information gathered in the exchange of AgentX PDUs between the
master agent and one or more subagents. Upon receipt and initial
validation of an SNMP request PDU, a master agent uses the procedures
described below to dispatch AgentX PDUs to the proper subagents,
marshal the subagent responses, and construct an SNMP response PDU.

7.2.1. Dispatching AgentX PDUs

Upon receipt and initial validation of an SNMP request PDU, a master
agent uses the procedures described below to dispatch AgentX PDUs to
the proper subagents.

General Rules of Procedure

While processing a particular SNMP request, the master agent may send
one or more AgentX PDUs on one or more subagent sessions. The
following rules of procedure apply in general to the AgentX master
agent. PDU-specific rules are listed in the applicable sections.

1) Honoring the registry

Because AgentX supports registration of duplicate and overlapping
regions, it is possible for the master agent to obtain a value for
a requested varbind from within multiple registered MIB regions.

The master agent must ensure that the value (or exception)
actually returned in the SNMP response PDU is taken from the
authoritative region (as defined in section 7.1.4.1, "Handling
Duplicate and Overlapping Subtrees").

2) GetNext and GetBulk Processing

The master agent may choose to send agentx-Get-PDUs while
servicing an SNMP GetNextRequest-PDU. The master agent may choose
to send agentx-Get-PDUs or agentx-GetNext-PDUs while servicing an
SNMP GetBulkRequest-PDU. One possible reason for this would be if
the current iteration has targeted instance-level registrations.

The master agent may choose to "scope" the possible instances
returned by a subagent by specifying an ending OID in the
SearchRange. If such scoping is used, typically the ending OID
would be the first lexicographical successor to the target region
that was registered on a session other than the target session.
Regardless of this choice, rule (1) must be obeyed.

The master agent may require multiple request-response iterations
on the same subagent session, to determine the final value of all
requested variables.

All AgentX PDUs sent on the session while processing a given SNMP
request must contain identical values of transactionID. Each
different SNMP request processed by the master agent must present
a unique value of transactionID (within the limits of the 32-bit
field) to the session.

3) Number and order of variables sent per AgentX PDU

For Get/GetNext/GetBulk operations, at any stage of the possibly
iterative process, the master agent may need to dispatch several
SearchRanges to a particular subagent session. The master agent
may send one, some, or all of the SearchRanges in a single AgentX
PDU.

The master agent must ensure that the correct contents and
ordering of the VarBindList in the SNMP Response-PDU are
maintained.

The following rules govern the number of VarBinds in a given
AgentX PDU:

a) The subagent must support processing of AgentX PDUs with
multiple VarBinds.

b) When processing an SNMP Set request, the master agent must
send all of the VarBinds applicable to a particular subagent
session in a single agentx-TestSet-PDU.

c) When processing an SNMP Get, GetNext, or GetBulk request,
the master agent may send a single AgentX PDU on the session
with all applicable VarBinds, or multiple PDUs with single
VarBinds, or something in between those extremes. The
determination of which method to use in a particular case is
implementation-specific.

4) Timeout Values

The master agent chooses a timeout value for each MIB region being
queried, which is

a) the value specified during registration of the MIB region,
if it was non-zero

b) otherwise, the value specified during establishment of the
session in which this region was subsequently registered, if
that value was non-zero

c) otherwise, or, if the specified value is not practical, the
master agent's implementaton-specific default value

When an AgentX PDU that references multiple MIB regions is
dispatched, the timeout value used for the PDU is the maximum
value of the timeouts so determined for each of the referenced MIB
regions.

5) Context

If the master agent has determined that a specific non-default
context is associated with the SNMP request PDU, that context is
encoded into the AgentX PDU's context field and the
NON_DEFAULT_CONTEXT bit is set in h.flags.

Otherwise, no context Octet String is added to the PDU, and the
NON_DEFAULT_CONTEXT bit is cleared.

7.2.1.1. agentx-Get-PDU

Each variable binding in the SNMP request PDU is processed as
follows:

(1) Identify the target MIB region.

Within a lexicographically ordered set of registered MIB
regions, valid for the indicated context, locate the
authoritative region (according to section 7.1.4.1, "Handling
Duplicate and Overlapping Subtrees") that contains the binding's
name.

(2) If no such region exists, the variable binding is not processed
further, and its value is set to `noSuchObject'.

(3) Identify the subagent session in which this region was
registered, termed the target session.

(4) If this is the first variable binding to be dispatched over the
target session in a request-response exchange entailed in the
processing of this management request:

- Create an agentx-Get-PDU for this session, with the header
fields initialized as described above (see section 6.1,
"AgentX PDU Header").

(5) Add a SearchRange to the end of the target session's PDU for
this variable binding.

- The variable binding's name is encoded into the starting OID.

- The ending OID is encoded as null.

7.2.1.2. agentx-GetNext-PDU

Each variable binding in the SNMP request PDU is processed as
follows:

(1) Identify the target MIB region.

Within a lexicographically ordered set of registered MIB
regions, valid for the indicated context, locate the
authoritative region (according to section 7.1.4.1, "Handling
Duplicate and Overlapping Subtrees") that

a) contains the variable binding's name and is not a fully
qualified instance, or

b) is the first lexicographical successor to the variable
binding's name.

(2) If no such region exists, the variable binding is not processed
further, and its value is set to `endOfMibView'.

(3) Identify the subagent session in which this region was
registered, termed the target session.

(4) If this is the first variable binding to be dispatched over the
target session in a request-response exchange entailed in the
processing of this management request:

- Create an agentx-GetNext-PDU for the session, with the header
fields initialized as described above (see section 6.1,
"AgentX PDU Header").

(5) Add a SearchRange to the end of the target session's agentx-
GetNext-PDU for this variable binding.

- if (1a) applies, the variable binding's name is encoded into
the starting OID, and the OID's "include" field is set to 0.

- if (1b) applies, the target region's r.subtree is encoded
into the starting OID, and its "include" field is set to 1.
(This is the recommended method. An implementation may
choose to use a Starting OID value that precedes r.subtree,
in which case the include bit must be 0. A starting OID
value that succeeds r.subtree is not permitted.)

- the Ending OID for the SearchRange is encoded to be either
NULL, or a value that lexicographically succeeds the Starting
OID. This is an implementation-specific choice depending on
how the master agent wishes to "scope" the possible returned
instances.

7.2.1.3. agentx-GetBulk-PDU

(Note: The outline of the following procedure is based closely on
section 4.2.3, "The GetBulkRequest-PDU" of RFC1905 [13]. Please
refer to it for details on the format of the SNMP GetBulkRequest-PDU
itself.)

Each variable binding in the request PDU is processed as follows:

(1) Identify the authoritative target region and target session,
exactly as described for the agentx-GetNext-PDU (see section
7.2.1.2, "agentx-GetNext-PDU").

(2) If this is the first variable binding to be dispatched over the
target session in a request-response exchange entailed in the
processing of this management request:

- Create an agentx-GetBulk-PDU for the session, with the header
fields initialized as described above (see section 6.1,
"AgentX PDU Header").

(3) Add a SearchRange to the end of the target session's agentx-
GetBulk-PDU for this variable binding, as described for the
agentx-GetNext-PDU. If the variable binding was a non-repeater
in the original request PDU, it must be a non-repeater in the
agentx-GetBulk-PDU.

The value of g.max_repetitions in the agentx-GetBulk-PDU may be less
than (but not greater than) the value in the original request PDU.

The master agent may make such alterations due to simple sanity
checking, optimizations for the current iteration based on the
registry, the maximum possible size of a potential Response-PDU,
known constraints of the AgentX transport, or any other
implementation-specific constraint.

7.2.1.4. agentx-TestSet-PDU

AgentX employs test-commit-undo-cleanup phases to achieve "as if
simultaneous" semantics of the SNMP SetRequest-PDU within the
extensible agent. The initial phase involves the agentx-TestSet-PDU.

Each variable binding in the SNMP request PDU is processed in order,
as follows:

(1) Identify the target MIB region and target session exactly as
described in section 7.2.1.1, "agentx-Get-PDU", step 1).

Within a lexicographically ordered set of OID ranges, valid for
the indicated context, locate the authoritative range that
contains the variable binding's name.

(2) If no such target region exists, this variable binding fails
with an error of `notWritable'. Processing is complete for this
request.

(3) If this is the first variable binding to be dispatched over the
target session in a request-response exchange entailed in the
processing of this management request:

- create an agentx-TestSet-PDU for the session, with the header
fields initialized as described above (see section 6.1,
"AgentX PDU Header").

(4) Add a VarBind to the end of the target session's PDU for this
variable binding, as described in section 5.4, "Value
Representation".

Note that all VarBinds applicable to a given session must be sent in
a single agentx-TestSet-PDU.

7.2.1.5. Dispatch

A timeout value is calculated for each PDU to be sent, which is the
maximum value of the timeouts determined for each of the PDU's
SearchRanges (as described above in section 7.2.1, "Dispatching
AgentX PDUs", item 4). Each pending PDU is mapped (via its
h.sessionID value) to a particular transport domain/endpoint, as
described in section 8 (Transport Mappings).

7.2.2. Subagent Processing

A subagent initially processes a received AgentX PDU as follows:

- If the received PDU is an agentx-Response-PDU:

1) If there are any errors parsing or interpreting the PDU, it is
silently dropped.

2) Otherwise the response is matched to the original request via
h.packetID, and handled in an implementation-specific manner. For
example, if this response indicates an error attempting to
register a MIB region, the subagent may wish to register a
different region, or log an error and halt, etc.

- If the received PDU is any other type:

1) an agentx-Response-PDU is created whose header fields are
identical to the received request PDU except that h.type is set to
Response, res.error to `noError', res.index to 0, and the
VarBindList to null.

2) If the received PDU cannot be parsed, res.error is set to
`parseError'.

3) Otherwise, if h.sessionID does not correspond to a currently
established session, res.error is set to `notOpen'.

4) At this point, if res.error is not `noError', the received PDU is
not processed further. If the received PDU's header was
successfully parsed, the AgentX-Response-PDU is sent in reply. If
the received PDU's header was not successfully parsed or for some
other reason the subagent cannot send a reply, processing is
complete.

7.2.3. Subagent Processing of agentx-Get, GetNext, GetBulk-PDUs

A conformant AgentX subagent must support the agentx-Get, -GetNext,
and -GetBulk PDUs, and must support multiple variables being supplied
in each PDU.

When a subagent receives an agentx-Get-, GetNext-, or GetBulk-PDU, it
performs the indicated management operations and returns an agentx-
Response-PDU.

Each SearchRange in the request PDU's SearchRangeList is processed as
described below, and a VarBind is added in the corresponding location
of the agentx-Response-PDU's VarbindList. If processing should fail
for any reason not described below, res.error is set to `genErr',
res.index to the index of the failed SearchRange, the VarBindList is
reset to null, and this agentx-Response-PDU is returned to the master
agent.

7.2.3.1. Subagent Processing of the agentx-Get-PDU

Upon the subagent's receipt of an agentx-Get-PDU, each SearchRange in
the request is processed as follows:

(1) The starting OID is copied to v.name.

(2) If the starting OID exactly matches the name of a variable
instantiated by this subagent within the indicated context and
session, v.type and v.data are encoded to represent the
variable's syntax and value, as described in section 5.4, "Value
Representation".

(3) Otherwise, if the starting OID does not match the object
identifier prefix of any variable instantiated within the
indicated context and session, the VarBind is set to
`noSuchObject', in the manner described in section 5.4, "Value
Representation".

(4) Otherwise, the VarBind is set to `noSuchInstance' in the manner
described in section 5.4, "Value Representation".

7.2.3.2. Subagent Processing of the agentx-GetNext-PDU

Upon the subagent's receipt of an agentx-GetNext-PDU, each
SearchRange in the request is processed as follows:

(1) The subagent searches for a variable within the
lexicographically ordered list of variable names for all
variables it instantiates (without regard to registration of
regions) within the indicated context and session, as follows:

- if the "include" field of the starting OID is 0, the
variable's name is the closest lexicographical successor to
the starting OID.

- if the "include" field of the starting OID is 1, the
variable's name is either equal to, or the closest
lexicographical successor to, the starting OID.

- If the ending OID is not null, the variable's name
lexicographically precedes the ending OID.

If a variable is successfully located, v.name is set to that
variable's name. v.type and v.data are encoded to represent the
variable's syntax and value, as described in section 5.4, "Value
Representation".

(2) If the subagent cannot locate an appropriate variable, v.name is
set to the starting OID, and the VarBind is set to `
endOfMibView', in the manner described in section 5.4, "Value
Representation".

7.2.3.3. Subagent Processing of the agentx-GetBulk-PDU

A maximum of N + (M * R) VarBinds are returned, where

N equals g.non_repeaters,
M equals g.max_repetitions, and
R is (number of SearchRanges in the GetBulk request) - N.

The first N SearchRanges are processed exactly as for the agentx-
GetNext-PDU.

If M and R are both non-zero, the remaining R SearchRanges are
processed iteratively to produce potentially many VarBinds. For each
iteration i, such that i is greater than zero and less than or equal

to M, and for each repeated SearchRange s, such that s is greater
than zero and less than or equal to R, the (N+((i-1)*R)+s)-th VarBind
is added to the agentx-Response-PDU as follows:

1) The subagent searches for a variable within the
lexicographically ordered list of variable names for all
variables it instantiates (without regard to registration of
regions) within the indicated context and session, for which
the following are all true:

- The variable's name is the (i)-th lexicographical successor
to the (N+s)-th requested OID.

(Note that if i is 0 and the "include" field is 1, the
variable's name may be equivalent to, or the first
lexicographical successor to, the (N+s)-th requested OID.)

- If the ending OID is not null, the variable's name
lexicographically precedes the ending OID.

If all of these conditions are met, v.name is set to the located
variable's name. v.type and v.data are encoded to represent the
variable's syntax and value, as described in section 5.4, "Value
Representation".

2) If no such variable exists, the VarBind is set to `
endOfMibView' as described in section 5.4, "Value
Representation". v.name is set to v.name of the (N+((i-
2)*R)+s)-th VarBind unless i is currently 1, in which case it
is set to the value of the starting OID in the (N+s)-th
SearchRange.

Note that further iterative processing should stop if

- For any iteration i, all s values of v.type are `
endOfMibView'.

- An AgentX transport constraint or other implementation-
specific constraint is reached.

7.2.4. Subagent Processing of agentx-TestSet, -CommitSet, -UndoSet,
-CleanupSet-PDUs

A conformant AgentX subagent must support the agentx-TestSet,
-CommitSet, -UndoSet, and -CleanupSet PDUs, and must support multiple
variables being supplied in the agentx-TestSet-PDU.

These four PDUs are used to collectively perform the indicated
management operation. An agentx-Response-PDU is sent in reply to
each of the PDUs (except -CleanupSet), to inform the master agent of
the state of the operation.

The master agent must serialize Set transactions for each session.
That is, a session need not handle multiple concurrent Set
transactions.

These Response-PDUs do not contain a VarBindList.

7.2.4.1. Subagent Processing of the agentx-TestSet-PDU

Upon the subagent's receipt of an agentx-TestSet-PDU, each VarBind in
the PDU is validated until they are all successful, or until one
fails, as described in section 4.2.5 of RFC1905 [13]. The subagent
validates variables with respect to the context and session indicated
in the testSet-PDU.

If each VarBind is successful, the subagent has a further
responsibility to ensure the availability of all resources (memory,
write access, etc.) required for successfully carrying out a
subsequent agentx-CommitSet operation. If this cannot be guaranteed,
the subagent should set res.error to `resourceUnavailable'. As a
result of this validation step, an agentx-Response-PDU is sent in
reply whose res.error field is set to one of the following SNMPv2 PDU
error-status values (see section 3, "Definitions", in RFC1905 [13]):

noError (0),
genErr (5),
noAccess (6),
wrongType (7),
wrongLength (8),
wrongEncoding (9),
wrongValue (10),
noCreation (11),
inconsistentValue (12),
resourceUnavailable (13),
notWritable (17),
inconsistentName (18)

If this value is not `noError', the res.index field must be set to
the index of the VarBind for which validation failed.

Implementation of rigorous validation code may be one of the most
demanding aspects of subagent development. Implementors are strongly
encouraged to do this right, so as to avoid if at all possible the
extensible agent's having to return `commitFailed' or `undoFailed'
during subsequent processing.

7.2.4.2. Subagent Processing of the agentx-CommitSet-PDU

The agentx-CommitSet-PDU indicates that the subagent should actually
perform (as described in the post-validation sections of 4.2.5 of RFC
1905 [13]) the management operation indicated by the previous
TestSet-PDU. After carrying out the management operation, the
subagent sends in reply an agentx-Response-PDU whose res.error field
is set to one of the following SNMPv2 PDU error-status values (see
section 3, "Definitions", in RFC1905 [13]):

noError (0),
commitFailed (14)

If this value is `commitFailed', the res.index field must be set to
the index of the VarBind (as it occurred in the agentx-TestSet-PDU)
for which the operation failed. Otherwise res.index is set to 0.

7.2.4.3. Subagent Processing of the agentx-UndoSet-PDU

The agentx-UndoSet-PDU indicates that the subagent should undo the
management operation requested in a preceding CommitSet-PDU. The
undo process is as described in section 4.2.5 of RFC1905 [13].

After carrying out the undo process, the subagent sends in reply an
agentx-Response-PDU whose res.error field is set to one of the
following SNMPv2 PDU error-status values (see section 3,
"Definitions", in RFC1905 [13]):

noError (0),
undoFailed (15)

If this value is `undoFailed', the res.index field must be set to the
index of the VarBind (as it occurred in the agentx-TestSet-PDU) for
which the operation failed. Otherwise res.index is set to 0.

This PDU also signals the end of processing of the management
operation initiated by the previous TestSet-PDU. The subagent should
release resources, etc. as described in section 7.2.4.4, "Subagent
Processing of the agentx-CleanupSet-PDU".

7.2.4.4. Subagent Processing of the agentx-CleanupSet-PDU

The agentx-CleanupSet-PDU signals the end of processing of the
management operation requested in the previous TestSet-PDU. This is
an indication to the subagent that it may now release any resources
it may have reserved in order to carry out the management request.
No response is sent by the subagent.

7.2.5. Master Agent Processing of AgentX Responses

The master agent now marshals all subagent AgentX response PDUs and
builds an SNMP response PDU. In the next several subsections, the
initial processing of all subagent AgentX response PDUs is described,
followed by descriptions of subsequent processing for each specific
subagent Response.

7.2.5.1. Common Processing of All AgentX Response PDUs

1) If a response is not received on a session within the timeout
interval for this dispatch, it is treated as if the subagent had
returned `genErr' and processed as described below.

A timeout may be due to a variety of reasons, and does not
necessarily denote a failed or malfunctioning subagent. As such,
the master agent's response to a subagent timeout is
implementation-specific, but with the following constraint:

A session that times out on three consecutive AgentX requests is
considered unable to respond, and the master agent must close the
AgentX session as described in section 7.1.8, "Processing the
agentx-Close-PDU", step (2).

2) Otherwise, the h.packetID, h.sessionID, and h.transactionID fields
of the AgentX response PDU are used to correlate subagent
responses. If the response does not pertain to this SNMP
operation, it is ignored.

3) Otherwise, the responses are processed jointly to form the SNMP
response PDU.

7.2.5.2. Processing of Responses to agentx-Get-PDUs

After common processing of the subagent's response to an agentx-Get-
PDU (see section 7.2.5.1, "Common Processing of All AgentX Response
PDUs", above), processing continues with the following steps:

1) For any received AgentX response PDU, if res.error is not
`noError', the SNMP response PDU's error code is set to this
value. If res.error contains an AgentX specific value (e.g.
`parseError'), the SNMP response PDU's error code is set to a
value of genErr instead. Also, the SNMP response PDU's error
index is set to the index of the variable binding corresponding to
the failed VarBind in the subagent's AgentX response PDU.

All other AgentX response PDUs received due to processing this
SNMP request are ignored. Processing is complete; the SNMP
Response PDU is ready to be sent (see section 7.2.6, "Sending the
SNMP Response-PDU").

2) Otherwise, the content of each VarBind in the AgentX response PDU
is used to update the corresponding variable binding in the SNMP
Response-PDU.

7.2.5.3. Processing of Responses to agentx-GetNext-PDU and
agentx-GetBulk-PDU

After common processing of the subagent's response to an agentx-
GetNext-PDU or agentx-GetBulk-PDU (see section 7.2.5.1, "Common
Processing of All AgentX Response PDUs", above), processing continues
with the following steps:

1) For any received AgentX response PDU, if res.error is not
`noError', the SNMP response PDU's error code is set to this
value. If res.error contains an AgentX specific value (e.g.
`parseError'), the SNMP response PDU's error code is set to a
value of genErr instead. Also, the SNMP response PDU's error
index is set to the index of the variable binding corresponding to
the failed VarBind in the subagent's AgentX response PDU.

All other AgentX response PDUs received due to processing this
SNMP request are ignored. Processing is complete; the SNMP
response PDU is ready to be sent (see section 7.2.6, "Sending the
SNMP Response-PDU").

2) Otherwise, the content of each VarBind in the AgentX response PDU
is used to update the corresponding VarBind in the SNMP response
PDU.

After all expected AgentX response PDUs have been processed, if any
VarBinds still contain the value `endOfMibView' in their v.type
fields, processing must continue:

3) A new iteration of AgentX request dispatching is initiated (as
described in section 7.2.1.2, "agentx-GetNext-PDU"), in which only
those VarBinds whose v.type is `endOfMibView' are processed.

4) For each such VarBind, an authoritative target MIB region is
identified in which the master agent expects to find suitable MIB
variables. The target session is the one on which this new target
region was registered.

The starting OID in each SearchRange is set to the value of v.name
for the corresponding VarBind, and its "include" field is set to
0.

5) The value of transactionID must be identical to the value used
during the previous iteration.

6) The AgentX PDUs are sent on the target session(s), and the
responses are received and processed according to the steps
described in section 7.2.5, "Master Agent Processing of AgentX
Responses".

7) This process continues iteratively until a complete SNMP
Response-PDU has been built, or until there remain no
authoritative MIB regions to query.

Note that r.subtree for the new target region identified in step 4)
may not lexicographically succeed r.subtree for the region that has
returned `endOfMibView'. For example, consider the following
registry:

session A `mib-2' (1.3.6.1.2.1)
session B `ip' (1.3.6.1.2.1.4)
session C `tcp' (1.3.6.1.2.1.6)

If while processing a GetNext-Request-PDU session B returns
`endOfMibView' for a variable name within 1.3.6.1.2.1.4, the target
MIB region identified in step 4) would be 1.3.6.1.2.1 (since it may
contain variables whose names precede 1.3.6.1.2.1.6).

Note also that if session A returned variables from within
1.3.6.1.2.1.6, they must be discarded since session A is NOT
authoritative for that region.

7.2.5.4. Processing of Responses to agentx-TestSet-PDUs

After common processing of the subagent's response to an agentx-
TestSet-PDU (see section 7.2.5.1, "Common Processing of All AgentX
Response PDUs", above), processing continues with the further

exchange of AgentX PDUs. The value of h.transactionID in the
agentx-CommitSet, -UndoSet, and -CleanupSet-PDUs must be identical to
the value sent in the testSet-PDU.

The state transitions and PDU sequences are depicted in section 7.3,
"State Transitions".

The set of all sessions who have been sent an agentx-TestSet-PDU for
this particular transaction are referred to below as "involved
sessions".

1) If any target session's response is not `noError', all other
agentx-Response-PDUs received due to processing this SNMP request
are ignored.

An agentx-CleanupSet-PDU is sent to all involved sessions.
Processing is complete; the SNMP response PDU is constructed as
described below in 7.2.6, "Sending the SNMP Response-PDU".

2) Otherwise an agentx-CommitSet-PDU is sent to all involved
sessions.

7.2.5.5. Processing of Responses to agentx-CommitSet-PDUs

After common processing of the subagent's response to an agentx-
CommitSet-PDU (see section 7.2.5.1, "Common Processing of All AgentX
Response PDUs", above), processing continues with the following
steps:

1) If any response is not `noError', the SNMP response PDU's error
code is set to this value. If res.error contains an AgentX
specific value (e.g. `parseError'), the SNMP response PDU's error
code is set to a value of genErr instead. Also, the SNMP response
PDU's error index is set to the index of the VarBind corresponding
to the failed VarBind in the agentx-TestSet-PDU.

An agentx-UndoSet-PDU is sent to each target session that has been
sent an agentx-CommitSet-PDU. An agentx-CleanupSet-PDU is sent to
the remainder of the involved sessions.

2) Otherwise an agentx-CleanupSet-PDU is sent to all involved
sessions. Processing is complete; the SNMP response PDU is
constructed as described below in section 7.2.6, "Sending the SNMP
Response-PDU".

7.2.5.6. Processing of Responses to agentx-UndoSet-PDUs

After common processing of the subagent's response to an agentx-
UndoSet-PDU (see section 7.2.5.1, "Common Processing of All AgentX
Response PDUs", above), processing continues with the following
steps:

1) If any response is `undoFailed' the SNMP response PDU's error code
is set to this value. Also, the SNMP response PDU's error index
is set to 0.

2) Otherwise, if any response is not `noError' the SNMP response
PDU's error code is set to this value. Also, the SNMP response
PDU's error index is set to the index of the VarBind corresponding
to the failed VarBind in the agentx-TestSet-PDU. If res.error is
an AgentX specific value (e.g. `parseError'), the SNMP response
PDU's error code is set to a value of genErr instead.

3) Otherwise the SNMP response PDU's error code and error index were
set in section 7.2.5.5 step 1)

7.2.6. Sending the SNMP Response-PDU

Once the processing described in section 7.2.5, "Master Agent
Processing of AgentX Responses" is complete, there is an SNMP
response PDU available. The master agent now implements the Elements
of Procedure for the applicable version of the SNMP protocol in order
to encapsulate the PDU into a message, and transmit it to the
originator of the SNMP management request. Note that this may
involve altering the PDU contents (for instance, to replace the
original VarBinds if an error condition is to be returned).

The response PDU may also be altered in order to support the SNMPv1
PDU. In such cases the required PDU mapping is that defined in RFC
2089 [25]. (Note in particular that the rules for handling Counter64
syntax may require re-sending AgentX GetBulk or GetNext PDUs until a
VarBind of suitable syntax is returned.)

7.2.7. MIB Views

AgentX subagents are not aware of MIB views, since view information
is not contained in AgentX PDUs.

As stated above, the descriptions of procedures in section 7,
"Elements of Procedure", of this memo are not intended to constrain
the internal architecture of any conformant implementation. In
particular, the master agent procedures described in section 7.2.1,

"Dispatching AgentX PDUs" and in section 7.2.5, "Master Agent
Processing of AgentX Responses" may be altered so as to optimize
AgentX exchanges when implementing MIB views.

Such optimizations are beyond the scope of this memo. But note that
section 7.2.3, "Subagent Processing of agentx-Get, GetNext, GetBulk-
PDUs", defines subagent behavior in such a way that alteration of
SearchRanges may be used in such optimizations.

7.3. State Transitions

State diagrams are presented from the master agent's perspective for
transport connection and session establishment, and from the
subagent's perspective for Set transaction processing.

7.3.1. Set Transaction States

The following table presents, from the subagent's perspective, the
state transitions involved in Set transaction processing:

STATE
+---------------+--------------+---------+--------+--------
| A | B | C | D | E
| (Initial | TestOK | Commit | Test | Commit
| State) | | OK | Fail | Fail
| | | | |
EVENT | | | | |
---------+---------------+--------------+---------+--------+--------
| 7.2.4.1 | | | |
Receive | All varbinds | | | |
TestSet | OK? | X | X | X | X
PDU | Yes ->B | | | |
| No ->D | | | |
---------+---------------+--------------+---------+--------+--------
| | 7.2.4.2 | | |
Receive | | NoError? | | |
Commit- | X | Yes ->C | X | X | X
Set PDU | | No ->E | | |
---------+---------------+--------------+---------+--------+--------
Receive | | | 7.2.4.3 | |7.2.4.3
UndoSet | X | X | ->done | X | ->done
PDU | | | | |
---------+---------------+--------------+---------+--------+--------
Receive | | 7.2.4.4 | 7.2.4.4 |7.2.4.4 |
Cleanup- | X | ->done | ->done | ->done | X
Set PDU | | | | |
---------+---------------+--------------+---------+--------+--------
Session | | rollback | undo | |
Loss | ->done | ->done | ->done | ->done | ->done
---------+---------------+--------------+---------+--------+--------

There are three possible sequences that a subagent may follow for a
particular set transaction:

1) TestSet CommitSet CleanupSet
2) TestSet CommitSet UndoSet
3) TestSet CleanupSet

Note that a single PDU sequence may result in multiple paths through
the finite state machine (FSM). For example, the sequence

TestSet CommitSet UndoSet

may walk through either of these two state sequences:

(initial) TestOK CommitOK (done)
(initial) TestOK CommitFail (done)

7.3.2. Transport Connection States

The following table presents, from the master agent's perspective,
the state transitions involved in transport connection setup and
teardown:
STATE
+--------------+--------------
| A | B
| No transport | Transport
| | connected
| |
EVENT | |
----------------+--------------+--------------
Transport | |
connect | ->B | X
indication | |
----------------+--------------+--------------
Receive | | if no resources
Open-PDU | | available
| | reject, else
| X | establish
| | session
| |
| | ->B
----------------+--------------+--------------
Receive | | if matching
Response-PDU | | session id,
| | feed to that
| X | session's FSM
| | else ignore
| |
| | ->B
----------------+--------------+--------------
Receive other | | if matching
PDUs | | session id,
| | feed to that
| X | session's FSM
| | else reject
| |
| | ->B
----------------+--------------+--------------
Transport | |notify all
disconnect | |sessions on
indication | X |this transport
| |
| | ->A
----------------+--------------+--------------

7.3.3. Session States

The following table presents, from the master agent's perspective,
the state transitions involved in session setup and teardown:

STATE
+-------------+----------------
| A | B
| No session | Session
| | established
EVENT | |
---------------+-------------+----------------
| 7.1.1 |
Receive | | X
Open PDU | ->B |
---------------+-------------+----------------
| | 7.1.8
Receive | X |
Close PDU | | ->A
---------------+-------------+----------------
Receive | | 7.1.4
Register PDU | X |
| | ->B
---------------+-------------+----------------
Receive | | 7.1.5
Unregister | X |
PDU | | ->B
---------------+-------------+----------------
Receive | |
Get PDU | |
GetNext PDU | |
GetBulk PDU | X | X
TestSet PDU | |
CommitSet PDU | |
UndoSet PDU | |
CleanupSet PDU | |
---------------+-------------+----------------
Receive | | 7.1.10
Notify PDU | X |
| | ->B
---------------+-------------+----------------
Receive Ping | | 7.1.11
PDU | X |
| | ->B
---------------+-------------+----------------
(continued next page)

---------------+-------------+----------------
Receive | | 7.1.2
IndexAllocate | X |
PDU | | ->B
---------------+-------------+----------------
Receive | | 7.1.3
IndexDeallocate| X |
PDU | | ->B
---------------+-------------+----------------
Receive | | 7.1.6
AddAgentxCaps | X |
PDU | | ->B
---------------+-------------+----------------
Receive | | 7.1.7
RemoveAgentxCap| X |
PDU | | ->B
---------------+-------------+----------------
Receive | | 7.2.5
Response PDU | X |
| | ->B
---------------+-------------+----------------
Receive | |
Other PDU | X | X
---------------+-------------+----------------
------分隔线----------------------------
顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------
最新评论 查看所有评论
发表评论 查看所有评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 密码: 验证码:
推荐内容