9. Same IPC mechanism can be used for procedure on different machines as well as on the same machine11/21/2009 IT703D: Dirstibuted Computing Debasis Das 3
14. Control is returned to calling procedure with result, if any11/21/2009 IT703D: Distributed Computing Debasis Das 4
15. RPC Model(Graphically) Caller Client Process Request message & parameters Send reply with result, if any Server Process 11/21/2009 IT703D: Distributed Computing Debasis Das 5
16.
17. If concurrency required, calling processes can leave messages asynchronously, server process keeps serving requests
18. Server process can have threads. Starts a thread on request, server is free to field further calls if they come along11/21/2009 IT703D: Distributed Computing Debasis Das 6
22. Syntactic transparency is easy to achieve but not semantic transparency11/21/2009 IT703D: Distributed Computing Debasis Das 7
23.
24. No shared memory: passing addresses as arguments is meaningless, call by reference pointers are useless, structures referenced by pointers are difficult.
25. More vulnerable to failures: two different processes, two different machines, intervening network. Processor and communication failures need to be taken care of.
26. RPCs can take much more time(x100 to x1000) due to communication congestions. Long delays need to be handled.11/21/2009 IT703D: Distributed Computing Debasis Das 8
41. Optimizes data to be sent over the network. Interface definition usually will have information as to which arguments are input/output/both.11/21/2009 IT703D: Distributed Computing Debasis Das
44. Define an interface using the IDL, write client program that imports the interface and server program that exports the interface
45. IDL compilers generate client stub procedure, server stub procedure, header files. Compile & link the stubs.
46. Interface code thus generated could be combined with client/server procedures done in different languages11/21/2009 IT703D: Distributed Computing Debasis Das
47.
48. Sent by client to server with request to execute a remote procedure
58. Client id field, identifying the requesting client and for authentication11/21/2009 IT703D: Distributed Computing Debasis Das
59. RPC Call Message Structure Remote Procedure id Client id Message id Message type Program number Version number Procedure number Arguments 11/21/2009 IT703D: Distributed Computing Debasis Das 16
66. RPC Reply Message Structure Message id Message type Reply Status success Result(s) Message id Message type Reply Status failure Failure reason 11/21/2009 IT703D: Distributed Computing Debasis Das 18
73. Must reflect structure of all types; primitive types, structured types and user defined types11/21/2009 IT703D: Distributed Computing Debasis Das 19
74. Marshalling Procedure Types Provided as part of the RPC support. Procedures for scalar types and compound ones built from Scalar types are included Defined by users of RPC systems. Includes marshalling procedures for user defined data types 11/21/2009 IT703D: Distributed Computing Debasis Das
84. For example a Stateful file server will remember that a particular client opened a file(given file id) previously and will let consecutive reads /writes and other operations on that file to be done properly
85. Two consecutive reads such as Read(fid,100,buf) will read two consecutive 100 bytes of data from the open file, opened in an earlier procedure call.11/21/2009 IT703D: Distributed Computing Debasis Das
86.
87. It is the responsibility of the server to ensure the operations are carried out correctly
88. For a similar example; you may have to open the file, seek to the correct location and then read to have a Read correctly.
89. Read(filename, position, bytes, buffer) or Write(filename, position, bytes, buffer)11/21/2009 IT703D: Distributed Computing Debasis Das
93. Client may be unaware of crash & restart creating inconsistent results.
94. Client crashes and restarts, server has useless state information that cannot be easily rolled back11/21/2009 IT703D: Distributed Computing Debasis Das
103. Will have to be a stateless server and state information to be maintained by the client process or the OS. OS involvement is expensive.11/21/2009 IT703D: Distributed Computing Debasis Das
161. Whereas if the callee executes exactly once, indempotency can be guaranteed
162. Implementation uses timeouts, re-transmissions, call id, same id for repeats and reply cache for callee11/21/2009 IT703D: Distributed Computing Debasis Das
188. Use sequence numbers, the ack. carries the sequence number original request, as does the reply message11/21/2009 IT703D: Distributed Computing Debasis Das
189.
190. RPCs involving arguments and/or results that cannot be fitted into one datagram11/21/2009 IT703D: Distributed Computing Debasis Das
191.
192. Request message to server, periodic probes with the same request number, server generates ack.
193. If original request was not received, server says so and client is intimated of failure
195. Server generates ack. Prior to timeout. So the client knows the server is working on request.
196. If ack. or reply not received within timeout, failure of node or comm. is assumed and user informed.11/21/2009 IT703D: Distributed Computing Debasis Das
197.
198. Use multiple physical RPC for each logical RPC. Each physical RPC handles data for one datagram
223. Binding agent check periodically and deregister non responding servers11/21/2009 IT703D: Distributed Computing Debasis Das
224. Primitives used: register, deregister and lookup Server registers Client request for server Server information Client calls the server Binding Agent 2 1 3 Server Process Client Process 4 11/21/2009 IT703D: Distributed Computing Debasis Das Binding Process
234. Binding Agent Client passes server interface name name & arguments 2. Agent does RPC call to server 3.Server returns result 4. Agent returns result & handle 5.Client makes subsequent calls directly 1 3 2 4 Server Process Client Process 5 11/21/2009 IT703D: Distributed Computing Debasis Das Call Time Binding(Indirect call)
235.
236. Client may want to change binding to another server if the earlier call failed
237. Server may want to change binding if it has to change to another node or upgrade to another version
238. When a server wants to change binding, the current state data may have to be transferred to the alternate server11/21/2009 IT703D: Distributed Computing Debasis Das
245. Can be handled by programming languages that have exception handling constructs
246. Alternatively(like in Unix) return a value -1 to indicate error and a global variable errno that contains a number indicating error type( a legitimate result could be -1)11/21/2009 IT703D: Distributed Computing Debasis Das
251. Is it ok if results and arguments of RPC are required or they could be shared by other users? (Other than caller & callee)11/21/2009 IT703D: Distributed Computing Debasis Das
257. Send a batch of RPC calls. High call rate(50-100 remote calls per second) applications can use this11/21/2009 IT703D: Distributed Computing Debasis Das
265. A handle also may be sent so that further calls can be made directly11/21/2009 IT703D: Distributed Computing Debasis Das
266.
267. To do that the client usually calls a svc-routine. The svc-routine waits for a callback and intimates client when a callback is received11/21/2009 IT703D: Distributed Computing Debasis Das
268. Waiting for reply From P2 Process P1 Process P2 Process P3 Waiting for Reply from P3 Waiting for reply From P1 11/21/2009 IT703D: Distributed Computing Debasis Das Handling Callback Deadlocks
283. A call is made which needs a reply, one must be able to distinguish between the batch calls and non-queueing RPC request11/21/2009 IT703D: Distributed Computing Debasis Das
290. Delay the decision. Binding agent sends the necessary data conversion and protocol routines to the client stub at binding time11/21/2009 IT703D: Distributed Computing Debasis Das
343. One way to reduce the load is to use stateless servers. Clients can keep track of the state. It is responsible for the processing anyway11/21/2009 IT703D: Distributed Computing Debasis Das