Subject Name: OPERATING SYSTEMS Subject Code: 10EC65

Slides:



Advertisements
Similar presentations
DISTRIBUTED COMPUTING PARADIGMS
Advertisements

1 Communication in Distributed Systems REKs adaptation of Tanenbaums Distributed Systems Chapter 2.
Processes Management.
IPC (Interprocess Communication)
©2009 Operačné systémy Procesy. 3.2 ©2009 Operačné systémy Process in Memory.
Inter Process Communication:  It is an essential aspect of process management. By allowing processes to communicate with each other: 1.We can synchronize.
Learning Objectives Understanding the difference between processes and threads. Understanding process migration and load distribution. Understanding Process.
© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.
Chapter 2: Application layer  2.1 Web and HTTP  2.2 FTP 2-1 Lecture 5 Application Layer.
02/02/2004CSCI 315 Operating Systems Design1 Interprocesses Communication Notice: The slides for this lecture have been largely based on those accompanying.
Chapter 3: Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts - 7 th Edition, Feb 7, 2006 Chapter 3: Processes Process Concept.
02/01/2010CSCI 315 Operating Systems Design1 Interprocess Communication Notice: The slides for this lecture have been largely based on those accompanying.
Chapter 4.1 Interprocess Communication And Coordination By Shruti Poundarik.
Chapter 30 Electronic Mail Representation & Transfer
Introduction 1 Lecture 7 Application Layer (FTP, ) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer Science & Engineering.
Introduction 1-1 Chapter 2 FTP & Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 IC322 Fall.
Electronic Mail (SMTP, POP, IMAP, MIME)
Chapter 17 Networking Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E William Stallings.
IT 424 Networks2 IT 424 Networks2 Ack.: Slides are adapted from the slides of the book: “Computer Networking” – J. Kurose, K. Ross Chapter 2: Application.
1 Computer Communication & Networks Lecture 27 Application Layer: Electronic mail and FTP Waleed.
Chapter 9 Message Passing Copyright © Operating Systems, by Dhananjay Dhamdhere Copyright © Operating Systems, by Dhananjay Dhamdhere2 Introduction.
What is a Protocol A set of definitions and rules defining the method by which data is transferred between two or more entities or systems. The key elements.
1 Chapter Client-Server Interaction. 2 Functionality  Transport layer and layers below  Basic communication  Reliability  Application layer.
Inter-Process Communication Mechanisms CSE331 Operating Systems Design.
Protocols and the TCP/IP Suite
Networks – Network Architecture Network architecture is specification of design principles (including data formats and procedures) for creating a network.
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 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
DISTRIBUTED COMPUTING PARADIGMS. Paradigm? A MODEL 2for notes
The Socket Interface Chapter 21. Application Program Interface (API) Interface used between application programs and TCP/IP protocols Interface used between.
3.1 Silberschatz, Galvin and Gagne ©2009Operating System Concepts with Java – 8 th Edition Chapter 3: Processes.
CE Operating Systems Lecture 13 Linux/Unix interprocess communication.
Hwajung Lee.  Interprocess Communication (IPC) is at the heart of distributed computing.  Processes and Threads  Process is the execution of a program.
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
 Process Concept  Process Scheduling  Operations on Processes  Cooperating Processes  Interprocess Communication  Communication in Client-Server.
