views:

171

answers:

1

I am working on a network monitoring application and need to know what versions of SNMP are backwards compatible with the other versions. I am writing the program in Java and using SNMP4J to query OIDs on particular devices. Within SNMP4J, you must specify the version of the SNMP device when setting up the target.

Currently, there is SNMP versions 1, 2c, and 3. If I have a device that is SNMP version 1, will SNMP version 2c or 3 be backwards compatible with that version?

If device is version 2, will 1 or 3 be backwards compatible?

... and so on

Anyway, all the help is greatly appreciated,

Steve

+1  A: 

SNMPv1 uses community strings, which became context-IDs in SNMPv2c. Essentially it's the same thing but a slightly different way of looking at things.

SNMPv3 has security and all kinds of additions that make the protocol anything but simple.

If you try and make SNMPv2c requests on a SNMPv1 device you will run into problems if the SNMPv2c manager is using get-bulk requests (where it requests more than 1 subsequent object at a time, useful for pulling in columnar objects quickly). SNMPv1 has no support for bulk operations.

So, a SNMPv1 manager may be able to retrieve objects from SNMPv2c agents. But a SNMPv2c manager may have trouble getting objects from a SNMPv1 device.

Mixing SNMPv3 with anything else is asking for trouble.

PP
Within SNMP4J, it seems as though there is no backwards compatibility. It seems very strict in versioning. When I set the target for SNMP version 1, I am unable to retrieve OIDs from SNMP version 2c device. To be more specific, it gives a No Such Name error.Does this sound correct? or am I missing something?
stjowa
"No such name" is a valid SNMP response: it indicates that you attempted to get a variable that does not exist. Did you know that scalar objects (i.e. not part of a table) MUST have an OID that ends in ".0"?
PP
SNMP agent designers have more control on this topic. If they decided an agent only supports a specific SNMP version, you lose the freedom to manage the device using other SNMP versions.
Lex Li