0% found this document useful (0 votes)
24 views

DC Module 2a

The document discusses various topics related to distributed computing including protocol layering, interprocess communication, characteristics of IPC, message passing interface (MPI), remote procedure calls (RPC), remote method invocation (RMI), and communication in distributed systems. It provides details on advantages and issues related to different techniques.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

DC Module 2a

The document discusses various topics related to distributed computing including protocol layering, interprocess communication, characteristics of IPC, message passing interface (MPI), remote procedure calls (RPC), remote method invocation (RMI), and communication in distributed systems. It provides details on advantages and issues related to different techniques.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 137

Distributed Computing

Prof. Smita S. Mane


Asst. Prof.
Dept. of AI & DS,
VESIT, Chembur
Module – 2
Communication
Protocol Layering - Introduction

● 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.

1. Asynchronous System Calls:

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:

A local port is a message destination within a computer, specified as an integer. A


port has exactly one receiver but many senders. Processes may use multiple ports
from which to receive messages. Any process that knows the number of a port can
send the message to it.

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)

MPI_Send and MPI_Recv


Issues in RPC design
● Security: Since RPC involves communication over the network, security is a
major concern. Measures such as authentication, encryption, and authorization
must be implemented to prevent unauthorized access and protect sensitive data.
● Scalability: As the number of clients and servers increases, the performance of
the RPC system must not degrade. Load balancing techniques and efficient
resource utilization are important for scalability.
● Fault tolerance: The RPC system should be resilient to network failures,
server crashes, and other unexpected events. Measures such as redundancy,
failover, and graceful degradation can help ensure fault tolerance.
● Standardization: There are several RPC frameworks and protocols available,
and it is important to choose a standardized and widely accepted one to ensure
interoperability and compatibility across different platforms and programming
languages.
● Performance tuning: Fine-tuning the RPC system for optimal performance is
important. This may involve optimizing the network protocol, minimizing the
data transferred over the network, and reducing the latency and overhead
associated with RPC calls.
ADVANTAGES :
● RPC provides ABSTRACTION i.e message-passing nature of
network communication is hidden from the user.
● RPC often omits many of the protocol layers to improve performance.
Even a small performance improvement is important because a
program may invoke RPCs often.
● RPC enables the usage of the applications in the distributed
environment, not only in the local environment.
● With RPC code re-writing / re-developing effort is minimized.
● Process-oriented and thread oriented models supported by RPC.
Remote Method Invocation
● RMI stands for Remote Method Invocation. It is a mechanism
that allows an object residing in one system (JVM) to
access/invoke an object running on another JVM.
● RMI is used to build distributed applications; it provides remote
communication between Java programs.
● It is provided in the package java.rmi.
Architecture of an RMI
● Stub/Skeleton Layer, Remote Reference Layer,Transport Layer
● Transport Layer − This layer connects the client and the server. It
manages the existing connection and also sets up new connections.
● Stub − A stub is a representation (proxy) of the remote object at
client. It resides in the client system; it acts as a gateway for the
client program.
● Skeleton − This is the object which resides on the server side. stub
communicates with this skeleton to pass request to the remote
object.
● RRL(Remote Reference Layer) − It is the layer which manages
the references made by the client to the remote object.
Working of an RMI Application
● When the client makes a call to the remote object, it is received
by the stub which eventually passes this request to the RRL.
● When the client-side RRL receives the request, it invokes a
method called invoke() of the object remoteRef. It passes the
request to the RRL on the server side.
● The RRL on the server side passes the request to the Skeleton
(proxy on the server) which finally invokes the required object
on the server.
● The result is passed all the way back to the client.
Marshalling and Unmarshalling
● Whenever a client invokes a method that accepts parameters on a
remote object, the parameters are bundled into a message before
being sent over the network. These parameters may be of primitive
type or objects. In case of primitive type, the parameters are put
together and a header is attached to it. In case the parameters are
objects, then they are serialized. This process is known as
marshalling.(Transmit)
● At the server side, the packed parameters are unbundled and then
the required method is invoked. This process is known as
unmarshalling.(Read)
RMI Registry
● RMI registry is a namespace on which all server objects are placed.
Each time the server creates an object, it registers this object with the
RMIregistry (using bind() or reBind() methods). These are registered
using a unique name known as bind name.
● To invoke a remote object, the client needs a reference of that object.
At that time, the client fetches the object from the registry using its
bind name (using lookup() method).
Goals of RMI
● To minimize the complexity of the application.
● To preserve type safety.
● Distributed garbage collection.
● Minimize the difference between working with local and
remote objects.
RMI application

● Define the remote interface


● Develop the implementation class (remote object)
● Develop the server program
● Develop the client program
● Compile the application
● Execute the application
Communication in DC
● The single most important difference between a distributed
system and a uniprocessor system is the interprocess
communication.
● In a uniprocessor system, interprocess communication assumes
the existence of shared memory.
● In a distributed system, there’s no shared memory, so the
entire nature of interprocess communication must be completely
rethought from scratch.
● All communication in distributed system is based on message
passing.
E.g. Proc. A wants to communicate with Proc. B
1.It first builds a message in its own address space
2.It executes a system call
3.The OS fetches the message and sends it through network to B.

● 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

● Ensure message is received in the buffer:

○ Polling

○ Interrupt

● Message communication techniques

○ 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

● Receiver overflow handled using:

○ Unsuccessful communication indication

○ Flow control mechanism


Multidatagram messaging

● Concept of MTU

● Message sequencing and reassembly

● Message contents

● Message representation: tagged, untagged


Message data transmission
Process addressing techniques

• Explicit addressing :send (process_id, message) and receive


(process_id, message)

• Implicit addressing:send_any (service_id, message) and receive_any


(service_id, message)

– Two level addressing : machine_id@local_id (receiver machine name)

– Three level addressing: machine_id@local_id@machine_id. (Node where the


process was created @ generated by the first machine@ last known location of
the machine)
Link-based Process Addressing
Failure handling mechanism

● IPC problems due to system failures


IPC Protocols

● 4-message reliable IPC protocol

● 3-message reliable IPC protocol

● 2-message reliable IPC protocol


IPC 4 message protocol
IPC 3 message protocol
IPC 2 message protocol
IPC Failure
Group communication
Group Communication

● Unicast –one to one communication

● Many-to-one group communication

● One-to-many or multicast group communication


Unicast group communication
Many to one communication
Multi cast communication

Broadcast communication
Types of Groups

● Closed group

● Open group

● Peer group

● Hierarchical group
Group management

● Centralized approach

● Distributed approach
●Thanks for
your attention

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy