This page contains the code etc for the simulation of a Go-Back-n protocol Ms Kanigiluppai has written. This is the version with input of parameter values throught the file input.h (etc). To run the simulation: Copy the file called ``simulator1.zip'' to a file of the same name in your own directory, say in a subdirectory called CIS451sim1 (or so). In that subdirectory, unzip the .zip file. In Unix, the command is (prompt) unzip simulator1 This gives you a number of files. One of these is the same as Ms Kanigiluppai's README file on this page. Others are the (example) input.h file, output file, and other files with definitions (.h files) and code (.cpp files). Ms Kanigiluppai's README file contains instructions on how to compile and run the simulation. For the time being, you do input through the input.h file: If you want to run with different input parameters, you have to edit the input.h file, and compile and run again. The ``termination condition'' for the simulation is given by FINAL_FRAME . The source node will generate a total number of FINAL_FRAME data frames. This includes transmissions and re-transmissions: If dataframe sequence = 17 is transmitted by node1 three times, it counts as three frames (for FINAL_FRAME). That is the reason that with FINAL_FRAME = 100 the highest sequence number we see in the example output is 40. So out of 100 data frames generated, 60 were: Either still there at the end, or had been damaged, or lost, or discarded by the destination, or retransmitted by the source. (Some: more than one of these!) The ``simulated process'' starts at ``simulated time'' 0.0000 and at time 1.11144 sec ACK(39) arrives at node 1. However, the frame with sequence number 1 is ``done'' by time zero, so from time 0.0000 until time 1.11144 only 38 frames are ACKED. (If a frame gets acked more than once, it counts only once). This means the ``goodput'' is 38/(1.11144) frames / sec. I.e. 34.1898798 frames/sec. If you want to do a project based on this simulation tool you must investigate how this goodput behaves if you change: Window, Propagation Delay, Probability of Loss, Probability of Damage, Frame size, Linespeed, Time_out. (If node 1 hands a dataframe to buffer 1 at time t, it sets a time-out for time t + Time_out). (Not ALL of these! Make a plan of what measurements are ``interesting''). Some of these parameters can be changed by editing the file input.h and then recompiling the code. In addition to the file input.h there is a file constants.h which also sets parameter values. You may also want to change these parameter values. constants.h contains a ``static double'' offset = .000001 (1 mu-sec). When a ``node'' hands several frames to the ``buffer'' ``simultaneously'', it actually spaces them out by ``offset''. Under certain special circumstances, ``offset'' must be decreased below 1 mu-sec, see node.cpp . The seed for the generator of pseudo-random number is nailed down at 101 in the file simulator.cpp . A more convenient way (for most purposes) of changing parameter values is implemented in the code in the page ``New Simulation''. If you want to do an ambitious project, you can change the code (the implementation of the protocol) and see what consequences that has. The code as it is given implements ``uni-directional'' go-back-n: Node 1 only sends data frames, Node 2 only sends Acknowledgements. An ambitious project would be to make the protocol bi-directional, with acknowledgements piggybacked on dataframes. Quite ambitious would be to modify the protocol to a ``Selective Repeat'' protocol. That needs a fair amount of additional coding! Teun Ott.