In this exercise, you will design and implement a simple electronic voting system using Sun remote procedure calls.
To submit your work, put your source and text files in a directory and use the turnin command on the Eniac Linux cluster. All programs should be written in C (with XDR and RPCGEN) and compile and execute on the Eniac-l machines.
Important: Take the time to write and code your answers clearly and lucidly, whether the language you are using is English or C.
Design a system that uses remote procedure calls to implement a very simple electronic election system that allows clients to vote for their favorite candidate in an election via RPC. The system should support five RPCs:
Design remote procedure calls for this system. Specify the data structures, network protocols, and other aspects of the system (using C, XDR, and English as appropriate) in sufficient detail that if you gave your specification to other people they would produce compatible client and server implementations.
You may impose reasonable limits on, e.g., the number of candidates, the length of candidate names, etc., but do be sure to document these limits in your specification.
Using the RPCGEN package, write a server for the voting system and clients that use each of the RPCs you specified above. Your server may be a single-threaded process (where each RPC call is processed in sequence).
Note: To complete this exercise, you will need to become familiar with the rpcgen package, which we did not discuss extensively in class. Part of the purpose of this exercise is to give you experience interpreting and evaluating the interfaces to unfamiliar system services.
Explain why this system might not be suitable for use in a real election. (What are the requirements for a good voting system? How does and doesn't this system meet them?)
Make your server multi-threaded, with multiple processes or threads able to (correctly) process votes simultaneously. Use either shared memory or the file system to store votes, but make sure to carefully consider mutex locking requirements and race conditions.
For an enormous amount of extra credit, get a state or local government to
use your system in an actual election.
Course
home page: http://www.crypto.com/courses/fall07/cse380/
27 November 2007;