Distributed Systems F 2 - 1 Distributed Systems F 2 - 2
MODELS OF DISTRIBUTED SYSTEMS Basic Elements
Resources in a distributed system are shared
between users. They are normally encapsulated
within one of the computers and can be accessed
from other computers by communication.
1. Architectural Models
Each resource is managed by a program, the
resource manager; it offers a communication
2. Interaction Models interface enabling the resource to be accessed by
its users.
3. Fault Models
Resource managers can be in general modelled as
processes.
If the system is designed according to an object-
oriented methodology, resources are encapsulated
in objects.
Petru Eles, IDA, LiTH Petru Eles, IDA, LiTH
Distributed Systems F 2 - 3 Distributed Systems F 2 - 4
Architectural Models Client - Server
How are responsibilities distributed between system
components and how are these components placed?
The system is structured as a set of processes,
called servers, that offer services to the users, called
Client-server model clients.
Peer-to-peer
The client-server model is usually based on a
simple request/reply protocol, implemented with
Variations of the above two:
send/receive primitives or using remote procedure
calls (RPC) or remote method invocation (RMI):
Proxy server - the client sends a request (invocation) message
Mobile code to the server asking for some service;
Mobile agents - the server does the work and returns a result
Network computers (e.g. the data requested) or an error code if the
work could not be performed.
Thin clients
Mobile devices
Petru Eles, IDA, LiTH Petru Eles, IDA, LiTH
Distributed Systems F 2 - 5 Distributed Systems F 2 - 6
Client - Server (contd) Peer-to-Peer
All processes (objects) play similar role.
client Processes (objects) interact without particular
client distinction between clients and servers.
The pattern of communication depends on the
server
particular application.
client server A large number of data objects are shared; any
individual computer holds only a small part of the
application database.
request: process (object): Processing and communication loads for access to
result: objects are distributed across many computers and
computer (node):
access links.
This is the most general and flexible model.
A server can itself request services from other
servers; thus, in this new relation, the server itself peer peer
acts like a client.
peer peer
Petru Eles, IDA, LiTH Petru Eles, IDA, LiTH
Distributed Systems F 2 - 7 Distributed Systems F 2 - 8
Peer-to-Peer (contd) Variations of the Basic Models
Some problems with client-server:
Centralisation of service poor scaling Client-server and peer-to-peer can be considered as
basic models.
- Limitations:
capacity of server
bandwidth of network connecting the server
Several variations have been proposed, with
considering factors such as:
Peer-to-Peer tries to solve some of the above - multiple servers and caches
- mobile code and mobile agents
It distributes shared resources widely
- low-cost computers at the users side
- mobile devices
share computing and communication loads.
Problems with peer-to-peer:
High complexity due to
- cleverly place individual objects
- retrieve the objects
- maintain potentially large number of replicas.
Petru Eles, IDA, LiTH Petru Eles, IDA, LiTH
Distributed Systems F 2 - 9 Distributed Systems F 2 - 10
Proxy Server Mobile Code
A proxy server provides copies (replications) of
resources which are managed by other servers. Mobile code: code that is sent from one computer to
another and run at the destination.
server Advantage: remote invocations are replaced by local ones.
client
Typical example: Java applets.
proxy
server
Step 1: load applet
client server
client server
applet code
Proxy servers are typically used as caches for web
Step 2: interact with applet
resources. They maintain a cache of recently
visited web pages or other resources.
When a request is issued by a client, the proxy client applet server
server is first checked, if the requested object
(information item) is available there.
Proxy servers can be located at each client, or can
be shared by several clients.
The purpose is to increase performance and
availability, by avoiding frequent accesses to
remote servers.
Petru Eles, IDA, LiTH Petru Eles, IDA, LiTH
Distributed Systems F 2 - 11 Distributed Systems F 2 - 12
Mobile Agents Network Computers
Network computers
Mobile agent: a running program that travels from
one computer to another carrying out a task on
someones behalf.
A mobile agent is a complete program, code + data,
that can work (relatively) independently.
Network
The mobile agent can invoke local resources/data.
Typical tasks:
Collect information servers
Install/maintain software on computers
Compare prises from various vendors bay visiting Network computers do not store locally operating
their sites. system or application code. All code is loaded from
the servers and run locally on the network computer.
Advantages:
Attention: potential security risk (like mobile code)!
The network computer can be simpler, with limited
capacity; it does not need even a local hard disk (if
there exists one it is used to cache data or code).
Users can log in from any computer.
No user effort for software management/
administration.
Petru Eles, IDA, LiTH Petru Eles, IDA, LiTH
Distributed Systems F 2 - 13 Distributed Systems F 2 - 14
Thin Clients Mobile Devices
Mobile devices are hardware, computing components
The thin client is a further step, beyond the network that move (together with their software) between
computer: physical locations.
Thin clients do not download code (operating
system or application) from the server to run it This is opposed to software agents, which are
locally. All code is run on the server, in parallel for software components that migrate.
several clients.
The thin client only runs the user interface! Both clients and servers can be mobile (clients
more frequently).
Advantages: Particular problems/issues:
All those of network computers but the computer at
the user side is even simpler (cheaper). Mobility transparency: clients should not be aware if
the server moves (e.g., the server keeps its Internet
address even if it moves between networks).
Problems due to variable connectivity and
Strong servers are needed! bandwidth.
The device has to explore its environment:
- Spontaneous interoperation: associations
between devices (e.g. clients and servers) are
dynamically created and destroyed.
- Context awareness: available services are
dependent on the physical environment in
which the device is situated.
Petru Eles, IDA, LiTH Petru Eles, IDA, LiTH
Distributed Systems F 2 - 15 Distributed Systems F 2 - 16
Synchronous Distributed Systems
Interaction Models
Main features:
Lower and upper bounds on execution time of
processes can be set.
How do we handle time? Are there time limits on process
execution, message delivery, and clock drifts? Transmitted messages are received within a known
bounded time.
Synchronous distributed systems Drift rates between local clocks have a known
bound.
Asynchronous distributed systems Important consequences:
1. In a synchronous distributed system there is a
notion of global physical time (with a known relative
precision depending on the drift rate).
2. Only synchronous distributed systems have a
predictable behaviour in terms of timing. Only such
systems can be used for hard real-time
applications.
3. In a synchronous distributed system it is possible
and safe to use timeouts in order to detect failures
of a process or communication link.
It is difficult and costly to implement synchronous
distributed systems.
Petru Eles, IDA, LiTH Petru Eles, IDA, LiTH
Distributed Systems F 2 - 17 Distributed Systems F 2 - 18
Asynchronous Distributed Systems
Asynchronous Distributed Systems (contd)
Many distributed systems (including those on the
Internet) are asynchronous.
No bound on process execution time (nothing can Asynchronous systems are widely and successfully
be assumed about speed, load, reliability of used in practice.
computers).
No bound on message transmission delays In practice timeouts are used with asynchronous
(nothing can be assumed about speed, load, systems for failure detection.
reliability of interconnections) However, additional measures have to be applied in
order to avoid duplicated messages, duplicated
No bounds on drift rates between local clocks. execution of operations, etc.
Important consequences:
1. In an asynchronous distributed system there is no
global physical time. Reasoning can be only in
terms of logical time (see lecture on time and
state).
2. Asynchronous distributed systems are
unpredictable in terms of timing.
3. No timeouts can be used.
Petru Eles, IDA, LiTH Petru Eles, IDA, LiTH
Distributed Systems F 2 - 19 Distributed Systems F 2 - 20
Fault Models Omission Faults
What kind of faults can occur and what are their effects?
Omission faults A processor or communication channel fails to
perform actions it is supposed to do.
Arbitrary faults This means that the particular action is not performed!
Timing faults We do not have an omission fault if:
- An action is delayed (regardless how long) but
finally executed.
Faults can occur both in processes and - An action is executed with an erroneous result.
communication channels. The reason can be both
software and hardware faults.
With synchronous systems, omission faults can be
Fault models are needed in order to build systems detected by timeouts.
with predictable behaviour in case of faults (systems If we are sure that messages arrive, a timeout
which are fault tolerant). will indicate that the sending process has
crashed. Such a system has a fail-stop
Of course, such a system will function according to behaviour.
the predictions, only as long as the real faults behave
as defined by the fault model. If not .......
These issues will be discussed in some of the
following chapters and in particular in the chapter on
Recovery and Fault Tolerance.
Petru Eles, IDA, LiTH Petru Eles, IDA, LiTH
Distributed Systems F 2 - 21 Distributed Systems F 2 - 22
Arbitrary (Byzantine) Faults Summary
Models can be used to provide an abstract and
This is the most general and worst possible fault simplified description of certain relevant aspects of
semantics. distributed systems.
Intended processing steps or communications are Architectural models define the way responsibilities
omitted or/and unintended ones are executed. are distributed among components and how they
Results may not come at all or may come but carry are placed in the system.
wrong values.
We have studied three architectural models:
1. Client-server model
2. Peer-to-peer
3. Several variations of the two
Timing Faults
Interaction models deal with how time is handled
throughout the system.
Timing faults can occur in synchronous distributed Two interaction models have been introduced:
systems, where time limits are set to process 1. Synchronous distributed systems
execution, communications, and clock drifts. 2. Asynchronous distributed systems
A timing fault occurs if any of this time limits is
exceeded. The fault model specifies what kind of faults can
occur and what their effects are.
Fault models:
1. Omission faults
2. Arbitrary faults
3. Timing faults
Petru Eles, IDA, LiTH Petru Eles, IDA, LiTH