0% found this document useful (0 votes)
13 views57 pages

Communication Models in Distributed Systems

The document discusses communication in distributed systems, detailing various communication models such as message passing, remote procedure calls (RPC), publish-subscribe, socket programming, and shared memory. It also covers communication protocols like TCP, UDP, HTTP, SMTP, and FTP, emphasizing their roles in ensuring reliable data exchange. Additionally, it explores concepts like middleware, message-queuing systems, and synchronization mechanisms essential for effective communication in distributed environments.

Uploaded by

xiao10152022
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views57 pages

Communication Models in Distributed Systems

The document discusses communication in distributed systems, detailing various communication models such as message passing, remote procedure calls (RPC), publish-subscribe, socket programming, and shared memory. It also covers communication protocols like TCP, UDP, HTTP, SMTP, and FTP, emphasizing their roles in ensuring reliable data exchange. Additionally, it explores concepts like middleware, message-queuing systems, and synchronization mechanisms essential for effective communication in distributed environments.

Uploaded by

xiao10152022
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Communication

Communication in Distributed Systems


• Nodes communicate by sending messages, invoking remote
procedures, sharing memory, or using sockets
• Communication methods allow nodes to exchange data and
coordinate actions, enabling effective collaboration towards
common goals
Communication Models
• Communication models are patterns or paradigms used for
enabling communication between different components or
nodes within a distributed computing environment.
• Communication models dictate how data is exchanged, coordinated,
and synchronized among the various entities in the system.
• Several communication models are commonly employed in distributed
systems, each with its characteristics and suitability for different
scenarios.
Communication Models
• Message Passing Model: communication between nodes is
achieved through message passing.
• One node sends a message to another node over a communication
channel.
• Messages can be synchronous or asynchronous, and communication
can be either direct (point-to-point) or indirect (via message brokers or
middleware).
• This model is often used in distributed systems where nodes are
loosely coupled and communicate over networks.
Communication Models
• Remote Procedure Call (RPC) Model: RPC enables one
program to execute code on another remote machine as if it
were a local procedure call.
• RPC abstracts the communication details and provides a familiar
programming interface, making it easier to develop distributed
applications.
• RPC typically assumes a client-server architecture and can suffer from
network latency and reliability issues.
Communication Models
• Publish-Subscribe Model: known as the pub-sub model, this
approach decouples publishers of messages from subscribers,
allowing multiple subscribers to receive messages published by
one or more publishers.
• It facilitates asynchronous and event-driven communication, making it
suitable for dynamic and scalable distributed systems such as
messaging systems, IoT platforms, and event-driven architectures.
Communication Models
• Socket Programming Model: Sockets provide a low-level
communication interface between processes running on
different hosts over a network.
• This model allows bidirectional communication between processes
through sockets, supporting various protocols such as TCP/IP and
UDP.
• Socket programming is commonly used for building networked
applications and distributed systems, offering flexibility and control over
communication.
Communication Models
• Shared Memory Model: multiple processes or threads share a
common address space (memory), allowing them to communicate
by reading from and writing to shared memory locations.
• Shared memory communication can be efficient and high-performance,
• This requires careful synchronization to avoid data races and ensure
consistency, making it suitable for tightly coupled distributed systems
running on multicore processors or shared-memory architectures.
Communication Protocols
• Communication protocols define the rules and conventions for
exchanging data and coordinating actions between nodes or
components within a networked environment.
• These protocols ensure reliable, efficient, and interoperable
communication among distributed entities, enabling them to
collaborate and achieve common goals.
• Various communication protocols are used in distributed systems,
each serving specific purposes and addressing different
requirements
Communication Protocols
• Transmission Control Protocol (TCP):
• TCP is a reliable, connection-oriented protocol used for transmitting data
between nodes over a network.
• It ensures data integrity, sequencing, and flow control by establishing a
virtual circuit between the sender and receiver before transferring data.
• TCP is commonly used for applications requiring guaranteed delivery of
data, such as web browsing, email, and file transfer.
Communication Protocols
• Transmission Control Protocol (TCP):
• TCP is a reliable, connection-oriented protocol used for transmitting data
between nodes over a network.
• It ensures data integrity, sequencing, and flow control by establishing a
virtual circuit between the sender and receiver before transferring data.
• TCP is commonly used for applications requiring guaranteed delivery of
data, such as web browsing, email, and file transfer.
Communication Protocols
• User Datagram Protocol (UDP):
• UDP is a lightweight, connectionless protocol that provides best-effort
delivery of data packets without guaranteeing reliability or ordering.
• It is used for applications where low latency and minimal overhead are
more important than reliability, such as real-time streaming, online
gaming, and Voice over IP (VoIP).
Communication Protocols
• Hypertext Transfer Protocol (HTTP):
• HTTP is an application-layer protocol used for transferring hypertext
documents on the World Wide Web.
• It defines how clients (web browsers) request resources (web pages,
images, etc.) from servers and how servers respond to those requests.
• HTTP operates over TCP and supports various methods (GET, POST,
PUT, DELETE) for interacting with web resources.
Communication Protocols
• Simple Mail Transfer Protocol (SMTP):
• SMTP is a protocol used for sending and receiving email messages
between mail servers.
• It defines the format and rules for message transfer, including
addressing, routing, and delivery.
• SMTP typically operates over TCP and supports authentication and
encryption mechanisms for secure email communication.
Communication Protocols
• File Transfer Protocol (FTP):
• FTP is a protocol used for transferring files between a client and a server
over a network.
• It allows users to upload, download, and manage files on remote servers
using commands such as PUT, GET, LIST, and DELETE.
• FTP operates over TCP and supports both authenticated and anonymous
access.
Communication Protocols
• Remote Procedure Call (RPC):
• RPC is a communication protocol that allows a program to execute
procedures or functions on a remote server as if they were local function
calls.
• It abstracts the details of network communication and provides a
transparent mechanism for invoking remote procedures across
distributed systems.
• RPC frameworks such as gRPC, Apache Thrift, and CORBA (Common
Object Request Broker Architecture) implement RPC communication
protocols.
Layered Protocols

