1 of 65

DISTRIBUTED COMPUTING

Sunita Mahajan, Principal, Institute of Computer Science, MET League of Colleges, Mumbai

Seema Shah, Principal, Vidyalankar Institute of Technology, Mumbai University

© Oxford University Press 2011

2 of 65

Chapter - 4�Remote Communication

© Oxford University Press 2011

3 of 65

Topics

  • Introduction to Remote Communication
  • Remote Procedural Call Basics
  • RPC Implementation
  • RPC Communication
  • Other RPC Issues
  • Case Study: Sun RPC
  • Remote invocation Basics
  • RMI Implementation

© Oxford University Press 2011

4 of 65

Introduction to Remote Communication

© Oxford University Press 2011

5 of 65

Introduction

  • Middleware

© Oxford University Press 2011

6 of 65

Remote Procedural Call Basics

© Oxford University Press 2011

7 of 65

Local Procedure Call

© Oxford University Press 2011

8 of 65

�Remote Procedure Call

  • Basic RPC operation

© Oxford University Press 2011

9 of 65

RPC operation

© Oxford University Press 2011

10 of 65

Elements of RPC mechanism implementation

  • Client
  • Client stub
  • RPC Runtime
  • Server stub
  • Server

© Oxford University Press 2011

11 of 65

RPC Execution

© Oxford University Press 2011

12 of 65

Stub generation

  • Manual generation
  • Auto generation using Interface Definition Language (IDL)

© Oxford University Press 2011

13 of 65

RPC Compilation

© Oxford University Press 2011

14 of 65

RPC Implementation

© Oxford University Press 2011

15 of 65

RPC implementation

  • RPC messages:
    • Call / Request
    • Reply

© Oxford University Press 2011

16 of 65

RPC Call/ Request message

© Oxford University Press 2011

17 of 65

RPC reply conditions

© Oxford University Press 2011

18 of 65

RPC reply message

© Oxford University Press 2011

19 of 65

Parameter Passing Semantics

  • Call-by-value semantic
    • Marshalling
  • Call-by –reference semantic
  • Call-by-copy/restore semantic

Call-by-value copies all parameters into a message before transmission . Call-by-reference passes pointers to the parameters that are passed from the client to the server. Call-by-copy/restore uses temporary storage accessible to both programs

© Oxford University Press 2011

20 of 65

Call-by-value semantic

© Oxford University Press 2011

21 of 65

Byte ordering

© Oxford University Press 2011

22 of 65

Other semantics

  • Call-by –reference semantic
  • Call-by-copy/restore semantic

© Oxford University Press 2011

23 of 65

Server management

  • Server implementation
    • Stateless server
    • Stateful server
  • Server management
    • Instance per call
    • Instance per session
    • Persistent servers

© Oxford University Press 2011

24 of 65

RPC communication

  • RPC call semantics

© Oxford University Press 2011

25 of 65

Orphan calls

  • Calls whose caller has expired due to a node crash
  • Handle orphan calls by using:
    • Extermination
    • Reincarnation
    • Gentle reincarnation
    • Expiration

© Oxford University Press 2011

26 of 65

RPC communication protocols

  • Request protocol
  • Request/Reply protocol
  • Request/Reply/ Acknowledge- Reply protocol

© Oxford University Press 2011

27 of 65

Request protocol

© Oxford University Press 2011

28 of 65

Asynchronous RPC

© Oxford University Press 2011

29 of 65

Request/Reply protocol

© Oxford University Press 2011

30 of 65

Request/Reply/ Acknowledge- Reply protocol

© Oxford University Press 2011

31 of 65

Client server binding process

© Oxford University Press 2011

32 of 65

Client Server binding

  • Issues
    • Server naming
    • Server locating
  • Binding agent primitives
    • Register
    • Deregister
    • Lookup

  • Types of binding
    • Static binding
    • Dynamic binding
      • At compile time
      • At link time
      • At run time

© Oxford University Press 2011

33 of 65

Other RPC Issues

© Oxford University Press 2011

34 of 65

