OS Options: Must run on naur or boole
- Part 1 [15 points total]: Modify one of the Echo Client applications given in class.
The new Echo Client you create should prompt the user for data to send to the
Echo Server in a loop. It should send each line of data that is inputted and print the data that is
received from the server. In addition, the program should exit when 'quit' is
entered at the prompt.
- Part 2 [15 points total]: Modify one of the Echo Server applications given in class.
The new Echo Server should have two additions:
- A [10 points]: It should process each connection until the client disconnects.
In other words, the server should loop around the recv/send part until the
recv returns a value of 0 bytes received. In other respects, this new Echo Server
should conform to the RFC document for Echo given in class.
- B [5 points]: It should handle multiple connections concurrently. For C/C++, this means
adding usage of fork() and reaping all child processes. For Java, the use of the
Thread class will be necessary.
- Part 3 [35 points total]: Write a basic web client that can parse a given
URL, connect to a web server, and retrieve the contents of the object. This part requires
multiple pieces to be done, they are:
- A [10 points]: Construct a routine or object to parse a given URL string in the form
http://machinename[:portnum]/pathname, where the part in
[] is optional, into (1) host IP address and (2) port. You may not rely
on any intrinsic Java objects that do URL parsing for you.
- B [10 points]: Construct a routine or object to construct an HTTP/1.0 request
line given a URL string.
- C [15 points]: Take the routines or objects constructed in the above
parts and construct an application that takes a given URL string, parses it to
obtain host IP address and port, connects to the host on that port, sends an HTTP/1.0
request for the object, and retrieves the whole object. The application must be
able to distinquish between the response line, headers, and body of the returned
data. The request phrase should be printed out along with the contents of all
headers and the length of the object as determined by the prcoess of retrieving the object body.
- Part 4 [35 points total]: Write a basic web server that can handle the
GET request method. This part requires multiple pieces to be done, they are:
- A [8 points]: Construct a routine or object that can read an HTTP/1.0
request from a socket and parse it into request-line, headers, and body.
- B [7 points]: Construct a routine or object that constructs a response-line,
given a status code and phrase along with response headers.
- C [20 points]: Take the routines or objects constructed in the above parts
and construct an application that listens on a given TCP port for HTTP/1.0
requests to handle. This server should handle GET requests only. All other
request methods should generate a 501 "Not Implemented" status. In addition,
any GET requests that can not be fulfilled due to the object not being around
should generate a 404 "Not Found" status. Any malformed request should generate
a 400 "Bad Request" status.
Notes:
Your submissions must at least compile before any credit will be given.
Submissions that do not compile will not be graded. Submissions submitted
after the due date will not be graded. All work must be your own original work.
If you share code with others, you will be given a 0 for the assignment. This
assignment set is worth 25% of your total grade.
HTTP 1.0 Specification at http://www.w3.org/pub/WWW/Protocols/HTTP/1.0/spec.html
Extra Credit
Value: up to +12% onto total grade
For extra credit, make Parts 3 and 4 support FTP URLs and requests [8%].
And/Or add support in Parts 3 and 4 for use of the If-Modified-Since header [4%].
Todd L. Montgomery (revised 01.22.2001)