GetNext for EntryObject - SNMP

This is a discussion on GetNext for EntryObject - SNMP ; Hi All, I have one table with two indexs like Table A {Index1,Index2,Var1) Index1 is imported from other table.Index2 is defined in TableA. if i invoke a GetNext Request in the TableEntry OID with two instance values(Entry.ValueofIndex1.ValueofIndex2) what would be ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: GetNext for EntryObject

  1. GetNext for EntryObject

    Hi All,
    I have one table with two indexs
    like Table A {Index1,Index2,Var1)
    Index1 is imported from other table.Index2 is defined in TableA.

    if i invoke a GetNext Request in the TableEntry OID with two instance
    values(Entry.ValueofIndex1.ValueofIndex2)
    what would be behavior of the agent ???
    Whether the agent will return the next entry of the instance in the
    table?? (if available)

    Example:

    Let see some table from ifmib ..

    The OID of the ifRcvAddressEntry is 1.3.6.1.2.1.32.1.4.1

    ifRcvAddressEntry OBJECT-TYPE
    SYNTAX IfRcvAddressEntry
    MAX-ACCESS not-accessible
    STATUS current
    DESCRIPTION
    "A list of objects identifying an address for which
    the system will accept packets/frames on the
    particular interface identified by the index value
    ifIndex."
    INDEX { ifIndex, ifRcvAddressAddress }
    ::= { ifRcvAddressTable 1 }

    IfRcvAddressEntry ::=
    SEQUENCE {
    ifRcvAddressAddress PhysAddress,
    ifRcvAddressStatus RowStatus,
    ifRcvAddressType INTEGER
    }

    suppose if i do GETNEXT Request with
    ifRcvAddressEntry.1.11.22.33.44.55.66 with the instance values (Assume
    that the entry is existing in the table), whether agent should return
    the lexcographically next to the entry ...

    Any pointers ...

    Thanks In advance
    /Kamaraj

  2. Re: GetNext for EntryObject

    Hi,

    The agent will always returns the next object in the table, that is,
    the first accessible object (leaf) whose OID is the *smallest strictly
    greater* OID than the provided OID.

    So let's assume I have a table with two integer index (c1) (c2), and
    2 additional columns (c3) (c4), containing 3 rows:

    (c1=1, c2=1, c3="first c3", c4="first c4")
    (c1=1, c2=2, c3="second c3", c4="second c4")
    (c1=2, c2=1, c3="third c3", c4="third c4")

    I am assuming here that c1 and c2 are defined as usual, i.e. as
    not-accessible index columns.

    then

    [Assuming c1 is not imported:
    getNext entry.c1.1.1 => entry.c3.1.1="first c3"
    getNext entry.c1.2.1 => entry.c3.1.1="first c3"
    ]
    getNext entry.c2.1.1 => entry.c3.1.1="first c3"
    getNext entry.c3 => entry.c3.1.1="first c3"
    getNext entry.c3.1.1 => entry.c3.1.2="second c3"
    getNext entry.c3.1.2 => entry.c3.2.1="third c3"
    getNext entry.c3.2.1 => entry.c4.1.1="first c4"
    getNext entry.c4.1 => entry.c4.1.1="first c4"
    getNext entry.c4.2 => entry.c4.2.1="third c4"

    etc...

    Hope this helps,

    -- daniel

    Kamaraj wrote:
    > Hi All,
    > I have one table with two indexs
    > like Table A {Index1,Index2,Var1)
    > Index1 is imported from other table.Index2 is defined in TableA.
    >
    > if i invoke a GetNext Request in the TableEntry OID with two instance
    > values(Entry.ValueofIndex1.ValueofIndex2)
    > what would be behavior of the agent ???
    > Whether the agent will return the next entry of the instance in the
    > table?? (if available)
    >
    > Example:
    >
    > Let see some table from ifmib ..
    >
    > The OID of the ifRcvAddressEntry is 1.3.6.1.2.1.32.1.4.1
    >
    > ifRcvAddressEntry OBJECT-TYPE
    > SYNTAX IfRcvAddressEntry
    > MAX-ACCESS not-accessible
    > STATUS current
    > DESCRIPTION
    > "A list of objects identifying an address for which
    > the system will accept packets/frames on the
    > particular interface identified by the index value
    > ifIndex."
    > INDEX { ifIndex, ifRcvAddressAddress }
    > ::= { ifRcvAddressTable 1 }
    >
    > IfRcvAddressEntry ::=
    > SEQUENCE {
    > ifRcvAddressAddress PhysAddress,
    > ifRcvAddressStatus RowStatus,
    > ifRcvAddressType INTEGER
    > }
    >
    > suppose if i do GETNEXT Request with
    > ifRcvAddressEntry.1.11.22.33.44.55.66 with the instance values (Assume
    > that the entry is existing in the table), whether agent should return
    > the lexcographically next to the entry ...
    >
    > Any pointers ...
    >
    > Thanks In advance
    > /Kamaraj



  3. Re: GetNext for EntryObject

    Kamaraj wrote:

    > if i invoke a GetNext Request in the TableEntry OID with two instance
    > values(Entry.ValueofIndex1.ValueofIndex2)
    > what would be behavior of the agent ???
    > Whether the agent will return the next entry of the instance in the
    > table?? (if available)


    Well, yes. To understand how things work, you have to realize that
    the MIB designer thinks in tables. So the MIB designer's view of
    the world is a set of interrelated tables.

    However, the protocol operations just operate on an ordered lists of
    existing variables. And a getnext always returns the next existing
    variable (as long as there exist a next variable).

    The glue between these two viewpoints is lexicograhic ordering which
    turns the tables in the MIB designer's view into the ordered list of
    existing variables which the protocol operates on.

    Once you manage to think in both worlds, you will see that many of the
    first surprising behaviors you can observe in the SNMP world as a
    beginner have a very natural explanation.

    /js

    --
    Juergen Schoenwaelder International University Bremen
    P.O. Box 750 561, 28725 Bremen, Germany

  4. Re: GetNext for EntryObject

    Juergen Schoenwaelder wrote in message news:<1064415849.157374@salvator.ibr.cs.tu-bs.de>...
    > Kamaraj wrote:
    >
    > > if i invoke a GetNext Request in the TableEntry OID with two instance
    > > values(Entry.ValueofIndex1.ValueofIndex2)
    > > what would be behavior of the agent ???
    > > Whether the agent will return the next entry of the instance in the
    > > table?? (if available)

    >
    > Well, yes. To understand how things work, you have to realize that
    > the MIB designer thinks in tables. So the MIB designer's view of
    > the world is a set of interrelated tables.
    >
    > However, the protocol operations just operate on an ordered lists of
    > existing variables. And a getnext always returns the next existing
    > variable (as long as there exist a next variable).
    >
    > The glue between these two viewpoints is lexicograhic ordering which
    > turns the tables in the MIB designer's view into the ordered list of
    > existing variables which the protocol operates on.
    >
    > Once you manage to think in both worlds, you will see that many of the
    > first surprising behaviors you can observe in the SNMP world as a
    > beginner have a very natural explanation.
    >
    > /js


    Let me explain my problem with a simple example with ifTable

    If i do GetNextRequest for ifEntry.3 (assume there is only one entry
    in the ifTable with index value as 1) what would be the behaviour of
    snmp agent???

    whether the agent would return the value of the first entry of the
    third
    column in the table(i.e, value of IfType.1) or return error?

    I have checked with Microsoft snmp agent and it returns IfType.1
    value.
    Is it correct?

    Thanks In advance
    Kamaraj

  5. Re: GetNext for EntryObject

    In article <2318efa1.0309250303.7e900314@posting.google.com>,
    pkamaraj@rediffmail.com says...

    > If i do GetNextRequest for ifEntry.3 (assume there is only one entry
    > in the ifTable with index value as 1) what would be the behaviour of
    > snmp agent???


    ifEntry.3 = ifType = 1.3.6.1.2.1.2.2.1.3 by the way.

    > whether the agent would return the value of the first entry of the
    > third column in the table(i.e, value of IfType.1) or return error?


    It should never return an error unless there are no other objects in view
    with OIDs greater than the one specified in the request. Since you're
    requesting a get-next from ifType, and you've indicated that ifType.1
    exists (and presumably is "in view" according to permissions and such)
    then the agent will return ifType.1.

    > I have checked with Microsoft snmp agent and it returns IfType.1
    > value.
    > Is it correct?


    Yes.

    You could also do a get-next from 1.3.6.1.2.1.2.2.1.3.0.0.0.0.0.0.0
    (ifType.0.0.0.0.0.0.0) or 1.3.6.1.2.1.2.2.1.3.0.9999999
    (ifType.0.9999999) and so on, and still get back ifType.1, because
    ifType.0.* is less than ifType.1. It doesn't matter that ifType.0.*
    doesn't exist (and can never exist since ifIndex's minimum value is 1) -
    it'll always return whatever's next.

    The only likely exceptions are (1) agent's that don't support
    subidentifiers with values up to 4294967295 (in which case the agent
    isn't compliant) yet you give it one somewhere (e.g. a get-next on
    ifType.0.4294967295), or (2) you specify an OID with more than 128
    subidentifiers, which is the maximum allowed by SNMP (in which case an
    agent could rightly reject the request as being malformed, but a robust
    agent wouldn't, provided it doesn't use fixed-length buffers or something
    that would lead to overruns in the decoder).

    --
    Michael Kirkham
    Muonics
    http://www.muonics.com/

  6. Re: GetNext for EntryObject

    Kamaraj wrote:

    [...]

    > Let me explain my problem with a simple example with ifTable


    > If i do GetNextRequest for ifEntry.3 (assume there is only one entry
    > in the ifTable with index value as 1) what would be the behaviour of
    > snmp agent???


    As I said before, the agent returns the next lexicograhic variable that
    is accessible or an error if there is no lexicograhic next variable
    (which does not apply in your example).

    Turn the tables, rows, columns whatever into a lexicograhically ordered
    list of variables and you will understand what happens and why.

    /js

    --
    Juergen Schoenwaelder International University Bremen
    P.O. Box 750 561, 28725 Bremen, Germany

+ Reply to Thread