Remote Procedure Calls (RPC) Technique allowing an application to - - PowerPoint PPT Presentation

remote procedure calls rpc
SMART_READER_LITE
LIVE PREVIEW

Remote Procedure Calls (RPC) Technique allowing an application to - - PowerPoint PPT Presentation

Remote Procedure Calls (RPC) Technique allowing an application to invoke a procedure whose code actually executes on another host Takes the form of a request / reply message exchange Client Server Request Blocked Computing Reply


slide-1
SLIDE 1
  • Dec. 2. 2005

CS 440 Lecture Notes 1

Remote Procedure Calls (RPC)

  • Technique allowing an application to

invoke a procedure whose code actually executes on another host

  • Takes the form of a request / reply

message exchange

Client Server

Request Reply Computing Blocked

slide-2
SLIDE 2
  • Dec. 2. 2005

CS 440 Lecture Notes 2

RPC (cont.)

  • Goal is to make process of calling a

remote procedure indistinguishable from calling a local procedure to the client app

  • Difficulties

– Network interaction introduces plenty of new complications that local call doesn’t have – Client and server hosts might have different architectures and different representations of data (i.e. big vs. little endian, 32-bit vs. 64-bit)

slide-3
SLIDE 3
  • Dec. 2. 2005

CS 440 Lecture Notes 3

RPC (cont.)

  • First problem solved by creating messaging

protocol to mask network issues

  • Second problem solved by creating support to

package arguments into requests and unpackage return values from responses

– Machine specific – Maybe language specific – Called marshalling / demarshalling – Done by stub compiler

slide-4
SLIDE 4
  • Dec. 2. 2005

CS 440 Lecture Notes 4

RPC Network Protocol

  • Could run on top of TCP or UDP

– TCP connection setup/teardown fairly wasteful to exchange a request and reply – UDP leaves several problems that protocol must address – mostly reliability

  • Might consider this as an alternative

transport protocol, since it is working at the app-to-app level

slide-5
SLIDE 5
  • Dec. 2. 2005

CS 440 Lecture Notes 5

RPC Network Protocol (cont.)

  • Book introduces three-level microprotocol

stack to accomplish different tasks

– BLAST – handle message fragmentation

  • More efficient that IP

– CHAN – synchronize messages – SELECT – dispatch requests to processes

  • Not standard protocols
slide-6
SLIDE 6
  • Dec. 2. 2005

CS 440 Lecture Notes 6

BLAST

  • Function similarly to IP fragmentation
  • Allows sender to acknowledge multiple

fragments

– Everything after a hole doesn’t need to be retransmitted

  • More aggressive in guaranteeing that all

fragments are delivered

  • Not completely reliable
slide-7
SLIDE 7
  • Dec. 2. 2005

CS 440 Lecture Notes 7

CHAN

  • Adds reliability

– Guarantees message delivery – Ensures only one copy of message delivered – Allows synchronization of client and server

  • Implements at-most-once semantics

– Message might not get through at all – If it does, it won’t be delivered more than once – Essential for many remote procedures

slide-8
SLIDE 8
  • Dec. 2. 2005

CS 440 Lecture Notes 8

CHAN (cont.)

  • Synchronous protocol – client blocks while

server is working, so only one call

  • utstanding
  • Provides multiple channels

– Possible to work around previous restriction by using parallel channels from one client to

  • ne server
slide-9
SLIDE 9
  • Dec. 2. 2005

CS 440 Lecture Notes 9

SELECT

  • Dispatcher that directs data from a

message to correct procedure

  • Provides mechanism to identify application

and procedure to call in that application

  • Manages multiple channels as necessary

for parallel calls to server

slide-10
SLIDE 10
  • Dec. 2. 2005

CS 440 Lecture Notes 10

Real Implementation - SunRPC

  • Now called Open Network Computing

RPC (ONC RPC)

  • Draft IETF standard
  • Standard on many Unix systems

– May be most widely used RPC mechanism – Used by NFS

slide-11
SLIDE 11
  • Dec. 2. 2005

CS 440 Lecture Notes 11

SunRPC (cont.)

  • Implemented on top of UDP

– Implements CHAN – IP used for BLAST (not as aggressive or efficient) – UDP provides dispatch to correct program, SunRPC selects correct procedure

slide-12
SLIDE 12
  • Dec. 2. 2005

CS 440 Lecture Notes 12

SunRPC (cont.)

  • Identifies program and procedure using

two 32-bit numbers (program & procedure)

  • Uses PortMapper to map 32-bit program

number to UDP port

– Runs on well known UDP port (111)

  • Client caches port number

– Avoids calling PortMapper for every procedure invocation

slide-13
SLIDE 13
  • Dec. 2. 2005

CS 440 Lecture Notes 13

SunRPC (cont.)

  • Does not guarantee at-most-once

semantics

– Possible for request to be delivered to server twice for some rare network conditions – Not addressed because protocol originally designed for use on a LAN, not an internet

slide-14
SLIDE 14
  • Dec. 2. 2005

CS 440 Lecture Notes 14

eXternal Data Representation (XDR)

  • Accompanying specification for mapping

host data to message

– Host architecture independent – Network independent

  • Described in RFC 1014
  • Presentation layer protocol

– Can be used independently of SunRPC

slide-15
SLIDE 15
  • Dec. 2. 2005

CS 440 Lecture Notes 15

OSF Distributed Computing Environment (DCE)

  • Can be used for stand-alone RPC

– Use NDR stub compiler to generate language interface

  • Also used as foundation for Common

Object Request Broker Architecture (CORBA)

slide-16
SLIDE 16
  • Dec. 2. 2005

CS 440 Lecture Notes 16

DCE (cont.)

  • Also implemented on UDP
  • Also uses “endpoint mapping service” to

select correct UDP port

  • Implements fragmentation (like BLAST)
  • Implements at-most-once semantics

– Can also support zero-or-more semantics