Hwajung Lee ITEC452 Distributed Computing Lecture 2 Interprocess Communication (IPC): An Overview.

Slides:



Advertisements
Similar presentations
DISTRIBUTED COMPUTING PARADIGMS
Advertisements

Mobile Agents Mouse House Creative Technologies Mike OBrien.
1 Understanding Web Services Presented By: Woodas Lai.
RPC Robert Grimm New York University Remote Procedure Calls.
Remote Procedure Call Design issues Implementation RPC programming
Chorus Vs Unix Operating Systems Overview Introduction Design Principles Programmer Interface User Interface Process Management Memory Management File.
Tam Vu Remote Procedure Call CISC 879 – Spring 03 Tam Vu March 06, 03.
Distributed components
Notes to the presenter. I would like to thank Jim Waldo, Jon Bostrom, and Dennis Govoni. They helped me put this presentation together for the field.
Distributed Systems Lecture #3: Remote Communication.
CS490T Advanced Tablet Platform Applications Network Programming Evolution.
Sockets  Defined as an “endpoint for communication.”  Concatenation of IP address + port.  Used for server-client communication.  Server waits for.
1. Introducing Java Computing  What is Java Computing?  Why Java Computing?  Enterprise Java Computing  Java and Internet Web Server.
Systems Architecture, Fourth Edition1 Internet and Distributed Application Services Chapter 13.
2 Systems Architecture, Fifth Edition Chapter Goals Describe client/server and multi-tier application architecture and discuss their advantages compared.
Process-to-Process Delivery:
Chapter 9 Message Passing Copyright © Operating Systems, by Dhananjay Dhamdhere Copyright © Operating Systems, by Dhananjay Dhamdhere2 Introduction.
Jozef Goetz, Application Layer PART VI Jozef Goetz, Position of application layer The application layer enables the user, whether human.
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
Lecture 15 Introduction to Web Services Web Service Applications.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
DISTRIBUTED COMPUTING PARADIGMS. Paradigm? A MODEL 2for notes
Copyright © George Coulouris, Jean Dollimore, Tim Kindberg This material is made available for private study and for direct.
1. I NTRODUCTION TO N ETWORKS Network programming is surprisingly easy in Java ◦ Most of the classes relevant to network programming are in the java.net.
Distributed Computing A Programmer’s Perspective.
Hwajung Lee.  Interprocess Communication (IPC) is at the heart of distributed computing.  Processes and Threads  Process is the execution of a program.
AMQP, Message Broker Babu Ram Dawadi. overview Why MOM architecture? Messaging broker like RabbitMQ in brief RabbitMQ AMQP – What is it ?
Seminar on Service Oriented Architecture Distributed Systems Architectural Models From Coulouris, 5 th Ed. SOA Seminar Coulouris 5Ed.1.
Web Services An Introduction Copyright © Curt Hill.
Distributed Computing Paradigms1. 2 Paradigms for Distributed Applications Paradigm means “a pattern, example, or model.” In the study of any subject.
TCP/IP1 Address Resolution Protocol Internet uses IP address to recognize a computer. But IP address needs to be translated to physical address (NIC).
Distributed Computing & Embedded Systems Chapter 4: Remote Method Invocation Dr. Umair Ali Khan.
Object Interaction: RMI and RPC 1. Overview 2 Distributed applications programming - distributed objects model - RMI, invocation semantics - RPC Products.
CORBA Antonio Vasquez, John Shelton, Nidia, Ruben.
Object Interaction: RMI and RPC 1. Overview 2 Distributed applications programming - distributed objects model - RMI, invocation semantics - RPC Products.
Java Web Services Orca Knowledge Center – Web Service key concepts.
Internet and Distributed Application Services
Last Class: Introduction
03 – Remote invoaction Request-reply RPC RMI Coulouris 5
WEB SERVICES From Chapter 19 of Distributed Systems Concepts and Design,4th Edition, By G. Coulouris, J. Dollimore and T. Kindberg Published by Addison.
Definition of Distributed System
Chapter 3 Internet Applications and Network Programming
CS533 Concepts of Operating Systems
MCA – 405 Elective –I (A) Java Programming & Technology
CORBA Alegria Baquero.
File System Implementation
Net 323 D: Networks Protocols
CHAPTER 3 Architectures for Distributed Systems
#01 Client/Server Computing
Knowledge Byte In this section, you will learn about:
Overview of Web Services
Inventory of Distributed Computing Concepts and Web services
CORBA Alegria Baquero.
Lecture 4: RPC Remote Procedure Call Coulouris et al: Chapter 5
Hwajung Lee ITEC452 Distributed Computing Lecture 7 Interprocess Communication (IPC): An Overview.
Process-to-Process Delivery:
Net 323 D: Networks Protocols
Lecture 4: RPC Remote Procedure Call CDK: Chapter 5
Channels.
Creating a Distributed System with Remote Procedure Calls and Web Services Ch.5 B.Ramamurthy 2/17/2019 B.Ramamurthy.
JINI ICS 243F- Distributed Systems Middleware, Spring 2001
WEB SERVICES From Chapter 19, Distributed Systems
Channels.
Remote invocation (call)
Channels.
Process-to-Process Delivery: UDP, TCP
Distributed System using Web Services
Last Class: Communication in Distributed Systems
Exceptions and networking
#01 Client/Server Computing
Presentation transcript:

