Home Schedule Reading Projects People
Mac Logo Windows Logo Minix Logo Sun Solaris Logo Linux Logo

Project 3: Inter Process Communication (IPC): Remote Procedure Calls (25/25 pts)

Assignment Day September 27, 2011 (Tuesday)
Due Date October 04, 2011 (Tuesday) Evening.

For Question 1-3 : Submit a hardcopy of your code (make sure it is readable) and a softcopy on odin via the submit command.

Note that you may need a .rhost file under you home directory, it includes authority to the machine that the 'server' accepts clients <hostname> and from what login id <loginid>.

The format for a .rhost file is:

<hostname1> <loginid1>
<hostname2> <loginid2>
.
.
.

<hostnameN> <loginidN>

The instructor's .rhost file may look like the below (login id is 'maria'):

atlas.cs.uga.edu  maria
odin.cs.uga.edu   maria
herc.cs.uga.edu   maria

Great RPC tutorial - Prof David Marshall @ Cardiff University (optional reading):
http://www.cs.cf.ac.uk/Dave/C/node33.html

On rpcgen: http://www.cs.cf.ac.uk/Dave/C/node34.html#ch:rpcgen (not you may not have permission to print on another server's Console for the printmessage tutorial).

Wikipedia: http://en.wikipedia.org/wiki/Remote_procedure_call (also check the link listed under 'external link" to the SGI Tutorial "Introduction to RPC Programming").

Question 1: Remote Procedure Calls (RPC) Compute the median (10 pts)

Modify the average RPC programs (avg.x, avg_proc.c and ravg.c) discussed last week so that it computes the median of a maximum of 100 numbers instead of the average of a maximum of 200 numbers. Test your program on odin.

The average RPC program is available here - a Makefile tested on odin is included). Just type make after installing these program on odin (make sure you have an .rhost file under your home diretory, and that 'white' space works correctly in the makefile (i.e., cut and past the makefile will not work).

For the avg program: Run the RPC server program by starting the server: ./avg_svc

For the avg program: Run the RPC client program by : ./ravg odin.cs.uga.edu 1 2 3 4

Try to use a different 'port number' than other classmates by 'uniquifying' the 22855 number given in the avg.x file. Suggesion, use the last 4 digits of you student ID number or some other unique number.

A zip file of the directory above is here:

rpc.zip

Question 2: Remote Procedure Calls (RPC): Echo RPC server (5 pts)

Write a program using remote procedure calls where the server simply echo's the word back to the client. Test your program on odin.

Question 3: Remote Procedure Calls (RPC): Sort numbers (10 pts)

Modify the average RPC program so that the server sends back a list of 'sorted' numbers to the client either in descending or ascending order given by an input parameter when invoking the client, e.g., the word "ascending:, "descending" (or just -a, -d).