inter-process communicationhome.eng.iastate.edu/~guan/course/cpre-450-550/slides... ·...

29
CprE 450-550 Dr. Yong Guan Department of Electrical and Computer Engineering & Information Assurance Center Iowa State University Inter-process Communication: Message-Oriented and Stream-Oriented Communication

Upload: others

Post on 24-Mar-2020

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Inter-process Communicationhome.eng.iastate.edu/~guan/course/CprE-450-550/Slides... · 2020-01-21 · CprE 450-550 Dr. Yong Guan Department of Electrical and Computer Engineering

CprE 450-550

Dr. Yong Guan

Department of Electrical and Computer Engineering& Information Assurance CenterIowa State University

Inter-process Communication: Message-Oriented and Stream-Oriented Communication

Page 2: Inter-process Communicationhome.eng.iastate.edu/~guan/course/CprE-450-550/Slides... · 2020-01-21 · CprE 450-550 Dr. Yong Guan Department of Electrical and Computer Engineering

CprE 450-550

Outline for Today’s TalkInter-process Communication

Message PassingSynchronization, QoS, etc.

Page 3: Inter-process Communicationhome.eng.iastate.edu/~guan/course/CprE-450-550/Slides... · 2020-01-21 · CprE 450-550 Dr. Yong Guan Department of Electrical and Computer Engineering

CprE 450-550

Readings for Today’s Lecture

Chapter 4 of “Distributed Systems: Principles and Paradigms”

Page 4: Inter-process Communicationhome.eng.iastate.edu/~guan/course/CprE-450-550/Slides... · 2020-01-21 · CprE 450-550 Dr. Yong Guan Department of Electrical and Computer Engineering

CprE 450-550

Message-oriented CommunicationTypes of Communication

RPCWhat about the receiving side is not executing at the time a request is issued?Messaging!

Page 5: Inter-process Communicationhome.eng.iastate.edu/~guan/course/CprE-450-550/Slides... · 2020-01-21 · CprE 450-550 Dr. Yong Guan Department of Electrical and Computer Engineering

CprE 450-550

Persistence and Synchronicity in Communication (1)

General organization of a communication system in which hosts are connected through a network

2-20

Page 6: Inter-process Communicationhome.eng.iastate.edu/~guan/course/CprE-450-550/Slides... · 2020-01-21 · CprE 450-550 Dr. Yong Guan Department of Electrical and Computer Engineering

CprE 450-550

Persistence and Synchronicity in Communication (2)

Persistent communication of letters back in the days of the Pony Express.

Page 7: Inter-process Communicationhome.eng.iastate.edu/~guan/course/CprE-450-550/Slides... · 2020-01-21 · CprE 450-550 Dr. Yong Guan Department of Electrical and Computer Engineering

CprE 450-550

Persistence and Synchronicity in Communication (3)

a) Persistent asynchronous communicationb) Persistent synchronous communication

2-22.1

Page 8: Inter-process Communicationhome.eng.iastate.edu/~guan/course/CprE-450-550/Slides... · 2020-01-21 · CprE 450-550 Dr. Yong Guan Department of Electrical and Computer Engineering

CprE 450-550

Persistence and Synchronicity in Communication (4)

c) Transient asynchronous communicationd) Receipt-based transient synchronous communication

2-22.2

Page 9: Inter-process Communicationhome.eng.iastate.edu/~guan/course/CprE-450-550/Slides... · 2020-01-21 · CprE 450-550 Dr. Yong Guan Department of Electrical and Computer Engineering

CprE 450-550

Persistence and Synchronicity in Communication (5)

e) Delivery-based transient synchronous communication at message delivery

f) Response-based transient synchronous communication

Page 10: Inter-process Communicationhome.eng.iastate.edu/~guan/course/CprE-450-550/Slides... · 2020-01-21 · CprE 450-550 Dr. Yong Guan Department of Electrical and Computer Engineering

CprE 450-550

Connection-oriented communication pattern using sockets.

Message-oriented Transient Communication

Berkeley Sockets

Page 11: Inter-process Communicationhome.eng.iastate.edu/~guan/course/CprE-450-550/Slides... · 2020-01-21 · CprE 450-550 Dr. Yong Guan Department of Electrical and Computer Engineering

