0% found this document useful (0 votes)
52 views75 pages

Chapter 4 Communication

1) Remote Procedure Call (RPC) hides the details of message passing between processes, making remote procedure calls appear the same as local procedure calls. It is suitable for client-server models. 2) RPC uses client and server stubs. The client stub handles packing parameters and unpacking results for the remote call. The server stub handles receiving the call and dispatching to the actual server procedure. 3) This provides location transparency, making it appear to the client and server code that they are calling a local procedure, even though it is remotely executed.

Uploaded by

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

Chapter 4 Communication

1) Remote Procedure Call (RPC) hides the details of message passing between processes, making remote procedure calls appear the same as local procedure calls. It is suitable for client-server models. 2) RPC uses client and server stubs. The client stub handles packing parameters and unpacking results for the remote call. The server stub handles receiving the call and dispatching to the actual server procedure. 3) This provides location transparency, making it appear to the client and server code that they are calling a local procedure, even though it is remotely executed.

Uploaded by

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

Chapter 4 - Communication

Introduction
ƒ interprocess communication is at the heart of all distributed
systems
ƒ communication in distributed systems is based on message
passing as offered by the underlying network which is
harder as opposed to using shared memory
ƒ modern distributed systems consist of thousands of
processes scattered across an unreliable network such as
the Internet
ƒ unless the primitive communication facilities of the network
are replaced by more advanced ones, development of large
scale Distributed Systems becomes extremely difficult

2
Objectives of the Chapter
ƒ review how processes communicate in a network (the rules
or the protocols) and their structures
ƒ introduce the five widely used communication models for
distributed systems:
ƒ Remote Procedure Call (RPC) - which hides the details of
message passing and suitable for client-server models
ƒ Remote Object (Method) Invocation (RMI)
ƒ Message-Oriented Middleware (MOM) - instead of the
client-server model, think in terms of messages and have
a high level message queuing model similar to e-mail
ƒ Stream-Oriented Communication - for multimedia to
support the continuous flow of messages with timing
constraints
ƒ Multicast Communication - information dissemination for
several recipients
3
4.1 Network Protocols and Standards
ƒ why communication in distributed systems? because there is
no shared memory
ƒ two communicating processes must agree on the syntax and
semantics of messages
ƒ a protocol is a set of rules that governs data communications
ƒ a protocol defines what is communicated, how it is
communicated, and when it is communicated
ƒ for instance, for one computer to send a message to another
computer, the first computer must perform the following
general steps (highly simplified)
ƒ break the data into small sections called packets (message,
datagram, packet, frame)
ƒ add addressing information to the packets identifying the
source and destination computers
ƒ deliver the data to the network interface card for
transmission over the network
4
ƒ the receiving computer must perform the same steps, but in
reverse order
ƒ accept the data from the NIC
ƒ remove transmitting information that was added by the
transmitting computer
ƒ reassemble the packets of data into the original message
ƒ the key elements of a protocol are syntax, semantics, and
timing
ƒ syntax: refers to the structure or format of the data
ƒ semantics: refers to the meaning of each section of bits
ƒ timing: refers to when data should be sent and how fast
they can be sent
ƒ functions of protocols
ƒ each device must perform the same steps the same way
so that the data will arrive and reassemble properly; if
one device uses a protocol with different steps, the two
devices will not be able to communicate with each other
5
ƒ Protocols in a layered architecture
ƒ protocols that work together to provide a layer or layers of
the model are known as a protocol stack or protocol suite,
e.g. TCP/IP
ƒ each layer handles a different part of the communications
process and has its own protocol
ƒ Data Communication Standards
ƒ standards are essential for interoperability
ƒ data communication standards fall into two categories
ƒ De facto standards: that have not been approved by an
organized body; mostly set by manufacturers
ƒ De jure standards: those legislated by an officially
recognized body such as ISO, ITU, ANSI, IEEE

6
Network (Reference) Models
ƒ Layers and Services
ƒ within a single machine, each layer uses the services
immediately below it and provides services for the layer
immediately above it
ƒ between machines, layer x on one machine communicates
with layer x on another machine
ƒ Two important network models or architectures
ƒ The ISO OSI (Open Systems Interconnection) Reference
Model
ƒ The TCP/IP Reference Model
a. The OSI Reference Model
ƒ consists of 7 layers
ƒ was never fully implemented as a protocol stack, but a
good theoretical model
ƒ Open – to connect open systems or systems that are open
for communication with other systems
7
layers, interfaces, and protocols in the OSI model

