NYCPHP Meetup

NYPHP.org

[nycphp-talk] SNMP really that "simple"?

John Lacey jlacey at att.net
Fri Jul 2 00:59:24 EDT 2004


Jon Baer wrote:

>Is SNMP really that "simple"?  
>
>Maybe its just me or does it sometimes seem like MIBS are so entirely complex that 
>the name of the protocol does not do it justice?  I dont see that many PHP based 
>admin tools, does anyone know of any?  It also seems like many of the hardware 
>items Ive toyed around with are Ver 1 based vs. 3 ... its a protocol that screams 
>for XML yet they stick with this SMI stuff.  Maybe someone w/ more SNMP experience 
>can explain.
>
>  
>
Well, SNMP is great for bandwidth economies.   When SNMP was first 
spec'd, we didn't have the benefit of cheap high-speed links. 
As such, it's based on a Tree structure, with numbers associated with 
tree elements and sub-elements.  The numbers in the Tree become object 
identifiers.
Note the tree includes other categories/standards.

                       Root
          ccitt-0   iso-1   iso/ccitt-2
                      / 
             org-3
                   \
                dod-6
                   /
             internet-1
    /             |              \                       \
private   directory     management-2    experimental
                                  |
                               MIB-1

So, when transmitting information from the managed object (e.g. a 
monitoring agent in a router) to the manager (e.g. HP OpenView),
the numbers:
    1.3.6.1.2.1
... indicate MIB information (follow the number string down the tree).

Now, there are MIB Groups, that indicate WHAT type of information is 
being sent.  IP is Group 4, with 33 objects.  .ICMP is Group 5 with 26; 
TCP is Group 6 with 17 objects; UDP is Group 7 with 4, etc.

Let's say we wanted to retrieve the number of IP datagrams/packets that 
were discarded (if any) by a router because of a lack of buffer space.
Since IP is Group 4 the numbers:
    1.3.6.1.2.1.4
... indicate the IP Group

Now let's say for the sake of discussion that out of the 33 objects that 
can be tracked in the IP layer, IpInDiscards is represented by the 
number 9.  So, the number string:
    1.3.6.1.2.1.4.9
... indicates the IpInDiscards data follows (we hope that number is 0 of 
course :)

If XML were used instead, names would be used instead of numbers.  for 
example:
   < iso>
        <org>
          <dod>
etc..

That's SNMP in a nutshell.  The MIB object numbering scheme makes for 
efficient transmisson and is easier on CPUs -- remember, we weren't 
trucking along with Pentium 4's @ 3GHz when SNMP was designed.

The above is a snippet from a series (Protocol Analysis) that I 
co-authored a while ago.  Not to date myself as too ancient, but I 
worked on some SNA MIB specifications and some other network-related RFCs.

HTH,
John




         




More information about the talk mailing list