implementing remote procedure calls authored by andrew d. birrell and bruce jay nelson xerox palo...

22
Implementing Remote Procedure Calls Authored by Andrew D. Birrell and Bruce Jay Nelson Xerox Palo Alto Research Center Presented by Lars Larsson

Upload: nancy-horn

Post on 01-Jan-2016

228 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Implementing Remote Procedure Calls Authored by Andrew D. Birrell and Bruce Jay Nelson Xerox Palo Alto Research Center Presented by Lars Larsson

Implementing Remote Procedure Calls

Authored by Andrew D. Birrell and Bruce Jay Nelson

Xerox Palo Alto Research Center

Presented by Lars Larsson

Page 2: Implementing Remote Procedure Calls Authored by Andrew D. Birrell and Bruce Jay Nelson Xerox Palo Alto Research Center Presented by Lars Larsson

Contents The RPC model and environment Aims of RPC facility and alternatives High level overview of the RPC facility RPC Binding Packet transport protocol Process Use Exception Handling Performance evaluation Conclusion

Page 3: Implementing Remote Procedure Calls Authored by Andrew D. Birrell and Bruce Jay Nelson Xerox Palo Alto Research Center Presented by Lars Larsson

RPC Model

Client server model for distributed computing

Network I/O is ‘wrapped’ by stubs Programmer doesn’t need to know

about message passing implementation

Page 4: Implementing Remote Procedure Calls Authored by Andrew D. Birrell and Bruce Jay Nelson Xerox Palo Alto Research Center Presented by Lars Larsson

This RPC Environment

Written for the Cedar project: a programming environment for building experimental programs and systems

Coded mostly in Mesa but also some Smalltalk and InterLisp

Communicate across the Xerox research inter-network

Page 5: Implementing Remote Procedure Calls Authored by Andrew D. Birrell and Bruce Jay Nelson Xerox Palo Alto Research Center Presented by Lars Larsson

Aims of the RPC Facility

Efficiency of communication

Simplicity Security

Page 6: Implementing Remote Procedure Calls Authored by Andrew D. Birrell and Bruce Jay Nelson Xerox Palo Alto Research Center Presented by Lars Larsson

Alternatives to Procedure Calls

Some form of remote fork and shared address space

This choice might introduce possible complications with the programming language

Not likely to be as efficient Need more research of possible

benefits

Page 7: Implementing Remote Procedure Calls Authored by Andrew D. Birrell and Bruce Jay Nelson Xerox Palo Alto Research Center Presented by Lars Larsson

The 5 Pieces of a Procedure Call

User process User Stub RPC Communications

Package (RPC Runtime) Server Stub Server process

Page 8: Implementing Remote Procedure Calls Authored by Andrew D. Birrell and Bruce Jay Nelson Xerox Palo Alto Research Center Presented by Lars Larsson

Generating the Pieces The RPC Runtime is part of Mesa -

the major programming language of Cedar

User and Server code are written as part of the distributed application

User and Server Stubs are generated by Lupine

Lupine uses specifications from the Mesa interface modules

Page 9: Implementing Remote Procedure Calls Authored by Andrew D. Birrell and Bruce Jay Nelson Xerox Palo Alto Research Center Presented by Lars Larsson

Caller and Callee

User process, user stub and an instance of the RPC Runtime exist on the caller machine

Server process, server stub and an instance of the RPC Runtime exist on the callee machine

Page 10: Implementing Remote Procedure Calls Authored by Andrew D. Birrell and Bruce Jay Nelson Xerox Palo Alto Research Center Presented by Lars Larsson

Overview of a simple call:

Page 11: Implementing Remote Procedure Calls Authored by Andrew D. Birrell and Bruce Jay Nelson Xerox Palo Alto Research Center Presented by Lars Larsson

Binding Importers and Exporters

Names bind importer with an exporter of an interface

Each Name holds the type and possibly an instance of the interface

Type describes which interface the caller expects the callee to implement

Instance specifies which implementer of the interface is desired