8
Media (lower) Layers
ƒ Physical: Physical characteristics of the media
ƒ Data Link: Reliable data delivery across the link
ƒ Network: Managing connections across the network
or routing
ƒ Transport: End-to-end connection and reliability (handles
lost packets); TCP (connection-oriented),
UDP (connectionless), etc.
ƒ Session: Managing sessions between applications
(dialog control and synchronization); rarely
supported
ƒ Presentation: Data presentation to applications; concerned
with the syntax and semantics of the
information transmitted
ƒ Application: Network services to applications; contains
protocols that are commonly needed by
users; FTP, HTTP, SMTP, ...
Host (upper) Layers
9
a typical message as it appears on the network

10
b. The TCP/IP Reference Model
ƒ TCP/IP - Transmission Control Protocol/Internet Protocol
ƒ used by ARPANET and its successor the Internet
ƒ design goals
ƒ the ability to connect multiple networks (internetworking)
in a seamless way
ƒ the network should be able to survive loss of subnet
hardware, i.e., the connection must remain intact as long
as the source and destination machines are properly
functioning
ƒ flexible architecture to accommodate requirements of
different applications - ranging from transferring files to
real-time speech transmission
ƒ these requirements led to the choice of a packet-switching
network based on a connectionless internetwork layer
ƒ has 4 (or 5 depending on how you see it) layers:
Application, Transport, Internet (Internetwork), Host-to-
network (some split it into Physical and Data Link) 11
ƒ OSI and TCP/IP Layers Correspondence

12
ƒ Layers involved in various hosts (TCP/IP)
ƒ when a message is sent from device A to device B, it may
pass through many intermediate nodes
ƒ the intermediate nodes usually involve the first three layers

13
ƒ 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) - see later in Chapter 8
ƒ middleware communication protocols (calling a procedure
or invoking an object remotely, synchronizing streams for
real-time data, multicast services) - see later in this Chapter
ƒ hence an adapted reference model for networked
communications is required

14
an adapted reference model for networked communication

15
4.2 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?

16
ƒ 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


call: the stack before the call to read procedure is active

ƒ parameters can be call-by-value (fd and bytes) or call-by


reference (buf) or in some languages call-by-copy/restore 17
ƒ 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

principle of RPC between a client and server program


ƒ when a program is compiled, it uses different versions of
library functions called client stubs
ƒ a server stub is the server-side equivalent of a client stub
18
ƒ 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
) server machine vs server process; client machine vs client process
19
ƒ Parameter Passing
1. Passing Value Parameters
ƒ e.g., consider a remote procedure add(i, j), where i and j
are integer parameters

steps involved in doing remote computation through RPC


20
ƒ the above discussion applies if the server and the client
machines are identical
ƒ but that is not the case in large distributed systems
ƒ the machines may differ in data representation (e.g., IBM
mainframes use EBCDIC whereas IBM PCs use ASCII)
ƒ there are also differences in representing integers(1’s
complement or 2’s complement) and floating-point numbers
ƒ byte numbering may be different (from right to left in Pentium
called little endian and left to right in SPARC, big endian)
ƒ e.g.
ƒ consider a procedure with two parameters, an integer and a
four-character string; each one 32-bit word (5, “JILL”)
ƒ the sender is Intel and the receiver is SPARC

21
original message on the Pentium
(the numbers in boxes indicate the address of each byte)

the message after receipt on the SPARC; wrong integer (224+226 =


83,886,080), but correct string

22
ƒ one approach is to invert the bytes of each word after
receipt

the message after being inverted (correct integer but wrong string)

 additional information is required to tell which is an


integer and which is a string

23
2. Passing Reference Parameters
ƒ assume the parameter is a pointer to an array
ƒ copy the array into the message and send it to the server
ƒ the server stub can then call the server with a pointer to this
array
ƒ the server then makes any changes to the array and sends it
back to the client stub which copies it to the client
ƒ this is in effect call-by-copy/restore
ƒ optimization of the method
ƒ one of the copy operations can be eliminated if the stub
knows whether the parameter is input or output to the
server
ƒ if it is an input to the server (e.g., in a call to write), it need
not be copied back
ƒ if it is an output, it need not be sent over in the first place;
only send the size
ƒ the above procedure can handle pointers to simple arrays
and structures, but difficult to generalize it to an arbitrary
data structure
24
ƒ Parameter Specification and Stub Generation
ƒ the caller and the callee need to use the same protocol
(format of messages) and the same steps; with such rules the
client and server stubs can assemble, communicate, and
interpret messages correctly
ƒ consider the following example; the procedure foobar has 3
parameters: a character, a floating point number, and an array
of 5 integers

