Web Programming Project: Additional Information 1

Internet and Intranet Protocols and Applications

Spring 1998

Prof. Arthur P. Goldberg

6 April 1998

Assumptions

Use revision 2 of the HTTP/1.1 specification. (If I learn of corrections in version 3 which influence your design, then we’ll incorporate them.)

Assume that:

Asynchronous issues

To control its resource use, the server MUST close an idle connection. An idle connection is a socket on which the server has not successfully executed read() or write() for a period equal to or greater than the time-out. The server should send a response with a 408 Request Time-out error before the close(). Reset a socket’s time-out after each accept(), read(), or write().

Time-outs can be handled with alarms or select() or any other appropriate method. You can efficiently manage multiple time-outs with a list of time-outs ordered by expiration time. The event that handles the earliest and time-out resets an alarm for the next one.

Transfer codings

The only transfer codings (3.6) to support are identity and chunked. Your server does not send trailers.

A request MAY contain a TE header. If a request does not contain a TE header, your server should return an identity response.

Consider a request that contains a TE header. If the t-coding is chunked, your server should return a chunked response. If the t-coding is identity, your server should return an identity response. The server’s response MUST include a Transfer-Encoding header.

A request will NOT include accept-params or qvalues.

HTTP Version

The server MUST send correct responses to requests for HTTP versions 1.0 and 1.1. In this way you will be able to use many browsers to test your server. The server MUST send a 505 response for requests identified by other HTTP version. (Note that this overrides my in-class and earlier written instructions.)

Resource

Please set up the following resource structure at your server. Your server should have a local "root" directory which stores all resources as files.

 

Resource name

Size (KB)

Modification date (file system)

/index.html

1

Any

/old.txt

1

More than 200 minutes before running test client

/dir/index.html

2

Any

/dir/large.txt

10

Any

/dir/new.txt

1

Less than 1 minute before running test client.

/dir/verylarge.txt

100

Any

Note that 1KB = 1024 bytes.

The "Date" header returned by GET and HEAD requests MUST be the file system modification date.

A document’s content depends on its file type.

Suffix

Content-Type

Content

.txt

text/plain

(80 bytes of (<file_name> )*)CRLF

Repeated to file length.

.html

text/html

<HTML>

"file_name " repeated to the file’s length.

</HTML>

We will assume that your clock is accurate to within five minutes of the time zone for which it is configured.

 

Scoring

We’ll score the functionality of your server as follows.

Functions

Points

Concurrency - Respond to multiple requests at the same time

2

8.1 Persistent connections

1.5

8.1.2.2 Pipelining

1

3.6.1 Chunked Transfer Coding

3

9.3 GET

4

9.4 HEAD

2

9.8 TRACE

3

10.2.1 200 OK

1

10.4.1 400 Bad Request

0.5

10.4.5 404 Not Found

0.5

10.4.9 408 Request Time-out

2

10.5.1 500 Server Error

0

10.5.2 501 Not Implemented

0.5

10.5.6 505 HTTP Version Not Supported

0.5

14.10 Connection

1

14.13 Content-Length

0.5

14.17 Content-Type

0.5

14.18 Date

0.5

14.22 From

0

14.23 Host

1

14.24 If-Modified-Since; 10.3.5 304 Not Modified

2

14.38 Server

0.5

Code organization and readability

1.5

Other, as yet to be determined

1

Total

30

Software tools

You may use any libraries or languages, provided that you write the code which

Thus, you can use a URL class in JDK 1.1.

Changes to "Web Programming Project: HTTP 1.1 Web Server"

"9.8 Implement ‘SHOULD’ functionality."

"7.1.1 Implement only headers specifically mentioned." Headers in requests will NOT span multiple lines.

Date/time

Because of the complexity of converting between integer and text time formats, I think it will be easier for you if your server represents date/time values as epoch 1970 seconds, like 891972448 for April 7 14:07:28 EDT 1998. Then, when you compare times, you simply compare long integers.

However, I still do not know which browsers accept Epoch 1970 second date fields.

References for Memory Management Tools

See David Hanson, "C Interfaces and Implementations", 1997, Chapters 5 and 6. Code is available at ftp://ftp.cs.princeton.edu/pub/packages/cii , information is at http://www.cs.priceton.edu/software/cii/. Also, Purify from Pure Software is the best commercial tool and available at http://www.rational.com/products/purify. Another allocator is Vmalloc by K. Vo.

On-Line Testing

You will follow these steps to have our client use your program. Remember, our client must be able to connect directly via TCP/IP to your server.

  1. Visit IIPA Webserver testing and grading web page, http://cs.nyu.edu/~jianjun/inter/interPage.html.
  2. Read time-out and chunk size.
  3. Start your server.
  4. Modify your /dir/new.txt.
  5. Fill out the testing form (Address or Host and Port number). The host header in requests will be whatever you supply the grading program, which may be a domain name or an IP address.
  6. Let your server handle test requests.
  7. Watch for test response.

Outstanding Questions

I’m still unsure of the following: