Andrew Birrell and Bruce Nelson Presented by Kai Cong Conventional Procedure Calls main proc 1 proc 5 proc 2 proc 3 proc 4 proc 6 proc 7 proc 8 Within a program On a single computer ID: 173925
Download Presentation The PPT/PDF document "Implementing Remote Procedure Calls" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
Implementing Remote Procedure Calls
Andrew Birrell and Bruce Nelson
Presented
by
Kai CongSlide2
Conventional Procedure Calls
main
proc
1
proc
5
proc
2
proc
3
proc
4
proc
6
proc
7
proc
8
Within a program On a single computer!!!Slide3
Extension of the Procedural Model
main
proc
1
proc
5
proc
2
proc
3
proc
4
proc
6
proc
7
proc
8
computer
1
computer
2
Across a network between programs
On different computers!!!Slide4
4
Remote Procedure Call (RPC)
Client
Server
Request
Reply
Computing
Blocked
Blocked
BlockedSlide5
RPC – How it works
client
procedure call
client stub
locate
(un)marshal
(de)serialize
send (receive)
server
procedure
server stub
(un)marshal
(de)serialize
receive (send)
client process
server process
RPC Runtime module
RPC Runtime moduleSlide6
Issues
BindingPassing dataImplementationExceptions
RPC systemsSlide7
The binding operation is to bind an importer of an interface to an exporter of an interface.
After binding, calls made by the importer invoke procedures implemented by the remote exporter.static binding vs dynamic binding
BindingSlide8
static
binding(not presented by the paper)hard coded stubsimpleefficientnot flexible
stub recompilation is necessary if the location of the server changesuse of redundant servers is not possible
Static
BindingSlide9
dynamic binding
Interface: type and instanceDatabaseload balancingflexible
redundant servers is possibleDynamic BindingSlide10
client
procedure call
client stub
bind
(un)marshal
(de)serialize
find
send
receive
RPC Runtime module
server
procedure
server stub
register
(un)marshal
(de)serialize
receive
send
client process
server process
Database
2
4
5
6
7
1
3
Dynamic
Binding
RPC Runtime module
7Slide11
Issues
BindingPassing dataImplementation
ExceptionsRPC systemsSlide12
Passing Data
Can't use the stack!Can't use shared memory!Generally use message passingSlide13
Passing data
Build a message that includes:Who and what's being called
Identity of the callerData values in known byte orderUsing an intermediate data representationSlide14
Issues
BindingPassing dataImplementation
ExceptionsRPC systemsSlide15
ImplementationSlide16
Implementation
Function prototype is (almost) all that's needed to build the client stubAlso need binding information
Function prototype is (almost) all that's needed to build server stubAlso need method to wait for messageSlide17
Implementation
Stub compiler
Generates stubs for client and serverLanguage dependentCompile into machine-independent format
Transport protocol
PUP, XML, SOAP, DCOM, CORBA, …Slide18
Implementation
Clients
Threaded
Servers
Event DrivenSlide19
Issues
BindingPassing dataImplementationExceptions
RPC systemsSlide20
What can happen in "normal" procedures
? Procedure generates an exceptionProcedure infinite loopsProcedure generates wrong results
ExceptionsSlide21
Exceptions
What can happen in "remote" procedures?
Client stub generates an exceptionTransmission failureknowable failure
unknowable failure
Remote procedure generates an exception
Remote procedure infinite loops
Remote procedure generates wrong resultsSlide22
Issues
BindingPassing dataImplementation
ExceptionsRPC systemsSlide23
RPC Systems
Sun RPC
DCE RPC DCOM
CORBA
Java RMI
XML RPC, SOAP/.NET, AJAX, REST
Protocol Buffers (Google)
Thrift (
Facebook
)Slide24
Conclusion
Remote Procedure Call should look and feel like local callRemote Procedure Call should be independent of where it executes
Remote Procedure Call should be "efficient“