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:
- The interarrival times of requests will have
an exponential distribution with a mean of lambda.
- C = The number of cylinders = 200 ... numbered 0 to 199.
- The target cylinders of the requests will be distributed
randomly (i.e. a flat distribution) between 0 and C-1.
- 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.
- T = disk rotation time = 25 msec.
- OBSV = 500 = number of "observations'' i.e. number of generated
requests for each experimental condition.
- At the beginning of a simulation the disk head is over
cylinder 0.
Program "variables'' are:
- Algorithms: FCFS (30pts), SSTF (50pts), LOOK (60pts)
- The arrival rate 1/lambda should vary from 10/second to 40/second by a step of
10/second.
- M = number of sectors per track = 4, 50.
Performance Measures to be computed:
- Expected Service Time Between Requests = Avg Seek Time +
T/2 + T/M
- Expected Waiting Time = W = (Time of Completion - Arrival Time)/OBSV
- 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 |
1 | 20 | 50 | 50.97 | 18.75 | 89.72 |
69.72 |
2 | 30 | 50 | 50.97 | 18.75 | 159.44 |
129.44 |
3 | 40 | 40 | 45.67 | 18.75 | 223.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