19
Procedure Made By: Abhishek Pachisia B.Tech-IT 090102801 Call Remote

Rpc

Embed Size (px)

DESCRIPTION

Remote Procedure Call

Citation preview

Page 1: Rpc

Procedure

Made By:Abhishek Pachisia

B.Tech-IT090102801

Call

Remote

Page 2: Rpc

Abhishek Pachisia 2

ForewordFlaw in Client Server Model.

Input/ OutputBirrell & Nelson – Simple Idea with subtle

implications.Call procedures located on other machines

ProblemsDifferent address – ComplicationsNon- identical MachinesCrashing of machines

Widely Used.

Page 3: Rpc

Abhishek Pachisia 3

IndexBasic RPC Operation

Parameter Passing

Dynamic Binding

Page 4: Rpc

Abhishek Pachisia 4

Basic RPC OperationSingle Machine Procedure Call

Count = read(fd, buf, nbytes);

cc

Page 5: Rpc

Abhishek Pachisia 5

StubsClient stub

Packs parameter into message.Calls : Send & Receive.

Server StubCalls : Receive & Send.Unpacks parameter from the message.

Details of message passing are hidden – two libraries.

Page 6: Rpc

Abhishek Pachisia 6

Page 7: Rpc

Abhishek Pachisia 7

Steps1. The client procedure calls the client stub in the normal way. 2. The client stub builds a message and traps to the kernel.3. The kernel sends the message to the remote kernel.4. The remote kernel gives the message to the server stub.5. The server stub unpacks the parameters and calls the server.6. The server does the work and returns the result to the stub.7. The server stub packs it in a message and traps to the kernel.8. The remote kernel sends the message to the clients kernel.9. The client’s kernel gives the message to the client stub.10. The stub unpacks the result and returns to the client.

Page 8: Rpc

Abhishek Pachisia 8

Client-side stubLooks like local server

functionSame interface as local

functionBundles arguments into

message, sends to server-side stub

Waits for reply, un-bundles results

Returns to kernel

Server-side stubLooks like local client

function to serverListens on a socket for

message from client stubUn-bundles arguments to

local variablesMakes a local function

call to serverBundles result into reply

message to client stub

Page 9: Rpc

Abhishek Pachisia 9

Parameter PassingParameter Marshaling.Ex: Remote procedure “sum( i, j)”.

Identical machines.0

Page 10: Rpc

Abhishek Pachisia 10

Different Machine TypesEx: IBM mainframes (EBCDIC) & IBM PCs(ASCII).

Different representation of Integers (1s compliment & 2s Compliment), Floating point numbers.

Numbering of bytesRight to Left (Ex: Intel 486) – Little Endian.Left to Right (Ex: Sun SPARC) – Big Endian.

Problems - Parameter Passing

Page 11: Rpc

Abhishek Pachisia 11

Example - 1

Page 12: Rpc

Abhishek Pachisia 12

Example - 2

Page 13: Rpc

Abhishek Pachisia 13

Representation of InformationCanonical Form

Convert internal representation while marshaling.Ex:

2’s compliment for integers.0 for ASCII.1 for Boolean.IEEE format for floating point no.

Page 14: Rpc

Abhishek Pachisia 14

Pointer PassingOne way is to forbid the pointers & reference parameters

in general. – Highly undesirableOne strategy is copying the whole array/structure

(simple) into message.Call by reference is replaced by copy/restore.Optimization – Buffer knows if stub is an input / output

parameter. (Twice as efficient).Pointer is followed (dereferenced) by putting it in the

register. – Highly Inefficient.

Page 15: Rpc

Abhishek Pachisia 15

Dynamic Binding

Hardwiring network add. of server into client – Extremely Inflexible

To avoid problems likeReplication of serverRelocationMigrationInterface Change

Page 16: Rpc

Abhishek Pachisia 16

Server’s Specification :For Stateless Server

Server Version number List of procedures provided by

server in: file sent from client to

server. out: sent from server to client in out: in + out (Copy/Restore) bytes: no. of bytes to be

transferred. position: where in file to begin buf: data requested by

client is placed here by file server.

Page 17: Rpc

Abhishek Pachisia 17

TermsExports InterfaceImports InterfaceBinderRegistering

Unique Id – Typically 32 bit longHandle

System DependentIP Add. , Ethernet Add. , etc.

Page 18: Rpc

Abhishek Pachisia 18

Disadvantages

Overhead Exporting & ImportingCosts TimeMany short lived client process may have to start over again.Binder may act as bottleneck in distributed system.Registering / Deregistering of interfaces creates more

overhead.

Page 19: Rpc

ThankYou