To write applications that use the SNMP protocol for network management, different possibilities exist as well. The mrtg product we presented in 1.2.1 uses the Perl5 library for SNMP by Simon Leinen which itself is also written entirely in Perl. The Perl language  is a scripting language which is interpreted. It is very powerful to write short administrative scripts for management applications. However, the Perl library offers only a limited subset of SNMP commands. The only SNMP operations currently supported are ``GET'' and ``GET-NEXT''. This means that one can neither set variables in an agent, nor receive or generate SNMP traps using these routines. Nevertheless, for solutions like mrtg, Perl5 with this library is an ideal platform, since the code is quite easy to maintain and a CGI program is perfectly capable of handling the task to generate a static graph of SNMP counters. For this particular application it is also of advantage that C programs can be easily used on the server side. Newer versions of mrtg use a C program to maintain the data files in order to speed up the process. Implementing this kind of application with Java would be very inefficient.
With Java, the complete mechanisms of SNMPv2 are available using special class libraries. SNMP support is not included in the Java Development Toolkit (JDK) Version 1.0. Sun is promoting the Java Management API (JMAPI). However, when this work was started, JMAPI had not yet been released and today it is still in a beta test state. An alternative to JMAPI is provided by AdventNet: The ``Advent SNMPv2c Package'' is a class library providing the complete set of functions necessary to write an SNMP application in Java. Advent uses this class library in their ``Advent Web NMS'' product, which can be used to interactively build SNMP applications by assembling pre-built components they provide. The library is widely in use and has shown to be suitable for a broad variety of applications.
For our application, the real-time analysis of traffic flows on a network, CGI programs with static output obviously are not suitable. Therefore we decided to write a Java application based on the AdventNet libraries.
In the following sections, we will describe the Java architecture and how SNMP applications are implemented in this architecture in detail.