


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Project; Class: Topics/Computer Engineering; Subject: Electrical & Computer Engineer; University: University of California - San Diego; Term: Fall 2005;
Typology: Study Guides, Projects, Research
1 / 4
This page cannot be seen from the preview
Don't miss anything!



When designing new network protocols, algorithms or communication systems, engineers often rely on simulations to test out their ideas and evaluate their performance before moving to implementation. For distributed systems, these simulation tools have to incorporate the ability to mimic parallel execution of code on multiple devices, a notion of time and mechanisms for message passing and synchronization.
For this project, we will be using PARSEC, a discrete event parallel programming language developed at UCLA. This language can be viewed as an extension of regular C, with the incorporation of parallelism and timing. It is ideally suited to do quick simulation checks of algorithmic or protocol ideas of communication networks. In this particular project, you will implement the code to simulate packet transmissions and possible collisions in a basic wireless ad hoc network.
First, you have to install PARSEC on your machine. The code is freely available for academic use from: http://pcl.cs.ucla.edu/projects/parsec/ This webpage also contains a manual.
Most of the code was developed a while back, so it might take some extra setup steps on your part to get it working. Check out the FAQ on the PARSEC webpage. Other then installing the code, you also need to do the following (for Linux/Unix):
To verify if you got PARSEC set up properly, download the ‘BasicNetwork’ example from the course webpage and compile it by running the Makefile. An executable named ‘run’ will be created. Note: when writing your own simulation, it is easiest if you copy the Makefile of this example and modify it appropriately.
Once you have PARSEC installed and running properly, go through the manual. You can also have a look at the ‘BasicNetwork’ example code. Now, you are ready to write your own PARSEC simulations.
The goal of this project is to implement the very basic packet transmission functionalities that are encountered in a wireless ad hoc network. Consider the 5-node network depicted in Fig. 1 below. The connections between nodes denote which ones are within communication range of each other.
Fig.1. Example ad hoc network
In your simulation, the network topology will be specified by an external file, named ‘data_locs.txt’. The file that corresponds to the network of Fig.1 is shown in Fig.2. The first line in the file specifies the total number of nodes in the network. The subsequent lines give the x- and y-coordinates (floats, in meters) of the network nodes, starting with node 0, 1, etc. Each node has a transmission range of exactly 10 m. This means that nodes that are 10 or fewer meters away will receive the packet (or see a collision), while nodes that are further will not.
Fig.2. Corresponding ‘data_locs.txt’ file
Nodes transmit packets at different point in time, which is specified by another external file, called ‘data_events.txt’ as shown in Fig.3. Each line contains two entries. The first one is the time at which the event happens, in milliseconds. The second entry specifies the event itself. A non-negative number indicates that the node with that number transmits a packet. An entry ‘-1’ indicates the end of the simulation and is always the last entry in the file. For the example of Fig.3, node 1 sends a packet at time 100 ms, node 4 sends one at time 200 ms, etc. The simulation ends after 500 ms. You may assume that the first events will not happen before 100 ms.
Fig.3. Example ‘data_events.txt’ file
For this project, you have to turn in working PARSEC source code and the associated Makefile. It is imperative that you use the file names ‘data_output.txt’, ‘data_events.txt’, and ‘data_locs.txt’ as mentioned earlier. Your Makefile should create an executable called ‘run’. To verify that your code works correctly, it will be compiled and run with different topology and event files.
Place your source files and Makefile in one project_directory. Only include *.pc, *.c, *.h files and the Makefile in this directory (not the *.o or *.pi files). Name this directory
Due date/time: Friday 10/14, 6:00:00 pm PST (Late submissions will not receive any credit!)