[go: up one dir, main page]

0% found this document useful (0 votes)
23 views26 pages

Chapter 3 IPC

Inter-process communication (IPC) allows processes to communicate over a network. There are two main communication methods - connection-oriented TCP streams and connectionless UDP datagrams. For TCP, messages are delivered reliably and in order while for UDP ordering and reliability are not guaranteed. External data representation standards are needed to convert data to and from message formats. Multicast sends a message to multiple recipients while network virtualization constructs virtual networks over a physical one.

Uploaded by

gemchis dawo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views26 pages

Chapter 3 IPC

Inter-process communication (IPC) allows processes to communicate over a network. There are two main communication methods - connection-oriented TCP streams and connectionless UDP datagrams. For TCP, messages are delivered reliably and in order while for UDP ordering and reliability are not guaranteed. External data representation standards are needed to convert data to and from message formats. Multicast sends a message to multiple recipients while network virtualization constructs virtual networks over a physical one.

Uploaded by

gemchis dawo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 26

Chapter - 3

Inter Process
Communication

1
CONTENTS
Introduction.

Characteristics of Inter process communication


Sockets

UDP Datagram Communication


TCP Stream Communication
External Data Representation and Marshalling.
 Multicast Communication.
 Network Virtualization- Overlay Networks.
2
Introduction
 Inter-Process Communication (IPC) is related to a
set of methods for the exchange of data among
multiple processes.
Inter-Process Communication (IPC) performs four important functions in
distributed systems:

•They allow communication between different processes over a


computer network.
•They provide security through firewalls.
•They enforce clean and simple interfaces.
•They hide the distinction between local and remote
communication.
3
Characteristics of IPC
1. Synchronous and Asynchronous Communication:
Communication between the sending and receiving processes
may be either synchronous or asynchronous.
 In synchronous communication, both send and receive are
blocking operations. Whenever a send is issued the sending
process (or thread) is blocked until the corresponding receive is
issued. Whenever a receive is issued by a process (or thread), it
blocks until a message arrives.
 In the asynchronous communication, the use of the send
operation is non blocking in that the sending process is allowed
to proceed as soon as the message has been copied to a local
buffer, and the transmission of the message proceeds in parallel
with the sending process.
4
Characteristics of IPC
2. Message Destinations:
 A local port is a message destination within a computer, specified as
an integer. A port has exactly one receiver but can have many senders.

3. Reliability:
 A reliable communication is defined in terms of validity and integrity.
 A point-to-point message service is described as reliable if messages
are guaranteed to be delivered despite a reasonable number of packets
being dropped or lost.
 For integrity, messages must arrive uncorrupted and without
duplication.

4. Ordering:
 Some applications require that messages be delivered in sender order.

5
Sockets
 Sockets constitutes a mechanism for delivering incoming data
packets to the appropriate application process, based on a
combination of local and remote addresses and port numbers.

 Socket is characterized by a unique combination of:

1. A protocol transfer (UDP, TCP …)


2. The local socket address and port number
3. The remote socket address and port number

6
Sockets

7
Sockets (Cont. …)

 Messages sent to a particular Internet address and port number


can be received only by a process whose socket is associated
with that Internet address and port number.

 Processes may use the same socket for sending and receiving
messages.

 Each computer has a large number (216) of possible port


numbers for use by local processes for receiving messages.

8
UDP Datagram Communication
 UDP datagram properties
 No guarantee of order preservation
 Message loss and duplications are possible

 Necessary steps
 Creating a socket
 Binding a socket to a port and local Internet address
 A client binds to any free local port
 A server binds to a server port

 Receive method
 It returns Internet address and port of sender, plus
message.
9
UDP Datagram Communication

 Issues related to datagram communications


are:
 Message size
 IP allows for messages of up to 216 bytes.
 Most implementations restrict this to around 8
kilo bytes.
 Any application requiring messages larger than
the maximum must fragment.
 Arriving message should not too big for array
allocated to receive message content.

10
UDP Datagram Communication
 Blocking
 Send: Non-blocking
• upon arrival, message is placed in a queue for the
socket that is bound to the destination port.
 Receive: blocking
• Pre-emption by timeout possible
• If process wishes to continue while waiting for
packet, use separate thread
 Timeout
 an appropriate timeout interval
 Receive from any
The receive method does not specify an origin for
messages.
11
TCP Stream Communication
 TCP protocol provides the abstraction of a stream of
bytes to be written to or read from.

 Characteristics of the stream abstraction:


 Message sizes
 Lost messages
 Flow control
 Message Ordering
 Message destinations

12
TCP Stream Communication
 Message sizes: The application can choose how much data it writes to a
