CS 6210 Advanced Operating Systems
Fall 2001
Project II:Client - Server

Due: 11:59 p.m., Sept. 24, 2000
(one minute prior to midnight on Monday night)


GOAL:
The goal of this assignment is to be introduced to client-server style of communication. You will be writing a client-server distributed application, in which the communication will be based on unix inet sockets. You will write a multi-threaded server that will manage image manipulation for a set of clients, as well as a the programs running in those clients. The clients and the server are each separate processes that could run on different hosts. You will extend your techniques from the first project to watch message traffic to dynamically CHANGE messaging behavior.

 

PROBLEM:

You will be implementing a client server application, in which a client provides and receives image data to and from the server. A client may have an image stream that it wants rotated, scaled or reflected. Therefore some processing needs to be performed on the image data. This processing will be carried out by the server at the request of a particular client. The client will send the image to the server in blocks. When the client connects the server will respond with the block size to use and the delay between blocks. In an implicit second channel the client will asynchronously listen for control messages from the server. The size of the block and delay between blocks will have to change based upon any control messages received from the server.
 

The Client
The client component should be its own process. It should be designed so that it can execute on the same host as the server component or on a separate host with no change or recompilation of the code. The client will connect to a known port on the server. It should be able to submit a request and a particular image to be rotated, scaled or reflected.  The client should submit the image in blocks and adjust the size of the blocks and delay between blocks based upon the response of the server. This operation should be performed asynchronously. That is the client should continue sending blocks at the current size and rate until it receives a throttle control message from the server.  After the file has been sent, the client should receive the transformed image.

You are free to define the format of the requests sent by the client. You should implement some simple and clear interface that allows the user to specify which transform is to be performed and the parameters e.g. scale 50%.

The original image should be read from disk. After the transformed image is received from the server, the client should simply display the image.
 

The Server
The server component should be its own process. The server should be able to service multiple clients at the same time. For each client that connects a new thread should be created. After a client has been processed its thread should be joined and its resources reclaimed.  Each thread should keep track of the bandwidth being consumed by its client. The server should dynamically throttle each client based upon load. It will do this by increasing/decreasing block size and delay between blocks. Once the entire image has been received, the server should perform the requested transformation and then begin sending the image back.
 

Coding the program:
To use sockets you can view the man page with  man socket . Information about the ppm format can be found from the man pages:   man ppm. For manipulation of the image file, you can use the pnm library. Information is available through man libpnm.  You are welcome to use other libraries for image manupulation, as long as you make that clear in your README, and include all necessary files in your turnin.

Some hints:

Sample ppm files: fitzroy.ppm, islands.ppm.

In case you need them: libpnm.c, libpnm.h.
 

DUE:

Due date is Due: 11:59 p.m., Sept. 24, 2000.

This is one minute prior to midnight on Monday night. No late assignments will be accepted unless prior arrangements have been made.

You will submit your code for the client and the server, and a README containing information on how to compile and execute your programs, and know bugs, or a Makefile. NO binaries!

Assignments will be submitted by e-mailing as an attachment a tar archive of your work to the account cs6210@cc.gatech.edu. To create a tar archive, put all your files in a directory, e.g. p2. cd to the parent directory, and execute:

tar -cvf p3.tar p2

Make sure that you do NOT include any binaries in your tar files. I am going to compile your programs from scratch. If you have any special commands needed to compile your code then mention them in your README file.