C Program for simulating blocking probabilities in multiservice loss systems ---------------------------------------------------------------------------- Author: Jan Hlinovsky, jan.hlinovsky@hut.fi Organisation: Laboratory of Telecommunications Technology, Helsinki University of Technology Contents: 1. Copyright information 2. Compiling the program 3. Input file format 4. Running the program 5. References 1. Copyright information ------------------------ The program can be used and modified freely. No claims are made about the correctness of the program and no liability is taken for any damage caused by the use of the program. 2. Compiling the program ------------------------ In Unix, the program can be compiled using the make utility. Make sure you have all the following files: main.c init.c read.c sim.c init.h read.h sim.h structs.h Makefile The Makefile is written to be used with gcc, so if you want to use some other compiler and linker, replace the corresponding lines in the Makefile. The program uses two functions for random number generation that are not part of the standard C library, namely srand48() and drand48(). Check that you have these (e.g. "grep [sd]rand48 /usr/include/stdlib.h" ). If you don't have these functions you may want to replace them with some other random number generator that returns a value between 0 and 1. If you have gcc and the above mentioned functions, just type "make" in the directory where the source files and the Makefile are. 3. Input file format -------------------- Note! Parameters of the algorithm are obtained by using the method from [1]. Here we assume that the most probable blocking states and the weights of the composite distribution (denoted by x*_j and P_i in [1]) are solved by the user. An input file must be a text file and have the following properties: a) content of an input file is (in following order): number of classes (integer) number of links (integer) load vector rho (real) capacity vector (integer) matrix of bandwidth requirements; (integer) NOTE: nr of rows = nr of classes nr of columns = nr of links matrix of the most probable blocking states; (real) NOTE: nr of rows = nr of links, nr of columns = nr of classes matrix of the composite distribution weights; (real) The matrix element (k, j) is zero if traffic class k does not use link j. NOTE: nr of rows = nr of classes, nr of columns = nr of links b) Every scalar number, vector, or matrix row is on its own line. c) Lines beginning with '%' are ignored (comments). d) Following letters are ignored: []{},; (blocks, braces, comma, semicolon). e) Any number of whitespace (space, tabs, newlines) is allowed, except for rule b): no newlines inside a vector or a matrix row. Examples of input files: ----------------------- The following file is a legal input file: % beginning of example file 1 ----------- 2 3 35 22 100 120 170 2 0 2 0 3 3 50 22 35 40 41.8412 28.7725 0.123524 0 0.876476 0 0.5 0.5 % end of example file 1 ------------------ The following is also legal, and more understandable input file: % begining of example file 2 ------------- %number of classes 2 %number of links 3 % load vector rho [35, 22] % capacity C [100, 120, 170] %B [[2, 0, 2] [0, 3, 3]] % most probable blocking states [[50, 22] [35, 40] [41.8412, 28.7725]] % composite distribution weights [[0.123524, 0, 0.876476] [0, 0.5, 0.5]] % end of example file 2 ------------------- 4. Running the program ---------------------- The program is started with the command ./netwsim. The input file may be given as an argument, otherwise it is asked for. When the program starts, it asks you to enter number of iterations for the simulation and the class you are interested in. Answering 0 will make the program go through all the classes. example: ~ % ./netwsim exmplfile Enter number of iterations:100000 For which class (number) you want to run the simulation? (0 for all):0 ...(program output) The program will write the point estimate of blocking probability and its 95 % confidence interval for each class that is simulated, and some simulation statistics including simulation time and number of hits in the blocking states of each class. 5. References ------------- [1] P. E. Lassila and J. T. Virtamo, "Efficient Importance Sampling for Monte Carlo Simulation of Loss Systems", Proceedings of the ITC-16, Edinburgh, 7-11 June, 1999, Teletraffic Engineering in a Competitive World, Elsevier, 1999, pp. 787-796.