Abstract

Pseudo Random Number Generators (PRNG) are the base for stochastic simulations. The usage of good generators is essential for valid simulation results. OPNET Modeler a well-known tool for simulation of communication networks provides a Pseudo Random Number Generator. The extension of OPNET Modeler with external generators and additional statistical evaluation methods that has been performed for this paper increases the flexibility and options in the simulation studies performed. Introduction Simulative analysis of complex systems is generally regarded as a scientific method. Stochastic simulations are based on sources of randomness. The randomness can be truly random [2, 3], but is usually created using algorithms called Pseudo Random Number Generators (PRNG). These algorithms do not create true random numbers. Many algorithms for PRNGs have been proposed and have been implemented [5]. Depending on the properties of the PRNGs [7], some of them are more or less suited for usage in simulations [8]. There are many different tests for PRNGs. Good PRNGs and their correct usage is essential for good and valid simulation results [3]. Every simulation environment provides PRNGs for the usage in simulation. In this paper the focus is on the well-known and often used simulation environment OPNET Modeler for communication networks and its Pseudo Random Number Generators. In the following sections the OPNET Modeler PRNG and its limitations are introduced, other available PRNG implementations and statistical evaluation libraries are introduced and an integration of those into the OPNET Modeler is described. An application of the PRNGs and statistical evaluation algorithm into an M/M/1 model is evaluated with regard to the simulation time needed to fulfill the requirements of a given certain maximum relative error. OPNET PRNG According to the documentation of the OPNET Modeler [15] the PRNGs in use in the tool are based on the operating systems random() implementation as shown in Table 1. Operating System Random Number Generator Sun Solaris random() Microsoft Windows random() (an OPNET port from the UNIX BSD source distribution) Table 1: Random Number Generators The usage in simulations is provided by the kernel procedures op_dist_uniform() and op_dist_outcome(). The underlying PRNG is initialized using the seed environment variable, which can be changed in the ‘Configure/Run DES’ dialog. In order to create new instances of the PRNG the kernel procedure op_prg_random_gen_create() can be used. Limitations of the provided PRNG The PRNG provided by the OPNET Modeler has at least four limitations as described in the following paragraphs. Uncertainty of the PRNG Although, as stated in the previous paragraph OPNET is using the BSD random() PRNG, it seems to be a customized version of the BSD random() PRNG. Additionally, it is not clear which version of the BSD random() PRNG it is based on as according to [18] there are at least 3 different versions (SunOS4, libc5, glibc2), which differ in the seeding procedure of the PRNG. The PRNG fails tests According to [16] the BSD PRNGs fails at least the p-value test, which checks the uniformity of the values the PRNG outputs. PRNGs which fail tests should not be used, as several others are passing the test suites [2]. Becker, M.; Weerawardane, T.L.; Li, X.; Gorg, C.: Extending OPNET Modeler with External Pseudo Random Number Generators and Statistical Evaluation by the Limited Relative Error Algorithm. In: Ince, N.; Bragg, A. (eds.): Recent Advances in Modeling and Simulation Tools for Communication Networks and Services. Springer, 2007 Limited number of provided PRNGs The OPNET Modeler provides only one PRNG. However, simulation results are doubtful if created with only one type of PRNG according to [19]. No independence of sequences If there is a need for complete independence of random number sequences, which is usually the case, an external PRNG needs to be used, according to the tools’ documentation [15]. The kernel procedure op_dist_outcome_ext() can be used to get non-uniformly distributed random numbers using an external PRNG. However, the OPNET Modeler’s documentation does not specify how to include external PRNGs into the models. Available PRNG implementations Implementations of PRNG algorithms can be found in many locations of the Internet. Two sources of implementations of PRNGs are introduced in more detail: the Communication Networks Class Library (CNCL) [12] and the GNU Scientific Library (GSL) [13]. Communication Networks Class Library The CNCL is a C++ library created by Communication Networks, Aachen University of Technology, Germany. It provides universal classes, event driven simulation classes, Pseudo Random Number Generators and distribution classes. The PRNGs have the common super class CNRNG. Currently the CNCL provides the following PRNGs: additive random number generator (CNACG), Fibonacci random number generator (CNFiboG), data file random number generator (CNFileG), linear congruential generator (CNLCG), multiple linear congruential generator (CNMLCG), Tausworthe generator (CNTausG). Additionally the CNCL provides statistical evaluation classes, which are derived from CNStatistics: batch means, various limited relative error (LRE) algorithms, histograms and moments. It has been compiled using the GNU compiler collection (gcc) [20] on UNIX operating systems. GNU Scientific Library The GNU Scientific Library (GSL) is a powerful and extensive numerical library for C and C++ programmers. Included in the library are algorithms for complex numbers, vectors and matrices, fast Fourier transforms, histograms, statistics and differential equations among many others. Additionally there are also algorithms for the generation of pseudo random numbers and distributions. The random number generators included are Mersenne Twister, RANLUX, CMRG, MRG, Tausworthe, GFSR, the UNIX PRNGs and many others. A Windows version of the GSL is available at [22]. Approaches to the Integration of external PRNGs and statistical evaluation In order to diminish the drawbacks of the OPNET Modeler’s PRNG and to add functionality with respect to the statistical evaluation, the coupling of external libraries and OPNET Modeler is investigated in this paper. As a first step the integration of the library CNCL and the GSL into OPNET Modeler has been performed. There are different possibilities of integrating external PRNGs and statistical evaluation into OPNET Modeler. In the following we are detailing four approaches. Approach 1: The first approach is to use the source code of the CNCL or GSL and integrate it into OPNET process models. For this approach the code needs to be cumbersomely copied and adopted. When integrated into the process models it is compiled and linked in conjunction with the process models. This approach is viable for OPNET on Linux as well as for Windows operating system. Approach 2: OPNET Modeler provides a way to use other compilers than the usual Microsoft Visual Studio tools. This second approach uses OPNET External Compiler Interface (ECI) as described in [22] and GCC/mingw. ECI is a specification for interfacing OPNET with third-party compilers and linker programs. This approach is viable for OPNET on Linux as well as for Windows operating system. Approach 3: The Linux version of the OPNET simulator could be used. PRNGs and statistical distributions of CNCL could be integrated into the OPNET simulator as a link library. In this case, the task is rather direct because, CNCL, GSL and OPNET are compiling with the GCC compiler. However, this approach is fixed to the operating system Linux. Approach 4: The compilation and linking of the libraries is done using Microsoft Visual Studio tools on the Windows platform in the fourth approach. In order to do so, the CNCL library needs to be slightly adapted as until now it has been compiled using the GNU compiler tools. The GSL is available as a Windows library [22]. Becker, M.; Weerawardane, T.L.; Li, X.; Gorg, C.: Extending OPNET Modeler with External Pseudo Random Number Generators and Statistical Evaluation by the Limited Relative Error Algorithm. In: Ince, N.; Bragg, A. (eds.): Recent Advances in Modeling and Simulation Tools for Communication Networks and Services. Springer, 2007 Integration of external PRNGs and statistical Evaluation As a first way to get independent PRNGs into OPNET approach 1 was chosen. During this research progress was made with regard to approach 4. In the following details on the inclusion of PRNGs using approach 4 are given. The advantages of approach 4 are that it does not involve adaptation of source code by hand, a different operating system and the creation of an external compiler interface. The following steps need to be performed to integrate CNCL/GSL and OPNET: 1. Compilation of the CNCL with the Visual C++ compiler and creation of a link library of the CNCL In order to create a link library, the Configuration Type needs to be set to Static Library (.lib), in the general project properties. Additionally the usage of the Microsoft Foundation Class needs to be specified as a shared library in the properties. The definitions -DCNCL_CC_GCC32 -DCNCL_HAS_BOOL need to be set. A binary library of the CNCL has been made available at [24]. 2. Inclusion of the header files and the library into the OPNET simulation models Include the following in the source code header block of the process model to indicate to OPNET to use the C++ compiler:

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call