Distributed and Concurrent Systems 6.5.2008 Exercise 8 These exercises at 6.5 10.30 - 12 at class T/D106 (both groups). Course exam 6.5. 08:00-10:00. We shall transform the previous time agreement to a JavaRMI -version. Now the server is given as a Remote interface (AgreeServerInterface) into which all clients register, and to which clients contact to start new agreements. When a new agreement is started, the server requests for applicable times from every registered client (including the one the made the initial request). After the replies are received (or a reasonable timeout has expired), the server announces the chosen time to all clients that responded. The request from client and announcing of the time to client is done through a Remote agreement client interface (AgreeClientInterface). In practice, the client creates and opens the interface upon startup and passes a reference to it at registration. The server remembers these references and contacts them when needed. Each agreement is identified using an integer id given on initiating a new agreement. The following X4 exercise is obligatory for all students. The answers to X-exercises have to be unique for every student. No copies of the same answer are allowed. The answer has to be sent by Monday 2:00 pm (the previous day). You will receive an acknowledgment upon successful processing. Answers will be graded. The answer must also contain a short self-evaluation (as a program comment) in which you describe whether the program works, nearly works, or does not probably work; how efficient it is, etc. A correct and proper self-evaluation is worth one point (in case of a proper answer). Send your answer to using cs to user sjuva with a subject HS_X4_username and the answer (with self-evaluation) as the body of the message (no attachments). At simplest using program mail at cs: /usr/ucb/mail -s HS_X4_username sjuva < username.java Where username is your cs username and username.java is a text file containing your answer. To make program compilable, the main class name must be exactly the same as your user name. No need to include AgreeProto, AgreeClientInterface, AgreeServerInterface or server classes to your answer. X4) Implement the client according the the protocol and interfaces given above. The consists of two parts. Firstly, the part that contains the user interface and initiates the agreements. Secondly, the listening part that reacts to the requests coming from the server. The listening part is an implementation of AgreeClientInterface. After the user gives proper times, the program connects to the server to start new agreement (and gives the times from user when server request them). For agreements started by others, it is enough to use random times. Take skeleton and interfaces from www-page. There is also a server for testing. 45) Let us assume a secret club that can exchange key at meetings. Augment to interfaces (but not implementation of them) above so that all content in request is encrypted. Describe also how the interfaces must be used to such detail, that the client and server can be implemented according to the interface description only. 46) Continue the exercise 26 (week 5) agreement by assumption that a significant part (e.g., 20%) of messages of a multicast are lost. How the agreement could be not still with a good probability but reasonable amount of multicasts. Use only multicasts (no single messages). 47) Continue the previous exercise by ensuring that the agreement always works even in case of unlucky group. 48) Let us assume a group (e.g., 32) persons sitting at a circle so that everyone has a board onto which (s)he can write and all can see (CROW). In the beginning everyone has a number in his/hers board. How the persons could fast (o(n)) count the sum of the figures so that at the end the sum would be in everyone's board. Write the algorithm (instructions to be followed by every person).