Implementing Remote Procedure Calls Andrew Birrell and Bruce Nelson - - PowerPoint PPT Presentation

implementing remote procedure calls
SMART_READER_LITE
LIVE PREVIEW

Implementing Remote Procedure Calls Andrew Birrell and Bruce Nelson - - PowerPoint PPT Presentation

Implementing Remote Procedure Calls Andrew Birrell and Bruce Nelson Presented by Kai Cong Conventional Procedure Calls main proc 1 proc 2 proc 3 proc 4 proc 5 proc 6 proc 7 proc 8 Within a program on a single computer!!! Extension of the


slide-1
SLIDE 1

Implementing Remote Procedure Calls

Andrew Birrell and Bruce Nelson

Presented by

Kai Cong

slide-2
SLIDE 2

Conventional Procedure Calls

main proc1 proc5 proc2 proc3 proc4 proc6 proc7 proc8

Within a program on a single computer!!!

slide-3
SLIDE 3

Extension of the Procedural Model

main proc1 proc5 proc2 proc3 proc4 proc6 proc7 proc8

computer1 computer2 across a netWork betWeen programs

  • n different computers!!!
slide-4
SLIDE 4

4

Remote Procedure Call (RPC)

Client Server Computing Blocked Blocked Blocked

slide-5
SLIDE 5

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 module

slide-6
SLIDE 6

Issues

  • Binding
  • Passing data
  • Implementation
  • Exceptions
  • RPC systems
slide-7
SLIDE 7
  • The binding operation is to bind an importer
  • f 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

Binding

slide-8
SLIDE 8
  • static binding(not presented by the paper)

– hard coded stub – simple – efficient – not flexible – stub recompilation is necessary if the location

  • f the server changes

– use of redundant servers is not possible

Static Binding

slide-9
SLIDE 9
  • dynamic binding

– Interface: type and instance – Database

  • load balancing

– flexible – redundant servers is possible

Dynamic Binding

slide-10
SLIDE 10

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

7

slide-11
SLIDE 11

Issues

  • Binding
  • Passing data
  • Implementation
  • Exceptions
  • RPC systems
slide-12
SLIDE 12

Passing Data

  • Can't use the stack!
  • Can't use shared memory!
  • Generally use message passing
slide-13
SLIDE 13

Passing data

Build a message that includes:

  • Who and what's being called
  • Identity of the caller
  • Data values in known byte order
  • Using an intermediate data representation
slide-14
SLIDE 14

Issues

  • Binding
  • Passing data
  • Implementation
  • Exceptions
  • RPC systems
slide-15
SLIDE 15

Implementation

slide-16
SLIDE 16

Implementation

  • Function prototype is (almost) all that's

needed to build the client stub

– Also need binding information

  • Function prototype is (almost) all that's

needed to build server stub

– Also need method to wait for message

slide-17
SLIDE 17

Implementation

  • Stub compiler

– Generates stubs for client and server – Language dependent – Compile into machine-independent format

  • Transport protocol

– PUP, XML, SOAP, DCOM, CORBA, …

slide-18
SLIDE 18

Implementation

Clients

Threaded

Servers

Event Driven

slide-19
SLIDE 19

Issues

  • Binding
  • Passing data
  • Implementation
  • Exceptions
  • RPC systems
slide-20
SLIDE 20
  • What can happen in "normal" procedures?

– Procedure generates an exception – Procedure infinite loops – Procedure generates wrong results

Exceptions

slide-21
SLIDE 21

Exceptions

  • What can happen in "remote" procedures?

– Client stub generates an exception – Transmission failure

  • knowable failure
  • unknowable failure

– Remote procedure generates an exception – Remote procedure infinite loops – Remote procedure generates wrong results

slide-22
SLIDE 22

Issues

  • Binding
  • Passing data
  • Implementation
  • Exceptions
  • RPC systems
slide-23
SLIDE 23

RPC Systems

  • Sun RPC
  • DCE RPC
  • DCOM
  • CORBA
  • Java RMI
  • XML RPC, SOAP/.NET, AJAX, REST
  • Protocol Buffers (Google)
  • Thrift (Facebook)
slide-24
SLIDE 24

Conclusion

  • Remote Procedure Call should look and feel

like local call

  • Remote Procedure Call should be independent
  • f where it executes
  • Remote Procedure Call should be "efficient“