Distributed Systems Principles and Paradigms Chapter 02 Communication 00 – 1.

Slides:



Advertisements
Similar presentations
1 Communication in Distributed Systems REKs adaptation of Tanenbaums Distributed Systems Chapter 2.
Advertisements

Chapter 4: Communication*
Remote Procedure Call (RPC)
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Last Class: RPCs and RMI
Tam Vu Remote Procedure Call CISC 879 – Spring 03 Tam Vu March 06, 03.
Remote Procedure CallCS-4513, D-Term Remote Procedure Call CS-4513 Distributed Computing Systems (Slides include materials from Operating System.
Remote Object Invocation
EECS122 - UCB 1 CS 194: Distributed Systems Remote Object Invocation, Message- Oriented Communications (Based on textbook slides) Computer Science Division.
Tutorials 2 A programmer can use two approaches when designing a distributed application. Describe what are they? Communication-Oriented Design Begin with.
CS 582 / CMPE 481 Distributed Systems Communications.
Socket Programming.
Persistent and Transient Objects Persistent objects continue to exist even if they aren’t in the address space of a server process Transient objects existence.
CS 582 / CMPE 481 Distributed Systems Communications (cont.)
CS 582 / CMPE 481 Distributed Systems Communications (cont.)
Chapter 2  Communication 1 Communication Chapter 2.
Chapter 15 – Part 2 Networks The Internal Operating System The Architecture of Computer Hardware and Systems Software: An Information Technology Approach.
Protocols and the TCP/IP Suite
Computer Science Lecture 2, page 1 CS677: Distributed OS Last Class: Introduction Distributed Systems – A collection of independent computers that appears.
Communication in Distributed Systems –Part 2
EECE 411: Design of Distributed Software Applications What is a Distributed System? You know when you have one … … when the failure of a computer you’ve.
Univ. of TehranDistributed Operating Systems1 Advanced Operating Systems University of Tehran Dept. of EE and Computer Engineering By: Dr. Nasser Yazdani.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
EEC-681/781 Distributed Computing Systems Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
An adapted reference model for networked communication.
Message-Oriented Communication Synchronous versus asynchronous communications Message-Queuing System Message Brokers Example: IBM MQSeries 02 – 26 Communication/2.4.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
CS-495 Distributed Systems Fabián E. Bustamante, Winter 2004 Communication Networking RPC and Relatives Distributed Objects Message- & Stream-Oriented.
Protocols and the TCP/IP Suite Chapter 4. Multilayer communication. A series of layers, each built upon the one below it. The purpose of each layer is.
Process-to-Process Delivery:
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Presentation on Osi & TCP/IP MODEL
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Communication. 4.1 Fundamentals 4.2 Remote Procedure Call 4.3 Message-oriented Communication 4.4 Stream-oriented Communication 4.5 Multicast Communication.
1 Chapter 2. Communication. STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered Protocol But some other protocols.
Communication Tran, Van Hoai Department of Systems & Networking Faculty of Computer Science & Engineering HCMC University of Technology.
Support for continuous media Streams in distributed systems Stream management Stream-Oriented Communication 02 – 36 Communication/2.5 Stream-Oriented Communication.
1 CS 6823 ASU Message-Queuing Model The underlying system takes care of fragmenting and assembling large messages Put: nonblocking call Get:
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
Distributed Systems Principles and Paradigms Chapter 02 Communication 00 – 1.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Chapter 15 – Part 2 Networks The Internal Operating System The Architecture of Computer Hardware and Systems Software: An Information Technology Approach.
1 Lecture 5 (part2) : “Interprocess communication” n reasons for process cooperation n types of message passing n direct and indirect message passing n.
3.1 Silberschatz, Galvin and Gagne ©2009Operating System Concepts with Java – 8 th Edition Chapter 3: Processes.
 Remote Procedure Call (RPC) is a high-level model for client-sever communication.  It provides the programmers with a familiar mechanism for building.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved RPC Tanenbaum.
CSE 451: Operating Systems Winter 2015 Module 22 Remote Procedure Call (RPC) Mark Zbikowski Allen Center 476 © 2013 Gribble, Lazowska,
Chapter 5: Distributed objects and remote invocation Introduction Remote procedure call Events and notifications.
 Communication Distributed Systems IT332. Outline  Fundamentals  Layered network communication protocols  Types of communication  Remote Procedure.
Distributed (Operating) Systems -Communication in Distributed Systems- Computer Engineering Department Distributed Systems Course Assoc. Prof. Dr. Ahmet.
Remote Procedure Call RPC
Distributed systems (NET 422) Prepared by Dr. Naglaa Fathi Soliman Princess Nora Bint Abdulrahman University College of computer.
Communication Chapter 2.
Computer Science Lecture 3, page 1 CS677: Distributed OS Last Class: Communication in Distributed Systems Structured or unstructured? Addressing? Blocking/non-blocking?
OS2-SUT– Sem ; R. Jalili Communication Chapter 2.
1 Chapter 2. Communication. STEMPusan National University STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered.
1 Kyung Hee University Chapter 11 User Datagram Protocol.
© Oxford University Press 2011 DISTRIBUTED COMPUTING Sunita Mahajan Sunita Mahajan, Principal, Institute of Computer Science, MET League of Colleges, Mumbai.
Computer Science Lecture 4, page 1 CS677: Distributed OS Last Class: RPCs RPCs make distributed computations look like local computations Issues: –Parameter.
Communication Chapter 2. Layered Protocols (1) Layers, interfaces, and protocols in the OSI model. 2-1.
Distributed Computing & Embedded Systems Chapter 4: Remote Method Invocation Dr. Umair Ali Khan.
OS2-Sharif University of Technology - Sem ; R. Jalili Communication Chapter 2.
Object Interaction: RMI and RPC 1. Overview 2 Distributed applications programming - distributed objects model - RMI, invocation semantics - RPC Products.
Prof. Leonardo Mostarda University of Camerino
Last Class: RPCs and RMI
Communication Chapter 2.
DISTRIBUTED COMPUTING
Lecture 4: RPC Remote Procedure Call Coulouris et al: Chapter 5
Process-to-Process Delivery:
Lecture 4: RPC Remote Procedure Call CDK: Chapter 5
Presentation transcript:

Distributed Systems Principles and Paradigms Chapter 02 Communication 00 – 1

Layered Protocols –Low-level layers –Transport layer –Application layer –Middleware layer Remote procedure call (RPC) Sun RPC DCE & DCE RPC Remote Method Invocation Message-Oriented Communication Stream-Oriented Communication 02 – 1 Communication/2.1 Layered Protocols

Basic Networking Model Open Systems Interconnection Reference Model (Zimmerman, 1983) Also called ISO OSI or OSI Model ISO – International Standards Organization 02 – 2 Communication/2.1 Layered Protocols

Low-level layers Physical layer: contains the specification and implementation of bits, and their transmission between sender and receiver Data link layer: prescribes the transmission of a series of bits into a frame to allow for error and flow control Network layer: describes how packets in a network of computers are to be routed. Observation: for many distributed systems, the lowest level interface is that of the network layer. 02 – 3 Communication/2.1 Layered Protocols

Transport Layer Important: The transport layer provides the actual communication facilities for most distributed systems. Standard Internet protocols: TCP: connection-oriented, reliable, stream-oriented communication UDP: unreliable (best-effort) datagram communication Note: IP multicasting is generally considered a standard available service. 02 – 4 Communication/2.1 Layered Protocols

Client–Server TCP 02 – 5 Communication/2.1 Layered Protocols TCP for transactions (T/TCP): A transport protocol aimed to support client–server interaction Normal operation of TCP Transactional TCP

Application Layer Observation: Many application protocols are directly implemented on top of transport protocols, doing a lot of application- independent work. 02 – 6 Communication/2.1 Layered Protocols

Middleware Layer A rich set of communication protocols, but which allow different applications to communicate Marshaling and unmarshaling of data, necessary for integrated systems Naming protocols, so that different applications can easily share resources Security protocols, to allow different applications to communicate in a secure way Scaling mechanisms, such as support for replication and caching 02 – 7 Communication/2.1 Layered Protocols Observation: Middleware is invented to provide common services and protocols that can be used by many different applications:

Remote Procedure Call (RPC) Basic RPC operation Parameter passing Variations 02 – 8 Communication/2.2 Remote Procedure Call

Basic RPC Operation Observations: Application developers are familiar with simple procedure model Well-engineered procedures operate in isolation (black box) There is no fundamental reason not to execute procedures on separate machines Conclusion: communication between caller & callee can be hidden by using procedure-call mechanism. 02 – 9 Communication/2.2 Remote Procedure Call

RPC Implementation (1/2) Local procedure call: 1: Push parameter values of the procedure on a stack 2: Call procedure 3: Use stack for local variables 4: Pop results (in parameters) Principle: “communication” with local procedure is handled by copying data to/from the stack (with a few exceptions) 02 – 10 Communication/2.2 Remote Procedure Call

RPC Implementation (2/2) 02 – 11 Communication/2.2 Remote Procedure Call Steps involved in doing a remote “add” operation

RPC: Parameter Passing (1/2) Parameter marshaling: There’s more than just wrapping parameters into a message: Client and server machines may have different data representations (think of byte ordering) Wrapping a parameter means transforming a value into a sequence of bytes Client and server have to agree on the same encoding: –How are basic data values represented (integers, floats, characters)? –How are complex data values represented (arrays, unions)? Client and server need to properly interpret messages, transforming them into machine-dependent representations. 02 – 12 Communication/2.2 Remote Procedure Call

RPC: Parameter Passing (2/2) RPC parameter passing: RPC assumes copy in/copy out semantics: while procedure is executed, nothing can be assumed about parameter values. RPC assumes all data that is to be operated on is passed by parameters. Excludes passing references to (global) data. Conclusion: full access transparency cannot be realized. Observation: If we introduce a remote reference mechanism, access transparency can be enhanced: Remote reference offers unified access to remote data Remote references can be passed as parameter in RPCs 02 – 13 Communication/2.2 Remote Procedure Call

Local RPCs: Doors Essence: Try to use the RPC mechanism as the only mechanism for interprocess communication (IPC). Doors are RPCs implemented for processes on the same machine. 02 – 14 Communication/2.2 Remote Procedure Call

Asynchronous RPCs 02 – 15 Communication/2.2 Remote Procedure Call Essence: Try to get rid of the strict request-reply behavior, but let the client continue without waiting for an answer from the server. Variation: deferred synchronous RPC:

RPC in Practice Essence: Let the developer concentrate on only the client- and server-specific code; let the RPC system (generators and libraries) do the rest. 02 – 16 Communication/2.2 Remote Procedure Call

Issues: (1) Client must locate server machine, and (2) locate the server. Read Introduction to DCE in Section Example: DCE uses a separate daemon for each server machine. Client-to-Server Binding (DCE) 02 – 17 Communication/2.2 Remote Procedure Call

Remote Object Invocation Distributed objects Remote method invocation Parameter passing 02 – 18 Communication/2.3 Remote Object Invocation

Remote Distributed Objects (1/2) 02 – 19 Communication/2.3 Remote Object Invocation Data and operations encapsulated in an object Operations are implemented as methods, and are accessible through interfaces Object offers only its interface to clients Object server is responsible for a collection of objects Client stub (proxy) implements interface Server skeleton handles (un)marshaling and object invocation

Remote Distributed Objects (2/2) Compile-time objects: Language-level objects, from which proxy and skeletons are automatically generated. Runtime objects: Can be implemented in any language, but require use of an object adapter that makes the implementation appear as an object. Transient objects: live only by virtue of a server: if the server exits, so will the object. Persistent objects: live independently from a server: if a server exits, the object’s state and code remain (passively) on disk. 02 – 20 Communication/2.3 Remote Object Invocation

Client-to-Object Binding (1/2) Object reference: Having an object reference allows a client to bind to an object: Reference denotes server, object, and communication protocol Client loads associated stub code Stub is instantiated and initialized for specific object Two ways of binding: Implicit: Invoke methods directly on the referenced object Explicit: Client must first explicitly bind to object before invoking it 02 – 21 Communication/2.3 Remote Object Invocation

Client-to-Object Binding (2/2) Some remarks: Reference may contain a URL pointing to an implementation file (Server, object) pair is enough to locate target object We need only a standard protocol for loading and instantiating code Observation: Remote-object references allow us to pass references as parameters. This was difficult with ordinary RPCs. 02 – 22 Communication/2.3 Remote Object Invocation

Remote Method Invocation Basics: (Assume client stub and server skeleton are in place) Client invokes method at stub Stub marshals request and sends it to server Server ensures referenced object is active: –Create separate process to hold object –Load the object into server process Request is unmarshaled by object’s skeleton, and referenced method is invoked If request contained an object reference, invocation is applied recursively (i.e., server acts as client) Result is marshaled and passed back to client Client stub unmarshals reply and passes result to client application 02 – 23 Communication/2.3 Remote Object Invocation

RMI: Parameter Passing (1/2) Object reference: Much easier than in the case of RPC: Server can simply bind to referenced object, and invoke methods Unbind when referenced object is no longer needed Object-by-value: A client may also pass a complete object as parameter value: An object has to be marshaled: –Marshall its state –Marshall its methods, or give a reference to where an implementation can be found Server unmarshals object. Note that we have now created a copy of the original object. Object-by-value passing tends to introduce nasty problems 02 – 24 Communication/2.3 Remote Object Invocation

RMI: Parameter Passing (2/2) Question: What’s an alternative implementation for a remote-object reference? 02 – 25 Communication/2.3 Remote Object Invocation Passing of an object by reference or by value

Message-Oriented Communication Synchronous versus asynchronous communications Message-Queuing System Message Brokers Example: IBM MQSeries 02 – 26 Communication/2.4 Message-Oriented Communication

Synchronous Communication Some observations: Client/Server computing is generally based on a model of synchronous communication: Client and server have to be active at the time of communication Client issues request and blocks until it receives reply Server essentially waits only for incoming requests, and subsequently processes them Drawbacks of synchronous communication: Client cannot do any other work while waiting for reply Failures have to be dealt with immediately (the client is waiting) In many cases the model is simply not appropriate (mail, news) 02 – 27 Communication/2.4 Message-Oriented Communication

Asynchronous Communication: Messaging Message-oriented middleware: Aims at high-level asynchronous communication: –Processes send each other messages, which are queued –Sender need not wait for immediate reply, but can do other things –Middleware often ensures fault tolerance 02 – 28 Communication/2.4 Message-Oriented Communication

Persistent vs. Transient Communication Persistent communication: A message is stored at a communication server as long as it takes to deliver it at the receiver. Transient communication: A message is discarded by a communication server as soon as it cannot be delivered at the next server, or at the receiver. 02 – 29 Communication/2.4 Message-Oriented Communication

Messaging Combinations 02 – 30 Communication/2.4 Message-Oriented Communication

Message-Oriented Middleware Essence: Asynchronous persistent communication through support of middleware-level queues. Queues correspond to buffers at communication servers. Canonical example: IBM MQSeries 02 – 31 Communication/2.4 Message-Oriented Communication

IBM MQSeries (1/3) Basic concepts: Application-specific messages are put into, and removed from queues Queues always reside under the regime of a queue manager Processes can put messages only in local queues, or through an RPC mechanism Message transfer: Messages are transferred between queues Message transfer between queues at different processes, requires a channel At each endpoint of channel is a message channel agent –Setting up channels using lower-level network communication facilities (e.g., TCP/IP) –(Un)wrapping messages from/in transport-level packets –Sending/receiving packets 02 – 32 Communication/2.4 Message-Oriented Communication

IBM MQSeries (2/3) Channels are inherently unidirectional MQSeries provides mechanisms to automatically start MCAs when messages arrive, or to have a receiver set up a channel Any network of queue managers can be created; routes are set up manually (system administration) 02 – 33 Communication/2.4 Message-Oriented Communication

02 – 34 Communication/2.4 Message-Oriented Communication IBM MQSeries (3/3) Routing: By using logical names, in combination with name resolution to local queues, it is possible to put a message in a remote queue Question: What’s a major problem here?

Message Broker 02 – 35 Communication/2.4 Message-Oriented Communication Observation: Message queuing systems assume a common messaging protocol: all applications agree on message format (i.e., structure and data representation) Message broker: Centralized component that takes care of application heterogeneity in a message-queuing system: Transforms incoming messages to target format, possibly using intermediate representation May provide subject-based routing capabilities Acts very much like an application gateway

Support for continuous media Streams in distributed systems Stream management Stream-Oriented Communication 02 – 36 Communication/2.5 Stream-Oriented Communication

Continuous Media Observation: All communication facilities discussed so far are essentially based on a discrete, that is time independent exchange of information Continuous media: Characterized by the fact that values are time dependent: Audio Video Animations Sensor data (temperature, pressure, etc.) Transmission modes: Different timing guarantees with respect to data transfer: Asynchronous: no restrictions with respect to when data is to be delivered Synchronous: define a maximum end-to-end delay for individual data packets Isochronous: define a maximum and minimum end-to-end delay (jitter is bounded) 02 – 37 Communication/2.5 Stream-Oriented Communication

Definition: A (continuous) data stream is a connection-oriented communication facility that supports isochronous data transmission Some common stream characteristics: Streams are unidirectional. There is generally a single source, and one or more sinks Often, either the sink and/or source is a wrapper around hardware (e.g., camera, CD device, TV monitor, dedicated storage) Stream types: Simple: consists of a single flow of data, e.g., audio or video Complex: multiple data flows, e.g., stereo audio or combination audio/video 02 – 38 Communication/2.5 Stream-Oriented Communication Stream (1/2)

Stream (2/2) 02 – 39 Communication/2.5 Stream-Oriented Communication Issue: Streams can be set up between two processes at different machines, or directly between two different devices. Combinations are possible as well.

02 – 40 Communication/2.5 Stream-Oriented Communication Streams and QoS Essence: Streams are all about timely delivery of data. How do you specify this Quality of Service (QoS)? Make distinction between specification and implementation of QoS. Flow specification: Use a token-bucket model and express QoS in that model.

Implementing QoS Problem: QoS specifications translate to resource reservations in underlying communication system. There is no standard way of (1) QoS specs, (2) describing resources, (3) mapping specs to reservations. Approach: Use Resource reSerVation Protocol (RSVP) as first attempt. RSVP is a transport-level protocol. 02 – 41 Communication/2.5 Stream-Oriented Communication

Stream Synchronization Problem: Given a complex stream, how do you keep the different substreams in synch? Example: Think of playing out two channels, that together form stereo sound. Difference should be less than 20–30 µ sec! Alternative: multiplex all substreams into a single stream, and demultiplex at the receiver. Synchronization is handled at multiplexing/demultiplexing point (MPEG). 02 – 42 Communication/2.5 Stream-Oriented Communication