stream or reads from it. It may deal in very small or very large sets of data.
 Lost messages: The TCP protocol uses an acknowledgement scheme. If the
sender does not receive an acknowledgement within a timeout, it retransmits
the message.
 Flow control: The TCP protocol attempts to match the speeds of the
processes that read from and write to a stream. If the writer is too fast for the
reader, then it is blocked until the reader has consumed sufficient data.
 Message duplication and ordering: Message identifiers are associated with
each IP packet, which enables the recipient to detect and reject duplicates, or
to re-order messages that do not arrive in sender order.
 Message destinations: A pair of communicating processes establishes a
connection before they can communicate over a stream. Once a connection
is established, the processes simply read from and write to the destination.

13
External Data Representation
 The information stored in running programs is represented as
data structures, whereas the information in messages consists
of sequences of bytes.
 Irrespective of the form of communication used, the data
structure must be converted to a sequence of bytes before
transmission and rebuilt on arrival.
 External Data Representation is an agreed standard for the
representation of data structures and primitive values.
 Data representation problems are:
 Using agreed external representation, two conversions necessary.
 Using sender’s or receiver’s format and convert at the other end.

14
External Data Representation
 Marshalling
 Marshalling is the process of taking a
collection of data items and assembling them
into a form suitable for transmission in a
message.
 Unmarshalling
 Unmarshalling is the process of disassembling
a collection of data on arrival to produce an
equivalent collection of data items at the
destination.
15
16
External Data Representation
Three alternative approaches to external data representation and
marshalling
 CORBA’s common data representation, which is concerned with
an external representation for the structured and primitive types
that can be passed as the arguments and results of remote method
invocations in CORBA.

 Java’s object serialization, which is concerned with the flattening


and external data representation of any single object or tree of
objects that may need to be transmitted in a message or stored on
a disk. It is for use only by Java.

 XML (Extensible Mark-up Language), which defines a textual


format for representing structured data.
17
Multicast Communication
 A multicast operation is an operation that sends a single
message from one process to each of the members of a group
of processes.
 The membership of the group is transparent to the sender.
 Multicast messages provide a useful infrastructure for
constructing distributed systems with the following
characteristics:
1. Fault tolerance.
2. Discovering services in spontaneous networking.
3. Better performance.
4. Event notifications.

18
Network Virtualization
 Network virtualization is concerned with the construction of many
different virtual networks over an existing network such as the
Internet.

 Each virtual network can be designed to support a particular


distributed application.

 For example, one virtual network might support multimedia


streaming, as in BBC iPlayer, BoxeeTV or Hulu.com, and also
supports a multiplayer online game.

19
Overlay networks
 An overlay network is a virtual network consisting of nodes
and virtual links.

 An overlay network is a service that is tailored towards the


needs of a class of application or a particular higher-level
service – for example, multimedia content distribution.

 An overlay network is more efficient operation in a given


networked environment – for example routing in an ad hoc
network.

 An additional feature is overlay network provides multicast


and secure communication. 20
Overlay networks (Contd..)
Advantages:
 They enable new network services to be defined without
requiring changes to the current network.

 They encourage experimentation with network services and


the customization of services to particular classes of
application.

 Multiple overlays can be defined and can coexist, with the end
result being a more open and extensible network architecture.

21
Skype: An example of an overlay-
network
 Skype is a peer-to-peer application offering Voice over IP
(VoIP). It also includes instant messaging, video conferencing
and interfaces to the standard telephony service through Skype
In and Skype Out.

 The software was developed by Kazaa in 2003. As of 2009


there are 370 million users.

 Skype is a virtual network in that it establishes connections


between people and there is no IP address or port address is
required to establish a call.

22
Skype (Contd..)
 Skype Architecture: Skype is based on a peer-to-peer
infrastructure consisting of ordinary hosts and super
nodes.

 Super nodes are ordinary Skype hosts that happen to


have sufficient capabilities to carry out their enhanced
role.

 Super nodes are selected on demand based a range of


criteria including bandwidth available, reach ability
and availability.
23
Skype (Contd..)
 User connection: Skype users are authenticated via a well-
known login server. They then make contact with a selected
super node. To achieve this, each client maintains a cache of
super node identities (that is, IP address and port number
pairs).
 Search for users: The main goal of super nodes is to perform
the efficient search of the global index of users, which is
distributed across the super nodes. The search is orchestrated
by the client’s chosen super node and involves an expanding
search of other super nodes until the specified user is found.
 Voice connection: Once the required user is discovered,
Skype establishes a voice connection between the two parties
using TCP or UDP Protocols.
24
25
THANK
YOU

26

You might also like