Other issues in RPC implementation

  • Exception handing and security
  • Failure handling
  • Optimizing RPC execution
  • Various types of complicated RPCs

© Oxford University Press 2011

35 of 65

RPC in heterogeneous environment

  • Data presentation
  • Transport protocol
  • Control protocol

© Oxford University Press 2011

36 of 65

Failure handling mechanism in RPC

  • Client cannot find the server
  • Request from client to the server is lost
  • Reply from server to the client is lost
  • Server crashes after getting the request
  • Client crashes after sending the request

© Oxford University Press 2011

37 of 65

RPC Optimization

© Oxford University Press 2011

38 of 65

Concurrent access to multiple servers

  • Use of threads
  • Early reply technique
  • Call buffering approach

© Oxford University Press 2011

39 of 65

Early Reply technique

© Oxford University Press 2011

40 of 65

Call buffer approach

© Oxford University Press 2011

41 of 65

RPC Optimization

  • Serving multiple requests simultaneously
  • Reducing call workload of server
  • Using reply cache for idempotent RPC
  • Selection of the Timeout value

© Oxford University Press 2011

42 of 65

Complicated and special RPCs

  • Complicated RPCs
    • RPCs with long duration calls or with gaps between calls
    • RPCs with long messages
  • Special RPCs:
    • Call back RPC
    • Broadcast RPC
    • Batch mode RPC

© Oxford University Press 2011

43 of 65

Call back RPC

  • Client handle is provided to the server
  • Client process should wait for callback RPC
  • Handle callback deadlocks

© Oxford University Press 2011

44 of 65

Special RPCs

    • Broadcast RPC
    • Batch mode RPC

© Oxford University Press 2011

45 of 65

Case Study: Sun RPC

© Oxford University Press 2011

46 of 65

Case Study- Sun RPC

  • Uses rpcgen compiler which generates
    • Header file
    • XDR filter file
    • Client stub file
    • Server stub file

© Oxford University Press 2011

47 of 65

Remote Method Invocation Basics

© Oxford University Press 2011

48 of 65

Remote Object Invocation

  • Distributed object concept
    • Remote objects reference
    • Remote interface

© Oxford University Press 2011

49 of 65

RMI

© Oxford University Press 2011

50 of 65

RMI vs LMI

© Oxford University Press 2011

51 of 65

RMI Implementation

© Oxford University Press 2011

52 of 65

RMI implementation Design issues in RMI�

      • RMI invocation semantics
      • Level of transparency
    • Marshalling
    • Message passing
    • Task of locating and contacting the remote object for the client

        • RMI invocation semantics
    • Maybe semantics
    • At-least-once semantics
    • At-most-once semantics

© Oxford University Press 2011

53 of 65

Invocation semantics

© Oxford University Press 2011

54 of 65

Level of Transparency

© Oxford University Press 2011

55 of 65

Components of RMI

© Oxford University Press 2011

56 of 65

RMI execution components

  • Communication module
  • Remote reference module
  • RMI software
  • Server program
  • Client program
  • Binder

© Oxford University Press 2011

57 of 65

RMI execution

© Oxford University Press 2011

58 of 65

RMI software

  • Proxy
  • Dispatcher
  • Skeleton

© Oxford University Press 2011

59 of 65

Types of objects

© Oxford University Press 2011

60 of 65

Remote invocation readiness

© Oxford University Press 2011

61 of 65

RMI binding

  • Implicit binding
  • Explicit binding

© Oxford University Press 2011

62 of 65

Parameter passing in RMI

  • Pass by value
  • Pass by reference

© Oxford University Press 2011

63 of 65

Case study: Java RMI

© Oxford University Press 2011

64 of 65

Java RMI layer

© Oxford University Press 2011

65 of 65

Summary

  • Introduction to Remote Communication
  • Remote Procedural Call Basics
  • RPC Implementation
  • RPC Communication
  • Other RPC Issues
  • Case Study: Sun RPC
  • Remote invocation Basics
  • RMI Implementation

© Oxford University Press 2011