CS 677 Distributed Operating Systems

Fall 2004

Programming Assignment 1: A Sensor Network

(for off-campus students - 14 days after viewing Lecture 9 )



1 The problem

In the first part of the programming project, you are to implement a sensor network. The network consists of a sensor proxy server that receives data from various data sources (or sensors) at periodic intervals and distributes the data to appropriate data sinks.

There are three components to this system ;

  1. Sources (or Sensors): A source generates new data at periodic intervals which it sends to the sensor proxy server for distribution. The data is in the form of integer values. E.g. Sink 1 generates the value 47 at time 11:24:00. A source should register with the sensor proxy server (with source_id, IP address, maybe even update time, if known) so that the sensor proxy can update its list of sources. Real-life examples of such data are weather updates, sports scores, IBM stock quotes etc.
    Each of the sources generates data at some periodicity and sends the new data to the sensor proxy.

  2. Sinks : Each sink subscribes to one (or more than one) source on the proxy's source list (say IBM stock quotes and weather updates). The sink IP address and respective source_ids are specified during the subscription process. After this, the proxy pushes data to sinks at sink-specified intervals. Thus, this is a push-based system, where sensors push data to the proxy and the proxy, in turn, pushes data to sinks.

  3. Sensor Proxy : There are 2 roles that the proxy performs.

The purpose of this assignment is to get you familiarized with sockets/RPCs, processes, threads and synchronization.

You can be creative with this project. You are free to use any programming languages (C, C++, Java, etc) and any abstractions such as sockets, RPCs, RMIs, threads, events, etc. that might be needed.

Some things to keep in mind:

2 Evaluation and Measurement

Deploy atleast 3 sources and atleast 4 sinks. They may be set up on the same machine or on different machines. Implement atleast one sink that is subscribed to more than one source. The data value returned to this sink by the sensor proxy should be the sum of the most recent values obtained from each of the different sources the sink is subscribed to. In this case, synchronization becomes very important. Study how the data transfer rate is affected by varying the intervals at which data is sent to the proxy by calculating the time for 100 data updates to a sink and averaging over the number of updates and number of sinks. Do the same thing by varying the size of the data files.

Do a simple experiment to study the scalability of the proxy server. Measure how the data tranfer rate from the proxy to sinks is affected by increasing the number of sinks and sources.

3 What you will submit

When you have finished implementing the complete assignment as described above, put all the code in a seperate directory in your edlab account (/677/project1).

You are required to submit your solution in the form of printouts.

Each program must work correctly and be documented. You should hand in:
  1. A copy of the output generated by running your program. When the sensor proxy receives data, have your program print a message "data received from source s" . When a sink is sent data by the proxy server, have your program print messages for the data being sent by the proxy and for the data being received by the sink.
  2. A seperate (typed) document of approximately two pages describing the overall program design, a description of "how it works", and design tradeoffs considered and made. Describe clearly how multiple threads and synchronization are handled. Also describe possible improvements and extensions to your program (and sketch how they might be made).
  3. A program listing containing in-line documentation.
  4. Instructions to compile and run the code from 677/project1.
  5. A seperate description of the tests you ran on your program to convince yourself that it is indeed correct. Also describe any cases for which your program is known not to work correctly.
  6. Performance results.

    Let us not waste a lot of trees. So, if any of the above turn out to be large, just save the relevant information in a file, leave it on your EDLAB account and submit the name of the file.

    4 Grading policy for all programming assignments

    Grading:

    Grades for late programs will be lowered 12 points per day late.