1 Network Communications A Brief Introduction. 2 Network Communications.
© MMII JW RyderCS 428 Computer Networks1 Electronic Mail  822, SMTP, MIME, POP  Most widely used application service  Sometimes only way a person ever.
What is a Protocol A set of definitions and rules defining the method by which data is transferred between two or more entities or systems. The key elements.
Last Class: Introduction
Chapter 3: Process Concept
Application layer 1 Principles of network applications 2 Web and HTTP
Operating System Concepts
CS533 Concepts of Operating Systems
Data Communications and Computer Networks Chapter 2 CS 3830 Lecture 9
Processes Overview: Process Concept Process Scheduling
Subject Name: Computer Communication Networks Subject Code: 10EC71
Subject Name: Computer Communication Networks Subject Code: 10EC71
CGS 3763 Operating Systems Concepts Spring 2013
Subject Name: Computer Communication Networks Subject Code: 10EC71
Applied Operating System Concepts
Data and Computer Communications by William Stallings Eighth Edition
Subject Name: Computer Communication Networks Subject Code: 10EC71
Chapter 4: Processes Process Concept Process Scheduling
Recap OS manages and arbitrates resources
Inter Process Communication (IPC)
Hwajung Lee ITEC452 Distributed Computing Lecture 7 Interprocess Communication (IPC): An Overview.
Process-to-Process Delivery:
CGS 3763 Operating Systems Concepts Spring 2013
Hwajung Lee ITEC452 Distributed Computing Lecture 2 Interprocess Communication (IPC): An Overview.
Chapter 15 – Part 2 Networks The Internal Operating System
Networking Theory (part 2)
William Stallings Data and Computer Communications
Typically for using the shared memory the processes should:
Process-to-Process Delivery: UDP, TCP
Chapter 2 Application Layer
Processes August 10, 2019 OS:Processes.
Exceptions and networking
Networking Theory (part 2)
Presentation transcript:

Subject Name: OPERATING SYSTEMS Subject Code: 10EC65 Prepared By: Kala H S and Remya R Department: ECE Date: 9/21/2018

Unit 8 MESSAGE PASSING 9/21/2018

TOPICS TO BE COVERED Overview of message passing Implementing message passing Mailboxes Inter process communication in UNIX 9/21/2018

Overview of Message Passing Ways in which processes interact with one another Control synchronization Data access synchronization Signals Message passing Differentiation between exchange of signals & message passing Signals have standard syntax & semantics Are used to implement pre-defined interactions between processes Messages does not have standard syntax & semantics It is up to the receiver to deduce its meaning 9/21/2018

An example of message passing Send makes a system call send with pj and the message as parameters At a send call by pi, the kernel checks if process pj is blocked on a receive call, in which case it copies the message into msg_area and activates pj. Processes may exist in the same computer or in different computers connected to a network Uses of message passing: Client-server paradigm Backbone of higher-level communication protocols Parallel and distributed programs 9/21/2018

Overview of Message Passing (continued) Two important issues in message passing are: Naming of processes Names may be explicitly indicated or deduced by the kernel in some manner Delivery of messages Whether sender should be blocked until delivery What the order is in which messages are delivered to a destination process How exceptional conditions are handled 9/21/2018

Direct and Indirect Naming In direct naming, sender and receiver processes mention each other’s name In symmetric naming, both sender and receiver processes specify each other’s name In asymmetric naming, receiver does not name process from which it wishes to receive a message; kernel gives it a message sent to it by some process In indirect naming, processes do not mention each other’s name in send and receive statements 9/21/2018

Blocking and Non-blocking Sends A blocking send blocks sender process until message is delivered to destination process Synchronous message passing Simplifies design of concurrent processes A nonblocking send call permits sender to continue its operation after send call Asynchronous message passing Enhances concurrency between sender and receiver In both cases, receive is typically blocking Kernel performs message buffering pending delivery 9/21/2018

Exceptional Conditions in Message Passing To facilitate handling exceptional conditions, send and receive take two additional parameters: Flags indicate how exceptions should be handled status_area is for storing code concerning outcome Some exceptional conditions: Destination process mentioned in send doesn’t exist Source process does not exist (symmetric naming) send cannot be processed (out of buffer memory) No message exists for process when it makes receive A set of processes become deadlocked when one is blocked on a receive 9/21/2018

Implementing Message Passing 9/21/2018

Delivery of Interprocess Messages Remember that: An event control block (ECB) has three fields: Description of the anticipated event Id of the process that awaits the event An ECB pointer for forming ECB lists 9/21/2018

9/21/2018

Mailboxes Mailbox: repository for interprocess messages Has a unique name Owner is typically the process that created it Indirect naming Only owner process can receive messages Any process that knows name of a mailbox can send messages to it Kernel may provide fixed set of mailbox names, or it may permit user processes to assign the names Varying levels of confidentiality 9/21/2018

