The goal of this assignment is to create a user-level networked file system
Download and install FUSE. Write a simple networked file system. During the mount, you should specify the remote server name. Make sure the remote system is one to which you can ssh. Whenever you get a request for a file, copy the entire file (using scp or sftp or libssh, hence the need for ssh access) from the remote server and cache it in /tmp or /var/tmp, then service the requests locally. Copy modified files back when the file is closed. You may use rcp or libssh or another alternative to scp for the file transfer.
Compare your file system to NFS. Design an experiment that shows the performance advantage and disadvantage of this scheme relative to NFS. Your writeup should contain at least one graph, but probably more.
Make sure your implementation can run the following program properly. It is most useful if foo exists. You should write and read the same number of bytes.
int fd0 = open("foo", O_RDWR);
int fd1 = open("foo", O_RDONLY);
buf = 9;
buf = 81;
buf = 'A';
buf = 'q';
buf = '0';
int nb0 = write(fd0, buf, 100);
nb1 = read(fd1, buf, 100);
assert(buf == 9);
assert(buf == 81);
assert(buf == 'A');
assert(buf == 'q');
assert(buf == '0');
printf("Wrote %d, then %d bytes\n", nb0, nb1);
Please report how much time you spent on the lab.
If you use ssh/scp, you probably want to put your public key in your authorized_keys file or run ssh-agent so you aren't prompted for a password on every file system transaction.You can use stat on the server to implement getattr, but you might want to consider a helper program to simplify parsing.
strace cat - > new_file
lsof | grep /dev
tcpdump -r tcpdump.out EXPRESSION