Distributed Systems Distributed Systems- COMMUNICATION.pptx
ssuser376193
12 views
23 slides
May 30, 2024
Slide 1 of 23
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
About This Presentation
Distributed Systems
Size: 1.36 MB
Language: en
Added: May 30, 2024
Slides: 23 pages
Slide Content
D i stribute d S y stems Asst.Prof.Dr.Satea Hikmat Alnajjar Ch a p t e r F o ur : COMMUN I C A TION By: Mustafa Saad
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 Figu r e 4 - 3 . A n a dap t e d r e f e r e n ce mo d e l f or networked communication.
Types of Communication Figure 4-4. Viewing middleware as an intermediate (distributed) service in application-level communication.
Types of Communication 1) Client/Server computing is generally based on a model of transient synchronous communication: Client and server have to be active at time of communication. Client issues request and blocks until it receives reply. Server essentially waits only for incoming requests, and subsequently processes them Drawbacks of synchronous communication: Client cannot do any other work while waiting for reply. Failures have to be handled immediately: the client is waiting. T h e mode l m a y sim p l y no t be ap p r op r i a te (mai l , n e ws) 2) Message-oriented middleware: asynchronous communication: Processes send each other messages, which are queued Sender need not wait for immediate reply, but can do other things Middleware often ensures fault tolerance
Conventional Procedure Call Figure 4-5. (a) Parameter passing in a local procedure call: the stack before the call to read. (b) The stack while the called procedure is active tead ( fd,buf,nbytes )
Basic RPC Operation Figure 4-6. Principle of RPC between a client and server program. RPC = Remote Procedure Calls
RPC Operation Figure 4-7. The steps involved in a doing a remote computation through RPC.
Remote Procedure Calls (1) A remote procedure call occurs in the following steps: The client procedure calls the client stub. 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) T h e se r v e r does the w o r k and r etu r n s the r es u lt 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. Client - client stub - client OS – remote OS - server stub – server
P assin g V a l ue P ar a meter s ( 2 ) Figure 4-8. (a) The original message on the Pentium.
Passing by Reference Like passing a pointer or an array or by reference. The pointer or address has meaning within the same address space. Call by reference is replaced by a copy/restore. Difference between input and output parameters. A r em o te r e f e r e n ce mech a nis m e n ha n ces ac c ess transparency Remote reference offers unified access to remote data ( URI in restful API ) Remote references can be passed as parameter in RPCs ( passed in same URL ) Note: stubs can sometimes be used as such references
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.
Asynchronous RPC (3) Figure 4-11. A client and server interacting through two asynchronous RPCs.
Writing a Client and a Server (2) Three files output by the IDL compiler: A hea d e r f ile ( e . g ., in t er f ac e . h , in C ter m s ). The client stub. The server stub.
Binding a Client to a Server (1) Registration of a server makes it possible for a client to locate the server and bind to it. Server location is done in two steps: Locate the server ’ s machine. 2. Locate the server on that machine . The server also registers with the directory service by providing it the network address of the server's machine and a name under which the server can be looked up . How does the client stub find the server stub? Needs to know remote IP address/port no.
Binding a Client to a Server (2) Figure 4-13. Client-to-server binding in DCE. DCE = Distributed Computing Environment RPC = Remote Procedure Calls • Port mapper Daemon on server machine maintaining server bindings Listens on a well-known port • Server stub registers its port no. and service name with port mapper Client gets this binding by querying port mapper
Berkeley Sockets Figu r e 4 - 14 . T h e soc k e t p r imit i v e s f o r TCP/I P .
Berkeley Sockets Figu r e 4 - 14 . T h e soc k e t p r imit i v e s f o r TCP/I P .