Distributed (Operating) Systems -Communication in Distributed Systems- Fall 2011 Kocaeli University Computer Engineering Department.

Slides:



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

Remote Procedure Call (RPC)
Remote Procedure Call Design issues Implementation RPC programming
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Last Class: RPCs and RMI
RPC Remote Procedure Call Dave Hollinger Rensselaer Polytechnic Institute Troy, NY.
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.
Tutorials 2 A programmer can use two approaches when designing a distributed application. Describe what are they? Communication-Oriented Design Begin with.
CS490T Advanced Tablet Platform Applications Network Programming Evolution.
Networking Theory (Part 1). Introduction Overview of the basic concepts of networking Also discusses essential topics of networking theory.
Computer Science Lecture 2, page 1 CS677: Distributed OS Last Class: Introduction Distributed Systems – A collection of independent computers that appears.
Outcomes What is RPC? The difference between conventional procedure call and RPC? Understand the function of client and server stubs How many steps could.
Netprog RPC Overview1 Distributed Program Design n Communication-Oriented Design –Design protocol first. –Build programs that adhere to the protocol.
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
TCP: Software for Reliable Communication. Spring 2002Computer Networks Applications Internet: a Collection of Disparate Networks Different goals: Speed,
.NET Mobile Application Development Remote Procedure Call.
EECS122 - UCB 1 CS 194: Distributed Systems Communication Protocols, RPC Computer Science Division Department of Electrical Engineering and Computer Sciences.
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
Communication. 4.1 Fundamentals 4.2 Remote Procedure Call 4.3 Message-oriented Communication 4.4 Stream-oriented Communication 4.5 Multicast Communication.
Introduction to Distributed Systems Slides for CSCI 3171 Lectures E. W
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.
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 1 Version 4.0 Network Services Networking for Home and Small Businesses – Chapter 6.
Introduction to Distributed Systems Slides for CSCI 3171 Lectures E. W. Grundke.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Chapter 4: Interprocess Communication‏ Pages
Dr. John P. Abraham Professor University of Texas Pan American Internet Applications and Network Programming.
Politecnico di Milano © 2001 William Fornaciari Operating Systems R P C Remote Procedure Call Lecturer: William Fornaciari Politecnico di Milano
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.
1 Conventional Procedure Call read(fd,buf,nbytes) a)Parameter passing in a local procedure call: the stack before the call to read b)The stack while the.
Distributed (Operating) Systems -Communication in Distributed Systems- Computer Engineering Department Distributed Systems Course Assoc. Prof. Dr. Ahmet.
Remote Procedure Call RPC
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
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.
COMP 655: Distributed/Operating Systems Summer 2011 Dr. Chunbo Chu Week 2, 3: Communication 1/30/20161Distributed Systems - COMP 655.
1 Chapter 2. Communication. STEMPusan National University STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered.
© 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.
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.
Communication in Distributed Systems. . The single most important difference between a distributed system and a uniprocessor system is the interprocess.
Introduction to Distributed Systems Slides for CSCI 3171 Lectures E. W. Grundke.
Last Class: Introduction
Prof. Leonardo Mostarda University of Camerino
Last Class: RPCs and RMI
4.1 Fundamentals COMMUNICATION: Advanced Operating Systems (CSc 8320)
Distributed Systems CS
CMSC621: Advanced Operating Systems Advanced Operating Systems
Communication Chapter 2.
CSE 451: Operating Systems Winter 2006 Module 20 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Lecture 4: RPC Remote Procedure Call Coulouris et al: Chapter 5
CSE 451: Operating Systems Winter 2007 Module 20 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Lecture 4: RPC Remote Procedure Call CDK: Chapter 5
CSE 451: Operating Systems Winter 2004 Module 19 Remote Procedure Call (RPC) Ed Lazowska Allen Center
CSE 451: Operating Systems Spring 2012 Module 22 Remote Procedure Call (RPC) Ed Lazowska Allen Center
CSE 451: Operating Systems Autumn 2009 Module 21 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Distributed Systems CS
CSE 451: Operating Systems Autumn 2010 Module 21 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Last Class: Communication in Distributed Systems
CSE 451: Operating Systems Messaging and Remote Procedure Call (RPC)
Communication.
Distributed Systems CS
Presentation transcript:

Distributed (Operating) Systems -Communication in Distributed Systems- Fall 2011 Kocaeli University Computer Engineering Department

