PARALLEL AND DISTRIBUTED
COMPUTING
TOPIC:
MESSAGE PASSING TECHNIQUES IN
DISTRIBUTED SYSTEM.
WE WILL DISCUSS:
1-Message Passing in Distributed
sytem.
2-Importance of Message Passing.
3-Message Passing Techniques.
4-Synchronous Message Passing.
5-Asynchronous Message Passing
6-Unicast Messaging.
7-Broadcast Messaging.
8-Multicast Messaging.
3 Message Passing in Distributed
system:
Message Passing in distributed systems refers to the
communication medium used by nodes to communicate
information and coordinate their actions. It involves
transferring and entering messages between nodes to achieve
various goals such as coordination, synchronization, and data
sharing.
This approach is crucial for systems with distributed memory or
when coordinating multiple nodes in a parallel environment.
Importance of Message Passing:
• In distributed systems, where multiple independent components
work together to perform tasks
• Message passing is crucial for inter-process communication (IPC).
• It enables applications to distribute workloads, share resources,
synchronize actions.
• It handle concurrent activities across different nodes efficiently.
• Message passing allows you to break down a large computational
task into smaller, independent parts that can be executed
concurrently on different processors or machines.
Message Passing Techniques:
“Message passing describes the method by which nodes or processes interact
and share information in distributed systems. Message passing can be divided
into two main categories according to the sender and receiver's timing and
synchronization.”
There are five types of message passing techniques:
1-Synchronous Message Passing.
2-Asynchronous Message Passing.
3-Unicast Messaging.
4-Broadcast Messaging.
5- Multicast Messaging.
Synchronous Message Passing.
“Synchronous message passing involves a tightly coordinated interaction between
the sender and receiver.”
The key characteristics include:
Timing Coordination:
Before proceeding with execution, the sender waits for the recipient to
confirm receipt of the message or finish processing it.
Request-Response Pattern:
Often use a request-response paradigm in which the sender sends a message
requesting something and then waits for the recipient to react.
ADVANTAGES AND DISADVANTAGES OF
SYNCHRONOUS MESSAGE PASSING.
ADVANTAGES DISADVANTAGES
Ensures precise synchronization May introduce latency if the
between communicating receiver is busy or unavailable.
entities. Synchronous blocking can
Simplifies error handling as the reduce overall system
sender knows when the throughput if many processes
message has been successfully are waiting for responses.
received or processed. The blocking nature of
The predictable flow of synchronous calls can limit the
synchronous communication can scalability of the system as it
simplify debugging and cannot handle a large number of
troubleshooting concurrent requests efficiently
Asynchronous Message Passing.
“Asynchronous message passing allows processes to operate independently of each
other in terms of timing”
The Key features include:
Decoupled Timing:
The sender does not wait for an immediate response from the
receiver after sending a message. It continues its execution without
blocking.
Event-Driven Model:
Communication is often event-driven, where processes respond to
messages or events as they occur asynchronously.
Advantages and Disadvantages of
Asynchronous Message Passing
Advantages Disadvantages
Enhances system responsiveness Requires additional mechanisms (like
and throughput by allowing callbacks or event handlers) to
processes to execute concurrently. manage responses or coordinate
actions.
Allows for interactions that are Handling out-of-order messages or
loosely connected, allowing
ensuring message delivery reliability
processes to process messages at can be more complex compared to
their own speed. synchronous communication.
Systems can handle multiple There is no immediate confirmation
requests concurrently, leading to that a message has been received
a more responsive user and processed, which can make it
experience. harder to track progress or identify
errors
UNICAST Messaging
“Unicast messaging is a one-to-one communication where a message is sent
from a single sender to a specific receiver”
The key characteristics include:
• Direct Communication:
The message is targeted at a single, specific node or
endpoint.
• Efficiency for Point-to-Point:
Since only one recipient receives the message, resources
are efficiently used for direct, point-to-point communication.
Advantages & Disadvantages of
Unicast Messaging.
Advantages Disadvantages
Optimized for targeted Not scalable for group
communication, as the message is communications; sending multiple
only sent to the intended unicast messages can strain the
recipient. system in larger networks.
Minimizes network load compared Can increase the complexity of
to group messaging, as it doesn’t managing multiple unicast
broadcast to unnecessary nodes. connections in large-scale
applications.
Unicast is easy to implement and
Unicast becomes less efficient as
ensures that the message is
the number of recipients increases,
delivered to the intended recipient
especially when the same data
without interference.
needs to be sent to multiple nodes.
BROADCAST Messaging:
“Broadcast messaging involves sending a message from one sender to all
nodes within the network”
The key characteristics include:
• Wide Coverage:
The message is sent to every node, ensuring that all nodes in
the network receive it.
• Network-Wide Reach:
Suitable for announcements, alerts, or updates intended for all
nodes without targeting specific ones.
Advantages & Disadvantages of
BROADCAST Messaging.
Advantages Disadvantages
Guarantees that every node in the network Consumes significant network
receives the message, which is useful for resources since every node, regardless
critical notifications or status updates. of relevance, receives the message.
Simplifies dissemination of information Can lead to unnecessary processing at
when all nodes need to be aware of an
nodes that don’t need the message,
event or data change.
potentially causing inefficiency.
Broadcasting is well-suited for applications
like streaming services, real-time data Unnecessary processing at nodes that
feeds, and firmware updates where all don't need the broadcasted message
nodes need the same information can reduce overall system performance
MULTICAST Messaging:
“Multicast messaging enables one-to-many communication, where a
message is sent from one sender to a specific group of receivers”
The key characteristics include:
Group-Based Communication:
Messages are delivered to a subset of nodes that have joined
the multicast group.
Efficient for Groups:
Saves bandwidth by sending the message once to all nodes in
the group instead of individually.
Advantages & Disadvantages of
MULTICAST Messaging.
Advantages Disadvantages
Reduces network traffic by sending a single Complex to implement as nodes need
message to multiple recipients, making it mechanisms to manage group
ideal for content distribution or group
memberships and handle node
updates.
join/leave requests.
Scales efficiently for applications where
data needs to reach specific groups, like Not all network infrastructures
video conferencing or online gaming. support multicast natively, which can
Multicast is well-suited for large-scale limit its applicability.
applications where data needs to be Possibility of out-of-sequence delivery
distributed to a specific group of recipients.
is more in multicast.