tags:

views:

11

answers:

1

Assume a MIB contains a table indexed by MAC address. What's the correct behavior by the agent when a manager requests myTable.0.1? This is an incomplete index.

Some possibilities that I see:

  1. Return the first row in the table -- treat this partial index as coming before the first row.
  2. Treat this as a subtree -- return rows in the table that match this MAC prefix.
  3. Return no rows -- treat this as coming after the last row in the table.
  4. Return some kind of error?
+4  A: 

Depends on the operation.

A GET on an incomplete OID will return noSuchName.

A GETNEXT on an incomplete OID will return the next complete OID.

Note that many manufacturers fail to implement SNMP agents correctly. You can't always count on them to return the next OID as expected.

PP
Thanks. This [net-snmp tutorial](http://www.net-snmp.org/wiki/index.php/TUT:snmpgetnext#OID_Completion) says the same thing. (And in this case, I'm the "manufacturer", so I'm trying to get it right...)
bstpierre
My very first career programming role was developing an agent for SNMP. Subsequently I was amazed at how some of the biggest router and switch manufacturers would fail to implement the RFCs correctly - frequently getnexts stop halfway through a MIB - and how many agent developers really understand the difference between scalar and columnar objects (scalar objects always end in .0)
PP