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 standard input and
send each line to the echo server in a loop. It should compare the input data that
it reads in with the data received from the server and alert the user if the data
differs. The application should take
the IP address and port to connect to from the command line.
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 [3 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 [2 points]: It should have the ability to take the port number to bind to
from the command line.
- C [15 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. Follow a process per connection or thread per connection model as
appropriate.
- Part 3 [30 points total]: Write a basic web client that can parse a given
URL, connect to a web server, and retrieve the headers 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 HTTP/1.0 HEAD request, and
retrieve the response. 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
object headers. Only the Content-Type,
Content-Length, Server, and Content-Encoding HTTP headers should be printed out if
present. Other headers should be ignored.
Errors must be printed for HTTP status codes other than 200 and for malformed
URLs.
Part 4 [30 points total]: Write a basic FTP client that can parse a given FTP
URL, connect to an FTP server, and retrieve the file and save it to a local file.
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
ftp://hostname[:portnum]/pathname, where the part in
[] is optional, into (1) host IP address, (2) port, and (3) filename.
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 FTP server, login as anonymous with a password
of the users email address (
user@hostname), and uses passive FTP to retrieve
the given file.
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 given
file and stores it in a local file.
Errors must be printed for FTP response codes that are incorrect and for malformed
URLs.
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
- FTP Specification (RFC 959)
Todd L. Montgomery (revised 01.27.2004)