unit-ii message passing - harishgadade
TRANSCRIPT
![Page 1: Unit-II Message Passing - HarishGadade](https://reader035.vdocument.in/reader035/viewer/2022071612/6157088da097e25c76505b5a/html5/thumbnails/1.jpg)
Unit-II
Message Passing
Mr. Harish D. GadadeGovt. College of Engg., Jalgaon
Mr. Harish D. Gadade Govt. Colleg of Engg, Jalgaon 1
![Page 2: Unit-II Message Passing - HarishGadade](https://reader035.vdocument.in/reader035/viewer/2022071612/6157088da097e25c76505b5a/html5/thumbnails/2.jpg)
Introduction
Two basic methods for for information sharing as as follows
1. Shared Data Approach
Figure: Shared Data Approach
2. Message Passing Approach
Figure: Message Passing Approach
Mr. Harish D. Gadade Govt. Colleg of Engg, Jalgaon 2
![Page 3: Unit-II Message Passing - HarishGadade](https://reader035.vdocument.in/reader035/viewer/2022071612/6157088da097e25c76505b5a/html5/thumbnails/3.jpg)
Desirable Features of a good Message Passing System
1. Simplicity
2. Uniform SemanticsI Local CommunicationI Remote Communication
3. Efficiency
4. Reliability
5. CorrectnessIssues related to correctness areI AtomicityI Ordered DeliveryI Survivability
6. Flexibility
7. Security
8. Portability
Mr. Harish D. Gadade Govt. Colleg of Engg, Jalgaon 3
![Page 4: Unit-II Message Passing - HarishGadade](https://reader035.vdocument.in/reader035/viewer/2022071612/6157088da097e25c76505b5a/html5/thumbnails/4.jpg)
Issues in IPC by Message Passing I
A message is a block of information formatted by a sending processin such a manner that it is meaningful to the receiving process.In the designing of an IPC protocol for message-passing system, thefollowing important issues need to be considered.
Figure: A Typical Message Structure
Mr. Harish D. Gadade Govt. Colleg of Engg, Jalgaon 4
![Page 5: Unit-II Message Passing - HarishGadade](https://reader035.vdocument.in/reader035/viewer/2022071612/6157088da097e25c76505b5a/html5/thumbnails/5.jpg)
Issues in IPC by Message Passing IIIn designing of an IPC for MPS, the following important issues needto be considered:
1. Who is the sender?
2. who is the receiver?
3. Is there one receiver or many receivers?
4. Is the message guaranted to have been accepted by itsreceiver?
5. Does the sender need to wait for a reply?
6. What should be done is a catastrophic event such as a nodecrash of a communication link failure occurs during the courseof communication?
7. What should be done if the receiver is not ready to accept themessage:Will the message be discarded or stored in a buffer?In case of buffering,what shoul be done if athe buffer is full?
8. Is there are several outstanding messages for a receiver, can itchoose the order in which to service the outstandingmessages?
Mr. Harish D. Gadade Govt. Colleg of Engg, Jalgaon 5
![Page 6: Unit-II Message Passing - HarishGadade](https://reader035.vdocument.in/reader035/viewer/2022071612/6157088da097e25c76505b5a/html5/thumbnails/6.jpg)
Synchronization I
A central issue in the communication structure is thesynchronization. The semantics used synchronization may bebroadly classified as
I Blocking
I Non-Blocking
An important issue in non-blocking receive primitive is how thereceiving process knows that message is arrived in the messagebuffer.
1. Polling
2. Interrupt
When both the send and receive primitives of a communicationbetween two processes use blocking semantics, the communicationis said to be synchronous; otherwise it is asynchronous.
Mr. Harish D. Gadade Govt. Colleg of Engg, Jalgaon 6
![Page 7: Unit-II Message Passing - HarishGadade](https://reader035.vdocument.in/reader035/viewer/2022071612/6157088da097e25c76505b5a/html5/thumbnails/7.jpg)
Synchronization II
Figure: Synchronous Mode of Communication with send and receiveprimitives having blocking type semantics.
Mr. Harish D. Gadade Govt. Colleg of Engg, Jalgaon 7
![Page 8: Unit-II Message Passing - HarishGadade](https://reader035.vdocument.in/reader035/viewer/2022071612/6157088da097e25c76505b5a/html5/thumbnails/8.jpg)
Buffering I
The synchronous and asunchronous mode of communicationcorrespond respectively to the two extremes of buffering: a NullBuffer or No Buffering and a buffer with unbounded capacity.Other two commonly used buffering strategies are Single-bufferingand finite bound or multiple message buffers. These four types ofbuffering strategies are;
I Null Buffer or No Buffering
I Single Message Buffer
I Unbounded-Capacity Buffer
I Finite Bound or Multiple Message Buffer
Mr. Harish D. Gadade Govt. Colleg of Engg, Jalgaon 8
![Page 9: Unit-II Message Passing - HarishGadade](https://reader035.vdocument.in/reader035/viewer/2022071612/6157088da097e25c76505b5a/html5/thumbnails/9.jpg)
Buffering II
Mr. Harish D. Gadade Govt. Colleg of Engg, Jalgaon 9
![Page 10: Unit-II Message Passing - HarishGadade](https://reader035.vdocument.in/reader035/viewer/2022071612/6157088da097e25c76505b5a/html5/thumbnails/10.jpg)
Multidatagram Messages
I Datagram
I MTU
I Single Datagram Messages
I Multi Datagram Messages
Mr. Harish D. Gadade Govt. Colleg of Engg, Jalgaon 10
![Page 11: Unit-II Message Passing - HarishGadade](https://reader035.vdocument.in/reader035/viewer/2022071612/6157088da097e25c76505b5a/html5/thumbnails/11.jpg)
Encoding and Decoding of Message Data
A message data should be meaningful to the receiving process. Thisimplies that, ideally, the structure of the program object should bepreserved while they are being transmitted from address space pfthe sending process to the address space of the receiving process.This obviously is not possible in a heterogeneous systems in whichthe sending and receiving processes are on different computers ofdifferent architectures. However, even in homogeneous systems, itis very difficult to achieve this goal mainly because of two reasons:
1. An absolute pointer value loses
2. Different program objects occupy varying amount of storagespace.
Due to above mentioned problem encoding and decoding is done.One of the following two representations may be used for encodingand decoding of a message data.
1. In tagged representation
2. In Untagged representationMr. Harish D. Gadade Govt. Colleg of Engg, Jalgaon 11
![Page 12: Unit-II Message Passing - HarishGadade](https://reader035.vdocument.in/reader035/viewer/2022071612/6157088da097e25c76505b5a/html5/thumbnails/12.jpg)
Process Addressing
Another important issue in message based communication isaddressing(or naming)of the parties involved in an interaction.MPS usually supports two types of process addressing.
I Explicit Addressingsend(process id,message)receive(process id,message)
I Implicit Addressingsend any(service id,message)receive any(process id,message)
Primitives for explicit and Implicit addressing of a process
A simple method to identify a process is by combineation ofmachine id and local id
(machine id, local id, machine id)
Mr. Harish D. Gadade Govt. Colleg of Engg, Jalgaon 12
![Page 13: Unit-II Message Passing - HarishGadade](https://reader035.vdocument.in/reader035/viewer/2022071612/6157088da097e25c76505b5a/html5/thumbnails/13.jpg)
Failure Handling I
While distributed system may offer potential for parallelism, it isalso prone to partial failure such as node crash or a communicationlink failure. Therefore, during interprocess communication, suchfailures may lead the following problems:
1. Loss of Request Message
2. Loss of Response Message
3. Unsuccessful Execution of the Request
Mr. Harish D. Gadade Govt. Colleg of Engg, Jalgaon 13
![Page 14: Unit-II Message Passing - HarishGadade](https://reader035.vdocument.in/reader035/viewer/2022071612/6157088da097e25c76505b5a/html5/thumbnails/14.jpg)
Failure Handling II
Figure: Request message is lost
Mr. Harish D. Gadade Govt. Colleg of Engg, Jalgaon 14
![Page 15: Unit-II Message Passing - HarishGadade](https://reader035.vdocument.in/reader035/viewer/2022071612/6157088da097e25c76505b5a/html5/thumbnails/15.jpg)
Failure Handling III
Figure: Response message is lost
Mr. Harish D. Gadade Govt. Colleg of Engg, Jalgaon 15
![Page 16: Unit-II Message Passing - HarishGadade](https://reader035.vdocument.in/reader035/viewer/2022071612/6157088da097e25c76505b5a/html5/thumbnails/16.jpg)
Failure Handling IV
Figure: Receiver’s computer crashed
Mr. Harish D. Gadade Govt. Colleg of Engg, Jalgaon 16
![Page 17: Unit-II Message Passing - HarishGadade](https://reader035.vdocument.in/reader035/viewer/2022071612/6157088da097e25c76505b5a/html5/thumbnails/17.jpg)
Failure Handling V
To cope up with these problems, a reliable IPC protocol of a MPSis normally designed based on the idea of internal retransmission ofmessage after timeouts and the return of the acknowledgementmessage of the sending machine’s kernel be the receivingmachine’s kernel.Based on the above idea, a fourway message reliable IPC protocolfor client-server between two processes works as follows:
1. Four-Message Reliable IPC Protocol
2. Three-Message Reliable IPC Protocol
3. Two-Message Reliable IPC Protocol
Mr. Harish D. Gadade Govt. Colleg of Engg, Jalgaon 17
![Page 18: Unit-II Message Passing - HarishGadade](https://reader035.vdocument.in/reader035/viewer/2022071612/6157088da097e25c76505b5a/html5/thumbnails/18.jpg)
Failure Handling VI
Figure: Four-message reliable IPC protocol
Mr. Harish D. Gadade Govt. Colleg of Engg, Jalgaon 18
![Page 19: Unit-II Message Passing - HarishGadade](https://reader035.vdocument.in/reader035/viewer/2022071612/6157088da097e25c76505b5a/html5/thumbnails/19.jpg)
Failure Handling(Continues...)
Figure: Three-message reliable IPC protocol
Mr. Harish D. Gadade Govt. Colleg of Engg, Jalgaon 19
![Page 20: Unit-II Message Passing - HarishGadade](https://reader035.vdocument.in/reader035/viewer/2022071612/6157088da097e25c76505b5a/html5/thumbnails/20.jpg)
Failure Handling(Continues...)
Figure: Two-message reliable IPC protocol
Mr. Harish D. Gadade Govt. Colleg of Engg, Jalgaon 20
![Page 21: Unit-II Message Passing - HarishGadade](https://reader035.vdocument.in/reader035/viewer/2022071612/6157088da097e25c76505b5a/html5/thumbnails/21.jpg)
Failure Handling(Continues...)Consider an example of fault-tolerant communication between aclient and a server
Figure: fault-tolerant communication between a client and a serverMr. Harish D. Gadade Govt. Colleg of Engg, Jalgaon 21
![Page 22: Unit-II Message Passing - HarishGadade](https://reader035.vdocument.in/reader035/viewer/2022071612/6157088da097e25c76505b5a/html5/thumbnails/22.jpg)
Idem-potency and Handling of Duplicate Messages I
Consider the following routine of a server process that debits a spec-ified amount from a bank and returns the balance amount to a re-questing client.
Figure: A Non-idempotent routine
Mr. Harish D. Gadade Govt. Colleg of Engg, Jalgaon 22
![Page 23: Unit-II Message Passing - HarishGadade](https://reader035.vdocument.in/reader035/viewer/2022071612/6157088da097e25c76505b5a/html5/thumbnails/23.jpg)
Idem-potency and Handling of Duplicate Messages II
Figure: Exactly once semantics
Mr. Harish D. Gadade Govt. Colleg of Engg, Jalgaon 23
![Page 24: Unit-II Message Passing - HarishGadade](https://reader035.vdocument.in/reader035/viewer/2022071612/6157088da097e25c76505b5a/html5/thumbnails/24.jpg)
Keeping Track of Lost and Out-Of-Sequence Packets inMultidatagram Messages
Mr. Harish D. Gadade Govt. Colleg of Engg, Jalgaon 24
![Page 25: Unit-II Message Passing - HarishGadade](https://reader035.vdocument.in/reader035/viewer/2022071612/6157088da097e25c76505b5a/html5/thumbnails/25.jpg)
Group Communication I
Depending on single or multiple senders and receivers, thefollowing are the three types of group communications;
1. One-to-Many
2. Many-to-One
3. Many-to-Many
Mr. Harish D. Gadade Govt. Colleg of Engg, Jalgaon 25
![Page 26: Unit-II Message Passing - HarishGadade](https://reader035.vdocument.in/reader035/viewer/2022071612/6157088da097e25c76505b5a/html5/thumbnails/26.jpg)
Group Communication II
1. One-to-Many
I Group Management
I Group Addressing
I Message Delivery to Receiver Process
I Buffered and Unbuffered Multicast
I Send-to-All and Bulletin-Board Semantics
I Flexible Reliability in Multicast Communication
I Atomic Multicast
Mr. Harish D. Gadade Govt. Colleg of Engg, Jalgaon 26
![Page 27: Unit-II Message Passing - HarishGadade](https://reader035.vdocument.in/reader035/viewer/2022071612/6157088da097e25c76505b5a/html5/thumbnails/27.jpg)
Group Communication III2. Many-to-One3. Many-to-Many The commonly used semantics for ordereddelivery of multicas messages are;
I Absolute Ordering
Figure: No Ordering constraint for Messages delivery
Mr. Harish D. Gadade Govt. Colleg of Engg, Jalgaon 27
![Page 28: Unit-II Message Passing - HarishGadade](https://reader035.vdocument.in/reader035/viewer/2022071612/6157088da097e25c76505b5a/html5/thumbnails/28.jpg)
Group Communication IV
Figure: Absolute Ordering of Messages
Mr. Harish D. Gadade Govt. Colleg of Engg, Jalgaon 28
![Page 29: Unit-II Message Passing - HarishGadade](https://reader035.vdocument.in/reader035/viewer/2022071612/6157088da097e25c76505b5a/html5/thumbnails/29.jpg)
Group Communication V
I Consistent Ordering
Figure: Consistent Ordering of Messages
Mr. Harish D. Gadade Govt. Colleg of Engg, Jalgaon 29
![Page 30: Unit-II Message Passing - HarishGadade](https://reader035.vdocument.in/reader035/viewer/2022071612/6157088da097e25c76505b5a/html5/thumbnails/30.jpg)
Group Communication VI
I Causal Ordering
Figure: Causal Ordering of Messages
Mr. Harish D. Gadade Govt. Colleg of Engg, Jalgaon 30