CprE 450-550

Some of the most intuitive message-passing primitives of MPI.

Primitive Meaning

MPI_bsend Append outgoing message to a local send buffer

MPI_send Send a message and wait until copied to local or remote buffer

MPI_ssend Send a message and wait until receipt starts

MPI_sendrecv Send a message and wait for reply

MPI_isend Pass reference to outgoing message, and continue

MPI_issend Pass reference to outgoing message, and wait until receipt starts

MPI_recv Receive a message; block if there are none

MPI_irecv Check if there is an incoming message, but do not block

Message-oriented Transient Communication (2)

Message-Passing Interface (MPI)

Page 12: Inter-process Communicationhome.eng.iastate.edu/~guan/course/CprE-450-550/Slides... · 2020-01-21 · CprE 450-550 Dr. Yong Guan Department of Electrical and Computer Engineering

CprE 450-550

Four combinations for loosely-coupled communications using queues.

2-26

Message-oriented Persistent Communication

Message Queuing Model

Page 13: Inter-process Communicationhome.eng.iastate.edu/~guan/course/CprE-450-550/Slides... · 2020-01-21 · CprE 450-550 Dr. Yong Guan Department of Electrical and Computer Engineering

CprE 450-550

Primitive Meaning

Put Append a message to a specified queue

Get Block until the specified queue is nonempty, and remove the first message

Poll Check a specified queue for messages, and remove the first. Never block.

Notify Install a handler to be called when a message is put into the specified queue.

Message-oriented Persistent Communication (2)

Basic interface to a queue in a message-queuing system

Page 14: Inter-process Communicationhome.eng.iastate.edu/~guan/course/CprE-450-550/Slides... · 2020-01-21 · CprE 450-550 Dr. Yong Guan Department of Electrical and Computer Engineering

CprE 450-550

The relationship between queue-level addressing and network-level addressing.

Message-oriented Persistent Communication (3)

General Architecture of a Message-Queuing System

Page 15: Inter-process Communicationhome.eng.iastate.edu/~guan/course/CprE-450-550/Slides... · 2020-01-21 · CprE 450-550 Dr. Yong Guan Department of Electrical and Computer Engineering

CprE 450-550

The general organization of a message-queuing system with routers.

Message-oriented Persistent Communication (4)

General Architecture of a Message-Queuing System

Page 16: Inter-process Communicationhome.eng.iastate.edu/~guan/course/CprE-450-550/Slides... · 2020-01-21 · CprE 450-550 Dr. Yong Guan Department of Electrical and Computer Engineering

CprE 450-550

The general organization of a message broker in a message-queuing system.

Message-oriented Persistent Communication (5)

Message Brokers

Page 17: Inter-process Communicationhome.eng.iastate.edu/~guan/course/CprE-450-550/Slides... · 2020-01-21 · CprE 450-550 Dr. Yong Guan Department of Electrical and Computer Engineering

CprE 450-550

Stream-oriented CommunicationCommunications discussed so far

Focus on exchanging more-or-less independent and complete units of informationTiming has no effect on correctness

There are forms of communication where timing plays a crucial role.

E.g., Audio/Video streamNeed the support for continuous media

Page 18: Inter-process Communicationhome.eng.iastate.edu/~guan/course/CprE-450-550/Slides... · 2020-01-21 · CprE 450-550 Dr. Yong Guan Department of Electrical and Computer Engineering

CprE 450-550

Data StreamData Stream

Continuous (representation) stream: temporal relationships between different data items are fundamentally to correctly interpreting what the data actually meansDiscrete (representation) stream: temporal relationships not fundamental to correctly interpreting data.

Transmission modes:Asynchronous transmission mode: No timing contrainstSynchronous transmission mode: Maximum delayIsochronous transmission mode: Max and min delay

Simple stream vs. Complex Stream

Page 19: Inter-process Communicationhome.eng.iastate.edu/~guan/course/CprE-450-550/Slides... · 2020-01-21 · CprE 450-550 Dr. Yong Guan Department of Electrical and Computer Engineering