ƒ assume a word is 4 bytes


ƒ one possibility is to transmit the character
in the rightmost byte, a float as a whole
word, and an array as a group of words
equal to the array length preceded by a
word giving the length
ƒ this way both client stub and server stub
can understand outgoing and incoming the corresponding message
25
messages
ƒ other issues that need the agreement of the client and the
server
ƒ how are simple data structures like integers (e.g. 2’s
complement), characters (e.g. 16-bit Unicode), Booleans, ...
represented?
ƒ endianess
ƒ which transport protocol to use - the connection-oriented
TCP or the unreliable connectionless UDP

26
Asynchronous RPC
ƒ a shortcoming of the original model is that it is blocking: but
no need of blocking for the client in some cases
ƒ two cases
1. if there is no result to be returned
ƒ e.g., inserting records in a database, ...
ƒ the server immediately sends an ack promising that it
will carryout the request
ƒ the client can now proceed without blocking

a) the interconnection between client and server in a traditional RPC


b) the interaction using asynchronous RPC 27
2. if the result can be collected later
ƒ e.g., prefetching network addresses of a set of hosts, ...
ƒ the server immediately sends an ack promising that it
will carryout the request
ƒ the client can now proceed without blocking
ƒ the server later sends the result

a client and server interacting through two asynchronous RPCs


28
ƒ the above method combines two asynchronous RPCs
and is sometimes called deferred synchronous RPC
ƒ variants of asynchronous RPC
ƒ let the client continue without waiting even for an ack,
called one-way RPC
ƒ problem: if reliability of communication is not guaranteed

