Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ucbvax!eng.xyplex.com!rlstewart From: rlstewart@eng.xyplex.com (Bob Stewart) Newsgroups: comp.protocols.tcp-ip Subject: Re: What are the rules for Object Instances? Message-ID: <9106040008.AA24232@xap.xyplex.com> Date: 4 Jun 91 00:08:55 GMT References: <23109@shlump.lkg.dec.com> Sender: daemon@ucbvax.BERKELEY.EDU Distribution: world Organization: The Internet Lines: 32 I would have responded directly to the questioner, but the address full of !s and dec.coms scared me off. Besides, the answer may be of general interest. SNMP object instancing is designed to be simple and regular, so, in a sense, every object has an instance identifier, whether it can actually have multiple instances or not. To completely identify the object, that instance identifier goes on the end of the object identifier. For an object with only one possible instance, such as sysDescr, the instance ID is 0. For an object with multiple instances, such as ifSpeed, the instance identifier suits the object and is non-zero. The instance identifier for an interface is ifIndex, a small integer, which gets tacked onto the end of the ifSpeed object identifer to say which instance you want. A zero on the end of ifSpeed is not valid. A non-zero on the end of sysDescr is not valid. So why is the observed behavior confusing? It may be bugs or it may be agents that are trying to be extremely tolerant. It also may be the difference between get and get-next. Strictly speaking, for get and set you must supply the entire object identifier, including instance identifier. On the other hand, get-next is so powerful, you can leave off as much of the object identifier as you want to, and the agent will find what's lexically next. A handy result of this power is that you can get-next an object identifier with the instance completely missing, and get-next will return the first instance of that object. Using that full object identifier in your next get-next will get you the 2nd instance, and so on until there are no more instances and you'll get whatever lexically follows the last instance. You can thus discover all the instance identifiers. I hope that helps. Once you're immersed in this stuff it's easy to forget what it took to get that far under. Bob