Advanced Network -- Projects

Thierry Coulbois

Al-Quds University -- 1st Semester 2002-2003



This document is available at http://www.logique.jussieu.fr/www.coulbois/alquds/network/project.html





Outline:

A company has three buildings: one in Abou Dis, one in Beit Hannina and one in Cheikh Jarra. In each of the parking of the buildings there are some cars that the company wants to share between its employees. It decided to use the computer network to make reservations for the cars. Each of the buildings is in charge of maintaining its own database for its cars. From any of the building it will be possible to reserve a car in any of the other buildings.




Details:

I am not really interested in the database process so an array to store a few cars (less than 10) will be widely enough. There should be one different file for each building. It must be possible to save or load these arrays.

Each of the building should be a different computer (SunLab, one of the PCs,...). At home or for testing you can use the same computer for all three buildings, but make sure that you are not cheatting : reading a file which should be in a different building, etc. In this latter case, use different process as the sockets does not require to go from a computer to another.

The communication between the buildings will be done using sockets between the different process and computers.

In each building there is a daemon process waiting for request to the local database. This daemon can read and write in the database and accept or deny requests. In each building you can run another program that starts a user interface that proposes either to reserve a car or to return one. It must be possible to see the list of cars available in a building, the total list of cars in a building (with their status: reserved or available), the list of all cars in all buildings. It is possible to ask for a specific car in a specific building , or to ask for any car in a specific building or to ask for any car in any building. So on each computer/building there is one program running continuously: the daemon, and another program that a user can start when he wants.

Specify carefully your protocol on your connections: what are the request, what are the responses, what are the possible errors.

I believe this will easier to program in Java than in C, so I will speak more of Java in the Lab hours.




Steps

  1. Think about this project and make a software design analysis.
  2. Define the car class and the parking class.
  3. Write all what is needed for dealing with the database (writing and reading a file, methods to reserve and return a car, accessor to the list of cars).
  4. Write the user interface.
  5. In the same time think about the protocole in the sockets.
  6. Program all what is needed for the sockets.
  7. Check that you did not get wrong with multi-thread programing: what will happen if two different processes read at the same time in the files, etc.



Extensions

If you have time and if you wish, you can think of the following extensions:

  1. Write a web page and use a CGI script for the user interface. Then you can use a central computer (in Abou Dis) which is accessed through HTTP instead of users interface programs on each computer.
  2. Prepare for the growth of your company: add new buidings in Deiheshe and in Essaouyeh.
  3. Add authentification process to protect from intruison to your database by computers outside your company.
  4. Propose other extensions