18-845 Individual Programming Project
Assigned: Thu Jan 17, 2002
Due: 12:30pm, Thu, Feb 7, 2002
Note: in the following,
$coursedir refers to /afs/ece/class/ece845/.
Intro
For this project, you will design and implement your own protocol for
serving dynamic Web content. The purpose is to give you some
practical context when we study research issues in server design.
Description
The project has three parts:
- Part I: Implement a baseline concurrent Web server in C based on
the Unix select() function.
- Part II: Design an efficient protocol for serving dynamic content and
implement it in an optimized version of your baseline server.
- Part III: Evaluate the performance of your baseline and optimized servers.
Part I: Baseline concurrent server
Here are the requirements for the baseline server:
- Implements HTTP/1.1 GET requests (only) for static and dynamic content.
- Assumes one connection per request (no persistent connections).
- Uses the CGI protocol to serve dynamic content.
- Serves HTML (.html), image (.gif and .jpg), and text (.txt) files.
- Accepts a single command-line argument: the port to listen on.
- Implements concurrency using I/O multiplexing with select().
Part II: Optimized concurrent server
The idea here is to improve the performance of your baseline server by
replacing the standard CGI protocol with a protocol of your own
design. This is entirely open-ended. Anything goes.
There are a number of existing standards for this kind of thing, such
as ISAPI (Microsoft), NSAPI (Netscape), and fast-cgi. However, I would
encourage you to forget about these and start from first principles.
Design something that is simple and fast. A good design is likely to
include some combination of dynamic linking, threads, and code caches.
Part III: Evaluation of baseline and optimized servers
In this part, you will evaluate how well your baseline and optimized
servers can serve dynamic content. For your evaluations, start with the adder.c CGI program from the
CS:APP network programming chapter.
The test program for your protocol should have similar functionality
(but of course it can be different from adder.c in order to conform to
your protocol).
Report performance of your baseline and optimized servers as server
throughput (requests per second measured on the server).
Handin instructions
Tar up the directory containing your solution in a file called
ANDREWID.tar", where ANDREWID is your Andrew login name, and copy it
to $coursedir/ip/handin.
You have list and insert privileges only in this directory. If you
need to hand in twice, put a number after later handins, e.g.,
ANDREWID-1.tar, ANDREWID-2.tar, and so on.
Evaluation
Evaluation will be done by a live demo with the TA.
Please arrange your demo time with the TA. The projects are
open-ended and so is the evaluation. Here are some rough guidelines:
- Baseline server (50%). The goal here is just to get it working
serving multiple clients concurrently.
- Optimized server (50%). The idea here is to come up with a
design that attacks the biggest overheads associated with
running CGI programs: fork() and exec().
Hints and sources of information
- Read these CS:APP handouts for information on dynamic linking,
processes, Unix signals, I/O, network programming, and concurrent
programming: (Note to former 15-213 students: Chapters 11, 12 and 13
contain a lot of new information).
- Chapter 7: Linking (ps)
- Chapter 8: Exceptional Control Flow (ps)
- Chapter 9: Measuring Program Execution Time (ps)
- Chapter 11: System Level I/O (ps)
- Chapter 12: Network Programming (ps)
- Chapter 13: Concurrent Programming (ps)
- Appendix A: Error Handling (includes csapp.c and csapp.h) (ps)
- Code examples:
- Please read the HTTP spec
for questions about HTTP.
- Use telnet as the client to debug your server.
Last modified: Wed Jan 8 18:52:58 EST 2003