The API For The Internet Protocols: Unit III Interprocess Communication
The API For The Internet Protocols: Unit III Interprocess Communication
INTERPROCESS COMMUNICATION
Message passing between a pair of processes can be supported by two message communication
operations, send and receive. To communicate, one process sends a message (a sequence of bytes) to a
destination and another process at the destination receives the message. This activity involves the
communication of data from the sending process to the receiving process and may involve the
synchronization of the two processes.
In the synchronous form of communication, the sending and receiving processes synchronize at
every message. In this case, 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 form of 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.
Message destinations
In the Internet protocols, messages are sent to (Internet address, local port) pairs. 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.
Processes may use multiple ports to receive messages. Any process that knows the number of a port can send a
message to it. Servers generally publicize their port numbers for use by clients.
Reliability
A point-to-point message service can be described as reliable if messages are guaranteed to be delivered
despite a
‘reasonable’ number of packets being dropped or lost.
Ordering
Some applications require that messages be delivered in sender order – that is, the order in which they were
transmitted by the sender. The delivery of messages out of sender order is regarded as a failure by such applications.
Sockets:
Both forms of communication (UDP and TCP) use the socket abstraction, which provides an endpoint for
communication between processes. Inter-process communication consists of transmitting a message between a
socket in one process and a socket in another process, shown in the below figure.
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. Any process may make use of
multiple ports to receive messages, but a process cannot share ports with other processes on the same computer.
However, any number of processes may send messages to the same port. Each socket is associated with a particular
protocol – either UDP or TCP.
TCP:
TCP(Transmission Control Protocol). TCP is a connection-oriented protocol, a connection can be made
from client to server, and from then on any data can be sent along that connection.
o Reliable - when you send a message along a TCP socket, you know it will get there unless the
connection fails completely. If it gets lost along the way, the server will re-request the lost part. This
means complete integrity, things don't get corrupted.
o Ordered - if you send two messages along a connection, one after the other, you know the first
message will get there first. You don't have to worry about data arriving in the wrong order.
Heavyweight - when the low level parts of the TCP "stream" arrive in the wrong order, resend
requests have to be sent, and all the out of sequence parts have to be put back together, so requires a bit of
work to piece together.
UDP(User Datagram Protocol). A simpler message- based connectionless protocol. With UDP you send
messages (packets) across the network in chunks.
o Unreliable - When you send a message, you don't know if it'll get there, it could get lost on the way.
o Not ordered - If you send two messages out, you don't know what order they'll arrive in.
o Lightweight - No ordering of messages, no tracking connections, etc. It's just fire and forget! This
means it's a lot quicker, and the network card / OS have to do very little work to translate the data back
from the packets.
Characteristic /
UDP TCP
Description
Full-featured protocol that allows
Simple, high-speed, low-functionality
applications to send data reliably
General Description “wrapper” that interfaces applications to
without worrying about network
the network layer and does little else.
layer issues.
Connection-oriented; connection
Protocol Connection
Connectionless; data is sent without setup. must be established prior to
Setup
transmission.
Stream-based; data is sent by the
Data Interface To Message-based; data is sent in discrete
application with no particular
Application packages by the application.
structure.
Reliability and Unreliable, best-effort delivery without Reliable delivery of messages; all
Acknowledgments acknowledgments. data is acknowledged.
Delivery of all data is managed,
Not performed. Application must detect
Retransmissions and lost data is retransmitted
lost data and retransmit if needed.
automatically.
Flow control using sliding
Features Provided to windows; window size adjustment
None
Manage Flow of Data heuristics; congestion avoidance
algorithms.
Overhead Very low Low, but higher than UDP
Transmission Speed Very high High, but not as high as UDP
Data Quantity Small to moderate amounts of data (up to a Small to very large amounts of data
Suitability few hundred bytes) (up to gigabytes)
Applications where data delivery speed Most protocols and applications
Types of Applications matters more than completeness, where sending data that must be received
That Use The Protocol small amounts of data are sent; or where reliably, including most file and
multicast/broadcast are used. message transfer protocols.
Well-Known
Multimedia applications, SNMP, NFS FTP, Telnet, SMTP, DNS, HTTP,
Applications and
etc… POP, BGP, IRC etc…
Protocols
• CORBA’s( Common Object Request Broker Architecture) common data representation, which is concerned with
an external data representation for the structured and primitive types that can be passed as the arguments and results
of remote method invocations in CORBA. It can be used by a variety of programming languages.
It consists many primitive types like:
Short (16 bit)
Long (32 bit)
Unsigned short
Unsigned long
Float(32 bit)
Double(64 bit)
Char
Boolean(TRUE,FALSE)
Octet(8 bit)
• Java’s object serialization, the term serialization refers to the activity of flattening an object or a connected set of
objects into a serial form that is suitable for storing on disk or transmitting in a message. Deserialization consists of
restoring the state of an object or a set of objects from their serialized form. It is for use only by Java.
• XML (Extensible Markup Language), which defines a textual format for representing structured data. It was
originally intended for documents containing textual self-describing structured data – for example documents
accessible on the Web – but it is now also used to represent the data sent in messages exchanged by
clients and servers in web services.
XML example:
<person id="123456789">
<name>Smith</name>
<place>London</place>
<year>1984</year>
<!-- a comment -->
</person >
Multicast communication
• Unicast
– One-to-one
– Destination – unique receiver host address
• Broadcast
– One-to-all
– Destination – address of network
• Multicast
– One-to-many
– Multicast group must be identified
– Destination – address of group
Multicast application examples
• Financial services
– Delivery of news, stock quotes, financial indices, etc
• Remote conferencing/e-learning
– Streaming audio and video to many participants (clients, students)
– Interactive communication between participants
• Data distribution
– e.g., distribute experimental data from Large Hadron Collider (LHC) at CERN lab to
interested physicists around the world
• Integrity
A correct process delivers a message at most once.
• Validity
A message from a correct process will be delivered by the process eventually.
• Agreement
A message delivered by a correct process will be delivered by all other correct processes in the group.
Þ Validity + Agreement = Liveness
Virtualization
• In computing, virtualization is a broad term that refers to the abstraction of computer resources
• It is "a technique for hiding the physical characteristics of computing resources from the way in
which other systems, applications, or end users interact with those resources. This includes
making a single physical resource (such as a server, an operating system, an application, or
storage device) appear to function as multiple logical resources; or it can include making multiple
physical resources (such as storage devices or servers) appear as a single logical resource."
• The common theme of all virtualization technologies is the hiding of technical detail, through
encapsulation.
• Virtualization creates an external interface that hides an underlying implementation, e.g. by
multiplexing access, by combining resources at different physical locations, or by simplifying a
control system.
Types:
• It is divided into two main categories:
– Platform virtualization involves the simulation of virtual machines.
– Resource virtualization involves the simulation of combined, fragmented, or simplified
resources.
Platform virtualization
The creation of a virtual machine using a combination of hardware and software is
referred to as platform virtualization.
Platform virtualization is performed on a given hardware platform by "host" software (a
control program), which creates a simulated computer environment (a virtual machine)
for its "guest" software.
The "guest" software, which is often itself a complete operating system, runs just as if it
were installed on a stand-alone hardware platform.
Resource virtualization
• The basic concept of platform virtualization, was later extended to the virtualization of specific
system resources, such as storage volumes, name spaces, and network resources.
Virtualization Approaches:
Full Virtualization
Paravirtualization
Hardware-assisted Virtualization
Full Virtualization
Full virtualization is designed to provide total abstraction of the underlying physical
system and creates a complete virtual system in which the guest operating systems can
execute.
No modification is required in the guest OS or application; the guest OS or application is
not aware of the virtualized environment so they have the capability to execute on the
VM just as they would on a physical system.
This approach can be advantageous because it enables complete decoupling of the
software from the hardware.
As a result, full virtualization can streamline the migration of applications and workloads
between different physical systems.
Full virtualization also helps provide complete isolation of different applications, which
helps make this approach highly secure.
However, full virtualization may incur a performance penalty. The VM monitor must provide the VM
with an image of an entire system, including virtual BIOS, virtual memory space, and virtual devices. The
VM monitor also must create and maintain data structures for the virtual components, such as a shadow
memory page table. These data structures must be updated for every corresponding access by the VMs.
– Everything is virtualized
– Full hardware emulation
– Emulation = latency
– Exact hardware exposed to OS
– Efficient execution
– OS runs unchanged
– Example: VMWare
– Binary rewriting
– Software Based
Paravirtualization
para-virtualization presents each VM with an abstraction of the hardware that is similar but not
identical to the underlying physical hardware. Para-virtualization techniques require modifications to the
guest operating systems that are running on the VMs. As a result, the guest operating systems are aware
that they are executing on a VM—allowing for near-native performance. Para-virtualization methods are
still being developed and thus have limitations, including several insecurities such as the guest OS cache
data, unauthenticated connections, and so forth.
Requirements:
– OS level – recompiled kernel
– Device level – paravirtualized or “enlightened” device drivers
• Pro: fast
• Con: requires a specially modified guest OS, thus precludes the ability to run off-the-shelf and
legacy OS in paravirtual environments
Hardware-assisted Virtualization
– Unmodified guest
– VMware and Xen on virtualization-aware hardware platforms
Examples
Type 1: VMWare ESX Server, Xen, OS/370
Type 2: User-mode Linux
Type - 1
Type – 2
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 SkypeIn and
SkypeOut. The software was developed by Kazaa in 2003 and hence shares many of the characteristics of
the Kazaa peer-to-peer file-sharing application. It is widely deployed, with an estimated 370 million users
as of the start of 2009.
Skype is a virtual network in that it establishes connections between people (Skype subscribers
who are currently active). No IP address or port is required to establish a call. The architecture of the
virtual network supporting Skype is not widely publicized but researchers have studied Skype through a
variety of methods, including traffic analysis, and its principles are now in the public domain.
Skype overlay architecture
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.
Voice connection • Once the required user is discovered, Skype establishes a voice connection between
the two parties using TCP for signaling call requests and terminations and either UDP or TCP for the
streaming audio.