InterProcess Communication In Distributed Systems

 Interprocess Communication is a process of exchanging the data between two or more independent process in a distributed environment is called as Interprocess communication. Interprocess communication on the internet provides both Datagram and stream communication.

Characteristics of Inter-process Communication

There are mainly five characteristics of inter-process communication in a distributed system.

Synchronous System Calls:
In the synchronous system calls both sender and receiver use blocking system calls to transmit the data which means the sender will wait until the acknowledgment is received from the receiver and receiver waits until the message arrives.

Asynchronous System Calls:
In the asynchronous system calls, both sender and receiver use non-blocking system calls to transmit the data which means the sender doesn’t wait from the receiver acknowledgment.

Message Destination:
A local port is a message destination within a computer, specified as an integer. Aport has exactly one receiver but many senders. Processes may use multiple ports from which to receive messages. Any process that knows the number of a port can send the message to it.

Reliability:
It is defined as validity and integrity.

Integrity:
Messages must arrive without corruption and duplication to the destination.

Validity:
Point to point message services are defined as reliable, If the messages are guaranteed to be delivered without being lost is called validity.

Ordering:
It is the process of delivering messages to the receiver in a particular order. Some applications require messages to be delivered in the sender order i.e the order in which they were transmitted by the sender.

Methods in Interprocess Communication

Inter-process communication (IPC) is set of interfaces, which is usually programmed in order for the programs to communicate between series of processes. This allows running programs concurrently in an Operating System. These are the methods in IPC:

Pipes (Same Process)
This allows flow of data in one direction only. Analogous to simplex systems (Keyboard). Data from the output is usually buffered until input process receives it which must have a common origin.

Names Pipes (Different Processes)
This is a pipe with a specific name it can be used in processes that don’t have a shared common process origin. E.g. is FIFO where the details written to a pipe is first named.

Message Queuing
This allows messages to be passed between processes using either a single queue or several message queue. This is managed by system kernel these messages are coordinated using an API.

Semaphores
This is used in solving problems associated with synchronization and to avoid race condition. These are integer values which are greater than or equal to 0.

Shared memory –
This allows the interchange of data through a defined area of memory. Semaphore values have to be obtained before data can get access to shared memory.

Sockets
This method is mostly used to communicate over a network between a client and a server. It allows for a standard connection which is computer and OS independent.