Homework 8 - multiple access control
In this homework, we experiment with the problem of multiple access control. Begin by copying the homework template to your submission directory using svn as before (use svn cp, not checkout, to add hw8 to your already checked out turn-in directory).
You are to fill in code for the functions in station.c, and if you desire, alter the struct in station.h. Be aware that your code will be tested against the original hw8.{h,c}, so any changes you make to these files are temporary.
The assignment
hw8.c creates a variable number of 'stations', each of which has an associated 'queue' of packets to transmit. In each time step, the queue length of each station is increased with some probability, which depends on the number of stations and the specified load. Then, each station that has a packet to transmit is asked whether it wishes to transmit in this time step. If a single station decides to transmit, the transmission succeeds and the station's queue length is reduced by one. However, if more than one station transmits, all transmissions fail, and queue lengths are preserved for next round.
Editing only station.c, and using no coordination between stations other than that afforded by the three template functions, implement a multiple access control protocol that reliably achieves at least 20% channel utilization for any load larger than 20%, regardless of the number of hosts.
Using gnuplot, create PDF files of the following two plots:
In one plot called 'loads.pdf', three lines displaying: 1 stations, load of 1,2,3...100. 10 stations, load of 1,2,3...100. 100 stations, load of 1,2,3...100.
In one plot called 'stations.pdf', three lines displaying: 1,2,3...100 stations, load of 10 1,2,3...100 stations, load of 30 1,2,3...100 stations, load of 100
Annotate your plots correctly, with x and y axis labels as well as legends for the three lines.
Turn-in instructions
Make sure your code compiles by running 'make'. Running 'make plots' should automatically run the experiments for the plots above, and create the plots.
Commit the code, and two representative plots, as in previous homeworks.
Hint
If your version of gnuplot does not produce PDFs, you can plot to a postscript (.ps) file, and use pstopdf to convert it to PDF.