2. P a g e 1 | 7
3 Wireless link model
3. Look at the code and answer the following questions.
(a) What does IATM represent?
Ans. It represents Inter-Arrival Time Distribution.
(b) What does SVTM represent?
Ans. It represents Service Time Distribution.
(c) How are customers created?
Ans. Customers are created by this command- create(“cust”);
This is the /*required create statement*/.
(d) What does hold(expnt 1(IATM)) mean?
Ans. It means that the program will hold an exponentially distributed inter-arrival time before
going to the next customer.
(e) If instead hold(IATM) was inserted, what would that mean?
Ans. It means that the program will hold in linear form for the given inter arrival time not in the
exponential form.
(f) What does hold(expnt 1(SVTM)) mean?
Ans. It means that it will hold for an exponentially distributed service time. Basically it is related
to time in which the customer is being processed.
4. Execute the simulation for the following input parameters
nice filename 0.5 1.0 10 > outputfilename1 &
nice filename 0.5 1.0 100 > outputfilename2 &
nice filename 0.5 1.0 100000 > outputfilename3 &
nice filename 0.5 1.0 100000000 > outputfilename4 &
nice filename 0.95 1.0 10 > outputfilename5 &
nice filename 0.95 1.0 100 > outputfilename6 &
nice filename 0.95 1.0 100000 > outputfilename7 &
nice filename 0.95 1.0 100000000 > outputfilename8 &
Ans. Output files have been attached.
3. P a g e 2 | 7
5. What conclusions can you make about the relationship between the number of arrivals
you are simulating, the utilization of the system, and the rate at which the simulation
results converge to the analytic results?
Ans.
a) When the number of arrivals go beyond 100000 at that time the simulation results converge to
the analytic results. When the number of arrivals increases from 10 to 100, the throughput
fluctuates near to the theoretical value of 0.5.
b) Also, response time, service time and time in queue are not close to the theoretical value.
6. What was the total simulation time for each simulation?
Ans.
OUTPUT SIMULATION
1 22.973
2 172.705
3 198288.489
4 200008809.533
5 12.209
6 113.856
7 105061.033
8 105284410.702
7. What was the total CPU time for each simulation?
Ans.
OUTPUT CPU TIME(seconds)
1 0.000
2 0.000
3 0.116
4 130.892
5 0.000
6 0.001
7 0.136
8 132.310
4. P a g e 3 | 7
8. Enable the warmup reset by removing the comments from the following lines of code:
/* wait(warmup); */
/*reset(); */
/* if(cnt==NARS-10000) */
/* set(warmup); */
Ans. Enabled.
5. P a g e 4 | 7
9. Recompile and execute the simulation for the following input parameters
nice filename 0.95 1.0 20000 > outputfilename9 &
nice filename 0.95 1.0 100000 > outputfilename10 &
Ans. Output files have been attached.
10. Is there any difference in the rate of convergence to the analytical results? Explain?
Ans. It depends on the number of arrivals. So when the number of arrivals increases the
simulation results become more convergent with the analytical results. The data of last 10000 is
reset due to the warmup event to eliminate startup bias.
6. P a g e 5 | 7
4 CSMA Network
4. Take a look at the source code CSMA-network.c.
1. Why do you think the process that is creating arrivals in this model has an infinite loop
for(;;) rather than specifically specifying the number of arrivals for(i =0;i < NARS;i++) as
in the M/M/1 model?
Ans. Because of the exponential back-off process. It might be possible that the process has to run
infinitely because of exponential back-off process.
2. What prevents the model from running forever?
Ans. The following lines of code prevent the model from running forever:
if(cnt = = 0)
set(done);
Basically when cnt = 0, the done event starts taking place which gives the permission to the last
customer to signal to the main process that they are the last one and they are about to leave the
system.
3. Explain in detail how the back-off mechanism works.
a. reserve(f1);
Ans. The facility is checked first before sending a packet.
b. hold (expntl(BETA));
Ans. The hold function stops the facility for an exponentially distributed BETA time.
c. while (busy = = 1)
Ans. It enters the while loop where busy is initiated with 1 and when busy = 1, it enters
the back-off process.
d. hold(expnt1(BETA));
Ans. In the back-off process, it holds for an exponentially distributed BETA time.
e. busy = 1;
f. hold(expnt1(SVTM));
g. busy = 0;
h. release(f1);
Ans.(e,f,g,h): After the service time, the busy is set to 0 so that the back-off process is
will not start again and then the facility will be released.
7. P a g e 6 | 7
4. What would happen if the variable busy was initialized with the value 1 instead of 0?
Ans. The program won’t be able to go into the back-off process as the criteria for entering the
while loop is not satisfied.
6. Compile and run CSMA-network.c with the following parameters.
nice CSMA-network 0.1 1.0 1.0 1000000 > outputfilename11 &
nice CSMA-network 0.1 1.0 2.0 1000000 > outputfilename12 &
nice CSMA-network 0.1 1.0 5.0 1000000 > outputfilename13 &
Ans. Output files have been attached.
7. Compare the results you get with Kleinrock and Tobagi’s results.
Ans.
Throughput from
Kleinrock and Tobagi’s
Expression
Average Throughput from
the program
90.90 90.74
95.23 95.17
98.03 97.86
5 Wireless CSMA with Forwarding
1. Are the buffers finite or infinite?
Ans. The buffers are finite.
2. For each source, look at the path from the source to the access point. What are the
collision domains for each hop in the path?
ANS. each BSS acts as a single Ethernet collision domain. A BSS can overlap with the another
BSS to provide a greater coverage area. Each BSS can be its own channel to provide separate
collision domains. BSS(basic service set).
3. Compile and run the program with the following parameters:
nice CSMA-repeater 0.16 1.0 1.0 10 1000000 > outputfilename14 &
nice CSMA-repeater 0.16 1.0 1.0 50 1000000 > outputfilename15 &
nice CSMA-repeater 0.16 1.0 1.0 100 1000000 > outputfilename16 &
nice CSMA-repeater 0.16 1.0 1.0 200 1000000 > outputfilename17 &
8. P a g e 7 | 7
Ans. Output files have been attached.
4. Does increasing the buffer size help with throughput?
Ans. No, the buffer size does not help with the throughput.
5. Does increasing the buffer size help with loss?
Ans. Yes, the buffer size will help with the loss. By increasing the buffer size loss can be
controlled.
6. Which repeaters are the bottlenecks?
Ans. Wireless access point. It offers the possibility to be configured as wireless repeaters, this
provides the same kind of wireless forwarding but in the managed way. 7th facility is the
bottleneck repeater.
7. Run the program with double the back-off rate (below). Does this help? What are the
bottleneck links now?
nice CSMA-repeater 0.16 1.0 2.0 10 1000000 > outputfilename18 &
nice CSMA-repeater 0.16 1.0 2.0 50 1000000 > outputfilename19 &
nice CSMA-repeater 0.16 1.0 2.0 100 1000000 > outputfilename20 &
nice CSMA-repeater 0.16 1.0 2.0 200 1000000 > outputfilename21 &
Ans. output files have been attached. And no this does not help.