Download presentation
Presentation is loading. Please wait.
Published byBrice Grant Modified over 8 years ago
1
Politecnico di Milano © 2001 William Fornaciari Operating Systems R P C Remote Procedure Call Lecturer: William Fornaciari Politecnico di Milano fornacia@elet.polimi.itwww.elet.polimi.it/~fornacia
2
Remote Procedure Call© 2001 William Fornaciari- 2 - REMOTE PROCEDURE CALL Allows programs to call procedures located on other machines Allows programs on different machines to interact using simple procedure call/return semantics Widely accepted Standardized client and server modules can be moved among computers and operating systems easily Goal : to make distributed computing look like centralized computing
3
Remote Procedure Call© 2001 William Fornaciari- 3 - RPC PROBLEMS Calling and called procedures run on different machines Calling and called procedures execute in different address spaces Parameters and results have to be passed Both machines can crash and each of the possible failures causes different problems
4
Remote Procedure Call© 2001 William Fornaciari- 4 - RPC TIMELINE
5
Remote Procedure Call© 2001 William Fornaciari- 5 - RPC MECHANISM Client Application Client Application Remote Server Application Remote Server Application Local Application or Operating System Local Application or Operating System Local Stub RPC Mechanism RPC Mechanism Local Stub RPC Mechanism RPC Mechanism Remote Procedure Call Local Response Local Response Local Response Local Procedure Call Local Procedure Calls Remote Procedure Call
6
© 2001 William Fornaciari- 6 - RPC STEPS 1The client procedure calls the client stub in the normal way 2The client stub builds a message 3The client stub gives the message to the server stub 4The server stub unpacks the parameters and calls the server 5The server does the work and returns the result to the stub 6The server stub packs it in a message 7The server stub gives the message to the client stub 8The stub unpacks the result and returns to the client
7
Remote Procedure Call© 2001 William Fornaciari- 7 - MARSHALLING Marshalling : packing parameters into a message Problem : each machine has its own representation for numbers characters and other data items EBCDIC character code vs ASCII little endian number format vs big endian different representations of floating point
8
Remote Procedure Call© 2001 William Fornaciari- 8 - MARSHALLING: FIRST APPROACH Use a canonical form for integers, characters, booleans, floating point numbers… All senders have to convert their internal representation to the canonical form Limit : Inefficient Example: if a big endian client is talking to a big endian server two conversions are done where none were necessary
9
Remote Procedure Call© 2001 William Fornaciari- 9 - MARSHALLING: SECOND APPROACH The sender uses its own native format The sender indicates in the first byte of the message which format this is As soon as a message comes in, the receiver stub examines the first byte to see what the client is Advantage : Efficient Example: if a big endian client is talking to a big endian server no conversion is done
10
Remote Procedure Call© 2001 William Fornaciari- 10 - BINDING Binding : how the client locates the server 1st Solution: hardwire the network address of the server into the client Limit: extremely inflexible if the server moves if the server is replicated if the interface changes
11
Remote Procedure Call© 2001 William Fornaciari- 11 - DYNAMIC BINDING 2nd Solution : Dynamic Binding the server sends a message to a program called binder, to make its existence known (registration) the client sends a message to the binder asking to import the version and interface of the requested service the binder checks to see if one or more servers have already exported an interface with the wanted name and version number if no currently running server is willing to support this interface, the call fails if a suitable server exists, the binder gives its handle and unique identifier to the client stub
12
Remote Procedure Call© 2001 William Fornaciari- 12 - RPC PROTOCOLS: SERVER REGISTRATION
13
Remote Procedure Call© 2001 William Fornaciari- 13 - RPC PROTOCOLS: CLIENT BINDING
14
Remote Procedure Call© 2001 William Fornaciari- 14 - PRESENCE OF FAILURES The client is unable to locate the server The request message from the client to the server is lost The reply message from the server to the client is lost The server crashes after receiving a request The client crashes after sending a request
15
Remote Procedure Call© 2001 William Fornaciari- 15 - RPC CALL SEMANTICS RPC call semantics Delivery guarantees Retry request message Duplicate filtering at server Re-execute procedure or retransmit reply Maybe At-least-once At-most-once No Yes No Not applicable Not applicable Re-execute procedure Retransmit reply
16
Remote Procedure Call© 2001 William Fornaciari- 16 - REFERENCES Stallings W. Sistemi Operativi Jackson Libri Silberschatz A. Sistemi Operativi Addison-Wesley Tanenbaum A. I Moderni Sistemi Operativi Jackson Libri Web
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.