Homework 11

22C:116, Spring 1995

Due Friday Apr. 28, 1995, in class.

Douglas W. Jones
  1. Background: Consider a stateless file server where the reply to an open message is a pair , where I is an I-node number and S is the number of bytes per sector for the file in question. Read and write operations must provide the server with the I-node number and sector number; in addition, a write message contains one sector of data to be written to disk, while the reply to a read message contains the data that was read from one disk sector.

    The Problem, part A: Show how a fairly simple user level procedure can mask this stateless protocol and present an interface to applications programs that looks like the standard UNIX model, with read, write and lseek operations on files that appear to be random-access sequential byte streams with no inherent sector structure.

    The Problem, part B: The problem with this stateless protocol is that it offers the server none of the information traditional file systems can use for predictive optimization of disk usage. For example, consider the problem of prefetching sectors of a sequential file in anticipation of future reads. A conventional file system can measure, for each file, the frequency of sequential reads and make prefetches based on these observations. What steps could a stateless server take to accomplish similar goals?

  2. The Problem: Tannenbaum's bullet file server for Amoeba requires that users read and write entire files, with no sector structure visible to the user. How would you write a database manager on this system that supported databases consisting of many millions of records, where each was about a thousand bytes long.

  3. Background: The current HTTP protocols used by world-wide-web require that a new client-server connection be established to move each file from client to server. Thus, if a web-page consists of text with 5 or 6 embedded GIF images, there are 6 or 7 client server interactions required to obtain the page.

    This design allows web servers to be stateless, if one ignores the fact that a virtual circuit protocol is used for each file transfer. Unfortunately, with HTTP, the time taken to open a client server connection is frequently larger than the time taken to transfer the data, and as a result, the time taken to retrieve and display a web page is usually dominated not by the time taken to move the data from client to server, but by the overhead in the protocol.

    The Problem: Describe how this overhead could be reduced by eliminating the purely stateless protocol now used by HTTP. Describe how your improved protocol would work when all the illustrations on a web page come from the same server, and describe how it would work when some of the illustrations come from a different server.