10
1 Conventional Procedure Call read(fd,buf,nbytes) a) Parameter passing in a local procedure call: the stack before the call to read b) The stack while the called procedure is active

1 Conventional Procedure Call read(fd,buf,nbytes) a)Parameter passing in a local procedure call: the stack before the call to read b)The stack while the

Embed Size (px)

Citation preview

Page 1: 1 Conventional Procedure Call read(fd,buf,nbytes) a)Parameter passing in a local procedure call: the stack before the call to read b)The stack while the

1

Conventional Procedure Callread(fd,buf,nbytes)

a) Parameter passing in a local procedure call: the stack before the call to readb) The stack while the called procedure is active

Page 2: 1 Conventional Procedure Call read(fd,buf,nbytes) a)Parameter passing in a local procedure call: the stack before the call to read b)The stack while the

2

Client and Server Stubs• Principle of RPC between a client and server program.

Page 3: 1 Conventional Procedure Call read(fd,buf,nbytes) a)Parameter passing in a local procedure call: the stack before the call to read b)The stack while the

Remote Procedure Call (1)

• Steps in making a remote procedure call– the stubs are shaded gray

Page 4: 1 Conventional Procedure Call read(fd,buf,nbytes) a)Parameter passing in a local procedure call: the stack before the call to read b)The stack while the

4

Steps of a Remote Procedure Call (RPC)

1. Client procedure calls client stub in normal way2. Client stub builds message, calls local OS3. Client's OS sends message to remote OS4. Remote OS gives message to server stub5. Server stub unpacks parameters, calls server6. Server does work, returns result to the stub7. Server stub packs it in message, calls local OS8. Server's OS sends message to client's OS9. Client's OS gives message to client stub10. Stub unpacks result, returns to client

Page 5: 1 Conventional Procedure Call read(fd,buf,nbytes) a)Parameter passing in a local procedure call: the stack before the call to read b)The stack while the

Remote Procedure Call (2)

Implementation Issues• Cannot pass pointers

– call by reference becomes copy-restore (but might fail)

• Weakly typed languages– client stub cannot determine size

• Not always possible to determine parameter types• Cannot use global variables

Page 6: 1 Conventional Procedure Call read(fd,buf,nbytes) a)Parameter passing in a local procedure call: the stack before the call to read b)The stack while the

6

Passing Value Parameters (2)

a) Original message on the Pentiumb) The message after receipt on the SPARCc) The message after being inverted. The little numbers in

boxes indicate the address of each byte

Page 7: 1 Conventional Procedure Call read(fd,buf,nbytes) a)Parameter passing in a local procedure call: the stack before the call to read b)The stack while the

7

RPC protocol definition

• Define message format

• Define data representation

• Define transport service type (i.e. TCP)

Page 8: 1 Conventional Procedure Call read(fd,buf,nbytes) a)Parameter passing in a local procedure call: the stack before the call to read b)The stack while the

8

Asynchronous RPC (1)useful when there is no result to return

a) The interconnection between client and server in a traditional RPCb) The interaction using asynchronous RPC

2-12

Page 9: 1 Conventional Procedure Call read(fd,buf,nbytes) a)Parameter passing in a local procedure call: the stack before the call to read b)The stack while the

9

Asynchronous RPC (2)

• A client and server interacting through two asynchronous RPCs2-13

Page 10: 1 Conventional Procedure Call read(fd,buf,nbytes) a)Parameter passing in a local procedure call: the stack before the call to read b)The stack while the

Distributed Systems (1)

Comparison of three kinds of multiple CPU systems