Presentation on theme: "Chapter 4: Communication*"— Presentation transcript:
1Chapter 4: Communication* Message-Oriented Communication&Stream-Oriented Communication*Referred to slides by Manhyung Han at Kyung Hee University, Hitesh Ballani at Cornell University, and Mary Ellen Weisskopf at University of Alabama in Huntsville
2Review In a distributed system, processes run on different machinesexchange information through message passingSuccessful distributed systems depend on communication models that hide or simplify message passing
3Middleware Communication Techniques Remote Procedure CallMessage-Oriented CommunicationStream-Oriented CommunicationMulticast Communication
4Types of Communication Persistent versus transientSynchronous versus asynchronousDiscrete versus streaming
5Persistent versus Transient Communication Persistent: messages are held by the middleware comm. service until they can be delivered (e.g., )Sender can terminate after executing sendReceiver will get message next time it runsTransient: messages exist only while the sender and receiver are runningCommunication errors or inactive receiver cause the message to be discardedTransport-level communication is transientRPC?If the router can’t forward the message it will drop it.
6Asynchronous v Synchronous Communication Asynchronous: (non-blocking) sender resumes execution as soon as the message is passed to the communication/middleware softwareSynchronous: sender is blocked untilThe OS or middleware notifies acceptance of the message, orThe message has been delivered to the receiver, orThe receiver processes it & returns a response
7EvaluationFully synchronous primitives may slow processes down, but program behavior is easier to understandIn multithreaded processes, blocking is not as big a problem because a special thread can be created to wait for messages
8Discrete versus Streaming Communication Discrete: communicating parties exchange discrete messagesStreaming: one-way communication; a “session” consists of multiple messages from the sender that are related either by send order (TCP streams), temporal proximity (multimedia streams), etc.
9Message Oriented Communication RPC supports access transparency, but is not always appropriateMessage-oriented communication is more flexibleRPC is usually synchronous, and is transient.
10Message Passing Interface (MPI) Designed for parallel applications using transient communicationMPI isa standardized and portable message-passing system designed by a group of researchers from academia and industryused in many environments, e.g., clustersplatform independent
11Message Primitives Asynchronous: e.g. MPI_bsend Synchronous: e.g. MPI_send, MPI_ssend, MPI_sendrecv:
12MPI Apps versus C/SProcesses in an MPI-based parallel system act more like peers (or peer slaves to a master processor)Communication may involve message exchange in multiple directionsC/S communication is more structured
13Message-Oriented Middleware (MOM) - Persistent Processes communicate through message queuesQueues are maintained by the message-queuing systemSender appends to queue, receiver removes from queueNeither the sender nor receiver needs to be on-line when the message is transmitted
144.4 Stream-Oriented Communication RPC and message-oriented communication are based on the exchange of discrete messagesTiming might affect performance, but not correctnessIn stream-oriented communication the message content (multimedia streams) must be delivered at a certain rate, as well as correctlye.g., music or video
15Discrete and Continuous Media Media: means by which information is conveyedTypes of mediaDiscrete mediaNo temporal dependence between data itemsex) text, still images, object code or executable filesContinuous mediaTemporal dependence between data itemsex) Motion - series of images
16Data Streams Data stream = sequence of data items Can apply to discrete, as well as continuous mediae.g. UNIX pipes or TCP/IP connections which are both byte oriented (discrete) streamsMessages are related by send orderAudio and video require continuous time-based data streams
17Data StreamsAsynchronous transmission mode: the order is important, and data is transmitted one after the other, no restriction to when data is to be deliveredSynchronous transmission mode defines a maximum end-to-end delay for individual data packetsIsochronous transmission mode has a maximum and minimum end-to-end delay requirement (jitter is bounded)Not too slow, but not too fast either
26Figure The effect of packet loss in (a) non interleaved transmission and (b) interleaved transmission.
27Lip synchronization of audio and video streams Stereo audio with CD quality (two sequences of 16 bit samples)Sampling rate 44.1 KHz -> synchronize 22.6 micro secNTSC: short for National Television System CommitteeNTSC is the video system or standard used in North America and most of South America. In NTSC, 30 frames are transmitted each second. Each frame is made up of 525 individual scan lines.Lip synchronization of audio and video streamsVideo stream: NTSC standard of 30Hz (a frame every ms),Audio stream: CD Quality soundSynchronized every 1470 sound samples
28Synchronization Mechanisms(1) Figure. 2-40The principle of explicit synchronization on the data unitsSynchronization Mechanisms(1)read&write data units of several simple streamsadhere to specific timing and synchronization constraints
29For example, a movie composed of A video stream of low-quality images of 320x240 pixels, i.e., 76,800 bytes video data units;A audio stream: audio samples group into units of 11,760 bytes, each corresponding to 33 ms of audio;If the input process can handle 2.5 MB/sec, lip synchronization is achieved by alternating between reading an image and reading a block of audio samples every 33 ms.
30Synchronization Mechanisms(2) Figure. 2-41The principle of synchronization as supported by high-level interfacesSynchronization Mechanisms(2)Synchronization achieved by middleware according to application instructions, e.g., desired image display rate
31The principle of synchronization as supported by high-level interfaces Figure. 2-41The principle of synchronization as supported by high-level interfacesMPEG: moving picture expert groupMPEG is a standard for lossy compression of video and audio.MPEG transport stream (MPEG-TS, MTS or TS) is a standard format for transmission and storage of audio, video,