Communication in Distributed Systems Communication is done through message passing Expressing communication through message passing is harder than using primitives based on shared memory Remote Procedure Calls – Transparency but poor for passing references – Ideal for client server applications Message-oriented Communication Stream-oriented Communication – Continuous media

Communication Between Processes Unstructured communication – Use shared memory or shared data structures Structured communication – Use explicit messages (IPCs) Distributed Systems: both need low-level communication support (why?)

Types of Communication -1 Transient Communication – A message is stored by the communication system only as long as the sending and the receiving application are executing – Typically all transport level communication is transient communication Persistent Communication – A message that has been submitted for transmission is kept by middleware as long as it takes to deliver it to the receiver – Receiving application don’t need to be executing when the message when the message is submitted

Types of Communication -2 Asynchronous Communication – Sender continues immediately after it has submitted its message for transmission – It means, message is temporarily stored in middleware upon submission Synchronous Communication – Sender is blocked until its request is known to be accepted – Three points Sender informs message is delivered Middleware informs message is delivered Sender informs with the response after processing

Types of Communication -3 Connection-oriented (telephone) – TCP Connectionless (mailbox – dropping a letter) – IP, UDP

Persistence and Synchronicity in Communication

Persistence Persistent communication – Messages are stored until (next) receiver is ready – Examples: , pony express

Transient Communication Transient communication – Message is stored only so long as sending/receiving application are executing – Discard message if it can’t be delivered to next server/receiver – Example: transport-level communication services offer transient communication – Example: Typical network router – discard message if it can’t be delivered next router or destination

Synchronicity Asynchronous communication – Sender continues immediately after it has submitted the message – Need a local buffer at the sending host Synchronous communication – Sender blocks until message is stored in a local buffer at the receiving host or actually delivered to sending – Variant: block until receiver processes the message Six combinations of persistence and synchronicity

Persistence and Synchronicity Combinations a) Persistent asynchronous communication (e.g., ) b) Persistent synchronous communication

Persistence and Synchronicity Combinations c) Transient asynchronous communication (e.g., UDP) d) Receipt-based transient synchronous communication

Persistence and Synchronicity Combinations e) Delivery-based transient synchronous communication at message delivery (e.g., asynchronous RPC) f) Response-based transient synchronous communication (RPC)

Layered Protocols 1 Communication messaging rules are defined in protocols Due to the absence of shared memory, all communication in distributed systems is based on sending and receiving (low-level) messages Many different agreements – IBM’s EBCDIC and ASCII – How many volts should be used to signal 0 – How does the receiver know which is the last bit – How can the receiver detect if a message has been damaged

Layered Protocols 2 ISO/OSI never widely used and are essentially dead. In the OSI model communication is divided up into 7 layers OSI layers were never popular. In contrast, protocols developed for the internet, such as TCO and IP, are mostly used

Communication Protocols There are some rules that communicating processes must adhere to – known as protocols Protocols are agreements/rules on communication Protocols could be connection-oriented or connectionless

Layered Protocols A typical message as it appears on the network.

Layers -1 Physical layer – Transmitting 0s and 1s – How many bits per sec transfer – Can transmission take place in both direction Data Link Layer – Puts special bit pattern on the start and end of each frame – Computing checksum Network Layer – Routing

Layers -2 Transport Protocol – Turns the underlying network into something than an application developer can use – Messages from the application is broken into small pieces- packets – Which packets have been sent, which have been received, which should be retransmitted – Connection-oriented: messages arrive in the same order (as in TCP) – Connectionless: message can arrive in different order (as in UDP) – Another example of transport protocol is RTP – The combination of TCP/IP is now used as a de facto standard for network communication

Client-Server TCP

Layers -3 Session Layer – Enhanced version if transport layer – Keeps track of which party is currently talking and it provides a synchronization – Puts checking points – in case of crash going to the last check point Presentation Layer – Concerned with the meaning of the bits

Middleware Protocols Middleware: layer that resides between an OS and an application – May implement general-purpose protocols that warrant their own layers

OSI Model summary In this model, clear distinction between applications, application-specific protocols and general purpose protocols. Application-specific protocol – FTP – HTTP General-purpose protocols – Useful to many applications but cannot be qualified as transport protocols. These protocols fall into the category of middleware protocols.

