Unit 2
Unit 2
CHAPTER 2
REFERENCE BOOK:
DISTRIBUTED OPERATING SYSTEM CONCEPT & DESIGN BY PRADEEP K. SINHA
Prof.M.S.Koli
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
SKN SINHGAD COLLEGE OF ENGINEERING PANDHARPUR
Subject: Distributed System Chapter 2: Message Passing
Chapter No. 2
Introduction
Synchronization
Buffering
Multidatagram messages
Process addressing
Failure Handling
Group communication
2.1 Simplicity
f f
Address.
It contains characters that uniquely identify the sending and receiving
processes in the network. It has a two part one is sending process address
and another is receiving process address.
Sequence number.
This is the message identifier (ID), which is very useful for identifying
lost messages and duplicate messages in case of system failures.
Structural information.
It has two part, the first part i.e. is type specifies whether the data to
be passed on to the receiver is included within the message or the message
only contains a pointer to the data, which is stored somewhere outside the
contiguous portion of the message. The second part of this element specifies
the length of the variable-size message data.
In a message-oriented IPC protocol, the sending process determines
the actual contents of a message and the receiving process is aware of how
to interpret the contents.
In the design of an IPC protocol for a message-passing system, the following
important issues need to be considered
Who is the sender?
Subject: Distributed System Chapter 2: Message Passing
Polling:
A test primitive is provided to allow the receiver to check the buffer
status.
The receiver uses this primitive to periodically poll the kernel to
check if the message is already available in the buffer.
Interrupt:
In this method, when the message has been filled in the buffer and
is ready for use by the receiver, a software interrupt is used to
notify the receiving process.
This method permits the receiving process to continue with its
execution without having to issue unsuccessful test requests.
This method is highly efficient and allows maximum parallelism, its
main drawback is that user-level interrupts make programming
difficult.
What is Datagram ?
o A datagram is a basic transfer unit associated with a packet-switched
network & provide a connectionless communication service across a
packet-switched network.
o Each packet is known as datagram.
How much data at a time we can transmit ?
o Almost all networks have an upper bound on the size of data that can
be transmitted at a time. This size is known as the maximum transfer
unit (MTU) of a network.
o The message whose size is greater than MTU fragmented into
multiples of the MTU & each fragment sent separately.
Messages smaller than the MTU of the network can be sent in a single
packet and are known as single-datagram messages.
Messages larger than the MTU of the network have to be fragmented and
sent in multiple packets known as multidatagram message.
The disassembling of a multidatagram message into multiple packets on the
sender side and the reassembling of the packets on the receiver side is
usually the responsibility of the message-passing system.
does the sender wish to send its message and, conversely, from whom does
Types of Addressing :
1) Explicit Addressing: The process with which communication is
desired is explicitly named as a parameter in the communication
primitive used.
send (process_id, message)
receive(process_id message)
These two primitives will send & receive message to and from process
identified by process_id.
2) Implicit Addressing : A process willing to communicate does not
explicitly name a process for communication.
send_any(service_id, message)
Sender names the service instead of process. This type of process
addressing is also known as functional addressing because the
address used in the communication primitive identifies a service
rather than a process.
receive_any(process_id, message)
This type of primitive is again useful in client-server communications
when the server is meant to service requests of all clients that are
authorized to use its
service.
unique only for one machine and it can be generated in local machine
without consultation with other machine.
Limitation: it does not allow a process to migrate from one machine
to' another if such a need arises.
Solution: processes can be identified by a combination of the
following three fields: machine_ld, local_id, and machine_id.
a) The first field identifies the node on which the process is created
b) The second field is a local identifier generated by the node on which
the process is created.
c) The third field identifies the last known location (node) of the
process.
This method of process addressing is known as link-based process
addressing.
Process: The kernel of the sending machine delivers the message to
the machine whose machine_id is specified in the third field of the
receiving process's address. If the value of the third field is equal to
the first field, the message will be sent to the node on which the
process was created. If the receiving process was not migrated, the
message is delivered to it by using the local_id information in the
process identifier. On the other hand, if the receiving process was
migrated, the link information left for it on that node is used to
forward the message to the node to which the receiving process was
migrated from this node.
It suffer from two drawbacks:
a) The overload of locating a process may be large if the process has
migrated several times during its lifetime.
b) It may not be possible to locate a process if an intermediate node on
which the process once resided during its lifetime is down.
Described above two methods are nontransparent due to need to specify the
machine identifier. Hence a location-transparent process-addressing
mechanism is more desirable for a message-passing system.
Subject: Distributed System Chapter 2: Message Passing
Node crash and communication link failure are the two basic types of partial
failure. This problem may lead to following problems
1) Loss of request message:
This may happen either due to the failure of communication
link between the sender and receiver or because the receiver's node is
down at the time the request message reaches there.
Subject: Distributed System Chapter 2: Message Passing
Solution:
To cope with this problem, a reliable IPC protocol of message passing
system is designed based on internal retransmission of message after time
out.
The kernel of the sending machine is responsible for retransmitting
the message after waiting for a timeout period if no acknowledgment is
received from the receiver's machine within this time. The kernel of the
sending machine frees the sending process only when the acknowledgment
is received.
a) Four – Message reliable IPC Protocol for client – server
communication
d) When the reply message is received at the client's machine, the kernel of
that machine returns an acknowledgment message to the kernel of the
server machine. If the acknowledgment message is not received within the
timeout period, the kernel of the server machine retransmits the reply
message.
b) Three-message reliable IPC protocol for client-server communication