chapter 4.1

Click here to load reader

Upload: jonah-saunders

Post on 30-Dec-2015

30 views

Category:

Documents


0 download

DESCRIPTION

Chapter 4.1. Interprocess Communication And Coordination By Shruti Poundarik. Outline. Interprocess Communication Message Passing Communication Basic Communication Primitives Synchronization. Interprocess Communication. - PowerPoint PPT Presentation

TRANSCRIPT

Slide 1

Chapter 4.1Interprocess Communication And Coordination

ByShruti Poundarik1OutlineInterprocess CommunicationMessage Passing CommunicationBasic Communication PrimitivesSynchronization2Interprocess CommunicationInterprocess communication is a set of techniques used to exchange data among two or more thread processes.

IPC can be viewed at different levels of abstraction.Table outlines 5 levels of communication.

Interprocess CommunicationTransaction Request/Reply(RPC)Message PassingNetwork Operating SystemTransport ConnectionCommunication NetworkPacket Switching3Message Passing is the lowest level of communication between communicating processes.

Request/Reply communication is based on client/server concept.

Transactions are sequence of request/ reply communication.

They form basic unit of communication for high level applications such as database systems.

4Message Passing CommunicationMessages are collections of data objects .Messages have a header containing system-dependent control information Message body which is fixed or variable size.

Basic Communication Primitives:- Two generic message passing primitives are used:-Send(destination,message)Receive(source,message)

Messages can be anything that is comprehensible data, remote procedure calls, executable code etc.Source and destination maybe process name, link or mailbox.5Main Question is how are the source & destination entities are addressed.

addressing can be Direct /Indirect1)Direct Communication:Entities can be addressed by using process names (Global process identifiers).GPIs are made unique by concatenatingHost Network Address+ local Generated Process Id

This implies one logical communication path exists between sender and receiver.

6Symmetric Addressing:-Direct communication path exists between sending and receiving processes.Since sender and receiver explicitly name each other in communication primitive.Asymmetric Addressing:-Only the sender needs to indicate the recipient

Disadvantages of Direct Communication:-limited modularity - changing the name of a process means changing every sender and receiver process to matchneed to know process names

72) Indirect Communication Primitives:-Sometimes the sending processes are not concerned with the identity of the receiving process as long as message is received .Receiver is not interested in the Id of the sending process as long as the message is received.Such scenarios are implemented by Mailboxes.

Multiple clients might request services from one of multiple servers. We use Mailboxes.

8process mailbox ownership :only the process may receive messages from the mailboxother processes may send to the mailboxmailbox can be created with the process and destroyed when the process diessystem mailbox ownership :mailboxes have their own independent existence, not attached to any processdynamic connection to a mailbox by processesfor send and/or receive

9Message Synchronization And BufferingMessage passing and synchronization depends on Synchronization.

Messages are passed to senders system Kernel, which transmits to the communication network.

Message then reaches remote system Kernel which delivers to destination process.

10Synchronization and Buffering There are 2 typical combinations:-1) Blocking Send, Blocking Receive Both receiver and sender are blocked until the message is delivered. (provides tight synchronization between processes)

2) Non Blocking Send, Blocking Receive Sender can continue the execution after sending a message, the receiver is blocked until message arrives. (most useful combination)

3) Non Blocking Send, Non Blocking Receive Neither party waits.11Message Synchronization Stages

Sender source kernel network destination kernel receiver message 3 4 request 2 ack 1 7 6 5 reply8

Message passing depends on Synchronization at several points.When sending a message to remote destination, the message is passed to sender system kernel which transmits it to communication network.

Non blocking Send 1+8 Sender process is released after message has been composed and copied into senders kernel.Blocking Send 1+2+7+8 Sender process is released after message has been transmitted to Network.Reliable Blocking Send 1+2+3+6+7+8Released after message has been received by kernel.Explicit Blocking Send 1+2+3+4+5+6+7+8Sender process is released after Message has been received by receiver process.Request & Reply 1-4 service 5-8 Released after message has been processed by the receiver and response returned to the sender.

12Pipe

Pipes are implemented with finite size, FIFO byte stream buffer maintained by the kernel.

Used by 2 communicating processes, a pipe serves as unidirectional communication link so that one process can write data into tail end of pipe while another process may read from head end of the pipe.

Pipe is created by a system call which returns 2 file descriptors, (reading /writing)

They are shared by two communicating processes ,therefore pipes are used for related processes.

For unrelated processes, there is need to uniquely identify a pipe since pipe descriptors cannot be shared. So concept of Named pipes.

With a unique path name, named pipes can be shared among disjoint processes across different machines with a common file system.

13Use of Named pipes is limited to single domain within a common file system.

To achieve interdomain process communication neither data structures nor files can be shared or named we need an API running on top of transport layer.

Two commonly APIs are Berkeley socket and System V Transport Layer Interface.

14SocketA Socket is a communication end point of a communication link managed by the transport services. It is not feasible to name a communication channel across different domains. A Communication channel can be visualized as a pair of 2 communication endpoints.Sockets have become most popular message passing API. Most recent version of the Windows Socket which is developed by WinSock Standard Group which has 32 companies (including Microsoft) also includes a SSL (Secure Socket Layer) in the specification. The goal of SSL is to provide: Privacy in socket communication by using symmetric cryptographic data encryption. Integrity in socket data by using message integrity check. Authenticity of servers and clients by using asymmetric public key cryptography15ReferencesOperating System Concepts, Silberschatz, Galvin and Gange 2002

Sameer Ajmani ``Automatic Software Upgrades for Distributed Systems'' Ph.D. dissertation, MIT, Sep. 2004

An analysis of message passing systems for distributed memory computersClematis, A.; Tavani, O.;Parallel and Distributed Processing, 1993. Proceedings. Euromicro Workshop on27-29 Jan. 1993 Page(s):299 - 306

16