29
ƒ DCE (Distributed Computing Environment) RPC
ƒ a middleware and an example RPC system developed by
OSF (Open Software Foundation), now The Open Group; it
is designed to execute as a layer of abstraction between
existing OSs and distributed applications
ƒ available as open source and vendors integrate it into their
systems (http://www.opengroup.org/dce/)
ƒ it uses the client-server programming model and
communication is by means of RPCs
ƒ services
ƒ distributed file service: a worldwide file system that
provides a transparent way of accessing files
ƒ directory service: to keep track of the location of all
resources in the system (machines, printers, data,
servers, ...); a process can ask for a resource without
knowing its location
ƒ security service: for protecting resources; access is only
through authorization
30
ƒ distributed time service: to maintain clocks on different
machines synchronized (clock synchronization is covered
in Chapter 6)
ƒ Steps in writing a Client and a Server in DCE RPC
ƒ the system consists of languages, libraries, daemons,
utility programs, ... for writing clients and servers
ƒ IDL (Interface Definition Language) is the interface
language - the glue that holds everything together
ƒ it allows procedure declarations (similar to function
prototypes in C++)
ƒ it contains type definitions, constant declarations,
information needed to marshal parameters and
unmarshal results, and what the procedures do (only
their syntax)

31
Edit file

ƒ Uuidgen generates a prototype IDL file with a globally unique


interface identifier (for uniqueness, the location and time of
creation is embedded) 32
ƒ the IDL file is edited (filling the names of the remote
procedures and their parameters) and the IDL compiler is
called to generate 3 files
ƒ the application writer writes the client and server codes and
are then compiled and linked together with the stubs
ƒ Binding a Client to a Server in DCE RPC
ƒ binding means locating the correct server and setting up
communication between client and server software
ƒ for a client to call a server, the server must be registered
with the daemon (1 & 2 in the following figure)
ƒ the registration allows the client to locate the server and
bind to it
ƒ the DCE daemon maintains a table (server, endpoint) and the
protocols the server uses
ƒ the directory server maintains the locations of all resources
in the system (machines, servers, data,, ...)

33
ƒ two steps for locating the server
ƒ locate the server’s machine (3)
ƒ locate the server process on that machine (with an
endpoint or port) (4)
ƒ now the RPC can take place; the above look up information
can be stored for subsequent RPCs

client-to-server binding in DCE


ƒ Others RPC systems: Sun RPC and DCOM (Microsoft's
system for distributed computing - Distributed Component
Object Model) 34
4.3 Remote Object (Method) Invocation (RMI)
(Chapter 10: Distributed Object-Based Systems; from page 443)
ƒ resulted from object-based technology that has proven its
value in developing nondistributed 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 an interface
ƒ 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 to as a distributed object
35
ƒ if the state of an object is not distributed, but only the
interfaces are, then such an object is referred to as a remote
object
ƒ 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

36
common organization of a remote object with client-side proxy

37
ƒ Object Servers
ƒ an object server is a server to support distributed objects
ƒ it does not provide a specific service; services are
implemented by the objects that reside on the server
ƒ the server provides only the means to invoke local objects
based on remote client requests

ƒ Alternatives for Invoking Objects


ƒ to invoke an object, the object server needs to know
ƒ which code to execute
ƒ on which data it should operate
ƒ whether it should start a separate thread
ƒ ...

38
ƒ different approaches exist
1.assume that all objects look alike and there is only one way to
invoke an object like in DCE; inflexible
2.let a server support different policies
ƒ transient versus persistent objects
ƒ transient object: create it at first request and destroy it if
no clients are bound to it or
ƒ persistent object: it exists even if it is not currently used
ƒ separate or shared memory
ƒ put each object in a memory segment of its own, i.e.,
objects share neither code nor data; protection of
segments required, probably by the underlying OS or
ƒ objects can at least share code
ƒ threading
ƒ implement the server with a single thread of control; or
ƒ the server may have several threads, one for each of its
objects
39
ƒ Object Adaptor
ƒ activation policies: decisions on how to invoke an object
ƒ object adaptor (wrapper): to group objects per policy; it is a
software for implementing a specific activation policy
ƒ an object adaptor has one or more objects under its control

organization of an object server supporting different activation policies 40


ƒ Binding a Client to an Object
ƒ a process must first bind to an object before invoking its
methods, which results in a proxy being placed in the
process’s address space
ƒ binding can be implicit (directly invoke methods using
only a reference to an object) or explicit (by calling a
special function)
Distr_object* obj_ref; // Declare a systemwide object reference
obj_ref = …; // Initialize the reference to a distributed object
obj_ref→do_something(); // Implicitly bind and invoke a method
(a)
Distr_object obj_ref; // Declare a systemwide object reference
Local_object* obj_ptr; // Declare a pointer to local objects
obj_ref = …; // Initialize the reference to a distributed object
obj_ptr = bind(obj_ref); // Explicitly bind and obtain a pointer to the local proxy
obj_ptr→do_something(); // Invoke a method on the local proxy
(b)

(a) an example with implicit binding using only global references


(b) an example with explicit binding using global and local references
41
ƒ an object reference could contain
ƒ network address of the machine where the object
resides
ƒ endpoint of the server
ƒ an identification of which object
ƒ the protocol used
ƒ ...
ƒ 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

42
the situation when passing an object by reference or by value

ƒ example object-based systems:


ƒ DCE Remote Objects ƒ Globe
ƒ Java RMI ƒ ICE
ƒ Java Beans ƒ CORBA
43
4.4 Message-Oriented Communication
ƒ 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
ƒ messaging is the solution

44
ƒ Persistence and Synchronicity in Communication
ƒ assume the communication system is organized as a
computer network shown below

general organization of a communication system in which hosts are


connected through a network

45
ƒ communication can be
ƒ persistent or transient
ƒ asynchronous or synchronous
ƒ persistent: a message that has been submitted for
transmission is stored by the communication system as long
as it takes to deliver it to the receiver
ƒ e.g., e-mail delivery, snail mail delivery
ƒ transient: a message that has been submitted for
transmission is stored by the communication system only as
long as the sending and receiving applications are executing
ƒ asynchronous: a sender continues immediately after it has
submitted its message for transmission
ƒ synchronous: the sender is blocked until its message is
stored in a local buffer at the receiving host or delivered to the
receiver

46
ƒ Message-Oriented Transient Communication
ƒ many applications are built on top of the simple
message-oriented model offered by the transport layer
ƒ standardizing the interface of the transport layer by
providing a set of primitives allows programmers to use
messaging protocols
ƒ they also allow porting applications

1. Berkley Sockets
ƒ an example is the socket interface as used in Berkley
UNIX
ƒ a socket is a communication endpoint to which an
application can write data that are to be sent over the
network, and from which incoming data can be read

47
Primitive Meaning Executed by
Socket Create a new communication endpoint both
Attach a local address to a socket; e.g., IP
Bind
address with a known port number
Announce willingness to accept connections; servers
Listen
non-blocking
Accept Block caller until a connection request arrives
Actively attempt to establish a connection; the
Connect clients
client is blocked until connection is set up
Send Send some data over the connection
Receive Receive some data over the connection both
Close Release the connection

socket primitives for TCP/IP

48
connection-oriented communication pattern using sockets

49
2. 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

50
Primitive Meaning
Append outgoing message to a local send buffer (for
MPI_bsend
transient asynchronous communication)
Send a message and wait until copied to local or remote
MPI_send
buffer; semantics are implementation dependent
Send a message and wait until receipt starts (for transient
MPI_ssend
synchronous communication)
Send a message and wait for reply; strongest form; similar
MPI_sendrecv
to RPC (synchronous)
Pass reference to outgoing message (not copying the
MPI_isend
message), and continue (asynchronous)
Pass reference to outgoing message (not copying the
MPI_issend
message), and wait until receipt starts (synchronous)
MPI_recv Receive a message; block if there are none (synchronous)
Check if there is an incoming message, but do not block
MPI_irecv
(asynchronous)

some of the most intuitive message-passing primitives of MPI

51
ƒ Message-Oriented Persistent Communication
ƒ there are message-oriented middleware services, called
Message-Queuing Systems or Message-Oriented
Middleware (MOM)
ƒ they support persistent asynchronous communication
ƒ they have intermediate-term storage capacity for messages,
without requiring the sender or the receiver to be active
during message transmission
ƒ unlike Berkley sockets and MPI, message transfer may take
minutes instead of seconds or milliseconds
ƒ Message-Queuing Model
ƒ applications communicate by inserting messages in
specific queues
ƒ it permits loosely-coupled communication
ƒ the sender may or may not be running; similarly the
receiver may or may not be running, giving four possible
combinations
52
four combinations for loosely-coupled communications using queues

(a) both are executing during the transmission of a message


(b) the sender is executing, but the receiver is not
(c) the receiver can read the message while the sender is
not executing
(d) the system is storing and possibly transmitting even if
both are not executing 53
Primitive Meaning
Append a message to a specified queue; by the sender
Put
and is nonblocking
Remove the first (longest pending) message; block if
Get
queue is empty
Check a specified queue for messages, and remove
Poll
the first; never block; nonblocking variant of Get
Install a handler (by the receiver) to be called when a
Notify message is put into the specified queue; usually a
daemon
basic interface to a queue in a message-queuing system

54
ƒ General Architecture of a Message-Queuing System
ƒ messages can be put only into queues that are local to the
sender (same machine or on a nearby machine on a LAN)
ƒ such a queue is called the source queue
ƒ messages can also be read only from local queues
ƒ a message put into a local queue must contain the
specification of the destination queue; hence a message-
queuing system must maintain a mapping of queues to
network locations; like in DNS

the relationship between queue-level addressing and network-level addressing 55


ƒ queues are managed by queue managers
ƒ they generally interact with the application that sends and
receives messages
ƒ some also serve as routers or relays, i.e., they forward
incoming messages to other queue managers
ƒ however, each queue manager needs a copy of the queue-
to-location mapping, leading to network management
problems for large-scale queuing systems
ƒ the solution is to use a few routers that know about the
network topology
ƒ hence, only routers need to be updated when queues are
added or removed
ƒ this helps to build scalable message-queuing systems

56
the general organization of a message-queuing system with routers
57
ƒ Message Brokers
ƒ how can applications understand the messages they receive
ƒ each receiver can not be made to understand message
formats of new applications
ƒ hence, in a message-queuing system conversations are
handled by message brokers
ƒ a message broker converts incoming messages to a format
that can be understood by the destination application based
on a set of rules

the general organization of a message broker in a message-queuing system 58


ƒ as an example, read about IBM’s WebSphere Message-
Queuing System; pages 152-157

59
4.5 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 60
ƒ The Challenge
ƒ new applications
ƒ multimedia will be pervasive in few years (as graphics)
ƒ continuous delivery
ƒ e.g., 30 frames/s (NTSC), 25 frames/s (PAL) for video
ƒ guaranteed Quality of Service
ƒ admission control
ƒ 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)
ƒ search
ƒ can we look at 100… videos to find the proper one?

