Subject: RFC 2741 clause 5.1

From: Randy Presuhn <[email-masked]>
Date: Tue, 12 Mar 2002 10:01:04 -0800 (PST)

Hi -

Dave Perkins' recent query on the SNMPv3 list prompted me
to take a look at the AgentX specification's rules for
object identifier encoding.  Specifically, the ad hoc
encoding rules in clause 5.1 of RFC 2741 permit object
identifier values that could not be represented in BER.
Examples:

    - a zero-length object identifier;

    - an object identifier consisting of a single element;

    - an object identifier in which the first element has
      a value other than 0, 1, or 2.

Three specific sub-cases for each of these come to mind:

    - notification (snmpTrapOID.0)

    - varbind values in general

    - varbind names in general

What is a master agent to do if it gets one of these beasts?
What is a subagent supposed to do with them?

 ------------------------------------------------------
 Randy Presuhn          BMC Software, Inc.  1-3141
 [email-masked]  2141 North First Street
 Tel: +1 408 546-1006   San José, California 95131  USA
 ------------------------------------------------------
 My opinions and BMC's are independent variables.
 ------------------------------------------------------

---

From: Mark Ellison <[email-masked]>
Date: Tue, 12 Mar 2002 18:22:51 -0500

Hi Randy,

This issue reduces to where the OID originates.

My comments are inline.  

Regards,

Mark

>     - a zero-length object identifier;

From my reading of clause 5.1 this is not possible.

I interpret "A null object identifier consists of the 4-byte header with
all bytes set to 0" as meaning "0.0"

When n_subid=0 and prefix=x, I interpret as "1.3.6.1.x"

>       a value other than 0, 1, or 2.

Could happen under clause 5.1.  When presented with this circumstance,
EOP clause 7.1.(5) for admin messages provides a means to terminate
processing with an error of processingError(268).

One could also interpret EOP clause 7.1.(2) as including malformed OIDs,
so parseError(266) may also be a remedy for admin messages.

I do not see any admin messages where the master originates an OID and
transfers to subagent.

> What is a subagent supposed to do with them?

Since the master provides the OIDs from the snmp-request to the subagent
(EOP 7.2.1.*), it follows that a subagent would not see any malformed
OID names or values during its processing (EOP 7.2.2, 7.2.3.*).

Should the master receive an agentx response (or agentx-Notify-PDU) with
a malformed OID (EOP 7.2.5.*, 7.2.6), the directions are not
particularly clear.  

If the malformed OID is a name, then the object "must be out of view"
(my own interpretation).  

If the malformed OID is a value, then this may not be caught until the
SNMP response PDU is being formed.  At this time, (RFC 1905 clause
4.2.*) the malformed value would be promoted to a genErr(5) for the
error_status of the SNMP response PDU.  In a master implemtation that
tracks subagent misbehavior, enough promotions to genErr during
snmp-response encoding might cause the master to send an
agentx-Close-PDU to the offending subagent with a
c.reason=reasonOther(1).

---

From: Michael Daniele <[email-masked]>
Date: Fri, 15 Mar 2002 12:51:52 -0500

i think i disagree with the general line of reasoning so far.

>     - an object identifier consisting of a single element;

why, for example, should it be illegal for a subagent to register "1"?

>
> If all master agents are bug-free, these PDUs won't
> be perpetrated, except perhaps by Finnish university
> students.  :-)
>

if a master agent is encoding into AgentX an OID that
does not have a valid BER representation, then it is
going to do so regardless of what AgentX does or doesn't
say in its specification.

the specification already provides several choices for an AgentX
implementation to handle such OIDs.

i don't think anything else need be (over) specified.

mike