Brief outline of the project
Several options were considered for implementing the simulator for this project:
The three options listed above represent three different ways of developing software. Method 1 is the bottom-up approach. In this method, the core of the simulator would be deveopled first. The simulator core would consist of functionalities like event management, Input/Output, and simulation execution. Once the basic simulator would be completed, the networking simulations could be built above it. Programming the simulator from scratch would provide the most flexibility in designing the software according to the needs of this project. A simulator language like csim provides all the flexibilities of C together with specific functions for simulator development. The core could be written in csim, and the networking protocol could essentially be written in a language like C. The biggest drawback to this method was the huge startup time for the project. A few months would be needed to implement and debug a robust simulator.
The second method uses commercially available simulater packages like Comnet, Opnet etc. Both Comnet and Opnet are networking simulator packages and are used extensively in research and industry. The packages have a very robust simulator core together with a good input output interface. Morover, both Comnet and Opnet come with an extensive library of networking protocol modules like ethernet, FDDI, TCP/IP etc. The input/output interface allows modules to be graphically fitted together to create configurations. There are several features for running simulations, logging parameter values and analysing results. The opnet and comnet interfaces provided the good environment for an educational and research setting. However, we rejected Comnet because it was very inflexible. None of the source code for the built in library modules was available. Moreover, new modules were very difficult to add. Thus, the Comnet user is restricted to experimenting with the set of networking protocols provided by the package. Opnet did not have that problem. All the source for the library modules was available, and was written in the C language syntax. New modules were easy to add, and could be done graphically as well as through programming (or a combination or both). However, a goal of our project was to make our product freely available to use and modification. A commercial product like Opnet would present several restrictions to that end. We also intended to port our product to several platforms, and with Opnet, we would be restricted to its portability. We decided not to use Opnet mainly because it was not free.
Method 3 was generated from our previous experience with Netsim[1] for research purposes. Netsim is a publicly available ATM simulator originally developed at MIT. Netsim is written completely in C, and its source code is freely available and modifiable. The Netsim simulator is quite robust, and it has a rudimentary X interface. Netsim represented a middle ground between the first two options. It would reduce our startup time for two reasons. First, it already had a complete simulator built into it. Second, we had been using Netsim for our research, and we had modified much of it ourselves. We separated the X interface in Netsim from the simulator core, and the protocols. The X interface has now been redesigned in Tcl/Tk as described in the next section. The simulator core and the protocol code were intertwined in the original code, and we separated the two components for modularity and portability.
Netsim has a Graphical User Interface (GUI) written in Xlib[2]. The GUI has been designed to be efficient. It allows the user to enter network configurations and specify parameters graphically. The user can also run the simulation, and observe the activity of the network during the simulation. The GUI however is very primitive and is inadequate for instructional purposes. It is not fault-tolerant to novice users. An incorrect sequence of keys or mouse clicks could cause the simulation to crash. The simulator has very limited features and most standard functionalities are missing. Moreover, the design and implementation of the GUI is poorly engineered with respect to modifiability. The code cannot be easily expanded to provide additional functionality and fault-tolerance. In designing instructional software, the GUI plays an very important role. As a result, we have designed a new GUI to work with the core Netsim simulator code.
The following reasons have been considered for the design of the new interface:
Although Xlib is the building block of all programs using X-windows, most practical applications choose some other toolkits such as Motif [3] or Tcl/Tk [4] as their starting point. These tool kits are built on top of Xlib (to be precise, Motif is built on top of X Toolkit Intrinsics [3], which in turn on top of Xlib), and provide advanced functionality in addition to the Xlib functions. Furthermore, both toolkits hide many tedious details of GUI programming which would have to be handled by the programmer in Xlib.
Currently there are several X-interface toolkits available for use.Of these, Motif and Tcl/Tk are used in most Unix environments. Motif was developed by the Open Software Foundation (OSF) and is available on most Unix platforms. It is designed to be invoked using C or C++, and is best suited for applications which require high performance for graphics or animation. It also provides convenient tools like pull-down menus, scroll bars. Graphics-intensive applications usually choose Motif as their building block.
Tcl/Tk was developed by John K. Ousterhout at UC Berkeley. Tcl/Tk is a script language which also provides a C and C++ interface. Being a script language, Tcl/Tk provides the convenience of fast prototyping. The GUI can be easily modified and tested without recompiling the code. This is very helpful when developing and maintaining the GUI. The C interface provides access to the Xlib functions, thus delivering the performance required by an application. Currently, Tcl/Tk is available on Unix platforms, but it will be ported to PC environments in the near future. The alpha release of Tcl/Tk for Windows (Win32s, Windows 95, or Windows NT) was available in USENIX 96 in January, 1996.
The learning curves of both Tcl/Tk are similar. Both are relatively easy to learn with a C like programming style. Tcl/Tk in additions supports a script language. Tcl/Tk was chosen over Motif as the language for designing the GUI for the following reasons:
Survey results, Labs, current status.
[1] netsim (? where did we get it?)
[2] Xlib: was developed by MIT and by DEC. See "Xlib reference manual," edited by Adrian NyeXlib, 1993. Published by O'Reilly & Associates.
[3] Motif: developed by Open Software Foundation (OSF). See "Motif programming manual," by Dan Heller and Paula M. Ferguson, 1994. Published by O'Reilly & Associates. The most recent stable version is Motif 1.2.
[4] Tcl/Tk: developed by John K. Ousterhout when he was with Berkeley. Usually pronounced as "tickle-tee-kay." The most recent stable version is Tcl7.4/Tk4.0, June 1995. See "Tcl and the Tk Toolkit," by John K. Ousterhout, 1994. Published by Addison Wesley.