Docsity

Implementing Dynamic Binding and RPC with Sockets Assignment, Exercises of Advanced Operating Systems

Toggle sidebar
bg1
Assignment #2
Implementing Dynamic Binding for RPC
In this assignment you will use sockets to implement dynamic binding and a simplified form of
RPC. You will have three programs: a client; a server; and a name server. The client consists of a test
program that calls your remote procedure. This program is linked to a client stub that does the usual
jobs: marshalling parameters, connecting to the server, sending a request, receiving the reply and
returning the result to the test program. You should do the connection using Internet domain stream
sockets. The server should accept requests, unmarshall the parameters, call the remote procedure, and
return the result. The server is linked to the remote procedure. You should write a client stub that has the
same name, number of parameters and return type as your remote procedure. In other words, you are
implementing a limited form of RPC. The client and server programs should run on different Linux
machines. Your implementation should use dynamic binding meaning that your client program doesn’t
know the address of the server. Instead it knows the IP address and port number of a third program - the
name server. The name server accepts requests containing an identifier for the remote procedure and
returns a handle containing the address of the server to be used in contacting the server or an error
message if it doesn’t know where the server is. The connection from the client to the name server should
also be done using stream sockets. The server will also contact the name server to register (it notifies the
name server of its identifier and its address). When the server shuts down it deregisters with the name
server. Your name server should be written in such a way that it could handle more than one remote
procedure. Your client stub should signal to the client if it can’t find the server by raising a signal. Your
test program must be written in such a way that we can test the following: 1) server registers; 2) client
gets handle; 3) client calls remote procedure and gets result; 4) server deregisters and moves then is
successfully contacted by client which previously held a handle; 5) server deregisters, client stub which
previously held a handle cannot contact server so it raises a signal. Describe the procedure to test each of
these cases in your readme file.
Your program must be submitted as described in the syllabus. Make sure that you document the
procedure to be used to test your program (i.e. the sequence of commands to be entered). Any deviation
from the description given here or from the description of the submission process given in the syllabus
will cause you to lose points. Programs will be examined for copying.
Extra credit: Further implement RPC by automatically generating client and server stubs from an IDL
file. Your generator (a stand-alone program) should work on general files (not just one particular file).
The file (whose format you can decide on) should allow one remote procedure to be described. The file
should give the name of the remote procedure, an identifier for the remote procedure, the names and
types of parameters, and the return type. Parameters can be integers, characters, or arrays of integers or
characters. Document the format for your IDL file so that I can write my own file and use your generator
to generate client and server stubs.
Docsity.com

Partial preview of the text

Download Implementing Dynamic Binding and RPC with Sockets Assignment and more Exercises Advanced Operating Systems in PDF only on Docsity!

Assignment

Implementing Dynamic Binding for RPC

In this assignment you will use sockets to implement dynamic binding and a simplified form of RPC. You will have three programs: a client; a server; and a name server. The client consists of a test program that calls your remote procedure. This program is linked to a client stub that does the usual jobs: marshalling parameters, connecting to the server, sending a request, receiving the reply and returning the result to the test program. You should do the connection using Internet domain stream sockets. The server should accept requests, unmarshall the parameters, call the remote procedure, and return the result. The server is linked to the remote procedure. You should write a client stub that has the same name, number of parameters and return type as your remote procedure. In other words, you are implementing a limited form of RPC. The client and server programs should run on different Linux machines. Your implementation should use dynamic binding meaning that your client program doesn’t know the address of the server. Instead it knows the IP address and port number of a third program - the name server. The name server accepts requests containing an identifier for the remote procedure and returns a handle containing the address of the server to be used in contacting the server or an error message if it doesn’t know where the server is. The connection from the client to the name server should also be done using stream sockets. The server will also contact the name server to register (it notifies the name server of its identifier and its address). When the server shuts down it deregisters with the name server. Your name server should be written in such a way that it could handle more than one remote procedure. Your client stub should signal to the client if it can’t find the server by raising a signal. Your test program must be written in such a way that we can test the following: 1) server registers; 2) client gets handle; 3) client calls remote procedure and gets result; 4) server deregisters and moves then is successfully contacted by client which previously held a handle; 5) server deregisters, client stub which previously held a handle cannot contact server so it raises a signal. Describe the procedure to test each of these cases in your readme file. Your program must be submitted as described in the syllabus. Make sure that you document the procedure to be used to test your program (i.e. the sequence of commands to be entered). Any deviation from the description given here or from the description of the submission process given in the syllabus will cause you to lose points. Programs will be examined for copying.

Extra credit: Further implement RPC by automatically generating client and server stubs from an IDL file. Your generator (a stand-alone program) should work on general files (not just one particular file). The file (whose format you can decide on) should allow one remote procedure to be described. The file should give the name of the remote procedure, an identifier for the remote procedure, the names and types of parameters, and the return type. Parameters can be integers, characters, or arrays of integers or characters. Document the format for your IDL file so that I can write my own file and use your generator to generate client and server stubs.

Docsity.com