CprE 450-550

Data Stream (2)

A general architecture for streaming stored multimedia data over a network.

Page 20: Inter-process Communicationhome.eng.iastate.edu/~guan/course/CprE-450-550/Slides... · 2020-01-21 · CprE 450-550 Dr. Yong Guan Department of Electrical and Computer Engineering

CprE 450-550

Data Stream (3)

An example of multicasting a stream to several receivers.

Page 21: Inter-process Communicationhome.eng.iastate.edu/~guan/course/CprE-450-550/Slides... · 2020-01-21 · CprE 450-550 Dr. Yong Guan Department of Electrical and Computer Engineering

CprE 450-550

Streams and Quality of ServiceQoS: Timing and other non-functional requirementsProperties for Quality of Service

The required bit rate at which data should be transported.The maximum delay until a session has been set up The maximum end-to-end delay .The maximum delay variance, or jitter.The maximum round-trip delay for Quality of Service

Specifying QoS

Characteristics of the Input Service Required

maximum data unit size (bytes)Token bucket rate (bytes/sec)Toke bucket size (bytes)Maximum transmission rate (bytes/sec)

Loss sensitivity (bytes)Loss interval (sec)Burst loss sensitivity (data units)Minimum delay noticed (sec)Maximum delay variation (sec)Quality of guarantee

Page 22: Inter-process Communicationhome.eng.iastate.edu/~guan/course/CprE-450-550/Slides... · 2020-01-21 · CprE 450-550 Dr. Yong Guan Department of Electrical and Computer Engineering

CprE 450-550

Streams and Quality of Service (2)Enforcing QoS

The principle of a token bucket algorithm

Page 23: Inter-process Communicationhome.eng.iastate.edu/~guan/course/CprE-450-550/Slides... · 2020-01-21 · CprE 450-550 Dr. Yong Guan Department of Electrical and Computer Engineering

CprE 450-550

Streams and Quality of Service (3)Enforcing QoS

Using a buffer to reduce jitter.

Page 24: Inter-process Communicationhome.eng.iastate.edu/~guan/course/CprE-450-550/Slides... · 2020-01-21 · CprE 450-550 Dr. Yong Guan Department of Electrical and Computer Engineering

CprE 450-550

Streams and Quality of Service (4)Enforcing QoS

The effect of packet loss in (a) non interleaved transmission and (b) interleaved transmission.

Page 25: Inter-process Communicationhome.eng.iastate.edu/~guan/course/CprE-450-550/Slides... · 2020-01-21 · CprE 450-550 Dr. Yong Guan Department of Electrical and Computer Engineering

CprE 450-550

Setting Up a Stream

The basic organization of RSVP for resource reservation in a distributed system.

Page 26: Inter-process Communicationhome.eng.iastate.edu/~guan/course/CprE-450-550/Slides... · 2020-01-21 · CprE 450-550 Dr. Yong Guan Department of Electrical and Computer Engineering

CprE 450-550

Stream SynchronizationComplex stream

Synchronization of streams deals with maintaining temporal relationships between streamsE.g. 1, Slide show (with audio) on the webE.g. 2, On-demand movie (audio and video)

Page 27: Inter-process Communicationhome.eng.iastate.edu/~guan/course/CprE-450-550/Slides... · 2020-01-21 · CprE 450-550 Dr. Yong Guan Department of Electrical and Computer Engineering

CprE 450-550

Stream Synchronization (2)Synchronization Mechanisms

The principle of explicit synchronization on the level data units.

Page 28: Inter-process Communicationhome.eng.iastate.edu/~guan/course/CprE-450-550/Slides... · 2020-01-21 · CprE 450-550 Dr. Yong Guan Department of Electrical and Computer Engineering

CprE 450-550

Stream Synchronization (3)Synchronization Mechanisms

The principle of synchronization as supported by high-level interfaces.

Page 29: Inter-process Communicationhome.eng.iastate.edu/~guan/course/CprE-450-550/Slides... · 2020-01-21 · CprE 450-550 Dr. Yong Guan Department of Electrical and Computer Engineering

CprE 450-550

Questions?

Thanks and See you next time