Subject: [Agentx] Empty context in rfc2742

From: Magnus Fromreide <[email-masked]>
Date: Sun, 30 Aug 2009 11:17:23 +0200

Hello.

According to rfc2742 agentxRegContext (octet string) is
     "The context in which the session supports the objects in this
      region.  A zero-length context indicates the default context.
     "

Now I am would like to know how a zero-length context should be
represented?

/MF

---

From: Mark Ellison <[email-masked]>
Date: Sun, 30 Aug 2009 13:48:34 -0400

> Now I am would like to know how a zero-length context should be
The default context is an OCTET STRING of zero-length.   How to
represent this depends upon where it is being represented.

On the wire, the tag is "OCTET STRING" the length is zero(0) and the
value occupies no octets.  There are numerous examples of OCTET
STRINGs that may be zero-length in IETF standard MIB modules.

For example, in the UsmUserTable, the usmUserPublic may be a
zero-length string.  In the USM MIB module, tthe usmUserPublic object
definition shows he zero-length string as represented by the DEFVAL
clause:  { ''H }  -- the empty string.

A zero-length string and the empty-string are synonymous.

- Mark
http://EllisonSoftware.com

---

From: Magnus Fromreide <[email-masked]>
Date: Sun, 30 Aug 2009 23:41:16 +0200

On Sun, 2009-08-30 at 13:48 -0400, Mark Ellison wrote:
> The default context is an OCTET STRING of zero-length.

Not according to RFC 2741 6.1.1 §4.

In agentxRegContext we are looking a AgentX registrations and in this
domain it is explicitly stated that NON_DEFAULT_CONTEXT "" is distinct
from DEFAULT_CONTEXT but I can see no provision for the MIB to represent
that.

> How to represent this depends upon where it is being represented.
> 

This is about the specific case of AgentX - we are talking about a
zero-length string and a non-existing string.

---

From: Mark Ellison <[email-masked]>
Date: Sun, 30 Aug 2009 18:23:26 -0400

Hi Magnus-

> from DEFAULT_CONTEXT but I can see no provision for the MIB to represent

Thanks for this reference- your original question was in regard to RFC
2742.  As the agentxRegContext object-type definition states, "A
zero-length context indicates the default context".  I believe this is
consistent with my previous reply.

The 2741 section cited above applies to the AgentX header.
Effectively, for 2742 you won't have a zero-length context name for a
non default context.

In the SNMP, the AgentX context is mapped from the SNMPv3 contextName
in the scoped PDU (most current is 3411 sxn 3.3.3).  Since every
contextName within an SNMP entity MUST be unique there can not be both
the default context and a non default context with a zero-length
string.

---

From: Magnus Fromreide <[email-masked]>
Date: Mon, 31 Aug 2009 22:32:57 +0200

> Hi Magnus-

Hello Mark.

> 2742.

Well, they are somewhat related since 2742 has no purpose without 2741.

> As the agentxRegContext object-type definition states, "A

I fear that we are speaking past each other and will do one last attempt
to ask my question.

> Effectively, for 2742 you won't have a zero-length context name for a

As I understand 2742 agentxRegistrationTable is a view into the set of
registrations that the sessions have done with the master agent and thus
the values of that table should match the values in the actual
registrations as far as possible.

> the default context and a non default context with a zero-length

While this is true it is also true that the agent is free to map the
AgentX-contexts to SNMP-contexts however it wish so I think this impose
no limits on the values of AgentX-contexts.

This question is only regarding the _values_ of the agentxRegContext
column.

As I said above it believe that agentxRegContext should represent the
values of the AgentX-context for all AgentX-registrations that is made
on the AgentX-side of the master agent.

The problem is that the value set for AgentX-context contains one
element more than the value set for OCTET STRING.

I am asking how the AgentX-context value that don't fit into the mapping
from AgentX-context to agentxRegContext should be handled.

EXAMPLE:

Assume that two AgentX registrations are made to a master agent that
implements rfc 2741 and rfc 2742.

1: { r.flags = 0, <no r.context>, ... }
2: { r.flags = NON_DEFAULT_CONTEXT, r.context = "", ... }

Now as I read 2742 the value of the agentxRegContext column for
registration #1 is ""

The question is what the value of the agentxRegContext column for
registration #2 should be?

/MF