10 CHAPTER 1.
INTRODUCTION
• As also mentioned, there is no such thing as a nonsecured distributed
system. The security perspective focuses on how to ensure authorized
access to resources. To that end, we need to discuss trust in distributed
systems, along with authentication, namely verifying a claimed identity.
The security perspective comes last, yet later in this chapter we shall
discuss a few basic instruments that are needed to understand the role
of security in the previous perspectives.
1.2 Design goals
Just because it is possible to build distributed systems does not necessarily
mean that it is a good idea. In this section, we discuss four important goals
that should be met to make building a distributed system worth the effort. A
distributed system should make resources easily accessible; it should hide the
fact that resources are distributed across a network; it should be open; and it
should be scalable.
1.2.1 Resource sharing
An important goal of a distributed system is to make it easy for users (and
applications) to access and share remote resources. Resources can be virtually
anything, but typical examples include peripherals, storage facilities, data,
files, services, and networks, to name just a few. There are many reasons for
wanting to share resources. One obvious reason is that of economics. For
example, it is cheaper to have a single high-end reliable storage facility be
shared than having to buy and maintain storage for each user separately.
Connecting users and resources also makes it easier to collaborate and
exchange information, as is illustrated by the success of the Internet with
its simple protocols for exchanging files, mail, documents, audio, and video.
The connectivity of the Internet has allowed geographically widely dispersed
groups of people to work together by all kinds of groupware, that is, software
for collaborative editing, teleconferencing, and so on, as is illustrated by
multinational software-development companies that have outsourced much
of their code production to Asia, but also the myriad of collaboration tools
that became (more easily) available due to the COVID-19 pandemic.
Resource sharing in distributed systems is also illustrated by the success
of file-sharing peer-to-peer networks like BitTorrent. These distributed sys-
tems make it simple for users to share files across the Internet. Peer-to-peer
networks are often associated with distribution of media files such as au-
dio and video. In other cases, the technology is used for distributing large
amounts of data, as in the case of software updates, backup services, and data
synchronization across multiple servers.
Seamless integration of resource-sharing facilities in a networked environ-
ment is also now commonplace. A group of users can simply place files into a
DS 4.01 downloaded by [Link]@[Link]
1.2. DESIGN GOALS 11
special shared folder that is maintained by a third party somewhere on the In-
ternet. Using special software, the shared folder is barely distinguishable from
other folders on a user’s computer. In effect, these services replace the use of
a shared directory on a local distributed file system, making data available
to users independent of the organization they belong to, and independent of
where they are. The service is offered for different operating systems. Where
exactly data are stored is completely hidden from the end user.
1.2.2 Distribution transparency
An important goal of a distributed system is to hide the fact that its processes
and resources are physically distributed across multiple computers, possibly
separated by large distances. In other words, it tries to make the distribution
of processes and resources transparent, that is, invisible, to end users and
applications. As we shall discuss more extensively in Chapter 2, achieving
distribution transparency is realized through what is known as middleware,
sketched in Figure 1.2 (see Gazis and Katsiri [2022] for a first introduction).
In essence, what applications get to see is the same interface everywhere,
whereas behind that interface, where and how processes and resources are
and how they are accessed is kept transparent. There are different types of
transparency, which we discuss next.
Types of distribution transparency
The concept of transparency can be applied to several aspects of a distributed
system, of which the most important ones are listed in Figure 1.3. We use the
term object to mean either a process or a resource.
Access transparency deals with hiding differences in data representation
and the way that objects can be accessed. At a basic level, we want to hide
differences in machine architectures, but more important is that we reach
Figure 1.2: Realizing distribution transparency through a middleware layer.
downloaded by [Link]@[Link] DS 4.01
12 CHAPTER 1. INTRODUCTION
Transparency Description
Access Hide differences in data representation and how an object is
accessed
Location Hide where an object is located
Relocation Hide that an object may be moved to another location while
in use
Migration Hide that an object may move to another location
Replication Hide that an object is replicated
Concurrency Hide that an object may be shared by several independent
users
Failure Hide the failure and recovery of an object
Figure 1.3: Different forms of transparency in a distributed system (see ISO
[1995]). An object can be a resource or a process.
agreement on how data is to be represented by different machines and operat-
ing systems. For example, a distributed system may have computer systems
that run different operating systems, each having their own file-naming con-
ventions. Differences in naming conventions, differences in file operations, or
differences in how low-level communication with other processes is to take
place, are examples of access issues that should preferably be hidden from
users and applications.
An important group of transparency types concerns the location of a
process or resource. Location transparency refers to the fact that users
cannot tell where an object is physically located in the system. Naming
plays an important role in achieving location transparency. In particular,
location transparency can often be achieved by assigning only logical names
to resources, that is, names in which the location of a resource is not secretly
encoded. An example of a such a name is the uniform resource locator
(URL) [Link] which gives no clue about
the actual location of the Web server where this book is offered. The URL also
gives no clue whether files at that site have always been at their current location
or were recently moved there. For example, the entire site may have been
moved from one data center to another, yet users should not notice. The latter
is an example of relocation transparency, which is becoming increasingly
important in the context of cloud computing: the phenomenon by which
services are provided by huge collections of remote servers. We return to
cloud computing in subsequent chapters, and, in particular, in Chapter 2.
Where relocation transparency refers to being moved by the distributed
system, migration transparency is offered by a distributed system when it
supports the mobility of processes and resources initiated by users, with-
out affecting ongoing communication and operations. A typical example
is communication between mobile phones: regardless whether two people
DS 4.01 downloaded by [Link]@[Link]
1.2. DESIGN GOALS 13
are actually moving, mobile phones will allow them to continue their con-
versation. Other examples that come to mind include online tracking and
tracing of goods as they are being transported from one place to another,
and teleconferencing (partly) using devices that are equipped with mobile
Internet.
As we shall see, replication plays an important role in distributed systems.
For example, resources may be replicated to increase availability or to im-
prove performance by placing a copy close to the place where it is accessed.
Replication transparency deals with hiding the fact that several copies of a
resource exist, or that several processes are operating in some form of lockstep
mode so that one can take over when another fails. To hide replication from
users, it is necessary that all replicas have the same name. Consequently,
a system that supports replication transparency should generally support
location transparency as well, because it would otherwise be impossible to
refer to replicas at different locations.
We already mentioned that an important goal of distributed systems is
to allow sharing of resources. In many cases, sharing resources is done
cooperatively, as in the case of communication channels. However, there are
also many examples of competitive sharing of resources. For example, two
independent users may each have stored their files on the same file server
or may be accessing the same tables in a shared database. In such cases, it
is important that each user does not notice that the other is making use of
the same resource. This phenomenon is called concurrency transparency.
An important issue is that concurrent access to a shared resource leaves that
resource in a consistent state. Consistency can be achieved through locking
mechanisms, by which users are, in turn, given exclusive access to the desired
resource. A more refined mechanism is to make use of transactions, but these
may be difficult to implement in a distributed system, notably when scalability
is an issue.
Last, but certainly not least, it is important that a distributed system
provides failure transparency. This means that a user or application does not
notice that some piece of the system fails to work properly, and that the system
subsequently (and automatically) recovers from that failure. Masking failures
is one of the hardest issues in distributed systems and is even impossible
when certain apparently realistic assumptions are made, as we will discuss
in Chapter 8. The main difficulty in masking and transparently recovering
from failures lies in the inability to distinguish between a dead process and a
painfully slowly responding one. For example, when contacting a busy Web
server, a browser will eventually time out and report that the Web page is
unavailable. At that point, the user cannot tell whether the server is actually
down or that the network is badly congested.
downloaded by [Link]@[Link] DS 4.01
14 CHAPTER 1. INTRODUCTION
Degree of distribution transparency
Although distribution transparency is generally considered preferable for any
distributed system, there are situations in which blindly attempting to hide
all distribution aspects from users is not a good idea. A simple example is
requesting your electronic newspaper to appear in your mailbox before 7 AM
local time, as usual, while you are currently at the other end of the world
living in a different time zone. Your morning paper will not be the morning
paper you are used to.
Likewise, a wide-area distributed system that connects a process in San
Francisco to a process in Amsterdam cannot be expected to hide the fact
that Mother Nature will not allow it to send a message from one process to
the other in less than approximately 35 milliseconds. Practice shows that it
actually takes several hundred milliseconds using a computer network. Signal
transmission is not only limited by the speed of light, but also by limited
processing capacities and delays in the intermediate switches.
There is also a trade-off between a high degree of transparency and the
performance of a system. For example, many Internet applications repeatedly
try to contact a server before finally giving up. Consequently, attempting to
mask a transient server failure before trying another one may slow down the
system as a whole. In such a case, it may have been better to give up earlier,
or at least let the user cancel the attempts to make contact.
Another example is where we need to guarantee that several replicas,
located on different continents, must be consistent all the time. In other words,
if one copy is changed, that change should be propagated to all copies before
allowing any other operation. A single update operation may now even take
seconds to complete, something that cannot be hidden from users.
Finally, there are situations in which it is not at all obvious that hiding
distribution is a good idea. As distributed systems are expanding to devices
that people carry around and where the very notion of location and context
awareness is becoming increasingly important, it may be best to actually expose
distribution rather than trying to hide it. An obvious example is making use
of location-based services, which can often be found on mobile phones, such
as finding a nearest shop or any nearby friends.
There are other arguments against distribution transparency. Recognizing
that full distribution transparency is simply impossible, we should ask our-
selves whether it is even wise to pretend that we can achieve it. It may be much
better to make distribution explicit so that the user and application developer
are never tricked into believing that there is such a thing as transparency. The
result will be that users will much better understand the (sometimes unex-
pected) behavior of a distributed system, and are thus much better prepared
to deal with this behavior.
The conclusion is that aiming for distribution transparency may be a
nice goal when designing and implementing distributed systems, but that
DS 4.01 downloaded by [Link]@[Link]
1.2. DESIGN GOALS 15
it should be considered together with other issues such as performance
and comprehensibility. The price for achieving full transparency may be
surprisingly high.
Note 1.2 (Discussion: Against distribution transparency)
Several researchers have argued that hiding distribution will lead to only further
complicating the development of distributed systems, exactly for the reason that
full distribution transparency can never be achieved. A popular technique for
achieving access transparency is to extend procedure calls to remote servers. How-
ever, Waldo et al. [1997] already pointed out that attempting to hide distribution
by such remote procedure calls can lead to poorly understood semantics, for
the simple reason that a procedure call does change when executed over a faulty
communication link.
As an alternative, various researchers and practitioners are now arguing for
less transparency, for example, by more explicitly using message-style commu-
nication, or more explicitly posting requests to, and getting results from remote
machines, as is done on the Web when fetching pages. Such solutions will be
discussed in detail in the next chapter.
A somewhat radical standpoint was taken by Wams [2012] by stating that
partial failures preclude relying on the successful execution of a remote service. If
such reliability cannot be guaranteed, it is then best to always perform only local
executions, leading to the copy-before-use principle. According to this principle,
data can be accessed only after they have been transferred to the machine of the
process wanting that data. Moreover, modifying a data item should not be done.
Instead, it can only be updated to a new version. It is not difficult to imagine
that many other problems will surface. However, Wams shows that many existing
applications can be retrofitted to this alternative approach without sacrificing
functionality.
1.2.3 Openness
Another important goal of distributed systems is openness. An open dis-
tributed system is essentially a system that offers components that can easily
be used by, or integrated into other systems. At the same time, an open
distributed system itself will often consist of components that originate from
elsewhere.
Interoperability, composability, and extensibility
To be open means that components should adhere to standard rules that
describe the syntax and semantics of what those components have to offer (i.e.,
which service they provide). A general approach is to define services through
interfaces using an Interface Definition Language (IDL). Interface definitions
written in an IDL nearly always capture only the syntax of services. In other
words, they specify precisely the names of the functions that are available
downloaded by [Link]@[Link] DS 4.01
16 CHAPTER 1. INTRODUCTION
together with types of the parameters, return values, possible exceptions that
can be raised, and so on. The hard part is specifying precisely what those
services do, that is, the semantics of interfaces. In practice, such specifications
are given in an informal way by natural language.
If properly specified, an interface definition allows an arbitrary process
that needs a certain interface, to talk to another process that provides that
interface. It also allows two independent parties to build entirely different
implementations of those interfaces, leading to two separate components that
operate in exactly the same way.
Proper specifications are complete and neutral. Complete means that
everything that is necessary to make an implementation has indeed been
specified. However, many interface definitions are not at all complete, so
that it is necessary for a developer to add implementation-specific details.
Just as important is the fact that specifications do not prescribe what an
implementation should look like; they should be neutral.
As pointed out in Blair and Stefani [1998], completeness and neutrality are
important for interoperability and portability. Interoperability characterizes
the extent by which two implementations of systems or components from
different manufacturers can co-exist and work together by merely relying
on each other’s services as specified by a common standard. Portability
characterizes to what extent an application developed for a distributed system
A can be executed, without modification, on a different distributed system B
that implements the same interfaces as A.
Another important goal for an open distributed system is that it should
be easy to configure the system out of different components (possibly from
different developers). Moreover, it should be easy to add new components or
replace existing ones without affecting those components that stay in place.
In other words, an open distributed system should also be extensible. For
example, in an extensible system, it should be relatively easy to add parts that
run on a different operating system, or even to replace an entire file system.
Relatively simple examples of extensibility are plug-ins for Web browsers, but
also those for Websites, such as the ones used for WordPress.
Note 1.3 (Discussion: Open systems in practice)
Of course, what we have just described is an ideal situation. Practice shows that
many distributed systems are not as open as we would like, and that still a lot
of effort is needed to put various bits and pieces together to make a distributed
system. One way out of the lack of openness is to simply reveal all the gory
details of a component and to provide developers with the actual source code.
This approach is becoming increasingly popular, leading to so-called open-source
projects, where large groups of people contribute to improving and debugging
systems. Admittedly, this is as open as a system can get, but whether it is the best
way is questionable.
DS 4.01 downloaded by [Link]@[Link]
1.2. DESIGN GOALS 17
Separating policy from mechanism
To achieve flexibility in open distributed systems, it is crucial that the system
be organized as a collection of relatively small and easily replaceable or
adaptable components. This implies that we should provide definitions of not
only the highest-level interfaces, that is, those seen by users and applications,
but also definitions for interfaces to internal parts of the system and describe
how those parts interact. This approach is relatively new. Many older and
even contemporary systems are constructed using a monolithic approach
in which components are only logically separated but implemented as one,
huge program. This approach makes it hard to replace or adapt a component
without affecting the entire system. Monolithic systems thus tend to be closed
instead of open.
The need for changing a distributed system is often caused by a component
that does not provide the optimal policy for a specific user or application.
As an example, consider caching in Web browsers. There are many different
parameters that need to be considered:
Storage: Where is data to be cached? Typically, there will be an in-memory
cache next to storage on disk. In the latter case, the exact position in the
local file system needs to be considered.
Exemption: When the cache fills up, which data is to be removed so that
newly fetched pages can be stored?
Sharing: Does each browser make use of a private cache, or is a cache to be
shared among browsers of different users?
Refreshing: When does a browser check if cached data is still up-to-date?
Caches are most effective when a browser can return pages without
having to contact the original Website. However, this bears the risk of
returning stale data. Note also that refresh rates are highly dependent
on which data is actually cached: whereas timetables for trains hardly
change, this is not the case for Web pages showing current highway-
traffic conditions, or worse yet, stock prices.
What we need is a separation between policy and mechanism. In the case
of Web caching, for example, a browser should ideally provide facilities for
only storing documents (i.e., a mechanism) and at the same time allow users
to decide which documents are stored and for how long (i.e., a policy). In
practice, this can be implemented by offering a rich set of parameters that the
user can set (dynamically). When taking this a step further, a browser may
even offer facilities for plugging in policies that a user has implemented as a
separate component.
downloaded by [Link]@[Link] DS 4.01
18 CHAPTER 1. INTRODUCTION
Note 1.4 (Discussion: Is a strict separation really what we need?)
In theory, strictly separating policies from mechanisms seems to be the way to go.
However, there is an important trade-off to consider: the stricter the separation, the
more we need to make sure that we offer the appropriate collection of mechanisms.
In practice, this means that a rich set of features is offered, in turn leading to many
configuration parameters. As an example, the popular Firefox browser comes
with a few hundred configuration parameters. Just imagine how the configuration
space explodes when considering large distributed systems consisting of many
components. In other words, strict separation of policies and mechanisms may
lead to highly complex configuration problems.
One option to alleviate these problems is to provide reasonable defaults, and
this is what often happens in practice. An alternative approach is one in which
the system observes its own usage and dynamically changes parameter settings.
This leads to what are known as self-configurable systems. Nevertheless, the
fact alone that many mechanisms need to be offered to support a wide range of
policies often makes coding distributed systems very complicated. Hard-coding
policies into a distributed system may reduce complexity considerably, but at the
price of less flexibility.
1.2.4 Dependability
As its name suggests, dependability refers to the degree that a computer
system can be relied upon to operate as expected. In contrast to single-
computer systems, dependability in distributed systems can be rather intricate
due to partial failures: somewhere there is a component failing while the
system as a whole still seems to be living up to expectations (up to a certain
point or moment). Although single-computer systems can also suffer from
failures that do not appear immediately, having a potentially large collection
of networked computer systems complicates matters considerably. In fact, one
should assume that at any time, there are always partial failures occurring.
An important goal of distributed systems is to mask those failures, as well as
mask the recovery from those failures. This masking is the essence of being
able to tolerate faults, accordingly referred to as fault tolerance.
Basic concepts
Dependability is a term that covers several useful requirements for distributed
systems, including the following [Kopetz and Verissimo, 1993]:
• Availability
• Reliability
• Safety
• Maintainability
DS 4.01 downloaded by [Link]@[Link]
1.2. DESIGN GOALS 19
Availability is defined as the property that a system is ready to be used
immediately. In general, it refers to the probability that the system is operating
correctly at any given moment and is available to perform its functions on
behalf of its users. In other words, a highly available system is one that will
most likely be working at a given instant in time.
Reliability refers to the property that a system can run continuously
without failure. In contrast to availability, reliability is defined in terms of a
time interval instead of an instant in time. A highly reliable system is one
that will most likely continue to work without interruption during a relatively
long period of time. This is a subtle but important difference when compared
to availability. If a system goes down on average for one, seemingly random
millisecond every hour, it has an availability of more than 99.9999 percent,
but is still unreliable. Similarly, a system that never crashes but is shut down
for two specific weeks every August has high reliability but only 96 percent
availability. The two are not the same.
Safety refers to the situation that when a system temporarily fails to
operate correctly, no catastrophic event happens. For example, many process-
control systems, such as those used for controlling nuclear power plants or
sending people into space, are required to provide a high degree of safety. If
such control systems temporarily fail for only a very brief moment, the effects
could be disastrous. Many examples from the past (and probably many more
yet to come) show how hard it is to build safe systems.
Finally, maintainability refers to how easily a failed system can be repaired.
A highly maintainable system may also show a high degree of availability,
especially if failures can be detected and repaired automatically. However, as
we shall see, automatically recovering from failures is easier said than done.
Traditionally, fault-tolerance has been related to the following three metrics:
• Mean Time To Failure (MTTF): The average time until a component
fails.
• Mean Time To Repair (MTTR): The average time needed to repair a
component.
• Mean Time Between Failures (MTBF): Simply MTTF + MTTR.
Note that these metrics make sense only if we have an accurate notion of
what a failure actually is. As we will encounter in Chapter 8, identifying the
occurrence of a failure may actually not be so obvious.
Faults, errors, failures
A system is said to fail when it cannot meet its promises. In particular, if a
distributed system is designed to provide its users with several services, the
system has failed when one or more of those services cannot be (completely)
provided. An error is a part of a system’s state that may lead to a failure. For
downloaded by [Link]@[Link] DS 4.01
20 CHAPTER 1. INTRODUCTION
example, when transmitting packets across a network, it is to be expected that
some packets have been damaged when they arrive at the receiver. Damaged
in this context means that the receiver may incorrectly sense a bit value (e.g.,
reading a 1 instead of a 0), or may even be unable to detect that something
has arrived.
The cause of an error is called a fault. Clearly, finding out what caused an
error is important. For example, a wrong or bad transmission medium may
easily cause packets to be damaged. In this case, it is relatively easy to remove
the fault. However, transmission errors may also be caused by bad weather
conditions, such as in wireless networks. Changing the weather to reduce or
prevent errors is a bit trickier.
As another example, a crashed program is clearly a failure, which may
have happened because the program entered a branch of code containing
a programming bug (i.e., a programming error). The cause of that bug is
typically a programmer. In other words, the programmer is the cause of the
error (programming bug), in turn leading to a failure (a crashed program).
Building dependable systems closely relates to controlling faults. As
explained by Avizienis et al. [2004], a distinction can be made between pre-
venting, tolerating, removing, and forecasting faults. For our purposes, the
most important issue is fault tolerance, meaning that a system can provide
its services even in the presence of faults. For example, by applying error-
correcting codes for transmitting packets, it is possible to tolerate, to a certain
extent, relatively poor transmission lines and reducing the probability that an
error (a damaged packet) may lead to a failure.
Faults are generally classified as transient, intermittent, or permanent.
Transient faults occur once and then disappear. If the operation is repeated,
the fault goes away. A bird flying through the beam of a microwave transmitter
may cause lost bits on some network (not to mention a roasted bird). If the
transmission times out and is retried, it will probably work the second time.
An intermittent fault occurs, then vanishes on its own accord, then reap-
pears, and so on. A loose contact on a connector will often cause an inter-
mittent fault. Intermittent faults cause a great deal of aggravation because
they are difficult to diagnose. Typically, when the fault doctor shows up, the
system works fine.
A permanent fault is one that continues to exist until the faulty compo-
nent is replaced. Burnt-out chips, software bugs, and disk-head crashes are
examples of permanent faults.
Dependable systems are also required to provide security, especially in
terms of confidentiality and integrity. Confidentiality is the property that
information is disclosed only to authorized parties, while integrity relates to
ensuring that alterations to various assets can be made only in an authorized
way. Indeed, can we speak of a dependable system when confidentiality and
integrity are not in place? We return to security next.
DS 4.01 downloaded by [Link]@[Link]
1.2. DESIGN GOALS 21
1.2.5 Security
A distributed system that is not secure, is not dependable. As mentioned,
special attention is needed to ensure confidentiality and integrity, both of
which are directly coupled to authorized disclosure and access of information
and resources. In any computer system, authorization is done by checking
whether an identified entity has proper access rights. In turn, this means
that the system should know it is indeed dealing with the proper entity. For
this reason, authentication is essential: verifying the correctness of a claimed
identity. Equally important is the notion of trust. If a system can positively
authenticate a person, what is that authentication worth if the person cannot
be trusted? For this reason alone, proper authorization is important, as it
may be used to limit any damage that a person, who could in hindsight not
be trusted, can cause. For example, in financial systems, authorization may
limit the amount of money a person is allowed to transfer between various
accounts. We will discuss trust, authentication, and authorization at length in
Chapter 9.
Key elements needed to understand security
An essential technique to making distributed systems secure is cryptography.
This is not the place in this book to extensively discuss cryptography (which
we also defer until Chapter 9), yet to understand how security fits into various
perspectives in the following chapters, we informally introduce some of its
basic elements.
Keeping matters simple, security in distributed systems is all about en-
crypting and decrypting data using security keys. The easiest way of consid-
ering a security key K is to see it as a function operating on some data data.
We use the notation K (data) to express the fact that the key K operates on
data.
There are two ways of encrypting and decrypting data. In a symmetric
cryptosystem, encryption and decryption takes place with a single key. Denot-
ing by EK (data) the encryption of data using key EK , and likewise DK (data)
for decryption with key DK , then in a symmetric cryptosystem, the same key
is used for encryption and decryption, i.e.,
if data = DK ( EK (data)) then DK = EK .
Note that in a symmetric cryptosystem, the key will need to be kept secret by
all parties that are authorized to encrypt or decrypt data. In an asymmetric
cryptosystem, the keys used for encryption and decryption are different.
In particular, there is a public key PK that can be used by anyone, and a
secret key SK that is, as its name suggests, to be kept secret. Asymmetric
cryptosystems are also called public-key systems.
downloaded by [Link]@[Link] DS 4.01
22 CHAPTER 1. INTRODUCTION
Encryption and decryption in public-key systems can be used in two,
fundamentally different ways. First, if Alice wants to encrypt data that can
be decrypted only by Bob, she should use Bob’s public key, PKB , leading
to the encrypted data PKB (data). Only the holder of the associated secret
key can decrypt this information, i.e., Bob, who will apply the operation
SKB (PKB (data)), which returns data.
A second, and widely applied use case, is that of realizing digital signa-
tures. Suppose Alice makes some data available for which it is important that
any party, but let us assume it is Bob, needs to know for sure that it comes
from Alice. In that case, Alice can encrypt the data with her secret key SKA ,
leading to SK A (data). If it can be assured that the associated public key PKA
indeed belongs to Alice, then successfully decrypting SK A (data) to data, is
proof that Alice knows about data: she is the only one holding the secret key
SKA . Of course, we need to make the assumption that Alice is indeed the only
one who holds SKA . We return to some of these assumptions in Chapter 9.
As it turns out, proving that an entity has seen, or knows about some
data, returns frequently in secured distributed systems. Practical placement
of digital signatures is generally more efficient by a hash function. A hash
function H has the property that when operating on some data, i.e., H (data),
it returns a fixed-length string, regardless of the length of data. Any change
of data to data∗ will lead to a different hash value H (data∗ ). Moreover, given
a hash value h, it is computationally impossible in practice, to discover the
original data. What this all means, is that for placing a digital signature, Alice
computes sig = SK A ( H (data)) as her signature, and tells Bob about data, H
and sig. Bob, in turn, can then verify that signature by computing PK A (sig)
and verifying that it matches the value H (data).
Using cryptography in distributed systems
The application of cryptography in distributed systems comes in many forms.
Besides its general use for encryption and digital signatures, cryptography
forms the basis for realizing a secure channel between two communicating
parties. Such channels basically let two parties know for sure that they are
indeed communicating to the entities that they expected to communicate with.
In other words, a communication channel that supports mutual authentication.
A practical example of a secure channel is using https when accessing Websites.
Now, many browsers demand that Websites support this protocol, and at
the very least will warn the user when this is not the case. In general, using
cryptography is necessary to realize authentication (and authorization) in
distributed systems.
Cryptography is also used to realize secure distributed data structures.
A well-known example is that of a blockchain, which is, literally, a chain of
blocks. The basic idea is simple: hash the data in a block Bi , and place that
hash value as part of the data in its succeeding block Bi+1 . Any change in
DS 4.01 downloaded by [Link]@[Link]
1.2. DESIGN GOALS 23
Bi (for example, as the result of an attack), will require that the attacker also
changes the stored hash value in Bi+1 . However, because the successor of
Bi+1 contains the hash computed over the data in Bi+1 , and thus including
the original hash value of Bi , the attacker will also have to change the new has
value of Bi as stored in Bi+1 . Yet changing that value, also means changing the
hash value of Bi+1 , and thus the value stored in Bi+2 , in turn, requiring that
a new hash value is to be computed for Bi+2 , and so on. In other words, by
securely linking blocks into a chain, any successful change to a block requires
that all successive blocks be modified as well. These modifications should go
unnoticed, which is virtually impossible.
Cryptography is also used for another important mechanism in distributed
systems: delegating access rights. The basic idea is that Alice may want to
delegate some rights to Bob, who, in turn, may want to pass some of those
rights on to Chuck. Using appropriate means (which we discuss in Chapter 9, a
service can securely check that Chuck has indeed been authorized to perform
certain operations, without the need for that service to check with Alice
whether the delegation is in place. Note that delegation is something we are
now used to: many of us delegate access rights that we have as a user to
specific applications, such as an e-mail client.
An upcoming distributed application of cryptography is so-called multi-
party computation: the means for two or three parties to compute a value
for which the data of those parties is needed, but without having to actually
share that data. An often-used example is computing the number of votes
without having to know who voted for whom.
We will see many more examples of security in distributed systems in the
following chapters. With the brief explanations of the cryptographic basis,
it should suffice to see how security is applied. We shall consistently use
the notations as shown in Figure 1.4. Alternatively, security examples can be
skipped until having studied Chapter 9.
Notation Description
KA,B Secret key shared by A and B
PKA Public key of A
SKA Private (secret) key of A
EK (data) Encryption of data using key EK (or key K)
DK (data) Decryption of (encrypted) data using key DK (or key K)
H (data) The hash of data computed using function H
Figure 1.4: Notations for cryptosystems used in this book.
downloaded by [Link]@[Link] DS 4.01
24 CHAPTER 1. INTRODUCTION
1.2.6 Scalability
For many of us, worldwide connectivity through the Internet is as common as
being able to send a package to anyone anywhere around the world. Moreover,
where until recently, we were used to having relatively powerful desktop
computers for office applications and storage, we are now witnessing that
such applications and services are being placed in what has been coined “the
cloud,” in turn leading to an increase of much smaller networked devices such
as tablet computers or even cloud-only laptops such as Google’s Chromebook.
With this in mind, scalability has become one of the most important design
goals for developers of distributed systems.
Scalability dimensions
Scalability of a system can be measured along at least three different dimen-
sions (see [Neuman, 1994]):
Size scalability: A system can be scalable regarding its size, meaning that
we can easily add more users and resources to the system without any
noticeable loss of performance.
Geographical scalability: A geographically scalable system is one in which
the users and resources may lie far apart, but the fact that communication
delays may be significant is hardly noticed.
Administrative scalability: An administratively scalable system is one that
can still be easily managed even if it spans many independent adminis-
trative organizations.
Let us take a closer look at each of these three scalability dimensions.
Size scalability When a system needs to scale, very different types of prob-
lems need to be solved. Let us first consider scaling regarding size. If more
users or resources need to be supported, we are often confronted with the
limitations of centralized services, although often for very different reasons.
For example, many services are centralized in the sense that they are imple-
mented by a single server running on a specific machine in the distributed
system. In a more modern setting, we may have a group of collaborating
servers co-located on a cluster of tightly coupled machines physically placed
at the same location. The problem with this scheme is obvious: the server, or
group of servers, can simply become a bottleneck when it needs to process
an increasing number of requests. To illustrate how this can happen, let us
assume that a service is implemented on a single machine. In that case, there
are essentially three root causes for becoming a bottleneck:
• The computational capacity, limited by the CPUs
• The storage capacity, including the I/O transfer rate
DS 4.01 downloaded by [Link]@[Link]
1.2. DESIGN GOALS 25
• The network between the user and the centralized service
Let us first consider the computational capacity. Just imagine a service for
computing optimal routes taking real-time traffic information into account. It
is not difficult to imagine that this may be primarily a compute-bound service,
requiring several (tens of) seconds to complete a request. If there is only a
single machine available, then even a modern high-end system will eventually
run into problems if the number of requests increases beyond a certain point.
Likewise, but for different reasons, we will run into problems when having
a service that is mainly I/O bound. A typical example is a poorly designed
centralized search engine. The problem with content-based search queries is
that we essentially need to match a query against an entire data set. Even
with advanced indexing techniques, we may still face the problem of having
to process a huge amount of data exceeding the main-memory capacity of
the machine running the service. As a consequence, much of the processing
time will be determined by the relatively slow disk accesses and transfer of
data between disk and main memory. Simply adding more or higher-speed
disks will prove not to be a sustainable solution as the number of requests
continues to increase.
Finally, the network between the user and the service may also be the cause
of poor scalability. Just imagine a video-on-demand service that needs to
stream high-quality video to multiple users. A video stream can easily require
a bandwidth of 8 to 10 Mbps, meaning that if a service sets up point-to-point
connections with its customers, it may soon hit the limits of the network
capacity of its own outgoing transmission lines.
There are several solutions to attack size scalability, which we discuss
below after having looked into geographical and administrative scalability.
Note 1.5 (Advanced: Analyzing size scalability)
Figure 1.5: A simple model of a service as a queuing system.
Size scalability problems for centralized services can be formally analyzed
using queuing theory and making a few simplifying assumptions. At a conceptual
level, a centralized service can be modeled as the simple queuing system shown
in Figure 1.5: requests are submitted to the service, where they are queued until
further notice. As soon as the process can handle a next request, it fetches it from
the queue, does its work, and produces a response. We largely follow Menasce
and Almeida [2002] in explaining the performance of a centralized service.
downloaded by [Link]@[Link] DS 4.01
26 CHAPTER 1. INTRODUCTION
Often, we may assume that the queue has an infinite capacity, meaning that
there is no restriction on the number of requests that can be accepted for further
processing. Strictly speaking, this means that the arrival rate of requests is not
influenced by what is currently in the queue or being processed. Assuming that
the arrival rate of requests is λ requests per second, and that the processing
capacity of the service is µ requests per second, one can compute that the fraction
of time pk that there are k requests in the system is equal to:
λ λ k
pk = 1 −
µ µ
If we define the utilization U of a service as the fraction of time that it is busy,
then clearly,
λ
U= ∑ p k = 1 − p0 = ⇒ p k = ( 1 − U )U k
k >0
µ
We can then compute the average number N of requests in the system as
( 1 − U )U U
N= ∑ k · p k = ∑ k · ( 1 − U )U k = ( 1 − U ) ∑ k · U k = (1 − U )2
=
1−U
.
k ≥0 k ≥0 k ≥0
What we are truly interested in, is the response time R: how long does it take
before the service to process a request, including the time spent in the queue.
To that end, we need the average throughput X. Considering that the service is
“busy” when at least one request is being processed, and that this then happens
with a throughput of µ requests per second, and during a fraction U of the total
time, we have:
λ
X= U·µ + (1 − U ) · 0 = · µ = λ
| {z } | {z } µ
server at work server idle
Using Little’s formula [Trivedi, 2002], we can then derive the response time as
N S R 1
R= = ⇒ =
X 1−U S 1−U
where S = µ1 , the actual service time. Note that if U is small, the response-
to-service time ratio is close to 1, meaning that a request is virtually instantly
processed, and at the maximum speed possible. However, as soon as the utilization
comes closer to 1, we see that the response-to-server time ratio quickly increases to
very high values, effectively meaning that the system is coming close to a grinding
halt. This is where we see scalability problems emerge. From this simple model,
we can see that the only solution is bringing down the service time S. We leave it
as an exercise to the reader to explore how S may be decreased.
Geographical scalability Geographical scalability has its own problems. One
of the main reasons why it is still difficult to scale existing distributed systems
DS 4.01 downloaded by [Link]@[Link]
1.2. DESIGN GOALS 27
that were designed for local-area networks is that many of them are based
on synchronous communication. In this form of communication, a party
requesting a service, generally referred to as a client, blocks until a reply is
sent back from the server implementing the service. More specifically, we often
see a communication pattern consisting of many client-server interactions, as
may be the case with database transactions. This approach generally works
fine in LANs, where communication between two machines is often at worst
a few hundred microseconds. However, in a wide-area system, we need to
consider that interprocess communication may be hundreds of milliseconds,
three orders of magnitude slower. Building applications using synchronous
communication in wide-area systems requires a great deal of care (and not
just a little patience), notably with a rich interaction pattern between client
and server.
Another problem that hinders geographical scalability is that communica-
tion in wide-area networks is inherently much less reliable than in local-area
networks. In addition, we generally also need to deal with limited bandwidth.
The effect is that solutions developed for local-area networks cannot always
be easily ported to a wide-area system. A typical example is streaming video.
In a home network, even when having only wireless links, ensuring a stable,
fast stream of high-quality video frames from a media server to a display is
quite simple. Simply placing that same server far away and using a standard
TCP connection to the display will surely fail: bandwidth limitations will
instantly surface, but also maintaining the same level of reliability can easily
cause headaches.
Yet another issue that pops up when components lie far apart is the
fact that wide-area systems generally have only very limited facilities for
multipoint communication. In contrast, local-area networks often support
efficient broadcasting mechanisms. Such mechanisms have proven to be
extremely useful for discovering components and services, which is essential
from a management perspective. In wide-area systems, we need to develop
separate services, such as naming and directory services, to which queries
can be sent. These support services, in turn, need to be scalable as well and
often no obvious solutions exist as we will encounter in later chapters.
Administrative scalability Finally, a difficult, and often open, question is
how to scale a distributed system across multiple, independent administrative
domains. A major problem that needs to be solved is that of conflicting
policies regarding resource usage (and payment), management, and security.
To illustrate, for many years, scientists have been looking for solutions to share
their (often expensive) equipment in what is known as a computational grid.
In these grids, a global decentralized system is constructed as a federation of
local distributed systems, allowing a program running on a computer at an
organization A to directly access resources at the organization B.
downloaded by [Link]@[Link] DS 4.01
28 CHAPTER 1. INTRODUCTION
Many components of a distributed system that reside within a single
domain can often be trusted by users that operate within that same domain. In
such cases, system administration may have tested and certified applications,
and may have taken special measures to ensure that such components cannot
be tampered with. In essence, the users trust their system administrators.
However, this trust does not expand naturally across domain boundaries.
If a distributed system expands to another domain, two types of security
measures need to be taken. First, the distributed system has to protect
itself against malicious attacks from the new domain. For example, users
from the new domain may have only read access to the file system in its
original domain. Likewise, facilities such as expensive image setters or high-
performance computers may not be made available to unauthorized users.
Second, the new domain has to protect itself against malicious attacks from
the distributed system. A typical example is that of downloading programs,
such as in the case of federated learning. Basically, the new domain does not
know what to expect from such foreign code. The problem, as we shall see in
Chapter 9, is how to enforce those limitations.
As a counterexample of distributed systems spanning multiple adminis-
trative domains that apparently do not suffer from administrative scalability
problems, consider modern file-sharing peer-to-peer networks. In these cases,
end users simply install a program implementing distributed search and
download functions and within minutes can start downloading files. Other ex-
amples include peer-to-peer applications for telephony over the Internet such
as older Skype systems [Baset and Schulzrinne, 2006], and (again older) peer-
assisted audio-streaming applications such as Spotify [Kreitz and Niemelä,
2010]. A more modern application (that has yet to prove itself in terms of scal-
ability) are blockchains. What these decentralized systems have in common is
that end users, and not administrative entities, collaborate to keep the system
up and running. At best, underlying administrative organizations such as
Internet Service Providers (ISPs) can police the network traffic that these
peer-to-peer systems cause.
Scaling techniques
Having discussed some scalability problems brings us to the question of how
those problems can generally be solved. In most cases, scalability problems
in distributed systems appear as performance problems caused by limited
capacity of servers and network. Simply improving their capacity (e.g., by
increasing memory, upgrading CPUs, or replacing network modules) is often
a solution, referred to as scaling up. When it comes to scaling out, that is,
expanding the distributed system by essentially deploying more machines,
there are basically only three techniques we can apply: hiding communication
latencies, distribution of work, and replication (see also Neuman [1994]).
DS 4.01 downloaded by [Link]@[Link]
1.2. DESIGN GOALS 29
Client Server
M
FIRST NAME MAARTEN A
LAST NAME VAN STEEN A
E-MAIL R
MVS@[Link] T
E
N
Check form Process form
(a)
Client Server
FIRST NAME MAARTEN
MAARTEN
LAST NAME VAN STEEN VAN STEEN
E-MAIL MVS@[Link] MVS@[Link]
Check form Process form
(b)
Figure 1.6: The difference between letting (a) a server or (b) a client check
forms as they are being filled.
Hiding communication latencies Hiding communication latencies is appli-
cable in the case of geographical scalability. The basic idea is simple: try to
avoid waiting for responses to remote-service requests as much as possible.
For example, when a service has been requested at a remote machine, an
alternative to waiting for a reply from the server is to do other useful work at
the requester’s side. Essentially, this means constructing the requesting appli-
cation in such a way that it uses only asynchronous communication. When a
reply comes in, the application is interrupted and a special handler is called
to complete the previously issued request. Asynchronous communication
can often be used in batch-processing systems and parallel applications, in
which independent tasks can be scheduled for execution while another task is
waiting for communication to complete. Alternatively, a new thread of control
can be started to perform the request. Although it blocks waiting for the reply,
other threads in the process can continue.
However, there are many applications that cannot make effective use of
asynchronous communication. For example, in interactive applications when
a user sends a request, she will generally have nothing better to do than to
wait for the answer. In such cases, a much better solution is to reduce the
overall communication, for example, by moving part of the computation that
is normally done at the server to the client process requesting the service. A
typical case where this approach works is accessing databases using forms.
Filling in forms can be done by sending a separate message for each field and
waiting for an acknowledgment from the server, as shown in Figure 1.6(a). For
example, the server may check for syntactic errors before accepting an entry.
downloaded by [Link]@[Link] DS 4.01
30 CHAPTER 1. INTRODUCTION
A much better solution is to ship the code for filling in the form, and possibly
checking the entries, to the client, and have the client return a completed
form, as shown in Figure 1.6(b). This approach of shipping code is widely
supported by the Web through JavaScript.
Partitioning and distribution Another important scaling technique is parti-
tioning and distribution, which involves taking a component or other resource,
splitting it into smaller parts, and subsequently spreading those parts across
the system. A good example of partitioning and distribution is the Internet
Domain Name System (DNS). The DNS name space is hierarchically orga-
nized into a tree of domains, which are divided into nonoverlapping zones,
as shown for the original DNS in Figure 1.7. The names in each zone are
handled by a single name server. Without going into too many details now
(we return to DNS extensively in Chapter 6), one can think of each path name
being the name of a host on the Internet, and is thus associated with a network
address of that host. Basically, resolving a name means returning the network
address of the associated host. Consider, for example, the name [Link].
To resolve this name, it is first passed to the server of zone Z1 (see Figure 1.7)
which returns the address of the server for zone Z2, to which the rest of the
name, [Link], can be handed. The server for Z2 will return the address of
the server for zone Z3, which is capable of handling the last part of the name,
and will return the address of the associated host.
Generic Countries
Z1
int com edu gov mil org net jp us nl
sun yale Z2
acm ieee ac co oce vu
eng cs eng jack jill keio nec cs
Z3
ai linda cs csl flits fluit
robot pc24
Figure 1.7: An example of dividing the (original) DNS name space into zones.
These examples illustrate how the naming service as provided by DNS, is
distributed across several machines, thus avoiding that a single server has to
deal with all requests for name resolution.
As another example, consider the World Wide Web. To most users, the Web
appears to be an enormous document-based information system, in which
each document has its own unique name in the form of a URL. Conceptually,
DS 4.01 downloaded by [Link]@[Link]
1.2. DESIGN GOALS 31
it may even appear as if there is only a single server. However, the Web
is physically partitioned and distributed across a few hundreds of millions of
servers, each handling often a number of Websites, or parts of Websites. The
name of the server handling a document is encoded into that document’s
URL. It is only because of this distribution of documents that the Web has
been capable of scaling to its current size. Yet, note that finding out how many
servers provide Web-based services is virtually impossible: A Website today
is so much more than a few static Web documents.
Replication Considering that scalability problems often appear in the form
of performance degradation, it is generally a good idea to actually replicate
components or resources, etc., across a distributed system. Replication not
only increases availability, but also helps to balance the load between com-
ponents, leading to better performance. Moreover, in geographically widely
dispersed systems, having a copy nearby can hide much of the communication
latency problems mentioned before.
Caching is a special form of replication, although the distinction between
the two is often hard to make or even artificial. As in the case of replication,
caching results in making a copy of a resource, generally in the proximity of
the client accessing that resource. However, in contrast to replication, caching
is a decision made by the client of a resource and not by the owner of a
resource.
There is one serious drawback to caching and replication that may ad-
versely affect scalability. Because we now have multiple copies of a resource,
modifying one copy makes that copy different from the others. Consequently,
caching and replication leads to consistency problems.
To what extent inconsistencies can be tolerated depends on the usage of a
resource. For example, many Web users find it acceptable that their browser
returns a cached document of which the validity has not been checked for
the last few minutes. However, there are also many cases in which strong
consistency guarantees need to be met, such as in the case of electronic stock
exchanges and auctions. The problem with strong consistency is that an
update must be immediately propagated to all other copies. Moreover, if two
updates happen concurrently, it is often also required that updates are pro-
cessed in the same order everywhere, introducing a global ordering problem.
To make things worse, combining consistency with desirable properties such
as availability may simply be impossible, as we discuss in Chapter 8.
Replication therefore often requires some global synchronization mecha-
nism. Unfortunately, such mechanisms are extremely hard or even impossible
to implement in a scalable way, if alone because network latencies have a nat-
ural lower bound. Consequently, scaling by replication may introduce other,
inherently nonscalable solutions. We return to replication and consistency
extensively in Chapter 7.
downloaded by [Link]@[Link] DS 4.01
32 CHAPTER 1. INTRODUCTION
Discussion When considering these scaling techniques, one could argue that
size scalability is the least problematic from a technical perspective. Often,
increasing the capacity of a machine will save the day, although perhaps
there is a high monetary cost to pay. Geographical scalability is a much
tougher problem, as network latencies are naturally bound from below. As
a consequence, we may be forced to copy data to locations close to where
clients are, leading to problems of maintaining copies consistent. Practice
shows that combining distribution, replication, and caching techniques with
different forms of consistency generally leads to acceptable solutions. Finally,
administrative scalability seems to be the most difficult problem to solve,
partly because we need to deal with nontechnical issues, such as politics of or-
ganizations and human collaboration. The introduction and now widespread
use of peer-to-peer technology has successfully demonstrated what can be
achieved if end users are put in control [Lua et al., 2005; Oram, 2001]. How-
ever, peer-to-peer networks are obviously not the universal solution to all
administrative scalability problems.
1.3 A simple classification of distributed systems
We have discussed distributed versus decentralized systems, yet it is also use-
ful to classify distributed systems according to what they are being developed
and used for. We make a distinction between systems that are developed for
(high performance) computing, for general information processing, and those
that are developed for pervasive computing, i.e., for the “Internet of Things.”
As with many classifications, the boundaries between these three types are
not strict and combinations can easily be thought of.
1.3.1 High-performance distributed computing
An important class of distributed systems is the one used for high-performance
computing tasks. Roughly speaking, one can make a distinction between two
subgroups. In cluster computing the underlying hardware consists of a
collection of similar compute nodes, interconnected by a high-speed network,
often alongside a more common local-area network for controlling the nodes.
In addition, each node generally runs the same operating system.
The situation becomes very different in the case of grid computing. This
subgroup consists as decentralized systems that are often constructed as a
federation of computer systems, where each system may fall under a different
administrative domain, and may be very different when it comes to hardware,
software, and deployed network technology.
DS 4.01 downloaded by [Link]@[Link]