DC Module 2a
DC Module 2a
● Rules that both the sender and receiver and all intermediate
devices need to follow to be able to communicate effectively
● Protocol Layering
Simple Communication: only one simple protocol
Complex Communication: we need a protocol at each
layer, or Protocol Layering
Protocol Layering
● Advantages
1. Modularity
2. Separation of Service & Implementation
3. Reduced Complexity &
4. Cost
● Disadvantages
None Really!
IPC Interprocess Communication
● Interprocess Communication is a process of exchanging
the data between two or more independent process in a
distributed environment.
● Interprocess communication on the internet provides both
Datagram and stream communication.
● Examples Of Interprocess Communication:
● N number of applications can communicate with the X
server through network protocols.
● Servers like Apache spawn child processes to handle
requests.
IPC functions:
1) Synchronization:
Exchange of data is done synchronously which means it has a single
clock pulse.
1) Message Passing:
When processes wish to exchange information. Message passing
takes several forms such as: pipes, FIFO, Shared Memory, and
Message Queues.
Characteristics Of IPC
1. Synchronous System Calls:
In the synchronous system calls both sender and receiver use blocking system calls to
transmit the data which means the sender will wait until the acknowledgment is
received from the receiver and receiver waits until the message arrives.
In the asynchronous system calls, both sender and receiver use non-blocking system
calls to transmit the data which means the sender doesn’t wait from the receiver
acknowledgment.
1. Message Destination:
1. Reliability:
It is defined as Reliable
Characteristics Of IPC
5. Integrity:
Messages must arrive without corruption and duplication to the
destination.
6. Validity:
Point to point message services are defined as reliable, If the
messages are guaranteed to be delivered without being lost is
called validity.
7. Ordering:
It is the process of delivering messages to the receiver in a
particular order. Some applications require messages to be
delivered in the sender order i.e the order in which they were
transmitted by the sender.
MPI (Message Passing Interface)
● Facebook, currently, has 1.5 billion active monthly users.
● Google performs at least 1 trillion searches per year.
● About 48 hours of video are uploaded on Youtube every minute.
● With such high demand, single system would be unable to handle the
processing.
Thus, comes the need for Distributed Systems.A distributed system
consists of a collection of autonomous computers, connected through a
network and distribution middleware, which enables computers to
coordinate their activities and to share the resources of the system so that
users perceive the system as a single, integrated computing facility.
● Let us say about Google Web Server, from users perspective while they
submit the searched query, they assume google web server as a single
system. However, behind the curtain, Google has built a lot of servers
which is distributed (geographically and computationally) to give us the
result within a few seconds.
MPI (Message Passing Interface)
● MPI is a standardized and portable message-passing system developed for
distributed and parallel computing.
● MPI provides parallel hardware vendors with a clearly defined base set of
routines that can be efficiently implemented. As a result, hardware vendors can
build upon this collection of standard low-level routines to create higher-level
routines for the distributed-memory communication environment supplied with
their parallel machines.
● MPI gives users the flexibility of calling a set of routines from C, C++, Fortran,
C#, Java, or Python. The advantages of MPI over older message passing
libraries are portability (because MPI has been implemented for almost every
distributed memory architecture) and speed (because each implementation is in
principle optimized for the hardware on which it runs)
● The advantages of MPI over other message-passing framework is portability
and speed. It has been implemented for almost every distributed memory
architecture and each implementation is in principle optimized for the hardware
on which it runs.
MPI (Message Passing Interface)
●
● A and B have to agree on the meaning of the bits being sent. For
example,
1) How many volts should be used to signal a 0-bit? 1-bit?
2) How does the receiver know which is the last bit of the message?
3) How can it detect if a message has been damaged or lost?
4) What should it do if it finds out?
5) How long are numbers, strings, and other data items? And how are
they represented?
Communication in DC
● Interprocess communication (IPC) is a set of programming
interfaces that allows a programmer to coordinate activities among
different program processes that can run concurrently in an
operating system.
● The processes run on different machines and they exchange
information through message passing.
● Successful distributed systems depend on communication models
that hide or simplify message passing.
Message Communication
● When one source process tries to communicate with multiple
processes at once, it is called Group Communication. A group is a
collection of interconnected processes with abstraction. This
abstraction is to hide the message passing so that the
communication looks like a normal procedure call. Group
communication also helps the processes from different hosts to
work together and perform operations in a synchronized manner,
therefore increasing the overall performance of the system.
Two main types of Protocols:
● Connection-oriented: Sender and receiver establish a connection
and negotiate the protocol to use before exchanging data. At the
end of commiunication, terminate or release the connection. An
example: TCP
● Connectionless: No connection is set up in advance. Sender
transmits message when ready. An example: UDP
Lower-Level Protocols
● Implemented in physical layer and data link layer of the stack.
Groups data bits into frames and adds a pattern called checksum
at either end of frame
● Network layer chooses best path from sender to receiver by
routing
● Transport Protocols
1. TCP
2. UDP
3. Higher Level Protocols
4. FTP
5. HTTP
Middleware Protocols:
● Examples are Authentication and Authorization protocols,
commit protocols in transaction databases
● Middleware protocols support high level communication
services
● Protocols that allow a process to call a procedure or invoke an
object on a remote machine transparently. An example
RPC/RMI
● Protocols that support the setting up and synchronizing of
streams for transferring real-time data such as multimedia
applications. An example: SCTP
● Protocols that support reliable multicast services to a WAN
Types of Communication
● Asynchronous communication:
● Synchronous communication:
●
Advantages :
● Simplicity: Message-based communication is a simple and
straightforward approach to IPC, as messages can be easily sent
and received between processes.
● Asynchronous communication: Message-based
communication allows for asynchronous communication, as the
sender and receiver do not have to be active at the same time.
● Reliability: Message-based communication can ensure reliable
delivery of messages, as messages can be re-sent until they are
received by the receiver.
● Scalability: Message-based communication can be used to
implement large-scale distributed systems, as messages can be
routed between multiple computers or networks.
Disadvantages :
● Overhead: Message-based communication can introduce
overhead, as the creation and management of message queues can
consume system resources.
● Complexity: Implementing message-based communication
requires careful design and management of message queues, which
can be complex and time-consuming.
● Latency: Message-based communication can introduce latency, as
messages may have to wait in the queue until they are received by
the receiver.
● Limited data size: Message-based communication is typically
limited in the size of data that can be sent in a message, which can
be a disadvantage for some types of applications.
Group Communication :
Broadcast Communication :
● When the host process tries to communicate with every process in
a distributed system at same time.
● Broadcast communication comes in handy when a common stream
of information is to be delivered to each and every process in most
efficient manner possible. Since it does not require any processing
whatsoever, communication is very fast in comparison to other
modes of communication. However, it does not support a large
number of processes and cannot treat a specific process individually.
Multicast Communication :
● When the host process tries to communicate with a designated
group of processes in a distributed system at the same time.
● This technique is mainly used to find a way to address problem of
a high workload on host system and redundant information from
process in system.
● Multitasking can significantly decrease time taken for message
handling.
Unicast Communication :
● When the host process tries to communicate with a single process
in a distributed system at the same time.
● This works best for two processes communicating as only it has to
treat a specific process only.
● However, it leads to overheads as it has to find exact process and
then exchange information/data.
Types of Groups
● Closed group
● Open group
● Peer group
● Hierarchical group
Topics
● Message Passing
● Group communication
Part 1 - Message Passing
Message Passing
Desirable Features of Message Passing Systems
• Simplicity
• Uniform semantics
• Efficiency
• Reliability
• Correctness
• Flexibility
• Portability
• Security
Message passing process
IPC message format
IPC Message
IPC synchronization
○ Polling
○ Interrupt
○ Synchronous communication
○ Asynchronous communication
IPC: Synchronous communication
IPC: Asynchronous communication
IPC primitives
Message buffering strategies
Null buffering
Null buffering with blocked receiver
Null buffering with non blocked receiver
Message buffering: single buffer
Message buffering: multiple message buffer
● Concept of MTU
● Message contents
Broadcast communication
Types of Groups
● Closed group
● Open group
● Peer group
● Hierarchical group
Group management
● Centralized approach
● Distributed approach
●Thanks for
your attention