ipForwarding
, icmpInEchoes
and tcpMaxConn
?
Give solutions using each of the get and get-next
commands.
Before we start - most SNMP implementations allow the user to short-circuit (or abbreviate) the first part of the officialOBJECT IDENTIFIER
for the SNMP MIB. Thus, instead of specifing{ 1 3 6 1 2 1 ip(4) }
, we can refer to the same node of the name tree as simplyip
. This is very convenient.For
ipForwarding
, you could dosnmpget ... ip.ipForwarding.0
, where the "..." means there's other stuff in here we can't be bothered with right now. If I replaced thesnmpget
withsnmpgetnext
, I could leave off the trailing.0
Similarly, foricmpInEchoes
(which, incidentally, gives a measure of how often this item of equipment has been pinged), I could dosnmpgetnext ... icmp.icmpInEchoes
Note the absence of the trailing.0
- I could put it in if I wanted and instead dosnmpget
.
FortcpMaxConn
(the maximum number of simultaneous TCP connections which this equipment can support) I could do either ofsnmpget ... tcp.tcpMaxConn.0
orsnmpgetnext ... tcp.tcpMaxConn
.Note that what I've written here is in terms of the CMU SNMP library of command-line SNMP functions. The
snmpget
andsnmpgetnext
commands simply implement the get and get-next requests of the SNMP protocol. Students can (if they wish) look up the Unixman
pages for these commands to see how they're used in real life. They would also discover how these commands implement the shorthand MIB specification mentioned at the start of this solution.
It's important to note that just because these command-line software tools permit abbreviations, nevertheless the actual SNMP protocol only deals with fullOBJECT IDENTIFIER
s. What actually gets requested is, for example,get(1.3.6.1.2.1.4.4.0)
, the fullOBJECT IDENTIFIER
foripForwarding
.
ifTable
)
in the interfaces portion of the standard MIB, edited to fit the
page. The table consists of a sequence of ifEntry
elements. Values
shown are from the router r-bgowan
at Bendigo.
It's a serial point-to-point link running at 252kbps. In fact, it used
to be the serial ISDN (4 B channels) between Bendigo and Bundoora, back
when the r-bgowan
router was still in regular service
(it's now a backup to the microwave link). Technical aside:
the value 252000 is what happens when you aggregate 4xB channels
(each 64kbps) into a single fast link. Because Telstra doesn't guarantee
any timing relationship between different B channels, this 4kbps
aggregation overhead allows additional synchonisation codes to
be sent to make sure that things don't get out of timing.
This is actually a bit of a trick question. The clue to how this is done is the column markedifIndex
, which is the last thing that has to appear in the request. Thus, a suitable request might be:snmpget ... interfaces.ifTable.ifEntry.ifSpeed.1
where a trailing.0
zero is not needed, because theifIndex
performs the equivalent function of defining an instance value.
The get-next operation returns the next object in a depth first search of the tree. Thus, in this case it simply increments theifIndex
by one, so you'd get the value ofifSpeed.3
which is 252Kbps. More interesting, perhaps, is what you'd get if you requested get-next(...ifSpeed.3), which would be the first item in the next column. If you think this is confusing - you're right! Tables in SNMP are jolly messy, IMHO.
In his definitive (and very readable) reference to SNMP The Simple Book[1], Marshall T. Rose states that the get-next request is particularly powerful because it gives a very simple and effective way of browsing the MIB in a particular piece of equipment. You can also apply it repeatedly to fetch all of the management information from a router, etc. Exercise - how?
The SNMP portion of the MIB contains information about the operation of the SNMP subsystem itself - for example, how many SNMP GET-Requests have been received by this system. Of course, if you ask a router how many times it's had an SNMP request, you thereby add one to the total of SNMP requests!