Hwajung Lee ITEC452 Distributed Computing Lecture 2 Interprocess Communication (IPC): An Overview

Introduction to IPC (1) Interprocess Communication (IPC) is at the heart of distributed computing. Processes and Threads Process is the execution of a program Threads are lightweight processes Like a process, each thread maintains a separate flow of control, but threads share a common address space

Introduction to IPC (2) Client-Server Model a widely accepted model for designing distributed system Example: a search engine like Google®

Introduction to IPC (3) Middleware Processes, processors, and objects may be scattered anywhere in a network. From developing distributed applications, transparency is a desirable property. The layer of software that makes it possible is called middleware. Applications Middleware OS of Machine 1 OS of Machine 2 OS of Machine 3 Network

Introduction to IPC (4) Some important middleware services address the following issues: How does a process locate another named process or object anywhere on the Internet? How does a process in the application layer communicate with another process anywhere on the Internet? How to isolate the application programs from differences in programming languages and communication protocols? How is the security of the communication guaranteed without any knowledge about the trustworthiness of the operating systems at the two endpoints?

Four General Approaches of IPC Shared Memory Messages Pipes Sockets

Shared Memory Two or several processes can map a segment of their virtual space into an identical segment of physical memory. Shared memory is the most efficient way of IPC But it may require synchronization Octal number (0-7) http://linux.die.net/man/2/shmget shmget - allocates a shared memory segment Synopsis #include <sys/ipc.h> #include <sys/shm.h> int shmget(key_t key, size_t size, int shmflg); Description shmget() returns the identifier of the shared memory segment associated with the value of the argument key. A new shared memory segment, with size equal to the value of size rounded up to a multiple of PAGE_SIZE, is created if key has the valueIPC_PRIVATE or key isn't IPC_PRIVATE, no shared memory segment corresponding to key exists, and IPC_CREAT is specified in shmflg. If shmflg specifies both IPC_CREAT and IPC_EXCL and a shared memory segment already exists for key, then shmget() fails witherrno set to EEXIST. (This is analogous to the effect of the combination O_CREAT | O_EXCL for open(2).) The value shmflg is composed of: IPC_CREATto create a new segment. If this flag is not used, then shmget() will find the segment associated with key and check to see if the user has permission to access the segment. IPC_EXCL used with IPC_CREAT to ensure failure if the segment already exists. mode_flags (least significant 9 bits) specifying the permissions granted to the owner, group, and world. These bits have the same format, and the same meaning, as the mode argument of open(2). Presently, the execute permissions are not used by the system. Image Source: http://medusa.sdsu.edu/cs570/Lectures/Chapter9.pdf

Messages (1) Most distributed applications are implemented using message passing. Messages are less efficient than shared memory (require buffering and synchronization), but sometimes are more suitable due to the built-in synchronization Image Source: http://medusa.sdsu.edu/cs570/Lectures/Chapter9.pdf

Messages (2) The messaging layer is logically located just above the TCP/IP or the UDP/IP layer, but below the application layer. The implementation of sockets at the TCP or the UDP layer helps processes address one another using specific socket addresses. Image Source: http://medusa.sdsu.edu/cs570/Lectures/Chapter9.pdf