Layers, interfaces, and protocols in the OSI model.


Layered Protocols
• A typical message as it appears on the network.
Middleware Protocols
• An adapted reference model for networked communication.
Types of Communication
• Viewing middleware as an intermediate (distributed) service in
application-level communication.
Conventional Procedure Call

• (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
• Principle of RPC between a client and server program.
Remote Procedure Calls
• A remote procedure call occurs in the following steps:
1. The client procedure calls the client stub in the normal way.
2. The client stub builds a message and calls the local operating
system.
3. The client’s OS sends the message to the remote OS.
4. The remote OS gives the message to the server stub.
5. The server stub unpacks the parameters and calls the server.
Passing Value Parameters
• The steps involved in a doing a remote computation through RPC.
Remote Procedure Calls
• A remote procedure call occurs in the following steps (continued):
6. The server does the work and returns the result to the stub.
7. The server stub packs it in a message and calls its local OS.
8. The server’s OS sends the message to the client’s OS.
9. The client’s OS gives the message to the client stub.
10. The stub unpacks the result and returns to the client.
Passing Value Parameters
• The original message on the Pentium.
Passing Value Parameters
• The original message on the Pentium.
Passing Value Parameters
• The message after being inverted. The little numbers in boxes
indicate the address of each byte.
Parameter Specification and Stub Generation

• (a) A procedure.
• (b) The corresponding message.
Synchronous RPC
• The interaction between client and server in a traditional RPC.
Asynchronous RPC
• The interaction using asynchronous RPC.
Asynchronous RPC
• A client and server interacting through two asynchronous RPCs.
Writing a Client and a Server

• The steps in writing a client and


a server in DCE RPC.
Writing a Client and a Server
Three files output by the IDL compiler:
• A header file (e.g., interface.h, in C terms).
• The client stub.
• The server stub.
Binding a Client to a Server
• 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:


[Link] the server’s machine.
[Link] the server on that machine.
Binding a Client to a Server
• Client-to-server binding in DCE.
Berkeley Sockets
• The socket primitives for TCP/IP.
The Message-Passing Interface

• Connection-oriented communication pattern using sockets.


The Message-Passing Interface
• Some of the most intuitive message-passing primitives of MPI.
Message-Queuing Model
• Four combinations for
loosely-coupled
communications using
queues.
Message-Queuing Model
• Basic interface to a queue in a message-queuing system.
General Architecture of a Message-Queuing System

• The relationship between queue-level addressing and network-


level addressing.
General Architecture of a Message-Queuing System

• The general organization


of a message-queuing
system with routers.
Message Brokers
• The general organization of a message broker in a message-queuing
system.
IBM’s WebSphere Message-Queuing System

• General organization of IBM’s message-queuing system.


Channels
• Some attributes associated with message channel agents.
Message Transfer
• The general organization of an MQ queuing network using routing
tables and aliases.
Message Transfer
• Primitives available in the message-queuing interface.
Data Stream
• A general architecture for streaming stored multimedia data over a
network.
Streams and Quality of Service
Properties for Quality of Service:
• The required bit rate at which data should be transported.
• The maximum delay until a session has been set up
• The maximum end-to-end delay .
• The maximum delay variance, or jitter.
• The maximum round-trip delay.
Enforcing QoS
• Using a buffer to reduce jitter.
Enforcing QoS
• The effect of packet loss in
• (a) non interleaved
transmission and
• (b) interleaved transmission.
Synchronization Mechanisms
• The principle of explicit synchronization on the level data units.
Synchronization Mechanisms
• The principle of synchronization as supported by high-level interfaces.
Overlay Construction
• The relation between links in an overlay and actual network-level
routes.
Information Dissemination Models

• Anti-entropy propagation model


• Node P picks another node Q at random
• Subsequently exchanges updates with Q
• Approaches to exchanging updates
• P only pushes its own updates to Q
• P only pulls in new updates from Q
• P and Q send updates to each other
Information Dissemination Models
• The relation between the fraction s of update-ignorant nodes and
the parameter k in pure gossiping. The graph displays ln(s) as a
function of k.

You might also like