CSC8320 Advanced Operating Systems

advertisement
CSC8320 Advanced Operating Systems
Project Four
Due Date: Monday, November 11, 2002
In a distributed computer system, a group of processors/processes is assumed to be
connected by communication links into a network. Each processor (node) of the network
has an identity (a unique integer value) that is not related to its position in the network
(the position of each node in the network will be called the address). A processor's
identity is known only to the processor itself and usually the processor that has the
highest identity is the leader of the network. The problem of finding the leader processor
is the election problem and a protocol that will find the leader is called an election
protocol. Some applications of the election protocol are discussed in our class. One of
them is: When all or parts of a computer network fails, a reorganization will require that
one processor be a coordinator. However, during a failure the information about which
processor had been the coordinator may be "forgotten" by some processors and
furthermore, the coordinator processor itself may have failed. Therefore, when a system
failure is detected, an election protocol must be run to find a new coordinator, which will
reorganize the system so that productive work may be accomplished again.
This project requires you to implement several election protocols on a ring topology.
After creating several processes on different computers, each process randomly generates
an integer identifier. In this way, we hope that all processes have different identifiers. We
assume that the protocols work in phases. After each phase, you may synchronize all
processes. You may implement the protocols using Unix sockets, Java sockets, or
Message Passing Interface (MPI) on any Unix systems connected by a network. You
should test your code using a large number of processes whenever possible. The project
consists of three parts.
Part 1: Implement one of the following algorithms (50%)

In this election protocol, we assume that the ring is directional. You are going to
implement the election developed by Chang and Roberts. The protocol will have
large message complexity.

Implement the improved leader election protocol on a bi-directional ring network
(by Hirschberg and Sinclair 1980). In this protocol, an initiator node remains
active only if its identifier is higher than both neighbors’. This effectively
eliminates at least half of the nodes in each round of message exchanges, resulting
in O(logN) phases in the protocol. Thus, the whole protocol’s message
complexity is O(NlogN).
Part 2: Emulate the above protocol on a directional ring network (by Dolev, Klawe, and
Rodeh 1982). The protocol’s message complexity is still O(NlogN). This project requires
you to design the protocol yourself. (30%)
Part 3: Implement the election algorithm in a complete network with a sense of direction
(by Loui, Matsushita and West 1986). The message complexity of this algorithm is O(N)
but the network used has much more links (each node will have N-1 neighbors). (20%)
Outputs:
Initially, each process prints out its address, its identifier, and its status (active).
Addresses can be assumed to be from 0 to N-1 for N processes and identifiers are random
numbers generated locally. Besides output the identifier and address of the leader at the
end of the protocol, each process will print out its address, its identifier, and its status
(passive or active) at the end of each phase. You need to print the addresses and
identifiers in order; that is, process 0 should print out its information first, and process N1 should print out last. Please label the outputs clearly. You also need to print out the
number of messages used in each protocol.
You must submit:
1.
2.
3.
4.
properly documented source codes;
procedures to compile and run your program;
A user manual which describes your entire submission;
Makefile for compiling your program.
Download