Disk Scheduling Simulation Specification

Write a disk scheduling simulation program. The program will report several statistical measures of performance for each of several disk scheduling policies.

Program "constants'' are:
  1. The interarrival times of requests will have an exponential distribution with a mean of lambda.
  2. C = The number of cylinders = 200 ... numbered 0 to 199.
  3. The target cylinders of the requests will be distributed randomly (i.e. a flat distribution) between 0 and C-1.
  4. Seek time will be a linear function of the number of cylinders traveled with a seek time of 25 msec for a travel of 1 cylinder and a seek time of 130 msec for a travel of C-1 cylinders. An exception: Seek time is 0 for a travel of 0 cylinders.
  5. T = disk rotation time = 25 msec.
  6. OBSV = 500 = number of "observations'' i.e. number of generated requests for each experimental condition.
  7. At the beginning of a simulation the disk head is over cylinder 0.
Program "variables'' are:
  1. Algorithms: FCFS (30pts), SSTF (50pts), LOOK (60pts)
  2. The arrival rate 1/lambda should vary from 10/second to 40/second by a step of 10/second.
  3. M = number of sectors per track = 4, 50.
Performance Measures to be computed:
  1. Expected Service Time Between Requests = Avg Seek Time + T/2 + T/M
  2. Expected Waiting Time = W = (Time of Completion - Arrival Time)/OBSV
  3. Standard Deviation of Waiting Times, where the standard deviation of the set x1 ... xn =
    sqrt(sum from i=1 to n of (xi-xavg)^2 over n) where xavg = the average of x1 ... xn.
For example, if interarrival times (in msec) are 20 10 10 and requested cylinders are 50 100 60 with M = 4, then for FCFS:

REQUEST ARRTME CYLCHNG SEEKTM LATENCY FINTM WAITTM
1205050.9718.7589.72 69.72
2305050.9718.75159.44 129.44
3404045.6718.75223.86 183.86


and the performance measures would be:

Expected Service Time Between Requests = ((50.97+50.97+45.67) / 3 ) + 18.75 = 67.95

Expected Waiting Time = (169.72+129.44+183.86) / 3 = 127.67

Standard Deviation of Waiting Time =
sqrt(((69.72-127.67)^2+(129.44-127.67)^2+(183.86-127.67)^2) / 3) = 46.61