Messages (3) Two Types of Messages Transient Messages A message is lost unless the receiver is active at the time of the message delivery and retrieves it during the life of the application Persistent Messages Messages are not lost, but saved in a buffer at the time of message delivery

Messages (4) Stream Sequence of data items. Communication using streams requires a connection establishment between a sender of a receiver

Pipes (1) Pipes are implemented in file system. Pipes are basically files with only two file offsets: one for reading, another for writing. Writing to a pipe and reading from a pipe is strictly in FIFO manner. Image Source: http://medusa.sdsu.edu/cs570/Lectures/Chapter9.pdf

Pipes (2) Two Types of Pipes Anonymous (Unnamed) Pipes Named Pipes Named pipes http://en.wikipedia.org/wiki/Named_pipe For example, one can create a pipe and set up gzip to compress things piped to it: mkfifo my_pipe gzip -9 -c < my_pipe > out.gz & In a separate process shell, independently, one could send the data to be compressed: cat file > my_pipe The named pipe can be deleted just like any file: rm my_pipe Unidirectional To communicate two related processes in both directions, two anonymous pipes must be created. Full-duplex or half-duplex Image Source: http://medusa.sdsu.edu/cs570/Lectures/Chapter9.pdf For example, one can create a pipe and set up gzip to compress things piped to it: mkfifo my_pipe gzip -9 -c < my_pipe > out.gz &

Sockets (1) Sockets are abstract endpoints of communication between a pair of processes. originally used in BSD 4.2 (1983) by now widely accepted in other operating systems. typically used in server/client communication. Note: BSD (Berkeley Software Distribution) Image Source: http://medusa.sdsu.edu/cs570/Lectures/Chapter9.pdf

Sockets (2) Sockets are typically used in server/client communication: server creates socket and binds it to a communication port and waits for connection request from a client (passive role - waits for client to initiate the connection). Client also creates a socket of the same type, then requests a connection to the known port on the known machine (active role - client initiates the connection). Once the server accepts the client's connection request, it will create another socket and bind it to another port, which will be used for further communication with the client. Once this is done, data can flow between the client's socket and the server's second socket. The server's first socket remains open, waiting requests from new clients. Waiting for new requests and communicating with clients with established connection is normally done through different threads (see diagram on the page 9-19). Image Source: http://medusa.sdsu.edu/cs570/Lectures/Chapter9.pdf

More IPCs (1) Remote Procedure Call (RPC) A procedure call that helps a client communicate with a server running on a different machine that may belong to a different network and a different administrative domain The task of packing the parameters of the call into a message is called parameter marshalling. Remote Method Invocation (RMI) A generalization of RPC in an object-oriented environment.

More IPCs (2) Web Services Most web services are based on XML that is widely used for cross-platform data communication including: Simple Object Access Protocol (SOAP) SOAP allows a one-way message containing a structured data to be sent from one process to another using any transport protocol like TCP.

More IPCs (3) Web Service Description Language (WSDL) It describes the public interface to the web service. An XML-based service description that explains how a client should communicate using the web service Universal Description Discovery, and Integration specification (UDDI) Java Web Services

More IPCs (4) Event Notification Event notification systems help establish a form of asynchronous communication among distributed objects on heterogeneous platforms. Jini®, also called Apache River, a product of Sun Microsystems, provides event notification service for Java-based platforms. It allows subscribers in one JVM to receive notification of events of interest from another JVM.

More IPCs (5) Common Object Request Broker Architecture (CORBA) The framework of a middleware that enables clients to transparently access remote objects across a distributed computing platform, regardless of the machines on which they are running or the language in which they are written. Its specifications were drown by the Object Management Group (OMG) consisting of some 700 companies. The core of CORBA is the Object Request Broker (ORB). www.corba.org

More IPCs (6) Mobile Agents A piece of code that migrates from one machine to another. The code, which is an executable program, is called a script Agents carry data values or procedure arguments or results across machines The use of an interpretable language like Tcl makes it easy to support mobile agent based communication on heterogeneous platforms.

More IPCs (7) Basic Group Communication Services With the rapid growth of the World Wide Web and electronic commerce, group oriented activities have substantially increased in recent years. Multicasts are useful in the implementation of specific group service.