Mailboxes (continued) 9/21/2018

Mailboxes (continued) Kernel may require a process to explicitly “connect” to a mailbox before starting to use it, and to “disconnect” when it finishes using it May permit owner to destroy it, transfer ownership, etc. Use of a mailbox has following advantages: Anonymity of receiver Classification of messages Through use of separate mailboxes for different classes 9/21/2018

Example: Use of Mailboxes An airline reservation system: A set of booking processes Server wishes to process cancellations before bookings and queries after both of them 9/21/2018

Higher-Level Protocols Using Message Passing Several protocols use message passing paradigm to provide diverse services: Simple mail transfer protocol (SMTP) delivers electronic mail Remote procedure call (RPC) is a programming language facility for distributed computing Invokes a part of a program that is located on a different computer Parallel virtual machine (PVM) and message passing interface (MPI) are message passing standards for parallel programming 9/21/2018

The Simple Mail Transfer Protocol (SMTP) SMTP is used to deliver electronic mail to one or more users reliably and efficiently Uses asymmetric naming Can deliver mail across a number of interprocess communication environments (IPCEs ) It is an applications layer protocol: uses TCP / IP SMTP consists of several simple commands: MAIL, RCPT, DATA Typically used with a protocol that provides a mailbox Internet Message Access Protocol (IMAP) Post Office Protocol (POP) 9/21/2018

Remote Procedure Calls Remote procedure call (RPC): used to invoke a part of a program located in a different computer Semantics resemble those of a procedure call call <proc_id> (<message>); <message> is a list of parameters Stubs perform marshaling of parameters and convert them to/from machine independent representations SunRPC and OSF/DCE standards, Java RMI 9/21/2018

Message Passing Standards for Parallel Programming Parallel program: set of tasks that can be performed in parallel Executed on a heterogeneous set of computers or on a massively parallel processor (MPP) Parallel virtual machine (PVM) and message passing interface (MPI) are standards used in coding message passing libraries; provide: Point-to-point communication between processes Barrier synchronization between processes Global operations for scattering (gathering) disjoint portions of data in a message to (from) different processes 9/21/2018

Message Passing in Unix Three interprocess communication facilities: Pipe: Data transfer facility Unnamed pipes can be used only by processes that belong to the same process tree Message queue: analogous to a mailbox Used by processes within “Unix system domain” Access permissions indicate which processes can send or receive messages Socket: one end of a communication path Can be used for setting up communication paths between processes within the Unix system domain and within certain Internet domains 9/21/2018

Message Passing in Unix (continued) One common feature: processes can communicate without knowing each other’s identities 9/21/2018

Message Passing in Unix: Pipes FIFO mechanism for data transfer between processes called reader and writer processes Usually implemented in file system But, data put into a pipe can be read only once Removed from pipe when it is read by a process Two kinds of pipes: named and unnamed Created through the system call pipe A named pipe has an entry in a directory Like a file, but size is limited and kernel treats it as a queue 9/21/2018

Message Passing in Unix: Message Queues Analogous to a mailbox Created and owned by one process Creator specifies access permissions for send/receive Size specified at the time of its creation 9/21/2018

Message Passing in Unix: Sockets A socket is one end of a communication path Can be used for interprocess communication within the Unix system domain and in the Internet domain Server can set up communication paths with many clients simultaneously Typically, after connect call, server forks a new process to handle the new connection Leaves original socket created by server process free to accept more connections Indirect naming: address (domain) used instead of process ids 9/21/2018

Acknowledgement : MY SINCERE THANKS TO By Kala H S and Remya R THE AUTHOR D M DHAMDHERE. BECAUSE THE ABOVE PRESENTATION MATERIALS ARE HEAVILY BORROWED FROM HIS TEXTBOOK “OPERATING SYSTEMS – A CONCEPT BASED APPROACH” 2ND EDITION, PUBLISHER TATA MCGRAW HILL By Kala H S and Remya R Assistant Professor 9/21/2018