6/73201 Advanced Operating Systems PROJECT 1 ASSIGNMENT 50 points Due by e-mail at 11:59pm on Tuesday, September 25, 2007 RANDOM FLOOD Assume that the system is completely connected. The execution semantics is interleaving and the system is message passing. Processes have unique identifiers ranging from 0 to N-1 (where N is the number of processes in the system). You are to implement an algorithm that floods a message to all processes in the system. The algorithm operates as follows. A process with identifier 0 initiates the algorithm by executing a random broadcast. This broadcast entails selecting a random number of neighbors and sending them a message. The message bears no content. The number of random neighbors is uniformly distributed from 0 to N-1. Note that the number of selected neighbors may thus be 0. The recipient identifiers are randomly selected from the list of all identifiers. When a process receives a message for the first time, it executes a random broadcast of its own. When this process receives consequent messages, no further actions are executed. The algorithm terminates when there are no more messages to receive. Note that the initiator, like all other processes, executes the random broadcast at most once. SIMULATION ENGINE The important part of the project is the simulation engine: the portion of code that simulates message transmission. Make sure this portion is modular and can be reused in further projects. The simulation engine should keep the state of each process and the queue of messages in transition (currently in the channels). The engine would construct a computation of the algorithm by iterating through the messages in the queue. The engine would select the message at the head of the queue, and have the recipient process execute a single atomic step. This execution would result in updating the state of the process and possibly some messages to be sent. The messages shall be appended to the tail of the queue. IMPLEMENTATION DETAILS For you implementation you can use either Java or C++. Your code should compile and run on the departmental Unix servers. If you prefer to use any other language, please discuss it with me before starting working on the project. Make sure you properly initialize the seed for your randomization implementation. I suggest initializing it from the computer's clock. Make sure your implementation is configurable to different values of N (the number of processes in the system). This configuration can be done through a run-time parameter or a compile-time constant. Coding has to be done professionally: with comments, indentation and appropriate modularity. Your grade may be influenced by the quality of your code. SUBMISSION DETAILS Pack and send your project to Tom Clouser (see class web-age for email). Your submission should contain the source code and instructions for compiling and running it. If you project does not work, send a note explaining what stage it is at and why you think it does not work. Tom will acknowledge your submission after he is able to run your code. Late submission policies apply as in the syllabus. Note that grading will be such that submitting a working project a few days late will get a higher grades than submitting a non-working project on time.