DISTRIBUTED SYSTEMSPrinciples and ParadigmsSecond EditionANDREW S. TANENBAUMMAARTEN VAN STEENChapter 4Communication
DISTRIBUTED SYSTEMSPrinciples and ParadigmsSecond EditionANDREW S. TANENBAUMMAARTEN VAN STEENChapter 4Communication
Layered Protocols (1)
Figure 4-1. Layers, interfaces, and protocols in the OSI model.
Layered Protocols (2)
Figure 4-2. A typical message as it appears on the network.
Middleware Protocols
Figure 4-3. An adapted reference model for networked communication.
Types of Communication
Persistent communications Figure 4-4. Viewing middleware as an intermediate (distributed) service in application-level communication.
Types of Communication
Persistent
Un messaggio inviato, è conservato nel middleware di comunicazione fino a che la spedizione ha successo
Transient
Un messaggio viene conservato solo per il tempo necessario alla spedizione o alla ricezione
Synchronous
Chi spedisce viene bloccato fino al termine dell’invio
Asynchronous
Chi spedisce continua immediatamente il proprio flusso di esecuzione
Discrete
Streaming
Conventional Procedure Call
Sometime used: call-by-copy/restore (dipende dal linguaggio usato) (a) Parameter passing in a local procedure call: the stack before the call to read.
(b) The stack while the called procedure is active.
Client and Server Stubs
Figure 4-6. Principle of RPC between a client and server program.
Remote Procedure Calls (1)
A remote procedure call occurs in the following
steps:
The client procedure calls the client stub in the normal way.
The client stub builds a message and calls the local operating system.
The client’s OS sends the message to the remote OS.
The remote OS gives the message to the server stub.
The server stub unpacks the parameters and calls the server. Continued …
Remote Procedure Calls (2)
A remote procedure call occurs in the following
steps (continued):
The server does the work and returns the result to the stub.
The server stub packs it in a message and calls its local OS.
The server’s OS sends the message to the client’s OS.
The client’s OS gives the message to the client stub.
The stub unpacks the result and returns to the client.
Passing Value Parameters (1)
Figure 4-7. The steps involved in a doing a remote computation through RPC.
Passing Value Parameters (2)
Figure 4-8. (a) The original message on the Pentium
(little endian).
Passing Value Parameters (3)
Figure 4-8. (b) The message after received on the SPARC
(big endian).
Passing Value Parameters (4)
Figure 4-8. (c) The message after being inverted. The little numbers in boxes indicate the address of each byte.
Passing reference parameters
Es. i puntatori?
Possono essere proibiti i passaggi per riferimento;
Si possono usare strategie di copia
Parameter Specification and Stub Generation
Figure 4-9. (a) A procedure. (b) The corresponding message.
Asynchronous RPC (1)
Figure 4-10. (a) The interaction between client and server in a traditional RPC.
Asynchronous RPC (2)
Figure 4-10. (b) The interaction using asynchronous RPC. Se non c’è l’accept request si ha una one-way RPC
Asynchronous RPC (3)
Figure 4-11. A client and server interacting through two asynchronous RPCs (deferred synchronous).
DCE
Distributed Computing Environment
Meno diffuso di Sun RPC
E’ un middleware che si basa sul modello client/server;
Mette a disposizione numerosi servizi:
file service distribuito;
directory;
security;
distributed time service;
…
Comments