61
ƒ 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; e.g., TCP provides
byte-oriented discrete data streams
ƒ stream-oriented communication provides facilities for the
exchange of time-dependent information (continuous media)
such as audio and video streams

62
ƒ 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,
called substreams, that must be synchronized; e.g., stereo
audio, video consisting of audio and video (may also contain
subtitles, translation to other languages, ...) 63
movie as a set of simple streams

64
ƒ a stream can be considered as a virtual connection between a
source and a sink
ƒ the source or the sink could be a process or a device
ƒ streaming means a user can listen (or watch) after the
downloading has started
ƒ we can stream stored data or live data (compression, actually
encoding is required)

A general architecture for streaming stored multimedia data over a network

65
setting up a stream directly between two devices - live data

66
ƒ the data stream can also be multicasted to several receivers
ƒ if devices and the underlying networks have different
capabilities, the stream may be filtered, generally called
adaptation (filtering?, transcoding?)

an example of multicasting a stream to several receivers

67
ƒ Quality of Service (QoS)
ƒ timing and other nonfunctional requirements are expressed
as Quality of Service requirements
ƒ QoS requirements describe what is needed from the
underlying distributed system and network to ensure
acceptable delivery; e.g. viewing experience of a user
ƒ for continuous data, the concerns are
ƒ timeliness: data must be delivered in time
ƒ initial delay: maximum delay until a session has been
setup
ƒ maximum end-to-end delay
ƒ maximum delay variance or jitter
ƒ volume/bandwidth: the required throughput (bit rate) must
be met
ƒ reliability: a given level of loss of data must not be
exceeded
ƒ quality of perception: highly subjective
68
ƒ Enforcing QoS
ƒ the underlying system offers a best-effort delivery service
ƒ however, the Internet also provides mechanisms such as
differentiated services which categorizes packets into many
classes; for example, it has an expedited class to inform the
router to forward a packet with absolute priority
ƒ in addition, a distributed system can help to improve QoS
ƒ three methods: buffering, forward error correction, and
interleaving frames
1. Buffering - Client Side
ƒ buffer (store) flows on the receiving side (client machine)
before delivery (playback)
ƒ it smoothes jitter (for audio and video on demand since
jitter is the main problem) - does not affect reliability or
bandwidth, increases delay

