CHAPTER 2 Ds Part 1
CHAPTER 2 Ds Part 1
SYSTEM MODELS
System models describe common properties and design choices for distributed system
in a single descriptive model. The system models of distributed systems are classified into the
following types:
27
Distrubuted Systems 2.2
Physical models: It is the most explicit way in which to describe a system in terms
of hardware composition.
Architectural models: They describe a system in terms of the computational and
communication tasks performed by its computational elements.
Fundamental models: They examine individual aspects of a distributed system.
They are again classified based on some parameters as follows:
Interaction models: This deals with the structure and sequencing of the
communication between the elements of the system
Failure models: This deals with the ways in which a system may fail to
operate correctly
Security models: This deals with the security measures implemented in the
system against attempts to interfere with its correct operation or to steal its
data.
Physical Models
A physical model is a representation of the underlying hardware elements of a distributed system hide
There are many physical models available from the primitive baseline model to the
complex models that could handle cloud environments.
Baseline physical model:
This is a primitive model that describes the hardware or software components
located at networked computers.
The communication and coordination of their activities is done by passing
messages.
It has very limited internet connectivity and can support a small range of
services such as shared local printers and file servers.
The nodes were desktop computers and therefore relatively static, discrete and
independent.
Mobile computing has led to physical models with movable nodes. Service
discovery is of primary concern in these systems.
The cloud computing and cluster architectures hassled to pools of nodes that
collectively provide a given service. This resulted in enormous number of
systems given the service.
The architecture abstracts the functions of the individual components of the distributed system.
Architectural Models
This describes the components and their interrelationships to ensure the system is
reliable, manageable, adaptable and cost-effective. The different models are evaluated based
on the following criteria:
architectural elements
architectural patterns
middleware platforms
Architectural elements
The following must be decided to build a distributed system:
Communicating entities (objects, components and web services);
Communication paradigms (inter process communication, remote invocation
and indirect communication);
Roles responsibilities and placement
Communicating entities
The components that are communicating and how those entities communicate together
are dealt here. The following are some of the problem oriented entities:
27
Distrubuted Systems 2.5
Objects: They are used to implement object oriented approaches in distributed
systems. Objects are accessed through interfaces.
Components: Components resemble objects and they offer problem-oriented
abstractions for building distributed systems. They are also accessed through
interfaces. The key difference between component and object is that a components
holds all the assumptions specified to other components and their interfaces in the
system. Components and objects are used to develop tightly coupled applications.
Web services: Web services are closely related to objects and components. Web
services are integrated into the World Wide Web. They are partially defined by the
web-based technologies they adopt. Web services are generally viewed as
complete services that can be combined to achieve value-added services across
organizational boundaries.
Communication paradigms
There are three major modes of communication in distributed systems:
Interprocess communication:
This is a low-level support for communication between processes in distributed
systems, including message-passing primitives. They have direct access to the API
offered by Internet protocols and support multicast communication.
Remote invocation:
It is used in a distributed system and it is the calling of a remote operation,
procedure or method.
a) Request-reply protocols:
This is a message exchange pattern in which a requestor sends a request message
to a replier system which receives and processes the request, ultimately returning a
message in response. This is a simple, but powerful messaging pattern which
allows two applications to have a two-way conversation with one another over a
channel. This pattern is especially common in client–server architectures.
27
Distrubuted Systems 2.6
b) Remote procedure calls: Remote Procedure Call (RPC) is a protocol that one
program can use to request a service from a program located in another computer
in a network without having to understand network details.
c) Remote method invocation: RMI (Remote Method Invocation) is a way that a
programmer can write object-oriented programming in which objects on different
computers can interact in a distributed network. This has the following two key
features:
Space uncoupling: Senders do not need to know who they are sending to
Time uncoupling: Senders and receivers do not need to exist at the same time
Indirect communication
Key techniques for indirect communication include:
a) Group communication: Group communication is concerned with the delivery
of messages to a set of recipients and hence is a multiparty communication
paradigm supporting one-to-many communication. A group identifier uniquely
identifies the group. The recipients join the group and receive the messages.
Senders send messages to the group based on the group identifier and hence do
not need to know the recipients of the message.
b) Publish-subscribe systems: This is a messaging pattern where senders
of messages, called publishers, do not program the messages to be sent directly
to specific receivers, called subscribers. Instead, published messages are
characterized into classes, without knowledge of what, subscribers there may
be. Similarly, subscribers express interest in one or more classes, and only
receive messages that are of interest, without knowledge of what, if any,
publishers there are. They offer one-to-many style of communication.
c) Message queues: They offer a point-to-point service whereby producer
processes can send messages to a specified queue and consumer processes can
receive messages from the queue or be notified of the arrival of new messages
in the queue. Queues therefore offer an indirection between the producer and
consumer processes.
d) Tuple spaces: The processes can place arbitrary items of structured data,
called tuples, in a persistent tuple space and other processes can either read or
remove such tuples from the tuple space by specifying patterns of interest. This
style of programming is known as generative communication.
e) Distributed shared memory: In computer architecture, distributed shared
memory (DSM) is a form of memory architecture where the (physically
separate) memories can be addressed as one (logically shared) address space.
Here, the term shared does not mean that there is a single centralized memory
but shared essentially means that the address space is shared (same physical
address on two processors refers to the same location in memory
27
Distrubuted Systems 2.7
1) Client-server:
The system is structured as a set of processes, called servers, that offer services
to the users, called clients.
The client-server model is usually based on a simple request/reply protocol,
implemented with send/receive primitives or using remote procedure calls
(RPC) or remote method invocation (RMI).
The client sends a request (invocation) message to the server for some
asking service; - the server does the work and returns a result (e.g. requested)
the data or an error code if the work could not be performed.
A server can itself request services from other servers; thus, in this new
relation, the server itself acts like a client.
27
Distrubuted Systems 2.9
Placement
Mapping of objects or services to the underlying physical distributed infrastructure is
considered here. The following points must be taken care while placing the objects: reliability,
communication pattern, load, QOS etc. The following are the placement strategies:
Mapping of services to multiple servers
The servers may partition the set of objects on which the service is based and
distribute those objects between themselves, or they may maintain replicated
copies of them on several hosts.
The Web provides a common example of partitioned data in which each web
server manages its own set of resources. A user can employ a browser to access
a resource at any one of the servers.
Caching
A cache is a local store of recently used data objects that is closer to one client
or a particular set of clients than the objects themselves.
When a new object is received from a server it is added to the local cache store,
replacing some existing objects if necessary.
27
Distrubuted Systems 2.9
When an object is needed by a client process, the caching service first checks
the cache and supplies the object from there if an up-to-date copy is available.
If not, an up-to-date copy is fetched.
Caches may be co-located with each client or they may be located in a proxy
server that can be shared by several clients.
Mobile code:
Applets are a well-known and widely used example of mobile code.
The user running a browser selects a link to an applet whose code is stored on a
web server; the code is downloaded to the browser and runs.
They provide interactive response.
Mobile agents:
A mobile agent is a running program (including both code and data) that
travels from one computer to another in a network carrying out a task on
someone‟s behalf, such as collecting information, and eventually returning
with the results.
A mobile agent is a complete program, code + data, that can work (relatively)
independently.
The mobile agent can invoke local resources/data.
A mobile agent may make many invocations to local resources at each site it
visit.
Typical tasks of mobile agent includes: collect information , install/maintain
software on computers, compare prices from various vendors bay visiting their
sites etc.
Mobile agents (like mobile code) are a potential security threat to the resources
in computers that they visit.
Architectural patterns
Architectural patterns are reusable solution to a commonly occurring problem
in software architecture within a given context. They are not complete solutions but rather
offer partial insights. The following are some of the common architectural patterns:
Layering:
In a layered approach, a complex system is partitioned into a number of
layers, with a given layer making use of the services offered by the layer
below.
27
Distrubuted Systems 2.1
0
Tiered architecture
Tiering is a technique to organize functionality of a given layer and place
this functionality into appropriate servers and, as a secondary
consideration, on to physical nodes.
The two tiered architecture refers to client/server architectures in which the
user interface (presentation layer) runs on the client and the database
(data layer) is stored on the server. The actual application logic can run on
either the client or the server.
27
Distrubuted Systems 2.1
1
Middleware is a general term for software that serves to "glue together" separate, often complex and
Categories of middleware
The following are some of the categories of middleware:
Distributed Objects
The term distributed objects usually refers to software modules that are designed to
work together, but reside either in multiple computers connected via a network or
in different processes inside the same computer. One object sends a message to
another object in a remote machine or process to perform some task. The results
are sent back to the calling object.
Distributed Components
A component is a reusable program building block that can be combined with
other components in the same or other computers in a distributed network to form
an application. Examples: a single button in a graphical user interface, a small
interest calculator, an interface to a database manager. Components can be
27
Distrubuted Systems 2.1
4
deployed on different servers in a network and communicate with each other for
needed services. A component runs within a context called a container .
Examples: pages on a Web site, Web browsers, and word processors.
Publish subscriber model
Publish–subscribe is a messaging pattern where senders of messages, called
publishers, do not program the messages to be sent directly to specific receivers,
called subscribers. Instead, published messages are characterized into classes,
without knowledge of what, if any, subscribers there may be. Similarly,
subscribers express interest in one or more classes, and only receive messages that
are of interest, without knowledge of what publishers are there.
Message Queues
Message queues provide an asynchronous communications protocol, meaning that
the sender and receiver of the message do not need to interact with the message
queue at the same time. Messages placed onto the queue are stored until the
recipient retrieves them. Message queues have implicit or explicit limits on the size
of data that may be transmitted in a single message and the number of messages
that may remain outstanding on the queue.
Web services
A web service is a collection of open protocols and standards used for exchanging
data between applications or systems. Software applications written in various
programming languages and running on various platforms can use web services to
exchange data over computer networks like the Internet in a manner similar to
inter-process communication on a single computer. This interoperability (e.g.,
between Java and Python, or Windows and Linux applications) is due to the use of
open standards.
Peer to peer
Peer-to-peer (P2P) computing or networking is a distributed application
architecture that partitions tasks or work load between peers. Peers are equally
privileged, equipotent participants in the application. They are said to form a peer-
to-peer network of nodes.
Advantages of middleware
Real time information access among systems.
Streamlines business processes and helps raise organizational efficiency.
Maintains information integrity across multiple systems.
It covers a wide range of software systems, including distributed Objects and
components, message-oriented communication, and mobile application support.
Middleware is anything that helps developers create networked applications.
27
Distrubuted Systems 2.1
5
Disadvantages of middleware
Prohibitively high development costs.
There are only few people with experience in the market place to develop and use
a middleware.
Fundamental Models are concerned with a formal description of the properties that are common in a
Fundamental Models
Models addressing time synchronization, message delays, failures, security issues are
addressed as:
make explicit all the relevant assumptions about the systems we are modelling.
Interaction model
1) Communication performance
2) Global notion of time.
Communication Performance
The communication channel in can be implemented in a variety of ways in
distributed systems: Streams or through simple message passing over a network.
The performance characteristics of a network are:
a) Latency: A delay between the start of a message‟s transmission from one
process to the beginning of reception by another.
b) Bandwidth: The total amount of information that can be transmitted over in a
given time. The communication channels using the same network, have to
share the available bandwidth.
c) Jitter: The variation in the time taken to deliver a series of messages. It is very
relevant to multimedia data.
Event Modeling
Event ordering is of major concern in DS.
The concept of one event happening before another in a distributed system is
examined, and is shown to define a partial ordering of the events.
The execution of a system can be described in terms of events and their ordering
despite the lack of accurate clocks.
Consider a mailing list with users X, Y, Z, and A.
Due to independent delivery in message delivery, message may be delivered in
different order.
If messages m1, m2, m3 carry their time t1, t2, t3, then they can be displayed to
users accordingly to their time ordering.
The mail box is:
23 Z Re: Meeting
24 X Meeting
26 Y Re: Meeting
27
Distrubuted Systems 2.18
send receive receive
X
1 m1 4
m2
send
2 3 receive
Y Physical
receive time
send
Z
receivereceive
m3m1m2
A receive receivereceive t3
t1 t2
Arbitrary Failure
Timing Failure
a) Omission failure
Omission failures occur due to communication link failures. They are detected through
timeouts. They are classified as:
A fixed period of time is fixed for all the methods to complete its
execution. If the method takes time longer than the allowed time, a time
out has occurred.
In an asynchronous system a timeout can indicate only that a process is
not responding.
A process crash is called fail-stopif other processes can detect certainly
that the process has crashed.
27
Distrubuted Systems 2.19
process p process q
send m receive
Communication channel
Clock Process Process‟s local clock exceeds the bounds on its rate of drift
from real time
Performance Process Process exceeds the bounds on the interval between two steps
Performance Channel A message‟s transmission takes longer than the stated bound.
Masking failures
Each component in a distributed system is generally constructed from a collection
of other components. It is always possible to construct reliable services from
components that exhibit failures.
A knowledge of failure characteristics of a component can enable a new service to
be designed to mask the failure of the components on which it depends.
27
Distrubuted Systems 2.21
The security of a DS can be achieved by securing the processes and the channels used in their interactio
Protection is described in terms of objects, although the concepts apply equally well to
resources of all types.
Protecting objects
This uses use “access rights” that define who is allowed to perform operation on a
object.
The server should verify the identity of the principal (user) behind each operation
and checking that they have sufficient access rights to perform the requested
operation on the particular object, rejecting those who do not.
A principal is an authority that manages the access rights. The principal may be a
user or a process.
Clients:
When a client receives the result of an invocation from a server, it cannot
necessarily tell whether the source of the result message is from the intended
server or from an enemy, perhaps „spoofing‟ the mail server.
Thus the client could receive a result that was unrelated to the original
invocation, such as a false mail item (one that is not in the user‟s mailbox).
Threats to communication channels:
An enemy can copy, alter or inject messages as they travel across the network
and its intervening gateways.
Such attacks present a threat to the privacy and integrity of information as it
travels over the network and to the integrity of the system.
Defeating security threats
Encryption and authentication are use to build secure channels.
Each of the processes knows the identity of the principal on whose behalf the
other process is executing and can check their access rights before performing
an operation.
Other possible threats from an enemy
Denial of service:
Denial of service (DoS) attack is an incident in which a user or organization is
deprived of the services of a resource they would normally expect to have. In a
distributed denial-of-service, large numbers of compromised systems (sometimes
called a botnet) attack a single target.
Mobile code:
Mobile code is software transferred between systems, e.g. transferred across a
network, and executed on a local system without explicit installation by the
recipient. Mobile code raises new and interesting security problems for anyprocess
that receives and executes program code from elsewhere.
The uses of security models
The use of security techniques incurs processing and management costs. The
distributed systems faces threats from various points. The threat analysis demands the
construction of security models.
INTERPROCESS COMMUNICATION
Interprocess communication (IPC) is a set of programming that allow a programmer to coordinate a
27
Distrubuted Systems 2.24
Message destinations
The messages in the Internet protocols, messages are sent to (Internet address,
local port) pairs.
A local port is a message destination with in 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.
Client programs refer to services by name and use a name server or binder to
translate their names into server locations at runtime.
This allows services to be relocated but not to migrate – that is, to be moved
while the system is running.
27
Distrubuted Systems 2.25
Reliability
A point-to-point message service can be described as reliable if messages are
guaranteed to be delivered.
A point-to-point message service can be described as unreliable if messages are
not guaranteed to be delivered in the face of even a single packet dropped or
lost.
Ordering
Some applications require that messages be delivered in the order in which
they were transmitted by the sender.
The delivery of messages outof sender order is regarded as a failure by such
applications.
Sockets
A socket is one endpoint of a two-way communication link between two programs running on the n
For a process to receive messages, its socket must be bound to a local port and one of
the Internet addresses of the computer on which it runs. 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.
Users of this class refer to computers by Domain Name System (DNS) hostnames.
InetAddressaComputer = InetAddress.getByName("abc.ac.in");
In the Java and UNIX APIs, the sender specifies the destination using a socket.
o Creating a socket
Receive() returns Internet address and port of sender, along with the message.
Any application requiring messages larger than the maximum must fragment
them.
27
Blocking:
Distrubuted Systems 2.27
Sockets normally provide non-blocking sends and blocking receives for
datagram communication.
The message is placed in a queue for the socket that is bound to the
destination port.
Timeouts:
The receive() cannot wait indefinitely. This situation occurs when the
sending process may have crashed or the expected message may have been
lost.
The timeouts must be much larger than the time required to transmit a
message.
The receive() does not specify an origin for messages. This can get
datagrams addressed to its socket from any origin.
The receive() returns the Internet address and local port of the sender,
allowing the recipient to check where the message came from.