Page 12: Implementing Remote Procedure Calls Authored by Andrew D. Birrell and Bruce Jay Nelson Xerox Palo Alto Research Center Presented by Lars Larsson

Locating Exporters with Grapevine

Each record is a Grapevine RName which have two varieties: individual or group

Individual RNames hold the connect-site network addresses

Group RNames hold a list of RNames identifying which instances belong to a particular group

Page 13: Implementing Remote Procedure Calls Authored by Andrew D. Birrell and Bruce Jay Nelson Xerox Palo Alto Research Center Presented by Lars Larsson

Given type FileAccess.Alpine wih instance Ebbets.Alpine exported from a server at 3#22# and another instance of FileAccess.Alpine with an instance named Luther.Alpine exported from a server at 3#276#

The members of the Grapevine group FileAccess.Alpine would include Ebbets.Alpine and Luther.Alpine.

The Grapevine individual Ebbets.Alpine would hold 3#22# and the individual Luther.Alpine would hold 3#276#

Example of Grapevine Group and Individual RName entries

Page 14: Implementing Remote Procedure Calls Authored by Andrew D. Birrell and Bruce Jay Nelson Xerox Palo Alto Research Center Presented by Lars Larsson

Exporting and Importing Interfaces

Page 15: Implementing Remote Procedure Calls Authored by Andrew D. Birrell and Bruce Jay Nelson Xerox Palo Alto Research Center Presented by Lars Larsson

Packet Level Transport Protocol Caller sends a CallPacket containing a call

identifier, data specifying the desired procedure and arguments

Result packet contains the same call identifier and the results

Retransmitted packets request explicit acknowledgement

While waiting for results caller sends periodic ‘probe’ packets

Large results sent in multiple packets which request explicit acknowledgement (except for last packet)

Page 16: Implementing Remote Procedure Calls Authored by Andrew D. Birrell and Bruce Jay Nelson Xerox Palo Alto Research Center Presented by Lars Larsson

Call Identifier Holds identifier of calling machine

and machine relative identifier of calling process and a sequence number (with conversation identifier)

(Machine, process identifier) pair is called an ‘activity’

Each activity has at most one outstanding remote call

Page 17: Implementing Remote Procedure Calls Authored by Andrew D. Birrell and Bruce Jay Nelson Xerox Palo Alto Research Center Presented by Lars Larsson

Simple Call Example

Page 18: Implementing Remote Procedure Calls Authored by Andrew D. Birrell and Bruce Jay Nelson Xerox Palo Alto Research Center Presented by Lars Larsson

Complicated Call Example

Page 19: Implementing Remote Procedure Calls Authored by Andrew D. Birrell and Bruce Jay Nelson Xerox Palo Alto Research Center Presented by Lars Larsson

Exception Handling

RPC returns an exception packet instead of a response packet

Raises an exception in the appropriate process If a catch phrase executes a return, the return

is passed to the callee and execution resumes otherwise the callee is notified of termination

Only exceptions defined in the exported interface may be sent

‘Call failed’ exception may be raised incase of communication difficulty

Page 20: Implementing Remote Procedure Calls Authored by Andrew D. Birrell and Bruce Jay Nelson Xerox Palo Alto Research Center Presented by Lars Larsson

Process Use Idle server processes wait for incoming

packets If a process is waiting for a packet the

Ethernet interrupt handler uses the ‘process identifier’ to pass the packet to waiting process

Otherwise an idle process is passed the packet to decide what to do

Initial destination process identifiers are ‘guessed’

Page 21: Implementing Remote Procedure Calls Authored by Andrew D. Birrell and Bruce Jay Nelson Xerox Palo Alto Research Center Presented by Lars Larsson

Performance Evaluation

Page 22: Implementing Remote Procedure Calls Authored by Andrew D. Birrell and Bruce Jay Nelson Xerox Palo Alto Research Center Presented by Lars Larsson

Conclusion

RPC is fully implemented in Cedar Being used by Alpine – file server

supporting multi-machine transactions

Implementations made for BCPL, InterLisp, SmallTalk and C

Still more work needs to be done