Skip to content
Home » All Posts » SNMP OIDs Explained – Explore What They Are and How to Correctly Use Them

SNMP OIDs Explained – Explore What They Are and How to Correctly Use Them

snmp network oid type


SNMP stands for Simple Network Management Protocol and it is commonly used to access and manage network equipment such as switches and routers. It has been available for a long time and has evolved quite a lot with better functionality and security. Each SNMP object can be addressed by its Object IDs (OIDs) and I find that many new SNMP users are confused about the SNMP OIDs and how they should be used correctly. There are 3 major kinds of SNMP OIDs, scalar, table and dynamic and each has its own unique way of accessing. This blog will explain each type of OID and show how they can be accessed correctly.

SNMP Scalar Type OID

Scalar SNMP OID represents one single value that is available for GET/SET on a SNMP agent. This type of SNMP OID is represented by a ‘leaf icon’ (if read only) or a “paper and pen” icon (if read and write) on MIB browser.

To access a scalar value SNMP OID, you need to append a zero (0) in the end of the OID number.

For example:
cxSysBplTopologyTree has OID number = .

To access it, you much append a zero (0) in the end to indicate that you want to access this OID as a scalar value. So it becomes = . without this zero, you will get “OID does not exist error”

oid type scalar

SNMP Table Type OID

Table OID represents one or more sets of values that are available for GET/SET on a SNMP agent. This type of SNMP OID is represented by a ‘Table icon’ on MIB browser. Each Table OID must have an index value that can be used by the client to select which table entry to retrieve value from. The index value is represented by the “key” icon on MIB browser and normally it is defined as integer.

To access a value from a Table OID, you need to append an index number that is larger than zero at the end of the OID number

For example:
plSysFWVersion has OID = .

To access it, you must append an index number in the end of the OID number to select one of many table entries. In most cases, (also our case), you need to put the index number = 1 to indicate you would like the value from table entry number 1. So the OID becomes . Without this index number 1, you will get “OID does not exist error”.

Why do we need a table OID?

SNMP is mostly used to manage network equipment and it is common that this network equipment can have multiple Network Interface Card (NIC), for example (eth0, eth1, eth4…etc). If table is not used, you will need to define multiple separate sets of SNMP OIDS, each corresponding to one NIC. This is extremely not efficient and could get messy. Easier way is to define the table OIDs containing only one set of OID common for all NICs, and manager software can access each NIC’s OID values simply by varying the index number

oid type table

Dynamic OID

Dynamic OID is a more advanced usage of Table OID, which involves using more than one value to index table entries. In table OID, we talked about using one integer value to select a table entry by appending a number in the end of OID value. In addition to the integer number acting as primary index, we can define a second index value to further refine the result… like a 2 dimensional table, and we call this dynamic OID. For dynamic OID, the table is defined like the picture below… with 2 keys defined to look up a table value:

plPhyByMACCard and plPhyByMACMAC

snmp oid dynamic table keys

This means in order to retrieve a value from this table, you have to supply 2 key values

• plPhyByMACCard
This is an integer value index, which we will append “1” in our case just like the previous chapter

This is the second index, and it has a type = PHYSADDRESS instead of integer, this means you need to append the 6 byte MAC address (in decimal form) also to the end of the OID in order to retrieve this value

For example:
• plPhyByMACTxPhySpeed has OID = .

We need to append a “1” in the end of the OID due to first index (plPhyByMACCard)
So it becomes .

• Now we need to tell the agent which MAC address we would like to get the PHY speed from, let’s say MAC = 00:0B:C2:12:CD:E3. In our case, this MAC address is sent to the transport in cxSysPeerMacAddr attribute field

• We need to convert the MAC to 6 decimal numbers
So it becomes

• Now we append the six numbers at the end of the OID that has been appended 1 from previous step:
So it becomes .

Why do we need a second key value defined as MAC address?

Let’s say a network switch has 5 devices connected to it having 5 different MAC addresses and there is one dynamic table OID using Network ID and MAC as keys defined to record the PHY speed to each connected equipment. In order for a SNMP manager to read the speed to one MAC equipment, it has to supply both network id and MAC address as index to the SNMP table so the agent can return the speed for respective device. Without dynamic table OID, the client simply cannot retrieve the speed value for any of the devices. SNMP walk can be used to GET all the available table entries, which represent all the devices connected.

snmp oid type dynamic key example

In the screenshot above, I first did a snmpwalk on OID . without any index added, then I receive 2 entries, each entry corresponding to the Tx speed of one MAC. As you can see, even the returned value has the OID + integer index + MAC index. Second, I did a snmpget on OID . and I only get one entry in the result as I have selected.

Join the conversation

Your email address will not be published. Required fields are marked *