47
Chapter - 3 Interprocess Communication

Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

Embed Size (px)

Citation preview

Page 1: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

Chapter - 3

Interprocess Communication

Page 2: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

Message Passing

Page 3: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

Message Passing vs Shared Memory

Page 4: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

Desirable Features of Message Passing

Systems

• Hardware approach

• Functionality

• Performance

• Uniform semantics

• Efficiency

• Reliability

• Correctness

• Flexibility

• Portability

• Security

Page 5: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

Message passing process

Page 6: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

IPC message format

Page 7: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

IPC Message

Page 8: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

IPC synchronization

Ensure message is received in the buffer:

Polling

Interrupt

Message communication techniques

Synchronous communication

Asynchronous communication

Page 9: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

IPC: Synchronous communication

Page 10: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

IPC: Asynchronous communication

Page 11: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

IPC primitives

Page 12: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

Message buffering strategies

Page 13: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

Null buffering

Page 14: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

Null buffering with blocked receiver

Page 15: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

Null buffering with non blocked

receiver

Page 16: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

Message buffering: single buffer

Page 17: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

Message buffering: multiple message

buffer

Receiver overflow handled using:

Unsuccessful communication indication

Flow control mechanism

Page 18: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

Multidatagram messaging

Concept of MTU

Message sequencing and reassembly

Message contents

Message representation: tagged, untagged

Page 19: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

Message data transmission

Page 20: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

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)

Page 21: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

Link-based Process Addressing

Page 22: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

Failure handling mechanism

IPC problems due to system failures

Page 23: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

IPC Protocols

4-message reliable IPC protocol

3-message reliable IPC protocol

2-message reliable IPC protocol

Page 24: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

IPC 4 message protocol

Page 25: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

IPC 3 message protocol

Page 26: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

IPC 2 message protocol

Page 27: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

IPC Failure

Page 28: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

Case Study: IPC in MACH

Page 29: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

Case Study: IPC in MACH

MACH IPC Components

Ports

Messages

Message format

NetMsgServer

Page 30: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

MACH message format

Page 31: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

Group communication

Page 32: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

Group Communication

Unicast –one to one communication

Many-to-one group communication

One-to-many or multicast group communication

Page 33: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

Unicast group communication

Page 34: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

Many to one communication

Page 35: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

Broadcast communication

Multi cast communication

Page 36: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

Types of Groups

Closed group

Open group

Peer group

Hierarchical group

Page 37: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

Group management

Centralized approach

Distributed approach

Page 38: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

Group addressing Message delivery

High level naming

For large LANs/

MANs: send message

to individual group

members

Send to all semantics

Bulletin board

semantics

Page 39: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

Reliability mechanism

Classified based on number of receivers from which

sender expects a response

Page 40: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

Message ordering

Page 41: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

Message ordering: Absolute Ordering

Page 42: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

Message ordering: Consistent ordering

Page 43: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

Message ordering: Causal ordering

Page 44: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

Case Study: CBCAST protocol in ISIS

Page 45: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

CBCAST protocol

S: vector of the sending process attached to the

message

R : vector of the receiving process

i: sequence number of the sender process

Runtime system tests following conditions

S[i] = R [i] + 1

S[j] <= R[j] for j <> i

Page 46: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

CBCAST protocol in ISIS

Page 47: Chapter - 3 Interprocess Communication - …© Oxford University Press 2011 Desirable Features of Message Passing Systems • Hardware approach • Functionality • Performance •

© Oxford University Press 2011

Summary

Message Passing

Case Study: IPC in MACH

Group communication

Case Study: CBCAST protocol in ISIS