Disk Simulator

This is the code for the disk simulator we used in the IOPADS '96 paper, Performance of the Galley Parallel File System.

Here's the code.

Here is the README file from the simulator:


This directory contains software to simulate the HP 97560 disk drive.

Background
----------
This implementation of the disk model is based on earlier
implementations by Ruemmler and Wilkes at HP and Dave Kotz (et.al.)
here at Dartmouth.

Among the factors simulated by all these models are head-switch time,
track-switch time, SCSI-bus overhead, controller overhead, rotational
latency, and a disk cache.

Ruemmler and Wilkes' simulator is not available, but their excellent
paper describing it is available by ftp:
   ftp://ftp.hpl.hp.com/pub/wilkes/HPL-93-68rev1.ps.Z

Dave Kotz's simulator is available by ftp:
   ftp://ftp.cs.dartmouth.edu/pub/diskmodel/diskmodel.tar.Z

Dave's simulator has one key advantage over mine: it can simulate
multiple devices on a single SCSI bus, including contention for the bus
(although this part hasn't been validated).  Dave's was designed to be
used within the Proteus simulator. As a result, it has a fairly rigid
event model, a (IMHO) strange time model, and a fair amount of baggage
in the code.

This model assumes that the disk being simulated is the only device on
the SCSI bus.  The code is much simpler and much smaller (about .2 to
.25 the size).  Finally, this model should be much easier to integrate
into another system, since it comes with so little baggage.

This model was validated by trace-driven simulation, using data
provided by Hewlett-Packard and used by Ruemmler and Wilkes in their
study. Comparing the results of this trace-driven simulation with the
measured results from the actual disk, we obtained a demerit figure of
5.0%, indicating that the model is extremely accurate.  (For a
discussion of the 'demerit figure', see the Ruemmler & Wilkes paper.)


Using the model
---------------

The interface to the model is very simple.  

   disk_init() -
                initialize the model
   faux_read(ulong_t sector, int quant) -
                read quant sectors
   faux_write(ulong_t sector, int quant, int sync) -
                write quant sectors, either synchronously or not

faux_read() and faux_write() return the number of microseconds before the
operation is complete.  (For an async. write, the operation is complete
when all the data is in the disk cache).

The model currently uses real time.  So, if 12 milliseconds pass
between calls to faux_read(), the model will actually behave as if 12
milliseconds have passed.  Converting the model to use another system
(eg, some kind of fake time in a simulator) should be trivial.  Just
change the gettimeofday() calls to getmyfaketime() (or whatever).

I've had this working for many months now, but I just spent a little time
cleaning up and commenting the code.  Hopefully I didn't screw anything
up in the process.

If you find this useful, or if you find any bugs, please let me know.

Good luck,
  Nils Nieuwejaar
  nils@cs.dartmouth.edu

Nils A. Nieuwejaar
nils@cs.dartmouth.edu
Last modified Thursday, May 30, 1996