Middleware Protocols 1 Some services are not tied to any specific applications, but instead can be integrated into a middleware system as a general service – Authentication protocols Proof of claimed identity – Atomicity protocols Widely applied in transactions – Distributed locking protocols Resources can be protected against simultaneous accesses

Middleware Protocols 2 Also supports high-level communication services – Remote Procedure Call (RPC) – Message Oriented Middleware (MOM) – RTP: Streams for transferring real-time data, such as needed for multimedia applications

Remote Procedure Calls Goal: Make distributed computing look like centralized computing Allow remote services to be called as procedures – Transparency with regard to location, implementation, language Issues – How to pass parameters – Bindings – Semantics in face of errors

Example of an RPC No message passing at all is visible to the programmer.

Divide programs up and add communication protocols blah, blah, blah bar = add(i,j); blah, blah, blah bar = add(i,j); blah, blah, blah Int add(int x, int y ) { if (x>100) return(y-2); else if (x>10) return(y-x); else return(x+y); } Int add(int x, int y ) { if (x>100) return(y-2); else if (x>10) return(y-x); else return(x+y); }ClientServer protocol

RPC Semantics Principle of RPC between a client and server program [Birrell&Nelson 1984]

Other RPC Models Asynchronous RPC – Request-reply behavior often not needed – Server can reply as soon as request is received and execute procedure later Deferred-synchronous RPC – Use two asynchronous RPCs – Client needs a reply but can’t wait for it; server sends reply via another asynchronous RPC One-way RPC – Client does not even wait for an ACK from the server – Limitation: reliability not guaranteed (Client does not know if procedure was executed by the server).

Asynchronous RPC a)The interconnection between client and server in a traditional RPC b)The interaction using asynchronous RPC

Deferred Synchronous RPC A client and server interacting through two asynchronous RPCs

Conventional Procedure Call a) Parameter passing in a local procedure call: the stack before the call to read b) The stack while the called procedure is active Count = read(fd, buf, nbytes)

Possible Issues Calling and called procedures run on different machines They execute in different address spaces Parameters and results have to be passed, it can be complicated when the machines are not identical. – How do you represent integers – big-endian little- endian Either or both machines can crash and each of the possible failures causes different problems.

Parameter Passing Local procedure parameter passing – Call-by-value – Call-by-reference: arrays, complex data structures No sense BUT in RMI it is OK Remote procedure calls simulate this through: – Stubs – proxies – Flattening – marshalling Related issue: global variables are not allowed in RPCs

Client and Server Stubs Client makes procedure call (just like a local procedure call) to the client stub Server is written as a standard procedure Stubs take care of packaging arguments and sending messages Packaging parameters is called marshalling Stub compiler generates stub automatically from specs in an Interface Definition Language (IDL) – Simplifies programmer task

Steps of a Remote Procedure Call 1.Client procedure calls client stub in normal way 2.Client stub builds message, calls local OS 3.Client's OS sends message to remote OS 4.Remote OS gives message to server stub 5.Server stub unpacks parameters, calls server 6.Server does work, returns result to the stub 7.Server stub packs it in message, calls local OS 8.Server's OS sends message to client's OS 9.Client's OS gives message to client stub 10.Stub unpacks result, returns to client

Marshalling Problem: different machines have different data formats – Intel: little endian, SPARC: big endian Solution: use a standard representation – Example: external data representation (XDR)

Binding Problem: how does a client locate a server? – Use Bindings Server – Export server interface during initialization – Send name, version no, unique identifier, handle (address) to binder Client – First RPC: send message to binder to import server interface – Binder: check to see if server has exported interface Return handle and unique identifier to client

Binder: Port Mapper Server start-up: create port Server stub calls svc_register to register prog #, version # with local port mapper Port mapper stores prog #, version #, and port Client start-up: call clnt_create to locate server port Upon return, client can call procedures at the server

Case Study: SUNRPC One of the most widely used RPC systems Developed for use with NFS Built on top of UDP or TCP Multiple arguments marshaled into a single structure At-least-once semantics if reply received, at-least-zero semantics if no reply. With UDP tries at-most-once Use SUN’s eXternal Data Representation (XDR) – Big endian order for 32 bit integers, handle arbitrarily large data structures XDR was originally designed for specifying eXternal Data Representation XDR has been extended to become Sun RPC IDL An interface contains a program number, version number, procedure definition and required type definitions

Rpcgen: generating stubs Q_xdr.c: do XDR conversion Detailed example: later in this course