69
how long to buffer?
2. Forward Error Correction - Client Side
ƒ packets may be lost
ƒ retransmission is not applicable for time-dependent data
ƒ the overhead for forward error correction may be high

70
3. Interleaving Frames - Server Side
ƒ a single packet may contain multiple audio and video frames
ƒ if such a packet is lost, there will be a large gap during play
back
ƒ hence, the idea is to distribute the effect of a packet loss
over time
ƒ but, a larger buffer is required at the receiver/client
ƒ for example, to play the first four frames, four packets need
to be delivered and stored

71
The effect of packet loss in (a) non interleaved transmission and
(b) interleaved transmission

72
ƒ Stream Synchronization
ƒ how to maintain temporal relations between streams
ƒ examples: lip synchronization or a slide show enhanced with
audio
ƒ two approaches
1. explicitly by operating on the data units of simple
streams; the responsibility of the application (not good
for applications to do it)

the principle of explicit synchronization on the level of data units 73


2. through a multimedia middleware that offers a collection of
interfaces for controlling audio and video streams as well as
devices such as monitors, cameras, microphones, ...

the principle of synchronization as supported by high-level interfaces

74
4.6 Multicast Communication
ƒ multicasting: delivery of data from one host to many
destinations; for instance for multimedia applications
ƒ a one-to-many relationship
1. Application-Level Multicasting
ƒ nodes are organized into an overlay network (a network
which is built on top of another network) and information is
disseminated to its members (routers are not involved as in
network-level routing)
ƒ how to construct the overlay network
ƒ nodes organize themselves as a tree with a unique path
between two pairs of nodes or
ƒ nodes organize into a mesh network and there will be
multiple paths between two nodes; adv: robust
2. Gossip-Based Data Transmission
ƒ use epidemic protocols where information is propagated
among a collection of nodes without a coordinator
ƒ for details read pages 166-174 75

You might also like