OS Options: Must run on CSEE shell servers
- Part 1 [20 points total]: Modify one of the echo client applications given in class.
The new echo client you create should read lines from a file and
send each line to the echo server in a loop. It should only
print the data that is receives back from the server. The application should take
the IP address and port to connect to from the command line as well as the filename to read from.
It should be able to understand
both hostnames and IP addresses in dotted decimal notation.
- Part 2 [20 points total]: Modify one of the echo server applications given in class.
The new echo server should have a few additions:
- A [5 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 the echo protocol given in class.
- B [10 points]: It should handle multiple connections concurrently. For C/C++, this means
adding usage of fork() and reaping all child processes or using POSIX threads. For Java, the use of the
Thread class will be necessary.
- C [5 points]: It should have the ability to take the port number to bind to
from the command line.
- Part 3 [60 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 printing out
specific HTTP headers and some statistics. This part requires multiple pieces to be done so I suggest
working on each part separately and verifying that each part works by itself. These parts are:
- A [10 points]: Construct a routine or object to parse a given URL string in the form
http://hostname[:portnum]/pathname, where the part in
[] is optional, into (1) host IP address, (2) port, and (3) URI.
You may not rely on any intrinsic language objects that do URL parsing for you.
- B [10 points]: Construct a routine that uses the routine or object above to
take a URL, connect to the correct web server, send a HTT/1.0 request, and
retrieve the whole object, storing it into a file given on the command line.
You may not rely on any intrinsic language objects that
do HTTP retrieval for you.
- C [10 points]: Take the routines or objects constructed in the parts above
and construct an application that takes a given URL string and retrieves
the whole object printing specific HTTP headers and statistics. The Content-Type,
Content-Length, and Content-Encoding HTTP headers should be printed out.
The transfer time should be printed along with how many bytes were transferred.
The resulting bytes-per-second should be printed as well. An appropriate format to use
for this would be: "15846 bytes transfered in 1.2 seconds (13205 Bps)".
Errors must be printed for HTTP status codes other than 200 and for malformed
URLs.
- D [10 points]: Add to part C above the ability to handle
HTTP redirect status code returns from the web server and follow the
redirection by retrieving the URL specified in the Location header.
- E [10 points]: Add to part C above the ability to use
a WWW Proxy by specifying the proxy IP address and Port on the command
line. If not specified on the command line, no proxy is to be used.
- F [10 points]: Add to part C above the ability to check to
see if the file given on the command line exists and handle sending
an "If-Modified-Since" header based on the creation time of the file.
The client must also handle the response appropriately as well.
If the file does not exist, the header should not be sent.
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.
To get partial credit for parts of the assignment, you must demonstrate that
those pieces work by themselves.
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, construct a server application that understands passive and active FTP[12%].
The server need only understand RETR.
Todd L. Montgomery (revised 01.29.2003)