From CS 537 - Operating Systems - Spring 2013

PmWiki: Project3-sp13

Software RAID

Notes

Due date

The project is due at 9 pm on Thursday, April 5th

Groups

This is a group project done in groups of three. If you know who you would like to work with, please notify the instructors. Otherwise we will make a group for you.

Objectives

The goals for this project are:

Overview

In this system you will implement a software RAID manager implementing RAID 0 (striping), RAID 1 (mirroring), RAID 4 (fixed parity disk), and RAID 5 (floating parity), and RAID 10 (mirroring + striping). For each strategy, you will implement a RAID manager capable of normal mode operation (no failures), failed-mode operation (working with one failed disk), and recovery (restoring normal mode with a new disk).

Rather than assign each of you a set of real disks, we will instead work with virtual disks stored in ordinary files. Thus, we won't be able to accurately measure the performance impact of different RAID systems. Instead, we will simply count the number of accesses per disk and use that as a proxy for performance.

Details

You will create a simulator program named raidsim.

Virtual disk array

This file contains source for a virtual disk array. Please use the functions defined in disk-array.h. The file test.c shows how to use the functions. The block size for the project is defined in disk.h.

RAID 0

Blocks should be striped across disks, starting with the lowest numbered disk and increasing. Each disk gets a strip of blocks, which is one or more blocks. For example, with 3 disks and strip size of 2, disk 0 gets blocks 0-1 and 6-7, disk 1 gets blocks 2-3 and 8-9, and disk 3 gets blocks 4-5 and 10-11.

RAID 10

Blocks should be mirrored between pairs of disks and then striped across pairs of disks in strip units. Mirrors should be disk i and i+1. For example, with 4 disks and strip size 2, disks 0 and 1 get blocks 0-1 and 4-5, and disks 2 and 3 gets blocks 2-3 and 6-7.

RAID 4

Blocks should be striped in strip size units across the first n-1 disks, and disk n should receive the parity. For 4 disks and strip size 3, disk 0 gets blocks 0-2 and 9-11, disk 1 gets blocks 3-5 and 12-14, disk 2 gets blocks 6-8 and 15-17. The parity disk gets the byte-wise XOR of the n-1 data disks. In this case, block 0 XOR block 3 XOR block 6, block 1 XOR block 4 XOR block 7, block 2 XOR block 5 XOR block 8 etc.

For writes less than a full stripe, you can use additive (read the old blocks and compute new parity) or subtractive (read the old block and old parity) parity. For writes to a full stripe, just write out the data and new parity.

RAID 5

Blocks should be striped in strip size units across N disks, reserving one disk for parity. For the first strip, disk 0 should be used for parity, for the second disk 1 etc. For stripe, parity returns to disk 0. For example, with strip size 1 and 4 disks

Disk 0Disk 1Disk 2Disk 3
B0 XOR B1 XOR B2B0B1B2
B3B3 XOR B4 XOR B5B4B5
B6B7B6 XOR B6 XOR B8B8
B9B10B11B9 XOR B10 XOR B11
B13 XOR B14 XOR B15B13B14B15

For writes less than a full stripe, you can use additive (read the old blocks and compute new parity) or subtractive (read the old block and old parity) parity. For writes to a full stripe, just write out the data and new parity.

Specification

Command line

Command line parameters (these can come in any order):

All parameters are mandatory except "verbose". A sample command line:

  raidsim -level 10 -strip 5 -disks 10 -size 10000 -trace input.txt

Trace file format

The trace file contains a sequence of lines with one command per line. There will be exactly one space between each word in a command. The commands can be:

For each RAID type, your simulator should try to complete as much of a command as possible: return as much data as possible on a read and write as much data as possible on a write.

Output:

Your simulator should print the command line from the trace and then execute it, then print the desired output on the following line. After the END command, your simulator should call disk_array_print_stats() to print the statistics for the disks. On read errors, replace the value (which may be one of many in a set of blocks) with the word ERROR. Thus, a read may return a mix of values and an error. On write errors, print ERROR if any blocks of the write cannot be written.

What to turn in

We will provide a file disk.c containing the disk emulator that keeps statistics. You should turn in a makefile and all your source files. The makefile should produce a program named raidsim. If you include disk.c, we will replace it with our own before compiling your code. Please turn the code to ~cs537-2/handin/<yourlogin>/p3.

You should turn in one project per group. With your project, please include a file name README.TXT listing the names and CS logins of your group members.

Grading Criteria

We will consider the following aspects of your code:

Retrieved from http://pages.cs.wisc.edu/~swift/classes/cs537-sp13/wiki/pmwiki.php?n=PmWiki.Project3-sp13
Page last modified on April 03, 2013, at 09:16 PM