Unformatted text preview:

6 824 Spring 2005 6 824 Lab 2 Basic File Server Due Lecture 5 Introduction In this lab you ll start implementing the Frangipani like file server originally outlined in Lab 1 App FS block srvr FS on other hosts Kernel NFS Client lock srvr We supply you with a block server block server client interface and a skeletal file server that knows little more than how to parse NFS RPC calls Your job in this lab is to design and implement directories You ll have to choose a representation with which to store directories in the block server and implement the CREATE LOOKUP and READDIR NFS RPCs You will need to consult the NFS v3 specification for information about what the NFS RPCs mean and what arguments responses are used for each RPC You can also consult the book NFS Illustrated by Brent Callaghan You can learn more about NFS loopback servers and asynchronous programming in the loop back NFS paper You can find the sources for this software at www fs net or in u 6 824 src sfs1 and u 6 824 src classfs 0 1 The NFS protocol is specified in XDR in u 6 824 include sfs nfs3 prot x and the output of the RPC compiler is available as nfs3 prot h The CCFS Server Download the lab starter files from http pdos csail mit edu 6 824 2006 labs lab 2 tgz to your home directory on one of the class machines wget nc http pdos csail mit edu 6 824 2006 labs lab 2 tgz tar xzvf lab 2 tgz cd lab 2 gmake Now you should start the block server on one of the class machines You ll need to choose a UDP port number that other students aren t using If for example you choose to run the block server on host frustration on port 3772 you should type this on frustration Cite as Robert Morris course materials for 6 824 Distributed Computer Systems Engineering Spring 2006 MIT OpenCourseWare http ocw mit edu Massachusetts Institute of Technology Downloaded on DD Month YYYY frustration cd lab 2 frustration blockdbd 3772 At this point you can start up the file server called ccfs By default the file server initializes a new file system in the block server chooses a new random file handle for the root directory and prints out the root handle You can optionally specify an existing root handle The block server keeps its state in memory so you can t use a root handle after you re start blockdbd When ccfs starts it mounts itself as a file server for a sub directory under classfs as specified on the command line Each student has their own view of classfs so you do not need to pick a unique directory name You must also tell ccfs the host name and port number of the block server so that it knows where to get and put data The following example starts ccfs and mounts a new filesystem on classfs dir using the block server you just started on frustration pain ccfs dir frustration 3772 root file handle 2d1b68f779135270 pain touch classfs dir file touch classfs dir file Input output error pain Clearly the file server is not very functional It implements a few NFS RPCs FSINFO GETATTR and ACCESS and returns error replies for most other RPCs e g CREATE LOOKUP and READDIR When you re done with the lab you should be able to run commands like this in your file system pain ccfs dir frustration 3772 root file handle 01a2d816f726da05 pain cd classfs dir pain ls pain touch a pain ls lt total 0 rw rw rw 0 root wheel 0 Feb 9 11 10 a pain touch b pain ls lt total 0 rw rw rw 0 root wheel 0 Feb 9 11 10 b rw rw rw 0 root wheel 0 Feb 9 11 10 a pain If all goes well your file server should also support sharing the file system on other hosts via the block cache So you should then be able to do this on frustration frustration ccfs dir frustration 3772 01a2d816f726da05 frustration cd classfs dir frustration ls lt total 0 rw rw rw 0 root wheel 0 Feb 9 11 10 b rw rw rw 0 root wheel 0 Feb 9 11 10 a Cite as Robert Morris course materials for 6 824 Distributed Computer Systems Engineering Spring 2006 MIT OpenCourseWare http ocw mit edu Massachusetts Institute of Technology Downloaded on DD Month YYYY frustration The extra argument to ccfs 01a2d816f726da05 is the root file handle printed by the ccfs on pain It tells ccfs on frustration where to look for the file system in the block server Your Job Your job is to implement the LOOKUP CREATE and READDIR NFS RPCs in fs C You must store the file system s contents in the block server so that in future labs you can share one file system among multiple servers If your server passes the tester see below then you are done If you have questions about whether you have to implement specific pieces of NFS server functionality then you should be guided by the tester if you can pass the tests without implementing something then don t bother implementing it For example you don t need to implement the exclusive create semantics of the CREATE RPC Please modify only fs C fs h and fsrep x You can make any changes you like to these files Please don t modify the block server or its client interface blockdbc C and blockdbc h since we may test your file server against our own copy of the block server Testing You can test your file server using the test lab 2 pl script supplying your directory under classfs as the argument Here s what a successful run of test lab 2 pl looks like pain test lab 2 pl classfs dir create file 69301 0 create file 69301 1 Passed all tests The tester creates lots of files with names like file XXX YYY and checks that they appear in directory listings If test lab 2 pl exits without printing Passed all tests then it thinks something is wrong with your file server For example if you run test lab 2 pl on the fs C we give you you ll probably see an error message like this test lab 2 cannot create classfs dir file 69503 0 Input output error This error message is the result of this line at the end of fs nfs3 lookup which you should replace with a working implementation of LOOKUP nc error NFS3ERR IO The Block Server The goal of the block server is to provide a centralized storage location for all the data representing your distributed filesystem much like a hard disk would In later labs you Cite as Robert Morris course materials for 6 824 Distributed Computer Systems Engineering Spring 2006 MIT OpenCourseWare http ocw mit edu Massachusetts Institute of Technology Downloaded on DD Month YYYY will be serving the same file system contents on multiple hosts each with its own file server The …


View Full Document

MIT 6 824 - Lab 2: Basic File Server

Documents in this Course
Logging

Logging

4 pages

Load more
Loading Unlocking...
Login

Join to view Lab 2: Basic File Server and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lab 2: Basic File Server and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?