RPC Lab

Remote Procedure Call

Background:

In this lab you will have the opportunity to implement a very basic version of RPC.  The lab will allow you to set up a very simple remote file system with open, read and write functionality.  This will be built on top of the TCP layer of your protocol stack (if your TCP layer isnt working, you can potentially try running it on top of IP).  In contrast to previous labs, you will be writing both the client and server parts of this lab and you will be passing the lab off against your own code.  The following basic procedure will be followed in running your code:

Specifications:

You should study the examples and code on pages 405-431 in order to understand the basic operation of RPC. We will be modeling SunRPC, except for the fact that SunRPC sits on top of UDP which is on top of IP.  Instead, we will use TCP to guarantee delivery in order.  You have already implemented TCP and IP and the rest of the stack. RPC will push to TCP and TCP will pop to RPC, in this lab.  You can find example packet breakdowns on page 427 - notice request and reply are different (a and b of figure 5.20)
 
 

The RPC layer object will be similar to the other objects you have written in prior labs.  The RPC layer object must support the following methods:

Passoff: The arguments to the binary are the same as ARP. The arguments are (host where daemon is running[this machine]) (port daemon is listening to[1234]) (src IP address) (src ETH address) (dst IP address) (dst ETH address) (-c or -s) (-v optional debug flag) (0xff debug level). Pick IP addresses and Ethernet addresses with the same high order bytes as this example, then change the bottom byte between 4 and 200. We are reserving 2 and 3 for the switches. You should receive email indicating values that will not be likely to be used by anyone else.

Example:

On the machine cs460-7 run

./rpc cs460-7 1234 192.168.102.7 00:a0:cc:66:99:33 192.168.102.2 00:a0:cc:66:99:35 -c -v 0xff

On the machine cs460-5 run with exactly the same arguments, except for the hostname and client flag

./rpc cs460-5 1234 192.168.102.7 00:a0:cc:66:99:33 192.168.102.2 00:a0:cc:66:99:35 -s -v 0xff

While you are getting your code working, you will probably want to turn on some serious debug statements. If you want to run the lab code to see how it implemented RPC you can run something like "./rpc cs460-7 1234 192.168.102.1 00:a0:cc:66:99:33 192.168.102.2 00:a0:cc:66:99:35 -c -v 0xff" it will turn on a lot of debug in the lower layers. Bit 0 turns on the physical layer printfs. Bit 1 (0x2) turns on the ethernet debug.  Bit 2 (0x4) turns on a printf when something is not destined for your ethernet address. Bit 3 (0x8) turns on the basic arp debug.  Bit 4 (0x10) just shows what is being put into the arp table. Bit 6 (0x40) turns on the IP debug statements.  Bit 7 (0x80) turns on the TCP debug.  Bit 8 (0x100) turns on the RPC debug.
 

The passoff procedure will test the following specific items

The passoff version of main.cc can be found in ~cs460ta/labs/rpc_template. Run your code on two machines in order to pass off your program for the TA during his office hours.

The following passoff levels will apply to this lab:
 
 
Passoff Level Behavior Points
Minimal Passoff open and simple read work 3 Points
Write works Write actually adds data to the file 4 Points
Perfect Behavior Read beyond end and after write work 3 Points