Remote procedure calls

Please work out the pre-lab problems before your next lab section. The GSI/IAs will go over all problems during the lab section.

[pre-lab and in-lab] 1. Remote procedure calls (RPC)

Consider the following linked list structure:

struct Node {
    string s;
    struct Node* next;	// pointer to the next node in the data, or null if this
    			// is the last node
};

struct Node* head;      // pointer to the first node in the list, or null if list
			// is empty

void append(Node* head, char c);	// append c to every node in the list

[pre-lab] A. Write append, then write a centralized program that creates a non-empty linked list and calls append.

[pre-lab] B. Write a function that sends the linked list to another machine, and write a function that receives and recreates the linked list. Only send/receive data that is required to recreate the linked list. The two machines may not use identical processors, so use htonl and ntohl to deal with different byte orders for integers.

[pre-lab] C. Write client and server RPC stubs for append, which allows a client program to call append without being aware that it is running on a remote computer.

[in-lab] D. Write a distributed