CEG 4188: Higher Layer Network Protocols, Fall 2010

Lab 1: Multi-Threaded Web Server

Date of Lab: September 16, 2010     
Report is due: to be determined (submission: by e-mail to the TA)

Note: It is suggested to use the Java programs GenericClient.java and HttpMirror.java given in the book "Java Examples in a Nutshell" by D. Flanagan (editor O'Reilly). Here are a few pages explanations from that book. If you would like to work in another programming language, you must translate the given programs into your language of choice.

Part 1 – After compiling the given programs, do the following:

  1. Run the client program, and point it to an actual Web server (such as www.uottawa.ca and one more web server of your choice). Observe and record the output of the program.
  2. Run the server program. Then, run the client program to send a request to the server program. Observe and record the output of the server program.
  3. Use an actual web browser, such as Internet Explorer or Netscape, and send a request to the server program. Observe and record the output of both the browser and the server program.

Part 2 – Modify the server program such that it can handle more than one client at the same time (hint: use multi-threading - see suggestion). Include the program code in your report.

Perform other experiments necessary to answer the following questions.

Part 3 (optional) – Modify the server program to become a real "HTTP server" that it is able to return html files to the client when the client sends a URL of the form http:// ... /file.html

Questions

Q1- What happens if we run more than one client at the same time for the server in Part 1?

Q2- What happens if we run more than one client at the same time for the server in Part 2?

Q3- Compare and explain differences and similarities between Q1 and Q2. Can we justify the need for a multithreaded server?