Professional Documents
Culture Documents
Communication
11/06/2023 1
Objectives of the Chapter
• Review of how processes communicate in a network (the rules or the protocols) and their
structures
11/06/2023 3
Two computers, possibly from different manufacturers, must be able to talk
to each other
For such a communication, there has to be a standard
The ISO OSI (Open Systems Interconnection) Reference Model is one of
such standards (7 layers )
TCP/IP protocol suite is the other; has 4 or 5 layers
OSI
Open – to connect open systems or systems that are open for communication
with other open systems using standard rules that govern the format, contents,
and meaning of the messages sent and received
These rules are called protocols
11/06/2023 4
Lower-Level Protocols
The three lowest layers of the OSI protocol suite. Together, these
layers implement the basic functions that encompass a computer
network.
The physical layer
The data link layer
The Network layer
11/06/2023 5
a typical message as it appears on the network
11/06/2023 6
Transport Protocols: Client-Server TCP
connection (5)
The server acknowledges receipt and
conversation (9)
Middleware Protocols
A middleware is an application that contains general-purpose protocols to
provide services
Example of middleware services
Authentication and authorization services
Distributed transactions (commit protocols; locking mechanisms)
Middleware communication protocols (calling a procedure or
invoking an object remotely, synchronizing streams for real-time data,
multicast services)
Hence an adapted reference model for networked communications is
required
11/06/2023 10
An adapted reference model for networked communication
11/06/2023 11
Remote Procedure Call
• The first distributed systems were based on explicit message
exchange between processes through the use of explicit send and
receive procedures; but do not allow access transparency
• In 1984, Birrel and Nelson introduced a different way of handling
communication: RPC
• It allows a program to call a procedure located on another machine
• Simple and elegant, but there are implementation problems
– The calling and called procedures run in different address spaces
– Parameters and results have to be exchanged;
– What if the machines are not identical?
– What happens if both machines crash?
11/06/2023 12
Conventional Procedure Call, i.e., on a single machine
e.g. count = read (fd, buf, bytes); a C like statement, where
fd is an integer indicating a file
buf is an array of characters into which data are read
bytes is the number of bytes to be read
Stack pointer
Stack pointer
parameter passing in a local procedure the stack while the called procedure is
call: the stack before the call to read active
Parameters can be call-by-value (fd and bytes) or call-by reference (buf) or in some
languages call-by-copy/restore
11/06/2023 13
Client and Server Stubs
RPC would like to make a remote procedure call look the same as a
local one; it should be transparent, i.e., the calling procedure
should not know that the called procedure is executing on a
different machine or vice versa
11/06/2023 14
Steps of a Remote Procedure Call
1. Client procedure calls client stub in the normal way
2. Client stub builds a message and calls the local OS (packing parameters into
a message is called parameter marshaling)
3. Client's OS sends the message to the remote OS
4. Remote OS gives the message to the server stub
5. Server stub unpacks the parameters and calls the server
6. Server does the work and returns the result to the stub
7. Server stub packs it in a message and calls the local OS
8. Server's OS sends the message to the client's OS
9. Client's OS gives the message to the client stub
10. Stub unpacks the result and returns to client
Hence, for the client remote services are accessed by making ordinary (local) procedure
calls; not by calling send and receive
11/06/2023 15
Parameter Passing
11/06/2023 17
Asynchronous RPC
If there is no need to block the client until it gets a reply (two cases)
1. If there is no result to be returned
e.g., adding entries in a database, ...
The server immediately sends an ack promising that it will carryout
the request
The client can now proceed without blocking
11/06/2023 20
RPC Programming Process
• Dividing the program into local and remote procedures.
11/06/2023 21
RPC Dispatching
(Procedure Location)
Proc A2
RPC
Dispatcher
Proc A1
RPC Server Stub Server Stub
Client Stub
Client Stub Proc B1 Proc B2
11/06/2023 22
RPC Interface Specification
11/06/2023 23
RPC General Build Procedure
Develop Interface
11/06/2023 24
Remote Object (Method) Invocation (RMI)
• Resulted from object-based technology that has proven its value in
developing non distributed applications
• it is an expansion of the RPC mechanisms
• it enhances distribution transparency as a consequence of an object that
hides its internal from the outside world by means of a well-defined
interface
Distributed Objects
– an object encapsulates data, called the state, and the operations on those
data, called methods
– methods are made available through interfaces
– the state of an object can be manipulated only by invoking methods
– this allows an interface to be placed on one machine while the object
itself resides on another machine; such an organization is referred to25as a
11/06/2023
the state of an object is not distributed, only the interfaces are;
such objects are also referred to as remote objects
the implementation of an object’s interface is called a proxy
(analogous to a client stub in RPC systems)
it is loaded into the client’s address space when a client
binds to a distributed object
tasks: a proxy marshals method invocation into messages
and unmarshals reply messages to return the result of the
method invocation to the client
a server stub, called a skeleton, unmarshals messages and
marshals replies
11/06/2023 26
common organization of a remote object with client-side proxy
11/06/2023 27
Binding a Client to an Object
a process must first bind to an object before invoking its
11/06/2023 28
Parameter Passing
there are two situations when invoking a method with
object reference as a parameter: the object can be local or
remote to the client
local object: a copy of the object is passed; this means the
object is passed by value
remote object: copy and pass the reference of the object
as a value parameter; this means the object is passed by
reference
11/06/2023 29
the situation when passing an object by reference or by value
two examples:
DCE Remote Objects
Java RMI
• RPCs and RMIs are not adequate for all distributed system
applications
• the provision of access transparency may be good but they have
semantics that is not adequate for all applications
• example problems
– they assume that the receiving side is running at the time
of communication
– a client is blocked until its request has been processed
11/06/2023 31
Persistence and Synchronicity in Communication
assume the communication system is organized as a
computer network shown below
Persistent Transient
Asynchronous
11/06/2023 34
persistent asynchronous persistent synchronous
communication communication
11/06/2023 35
transient asynchronous receipt-based transient synchronous
communication communication
11/06/2023 37
The Message-Passing Interface (MPI)
sockets were designed to communicate across networks
using general-purpose protocol stacks such as TCP/IP
they were not designed for proprietary protocols
developed for high-speed interconnection networks; of
course portability will suffer
MPI is designed for parallel applications and tailored for
transient communication
MPI assumes communication takes place within a known
group of processes, where each group is assigned an
identifier (groupID)
each process within a group is also assigned an identifier
(processID)
a (groupID, processID) identifies the source or destination
of a message, and is used instead of a transport-level
address
11/06/2023 38
Primitive Meaning
MPI_bsend Append outgoing message to a local send buffer
Send a message and wait until copied to local or remote
MPI_send
buffer
MPI_ssend Send a message and wait until receipt starts
MPI_sendrecv Send a message and wait for reply
MPI_isend Pass reference to outgoing message, and continue
Pass reference to outgoing message, and wait until receipt
MPI_issend
starts
MPI_recv Receive a message; block if there are none
MPI_irecv Check if there is an incoming message, but do not block
11/06/2023 39
Stream Oriented Communication
• until now, we focused on exchanging independent and complete units of
information
• time has no effect on correctness; a system can be slow or fast
• however, there are communications where time has a critical role
• Multimedia
– media
• storage, transmission, interchange, presentation, representation and
perception of different data types:
• text, graphics, images, voice, audio, video, animation, ...
• movie: video + audio + …
– multimedia: handling of a variety of representation media
– end user pull
• information overload and starvation
– technology push
• emerging technology to integrate media
11/06/2023 40
The Challenge
new applications
multimedia will be pervasive in few years (as graphics)
storage and transmission
e.g., 2 hours uncompressed HDTV (1920×1080) movie:
1.12 TB (1920×1080x3x25x60x60x2)
videos are extremely large, even after compressed
(actually encoded)
continuous delivery
e.g., 30 frames/s (NTSC), 25 frames/s (PAL) for video
guaranteed Quality of Service
admission control
search
can we look at 100… videos to find the proper one?
11/06/2023 41
Types of Media
two types
discrete media: text, executable code, graphics, images;
temporal relationships between data items are not
fundamental to correctly interpret the data
continuous media: video, audio, animation; temporal
relationships between data items are fundamental to
correctly interpret the data
a data stream is a sequence of data units and can be applied
to discrete as well as continuous media
stream-oriented communication provides facilities for the
exchange of time-dependent information (continuous media)
such as audio and video streams
11/06/2023 42
• timing in transmission modes
– asynchronous transmission mode: data items are transmitted one after the
other, but no timing constraints; e.g. text transfer
– synchronous transmission mode: a maximum end-to-end delay defined for
each data unit; it is possible that data can be transmitted faster than the
maximum delay, but not slower
– isochronous transmission mode: maximum and minimum end-to-end delay
are defined; also called bounded delay jitter; applicable for distributed
multimedia systems
• a continuous data stream can be simple or complex
– simple stream: consists of a single sequence of data; e.g., mono audio, video
only (only visual frames)
– complex stream: consists of several related simple streams that must be
synchronized; e.g., stereo audio, video consisting of audio and video (may
also contain subtitles, translation to other languages, ...)
11/06/2023 43
Unicast, Broadcast
Key:
Unicast transfer
versus Multicast
Broadcast transfer
Multicast transfer
• 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
11/06/2023 44
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
11/06/2023 45
Introduction to Web Services
• Microsoft coined the term “Web services” in June 2000, when
the company introduced Web services as a key component of
its .Net initiative,
– A new vision for embracing the Internet in the development,
engineering and use of software.
• As others began to investigate Web services, it became clear
that the technology could revolutionise distributed computing.
• Now, nearly every major vendor is marketing Web services’
tools and applications and Web services are radically changing
IT architectures and partner relationships.
11/06/2023 46
• Web services encompass a set of related
standards that can allow any two computers to
communicate and exchange data via a network,
such as the Internet.
• The primary standard used in Web services is
the Extensible Markup Language (XML)
developed by the World Wide Web Consortium
(W3C).
• Developers use XML tags to describe individual
pieces of data, forming XML documents, which
are text-based and can be processed on any
platform.
11/06/2023 47
• XML’s portability and its rapid adoption throughout the
industry made it the obvious choice for enabling cross-
platform data communication in Web services.
• XML provides the foundation for many core Web services
standards:
1. SOAP,
2. WSDL,
3. UDDI,
– Plus vocabularies of XML-based markup for a specific industry or
purpose).
• Almost every type of business can benefit from Web services
such as:
– Expediting software development,
– Integrating applications and databases,
– Automating transactions with suppliers, partners, and clients.
11/06/2023 48
• SOAP (was originally called the Simple Object Access
Protocol) is an XML vocabulary that lets programs on
separate computers to interact across a network (via
RPC).
• WSDL (Web Services Description Language) is another
XML vocabulary that lets developers describe Web
services and their capabilities in a standardised format.
• UDDI (Universal Description, Discovery and Integration)
is a framework that defines XML-based registries where
businesses can publish information about themselves
and the services they offer.
11/06/2023 49
Web Services’ Applications
• Unfortunately, interoperability, the ability to
communicate and share data with software from
different vendors and platforms, is limited among
conventional proprietary technologies, e.g. DCE,
CORBA, DCOM and RMI.
• Web services improve distributed computing
interoperability by using open (non-proprietary)
standards that can enable (theoretically) any two
software components to communicate:
– Also they are easier to debug because they are text-based,
rather than binary, communication protocols.
11/06/2023 50
The Advantages of Web Services
• Web services advantages:
– Use open, text-based standards, which allow components written in
different languages and for different platforms to communicate,
– Promotes a modular approach to programming, so multiple
organisations can communicate with the same Web services.
– Comparatively easy and inexpensive to implement, because they
employ an existing infrastructure and because most applications can
be repackaged as Web services,
– Significantly reduce the costs of enterprise application integration
(EAI) and B2B communications,
– Implemented incrementally, rather than all at once which lessens the
cost and reduces the organisational disruption from an abrupt switch
in technologies,
– The Web Services Interoperability Organisation (WS-I) consisting of
over 100 vendors promotes interoperability.
11/06/2023 51
Web Services’ challenges
• Web services’ challenges:
– The standards that drive Web services are still in
draft form, always will be in refinement.
– Some vendors want to retain their intellectual
property rights to certain Web services standards.
– Web services need standard security procedures,
a common problem to all of distributed
computing.
– The leading registry, based on the UDDI specification, has
some key limitations, and alternative discovery methods
are provided by ebXML and WS-Inspection.
– Web services need Quality of Service (QoS) support from
Web Services Registries, Brokerages, and Network
Providers.
11/06/2023 52
Web Services Basics
• Web services:
– Software programs that use XML to exchange
information with other software via common
Internet protocols:
• Scalable, e.g. multiplying two numbers together to an
entire customer-relationship management system,
• Programmable - encapsulates a task,
• Based on XML - open, text-based standard,
• Self-describing - metadata for access and use,
• Discoverable - search and locate in registries,.
11/06/2023 53
Architecture of Web Service
• A web service is a network accessible interface to
application functionality, built using standard
Internet technologies.
• Clients of web services do NOT need to know how
it is implemented.
Application
Application
Network
Web code
client Service
11/06/2023 54
Web Services
1. Client queries registry to locate
2
WSDL service.
UDDI Docume 2. Registry refers client to WSDL
Registry nt document.
3. Client accesses WSDL document.
4. WSDL provides data to interact with
3 Web service.
1
4 5. Client sends SOAP-message request.
6. Web service returns SOAP-message
5 response.
Client
Web
6
Services
11/06/2023 55
Web Service Technology Stack
shopping web service?
Discovery
Discovery
Web Service WSDL URIs
UDDI
Client
Description
Description Web Service
WS
WSDL
SOAPDLpkg
Packaging
Packaging request
Proxy
SOAP pkg
response
Transport
Transport
Network
Network
11/06/2023 56
Step1. Write Web Service Method
shopping web service?
Discovery
Discovery
Web Service WSDL URIs
UDDI
Client
Description
Description Web Service
WS
WSDL
SOAPDLpkg
Packaging
Packaging
Proxy request
SOAP pkg
response
Transport
Transport
Network
Network
11/06/2023 57
Step2. Describe Web Service using WSDL
shopping web service?
Discovery
Discovery
Web Service WSDL URIs
UDDI
Client
Description
Description Web Service
WS
WSDL
SOAPDLpkg
Packaging
Packaging
Proxy request
SOAP pkg
response
Transport
Transport
Network
Network
11/06/2023 58
Step3. Write Proxy to Access Web Service
shopping web service?
Discovery
Discovery
Web Service WSDL URIs
UDDI
Client
Description
Description Web Service
WS
WSDL
SOAPDLpkg
Packaging
Packaging
Proxy request
SOAP pkg
response
Transport
Transport
Network
Network
11/06/2023 59
Step4. Write Client to Invoke Proxy
shopping web service?
Discovery
Discovery
Web Service WSDL URIs
UDDI
Client
Description
Description Web Service
WS
WSDL
SOAPDLpkg
Packaging
Packaging
Proxy request
SOAP pkg
response
Transport
Transport
Network
Network
11/06/2023 60
SOAP (Simple Object Access Protocol)
• SOAP Messages
• Using SOAP as RPC (Remote Procedure Call)
Messages
Request message
Response message