I am trying to understand SNMP protocol. I have clear understanding how SNMP works on network level.
We can send UDP request to device, but on this device snmpd should listen for incoming requests.
But I cannot understand MIB & OID.
I understand that MIB is tree structured database that contains hierarchy of different objects with unique IDs (OID).
But I cannot understand following.
Is MIB unique to device ? As far as I understand to get you own branch/node in MIB tree as a vendor, you have to send request to specific organization. This is like DNS system. But again the question is, does specific device contain only specific mib part that is related to this device ?
But as I've read snmp device contains full database MIB, so why this is required, if device can respond only to specific OID ? What happens when SNMP request is sent to device but there no such information available on the device ?
How MIB is maintained ? As I understand if we have full copy of current MIB(defined by standard), MIB itself like a directories structure. So mib objects are modified directly in .mib file or .mib file is just pointer and structure representation and data store somewhere else ?
I would be grateful for any inforamtion that will help me to understand this.
A device (or its SNMP Agent to be precise) can contain whatever objects it likes. Since many (networked) devices often share common objects (for instance related to the Ethernet interface) they make use of common defined objects, as found in common MIBs. For any unique device features it's not uncommon to have an enterprise MIB which defines only the objects specific to the unique device features.
Any object not represented in the Agent will cause the Agent to return an error code (to the likes of OID does not exist).
The MIB is mainly the definition of the OID and syntax of the objects as they can be addressed in the SNMP Agent. It is the Agent that retains the the objects values, usually through the use of callbacks into the rest of the software system.