Assignment – 2: Simple Proxy Cache
In this assignment, you will
implement a simple Internet proxy cache. A proxy cache receives
requests from client machines. It checks whether the document is
available locally (in its file system). If so, it returns the file from
its file system. Otherwise, it obtains the document from the respective
website, stores it locally and returns it to the client. The local
cache is cleaned when the proxy cache starts up (cold state at
startup).
You will use your client from the
previous assignment to test the caching server. Recall that the request
strings are of the format GET <filename>.
The proxy receiving the above request first checks whether
the request string is properly formatted. If not, it sends the following error
string 100: Unsupported Operation. It then checks the whether the file is
locally available. If so, the proxy sends the string 400: OK followed
by the contents of
the file. If the file is not locally available, it sends the request to
the origin web server in the required format, and sends the reply sent
by the origin server to the client. However, it stores the reply only
if the requested document was successfuly retreived (which means that
negative replies are not cached). Your proxy cache should take the
total amount of storage available at the cache as an input parameter.
If the cache becomes full, the document in the cache that has not been
accessed for the longest duration of time should be removed (LRU
replacement policy).
The proxy cache has to be implemented in C/C++
using sockets in Linux/Solaris environment. If you plan to implement it on another OS
you should talk to me and get prior permission.
In addition to implementing the
proxy cache, you will do a small experimental evaluation. You will
select 5 web sites of your choice retreive the web pages and record the
latency when the request is "hit" (the reply is from your proxy cache)
and when it is a miss (the request reaches the origin server).
What to Submit:
- You
will submit the source code of proxy cache. You should also include makefiles
for compiling the code. You should also include a README stating any
assumptions you have made.
- Submit
the performance graphs and in one/two paragraphs state the observations
you have made through this experimental study.
Submission Deadline:
Graduate Students: 03/02/2009, 11:59 PM EST
Undergraduate Students: 03/06/2009, 11:59 EST