Professional Documents
Culture Documents
DS Unit 04
DS Unit 04
11/27/2022 Distributed_System_01 1
Communication in a Distributed System
In a distributed system, processes run on different machines.
Processes can only exchange information through message passing.
Harder to program than shared memory communication
Successful distributed systems depend on communication models that hide or simplify
message passing
Communication in distributed systems is always based on low-level message passing as
offered by the underlying network.
Network
Asynchronous Communication
Sender continues execution immediately after sending a message
Message stored by middleware upon submission
Message may be processed later at receiver’s convenience
A A
Message is stored at B’s Accepted
Time location for later delivery. Time
B B
B is not B starts and
running receives B is not
B starts and
message. running
receives message.
A A
Message can be sent
only if B is running. Request is ACK
Time received.
Time
B B
B
receives B is running but doing B processes
message. something else. request.
Socket
Transport Transport
Strategy used for communication in Client – server
systems. Network Network
The process acting as server opens a socket using a
well-known port and waits until some client request Data link Data link
comes.
Physical Physical
The second process acting as a client also opens a
socket but instead of waiting for an incoming request,
the client processes ‘requests first’.
Server
call local procedure and return results time
Call Execute
Return Call Return
RPCRuntime RPCRuntime
Call Packet
Request Packet
Call Packet
Request Packet
Client OS Server OS
proc: add | int: 3 | int: 5 proc: add | int: 3 | int: 5
Client OS Server OS
Result | int: 8 Result | int: 8
After opening a file, if a client makes two subsequent Read (fid, 100, buf) requests, for the
first request the first 100 bytes (bytes 0 to 99) will be read and for the second request the
next 100 bytes (bytes 100 to 199) will be read.
This file server does not keep track of any file state information resulting from a previous
operation.
Therefore, if a client wishes to have similar effect as previous figure, the following two read
operations must be carried out:
Read(filename, 0, 100, buffer)
Read(filename, 100, 100, buffer)
#3170719 (DS) Unit 2 – Basics of Architectures, Processes, and
Prof. Umesh H. Thoriya 36
Difference between Stateful & Stateless
Parameters Stateful Stateless
State A Stateful server remember client data (state) A Stateless server does not remember state
from one request to the next. information.
Programming Stateful server is harder to code. Stateless server is straightforward to code.
Efficiency More because clients do not have to provide Less because information needs to be
full file information every time they perform provided.
an operation.
Crash Difficult due to loss of information. Can easily recover from failure because there
recovery is no state that must be restored.
Information The client can send less data with each The client must specify complete file names
transfer request. in each request.
Server
socket bind listen accept read write close
Synchronization Communicatio
point n
Socket connect write read close
Client
#3170719 (DS) Unit 2 – Basics of Architectures, Processes, and
Prof. Umesh H. Thoriya 44
The Message-Passing Interface (MPI)
The Message Passing Interface (MPI) is a library specification for message passing.
It is a standard API that can be used to create applications for high-performance
multicomputers.
Specific network protocols (not TCP/IP)
Message-based communication
Primitives for all 4 forms of transient communication (+ variations)
Vendors + Open Source
IBM, Intel, TMC, Meiko, Cray, Convex, Ncube, OpenMPI
Sender Receiver
Poll Check a specified queue for messages, and remove the first. Never block.
Notify Install a handler to be called when a message is put into the specified
queue.
Stream synchronization
Multimedia server Client
Compressed
multimedia data
Network
A general architecture for streaming stored multimedia data over a
network #3170719 (DS) Unit 2 – Basics of Architectures, Processes, and
Prof. Umesh H. Thoriya 55
Quality of Service
Ensuring that the temporal relationships in the stream can be preserved
Streams are all about timely delivery of data.
How do you specify this Quality of Service (QoS)?
Basics:
The required bit rate at which data should be transported
The maximum delay until a session has been set up (i.e., when an application can start
sending data)
The maximum end-to-end delay (i.e., how long it will take until a data unit makes it to a
recipient)
The maximum delay variance, or jitter
The maximum round-trip delay