Building Distributed Computing Abstractions in the Presence of Mobile Byzantine Failures

Chapter 1 Introduction

Nowadays high availability plays a key role for many distributed systems. Just to give an intuition, less than twenty years ago IBM Global Services quantified that due to unavailable systems in 1996 the American businesses lost $4.54 billion [START_REF] Services | Improving systems availability[END_REF]. In 2015, this figure has dramatically increased, indeed, it has been shown that IT downtime costs $700 billion to North American companies [START_REF]The high price of it downtime[END_REF]. One of the main challenges is to guarantee distributed systems availability despite accidental and malicious failures. Failures can not be avoided, increasing the importance of designing fault tolerant systems. The main characteristic of those systems is the elimination of single points of failure introducing redundancy, which allows the system to work even though some of its components are faulty. More into details, all different typologies of failures are included under the name of Byzantine failures. A Byzantine component may behave in any possible way, spanning from the crash failures (the component does not work at all) to malicious failures (the component is hijacked by an attacker). Classical Byzantine tolerant solutions assume that over n components there can be up to f that may suffer from Byzantine failures. If such hypothesis is violated, i.e., an attacker controls more than f components, the distributed system may no more be available or correct. It follows that the main limitation with this approach is that systems are built to tolerate a fixed percentage of failures over the whole components number. This fails the reality test of long-lived distributed services. With new exploits being publicized daily and hackers offering services at amazingly low prices, every component is bound to be compromised in a long time. On the bright side, dedicated cure and software rejuvenation techniques increase the possibility that a compromised node does not remain compromised forever, and may be recover from its previously compromised status [START_REF] Sousa | Highly available intrusion-tolerant services with proactive-reactive recovery[END_REF]. Moreover, as pointed out in [START_REF] Yung | The "Mobile Adversary" Paradigm in Distributed Computation and Systems[END_REF], in addition to classical Byzantine behaviors, it is worth to consider mobile adversaries. Mobile adversaries have been primarily introduced in the context of multi-party computation and they try to model an attacker that is able to progressively compromise computational entities but only for a limited period of time. Therefore, tolerating Mobile Byzantine Failures is, in some sense, like having a bounded number of compromised entities at any given time, but such set changes from time to time. Such model captures phenomena like virus injection (where viruses start to infect the network but then they are detected and progressively deleted from a set of machines), programmed maintenance with the aim of restoring potentially infected machines or self-repairing systems [START_REF] Sousa | Highly available intrusion-tolerant services with proactive-reactive recovery[END_REF]. All those considerations advocate the study of a more complex failure model to capture the dynamism of compromised component sets. In this thesis we analyze two main problems concerning the implementation of distributed systems. Distributed Registers and Approximate Agreement. Those, in our vision, were the natural steps after the Mobile Byzantine Tolerant Consensus, the only problem solved so far in the presence of mobile Byzantine failures ( [START_REF] Banu | An improved byzantine agreement algorithm for synchronous systems with mobile faults[END_REF][START_REF] Bonnet | Tight bound on mobile byzantine agreement[END_REF][START_REF] Buhrman | Optimal resiliency against mobile faults[END_REF][START_REF] Garay | Reaching (and maintaining) agreement in the presence of mobile faults[END_REF][START_REF] Sasaki | Mobile byzantine agreement on arbitrary network[END_REF]). Distributed Registers are the building block of a distributed data store, a fundamental component for many of the principal web services, such as Facebook (Apache Cassandra), Google (BigTable), Netflix (Druid), Amazon (Dynamo), just to cite a few. Depending on the provided consistency degree there are three register specifications, from the weakest to the strongest: safe, regular and atomic. To ensure high availability, storage services are usually implemented by replicating data at multiple locations and maintaining such data consistent. Thus, replicated servers represent today an attractive target for attackers that may try to compromise replicas correctness for different purposes. Some examples are: to gain access to protected data, to interfere with the service provisioning (e.g., by delaying operations or by compromising the integrity of the service), to reduce service availability with the final aim to damage the service provider (reducing its reputation or letting it pay for the violation of service level agreements), etc. In this context, thanks to Byzantine Fault Tolerance (BFT) techniques, a compromised replica (a Byzantine failure) is made transparent to clients. In the context of distributed storage implementations (e.g., register abstraction), common approaches to BFT are based on the deployment of a sufficient large number of replicas to tolerate an estimated number f of compromised servers (i.e., BFT replication). However, to the best of our knowledge, no storage abstraction has been investigated so far assuming mobile adversaries. Along with the Distributed Register abstraction, the Approximate Agreement problem plays a key role in many distributed system classes. The emergent area of sensor networks or mobile robot networks revived recently the research on one of the most studied building blocks of distributed computing ([9, 10, 13, 27, 46, 47, 48, 49, 50]). Indeed, gathering environmental data such as temperature or atmospheric pressure, or synchronizing clocks in large scale sensor networks, typically do not require perfect agreement between participating nodes. Also, requiring autonomous mobile robots to gather at some specific location e.g., to communicate or to setup a new task, tolerates a difference in the final robot positions after gathering. This is due to the robots physical size. Accepting a predetermined difference in the agreement process permits to avoid many impossibility results occurring in the perfect agreement case. The above mentioned contexts are not free from failures and in particular from Byzantine ones. In sensor networks, in fact, sensors may not transmit their values or may transmit erroneous values due to permanent or temporary failures. In mobile autonomous robot networks, some robots may move in the opposite direction as the one intended due to hardware malfunction of buggy software. In both cases the signals (transmitted data, or perceived position) sent by the faulty participants may have a tremendous impact on the approximated value that is computed by the correct ones. To handle such behaviors, the solvability of Approximate Agreement has been studied in presence of Byzantine processes [START_REF] Dolev | Reaching approximate agreement in the presence of faults[END_REF][START_REF] Kieckhafer | Reaching approximate agreement with mixed-mode faults. Parallel and Distributed Systems[END_REF][START_REF] Lynch | Distributed Algorithms[END_REF]. The problem becomes even more difficult to solve when failures may impact different participants over time. For example, in sensor or mobile robot networks, the possibility of intermittent external perturbations (e.g., magnetic fields) may affect different processes of the network at various moments during system execution. Participants that are located in such affected areas may exhibit Byzantine behavior. While the Approximate Agreement problem has been deeply studied in systems prone to Byzantine faults [START_REF] Dolev | Reaching approximate agreement in the presence of faults[END_REF][START_REF] Kieckhafer | Reaching approximate agreement with mixed-mode faults. Parallel and Distributed Systems[END_REF][START_REF] Lynch | Distributed Algorithms[END_REF] revealing its complexity, none has been done (as far as we know) considering Mobile Byzantine Failures. This left open some important questions about the solvability of the problem and its complexity.

Contributions and Road map

The work in this thesis can be quickly listed in the following contributions:

• we define a general round-free Mobile Byzantine Failure (MBF) model, which can be decomposed in a hierarchy of four different models (published in [START_REF] Bonomi | Optimal mobile byzantine fault tolerant distributed storage[END_REF]);

• starting from the already defined round-based Mobile Byzantine Failure model, we solve the Atomic Register problem (published in [START_REF] Bonomi | Tight selfstabilizing mobile byzantine-tolerant atomic register[END_REF]);

• we define a framework to prove lower bounds to solve Safe Register problem in each of the round-free synchronous MFB models;

• we propose optimal solutions to solve Regular Registers problem in each of those models (partially published in [START_REF] Bonomi | Optimal mobile byzantine fault tolerant distributed storage[END_REF]);

• we propose an optimal solution for the Approximate Agreement problem in the round-based MBF models (published in [START_REF] Bonomi | Approximate agreement under mobile byzantine faults[END_REF]).

Roadmap. In Chapter 2 and Chapter 3 we respectively discuss related works and define the system model. The main contribution of this thesis is Chapter 4, where we propose and formalize a general MBF model. Along with the already defined round based MBF model, we propose a hierarchy of round-free MBF models, generated combining components awareness about their failure state and mobile agents movements freedom. Hereafter we explore the instances of the model where this problem is solvable,e.g., we provide impossibility results for the asynchronous setting (Section 6.2). In Chapter 5 is presented the study of Distributed Register in the round-based MBF models. In particular we prove lower bounds on the number of replicas, and propose an optimal algorithm to solve the strongest consistency register problem in the round-based system model. In Chapter 6 we explore the Regular Register abstraction in the round-free MBF models. We prove lower bounds (Section 6.3) and present and prove the correctness of protocols (Sections 6.4 -6.7) whose resilience is optimal with respect to the number of Byzantine agents that can be tolerated. Finally we move to the Approximate Agreement problem in Chapter 7. In Section 7.2 we prove lower bounds for Approximate Agreement in the Mobile Byzantine failures model. Interestingly the lower bounds do not change with respect the Agreement in the Mobile Byzantine failures model. The same happens in the case of Byzantine failures, Agreement and Approximate Agreement have the same lower bounds with respect the number of replicas. Then we map the existing variants of Mobile Byzantine models to the Mixed-Mode faults model [START_REF] Kieckhafer | Reaching approximate agreement with mixed-mode faults. Parallel and Distributed Systems[END_REF]. This mapping further helps us to prove the correctness of a particular class of solutions for Approximate Agreement in the Mobile Byzantine failures model, Section 7.3.

Chapter 2

Related Work

Byzantine fault tolerance is at the core of Distributed Computing and a fundamental building block in any reasonably sized distributed system. Byzantine failures encompass all possible cases that can occur in practice (even unforeseen ones) as the impacted process may simply exhibit arbitrary behaviors. Specifically targeted attacks to compromise processes and/or virus infections can indeed cause malicious code execution. In classical Byzantine fault-tolerance, the power of attacks and infections is typically abstracted as an upper bound f on the number of Byzantine processes that a given set of n processes has to be able to tolerate. Such bounds permit to characterize the solvable cases for benchmarking problems in Distributed Computing (e.g., Agreement and Register Emulation). As we stated, this abstraction fails the reality test of long-lived distributed services. Dedicated cure and software rejuvenation techniques increase the possibility that a compromised node does not remain compromised forever, and may be aware of its previously compromised status [START_REF] Sousa | Highly available intrusion-tolerant services with proactive-reactive recovery[END_REF]. Rejuvenation techniques use proactive and reactive replicas recovery. Interestingly, proactive recovery has been shown to be not feasible in asynchronous systems ( [START_REF] Sousa | How resilient are distributed f fault/intrusion-tolerant systems?[END_REF], [START_REF] Sousa | Hidden problems of asynchronous proactive recovery[END_REF]). In few words, periodically groups of replicas start to recover, but in an asynchronous system a compromised replica can delay its recovery, allowing more than f replicas to be compromised. Interestingly, in [START_REF] Platania | Towards a practical survivable intrusion tolerant replication system[END_REF] is presented a theoretical model to estimate the system resilience over its lifetime based on the rejuvenation rate and the number of replicas. As will be clearer further, the implicit failure model considered in those works match particular cases of the Mobile Byzantine Failures (MBF) models. In the MBF models, faults are represented by Byzantine agents that are managed by a powerful omniscient adversary that "moves" them from a process to another. Let us note that the term "mobile" does not necessary imply that a Byzantine agent physically moves from one process to another, but it rather captures the phenomenon of a progressive infection, that modifies the code executed by a process as well as its internal state, and the subsequent cure and restoration of the correct protocol (due, for example, to the detection of the infection or to a proactive recovery mechanism). In the sequel, we first present Mobile Byzantine Failure models, then we introduce the relevant abstractions that we considered to be solved in presence of Mobile Byzantine failures, Shared Memory and Approximate Agreement.

Mobile Byzantine Failure Models for Round-based Computations

Mobile Byzantine Failures have been investigated so far in round-based computations, and can be classified according to Byzantine mobility constraints: (i) Byzantine agents with constrained mobility [START_REF] Buhrman | Optimal resiliency against mobile faults[END_REF] may only move from one node to another when protocol messages are sent (similarly to how viruses would propagate), while (ii) Byzantine agents with unconstrained mobility [START_REF] Banu | An improved byzantine agreement algorithm for synchronous systems with mobile faults[END_REF][START_REF] Bonnet | Tight bound on mobile byzantine agreement[END_REF][START_REF] Garay | Reaching (and maintaining) agreement in the presence of mobile faults[END_REF][START_REF] Ostrovsky | How to withstand mobile virus attacks[END_REF][START_REF] Reischuk | A new solution for the Byzantine generals problem[END_REF][START_REF] Sasaki | Mobile byzantine agreement on arbitrary network[END_REF] may move independently of protocol messages. Most of the previously cited models [START_REF] Banu | An improved byzantine agreement algorithm for synchronous systems with mobile faults[END_REF][START_REF] Bonnet | Tight bound on mobile byzantine agreement[END_REF][START_REF] Buhrman | Optimal resiliency against mobile faults[END_REF][START_REF] Garay | Reaching (and maintaining) agreement in the presence of mobile faults[END_REF][START_REF] Sasaki | Mobile byzantine agreement on arbitrary network[END_REF] consider that processes execute synchronous rounds composed of three phases: (i) send where processes send all the messages for the current round, (ii) receive where processes receive all the messages sent at the beginning of the current round and (iii) computation where processes process received messages and prepare those that will be sent in the next round. Only between two consecutive rounds, Byzantine agents are allowed to move from one node to another. Hence the set of faulty processes at any given time has a bounded size, yet its membership may evolve from one round to the next. The main difference between the aforementioned four works [START_REF] Banu | An improved byzantine agreement algorithm for synchronous systems with mobile faults[END_REF][START_REF] Bonnet | Tight bound on mobile byzantine agreement[END_REF][START_REF] Garay | Reaching (and maintaining) agreement in the presence of mobile faults[END_REF][START_REF] Sasaki | Mobile byzantine agreement on arbitrary network[END_REF] lies in the knowledge that processes have about their previous infection by a Byzantine agent. In Garay's model [START_REF] Garay | Reaching (and maintaining) agreement in the presence of mobile faults[END_REF], a process is able to detect its own infection after the Byzantine agent left it. More precisely, during the first round following the leave of the Byzantine agent, a process enters a state, called cured, during which it can take preventive actions to avoid sending messages that are based on a corrupted state.

More details are presented in Chapter 3, where we present all the system models considered in this thesis.

The Byzantine Agreement problem, introduced first by Lamport et al. [START_REF] Lamport | The byzantine generals problem[END_REF] is one of the most studied building blocks in distributed computing and is specified as the conjunction of the following three properties [START_REF] Lynch | Distributed Algorithms[END_REF]:

• (Termination): All correct processes eventually decide;

• (Agreement): No two correct processes decide on different values;

• (Validity): If all correct processes start with the same value v, then v is the only possible decision value for a correct process.

In the Mobile Byzantine version of the problem has been the only problem solved so far presence of mobile Byzantine failures.

Garay [START_REF] Garay | Reaching (and maintaining) agreement in the presence of mobile faults[END_REF] proposed, in this model, an algorithm that solves Mobile Byzantine Agreement provided that n > 6f . This bound was later dropped to n > 4f by Banu et al. [START_REF] Banu | An improved byzantine agreement algorithm for synchronous systems with mobile faults[END_REF]. Sasaki et al. [START_REF] Sasaki | Mobile byzantine agreement on arbitrary network[END_REF] investigated the same problem in a model where processes do not have the ability to detect when Byzantine agents move, and show that the bound raises to n > 6f . Finally, Bonnet et al. [START_REF] Bonnet | Tight bound on mobile byzantine agreement[END_REF] considers an intermediate setting where cured processes remain in control on the messages they send (in particular, they send the same message to all destinations, and they do not send obviously fake information, e.g., fake IDs); this subtle difference on the power of Byzantine agents has an important impact on the bounds for solving agreement: the bound becomes n > 5f and is proven tight.

Approximate Byzantine Agreement

In this thesis we explore the Approximate Byzantine Agreement problem, in which processes start with real numbers as inputs, and eventually decide a real number as output. The difference with the (exact) Byzantine Agreement is that instead of agreeing exactly, processes are allowed to disagree within a small positive margin on the decided values. The specification of the Approximate Byzantine Agreement [START_REF] Lynch | Distributed Algorithms[END_REF] has the same termination property as the Byzantine Agreement. However, it has different agreement and validity properties:

• (Termination): All correct processes eventually decide;

• ( -Agreement): for some > 0, the decision values of any pair of correct processes are within of each other;

• (Validity): any decision value for a correct process is in the range of the initial values of the correct processes.

The Approximate Byzantine Agreement problem has been studied since the eighties [START_REF] Dolev | Reaching approximate agreement in the presence of faults[END_REF], [START_REF] Fischer | Easy impossibility proofs for distributed consensus problems[END_REF]. Most of the presented solutions are based on successive rounds of exchanges of the latest value each process locally stores. Upon collecting each set of values, a correct process applies a function (e.g., average) and adopts as next value the value returned by the function. The interested reader may refer to reference textbooks [START_REF] Lynch | Distributed Algorithms[END_REF] and references herein [START_REF] Fekete | Asymptotically optimal algorithms for approximate agreement[END_REF][START_REF] Fekete | Asynchronous approximate agreement[END_REF].

Stolz et al. [START_REF] Stolz | Byzantine approximate agreement with median validity[END_REF] recently proposed an Approximate Byzantine Agreement solution where processes have to approximate the median value of the input values. Their algorithm achieves agreement for n > 3f within f + 1 rounds, where f denotes the number of faulty (Byzantine) processes, while n denotes the total number of processes. Their algorithm is not included in the class of MSR-algorithms of [START_REF] Kieckhafer | Reaching approximate agreement with mixed-mode faults. Parallel and Distributed Systems[END_REF] since they use a variant of the King algorithm [START_REF] Berman | Towards optimal distributed consensus (extended abstract)[END_REF]. Multidimensional agreement has been investigated by Mendes et al. [START_REF] Mendes | Multidimensional approximate agreement in byzantine asynchronous systems[END_REF][START_REF] Mendes | Multidimensional agreement in byzantine systems[END_REF], where the authors also highlight the connexion between approximate agreement and convergence in mobile autonomous robot networks [START_REF] Bouzid | Byzantine convergence in robot networks: The price of asynchrony[END_REF][START_REF] Bouzid | Optimal byzantineresilient convergence in uni-dimensional robot networks[END_REF]. Li et al. [START_REF] Li | Approximate byzantine consensus in sparse, mobile ad-hoc networks[END_REF] and Charron-Bost et al. [START_REF] Charron-Bost | Approximate consensus in highly dynamic networks: The role of averaging algorithms[END_REF] consider extensions to dynamic networks. In a sustained line of work, Tseng et al. [START_REF] Su | Reaching approximate byzantine consensus with multi-hop communication[END_REF][START_REF] Tseng | Iterative approximate byzantine consensus under a generalized fault model[END_REF][START_REF] Tseng | Asynchronous convex hull consensus in the presence of crash faults[END_REF][START_REF] Tseng | Iterative approximate consensus in the presence of byzantine link failures[END_REF][START_REF] Vaidya | Iterative approximate byzantine consensus in arbitrary directed graphs[END_REF] investigate approximate agreement problem within various faults models (link crash, process crash, Byzantine) in multi-hop networks (both for the directed and the undirected cases).

Allowing different kinds of faults was investigated by Kieckhafer et al. [START_REF] Kieckhafer | Reaching approximate agreement with mixed-mode faults. Parallel and Distributed Systems[END_REF], as they unify different algorithms into the class of MSR-algorithms (Mean -Subsequence-Reduced), which compute the mean of a subsequence of the reduced multi-set of values. The authors analyze the convergence rate and the fault-tolerance of this class of algorithm in a so-called Mixed-Mode faults model. In this model faults are partitioned into asymmetric (classical Byzantine), symmetric and benign. The benign faults are self-incriminating (immediately self-evident to all non faulty processes). The behavior of symmetric faults is perceived identically to all correct processes, while the asymmetric faults have a totally arbitrary behavior. That is, the behavior of processes being subject to asymmetric faults may be perceived differently by different correct processes.

Distributed Registers

A Distributed Register (or just Register) is an abstraction that provides two operation, read() to read the value on the register and write(), to write a new value on the register. This abstraction can be accessed by multiple readers and by one or multiple writers. We indicate as SWMR Register the Single Writer Multi Reader Register specification and as MWMR Register the Multi Writer Multi Reader Register specification. Distributed Registers classification have been defined in [START_REF] Lamport | On interprocess communication. part i: Basic formalism[END_REF] depending on the operational semantics they provide. In particular those semantics aim to specify values that a read() operation is allowed to return. Safe Register is the weakest specification. The only assumption is that a read() operation that is not concurrent with any write() operation obtains the correct value, the most recently written one. Thus, in case the operations are concurrent, a read() operation is allowed to return any value in the register domain. The Regular Register is the next stronger specification. Basically, it is a safe register (a read not concurrent with a write returns the correct value) and in which a read() operation that overlaps a write() operation obtains either the old or the new value. The Atomic Register is the strongest specification considered. This register is like a regular register in which reads and writes behave as if they occur in some definite order. Informally, the semantic does not allow the following situation: given two consecutive (not concurrent) read() operations, r 1 and r 2 , is it not possible that r 1 returns a more recent value with respect to the one returned by r 2 (the so called new old inversion). In [START_REF] Lamport | On interprocess communication. part ii: Algorithms[END_REF] algorithms are presented to implement those Register specifications in an asynchronous system, all but the MWMR Atomic Register, whose is presented in [START_REF] Vitanyi | Atomic shared register access by asynchronous hardware[END_REF]. Those works do not take into account any type of failure, [START_REF] Attiya | Sharing memory robustly in message-passing systems[END_REF] is the first work that introduces a solution to implement a SWMR Atomic Register in an asynchronous system prone to crash failures, and in [START_REF] Lynch | Robust emulation of shared memory using dynamic quorum-acknowledged broadcasts[END_REF], using quorum system, the MWMR Atomic Register problem is solved. As we state, beside crash failures, Byzantine failures are the most general failures type, and Byzantine fault tolerance is at the core of Distributed Computing. To tolerate Byzantine failures two approaches are possible: (i) verifiable approach, where authenticated communication primitives are used to communicate and (ii) non-verifiable, where those primitives are not available. Concerning the verifiable approach in [START_REF] Cachin | Optimal resilience for erasure-coded byzantine distributed storage[END_REF] is provided the first optimal MWMR Atomic Register, where n > 3f is the lower bound on the number of replicas. Concerning the more challenging non-verifiable approach, in [START_REF] Malkhi | Secure and scalable replication in phalanx[END_REF] is implemented a safe and regular register introducing the so called Byzantine Quorum System. Atomicity is solved in [START_REF] Pierce | A recipe for atomic semantics for byzantine quorum systems[END_REF] showing that any protocol assuring the regular semantic in presence of Byzantine failures can produce an atomic register leveraging on the writeback mechanism. Finally in [START_REF] Martin | Minimal byzantine storage[END_REF] a solution is presented matching the lower bound to implement a MWMR Atomic Register. In particular they state that the lower bound on the number of servers to implement a safe register with a confirmable1 protocol is at least n > 3f , which matches the lower bounds of the verifiable approach.

Chapter 3

System Model

In this chapter we introduce the basic definitions to characterize the distributed system and the system model where it takes place.

Processes

A process models the computer program behavior. A distributed system is composed by a set of n processes, each of them running a distributed algorithm and each of them is distinguishable by a unique identifier. We denoted such set as Π = {p 1 , p 2 , . . . , p n }. When we consider the Client-Server paradigm, we consider a distributed system composed of an arbitrarily large set of client processes C and a set of n server processes S = {s 1 , s 2 . . . s n }. In the following, when it is not necessary to specify, we use the general term process.

The passage of time is measured by a fictional global clock that spans the set of natural integers. Processes in the system do not have access at the fictional global time. At each time t, each process (either client or server) is characterized by its internal state (or just state) i.e., the set of all its local variables and the corresponding values.

Each process is modeled as an I/O automaton [START_REF] Lynch | An introduction to input/output automata[END_REF]. Automaton actions are classified as either input, output, or internal. An automaton generates output and internal actions autonomously, and transmits an output to its environment (e.g., the process sends a message). In contrast, the automaton input (e.g., the process receives a message) is generated by the environment and transmitted to the automaton. We refer to this interface as the automaton actions signature sig.

More formally an I/O automaton is a tuple of the form A = sig, Γ, st 0 , F, ω , where:

sig is the actions signature, a finite, non empty set of input, output and internal actions;

-Γ is a finite, non empty, set of states;

st 0 ∈ Γ is the initial state;

-F ∈ Γ is a non empty set of final states;

ω : Γ × sig → Γ is the transition function.

When automata run, they generate executions. An execution is an alternated sequence of states st j and actions π j starting with the initial state st 0 . A distributed protocol is composed by a set of u automata, P = {A 1 , A 2 , . . . , A u }. The set containing the u executions of all n processes forms the behavior of the distributed system.

Process Failures

In this work we consider a distributed system prone to failures, in particular Mobile Byzantine failures. We refer to a process experiencing a Byzantine failure as Byzantine process, faulty process or just Byzantine. A Byzantine process, contrarily to a correct process, might deviate in an arbitrarily way from the automaton specification assigned to it. Given an execution, a Byzantine process p i is assumed to be always faulty Mobile Byzantine fault is an extension of such model, given an execution, a Byzantine process p i is not assumed to be Byzantine forever, or in other words, all processes can be Byzantine at some point, but the number of Byzantine process can not be more than f at any time. We assume that there are f mobile Byzantine agents (or just mobile agents) that move from a process to another, in such a way that when a mobile agent affects a process, such process is said to be Byzantine. In this case the notion of time has to be explicit, we say that a process p i is Byzantine at time t or affected by mobile Byzantine agent at time t. We assume that when a process is no more affected by Byzantine failure, it retrieves the correct protocol P code from a tamper prof memory but the internal state is not predictable. Such process is said to be cured at time t. Let P = {A 1 , A 2 , . . . , A u } be a protocol such that A i = sig i , Γ, st i 0 , F i , ω i ∀i = 1, . . . , u. Intuitively, a correct process never deviates from P specification. On the contrary, a Byzantine process can be modeled by a process executing a protocol B = P. A cured process is executing P but with different states with respect to a correct process at the same time t. Let us now give a formal definition of correct, Byzantine and cured processes with respect to the time. To do that let us first introduce the concept of valid internal state at time t referred in short as valid state at time t.

Communication models

Processes, in order to run the distributed protocol, need to communicate. In this work we consider the message-passing model. In particular, we assume that: (i) each process can communicate with every other process through a broadcast() primitive. In the Client-Server paradigm, (ii) each client c i ∈ C can communicate with every server through a broadcast() primitive and (iii) each server can communicate with a particular client through a send() unicast primitive. We assume that communications are authenticated (i.e., given a message m, the identity of its sender cannot be forged) and reliable (i.e., spurious messages are not created and sent messages are neither lost nor duplicated).

Time Assumptions

Communication between processes is either synchronous or asynchronous. We assume (i) processes internal steps take no time and, as stated before, (ii) there is a global clock. We consider two types of system time assumptions: asynchronous and synchronous.

The asynchronous system is characterized by no physical timing assumption on processes and communication links. Thus, there exists no upper bound on communications latency. As a consequence, messages are delivered but it is not possible to predict any upper bounds on their delivery time. On the contrary, the synchronous system is characterized by the following property: a message m sent at time t from process p i / ∈ B(t) to p j is received by p j a time t , t ≤ t + δ and δ ≥ 0. Similarly, let t be the time at which a correct process (client) p i / ∈ B(t) invokes the broadcast(m) primitive, then there is a constant δ such that all processes (servers) have delivered m by time t + δ. δ is known to every process.

Computational models

We consider two different computational models, round-based and round-free. In the round-based system the computation evolves in sequential synchronous rounds {r 0 , r 1 , . . . , r i , . . . }. Every round is divided in three phases: (i) send, where processes send all the messages for the current round, (ii) receive, where processes receive all the messages sent at the beginning of the current round and (iii) computation, where processes process received messages and prepare those that will be sent in the next round. Contrarily to this, in the round-free system there are no rounds and no phases driving the computation.

Chapter 4

Mobile Byzantine Failures

In this chapter we define the Mobile Byzantine Failure (MBF) models, starting with models defined so far for round-based computation, and presenting after them our contribution for round-free computations. The MBF models considered so far in the literature [START_REF] Banu | An improved byzantine agreement algorithm for synchronous systems with mobile faults[END_REF][START_REF] Bonnet | Tight bound on mobile byzantine agreement[END_REF][START_REF] Buhrman | Optimal resiliency against mobile faults[END_REF][START_REF] Garay | Reaching (and maintaining) agreement in the presence of mobile faults[END_REF][START_REF] Ostrovsky | How to withstand mobile virus attacks[END_REF][START_REF] Reischuk | A new solution for the Byzantine generals problem[END_REF][START_REF] Sasaki | Mobile byzantine agreement on arbitrary network[END_REF] assume that faults, represented by Byzantine agents, are controlled by a powerful external adversary that "moves" them from a server to another. Let us remember that the term "mobile" does not necessary mean that a Byzantine agent physically moves from one process to another but it rather captures the phenomenon of a progressive infection, that alters the code executed by a process and its internal state.

MBF Models for round-based computations

In all the above cited works the system evolves in synchronous rounds. As we state in the previous chapter, every round is divided in three phases: send, receive and computation. Concerning the assumptions on agent movements and servers awareness on their cured state, the Mobile Byzantine Models defined in [START_REF] Bonnet | Tight bound on mobile byzantine agreement[END_REF][START_REF] Garay | Reaching (and maintaining) agreement in the presence of mobile faults[END_REF][START_REF] Buhrman | Optimal resiliency against mobile faults[END_REF][START_REF] Sasaki | Mobile byzantine agreement on arbitrary network[END_REF] are summarized as follows:

• Garay's model [START_REF] Garay | Reaching (and maintaining) agreement in the presence of mobile faults[END_REF] (M1). In this model, agents can move arbitrarily from a server to another at the beginning of each round (i.e., before the send phase starts). When a server is in the cured state it is aware of its condition and thus can remain silent for a round to prevent the dissemination of wrong information. An example is depicted in Figure 4.1. Previously cited models [START_REF] Bonnet | Tight bound on mobile byzantine agreement[END_REF][START_REF] Garay | Reaching (and maintaining) agreement in the presence of mobile faults[END_REF][START_REF] Buhrman | Optimal resiliency against mobile faults[END_REF][START_REF] Sasaki | Mobile byzantine agreement on arbitrary network[END_REF] consider that the Byzantine agents mobility is related to the round-based synchronous system communication. That is, processes execute synchronous rounds composed of three phases: send, receive, compute. Only between two consecutive rounds, Byzantine agents are allowed to move from one node to another. In the sequel we formalize and generalize the MBF model. Our generalization is twofold: (i) we decouple the Byzantine agents movement from the structure of the computation making it round-free and hence suitable for any distributed application and (ii) we model the infection diffusion in relation with the detection/recovery capabilities of servers.

Mobile Byzantine Models for round-free computations

In our framework, we are interested in modeling two different attack dimensions: (i) how the external adversary can coordinate the movement of the Byzantine agents and (ii) the process awareness about their current failure state. The first point abstracts the capability of the external adversary to propagate the infection with respect to the detection and recovery capability of processes while the second point distinguishes between detection and proactive recovery capabilities. Concerning the adversary coordination power, we can distinguish among the following three cases:

• ∆-synchronized (or synchronized with a period ∆, denoted as ∆S):

the external adversary moves all the f mobile Byzantine Agents at the same time t and movements happen periodically (i.e., movements happen at time t 0 + ∆, t 0 + 2∆, . . . , t 0 + i∆, with i ∈ N). An example is shown in Figure 4.5.

• independent: the adversary moves each of f mobile Byzantine Agents independently. Independent movements can be further decomposed in:

-time-bounded (ITB): each of the f Mobile Byzantine Agent ma i is forced to remain on a process for at least a period ∆ i . Given two mobile Byzantine Agents ma i and ma j , their movement periods ∆ i and ∆ j may be different. An example is shown in Figure 4.6.

-time-unbounded (ITU): each Mobile Byzantine agent ma i is free to move at any time (i.e., it may occupy a process for one time unit, corrupt its state and then leave). This case can be seen as a particular case of IT B where ∆ i = 1 for each mobile agent ma i . An example is shown in Figure 4.7.

Concerning the knowledge that each process has about its failure state, we will distinguish, as for round-based models, among the following two cases:

• Cured Aware Model (CAM): at any time t, any process is aware about its failure state.

• Cured Unaware Model (CUM): at any time t, any process is not aware about its failure state. Any instance of our MBF framework is characterized by a pair (X, Y ), where X represents the coordination aspect (i.e., one among ∆S, IT B and IT U ) and Y represents the process awareness (i.e., CAM vs. CU M ). Figure 4.8 shows the six different models obtained by combining the two axis of our round-free MBF framework.

s 5 s 4 s 3 s 2 s 1 s 0 ma 1 ma 2 t 0 t 0 + ∆ . . . t 0 + i∆
The coordination dimension allows to characterize the infection spreading from a time point of view. In particular:

• (∆S, * ) allows to consider coordinated attacks where the external adversary needs to control a subset of machines. In this case, compromising new machines will take almost the same time as the time needed to detect the attack or the time necessary to rejuvenate. This may represent scenarios with low diversity where compromising time depends only on the complexity of the exploit and not on the target server. More formally, the external adversary moves all the f mobile Byzantine Agents at the same time t and movements happen periodically (i.e., movements happen at time t 0 + ∆, t 0 + 2∆, . . . , t 0 + i∆, with i ∈ N) and such periods are known by servers.

• (IT B, * ) slightly relaxes the assumption about the time of the infection propagation. In particular, in this case the Byzantine agents may affect different servers for different periods of time. This abstracts in some way the possible different complexities of various attack steps (each mobile agent can do a set of exploits and each exploit may take different time to succeed and then to be detected). As a consequence, we are able to capture possible differences in the detection and the rejuvenation times that are now different from server to server. More formally, each of the f Mobile Byzantine Agent ma i is forced to remain on a process for at least a period ∆ i . Given two mobile Byzantine Agents ma i and ma j , their movement periods ∆ i and ∆ j may be different.

• (IT U, * ) further relaxes the coordination assumption and allows to consider extremely fast infection and detection/rejuvenation processes. More formally, each Mobile Byzantine agent ma i is free to move at any time (i.e., it may occupy a process for one time unit, corrupt its state and then leave). This case can be seen as a particular case of IT B where ∆ i = 1 for each mobile agent ma i .

s 5 s 4 s 3 s 2 s 1 s 0 ma 1 ma 2 ∆ 2 ∆ 1 |B(t0 + ∆1, t0 + 2∆1)| = f
Let us note that, obviously, (∆S, * ) is the most restrictive coordination case with respect to the adversary power while (IT U, * ) represents the maximum freedom (from the coordination point of view) for the external adversary.

The awareness dimension allows to distinguish between servers under continuous monitoring from the non-monitored ones. Monitored systems are, in fact, characterized by detection and reaction capabilities that enable them to detect their failure state and to act accordingly. On the contrary, non-monitored servers have no self-diagnosis capabilities but they can try to prevent infections by adopting pessimistic strategies that include proactive rejuvenation. In particular:

• ( * , CAM ) is able to capture scenarios where servers are aware of a past infection as they abstract environments characterized by the presence of monitors (e.g., antivirus, Intrusion Detection System etc...) that are able to detect the infection and notify the server when the threat is no more affecting the server.

• ( * , CU M ) represents situations where the server is not aware of a possible past infection. This scenario is typical of distributed systems subject to periodic maintenance and proactive rejuvenation. In this systems, there is a schedule that reboots all the servers and reloads correct versions of the code to prevent infections to be propagated in the whole network. However, this happens independently from the presence of a real infection and implies that there could be periods of time where the server executes the correct protocol however its internal state is not aligned with non compromised servers. It is easy to prove that CAM is a stronger awareness condition with respect to CU M and thus represents a restriction over the adversary power.

The instance (∆S, CAM ) is the strongest one as it is the most restrictive for the external adversary and it provides cured processes with the highest awareness while the instance (IT U, CU M ) represents the weakest model as it considers the most powerful adversary and provides no awareness to cured processes.

As in the round-based models, we assume that the adversary can control at most f Byzantine agents at any time (i.e., Byzantine agents are not replicating themselves while moving). In our work, only servers can be affected by the mobile Byzantine agents 1 . It follows that, at any time t, |B(t)| ≤ f . However, during the system life, all servers may be affected by a Byzantine agent (i.e., none of the server is guaranteed to be correct forever). In order to abstract the knowledge a server has on its state (i.e., cured or correct), we assume the existence of a cured_state oracle. When invoked via report_cured_state() function, the oracle returns, in the CAM model, true to cured servers and false to others. Contrarily, the cured_state oracle returns always false in the CUM model. The implementation of the oracle is out of scope of this work and the reader may refer to [START_REF] Ostrovsky | How to withstand mobile virus attacks[END_REF] for further details. 1 It is trivial to prove that in our model when clients are Byzantine it is impossible to implement deterministically even a safe register. The Byzantine client will always introduce a corrupted value. A server cannot distinguish between a correct client and a Byzantine one.

Chapter 5

Distributed Registers in the Round Based Model

Register Specification

A register is a shared variable accessed by a set of processes (i.e., clients) through two operations, namely read() and write(). Informally, the write() operation updates the value stored in the shared variable while the read() obtains the value contained in the variable (i.e., the latest written value). The register state is maintained by the set of servers S. Every operation issued on a register is, generally, not instantaneous and it can be characterized by two events occurring at its boundaries: an invocation event and a reply event. These events occur at two time instants (i.e., invocation time and the reply time) according to the fictional global time. An operation op is complete if both the invocation event and the reply event occurred (i.e., the client issuing the operation does not crash between the invocation time and the reply time). Then, an operation op is failed if it is invoked by a process that crashes before the reply event occurs.

Given two operations op and op , their invocation times (t B (op) and t B (op )) and reply times (t E (op) and t E (op )), we say that op precedes op (op ≺ op ) if and only if t E (op) < t B (op ). If op does not precede op and op does not precede op, then op and op are concurrent (noted op||op ). Given a write(v) operation, the value v is said to be written when the operation is complete. In this chapter we consider the atomic register specifications.

MWMR Atomic Register

The Multi-Writer/Multi-Reader (MWMR) atomic register is specified as follow:

• Termination: Any operation invoked on the register eventually terminates.

• Validity: A read() operation, if it does not overlap any write() operation, returns the last value written before its invocation (i.e., the value written by the latest completed write() preceding it).

• Ordering: There exists a total order S such that (i) any operation invoked on the register belongs to S, (ii) given op and op belonging to S, if op ≺ op , then op appears before op in S and (iii) any read() operation returns the value v written by the last write() preceding it in S.

Impossibility results are stated in the next section (Section 5.2). For simplicity those results are proven using the weak register specification, the safe register (weaker than the regular register in the Lamport's hierarchy [START_REF] Lamport | On interprocess communication[END_REF]). Contrarily to the Atomic register, a read() operation on a safe register concurrent with a write operation may return any value in the register domain.

SWMR Safe Register

A single-writer/multi-reader (SWMR) safe register [START_REF] Lamport | On interprocess communication[END_REF] specified as follows:

• Termination: if a correct client invokes an operation, it eventually returns from that operation (i.e., every operation issued by a correct client eventually terminates);

• Validity: A read() operation, if it does not overlap any write() operation, returns the last value written before its invocation (i.e., the value written by the latest completed write() preceding it).

Impossibilities

In this section we start to present new problems that arise to design a MBF tolerant protocol. In particular what is the impact of mobile Byzantine movements and the consequent change of servers failure state. In the sequel we prove that in the case of MBF tolerant implementations a new operation, that we name maintenance(), must be implemented to prevent servers from losing the current register value.

Theorem 1 Let n be the number of servers emulating a safe register and let f be the number of Mobile Byzantine Agents affecting servers. Let A R and A W be respectively the algorithms implementing the read() and the write() operations. If f > 0 then there exists no protocol P reg = {A R , A W } implementing a safe register in any of the MBF models for round-based computations.

Proof Let us suppose by contradiction that P reg = {A R , A W } is a correct protocol implementing a safe register. If P reg is correct, it means that both A R and A W implementing respectively the read() and the write() operations terminate i.e., they stop to execute steps when the operation is completed. Let r be the round at which some operation op terminates and let us assume that no other operation is invoked until round r > r. Let us note that during the interval [r, r ] no algorithm is running as all the operations issued in the past are completed. As a consequence, no correct server and no cured server change its state by themselves. However, considering that r does not depend on P reg (i.e., it is not controlled by the register protocol but it is defined by clients) and considering the mobility of the Mobile Byzantine agents, we may easily have a run where every correct server is faulty and its state is corrupted at some round in [r, r ]. Considering that P reg = {A R , A W } and that A R and A W are not running in [r, r ] we can have that every server stores a non valid state at round r and the register value is lost. As a consequence, A R has no way to read a valid value after r and the validity (or termination, depending on how the algorithm is implemented) property is violated. It follows that P reg is not correct and we have a contradiction.

T heorem 1

From Theorem 1 it follows that, in presence of Mobile Byzantine Agents, a new operation must be defined to allow cured servers to restore a valid state and avoid the loss of the register values.

Definition 5 (maintenance() and A M ) A maintenance() operation is an operation that, when executed by a process p i , terminates at some point during round r so that p i has a valid state at the beginning of round r + 1 (i.e., it guarantees that p i is correct at round r + 1). A maintenance algorithm A M is an algorithm that implements the maintenance() operation.

As a consequence, any correct protocol P reg must include one more algorithm implementing the maintenance() operation1 so that the corollary follows:

Corollary 1 Let n be the number of servers emulating a register and let f be the number of Mobile Byzantine Agents in the system. That is, if f > 0 then any correct protocol P reg implementing a register in the round-based Mobile Byzantine Failure model must include an algorithm A M (i.e., P reg = {A R , A W , A M }) that concurrently runs with mobile agents movements.

Lemma 1 Let P reg = {A R , A W , A M } be a protocol implementing a safe register in any round-based Mobile Byzantine Failure Model. Let f > 0 be the number of Byzantine Agents controlled by the external adversary. Any algorithm A M must involve at least one round.

Proof

The claim follows by considering that cured servers have a compromised state and they need to receive information from correct servers in order to be able to update their state to a valid one. It follows that at least one communication step is required, which means at least one round. Lemma 1

Discussion

In the previous works ( [START_REF] Garay | Reaching (and maintaining) agreement in the presence of mobile faults[END_REF][START_REF] Banu | An improved byzantine agreement algorithm for synchronous systems with mobile faults[END_REF][START_REF] Bonnet | Tight bound on mobile byzantine agreement[END_REF][START_REF] Buhrman | Optimal resiliency against mobile faults[END_REF]) has never been pointed out the maintenance necessity condition. The reason is that the aim of those works is to solve consensus, which is a single operation and whose solution requires algorithms evolving in rounds ( [START_REF] Fischer | A lower bound fob the time to assube intebactive consistencv[END_REF]), thus in a synchronous system there are no periods in which the protocol does not perform operations while mobile agents are moving. The only form of maintenance, in the mobile Byzantine case, is performed when consensus terminates, thus at the end of the operation. In this case algorithms keep on exchanging information to do not lose the reached agreement. Informally we can say that the maintenance() operation is embedded in the previous work given the problem nature (solution itself requires a continuous values exchange). In the register case, more operations occur and those operation may not be sequential, thus an explicit maintenance operation is required. In a toy scenario where the writer is continuously executing the write() operation the maintenance() operation would be redundant.

Lower Bounds

In this section we prove impossibilities on the number of correct servers to implement an atomic register for the four models [START_REF] Bonnet | Tight bound on mobile byzantine agreement[END_REF][START_REF] Garay | Reaching (and maintaining) agreement in the presence of mobile faults[END_REF][START_REF] Buhrman | Optimal resiliency against mobile faults[END_REF][START_REF] Sasaki | Mobile byzantine agreement on arbitrary network[END_REF] presented in Chapter 4. An algorithm that matches those impossibilities is presented in Section 5.4, proving that results presented in the sequel are lower bounds for the considered problem.

To this aim we start proving impossibilities on the number of correct servers to implement a safe register, whose results can be directly extended to atomic register. We represent each server s i state at each round r as the composition of the internal state and faulty state: values, f state s i ,r , where s i is the server identifier we are referring to at round r. values represents the internal variables values of s i (including the last written value) and f state is the failure state at round r, such that f state ∈ {correct, cured, f aulty}. We represent f state for simplicity in each considered failure models. Notice that in Garay [START_REF] Garay | Reaching (and maintaining) agreement in the presence of mobile faults[END_REF] and Buhrman [START_REF] Buhrman | Optimal resiliency against mobile faults[END_REF] models this information is available at server side contrarily to Sasaki [START_REF] Sasaki | Mobile byzantine agreement on arbitrary network[END_REF] and Bonnet [START_REF] Bonnet | Tight bound on mobile byzantine agreement[END_REF] models. Without loss of generality in the following proofs we consider that one server may be affected by a Byzantine agent each round, i.e., f = 1. To extend the proof then it is sufficient to substitute the faulty server with a set of f faulty servers.

As shown in Section 5.2, the A M algorithm is necessary (cf. Corollary 1), therefore any protocol solving safe register has to be twofold, on one side it has to (i) allow cured servers to turn in correct and to (ii) allow a client, if there are no concurrent write() operation, to return the last written value during a read() operation. In the following impossibility proofs we violate one of the two. In particular concerning the A M algorithm we consider the following. For Lemma 1 such operation requires at least one round in which correct servers exchange the information necessary for a cured server to become correct. From the system model, the computation evolves in rounds and at each round the set of Byzantine servers may change. To match the result in Lemma 1 we consider that at the beginning of each round servers, during the send phase of the round, broadcast information each others and during the delivery phase, at the end of the same round, servers collect those information.

Theorem 2 If n ≤ 3f , there exists no protocol P solving a safe register in Garay's model [START_REF] Garay | Reaching (and maintaining) agreement in the presence of mobile faults[END_REF].

Proof Let us suppose by contradiction that there exists a protocol P implementing the safe register in the Garay's model with n = 3f . Let r 1 be the first round of the computation. Assuming that the mobile agent moves at each new round, it follows that during next round r 2 , the first cured server appears (server that was affected during round r 1 ).

Let E 1 and E 2 be two executions where at the beginning of each round servers exchange the value values they are storing. Execution E 1 characterized by the following three servers states at the beginning of round r2: { v, correct s 0 ,r 2 , v , f aulty s 1 ,r 2 , ⊥, cured s 2 ,r 2 }. During round r 2 cured server s 2 collects other servers values: {v, v }2 . Since P exists then s 2 , at the end of the round, changes its state storing the same values as the correct server s 0 , v, correct s 2 ,r 2 . Execution E 2 is characterized by the following three servers states at the beginning of round r2 : { v , correct s 0 ,r 2 , v, f aulty s 1 ,r 2 , ⊥, cured s 2 ,r 2 }. During r 2 cured server s 2 collects the following servers replies: {v, v }. By hypothesis P implements a safe register, then s 2 , at the end of the round, changes its state storing the same values as the correct server s 0 , v , correct s 2 ,r 2 . In both executions s 2 collects the same sets of replies but ends up with different states, leading to a contradiction. To conclude the proof let us consider the case in which the maintenance() operation lasts more than one round, then it is straightforward that there is no advantage. In this case the reply set collected during the round after can be either the same (if the mobile agent does not move, but then we can still build two indistinguishable executions) or different, but such difference is due to the presence of two cured servers and a Byzantine server, so there are no more correct servers. Thus if n = 3f there is no maintenance() operation and from Theorem 1 safe register cannot be implemented.

T heorem 2

The previous proof is constructed on the fact that when n ≤ 3f , cured processes cannot recover the correct state. Therefore, a client cannot return the last written value. Next proofs advocate that even though the number of correct servers increases, a client may return different values based on the same set of collected values. To be as general as possible consider that a read() operation is composed by a request phase and of t, t ≥ 1, reply phases. In each of those reply phases servers send to the client their stored value. A read() operation whose duration is not fixed is considered because mobile agents move round after round, this means that the system composition changes respect to the faulty servers and changes at each round the set of correct servers that reply. Thus one may think that after a certain amount of time it could be possible to read. Let further assume that each server is aware of having been affected in the previous round and sends back this information to client. Notice, we are assuming that correct servers know if they were correct or not in the previous round, indifferently from the failure model considered. In this way we are giving to servers as much power as possible, despite that, we prove impossibilities. We assume that reply messages contain the following information: value, f state r-1 s jr , where value is the value stored by s j at round r and f state r-1 ∈ {correct, non_correct} is the failure of the server in the previous round, notice that non_correct is either Byzantine or cured.

Theorem 3 If n ≤ 4f , there exists no protocol P implementing a safe register in Sasaki's model [START_REF] Sasaki | Mobile byzantine agreement on arbitrary network[END_REF].

Proof Let us suppose that n = 4f and that the P protocol does exist. Let r 1 be the first round of the computation, such that during r 2 the first cured server appears (server that was affected during round r 1 ). Let us consider that at round r 2 client c i issues a read() operation, such that during r 2 the request phase takes place and during r 3 until r 3+t , the t reply phases take place. Let value be the value stored by correct servers, so that each server s j replies as follows:

• (case 1) if s j is faulty then it replies with value , non_correct ;

• (case 2) if s j is cured then it replies with value , correct ;

• (case 3) if s j is correct, but was cured in the previous round then it replies with value, non_correct ;

• (case 4) if s j is correct and was correct also in the previous round then it replies with value, correct ;

Let E 1 be an execution where f = 1 and v is the value stored by correct servers. Let us consider that mobile agent affects at each round r i a different server in the following way: given r i the mobile agent is on s (i mod n) , for simplicity let us denote such servers as s S 1 (i) , 1 is because we are referring to case 1, as defined earlier. It follows that cured server at r i is s S 2 (i) = s (i-1) mod n if i > 1, the correct server that was previously cured is s S 3 (i) = s i+2 mod n while the correct server that was correct also in the previous round is s S 4 (i) = s i+1 mod n , as depicted in Figure 5.1. In E 1 at round r 2 the request phase takes place and from round r 3 to round r 3+t , c i collects the following replies: Let E 2 be an execution where f = 1 and v is the value stored by correct servers and a mobile agent is affecting at each round r i a different server, in particular at r i the affected server is s (n-i mod n) such that the cured server is s (n-(i-1) mod n) from i ≥ 1. Fixed those two servers in each round s (n-(i-2) mod n) (from i ≥ 2) is the correct server that was previously cured. s (n-(i-3) mod n) is the correct server that was correct also in the previous round, with i ≥ 3, if i = 2 we consider s 2 as the resulting server. Such scenario is depicted in Figure 5.2. In E 2 at round r 2 the request phase takes place and from round r 3 to round r 3+t , c i collects the following replies:

{ v, non_correct s 1 ,r 3 , v , correct s 2 ,r 3 , v , non_correct s 3 ,r 3 , v, correct s 4 ,
{ v , non_correct s 1 ,r 3 , v , correct s 2 ,r 3 , v, non_correct s 3 ,r 3 , v, correct s 4 ,r 3 , . . . , v , non_correct s S 1 (3+t) ,r 3+t , v , correct s S 2 (3+t) ,r 3+t , v, non_correct s S 3 (3+t) ,r 3+t , v, correct s S 4 (3+t) ,r 3+t }. Since P exists then c i returns v .
In both executions c i returns different values even though it collects the same set of replies, thus there exist no protocol P solving the safe register if n ≤ 4f . Notice that this is true despite that the mobile agent affects different servers in the two executions and despite the variable duration of the read() operation, which concludes the proof.

T heorem 3

Corollary 2 If n ≤ 4f , there exists no protocol P in Bonnet model [START_REF] Bonnet | Tight bound on mobile byzantine agreement[END_REF] In the Burhman's model [START_REF] Buhrman | Optimal resiliency against mobile faults[END_REF] a key role is played by the moment at which mobile agents move. In this case mobile agents, rather than moving at the beginning of the round, move during the sending phase. Moreover cured servers, as in Garay's model, are aware about their failure state.

Theorem 4

If n ≤ 2f , there exists no protocol P implementing a safe register in the Burhman's model [START_REF] Buhrman | Optimal resiliency against mobile faults[END_REF].

Proof The proof is direct considering that to tolerate Byzantine servers, with non-confirmable writes, n ≥ 2f + 1 is the minimal required number of servers [START_REF] Martin | Minimal byzantine storage[END_REF].

T heorem 4

Upper Bounds

In this section, we present an algorithm A reg implementing a MWMR Atomic Register resilient to the presence of up to f mobile Byzantine agents for the four Round-Based MBF models (i.e., M1-M4). The algorithm follows the basic quorumbased approach to implement read() and write() operations.

Let us recall that mobile Byzantine agents move from one server to another corrupting their internal states. As a consequence, if not properly mastered, this can bring to the compromising of all the servers and to the loss of the register value (cf. Theorem 1). A naive solution would be to exploit write() operations to clean values of cured processes and increase the number of replicas n to ensure the presence of "enough" correct servers to select a valid value. However, such solution has two strong drawbacks: (i) write() operations are not governed by servers and are invoked depending on clients protocols and (ii) the number of replicas needed to tolerate f mobile Byzantine agents grows immediately linearly in the number of rounds between two following write() operations (as the number of cured servers grows). To handle the presence of mobile Byzantine agents, we started from this intuition and we defined a value propagation mechanism that is used to help cured servers to recover and to update their local variables to a correct state. Such mechanism is executed at the beginning of each round and it pushes information between servers allowing cured ones to become correct in one round. The immediate benefit is the reduction of the number of replicas required to master the mobility.

The algorithm presented in the following is defined in a parametric way in order to fit all the four round-based mobile Byzantine failure models presented in Chapter 4. The first parameter of the algorithm, denoted as α, is used to relate the global number of required servers n to the number of mobile Byzantine agents f that can be tolerated. In particular, we relate such two values by the following inequality n ≥ αf + 1 with α ∈ {2, 3, 4} depending on the mobile Byzantine failure model considered. The second parameter, denoted as β, is used to define the minimal number of occurrences of a same value that a client needs to collect in order to select a valid value at the end of the read() operation. Such number is denoted by s and it is defined as s = n -βf , with β ∈ {1, 2}. Finally, in order to abstract the knowledge that a server has of its failure state (i.e., cured or correct), we introduce the cured_state oracle. When invoked via report_cured_state() function, it returns, in the Garay [START_REF] Garay | Reaching (and maintaining) agreement in the presence of mobile faults[END_REF] and Buhrman et al. [START_REF] Buhrman | Optimal resiliency against mobile faults[END_REF] models, true to cured servers and false to others. In this case the oracle is said to be enabled. In Sasaki et al. [START_REF] Sasaki | Mobile byzantine agreement on arbitrary network[END_REF] and Bonnet et al. [START_REF] Bonnet | Tight bound on mobile byzantine agreement[END_REF] model the cured_state oracle returns always false. In this case the oracle is said disabled. The implementation of the oracle is out of scope of this work and the reader may refer to [START_REF] Denning | An intrusion-detection model[END_REF], [START_REF] Ostrovsky | How to withstand mobile virus attacks[END_REF] for further details.

Table 5.1 summarizes the above parameters for each model.

A reg Algorithm Detailed Description

The pseudo-code of the algorithm is presented in Figures 5.3-5.5. The algorithm exploits the round based nature of the system. Any write() operation spans at most two rounds. The operation may, in fact, be invoked in the middle of a round and in this case it effectively starts in the send phase of the next round r. The writer broadcasts the value and all servers deliver it in the same round r. In the receive phase of the same round, servers delivers write() messages and, if more than one write() operation is executed in the same round, servers update the register by selecting the value coming from the client with the highest identifier. Due to the synchrony assumptions no acknowledgement message is required and the operation can terminate at the end of the round r. The read() operation spans at most three rounds. As for the write(), it effectively starts with the send phase of the round starting after its invocation, and takes such round to send a read request to servers, and the following one to gather replies. In the computation phase of the round after, the reader selects the value occurring at least s = n -β M i f times concluding the operation. The value propagation mechanism is implemented by letting servers disseminate the stored value through echo() messages at the beginning of each round. Such echo() messages are collected during the receive phase and are used by cured processes to select a value and to update their value of the register. In such way, they are able to cope with f servers that may have lost their value during the previous round due to the Byzantine mobility.

Local variables at client c i . Each client c i manages the following variables to implement the read() operation:

-op R _start i : is a variable that keeps track of the state of a read() operation at client c i and it can have the following values: {0 = request_round, 1 = reply_round, ⊥ =

Init():

(1) value i ← ⊥; ------------------------------At the beginning of each round r (2) echo_vals i ← ∅;

(3) current_writes i ← ∅; (4) cured i ← report_cured_state(); ------------------------------Send Phase of round r (5) if (¬cured i ) [START_REF] Bonomi | Tight selfstabilizing mobile byzantine-tolerant atomic register[END_REF] then broadcast echo(value i , i); [START_REF] Bonomi | Approximate agreement under mobile byzantine faults[END_REF] for each j ∈ current_reads i do [START_REF] Bonomi | Optimal mobile byzantine fault tolerant distributed storage[END_REF] send reply(value i , i) to c j ; ( 9) endFor (10) endif [START_REF] Buhrman | Optimal resiliency against mobile faults[END_REF] ------------------------------Receive Phase of round r [START_REF] Cachin | Optimal resilience for erasure-coded byzantine distributed storage[END_REF] for each echo(v, j) message delivered do [START_REF] Charron-Bost | Approximate consensus in highly dynamic networks: The role of averaging algorithms[END_REF] echo_vals i ← echo_vals i ∪ {v}; (14) endFor [START_REF] Dolev | Reaching approximate agreement in the presence of faults[END_REF] for each write(v, j) message delivered do [START_REF] Dolev | Self-Stabilization[END_REF] current_writes i ← current_writes i ∪ {< v, j >}; (17) endFor [START_REF] Fekete | Asynchronous approximate agreement[END_REF] for each read(j) message delivered do [START_REF] Fischer | Easy impossibility proofs for distributed consensus problems[END_REF]

current_reads i ← ∅;
current_reads i ← current_reads i ∪ {j}; (20) endFor ------------------------------ Computation Phase of round r (21) if (current_writes i = ∅) (22) then let v such that ∃ < v, j >∈ current_writes i (23) ∧j = arg max k (< -, k >∈ current_writes i ); (24) value i ← v; (25) else if (∃v ∈ echo_vals i | #occurrence(v) ≥ n -β M i f ) (26)
then value i ← v; [START_REF] Li | Approximate byzantine consensus in sparse, mobile ad-hoc networks[END_REF] else value i ← ⊥; no_read_running}.

-replies i : is a set that collects reply messages during a read() operation. It is set to ∅ at the beginning of the operation.

Local variables at server s i . Each server s j manages the following variables:

-value i : it stores the current value of the register.

-echo_vals i : is a set variable (emptied at the beginning of each round) where servers store the echo messages received in the current round.

-current_writes i : is a set variable (emptied at the beginning of each round) where servers store values received through a write() message.

-current_reads i : is a set variable where servers store identifiers of clients that are currently reading. It is emptied after the reply to such clients.

-cured i : is a boolean variable set through the report_cured_ state() event. It is set to true by the cured_state oracle (if enabled) when s i is in a cured state. Otherwise it is always false. operation read():

(1) delay op R _start i ← 0 until the end of the round; ----------------------------

- Send Phase of round r (2) if (op R _start i == 0) (3)
broadcast read(i); (4) endIf [START_REF] Bonnet | Tight bound on mobile byzantine agreement[END_REF] -----------------------------Receive Phase of round r (6) for each reply(v j , j) message received from s j do [START_REF] Bonomi | Approximate agreement under mobile byzantine faults[END_REF] replies Server maintenance. In the send phase of each round, each servers s i , whose variable cured i is set by the oracle as false, performs the broadcast of echo(val, i) message (line 6, Figure 5.3). If no write() operations happen in the current round (the condition at line 21 is not verified), then servers use such collected values are then used during the computation phase (line 25, Figure 5.3) to select a value occurring at least n -β M i f times and update their state. Write operation. In order to write a value v a client c i has to broadcast the write(v, i) message to all servers (line 1, Figure 5.5). Since an operation invocation may happen in any time during a round, then the broadcast() is delayed until the next send phase. At the server side this message is delivered within the same round during the receive phase and any correct and cured server s j stores it in current_writes j set (lines 15-16, Figure 5.3). At the end of the round, during the computation phase, if current_writes j is not empty then the value associated to the highest client identifier is stored in value j (lines 21-24, Figure 5.3). Back to the client side, during its computation phase, it returns the write_confirmation to the application layer (line 4, Figure 5.5).

replies i ← ∅;
i ← replies i ∪ {< v j , j >}; (8) endFor ----------------------------- Computation Phase of round r (9) if (op R _start i == 1) (10) then op R _start i ← ⊥; (11) if (∃ < v j , ->∈ replies i | #occurrence(v j ) ≥ n -β M i f ) (12) then v ← v j ; (13) else v ← ⊥; (14) endif (15) return v; (16) else if (op R _start i == 0) (17) then op R _start i ← 1; (18) replies i ← ∅; (19) else op R _start i ← ⊥; (20) endif (21) endif
Read operation. When a read() operation is invoked by a client c i , op R _start i is set to 0 at the end of the current round (line 1, Figure 5.4), thus at the next send phase the condition at line 2 is true and the read(i) message is broadcast (line 3). Regardless the value of op R _start i at each round the replies i set is emptied --------------------------- (line 18). In the computation phase, the condition at line 16 is true (op R _start i is equal to 0) and op R _start i is set to 1. This means that the read_request phase is over and the next one is the read_reply one. At server side (Figure 5.3), the read(i) message is delivered within the same invocation round. Once the message is delivered, any server s j stores the identifier of the reader in the current_reads j set in order to send back a reply() message at the beginning of the next round (lines 18-19, Figure 5.3). At client side (Figure 5.4), when the next round begins, the condition at line 2 is not true, thus during the send phase the replies i set is emptied. Such set is filled with reply(value j ) messages during the receive phase (lines 6 -8, Figure 5.4). During the computation phase the condition at line 9 is true, thus op R _start i is set to ⊥ and the value in replies i which occurs at least n -β M i f times is returned to the application layer (lines 8-15, Figure 5.4).

operation write(v) (1) delay broadcast write(v, i) until next send phase; ----------------------------- Send Phase of round r (2) nop ----------------------------- Receive Phase of round r (3) nop -

Correctness proofs

Lemma 2 Any write() operation eventually terminates.

Proof The proof follows by considering that the write() operation generates a write_confirmation event at the end of the computation phase in which the operation is effectively started (line 4, Figure 5.5). Proof The proof directly follows from Lemma 2 and Lemma 3.

T heorem 5

Lemma 4 Let α M i and β M i be the parameters for each of the 4 failure models Mi as reported in Table 5.1 and used by the algorithm in . Let n > α M i f for each failure model Mi considered. At the end of each round at least n -f correct servers store the same value v in their value i local variable.

Proof The proof is done by induction.

-Basic Step. At the end of each round, each non-faulty server updates its value i local variable (i) in line 24 (i.e., if there exists at least a pair in the current_writes i local variable) or (ii) in line 26 (i.e., current_writes i is empty and there exist at least n -

β M i f same values in echo_vals i ).
Let us recall that at round r 0 all correct servers store the same default value ⊥ in their local variable value i . As a consequence, in r 0 there exists at least n -2f (f are Byzantine and f are cured, the remaining servers are correct) correct servers storing v.

Let us first prove that one of the two cases always happens and then we prove that the number of non-faulty servers storing the same values v at the end of r 0 is n -f .

The current_writes i local variable is initialized by any non-faulty server s i to ∅ at the beginning of each round r (cfr. line 3) and it is updated when a write() message is received by s i3 . Thus, case (i) corresponds to a scenario where at least a write() operation is executed in round r 0 and case (ii) corresponds to a scenario where no write() is running.

-Case (i): current_writes i = ∅. In this case the claim simply follows by observing that the current _writes i local variable is filled in when servers deliver a write() message. Considering that (i) writer clients broadcast a write(v, j) message in the send phase of round r, (ii) clients are correct and send the same set of values to all servers that will apply a deterministic function to select the value v and (iii) at most f servers are faulty and may skip the update of their value i variable, the claim follows.

-Case (ii): current_writes i = ∅ and line 25 is true. In this case, the value i variable is updated according to the values stored in echo_vals i . Such variable is emptied by every non-faulty process at the beginning of each round (cfr. line 2) and is filled in when an echo() message is delivered. Such message is sent at least by any server, believing it is correct, at the beginning of each round. At the beginning of r 0 , at least n -f -x correct servers will send an echo(v, j) message, where x is the number of non-faulty processes that become faulty in r 0 (i.e., x = f for all the models but Burhman's one where x = 0 as faulty processes move during the send phase and not at the beginning of the round). Let us note that the condition in line 25 is verified if and only if n -2f ≥ n -β M i f that is true in any model (n -2f is the number of correct servers sending the echo() message in r 0 ). Therefore, considering that at the end of round r 0 non-faulty servers are exactly n -f , we have that n -f processes will execute this update.

-Inductive Step. Iterating the reasoning for any r the claim follows. Proof Let r w1 be the round in which op w terminates and let v 0 be the value written by op w . Without lost of generality, let us consider the first write(v) operation op w and the first read() operation op r issued after r w1 . Three cases may happen: (i) op r ≺ op w , (ii) op w ≺ op r and (iii) op w || op r . Let us note that op r spans over at least two rounds and during the first one the client sends the read() message while in the second one it collects replies.

• Case (i): op r ≺ op w . This case follows directly from Lemma 4 considering that (i) at the end of the first round of op r at least n -f correct processes have the same value v 0 written by op w , (ii) while moving to the second round of op r , at most x processes can get faulty (with x ≤ f for models M1-M3 and

x = 0 for M4), (iii) n -f -x ≥ n -β M i f (i.e., β M i f ≥ f + x)
for each model (i.e., there will always be enough replies from correct servers to select a value) and (iv) n -

β M i f > f (i.e., (α M i -β M i )f + 1 > f )
for each model. It follows that faulty processes cannot force the client to select a wrong value and the claim follow in this case.

• Case (ii): op w ≺ op r . Let r w be the round at which op w terminates and let r w + 1 be the round at which op r is invoked. Due to Lemma 4, at round r w + 2 there are at least n -β M i f of the last written value. So, applying the same reasoning of case (i) the claim follows.

• Case (iii): op w || op r . Let us note that a read() operation spans two rounds, i.e., the round of the request r req and the round of the reply r reply . So, let us consider them separately.

-Case (iii.a): op w is concurrent with op r during r req . In that case the value v is delivered to correct server at the end of r req . Due to Lemma 4, at the end of r req at least n -f correct servers store the new written value v, we fall down into case (ii) and the claim follows.

-Case (iii.b): op w is concurrent with op r during r replay . Since, in every round, the send phase is executed before the receive phase, it follows that at least all the correct servers will reply with the value written before the invocation of the write() operation, we fall down into case (i) and the claim follows.

T heorem 6

Theorem 7 (Ordering) Let α M i and β M i be the parameters for each of the 4 failure models Mi as reported in Proof Let r w1 be the round in which op w terminates and let v 0 be the value written by op w .

In order to prove the claim, we have to show that the algorithm in Figures 5.3-5.5 is eventually able to build a total order of operations S that preserves (i) the read from last write property and that includes all the operations from a certain round on.

Let us observe the following:

1. any write() operation is "effectively" executed in one round (i.e., the round in which the value is propagated) even if it has been invoked during the previous round;

2. any read() operation is "effectively" executed in two rounds (i.e., r req the round in which the request for reading the value is sent to servers and r rep where replies are collected at the client side) even if it has been invoked during the previous round;

3. at the beginning of any round r > r w1 , since no more transient failures are going to happen, there always exist at least n -2f correct servers storing the same value v (see Lemma 4);

correct servers answer to read request by sending back their local values.

Let us suppose by contradiction that a total order S does not exists. S cannot exist iff the scenario in Figure 5.6 happens. However, considering the observations above and that the algorithm evolves in synchronous rounds, all the possible executions follow patterns similar to those shown in Figure 5.7, i.e., there can not exist a write() operation that overlaps two different read() operations op r1 and op r2 such that op r1 ≺ op r12 , from which we have a contradiction.

T heorem 7

Theorem 8 Let A reg be the algorithm in Figures 5.3 T heorem 11

op r1 → v 2 op w(v 1 ) op r2 → v 1 op w(v 2 ) c

Concluding remarks

The results found so far can be quickly summarized in Chapter 6

n ≥ 2f + 1 n ≥ 3f + 1 [3] Garay n ≥ 3f + 1 n ≥ 4f + 1 [21] Bonnet n ≥ 4f + 1 n ≥ 5f + 1 [5] Sasaki n ≥ 4f + 1 n ≥ 6f + 1[40]

Distributed Registers in the Round-free Model

In this Chapter we consider the round-free MBF models. We first state the Safe Register and Regular Register problems and we prove that in an asynchronous system such problems are unsolvable. Then, in the remaining part of this Chapter, only synchronous round-free MBF models are considered. In particular, for each instance of the round-free MBF model, we prove lower bounds and propose optimal solutions with respect to the required number of replicas.

Register Specification

As define in Section 5.1, a register is a shared variable accessed by a set of processes (i.e., clients) through two operations, namely read() and write().

In this chapter we consider the following register specifications in the round free models.

SWMR Regular Register

A single-writer/multi-reader (SWMR) regular register [START_REF] Lamport | On interprocess communication[END_REF] specified as follows:

• Termination: if a correct client invokes an operation, it eventually returns from that operation (i.e., every operation issued by a correct client eventually terminates);

• Validity: A read() operation returns the last value written before its invocation (i.e., the value written by the latest completed write() preceding it), or a value written by a concurrent write() operation.

Our impossibility results (reported in the next section) are proven for the case of a safe register (weaker than the regular register in the Lamport's hierarchy [START_REF] Lamport | On interprocess communication[END_REF]). A read operation on a safe register concurrent with a write operation may return any value in the register domain.

SWMR Safe Register

A single-writer/multi-reader (SWMR) safe register [START_REF] Lamport | On interprocess communication[END_REF] specified as follows:

• Termination: if a correct client invokes an operation, it eventually returns from that operation (i.e., every operation issued by a correct client eventually terminates);

• Validity: A read() operation, if it does not overlap any write() operation, returns the last value written before its invocation (i.e., the value written by the latest completed write() preceding it).

We consider in the sequel only execution histories related to the register computation. In particular, the set of relevant computation events H will be defined by the set of all the operations issued on the register and the happened-before relation will be substituted by the precedence relation ≺ between operations. Thus, we will consider a register execution history specified as ĤR = (H, ≺).

From the specification above, we can define a specified notion of valid value at time t for register as follow: Definition 6 (Valid Value at time t) Let ĤR = (H, ≺) be a register execution history of a regular-register R. A valid value at time t is any value returned by a fictional read() operation on the register R executed instantaneously at time t.

Impossibilities

In this section we prove that, contrary to the static Byzantine tolerant implementations of registers, in the case of MBF tolerant implementations a new operation, namely maintenance(), must be implemented to prevent servers from losing the current register value, independently from the system synchrony. Then, we show that in an asynchronous system and in the presence of single Mobile Byzantine Agent, there is no protocol P reg implementing a safe register and consequently a regular register.

Theorem 12

Let n be the number of servers emulating a safe register and let f be the number of Mobile Byzantine Agents affecting servers. Let A R and A W be respectively the algorithms implementing the read() and the write() operation assuming no communication between servers. If f > 0 then there exists no protocol

P reg = {A R , A W } implementing a

safe register in any of the MBF models for round-free computations.

Proof Let us suppose by contradiction that P reg = {A R , A W } is a correct protocol implementing a safe register. If P reg is correct, it means that both A R and A W implementing respectively the read() and the write() operation terminates i.e., they stop to execute steps when the operation is completed. Let t be the time at which the last operation op terminated and let us assume that no other operation is invoked until time t > t. Let us note that during the time interval [t, t ] no algorithm is running as all the operations issued in the past are completed. As a consequence, no correct server and no cured server will change its state. However, considering that t does not depend on P reg (i.e., it is not controlled by the register protocol but it is defined by clients) and considering the mobility of the Mobile Byzantine agents, we may easily have a run where every correct server is faulty and its state can be corrupted at some time in [t, t ].

Considering that P reg = {A R , A W } and that A R and A W are not running in [t, t ] we can have that every server stores a non valid state at time t and the register value is lost. As a consequence, A R has no way to read a valid value and the validity property is violated. It follows that P reg is not correct and we have a contradiction.

T heorem 12

From Theorem 12 it follows that, in presence of Mobile Byzantine Agents, a new operation must be defined to allow cured servers to restore a valid state and avoid the loss of the register value.

Definition 7 (maintenance() and A M ) A maintenance() operation is an operation that, when executed by a process p i , terminates at some time t leaving p i with a valid state at time t (i.e., it guarantees that p i is correct at time t). A maintenance algorithm A M is an algorithm that implements the maintenance() operation.

As a consequence, any correct protocol P reg must include one more algorithm implementing the maintenance() operation1 so that the corollary follows:

Corollary 3 Let n be the number of servers emulating a register and let f be the number of Mobile Byzantine Agents in the system. That is, if f > 0 then any correct protocol P reg implementing a register in the round-free Mobile Byzantine Failure model must include an algorithm A M (i.e., P reg = {A R , A W , A M }). Proof The claim simply follows by considering that cured servers have a compromised state thus, they need to receive information from correct servers in order to be able to update their state to a valid one. Lemma 4

Impossibilities in Asynchronous System

Lemma 5 Let P reg = {A R , A W , A M } be a protocol implementing a safe register in the (∆S, CAM ) MBF model. Let f > 0 be the number of Byzantine Agents controlled by the external adversary. Any algorithm A W and A R must involve at least one sendreply (resp. requestreply) communication pattern (i.e., two communication steps).

Proof Let us recall that read() and write() operations are issued by clients and that the set of clients C and the set of servers S maintaining the register are disjoint. As a consequence, when a client c i wants to write a new value v in the register, it has necessarily to propagate it in the server set. The same happens when a client c j wants to read: it has to ask servers the most up-to-date value. It follows that a send (request) communication step is necessary.

Let us now show that the send communication step is not sufficient to provide a correct implementation of A W and A R .

In oder to be correct, A W must ensure the termination property. As a consequence, c i must be able to decide when it can trigger the write_return event. In particular, this can be done when at least one correct server2 updated its internal state.

Let us recall that (i) processes communicate only by exchanging messages, (ii) clients (and in particular the writer) do not know the failure state of servers and (iii) the system is asynchronous. As a consequence, the only way c i has to know that at least one server s j updated its state is to wait for an acknowledgement from s j . As a consequence, a second communication step, i.e., a reply step, is necessary for a correct implementation of A W .

The same reasoning applies for the termination of the read() operation and the claim follows.

Lemma 5

Lemma 6 Let n be the number of servers emulating a safe register and let f be the number of Byzantine agents in the (∆S, CAM ) Mobile Byzantine Failure model. Let t be a time instant at which f servers are faulty and f other servers are cured. Let op be a maintenance() operation issued at time t. There does not exist a maintenance algorithm A M able to terminate in asynchronous settings leaving cured servers with a valid state.

Proof Consider an arbitrary cured server s in the set of cured servers that triggers a maintenance operation op. Assume that op is implemented by an algorithm A M in asynchronous settings. Two cases may happen: (i) there is no write() operation concurrent with op or (ii) there is at least one concurrent write() operation.

• Case 1: write(v)||op. Considering that no write() is concurrent with op, the only way s has to come back to be correct is to get the valid value from correct servers. As a consequence, every A M must include a communication step where correct servers send their stored value to the cured server s (see Corollary 4). Let us recall that the system is asynchronous; thus it is not possible to bound, a priori, the time needed by such messages to reach s. In addition, s is aware just about its failure state but it is not aware about other failure states (in other words, s cannot know, for any time t, the sets Co(t) and B(t)).

As a consequence, the termination condition of A M will depend on messages delivered by s and coming from other servers. Let us recall that cured servers have a non-valid state and, in order to terminate, A M must be able to decide a valid value to update the state of the cured server. Thus, the termination condition of A M must be able to select a valid value by considering all the information received by s.

Let us now show that due to the Byzantine agents movement and the asynchrony of the communication, we can always have an indistinguishability situation between valid values and non valid values.

The indistinguishability comes from the following observations:

1. in every time interval [t 0 + j∆, t 0 + (j + 1)∆] (with j ∈ N) the number of correct servers sending valid values is n -(j + 1)f . In fact, at any movement, the adversary may decide to move the Byzantine agents on a totally disjoint set of servers (corrupting each time f new servers) until everyone is corrupted. Where t 0 is the initial time where f servers and all the other servers where correct.

2. messages may take an arbitrary time to reach their destination and, in the worst case, all the messages sent in a long time period may be delivered at the same time and not following the FIFO order.

3. when a server is affected by the Byzantine agents, it can send an arbitrary number of messages with an arbitrary content. In particular, given the sequence of messages sent by a server before its compromising, such sequence can be permuted and sent again creating a symmetry condition.

As a consequence, each time that s evaluates a set of messages, it can always have a symmetric set and it will be forced to wait forever. Hence, the maintenance operation never terminates which contradicts the assumption. The same scenario may happen for every cured server starting a maintenance() operation and there is a time t such that Co(t ) = ∅ and none of the maintenance() operation will terminate.

• Case 2: ∃ write(v)||op. Due to the asynchrony of the system, every write() operation may be completed by interacting with servers always in the time period in which they are faulty. As a consequence, the resulting computation is equivalent to the one in which the write() never happened, we fall down in the previous case and the claim follows.

)| = n -f ).
At time t 0 + ∆, the adversary moves mobile agents and, in the worse case, such agents affect a set of f servers completely disjoint from the previous one. Thus, in the computation we have f servers controlled by the Byzantine agents (|B(t 0 + ∆)| = f ) , f different servers entering in the cured state (|Cu(t 0 + ∆)| = f )) and n -2f correct processes (|Co(t 0 + ∆)| = n -2f ). Let us recall that, by assumption, cured servers know about their state (see CAM model) and thus they can start executing the maintenance operation running the maintenance algorithm A M . Each of the cured servers at time t 0 + ∆, s, will start a maintenance() operation. Following Lemma 6 there is no A M maintenance algorithm able to terminate leaving s with a valid state under asynchronous communication model. As a consequence, the value of the register is lost and no client is able to return a valid value of the register.

T heorem 13

Note that the above result extends to any register specification and to any MBF instance defined in Chapter 4 since (∆S, CAM ) is the weakest adversary and safe is the weakest specification. Proof Let op W be a write operation invoked by client c i and let v be the value to be written (i.e., to be stored in the register). The claim simply follows by considering that servers need to receive information from client c i in order to be able to store v. Proof Let us suppose that A M does exists. Let E 1 be an execution for f = 1 and n = 3. Let us consider the generic time T i when the mobile agent moves from s 1 to s 2 and ∆ > 0 arbitrarily big. At T i , s 0 is correct and stores v, s 1 is cured and finally s 2 is Byzantine. s 1 is aware to be in a cured state and starts a maintenance() operation. In order to terminate it s 1 needs to get values from other servers, s 1 and s 2 , to became correct (cf. Lemma 4). During such operation s 1 gets v from s 0 and v = v from s 2 . By hypothesis A M does exist, so s 1 become correct storing v. Let us consider another execution E 2 , for f = 1 and n = 3. Let us consider the generic time T i when the mobile agent moves from s 1 to s 2 and ∆ > 0 arbitrarily big. At T i , s 0 is correct and stores v , s 1 is cured and finally s 2 is Byzantine. As in E 1 , s 1 is aware to be in a cured state so it starts the maintenance() operation. In order to terminate it s 1 needs to get values from others server, s 0 and s 2 , to become correct (cf. Lemma 4). During such operation s 1 gets v from s 0 and v = v from s 2 . By hypothesis A M does exist, so s 1 became correct storing v . In both execution s 1 terminates the maintenance() operation with different values, but reasoning on the same set of values, both executions are indistinguishable leading to a contradiction.

Considering that all Byzantine agents move in a coordinated way, for a generic f ≥ 1, is it enough to consider S 0 , in place of s 0 , as a set of f correct servers, S 1 , in place of s 1 , as a set of cured servers and finally S 2 , in place of s 2 as a set of f Byzantine servers and the result does not change. Proof Let us suppose that A M does exists. From Lemma 4 such algorithm has to involve at least one information exchange among servers. Since those servers are not aware about their state we assume that A M is triggered at some point by all servers (not necessarily at the same time). We consider a scenario for f = 1 and n = 4, {s 0 , s 1 , s 2 , s 3 }. Let T i be the generic time when the mobile agent moves from s 2 to s 3 and ∆ > 0 arbitrarily big. s 2 , is not aware to be in a cured state and at some point it triggers the maintenance() operation. We consider two cases, a server invoking A M may use or not the value of its internal state.

• Server uses its internal state.

-Let E 1 be an execution, such that at T i s 0 , s 1 are correct and storing v, s 2 is cured and s 3 is Byzantine. s 2 at some points starts the maintenance() operation and gets v from s 0 , s 1 and v = v from s 3 and itself. By hypothesis A M does exist, so s 2 became correct and stores v.

-Let us consider another execution E 2 such that at T i s 0 , s 1 are correct and storing v , s 2 is cured and s 3 is Byzantine. s 2 at some points starts the maintenance() operation and gets v from s 0 , s 1 and v = v from s 3 and itself. By hypothesis A M does exist, so s 2 became correct storing v .

In both execution s 2 terminates the maintenance() operation with different values, but values collected are the same in both executions, leading to a contradiction.

• Server does not use its internal state.

-Let E 1 be an execution, such that at T i s 0 , s 1 are correct and storing v, s 2 is cured and s 3 is Byzantine. Correct server s 0 at some points starts the maintenance() operation and gets v from s 1 and v = v from s 2 , s 3 . By hypothesis A M does exist, so s 0 is still correct and stores v (value coming from the correct process).

-Let us consider another execution E 2 such that at T i s 0 , s 1 are correct and storing v , s 2 is cured and s 3 is Byzantine. s 0 at some points starts the maintenance() operation and gets v from s 1 and s 3 and v = v from s 2 . By hypothesis A M does exist, so s 0 is still correct and stores v (value coming from the correct process).

In both execution s 0 terminates the maintenance() operation with different values, but values collected are the same in both executions, leading to a contradiction.

It follows that there exists no algorithm A M that solves the maintenance in the (∆S, CU M ) model if n ≤ 4f .

Lemma 9

Lower Bounds for the Synchronous MBF models

In this section we prove lower bounds with respect to the minimum fraction of correct servers to implement safe registers in presence of mobile Byzantine failures 3 . In particular we first prove lower bounds for the (∆S, CAM ) and (∆S, CU M ) models and then we extend those results to all the other models. The first observation that raises is that in presence of mobile agents in the round-free models there are several parameters to take into account with respect to the round-based model. Let us start considering that the set of Byzantine servers changes its composition dynamically time to time. This yields to the following question: does it impact on the read() duration? Or, in other words, such operation has to last as less as possible or until it eventually terminates? In this chapter we consider the read() operation duration as a parameter itself, allowing us to easily verify when the variation of such parameter has any impact on lower bounds. Here below the list of parameters we take into account.

• servers knowledge about their failures state (CAM, CU M );

• the relationship between δ and ∆ (that states how many Byzantine servers there may be during an operation);

• T r , the read() operations duration;

• γ, the upper bound on the time during which a server can be in a cured state (the design of an optimal maintenance() operation is out of the scope of this thesis, thus we use such upper bound as another parameter).

Those parameters allow us to describe different failure models and help us to provide a general framework that produces lower bounds for each specific instance of the MBF models. In the sequel it will be clear that γ varies depending on the coordinated/uncoordinated mobile agents movements (∆S, IT B, IT U ). In other words, in this parameter is hidden the movements model taken into account, so we do not need to explicitly parametrize it. Before to start let us precise that we do not consider the following algorithm families: (i) full information algorithm families (processes exchange information at each time instant); (ii) algorithms characterized by a read operation that does not require a request-reply pattern; (iii) algorithms with non quiescent operation (the message exchange triggered by an operation eventually terminates); and finally (iv) algorithms where clients interact with each other. All results presented in the sequel consider a families of algorithms such that previous characteristics do not hold.

The lower bounds proof leverages on the classical construction of two indistinguishable executions. The tricky part is to characterize the set of messages delivered by a client from correct and incorrect servers depending of the read() operation duration. Let T r , T r ≥ 2δ be such duration (according to Lemma 5, each read() operation requires at least a request-reply pattern). We first characterize the correct and incorrect sets of messages, delivered during T r time, with respect to ∆ and γ.

For clarity, in the sequel we note correct message/request/reply a message that carries a valid value when it is sent (i.e., sent by a correct process). Otherwise, the message is incorrect.

Corollary 3 proves that a protocol P reg implementing a regular register in a mobile Byzantine setting in addition to the mandatory read() and write() operations must include the additional maintenance operation. Let us recall that such operation when executed by a process p i , whose internal state is clean from mobile agent effects, terminates at some time t such that p i has a valid state at time t.

Such operation has a direct impact on the number of correct processes in any time instant. For that reason it is important to characterize its duration, in particular its upper bound in terms of time. The following definition defines γ, the upper bound of the time during which a server can be in a cured state.

Definition 8 (Curing time, γ)

We define γ as the maximum time a server can be in a cured state. More formally, let T c the time at which server s c is left by a mobile agent, let op M the first maintenance operation that correctly terminates, then

t E (op M ) -T c ≤ γ.
Lemma 10 There no exist a maintenance() operation that correctly terminates in less than δ time.

Proof The proof follows from Corollary 4 and considering that δ is the upper bound on the message delivery delay.

Lemma 10

γ is strictly dependent on the considered Byzantine agent movement model and as we state, the design of an optimal maintenance() operation in the different models is not the scope of such work. For the sake of simplicity in the following depicted figures we consider γ ≤ δ in the (∆S, * ) models and γ ≤ 2δ in the others. Intuitively, in the first model the time at which mobile agents move is known, thus the maintenance() operation can start right after agents movement, thus it lasts just the time necessary for messages exchange. In the other models such time it is not known, thus we reasonably assume γ ≤ 2δ. It holds if servers exchange messages each δ time periods or employ a request-reply pattern.

We define below a scenario of agents movements S * , with respect to we build the two indistinguishable executions for the lower bounds proof. Definition 9 (Scenario S * ) Let S * be the following scenario: for each time T i , i ≥ 0 the affected servers are s (i mod n)f +1 , . . . , s (i mod n)f +f . Figure 6.1 depicts S * . In particular, the red part is the time where f agents are affecting f servers and the gray part is the time during which servers are in a cured state.

Let us characterize the P reg protocol in the most general possible way. By definition a register abstraction involves read() and write() operations issued by clients. From Lemma 5, a read operation involves at least a requestreply communication pattern (i.e., two communication steps). Thus, given the system synchrony, a read() operation op R lasts at least T r ≥ 2δ time. Moreover we consider that a correct server sends a reply message in two occasions: (i) after the delivery of a request message, and (ii) right after it changes its state, at the end of the maintenance operation if an op R is occurring. The latter case exploits the maintenance operation allowing servers to reply with a valid value in case they were Byzantine at the beginning of the read operation. Moreover we assume that in ( * , CAM ) model servers in a cured state do not participate to the read operation. Notice that those servers are aware of their current cured state and are aware of their impossibility to send correct replies. Even though those may seems not very general assumptions, let us just consider that we are allowing servers to correctly contribute to the computation as soon as they can and stay silent when they can not and under those assumptions we prove lower bounds. Thus if we remove those assumptions the lower bounds do not decreases. Scenario and protocol has been characterized. Now we aim to characterize the set of servers, regarding their failure states, that can appear during the execution of the protocol, in particular during the read() operation. Those sets allow us to characterize correct and incorrect messages that a client delivers during a read() operation. Servers belonging to Sil(t B (op R ), t E (op R )) are servers that do no participate to op R . In oder words, those servers in the worst case scenario became correct after t E (opR) -δ, thus if they send back a correct reply it is not sure that client delivers such reply before the end of T r time. Now we can define the worst case scenarios for the sets we defined so far with respect to S * . Definition 13 (M ax B(t, t + T r )) Let S be a scenario and [t, t + T r ] a time interval. The cardinality of BS (t, t + T r ) is maximum with respect to S if for any t , t > 0, we have that | BS (t, t + T r )| ≥ | BS (t , t + T r )|. Then we call the value of such cardinality as Max BS (t, t + T r ). If we consider only one scenario per time then we can omit the subscript related to the scenario and write directly M ax B(t, t + T r ). This value quantifies in the worst case scenario how many servers can be Byzantine, for at least one time unit, during a read() operation. Figure 6.2 depicts a scenario where T r = 3δ and during the time interval [t , t + T r ] there is a maximum number of Byzantine servers while in [t , t + T r ] this number is not maximal. one scenario per time then we can omit the subscript related to the scenario and write directly minSil(t, t + T r ).

This value quantifies the maximum number of servers that begin in a cured state a read() operation and are still cured after T r -δ time. So that any correct reply sent after such period has no guarantees to be delivered by the client and such servers are assumed to be silent.

Definition 15 (M axCu(t))

Let S be a scenario and t be a time instant. The cardinality of Cu S (t) is maximum with respect to S if for any t , t ≥ 0, we have that |Cu S (t )| ≤ |Cu S (t)| and B(t, t + T r ) = M ax B(t, t + T r ). We call the value of such cardinality as M axCu S (t). If we consider only one scenario per time then we can omit the subscript related to it and write directly M axCu(t).

This value quantifies, in the worst case scenario, how many cured servers there may be at the beginning of a read() operation. Figure 6.3 depicts a scenario where at time t there are the maximum number of cured server while at t this value is not maximum. Notice that in such figure, in case of a shorter time interval [t , t + 2δ] s 0 would be silent. As we stated before, Byzantine servers set changes during the read() operation op R , so there can be servers that are in a Byzantine state at t B (op R ) and in a correct state before t E (op R ) -δ (cf. s 0 during [t , t + 3δ] time interval in Figure 6.5). Those servers contribute with an incorrect message at the beginning and with a correct message after. The same may happen with servers that are correct from t B (op R ) to at least t B (op R ) + δ (so that for sure deliver the read request message and send the reply back) and are affected by a mobile agent after t B (op R ) + δ (cf. s 0 during [t , t + 3δ] time interval in Figure 6.5).

Lemma 11 M ax B(t, t + T r ) = ( Tr ∆ + 1)f .
Proof For simplicity let us consider a single agent ma k , then we extend the same reasoning to all the f agents. In [t, t + T r ] time interval, with T r ≥ 2δ, ma k can affect a different server each ∆ time. It follows that the number of times it may change server is Tr ∆ . Thus the affected servers are Tr ∆ plus the server that was affected at t. Finally, extending the reasoning to f agents, M ax B(t, t + T r ) = ( Tr ∆ + 1)f , which concludes the proof. Lemma 11 As we see in the sequel, the value of M ax B(t, t + T r ) is enough to compute the lower bound. Now we can define the worst case scenario for a read() operation with respect to S * . Let op be a read operation issued by c i . We want to define, among the messages that can be deliver by c i during op, the minimum amount of messages sent by server when they are in a correct state and the maximum amount of messages sent by servers when they are not in a correct state.

In each scenario, we assume that each message sent to or by Byzantine servers is instantaneously delivered, while each message sent to or by correct servers requires δ time. Without loss of generality, let us assume that all Byzantine servers send the same value and send it only once, for each period where they are Byzantine. Moreover, we make the assumption that each cured server (in the CAM model) does not reply as long as it is cured. Yet, in the CUM model, it behaves similarly to Byzantine servers, with the same assumptions on message delivery time. In the following, given a time interval, we characterize correct and incorrect servers involved in such interval. Concerning correct servers, let us first analyze when a client collects x ≤ n different replies and then we extend such result to x > n. Then we do the same for incorrect replies.

Lemma 12

Let op be a read operation issued by client c i in a scenario S * , whose duration is T r ≥ 2δ. Let x, x ≥ 2, be the number of messages delivered by c i during op. If x ≤ n then minReplies_Co(t, t + T r ) k contains replies from x different servers.

Proof Let us suppose that minReplies_Co(t, t + T r ) k contains replies from x -1 different servers (trivially it can not be greater than x). Without lost of generality, let us suppose that c i collects replies from s 1 , . . . , s x-1 . It follows that there is a server s i , i ∈ [1, x -1] that replied twice and a server s x that did not replied. Let us also suppose w.l.g. that there is one Byzantine mobile agent ma k (i.e., f = 1). If during the time interval [t, t + T r ] s x never replied, then s x has been affected at least during [t + δ, t + T r -δ -γ + 1]. This implies that T r ≤ ∆ + 2δ + γ. Since s i replies twice then two scenarios are possible during op: (i) s i was first affected by ma k and then became correct (so it replied once), then affected again and then correct again (so it replied twice); (ii) s i was correct (so it replied once), then it was affected by ma k and then correct again (so it replied twice). Let us consider case (ii) (case (i) follows trivially). Since s i had the time to reply (δ), to be affected and then became correct (∆ + γ) and reply again (δ) this means that T r > ∆ + 2δ + γ. A similar result we get in case (i) where the considered execution requires a longer time. This is in contradiction with T r ≤ ∆ + 2δ + γ thus c i gets replies for x different servers.

Lemma 12

If a client delivers n > x messages then we can apply the same reasoning of the previous Lemma to the first chunk of n messages, then to the second chunk of n messages and so on. Roughly speaking, if n = 5 and a client delivers 11 messages from correct processes, then there are 3 occurrences of the message coming from the first server and 2 occurrences of the messages coming from the remaining servers. Thus the next Corollary directly follows.

Corollary 7

Let op be a read operation issued by client c i in a scenario S * , op duration is T r ≥ 2δ. Let x, x ≥ 2, be the number of messages delivered by c i during op, then minReplies_Co(t, t + T r ) k contains x mod n messages m ij whose occurrences is x n + 1 and (n -x (mod n)) messages whose occurrences is x n .

The case of M axReplies_N Co(t, t + T r ) k directly follows from scenario S * , since by hypotheses mobile Byzantine agents move circularly from servers to servers, never passing on the same server before having affected all the others. Thus, the following corollary holds. From Lemmas 11 and using values in Table 6.1 we obtain following equations for both models:

Corollary 8 Let op be a read operation issued by client c

i in a scenario S * , op duration is T r ≥ 2δ. Let x, x ≥ 2,
• (∆S, CAM ):

-M axReplies_N Co(t, t + T r ) i = M ax B(t, t + T r ) = ( Tr ∆ + 1)f -minReplies_Co(t, t + T r ) i = n -[M ax B(t, t + T r ) + M axSil(t, t + T r )] + min CBC(t, t + T r ) = [2(M ax B(t, t + T r )) + M axSil(t, t + T r ) -min CBC(t, t + T r )]+ -[(M ax B(t, t + T r ) + M axSil(t, t + T r )) + min CBC(t, t + T r )] = M ax B(t, t + T r ) = ( T r ∆ + 1)f • (∆S, CU M ): -M axReplies_N Co(t, t + T r ) i = M ax B(t, t + T r ) + M axCu(t) = ( Tr ∆ + 1)f + M axCu(t) -minReplies_Co(t, t+T r ) i = n-[M ax B(t, t+T r )+M axCu(t)]+min CBC(t, t+ T r ) = [2M ax B(t, t + T r ) + 2M axCu(t)) -min CBC(t, t + T r )]+ -[M ax B(t, t + T r ) + M axCu(t)] + min CBC(t, t + T r ) = M ax B(t, t + T r ) + M axCu(t) = ( T r ∆ + 1)f + M axCu(t)
It follows that in E 0 and E 1 c i delivers the same occurrences of 0 and 1, both executions are indistinguishable leading to a contradiction.

T heorem 14 M axReplies_N Co(t, t + T r ) i and minReplies_Co(t, t + T r ) i are equal independently from the value assumed by T r , the read() operation duration. From the equation just used in the previous lemma the next Corollary follows.

Corollary 9 For each T r ≥ 2δ if n > n CAM LB (n > n CU M LB ) then M axReplies_N Co(t, t+ T r ) i < minReplies_Co(t, t + T r ) i .
At this point we compute minCu(t), M axSil(t, t + T r ) and min CBC(t, t + T r ) to finally state exact lower bounds depending on the system parameters, in particular depending on ∆, γ and the servers awareness, i.e., ( * , CAM ) and ( * , CU M ).

Let us adopt the following notation. Given the time interval [t, t + T r ] let {s 1 , s 2 , . . . , s b } ∈ B(t, t + T r ) be the servers affected sequentially during T r by the mobile agent ma k . Let {s -1 , s -2 , . . . , s -c } ∈ Cu(t) be the servers in a cured state at time t such that s -1 is the last server that entered in such state and s c the first server that became cured. Let t B B(s i ) and t E B(s i ) be respectively the time instant in which s i become Byzantine and the time in which the Byzantine agent left. t B Cu(s i ) and t E Cu(s i ) are respectively the time instant in which s i become cured and the time instant in which it became correct. Considering that ma k moves each ∆ time then we have that t B B(s i-1 ) -t B B(s i ) = ∆ and t B Cu(s -j ) -t B Cu(s -j+1 ) = ∆. The same holds for the t E of such states. Moreover t B B(s 1 ) = t B Cu(s -1 ). Now we are ready to build the read scenario with respect to S * . In particular we build a scenario for the (∆S, CAM ) model and one for the (∆S, CU M ) model. Intuitively, the presence of cured servers do not have the same impact in the two models, thus in the (∆S, CU M ) model we maximize such number. Let [t, t + 2δ] be the considered time interval and let be a positive number arbitrarily smaller, then we consider in the (∆S, CAM ) scenarios t = t E B(s 1 ) -(cf. Figure 6.6) and in the (∆S, CU M ) scenarios t B B(s b ) = t + 2δ -(cf. Figure 6.7).

In the sequel we use the notion of Ramp Function: of servers in a cured state at t is M axCu(t) = t E Cu(s 1 )-t ∆

R(x) = x if x ≥ 0 0 if x <
. 4 As we stated, for ( * , CAM ) models we consider scenarios in which t, the beginning of the considered time interval, is just before t E B(s 1 ). Thus given an arbitrarily small number > 0, let t = t E B(s 1 )-. By construction we know that t B B(s 1 ) = t E B(s 1 )-∆ = t B Cu(s -1 ). Substituting t B Cu(s -1 ) = t + -∆, since we consider γ the upper bound for the curing time, then t E Cu(s -1 ) = t+ -∆+γ . So finally, M axCu(t

) = t E Cu(s 1 )-t ∆ = γ-∆+ ∆
and since there can no be a negative result then M axCu(t) = R( γ-∆+

∆

). This concludes the proof. ).

Proof As we defined, s -1 is the most recent server that entered in a cured state, with respect to the considered interval. Intuitively,

s -j is in Cu(t) if t E Cu(s -j ) > t. Considering that t E Cu(s -j ) -t E Cu(s -j-1 ) = ∆ then the number of servers in a cured state at t is M axCu(t) = t E Cu(s 1 )-t ∆ .
As we state, for ( * , CU M ) models we consider scenarios in which the end of the considered time interval, is just after t B B(s b ). Thus given an arbitrarily small number > 0, let t B B(s b ) = t + T r -. By construction we know that t B B(s 1 ) = t E B(s 1 ) -∆ = t B Cu(s -1 ) and Lemma 11). Substituting and considering that t E Cu(s -1 ) = t B Cu(s -1 ) + γ) we get the following:

t B B(s 1 ) = t B B(s b ) -Tr ∆ ∆ (cf.
t E Cu(s -1 ) = t + T r --Tr ∆ + γ. Finally M axCu(t) = t E Cu(s 1 )-t ∆ = Tr--Tr ∆ +γ ∆
and since there can not be a negative result then M axCu(t) = R(

Tr--Tr ∆ ∆+γ ∆
). This concludes the proof.

Lemma 14

Lemma 15 Let us consider a time interval [t, t+T r ], T r ≥ 2δ and an arbitrarily small number > 0, then in the (∆S, CAM ) model M axSil(t, t

+ T r ) = R( γ-∆+ -Tr+δ ∆ ).
Proof As we defined, s -1 is the most recent server that entered in a cured state, with respect to the considered interval. Intuitively,

s -j is in Sil(t, t + 2δ) if t E Cu(s -j ) > T r -δ. Considering that t E Cu(s -j ) -t E Cu(s -j-1 ) = ∆ then the number of servers in a silent state at t is M axSil(t, t + 2δ) = t E Cu(s 1 )-Tr+δ ∆
. As we stated for (∆S, CAM ) models we consider scenarios in which t, the beginning of the considered time interval, is just before t E B(s 1 ). Thus given an arbitrarily small number > 0, let t = t E B(s 1 ) -. By construction we know that t B B(s 1 ) = t E B(s 1 ) -∆ = t B Cu(s -1 ). Substituting t B Cu(s -1 ) = t + -∆, since we consider γ the upper bound for curing time, then .

t E Cu(s -1 ) = t + -∆ + γ . So finally, M axSil(t, t + T r ) = t E Cu(s 1 )-Tr+δ ∆ = γ-∆+ -Tr+δ ∆ , then since there can not be a negative result M axSil(t, t + 2δ) = R( γ-∆+ -Tr+δ ∆ ).
Proof As we defined, s -1 is the most recent server that entered in a cured state, with respect to the considered interval. Intuitively, s -j is in Sil(t, t + T r ) if t E Cu(s -j ) > T r -δ. Considering that t E Cu(s -j )-t E Cu(s -j-1 ) = ∆ then the number of servers in a silent state at t is M axSil(t, t+T r ) = t E Cu(s 1 )-Tr+δ ∆ . As we stated for (∆S, CU M ) models we consider scenarios in which t + T r , the end of the considered time interval, is just after t B B(s b ). Thus given an arbitrarily small number > 0, let t B B(s b ) = t + T r -. By construction we know that t B B(s Lemma 11). Substituting and considering that t E Cu(s -1 = t B Cu(s -1 ) + γ) we get the following:

1 ) = t E B(s 1 ) -∆ = t B Cu(s -1 ) and t B B(s 1 ) = t B B(s b ) -Tr ∆ ∆ (cf.
t E Cu(s -1 = t + T r --Tr ∆ + γ. Finally M axSil(t, t + T r ) = t E Cu(s 1 )-Tr+δ ∆ = Tr--Tr ∆ +γ-Tr+δ ∆
, then since there can not be a negative result, M axSil(t, t + T r ) = min BC(t, t + 2δ) is the minimum number of servers that incorrectly reply and then become correct in time that the correct reply is delivered. A server is able to correctly reply if it is correct before t + T r -δ (the reply message needs at most δ time to be delivered). Thus we are interested in servers that are affected by a mobile agent up to t + T r -γ -δ. For (∆, CAM ) models we consider scenarios in which t, the beginning of the considered time interval, is just before t E B(s 1 ).

Thus given an arbitrarily small number > 0, let t = t E B(s 1 ) -. In the time interval [t, t + T r -γ -δ] the number of the mobile agent "jumps" is given by

Tr-γ-δ ∆
Trivially, we can not have a negative number, so it becomes R(

Tr-γ-δ ∆ ). Summing up min CBC = R( Tr ∆ -δ ∆ ) + R( Tr-γ-δ ∆
), which concludes the proof.

CB = Tr--δ ∆ otherwise min CB = R(M ax B(t, t + T r ) -M ax B(t, t + T r -δ)).
Proof min CB(t, t + T r ) is the minimum number of servers that correctly reply and then, before t + T r are affected by a mobile agent and incorrectly reply. We are interested in the maximum number of Byzantine servers in B(t, t + T r -δ), so that the remaining ones belong to B(t + T r -δ, t + T r ), which means that servers in B(t+T r -δ, t+T r ) are in Co(t, t+δ) (considering the scenario S * ). Thus, considering that in the (∆, CU M ) model we consider t B B(s b ) = t + T r -( > 0 and arbitrarily small) then we consider the maximum number of "jumps" there could be in the time interval [t + δ, t + T r -]. Thus min CB(t, t + T r ) = t+Tr--t-δ ∆ = Tr--δ

∆

. If M axCu(t) = 0 or γ > ∆ then it has no sense to consider the (∆S, CU M ) worst case scenario that aims to maximize cured servers. Thus in this case we consider the (∆S, CAM ) worst case scenario, min CB = R(M ax B(t, t+T r )-M ax B(t, t+T r -δ)), concluding the proof. Proof By definition min CBC(t, t + T r ) = min CB(t, t + T r ) + min BC(t, t + T r ). From Lemma 18, if maxCu(t) > 0 or ∆ > γ then in the (∆S, CU M ) model min CB = Tr--δ ∆ otherwise min CB = R(M ax B(t, t + T r ) -M ax B(t, t + T r -δ)). min BC(t, t + T r ) is the minimum number of servers that incorrectly reply and then, before t + T r -δ become correct so that are able to correctly reply in time such that their reply is delivered. In the (∆S, CU M ) model servers may incorrectly reply because affect by a mobile agent or because in a cured state. In the first case, a

M ax B(t, t + T r ) M axCu(t) M axSil(t, t + T r ) (∆S, CAM )

Tr ∆ + 1 R( γ-∆+ ∆ ) R( γ-∆+ -Tr+δ ∆ ) (∆S, CU M ) Tr ∆ + 1 R( Tr--Tr ∆ ∆+γ ∆ ) γ+δ--Tr ∆ ∆ ∆ min CBC(t, t + T r ) (∆S, CAM ) R( Tr ∆ -δ ∆ ) + R( Tr-γ-δ ∆ ) (∆S, CU M ) Tr--δ ∆ 5 +R( Tr ∆ -γ+δ ∆ ) + (M axCu(t) -M axSil(t, t + T r ))
server is able to correctly reply if it become correct before t + T r -δ (the reply message needs at most δ time to be delivered). Thus we consider the maximum number of servers that can be affected in the period t + T r -γ -δ, t + T r , which is γ+δ ∆ . Thus, among the Byzantine servers (i.e., M ax B(t, t + T )) we consider servers not affected in the time interval [t + T r -γ + δ, t + T r ]. In other words such servers have γ time to became correct and δ time to reply before the end of the operation. Thus M ax B(t, t + T r ) -M ax(t + T r -γ + δ, t + T r ). Again we can not have a negative number, so it becomes R( Tr ∆ -γ-δ ∆ ). Concerning servers that incorrectly reply when in a cured state, we are interested in servers that correctly reply after in time such that the reply is delivered by the client, i.e., they are not silent. This number is easily computable, M axCu(t) -M axSil(t, t + T r ). Thus min BC(t,

t + 2δ) = (M axCu(t) -M axSil(t, t + T r )). Summing up if maxCu(t) > 0 or ∆ > γ, then min CBC = Tr--δ ∆ +R( Tr ∆ -γ-δ ∆ )+(M axCu(t)-M axSil(t, t+2δ
)), otherwise min CBC assumes the same values as in the (∆S, CAM ) model, which concludes the proof.

Lemma 19

In Table 6.2 are reported all the results found so far for (∆S, * ) models. Such results have been proved considering f = 1. Extending such results to scenario for f > 1 is straightforward in the (∆S, * ) model. The extension to f > 1 in the (IT B, * ) and (IT U, * ) models is less direct. What is left to prove is that the results found for f = 1 can be applied to all other models in which mobile agents move independently from each other. In the following Lemma we employ * to indicate that the result holds for * assuming consistently the value CAM or CU M .

Lemma 20

Let n * LB ≤ α * (∆, δ, γ)f be the impossibility result holding in the (∆S, * ) model for f = 1. If there exists a tight protocol P reg solving the safe register for n ≥ α * (∆, δ, γ)f + 1 (f ≥ 1) then all the Safe Register impossibility results that hold in the (∆S, * ) models hold also in the (IT B, * ) and (IT U, * ) models.

Proof Let us consider the scenario S * for f = 1 and a read() operation time interval [t, t + T r ], t ≥ 0. Depending on the value of t there can be different (but finite) read scenarios, rs 1 , rs 2 , . . . , rs s . By hypothesis there exists P reg solving the safe register for n ≥ α * f (∆, δ, γ) + 1 then among the read scenarios RS = {rs 1 , rs 2 , . . . , rs s } all the possible worst case scenarios {wrs 1 , . . . , wrs w } ⊆ RS hold for n = α * (∆, δ, γ)f (meaning that P reg does not exist). We can say that those worst scenarios are equivalent in terms of replicas, i.e., for each wsr k is it possible to build an impossibility run if n = α * (∆, δ, γ) but P reg works if n = α * (∆, δ, γ)+1 (if we consider f = 1). Let us now consider (∆S, * ) for f > 1. In this case, mobile agents move all together, thus the same wrs k scenario is reproduced f times. For each wrs k scenario is it possible to build an impossibility run if n = α * (∆, δ, γ)f , i.e., α * (∆, δ, γ) -1 non Byzantine servers are not enough to cope with 1 Byzantine server, then it is straightforward that α * (∆, δ, γ) -f non Byzantine servers are not enough to cope with f Byzantine servers, the same scenario is reproduced f times.

In the case of unsynchronized movements (ITB and ITU) we consider ∆ = min {∆ 1 , . . . , ∆ f }. Each mobile agent generates a different read scenarios, those scenario can be up to f . As we just stated, if P reg exists, those worst case scenarios are equivalent each others in terms of replicas. Since all the worst case scenarios are equivalent in terms of replicas, thus impossibility results holding for mobile agents moving together hold also for mobile agent moving in an uncoordinated way.

Lemma 20

Examples

In this last part we see with some example how to compute the lower bounds for some particular case. If Figure 6.8 we consider 2δ ≤ ∆ < 3δ. In case (a) we consider the (∆S, CAM ) model. In such case we have M ax B(t, t+2δ) = 2 (cf. Lemma 11), M axCu(t) = 0 (cf. Lemma 13), thus M axSil(t, t + 2δ) = 0 as well (cf. Lemma 15) and min CBC = 0 (cf. Lemma 17). In particular, s 0 and s 1 incorrectly reply, contrarily to s 2 and s 3 . Thus, considering the reasoning in Theorem 14 we have that for n = 4 we can build two indistinguishable executions. In case (b) we consider the (∆S, CU M ) model. In such case we have M ax B(t, t + 2δ) = 2 (cf. Lemma 11), M axCu(t) = 1 (cf. Lemma 14), M axSil(t, t + 2δ) = 0 (cf. Lemma 16) and min CBC = 1 (cf. Lemma 19). s 0 , s 1 and s 2 incorrectly reply, contrarily to s 3 and s 4 . Moreover s 2 is correct before t + δ, thus reply correctly as well.Thus, considering the reasoning in Theorem 14 we have that for n = 5 we can build two indistinguishable executions.

If Figure 6.9 we consider δ ≤ ∆ < 2δ. In case (a) we consider the (∆S, CAM ) model. In such case we have M ax B(t, t+2δ) = 3 (cf. Lemma 11), M axCu(t) = 1 (cf. Lemma 13), M axSil(t, t + 2δ) = 0 (cf. Lemma 15) When we consider the model in which mobile agents are free to move we consider γ ≤ 2δ. If Figure 6.10 we consider 2δ ≤ ∆ < 3δ and f = 2. In such case we have M ax B(t, t + 2δ) = 2f = 4 (cf. Lemma 11), M axCu(t) = 1f = 2 (cf. Lemma 13),M axSil(t, t + 2δ) = 0 (cf. Lemma 15) and min CBC = 0 (cf. Lemma 17). Thus, considering the reasoning in Theorem 14 we have that for n = 4f we can build two indistinguishable executions. In this case we can see that the two mobile agents generates two different read scenarios, but those scenarios are equivalent in terms of replies. Let ma 0 the mobile agent on s 0 at time t and Let ma 1 be the mobile agent on s 4 at time t. ma 0 generates the following scenario: s 0 and s 1 incorrectly reply, contrarily to s 2 and s 7 (that starts the maintenance() when s 0 becomes Byzantine). On the other side, ma 1 generates the following read scenario: s 4 and s 5 incorrectly replies, s 3 is silent, but s 5 correctly replies before to be affected and s 6 correctly replies as well.

In the remaining part of the Chapter we propose optimal solutions to solve the Regular Register problem in the hierarchy of models we proposed (cf. Figure 4.8). Notice that all those solutions are optimal with respect to the γ deriving from the specific maintenance() operation employed, but we do not always have clues about the optimality of such operation. Before to proceed, is it worthy to discuss the relationship between the protocol structure and the MBF model considered. As we will see, the read() and write() operations slightly change from a model to the next.

Informally speaking, such operations need to interact with a large enough fraction of correct servers, the dimension of such fraction depends on δ, ∆ and γ. What really changes, from a model to the next, is the maintenance() operation. Indeed such operation copes with mobile agent movements and allows cured servers to become correct as soon as possible. In the next sections we will see how such operation has to change with respect to the MBF failure model considered and consequently the impact of γ in the protocols upper bounds we define.

Upper Bounds for the (∆S, CAM ) Synchronous model

In this section, we present an optimal protocol P reg with respect to the number of replicas, that implements a SWMR Regular Register in a round-free synchronous system for (∆S, CAM ) instance of the proposed MBF model. Our solution is based on the following three key points: (1) we implement a maintenance() operation that is executed periodically at each T i = t 0 + i∆ time (the time at which mobile agents move is known). In this way, the effect of a Byzantine agent on a server disappears in a bounded period of time;

(2) we implement read() and write() operations following the classical quorum-based approach. The size of the quorum needed to carry on the operations, and consequently the total number of servers required by the computation, is dependent by the time to terminate the maintenance() operation, δ and ∆; (3) we define a forwarding mechanism to avoid that read() and write() messages are "lost" by some server s i due to a concurrent movement of the Byzantine agent during such operations. Notice that when we say that a message is lost we are referring to the following situation: a client send a message at time t, thus it is delivered by all servers in a non Byzantine state in the time interval [t, t + δ]. As a consequence, servers in B(t, t + δ) may deliver such message when affected by a mobile agent, so that, after the mobile agent move to another server there is not trace of the delivered message. Thus we say that such message is lost. Protocol P reg is presented in details for δ ≤ ∆ < 3δ (6.4.1). Then we present slight modifications to apply to algorithms in both cases ∆ < δ (6.4.2) and ∆ > 3δ (6.4.3). Finally are presented parametrized joint proofs for those three cases (6.4.4). For simplicity we consider ∆ as a multiple of δ or vice versa when δ > ∆ and we use k = 2δ ∆ as a parameter. Roughly speaking k represents how many mobile agent "jumps" there may be during a 2δ temporal window and k 2 how many "jumps" there can be in a δ time period.

k = 2δ ∆ n CAM ≥ (k + 3)f + 1 #reply CAM ≥ (k + 1)f + 1 #echo CAM Tr d k = 1 4f + 1 2f + 1 2f + 1 2δ 3 k = 2 5f + 1 3f + 1 2f + 1 2δ 3

P reg Detailed Description for δ ≤ ∆ < 3δ

The protocol P reg for the (∆S, CAM ) model is described in Figures 6.11 -6.13, which present the maintenance(), write(), and read() operations respectively. Parameters for such protocol are reported in Table 6.3 respect to k = 2δ ∆ . n CAM is the minimum number of required replicas, #reply CAM is the minimum number of expected reply messages carrying the same value from #reply CAM different servers and #echo CAM is the minimum number of echo messages carrying the same value from #echo CAM different servers. T r is the read() operation duration and d is the number of values each server stores.

Local variables at client c i .

Each client c i maintains a set reply i that is used during the read() operation to collect the three tuples j, v, sn sent back from servers. In particular v is the value, sn is the associated sequence number and j is the identifier of server s j that sent the reply back. Additionally, c i also maintains a local sequence number csn that is incremented each time it invokes a write() operation and is used to timestamp such operations monotonically. Server side is more complex than client side. Servers, besides to store values and provide them when required, have also to manage the maintenance operation. As we proved in Theorem 12, such operation is necessary to cope with Byzantine movements to do not lose the last written values in the register. Local variables at server s i . Each server s i maintains the following local variables (we assume these variables are initialized to zero, false or empty sets according their type):

• V i : an ordered set containing d tuples v, sn , where v is a value and sn the corresponding sequence number. Such tuples are ordered incrementally according to their sn values. The function insert(V i , v k , sn k ) places the new value v k with sequence number sn k in V i according to the incremental order with respect to the sequence numbers. If there are more than d values, it discards from V i the value associated to the lowest sequence number.

• pending_read i : set variable used to collect identifiers of the clients that are currently reading.

• cured i : boolean flag updated by the cured_state oracle. In particular, such variable is set to true when s i becomes aware of its cured state and it is reset during the algorithm when s i becomes correct.

• echo_vals i and echo_read i : two sets used to collect information propagated through echo messages. The first one stores tuple j, v, sn propagated by servers just after the mobile Byzantine agents moved, while the second stores the set of concurrently reading clients in order to notify cured servers and expedite termination of read().

• f w_vals i : set variable storing a triple j, v, sn meaning that server s j forwarded a write message with value v and sequence number sn.

• just_correct i : boolean flag used to prevent servers, that were cured during the previous maintenance() operation, to reset the auxiliary variables (echo_vals i , echo_read i and f w_vals i listed before). In particular this variable is set to true just after s i becomes correct and it is reset during at the end of the next maintenance() operation.

In order to simplify the code of the algorithm, let us define the following functions:

• select_d_pairs_max_sn(echo_vals i ): this function takes as input the set echo_vals i , selects all the tuples v, sn whose occurrence in echo_vals i is at least #echo CAM = 2f + 1 and among those returns the d tuples (if exist) with the highest sequence number.

• select_value(reply i ): this function takes as input the reply i set of replies collected by client c i and returns the pair v, sn occurring at least #reply CAM times. If there are more pairs satisfying such condition, it returns the pair containing the highest sequence number.

The maintenance() operation. Such operation is executed by servers periodically at any time instant T i = t 0 + i∆. In the ( * , CAM ) models servers knows when a mobile agent leaves them, thus depending on such knowledge they execute different actions.

In particular, if a server s i is not in a cured state then it broadcasts an echo message carrying V i and pending_read i sets. Moreover if s i is not in a just_correct i case, it empties f w_vals i and echo_vals i sets, meaning that there is not need to retrieve lost values because s i was not recently affected by a mobile agent. If a server s i is in a cured state it first cleans its local variables and then, after δ time units, tries to update its state by checking the number of occurrences of each pair v, sn received with echo messages. In particular, it updates V i invoking the select_d_pairs_max_sn(echo_vals i ) function that populates V i with up to d tuples v, sn . If there are less than d tuples v, sn , it means that there are concurrent operation maintenance() executed every

T i = t 0 + i∆ : (1) cured i ← report_cured_state(); (2) if (cured i ) then (3) V i ← ∅; echo_vals i ← ∅; echo_read i ← ∅; f w_vals i ← ∅; (4)
wait(δ); [START_REF] Bonnet | Tight bound on mobile byzantine agreement[END_REF] insert(V i , select_d_pairs_max_sn(echo_vals i )); [START_REF] Bonomi | Tight selfstabilizing mobile byzantine-tolerant atomic register[END_REF] cured i ← false; [START_REF] Bonomi | Approximate agreement under mobile byzantine faults[END_REF] just_correct i ← true; [START_REF] Bonomi | Optimal mobile byzantine fault tolerant distributed storage[END_REF] for each (j ∈ (pending_read i ∪ echo_read i )) do [START_REF] Bouzid | Byzantine convergence in robot networks: The price of asynchrony[END_REF] send reply (i, V i ) to c j ; (10) endFor [START_REF] Buhrman | Optimal resiliency against mobile faults[END_REF] else [START_REF] Cachin | Optimal resilience for erasure-coded byzantine distributed storage[END_REF] broadcast echo(i, V i , pending_read i ); [START_REF] Charron-Bost | Approximate consensus in highly dynamic networks: The role of averaging algorithms[END_REF] if ¬(just_correct i )then ( 14) ---------------------------------when echo (j, V j , pr) is received: write() operations updating the register value concurrently with the maintenance() operation. For the moment, s i considers ⊥, 0 as the pair associated to the value that is concurrently written. At the end s i assigns f alse to cured i variable, meaning that it is now correct (has valid value to reply with) and can start to reply to clients that are currently reading and assigns true to just_correct i variable, to avoid to empty the auxiliary variables during the next maintenance() operation.

f w_vals i ← ∅; echo_vals i ← ∅; (15) else just_correct i ← false; (16) endif (17) endif -
(18) echo_vals i ← echo_vals i ∪ V j ; (19) echo_read i ← echo_read i ∪ pr;
The write() operation. When the writer wants to write a value v, it increments its sequence number csn and propagates v and csn to all servers. Then it waits for δ time units (the maximum message transfer delay) before returning. When a server s i delivers a write message, it updates V i invoking the function insert() and forwards the message, through a write_fw(i, v, csn ), to all others servers. This helps to cope with the message loss in case servers deliver such message while they are affected by mobile Byzantine agents. In addition, it also sends a reply() message to all clients that are currently reading (clients in pending_read i set) to allow them to terminate their read() operation.

When s i delivers a write_fw(j, v, csn ) message, it stores such message in f w_vals i set. Such set is constantly monitored together with echo_vals i set to find a couple v, sn occurring at least #reply CAM times. This continuous check enables servers in a cured of just cured state to store the new value and reply to a reading client as soon as possible.

The read() operation. When a client wants to read, it broadcasts a read() message request to all servers and waits 2δ time (i.e., one round trip delay) to collect replies. When it is unblocked from the wait statement, it selects a value v invoking the select_value function on reply i set, sends an acknowledgement message to servers to ========= Client code ========== operation write(v):

(1) csn ← csn + 1;

(2) broadcast write(v, csn);

(3) wait (δ); (4) return write_confirmation;

========= Server code ========== when write(v, csn) is received:

(5) insert(V i , v, csn ); ( 6) for each j ∈ (pending_read i ∪ echo_read i ) do [START_REF] Bonomi | Approximate agreement under mobile byzantine faults[END_REF] send reply (i, { v, csn }); (8) endFor [START_REF] Bouzid | Byzantine convergence in robot networks: The price of asynchrony[END_REF] broadcast write_fw(i, v, csn ); -------------------------------------when write_fw(j, v, csn ) is received: [START_REF] Bouzid | Optimal byzantineresilient convergence in uni-dimensional robot networks[END_REF] ------------------------------------when ∃ j, v, sn ∈ (f w_vals i ∪ echo_vals i ) occurring at least #reply CAM times: [START_REF] Buhrman | Optimal resiliency against mobile faults[END_REF] insert(V i , v, sn ); (12) ∀j : f w_vals i ← f w_vals i \ { j, v, ts }; (13) ∀j : echo_vals i ← echo_vals i \ { j, v, ts }; [START_REF] Denning | An intrusion-detection model[END_REF] for each (j ∈ (pending_read i ∪ echo_read i )) do [START_REF] Dolev | Reaching approximate agreement in the presence of faults[END_REF] send reply (i, { v, sn }) to c j ; (16) endFor inform that its operation is now terminated and returns v as result of the operation. When a server s i delivers a read(j) message from client c j it first puts the client identifier in pending_read i set to remember that c j is reading and needs to receive possible concurrent updates, then s i checks if it is in a cured state and if not, it sends a reply back to c j . Note that, the reply() message carries the set V i , which contains up to d tuples value, ts .

f w_vals i ← f w_vals i ∪ { j, v, csn };
As we said earlier, V i may contains less than d values if s i was affected by a Byzantine agent when the last write() operations occurred. As soon as s i retrieve such values through the f w_vals i and echo_vals i sets, such values are sent back to c j .

In any case, s i forwards a read_fw message to inform other servers about c j read request. This is useful in case some server missed the read(j) message as it was affected by mobile Byzantine agent when such message has been delivered.

When a read_fw(j) message is delivered, c j identifier is added to pending_read i set, as when the read request is just received from the client.

When a read_ack(j) message is delivered, c j identifier is removed from both pending_read i and echo_read i sets as it does not need anymore to receive updates.

P reg for ∆ < δ

When ∆ < δ the previous protocol changes with respect to the maintenance() operation. In this case, during such operation operation, mobile Byzantine agent movements may occur. Informally the maintenance() operation could be run at each T i , but since T i+1 -T i < δ, then a new maintenance() would be started before the ========= Client code ========== operation read():

(1) reply i ← ∅;

(2) broadcast read(i);

(3) wait (Tr); (4) v, sn ← select_value(reply i );

(5) broadcast read_ack(i); (6) return v; ------------------------when reply (j, V j ) is received: [START_REF] Bonomi | Approximate agreement under mobile byzantine faults[END_REF] for each ( v, sn ∈ V j ) do [START_REF] Bonomi | Optimal mobile byzantine fault tolerant distributed storage[END_REF] reply i ← reply i ∪ { j, v, sn }; (9) endFor ========= Server code ========== when read (j) is received: [START_REF] Bouzid | Optimal byzantineresilient convergence in uni-dimensional robot networks[END_REF]

pending_read i ← pending_read i ∪ {j}; (11) if (¬cured i ) (12)
then send reply (i, V i ); ( 13) endif [START_REF] Denning | An intrusion-detection model[END_REF] broadcast read_fw(j); ------------------------when read_fw (j) is received: ------------------------when read_ack (j) is received: [START_REF] Dolev | Self-Stabilization[END_REF] previous one terminate, so that the operation never terminate. This means that it no possible to run a new maintenance() at each T i . To overcome this problem we introduce a new variable curing_state i that is used in place of cured i in the following way. When cured i is set to true, then the maintenance() operation starts. To avoid the run of a new operation too early (at the next T i ), cured i is set to false and curing_state i to true. So that curing_state i is used during the read() operation to avoid cured servers to reply when are storing any valid value. Variable counter i takes the place of just_cured i . Basically, after the end of the maintenance() operation, some value just written could be still missing, thus echo_vals i and f w_vals i can not be emptied, in this case, for δ time after the end of the operation. counter i keeps track of the number of maintenance() operations that occur during δ time. In Figure 6.14 and Figure 6.15 are reported, with slight modifications, the maintenance() and read() operations respectively (write() operation is unchanged). In Table 6.4 are listed the new parametrized values. In particular, in the second line there is an example for δ 2 ≤ ∆ < δ. As we can see the number of replicas increases to cope with the number of Byzantine servers that increases during a δ time period. operation maintenance() executed every

(15) pending_read i ← pending_read i ∪ {j};
pending_read i ← pending_read i \ {j}; (17) echo_read i ← echo_read i \ {j};
∆ ≤ δ n CAM ≥ (k + k 2 + 2)f + 1 #reply CAM ≥ (k + 1)f + 1 #echo CAM ≥ kf + 1 Tr d δ 2 ≤ ∆ < δ 8f + 1 5f + 1 4f + 1 2δ 3
T i = t 0 + i∆ : (1) cured i ← report_cured_state(); (2) if (cured i ) then (3) V i ← ∅; echo_vals i ← ∅; echo_read i ← ∅; f w_vals i ← ∅; (4) curing_state i ← true; (5) cured i ← f alse; (6)
wait(δ); [START_REF] Bonomi | Approximate agreement under mobile byzantine faults[END_REF] insert(V i , select_d_pairs_max_sn(echo_vals i )); [START_REF] Bonomi | Optimal mobile byzantine fault tolerant distributed storage[END_REF] curing_state i ← false; [START_REF] Bouzid | Byzantine convergence in robot networks: The price of asynchrony[END_REF] counter i ← k 2 ; (10) for each (j ∈ (pending_read i ∪ echo_read i )) do [START_REF] Buhrman | Optimal resiliency against mobile faults[END_REF] send reply (i, V i ) to c j ; ( 12) endFor (13) elseIf ¬(curing_state i ) [START_REF] Denning | An intrusion-detection model[END_REF] broadcast echo(i, V i , pending_read i ); [START_REF] Dolev | Reaching approximate agreement in the presence of faults[END_REF] if counter i = 0 then [START_REF] Dolev | Self-Stabilization[END_REF] f w_vals i ← ∅; ----------------------------------when echo (j, V j , pr) is received: [START_REF] Fischer | A lower bound fob the time to assube intebactive consistencv[END_REF] ========= Client code ========== operation read():

echo_vals i ← ∅; (17) else counter i ← counter i -1; (18) endif (19) endif
echo_vals i ← echo_vals i ∪ V j ; (21) echo_read i ← echo_read i ∪ pr;
(1) reply i ← ∅;

(2) broadcast read(i);

(3) wait (2δ); (4) v, sn ← select_value(reply i );

(5) broadcast read_ack(i);

(6) return v; -----------------------when reply (j, V j ) is received: [START_REF] Bonomi | Approximate agreement under mobile byzantine faults[END_REF] for each ( v, sn ∈ V j ) do [START_REF] Bonomi | Optimal mobile byzantine fault tolerant distributed storage[END_REF] reply i ← reply i ∪ { j, v, sn }; (9) endFor ========= Server code ========== when read (j) is received: [START_REF] Bouzid | Optimal byzantineresilient convergence in uni-dimensional robot networks[END_REF]

pending_read i ← pending_read i ∪ {j}; (11) if (¬curing_state i ) (12)
then send reply (i, V i ); ( 13) endif [START_REF] Denning | An intrusion-detection model[END_REF] broadcast read_fw(j); ------------------------when read_fw (j) is received: ------------------------when read_ack (j) is received: [START_REF] Dolev | Self-Stabilization[END_REF]

(15) pending_read i ← pending_read i ∪ {j};
pending_read i ← pending_read i \ {j}; (17) echo_read i ← echo_read i \ {j};
∆ ≥ 3δ n CAM #reply CAM ≥ (k + 1)f + 1 #echo CAM Tr d k = 1 3f + 1 2f + 1 2f + 1 3δ 4

P reg for ∆ ≥ 3δ

For ∆ ≥ 3δ the protocol slightly changes with respect to the δ ≤ ∆ < 3δ protocol (cf. 6.4.1), in particular the main changes are in the maintenance() operation. The idea is the following, with respect to 6.4.1, n CAM is composed by f fewer correct servers but a longer read() operation is employed. This gives to servers in a cured state during a read() operation the time to become correct and contribute to such operation. To cope with a fewer number of correct servers, in particular in the forwarding mechanism and maintenance() operation, messages coming from cured servers are ignored, which implies to wait the maitenance() termination (if a server does not send an echo() message then is faulty or cured) to take any decision. In Figure 6.16 and Figure 6.17 the maintenance() and the write() operation respectively. The read() operation does not change, the only difference is the different values assumed by T r that according to Table 6.5 is 3δ. For each server s i there are the following changes:

• V i dimension is d = 4 rather than d = 3;
• during the maintenance() operation f w_vals i are purged from values coming from cured servers using the following function;

-delete_cured_values(echo_vals i , set i ): this function takes as input echo_vals i and set i set and removes from the latter all values coming from servers that omit to send the echo() message.

• at this point in f w_vals i ∪ echo_vals i there can be at most f values coming from Byzantine servers, then a value is chosen from such set if occurs at least f + 1 = #echo CAM times and no decision are taken when the server is still in a cured state, meaning that the delete_cured_values(echo_vals i , fw_vals i ) and delete_cured_values(echo_vals i , echo_vals i ) functions have not been invoked yet.

• there is no more need of just_cured i variable. This variable was used to avoid to delete the f w_vals i ∪ echo_vals i sets after the end of the maintenance() operation in case, before the beginning of such operation, a write() operation occurred. To allows the cured server to get the value the forwarding mechanism takes place. In this case, being ∆ ≥ 3δ the new maintenance() operation do no begin before the end of the forwarding mechanism and thus there is no more need to keep those values during more than one maintenance() operation.

For each client c i the only change concern the read() operation, that terminates after 3δ time rather than 2δ time. operation maintenance() executed every

T i = t 0 + i∆ : (1) cured i ← report_cured_state(); (2) if (cured i ) then (3) V i ← ∅; echo_vals i ← ∅; echo_read i ← ∅; f w_vals i ← ∅; (4)
wait(δ); [START_REF] Bonnet | Tight bound on mobile byzantine agreement[END_REF] delete_cured_values(echo_vals i , echo_vals i ); [START_REF] Bonomi | Tight selfstabilizing mobile byzantine-tolerant atomic register[END_REF] insert(V i , select_d_pairs_max_sn(echo_vals i )); [START_REF] Bonomi | Approximate agreement under mobile byzantine faults[END_REF] delete_cured_values(echo_vals i , fw_vals i ); [START_REF] Bonomi | Optimal mobile byzantine fault tolerant distributed storage[END_REF] cured i ← false; [START_REF] Bouzid | Byzantine convergence in robot networks: The price of asynchrony[END_REF] for each (j ∈ (pending_read i ∪ echo_read i )) do [START_REF] Bouzid | Optimal byzantineresilient convergence in uni-dimensional robot networks[END_REF] send reply (i, V i ) to c j ; (11) endFor [START_REF] Cachin | Optimal resilience for erasure-coded byzantine distributed storage[END_REF] else [START_REF] Charron-Bost | Approximate consensus in highly dynamic networks: The role of averaging algorithms[END_REF] broadcast echo(i, V i , pending_read i ); ( 14) endif ----------------------------------when echo (j, V j , pr) is received: [START_REF] Dolev | Reaching approximate agreement in the presence of faults[END_REF]

echo_vals i ← echo_vals i ∪ V j ; (16) echo_read i ← echo_read i ∪ pr;

Correctness (∆S, CAM )

Proofs for P Rreg protocol are similar for all the three cases presented. Termination property is guaranteed by the way the code is designed, after a fixed period of time all operations terminate. Validity property is proved with the following steps:

• 1. maintenance() operation works (i.e., at the end of the operation n -f servers store valid values). In particular, for a given value v stored by #echo correct servers at the beginning of the maintenance() operation, there are n -f servers that may store v at the end of the operation;

• 2. given a write() operation that writes v at time t and terminates at time t + δ, there is a time t > t + δ after which #reply correct servers store v.

• 3. at the next maintenance() operation after t there are #reply -f = #echo correct servers that store v, for step (1) this value is maintained.

• 4. the validity follows considering that the read() operation is long enough to include the t of the last written value before the read() and V is big enough to do not be full filled with new values before t .

Those steps are used along all the chapter for all the algorithms we present. We now show that the termination property is satisfied i.e, that read() and write() operations terminates. Due to the algorithm implementation, such property is independent from the specific instance of the MBF model considered. Notice, from now on we refer to the protocol code lines in 6.4.1, for the others instances (δ > ∆ 6.4.2 and ∆ ≥ 3δ 6.4.3) we point out code lines when it is necessary.

Lemma 21 If a correct client c i invokes write(v) operation at time t then this operation terminates at time t + δ.

========= Client code ========== operation write(v):

(1) csn ← csn + 1;

(2) broadcast write(v, csn);

(3) wait (δ); (4) return write_confirmation;

========= Server code ========== when write(v, csn) is received:

(5) insert(V i , v, csn ); ( 6) for each j ∈ (pending_read i ∪ echo_read i ) do [START_REF] Bonomi | Approximate agreement under mobile byzantine faults[END_REF] send reply (i, { v, csn }); (8) endFor [START_REF] Bouzid | Byzantine convergence in robot networks: The price of asynchrony[END_REF] broadcast write_fw(i, v, csn ); -------------------------------------when write_fw(j, v, csn ) is received: [START_REF] Bouzid | Optimal byzantineresilient convergence in uni-dimensional robot networks[END_REF] ------------------------------------when ∃ j, v, sn ∈ (f w_vals i ∪ echo_vals i ) occurring at least #echo CAM times ∧¬(cured i ): ( 11) insert(V i , v, sn ); (12) ∀j : f w_vals i ← f w_vals i \ { j, v, ts }; (13) ∀j : echo_vals i ← echo_vals i \ { j, v, ts }; [START_REF] Denning | An intrusion-detection model[END_REF] for each (j ∈ (pending_read i ∪ echo_read i )) do [START_REF] Dolev | Reaching approximate agreement in the presence of faults[END_REF] send reply (i, { v, sn }) to c j ; (16) endFor Proof The claim follows by considering that a write_confirmation event is returned to the writer client c i after δ time, independently of the behavior of the servers (see lines 3-4, Figure 6.12).

f w_vals i ← f w_vals i ∪ { j, v, csn };

Lemma 21

Lemma 22 If a correct client c i invokes read() operation at time t then this operation terminates at time t + T r .

Proof The claim follows by considering that a read() returns a value to the client after 2δ time, independently of the behavior of the servers (see lines 12-15, Figure 6.13).

T heorem 22

Theorem 15 (Termination) If a correct client c i invokes an operation, c i returns from that operation in finite time.

Proof The proof follows from Lemma 21 and Lemma 22.

T heorem 15

Notice, in the following, when not explicitly defined, we always consider as hypothesis that n CAM follows values defined in Tables 6.3, 6.4 and 6.5.

Lemma 23 (Step 1) Let v be the value stored at

#echo CAM correct servers s j ∈ Co(T i ), such that v ∈ V j ∀s j ∈ Co(T i ). Then ∀s c ∈ Cu(T i ) v is returned by the function select_d_pairs_max_sn(echo_vals i ) at T i + δ (i.

e., at the end of the maintenance() operation).

Proof By hypotheses at T i there are #echo CAM correct servers s j storing the same value v in V j and running the correct code. Non faulty servers run code in Figure 6.11. In particular each correct server broadcasts a echo() message with attached the content of V j (line 11) while each server s i ∈ Cu(T 1 ) waits δ time (line 4) to gather all the echo() messages. Since those servers are #echo CAM then after δ time all non Byzantine servers collect #echo CAM occurrences of all correct values in V j . Thus all cured servers get v when invoke the function select_d_pairs_max_sn(echo_vals i ).

To conclude, at the beginning of the maintenance() operation the echo_vals set is reset. During such operation there are at most 2δ ∆ = kf Byzantine servers (servers just affected and servers affected in the previous δ time period, that can send an incorrect echo() message. When 0 < ∆ ≤ 3δ, #echo CAM = kf + 1 > kf then Byzantine servers are not able to force cured servers to chose a never written or older value. The same reasoning holds for ∆ ≥ 3δ considering that, contrarily to the previous case, we remove values coming from Byzantine servers affected before the maintenance() operation (cf. Figure 6.16 line 6), thus cured servers have to cope only with f Byzantine servers, being #echo CAM = f + 1 > f then Byzantine servers may not force the cured servers to chose a never written or older value, concluding the proof.

Lemma 23

In the next lemma we prove that, thanks to the forwarding mechanism, after a shorter time, T r after the end of the write() operation, there are enough servers storing the last written value to allow a read() operation to return it. We refer to T r , which is the read() duration since this time is strictly related to the availability of the last written value to be read. This is always true except for ∆ ≥ 3∆. Looking at Figure 6.20 is it clear that during each maintenance() operation there are never #reply CAM servers. Now it should be clear why T r in this case is longer, to allows cured servers to become correct and reply.

Lemma 24 (

Step 2) Let op W be a write(v) operation invoked by a client c k at time t B (op W ) = t then at time t + T r there are at least #reply CAM servers s j ∈ Co(t + 2δ) such that v ∈ V j . Proof Let us proceed by construction. We first consider how many correct servers are storing v at t+δ (the end of op W , cf. Lemma 21), then we evaluate this number at time t + T r . Due to the communication channel synchrony, the write messages from c k are delivered by non faulty servers within the time interval [t, t + δ]; any non faulty server in the time interval [t, t + δ] executes the correct algorithm code. Thus, each s j delivers the write message and executes line 5 in Figure 6.12, storing v in V j . For Lemma 11 in the [t, t + δ] time interval there are maximum 2δ ∆ + 1 = k + 1 Byzantine servers, thus at t + δ v is stored by at least n -(k + 1)f = (k + 1)f + 1 correct servers. For clarity let us now consider separately the three cases: (i) 0 < ∆ < 2δ, (ii) 2δ ≤ ∆ < 3δ and (iii) ∆ ≥ 3δ. Let us remember that T r = 2δ in case (i) and case (ii) and T r = 3δ in case (iii). case (i) 0 < ∆ < 2δ, k ≥ 1 (cf. Figure 6.18), at t + δ there are (k + 1)f + 1 = #reply CAM correct servers storing v. We have to prove that despite a Byzantine movement T i ∈ [t + δ, t + 2δ] (at T i there are #reply CAM -f = #echo CAM correct servers storing v) at time t + 2δ there are #reply CAM correct servers storing v.

Those #reply CAM correct servers may deliver the write() message from c k before of after T i-1 . Consequently they can send the WRITE_FW() (or echo()) message before of after T i . In the first case v is insert in the V set (Figure 6.12 line 5) and at the next maintenance() operation, at T i , v is in the echo() message (Figure 6.11 line 12). In the second case, when the write() message from c k is delivered by servers in Co(t, t + δ) after T i , the WRITE_FW() message is sent by servers in the time interval [T i , t E (op)] (Figure 6.12 line 9). Since a message is delivered by δ time, then by t E (op) + δ = t + 2δ any server has enough occurrences of v in the f w_vals i ∪ echo_vals i set, line 15 Figure 6.12 is executed and v is stored in V . Thus by this time, all servers that are no Byzantine during [T i , t E (opW ) + δ] (i.e.,n -f > #reply CAM ) store v. case (ii) 2δ ≤ ∆ < 3δ , k = 1, being ∆ ≥ 2δ then during a 2δ time interval can occur only one Byzantine movement, cf. Figure 6.19. Let be T i the time of such movement, there are two cases: (a)

T i ∈ [t, t + δ] and case (b) T i ∈ [t + δ, t + 2δ].
In case (a), at t + δ there are (k + 1)f + 1 = 2f + 1 correct servers storing v and there are not further movements up to t + 2δ. To completeness, at t + 2δ, thanks to the forward mechanism shown in case (i), servers that were in B(t) are now storing v as well. Thus at t + 2δ there are at least 3f + 1 > #reply CAM servers storing v. Finally, case (b), since T i ∈ [t + δ, t + 2δ] then T i / ∈ [t, t + δ] so that at t + δ there are n -f = 3f + 1 correct servers storing v. At t + 2δ, due to Byzantine movements in T i , there are 2f + 1 = #reply CAM servers storing v. case (iii) ∆ ≥ 3δ, being ∆ ≥ 3δ then during a T r = 3δ time interval can occur only one Byzantine movement, cf. Figure 6.20. Let be T i the time of such movement, there are two cases: (a) T i ∈ [t, t + δ] and case (b)

T i ∈ [t + δ, t + 3δ].
In case (a), at t + δ there are f + 1 correct servers storing v and there are not further movements up to T i + 3δ. As for case (i) those f + 1 correct servers may deliver the write() message from c k before of after T i . Consequently they can send the WRITE_FW() (or echo()) message before of after T i . In the first case v is insert in the V set (Figure 6.17 line 5) and at the next maintenance() operation, at T i , v is in the echo() message (Figure 6.16 line 13). In the second case, when the write() message from c k is delivered by servers in Co(t, t + δ) after T i , the WRITE_FW() message is sent by servers in the time interval [T i , t E (op)] (Figure 6.17 line 9). Since a message is delivered by δ time, then by t E (op) + δ = t + 2δ any server has f + 1 occurrences of v in the f w_vals i ∪ echo_vals i sets, and after T i + δ values coming from cured servers are removed, thus line 11 is executed and v is stored in V . Thus by this time, all servers that are no Byzantine during [T i , t E (opW ) + δ] (i.e.,#reply CAM ), store v. Finally, case (b), since T i ∈ [t + δ, t + 3δ] then T i / ∈ [t, t + δ] so that at t + δ there are n -f = 2f + 1 correct servers storing v. At t + 2δ, due to Byzantine movements in T i , there are f + 1 = #echo CAM servers storing v and for Lemma 23 from time T i + δ ≤ t + 3δ there are #reply CAM servers storing v.

To conclude the proof, let us consider that cured servers reset the f w_vals and echo_vals when they begin the maintenance() operation and in T r = 2δ time there are not enough Byzantine servers to force a cured server to store in V a never written value. If T r = 3δ we have that messages coming from cured servers (and thus servers that were previously Byzantine) are ignored (Figure 6.16 line 5 and line 7).

Lemma 24

For simplicity, for now on, given a write() operation op W we call t B (op W ) + T r = t wC the completion time of op W , the time at which there are at least #reply CAM servers storing the value written by op W .

Lemma 25 (

Step 3) Let op W be a write() operation occurring at t B (op W ) = t and let v be the written value and t wC its completion time. Then if there are no other write() operations after op W , the value written by op W is stored by all correct servers forever.

Proof Let T i be the time of the first Byzantine agent movement after t wC , let us consider the same cases as in Lemma 24: (i) 0 < ∆ < 2δ, (ii) 2δ ≤ ∆ < 3δ and (iii) ∆ ≥ 3δ. case (i) 0 < ∆ < 2δ, for Lemma 24, at t + T r = t + 2δ = t wC there are n-f > #reply CAM = (k+1)f +1 servers storing v. Thus at time T i , due to Byzantine movements, there are at least n -2f ≥ #rely CAM servers storing v and performing the maintenance() operation. For Lemma 23 at the end of maintenance() operation all cured servers, when invoke select_d_pairs_max_sn(echo_vals i ) returns v. By hypothesis there are no concurrent write() operation, thus all those servers store v. When ∆ ≥ δ, at the end of this maintenance() operation there are n-f ≥ #reply CAM servers storing v, whose became n -2f ≥ #reply CAM ≥ #echo CAM at T i+1 , again, applying Lemma 23, at the end of maintenance() operation there are n -f correct servers storing v. This reasoning can be iterated forever. When ∆ < δ before the end of the maintenance() other movements occur. In particular in δ time may occur δ ∆ = k 2 = k movements. Thus each time there are up to f servers that lose v. This

s 0 s 1 s 2 s 3 s 4
write()

T i t wC s 0 s 1 s 2 s 3 s 4
write() write()

T i t wC
T i t wC s 0 s 1 s 2 s 3
write() is true for k times. At time T i+k > T i + δ, servers that executed the maintenance() operation at T i , for Lemma 23 are now able to select v, and since there a no write() operations, v is stored in V j . Thus, at time T i+k there are n-(k -1)f servers storing v since T i and f servers that terminate the maintenance() operation started at

T i t wC
T i . So there are n-(k -1)f +f = n-k f = (k+k +2)f +1-k f = (k+1)f +1 ≥ #reply CAM servers storing v.
From now on, at each T j there are up to f servers that lose v and f servers that recover it, thus v is always stored at all correct servers.

case (ii) 2δ ≤ ∆ < 3δ, case (a) T i-1 ∈ [t, t + δ],
from Lemma 24 at time t wC there are 3f + 1 correct servers storing v. Using the same reasoning as in case (i), at T i there are 2f + 1 = #echo CAM = #reply CAM correct servers storing v, by hypothesis there are no further write() operation, thus for Lemma 23, at the end of the maintenance() operation there are n -f ≥ 3f + 1 ≥ #reply CAM correct servers storing v. Applying the same iterative reasoning as in case (i) we have that v is stored in all correct servers forever.

case (b) T

i-1 ∈ [t + δ, t + 2δ],
as show in Lemma 24, at t + δ there are n -f correct servers storing v. Thus at T i there are n -2f ≥ #reply CAM ≥ #echo CAM correct servers storing v. By hypothesis there are no further write() operations, so we can apply Lemma 23 and at the end of the maintenance() operation there are n -f ≥ #reply CAM correct servers storing v. Applying the same iterative reasoning as in case (i) we have that v is stored in all correct servers forever.

case (iii) ∆ ≥ 3δ. From Lemma 24 at time t wC there are n -f correct servers storing v. At the next maintenance() operation those servers are n-2f = #echo CAM , for Lemma 23 those servers are enough to correctly terminate the maintenance() operation. Thus, before next mobile agent movements, there are n -f correct servers storing v and again this reasoning can be iterated forever concluding the proof.

Lemma 25

Notice, for ∆ ≥ 3δ case, contrarily to other cases, a value v is present in #reply correct servers only from the end of the maintenance() time to the next mobile agent movement. In other words, there is a period of δ time in which is not possible to read(), to cope with that the read() operation lasts 3δ time rather than 2δ.

Lemma 26 (

Step 3) Let op W 0 , op W 1 , . . . , op W q-1 , op Wq , op W q+1 , . . . be the sequence of write() operations issued on the regular register. Let us consider a particular op Wq , let v be the value written by op Wq and let t wC k be its completion time. Register stores v (there are at least #reply CAM correct servers storing it) up to time at least t B W q+d .

Proof The proof simply follows considering that:

• for Lemma 25 if there are no more write() operation then v, after t wC , is in the register forever.

• any new written value is store in an ordered set V (cf. Figure 6.12 line 5) whose dimension is d.

• write() operations occur sequentially.

It follows that after the beginning of d write() operations, op W q+1 , . . . , op W q+d , v it may be no more stored in the regular register.

Lemma 26

Considering values in Tables 6.3, 6.4 and 6.5, we always have that if 0 < ∆ < 3δ then n -B(t, t + δ) ≥ #reply CAM . We can rewrite it as n CAM -

( δ ∆ + 1)f ≥ #reply CAM . • δ ≤ ∆ < 3δ, Table 6.3. (k + 3)f + 1 -2f = (k + 1)f + 1; • ∆ ≤ δ, Table 6.4. (k + k 2 + 2)f + 1 -( k 2 + 1)f = (k + 1)f + 1 6 .
Theorem 16 (Step 4.) Any read() operation returns the last value written before its invocation, or a value written by a write() operation concurrent with it.

Proof Let us consider a read() operation op R . We are interested in the time interval

[t B (op R ), t B (op R ) + T r -δ].
Since such operation lasts T r , the reply messages sent by correct servers within t B (op R ) + T r -δ are delivered by the reading client. For 0 < ∆ < 3δ during [t, t + δ] time interval there are n -k 2 -1 ≥ #reply CAM correct servers that have the time to deliver the read request and reply. For ∆ ≥ 3δ, there is a δ time period in which a mobile agent movement occurs. But in this case T r = 3δ, thus during such operation there are the remaining 2δ time during which there are #reply correct servers that reply. Now we have to prove that what those correct servers reply with is a valid value. There are two cases, op R is concurrent with some write() operations or not.

op R is not concurrent with any write() operation. Let op W be the last write() operation such that t E (op W ) ≤ t B (op R ) and let v be the last written value. For Lemma 25 after the write completion time t wC there are #reply CAM correct servers storing v. Since t B (op R ) + T r -δ ≥ t wC , then there are #reply CAM correct servers replying with v. So the last written value is returned.

op R is concurrent with some write() operation. Let us consider the time interval [t B (op R ), t B (op R ) + T r -δ]. In such time there can be at most d -1 write() operations 7 . For Lemma 26 the last written value before t B (op R ) is still present in #reply CAM correct servers. Thus at least the last written value is returned. To conclude, for Lemma 11, during the read() operation there are at most (k + 1)f Byzantine servers, being #reply CAM > (k + 1)f then Byzantine servers may not force the reader to read another or older value, if an older values has #reply CAM occurrences the one with the highest sequence number is chosen.

T heorem 16

Theorem 17 Let n be the number of servers emulating the register and let f be the number of Byzantine agents in the (∆S, CAM ) round-free Mobile Byzantine Failure model. If n = n CAM according to Tables 6.3 -6.5, then P reg instances (cf. 6.4.1, 6.4.2 and 6.4.3) implement a SWMR Regular Register in the (∆S, CAM ) round-free Mobile Byzantine Failure model.

Proof

The proof simply follows from Theorem 15 and Theorem 16.

T heorem 17 7 If the read() operation lasts Tr = 2δ time, then there can be 2 concurrent write() operations in Tr -δ time, if Tr = 3δ there can be 3 write() operations in Tr -δ time.

6 k = 2δ ∆ , thus δ ∆ ≤ k 2 .
+ k 2 + 2)f + 1.
The blue line is the Function n CAM LB described in Table 6.1 with values from Table 6.2. The distance between the two lines is just 1 server.

Lemma 27 Protocol

P reg for ∆ ≥ 3δ is tight.
Proof The proof simply follows considering that for Lemma 8 there exists no protocol solving the safe register problem if n ≤ 3f .

Lemma 27

Lemma 28 Protocols P reg for 0 < ∆ < δ and Protocol P reg for δ ≤ ∆ < 3δ are tight with respect to γ ≤ δ.

Proof The proof follows from Theorem 14 using the values in Table 6.2 to compute n CAM LB as defined in Table 6.1. From Lemma 23 we can set γ ≤ δ. In particular if δ ≤ ∆ < 3δ then lower bounds are respectively 4f if k = 1 and 5f if k = 2. Whose match values of n CAM = (k + 3)f + 1. If δ > ∆, let us consider graphic depicted in Figure 6.21, where n CAM and n CAM LB are depicted for k increasing, proving that the bound for the protocol is just above, by one server, over the lower bound. Lemma 27

Discussion

We proved that exists an optimal protocol P reg that solves the Regular Register and matches bound proved in Section 6.3. Thus are verified the hypothesis for Lemma 20, which implies that lower bounds proved so far for the (∆S, CAM ) model holds for the (IT B, CAM ) and (IT U, CAM ) models. Clearly since parameters change from model to model then the exact values of those lower bounds are different.

Finally let us conclude this section with Figure 6.22. In such figure we case see that for 0 < ∆ < 3δ (for simplicity we draw two specific cases) for any value of T r the lower bounds do not change. For ∆ ≥ 3δ lower bounds are lower when T r is a multiple of ∆. Intuitively the reason behind is that T r has to be long enough to allow cured servers to terminate the maintenance() operation but on the other side it has to be not too long to allow mobile agents to move to much during a read() operation.

T r n(f ) 2δ ≤ ∆ < 3δ δ ≤ ∆ < 2δ ∆ ≥ 3δ

Upper Bounds for the (IT B, CAM ) Synchronous model

In this section, we present an optimal protocol P reg with respect to the number of replicas, that implements a SWMR Regular Register in a round-free synchronous system for (IT B, CAM ) and (IT U, CAM ) instances of the proposed MBF model. The difference with respect (∆S, CAM ) model is that the time at which mobile agents move is unknown. Notice that each mobile ma i agent has it own ∆ i . Since we do not have any other information we consider ∆ = min{∆ 1 , . . . , ∆ f }. Following the approach used in the (∆S, CAM ) model, our solution is still based on the following two key points: (1) we implement a maintenance() operation, in this case executed on demand; (2) we implement read() and write() operations following the classical quorum-based approach. The size of the quorum needed to carry on the operations, and consequently the total number of servers required by the computation, is dependent by the time to terminate the maintenance() operation, δ and ∆ (see Table 6.6). Contrarily to the solution presented in Section 6.4, we do not employ a a forwarding mechanism. Such mechanism is it not necessary since being the maintenance() operation on demand (i.e., γ ≤ 2δ) its duration increases and, informally speaking, there is no more need to rush to help cured servers to retrieve a lost value as soon as possible. In this case, the only propagating mechanism is on the maintenance() operation. In Table 6.6 n CAM is the minimum number of required replicas, #reply CAM is the minimum number of expected reply messages carrying the same value from #reply CAM different servers and #echo is the minimum number of echo messages carrying the same value from #echo CAM different servers. The last difference, with respect the (∆S, CAM ) model is the increased #echo CAM . In fact, since the maintenance() operation lasts δ time more then there are k 2 Byzantine servers more. What we can do, is to leverage of the failure awareness and make it possible for curing servers, to ignore information coming from servers that where Byzantine in the δ time before the beginning of the maintenance() operation, as we do in the (∆S, CAM ) model for ∆ ≥ 3δ.

CAM k = 2δ ∆ n CAM ≥ 2(k + 1)f + 1 #reply CAM ≥ (k + 1)f + 1 #echo CAM ≥ (k + 1)f Tr d k = 1 4f + 1 2f + 1 2f 2δ 3 k = 2 6f + 1 3f + 1 3f 2δ 3 k = 4 10f + 1 5f + 1 5f 2δ 3

P reg Detailed Description.

The protocol P reg for the (IT B, CAM ) model is described in Figures 6. 23 -6.25, which present the maintenance(), write(), and read() operations, respectively.

Local variables at client c i . Each client c i maintains a set reply i that is used during the read() operation to collect the three tuples j, v, sn sent back from servers. In particular v is the value, sn is the associated sequence number and j is the identifier of server s j that sent the reply back. Additionally, c i also maintains a local sequence number csn that is incremented each time it invokes a write() operation and is used to timestamp such operations monotonically.

Local variables at server s i . Each server s i maintains the following local variables (we assume these variables are initialized to zero, false or empty sets according their type):

• V i : an ordered set containing d tuples v, sn , where v is a value and sn the corresponding sequence number. Such tuples are ordered incrementally according to their sn values. The function insert(V i , v k , sn k ) places the new value in V i according to the incremental order and, if there are more than d values, it discards from V i the value associated to the lowest sn.

• pending_read i : set variable used to collect identifiers of the clients that are currently reading.

• cured i : boolean flag updated by the cured_state oracle. In particular, such variable is set to true when s i becomes aware of its cured state and it is reset during the algorithm when s i becomes correct.

• echo_vals i and echo_read i : two sets used to collect information propagated through echo messages. The first one stores tuple j, v, sn propagated by servers just after the mobile Byzantine agents moved, while the second stores the set of concurrently reading clients in order to notify cured servers and expedite termination of read().

function awareAll():

(1) broadcast echo(i, ⊥) (2) wait(δ);

(3) broadcast echo(i, ⊥) ---------------------------------operation maintenance() executed while (true) : (4) cured i ← report_cured_state();

(5) if

(cured i ) then (6) cured i ← f alse; (7) curing_state i ← true; (8) V i ← ∅; echo_vals i ← ∅; pending_read i ← ∅;curing i ← ∅; (9)
broadcast echo_req(i); (10) awareAll(); (11) wait(2δ); [START_REF] Cachin | Optimal resilience for erasure-coded byzantine distributed storage[END_REF] delete_cured_values(echo_vals); (13) insert(V i , select_three_pairs_max_sn(echo_vals i )); [START_REF] Denning | An intrusion-detection model[END_REF] for each (j ∈ (curing i )) do [START_REF] Dolev | Reaching approximate agreement in the presence of faults[END_REF] send echo (i, V i ) to s j ; ( 16) endFor [START_REF] Fekete | Asymptotically optimal algorithms for approximate agreement[END_REF] ---------------------------------when echo (j, V j ) is received: ---------------------------------when echo_req (j) is received: • curing i : set used to collect servers running the maintenance() operation. Notice, to keep the code simple we do not explicitly manage how to empty such set since has not impact on safety properties.

curing_state i ← false; (18) endIf -
(19) for each ( v, sn ∈ V j do (20) echo_vals i ← echo_vals i ∪ v, sn j ; (21) endFor -
(22) curing i ← curing i ∪ j; (23) if (V i = ∅) (24) send echo(i, V i ); (25) endif
In order to simplify the code of the algorithm, let us define the following functions:

• select_d_pairs_max_sn(echo_vals i ): this function takes as input the set echo_vals i and returns, if they exist, three tuples v, sn , such that there exist at least #echo CAM occurrences in echo_vals i of such tuple. If more than three of such tuple exist, the function returns the tuples with the highest sequence numbers.

• select_value(reply i ): this function takes as input the reply i set of replies collected by client c i and returns the pair v, sn occurring at least #reply CAM times (see Table 6.6). If there are more pairs satisfying such condition, it returns the one with the highest sequence number.

• delete_cured_values(echo_vals): this function takes as input echo_vals i and removes from f w_vals i all values coming from servers that sent an echo() message containing ⊥.

========= Client code ========== operation write(v):

(1) csn ← csn + 1;

(2) broadcast write(v, csn);

(3) wait (δ); (4) return write_confirmation;

========= Server code ========== when write(v, csn) is received:

(5) insert(V i , v, csn ); ( 6) for each j ∈ (pending_read i ) do [START_REF] Bonomi | Approximate agreement under mobile byzantine faults[END_REF] send reply (i, { v, csn }); (8) endFor [START_REF] Bouzid | Byzantine convergence in robot networks: The price of asynchrony[END_REF] for each j ∈ (curing i ) do [START_REF] Bouzid | Optimal byzantineresilient convergence in uni-dimensional robot networks[END_REF] send echo (i, V i ); (11) endFor The maintenance() operation. Such operation is executed by servers on demand when the oracle notifies them that are in a cured state. Notice that in the ( * , CAM ) models servers knows when a mobile agent leaves them, thus depending on such knowledge they execute different actions. In particular, if a server s i is not in a cured state then it does nothing, it just replies to echo_req() messages. Otherwise, if a server s i is in a cured state it first cleans its local variables and broadcast to other servers an echo request then, after 2δ time units it removes value that may come from servers that were Byzantine before the maintenance() and updates its state by checking the number of occurrences of each pair v, sn received with echo messages.

In particular, it updates V i invoking the select_three_pairs_max_sn(echo_vals i ) function that populates V i with d tuples v, sn . At the end it assigns f alse to cured i variable, meaning that it is now correct and the echo_vals i can now be emptied. Contrarily to the (∆S, CAM ) case, cured server notifies to all that it has been Byzantine in the previous δ time period. This is done invoking the awareAll function that broadcast a default value ⊥ after δ time that a server discovered to be in a cured state. The write() operation. When the writer wants to write a value v, it increments its sequence number csn and propagates v and csn to all servers. Then it waits for δ time units (the maximum message transfer delay) before returning. When a server s i delivers a write, it updates its local variables and sends a reply() message to all clients that are currently reading (clients in pending_read i ) to notify them about the concurrent write() operation and to each server executing the maintenance() operation (servers in curing i ). The read() operation. When a client wants to read, it broadcasts a read() request to all servers and waits 2δ time (i.e., one round trip delay) to collect replies. When it is unblocked from the wait statement, it selects a value v invoking the select_value function on reply i set, sends an acknowledgement message to servers to inform that its operation is now terminated and returns v as result of the operation. When a server s i delivers a read(j) message from client c j it first puts its identifier in the set pending_read i to remember that c j is reading and needs to receive possible concurrent updates, then s i checks if it is in a cured state and if not, it sends a reply back to c j . Note that, the reply() message carries the set V i .

When a read_ack(j) message is delivered, c j identifier is removed from both pending_read i set as it does not need anymore to receive updates for the current read() operation.

========= Client code ========== operation read():

(1) reply i ← ∅;

(2) broadcast read(i);

(3) wait (2δ); (4) v, sn ← select_value(reply i );

(5) broadcast read_ack(i); (6) return v; ------------------------when reply (j, V j ) is received:

(7) for each ( v, sn ∈ V j ) do (8) reply i ← reply i ∪ { j, v, sn }; (9) endFor ========= Server code ========== when read (j) is received: (10) pending_read i ← pending_read i ∪ {j}; (11) if (V i = ∅) (12) then send reply (i, V i ); (13) endif ------------------------ when read_ack (j) is received: (14) pending_read i ← pending_read i \ {j};

P reg for ∆ ≥ 4δ

In this work we do not analyze the case ∆ ≥ 4δ. When we plot n CAM LB for ∆ = 4δ and γ = 2δ we obtain the graphic in Figure 6.26. As we can see when T r is a multiple of 4δ the lower bound decrease to 3f , with respect to 4f for all the other values of T r . This means that it does not exist a protocol solving the Safe Register with less than 3f servers. On the other side our conjecture is that we can not solve the maintenance() operation in the IT B model with less than 3f servers. This is due to the uncoordinated agents movements, which implies that during the maintenance() operation there may be more Byzantine servers with respect to the previous model. For this reason we do not consider such specific case. 6.1 with values from Table 6.2. We consider f = 1 and γ = 2δ.

Correctness (IT B, CAM )

To prove the correctness of P reg , we first show that the termination property is satisfied i.e, that read() and write() operations terminates.

Lemma 29 If a correct client c i invokes write(v) operation at time t then this operation terminates at time t + δ.

Proof

The claim follows by considering that a write_confirmation event is returned to the writer client c i after δ time, independently of the behavior of the servers (see lines 3-4, Figure 6.24).

Lemma 29

Lemma 30 If a correct client c i invokes read() operation at time t then this operation terminates at time t + 2δ.

Proof

The claim follows by considering that a read() returns a value to the client after 2δ time, independently of the behavior of the servers (see lines 3-6, Figure 6.25).

T heorem 30

Theorem 18 (Termination) If a correct client c i invokes an operation, c i returns from that operation in finite time.

Proof The proof follows from Lemma 29 and Lemma 30.

T heorem 18

Notice, in the following, when not explicitly defined, we always consider as hypothesis that n CAM follows values defined in Table 6.6 and proceed following the same four steps as in 6.4.4.

Before to prove the correctness of the maintenance() operation let us see how many Byzantine agent there may be during such operation. Since the cured server run it as soon as the mobile agent ma i leaves it, then ma i movement are aligned to such operation, this agent contribution is 2δ ∆ = k. All the others f -1 mobile agent are not aligned, thus their contribution is M ax B(t, t + 2δ) = k + 1. Thus there are k + (k + 1) × (f -1) Byzantine servers during the 2δ time maintenance() operation.

Lemma 31 (Step 1) Let T i = t be the time at which mobile agent ma i leave s c . Let v be the value stored at #echo CAM servers s j / ∈ B(t, t + δ) ∧ s j ∈ Co(t + δ), v ∈ V j ∀s j ∈ Co(t + δ). At time t + 2δ, at the end of the maintenance(), v is returned to s c by the function select_d_pairs_max_sn(echo_vals c ).

Proof The proof follows considering that:

• the maintenance() employs a request-reply pattern and during such operation, by hypothesis, there are #echo CAM servers that are never affected during the [T i , T i + δ] time period and are correct at time T i + δ. i.e., there are #echo CAM servers that deliver the echo_req() message (the can be either correct or cured) but are correct at time T i + δ such that the reply is delivered by s c by time T i + 2δ.

• during the maintenance() operation there are k + (k + 1) × (f -1) Byzantine servers, and ( k 2 )f servers that were Byzantine in [t -δ, t] time period, thus they could have sent incorrect messages as well.

• each cured servers, invokes awareAll() function, sends a ⊥ message twice: when they are aware to be cured and δ time after. Thus by time t + 2δ server running the maintenance removes from echo_vals the ( k 2 )f messages sent by those servers. In the end there are k + (k + 1) × (f -1) = (k + 1)f -1 messages coming from Byzantine servers in the echo_vals c set.

#echo CAM = (k + 1)f > (k + 1)f -1 thus Byzantine servers can not force the function select_d_pairs_max_sn(echo_vals c ) to return a not valid value and select_d_pairs_max_sn(echo_vals c ) returns v that occurs #reply CAM times, concluding the proof.

such that v ∈ V j .
Proof The proof follows considering that during the write() operation, [t, t + δ], there can be at most ( k 2 + 1)f mobile agents. Thus, during such time there are n -

( k 2 + 1)f = 2(k + 1)f + 1 -( k 2 + 1)f = (k + k 2 + 1)
f + 1 servers s j that being either cured or correct, execute code in Figure 6.24, line 5, inserting v in V j . Finally, (k + k 2 + 1)f + 1 > (k + 1)f + 1 = #reply CAM concluding the proof.

Lemma 32

For simplicity, for now on, given a write() operation op W we call t B (op W )+δ = t wC the completion time of op W , the time at which there are at least #reply CAM servers storing the value written by op W . Lemma 33 (Step 3.) Let op W be a write() operation occurring at t B (op W ) = t and let v be the written value and let t wC be its completion time. Then if there are no other write() operations after op W , the value written by op W is stored by all correct servers forever.

Proof Following the same reasoning as Lemma 32, at time t + δ, assuming that in [t, t + δ] there are ( k 2 + 1)f , then there are at least (k + k 2 + 1)f + 1 servers s j that being either cured or correct, execute code in Figure 6.24, line 5, inserting v in V j . Now let us consider the following:

• Let B 1 = B(t, t + δ) be the set containing the ( k 2 + 1)f Byzantine servers during [t, t + δ], so that there are (2k + 1)f + 1 -k 2 = (k + k 2 + 1)f + 1 ≥ #reply CU M non faulty servers storing v; -there are ( k 2 )f Byzantine servers in B 1 that begin the maintenance() operation . At that time there are #reply CAM non faulty servers storing v, being #reply CAM > #echo CAM , for Lemma 31 at the end of the maintenance() operation, by time t + 3δ, those servers obtain v a result of select_d_pairs_max_sn(echo_vals) invocation, whose is stored in V since there are no other write() operation and since v has the highest associated sequence number.

• Let B 2 = B(t + δ, t + 2δ) be the set containing Byzantine servers in the next δ period. Those servers are k 2 f (it is not k 2 f + 1, otherwise we would count the Byzantine servers at t+δ twice). Thus, at t+2δ there are (k+ k 2 +1)f +1-k 2 f = (k + 1)f + 1 = #reply CAM non faulty servers storing v; -there are ( k 2 )f Byzantine servers in B 2 that begin the maintenance() operation during [t + δ, t + 2δ] time interval. There are #reply CAM non faulty servers storing v, being #reply CAM > #echo CAM , for Lemma 31 at the end of the maintenance() operation, by time t + 4δ, those servers, get v invoking select_d_pairs_max_sn(echo_vals), whose is stored in V since there are no other write() operation and since v has the highest associated sequence number.

• Let B 3 = B(t + 2δ, t + 3δ) be the set containing Byzantine servers in the next δ period. Those servers are k 2 f . At t + 3δ there are (k + 1)f + 1 -k 2 f < #reply CAM non faulty servers storing v and the there are ( k 2 )f servers in B 1 that terminated the maintenance() operation storing v. Summing up there are

(k + 1)f + 1 -k 2 f + k 2 f = #reply CAM servers storing v.
Thus, after t + 3δ period there are servers becoming affected that lose v, but there are other f servers that become correct storing v, so that all correct servers store v.

Since there are no more write() operation, this reasoning can be extended forever, concluding the proof. Proof The proof simply follows considering that:

• for Lemma 33 if there are no more write() operation then v, after t wC , is in the register forever.

• any new written value is store in an ordered set V (cf. Figure 6.24 line 5) whose dimension is 3.

• write() operations occur sequentially.

It follows that after the beginning of 3 write() operations, op W k+1 , op W k+2 , op W k+3 , v it may be no more stored in the regular register. op R is not concurrent with any write() operation. Let op W be the last write() operation such that t E (op W ) ≤ t B (op R ) and let v be the last written value. For Lemma 33 after the write completion time t C w there are #reply CAM non faulty servers storing v. Since t B (op R ) + δ ≥ t C w, then there are #reply CAM non faulty servers replying with v (Figure 6.25, lines [START_REF] Buhrman | Optimal resiliency against mobile faults[END_REF][START_REF] Cachin | Optimal resilience for erasure-coded byzantine distributed storage[END_REF]. So the last written value is returned.

op R is concurrent with some write() operation. Let us consider the time interval [t B (op R ), t B (op R ) + δ]. In such time there can be at most two write() operations. Thus for Lemma 34 the last written value before t B (op R ) is still present in #reply CAM non faulty servers. Thus at least the last written value is returned. To conclude, for Lemma 11, during the read() operation there are at most (k + 1)f Byzantine servers, being #reply CAM > (k+1)f then Byzantine servers may not force the reader to read another or older value and even if an older values has #reply CAM occurrences the one with the highest sequence number is chosen.

T heorem 19

Theorem 20 Let n be the number of servers emulating the register and let f be the number of Byzantine agents in the (IT B, CAM ) round-free Mobile Byzantine Failure model. Let δ be the upper bound on the communication latencies in the synchronous system. If n = n CAM according to Table 6 the Function n CAM LB described in Table 6.1 with values from Table 6.2 (setting γ = 2δ).

The distance between the two lines is just 1 server.

Proof

The proof simply follows from Theorem 18 and Theorem 19 and considering ∆ = 1 in the case of (IT U, CAM ) model.

T heorem 17

Lemma 35 Protocol P reg for 0 < ∆ < 4δ is tight with respect to γ ≤ 2δ.

Proof The proof follows from Theorem 14 using the values in Table 6.2 to compute n CAM LB as defined in Table 6.1. We can use such Theorem since does exists a tight protocol that solves Regular Register in the (∆S, CAM ) model so we can apply Lemma 20. From Lemma 31 we can set γ ≤ 2δ. Let us consider graphic depicted in Figure 6.27, where the two functions are depicted for k increasing, proving that the bound for the protocol is just above, by one server, over the lower bound.

Lemma 35

Upper Bounds for the (∆S, CU M ) Synchronous model

In this section, we present an optimal protocol P reg with respect to the number of replicas, that implements a SWMR Regular Register in a round-free synchronous system for (∆S, CU M ) instance of the proposed MBF model. As for the (∆S, CAM ) model, the moment at which mobile agents move is known but servers are not aware of their failure state. As for the (∆, CAM ) model (cf. Section 6.4), our solution is based on the following two key points: (1) we implement a maintenance() operation that is executed periodically at each T i = t 0 + i∆ time. In this way, the effect of a Byzantine agent on a server disappears in a bounded period of time;

(2) we implement read() and write() operations following the classical quorum-based approach. The size of the quorum needed to carry on the operations, and consequently the total number of servers required by the computation, is computed by taking into account the time to terminate the maintenance() operation, δ and ∆; Contrarily to the (∆S, CAM ) case, the values that populate auxiliary variables (i.e., not the register stored value) have a fixed life time. This is necessary since servers are never aware to be in a cured state and thus mobile agents, once they left, may force them to take wrong decisions. For this reason, there is no more a forwarding mechanism and no more a f w_vals set after a write() operation. The maintenance() operation is the only operation in charge to "push" values and is run any ∆ time. It follows that is it necessary more time to spread the last written value to enough servers so that the value can be read. To this purpose, values that populate auxiliary variables can not be reset at each maintenance() operation (later it will be clearer), which implies that cured servers can not have a clean state after only one maintenance() operation. Thus in this model we have that cured servers are in such state for a longer time, in particular γ ≤ 2δ. This is the first case we saw where γ is greater than the maintenance() duration.

k = 2δ ∆ , δ ≤ ∆ < 3δ n CU M ≥ (3k + 2)f + 1 #reply CU M ≥ (2k + 1)f + 1 #echo CU M ≥ (k + 1)f + 1 k = 2 8f + 1 5f + 1 3f + 1 k = 1 5f + 1 3f + 1 2f + 1 ∆ ≥ 3δ 4f + 1 2f + 1 2f + 1
As in Section 6.4, the number of replicas needed to tolerate f Byzantine agents does not depend only on f but also on the ∆ and δ relationship (see Table 6.7).

P reg Detailed Description for δ ≥ ∆

The protocol P reg for the (∆S, CU M ) model is described in Figures 6. 28 -6.30.

Local variables at client c i . Each client c i maintains a set reply i that is used during the read() operation to collect the three tuples j, v, sn sent back from servers. Additionally, c i also maintains a local sequence number csn that is incremented each time it invokes a write() operation and is used to timestamp such operations.

Local variables at server s i . Each server s i maintains the following local variables (we assume these variables are initialized to zero, false or empty sets according their type):

• V i : an ordered set containing 3 tuples v, sn , where v is a value and sn the corresponding sequence number. Such tuples are ordered incrementally according to their sn values.

• V saf e j : this set has the same characteristic as V j . The function insert(V saf e i , v k , sn k ) places the new value in V saf e i according to the incremental order and if dimensions exceed 3 then it discards from V saf e i the value associated to the lowest sn.

• W i : is the set where servers store values coming directly from the writer, associating to it a timer, v, sn, timer . Values from this set are deleted at the end of the maintenance() operation when the timer expires or has a value non compliant with the protocol.

• echo_vals i and echo_read i : two sets used to collect information propagated through echo messages at the beginning of the maintenance() operation. The first one stores tuple v, sn j propagated by servers just after the mobile Byzantine agents moved. Set echo_read i stores identifiers of concurrently reading clients in order to notify cured servers and expedite termination of read().

• pending_read i : set variable used to collect identifiers of the clients that are currently reading.

In order to simplify the code of the algorithm, let us define the following functions:

• select_three_pairs_max_sn(echo_vals i ): this function takes as input the set echo_vals i and returns, if they exist, 3 tuples v, sn , such that there exist at least #echo CU M occurrences in echo_vals i of such tuple. If more than 3 of such tuples exist, the function returns the tuples with the highest sequence numbers.

• select_value(reply i ): this function takes as input the reply i set of replies collected by client c i and returns the pair v, sn occurring at least #reply CU M times. If there are more pairs with the same occurrence, it returns the one with the highest sequence number.

• conCut(V i , V saf e i , W i ): this function takes as input three 3 dimension ordered sets and returns another 3 dimension ordered set. The returned set is composed by the concatenation of V saf e i • V i • W i , without duplicates, truncated after the first 3 newest values (with respect to the timestamp). e.g.,

V i = { v a , 1 , v b , 2 , v c , 3 , v d , 4 } and V saf e i = { v b , 2 , v d , 4 , v f , 5 } and W i = ∅, then the returned set is { v c , 3 , v d , 4 , v f , 5 }.
The maintenance() operation. Such operation is executed by servers periodically at any time T i = t 0 + i∆. Each server first checks if there are expired values in W i then all the content of V saf e i is stored in V i and all V saf e i and echo_vals i sets are reset. Each server broadcast an echo message with the content of V i , W i (purged of the timer information) and the set pending_read i . When there is a value in echo_vas i set that occurs at least #echo CU M times, it updates V saf e i set by invoking select_three_pairs_max_sn(echo_vals i ) function. To conclude, after δ time since the beginning of the operation, the W i set is pruned from expired values and V i is reset. Informally speaking, at this point V i is no more used, since V saf e i during the maintenance() operation is filled with values, then the content in V i is not more necessary.

The write() operation. When the writer wants to write a value v, it increments its sequence number csn and propagates v and csn to all servers. Then it waits for δ time units (the maximum message transfer delay) before returning. When a server s i delivers a write, it stores v in W i . Then server sends a reply carrying such value to each reading client and broadcast such value as an echo() message to other servers. -----------------------------------operation maintenance() executed every T i = t 0 + i∆ : (6) echo_vals i ← ∅; V i ← V saf e i ; V saf e ← ∅; (7) Set i ← ∅; [START_REF] Bonomi | Optimal mobile byzantine fault tolerant distributed storage[END_REF] for each v, csn , timer j ∈ W i do; [START_REF] Bouzid | Byzantine convergence in robot networks: The price of asynchrony[END_REF] Set i ← Set i ∪ v, csn j ; (10) endFor [START_REF] Buhrman | Optimal resiliency against mobile faults[END_REF] broadcast echo(i, V i ∪ Set i , pending_read i ); ( 12) wait(δ); [START_REF] Charron-Bost | Approximate consensus in highly dynamic networks: The role of averaging algorithms[END_REF] ----------------------------------(15) when select_three_pairs_max_sn(echo_vals i ) = ⊥ (16) insert(V saf e i , select_three_pairs_max_sn(echo_vals i )); [START_REF] Fekete | Asymptotically optimal algorithms for approximate agreement[END_REF] for each (j ∈ (pending_read i ∪ echo_read i )) do [START_REF] Fekete | Asynchronous approximate agreement[END_REF] send reply (i, V saf e ) to c j ; ( 19) endFor ------------------------------------when echo (j, S, pr) is received: [START_REF] Fischer | A lower bound fob the time to assube intebactive consistencv[END_REF] for each ( v, sn j ∈ S) [START_REF] Garay | Reaching (and maintaining) agreement in the presence of mobile faults[END_REF] echo_vals i ← echo_vals i ∪ v, sn j ; ( 22) endFor [START_REF] Lamport | On interprocess communication[END_REF] The read() operation. When a client wants to read, it broadcasts a read() request to all servers and waits 2δ time to collect replies. When it is unblocked from the wait statement, it selects a value v occurring #reply CU M number of times from the reply i set, sends an acknowledgement message to servers to inform that its operation is now terminated and returns v as result of the operation. When a server s i delivers a read(j) message from client c j it first puts its identifier in the set pending_read i to remember that c j is reading and needs to receive possible concurrent updates, then s i sends a reply back to c j . Note that, in the reply() message is carried the result of conCut(V i , V saf e i , W i ). In this case, if the server is correct then V i contains valid values, and V saf e i contains valid values by construction, since it comes from values sent during the current maintenance(). If the server is cured, then V i and W i may contain any value. Thus, considering the function conCut(), a cured server may send a non valid value during 2δ time. Finally, s i forwards a read_fw message to inform other servers about c j read request. This is useful in case some server missed the read(j) message as it was affected by mobile Byzantine agent when such message has been delivered.

timerCheck(W i ); (14) V i ← ∅;
echo_read i ← echo_read i ∪ pr;
When a read_fw(j) message is delivered, c j identifier is added to pending_read i set, as when the read request is just received from the client.

When a read_ack(j) message is delivered, c j identifier is removed from both pending_read i and echo_read i sets as it does not need anymore to receive updates for the current read() operation.

with respect to such parameter are the same as solution to solve the regular register problem. The are no clue about the optimality of γ in those models, but the solution to implement the regular register is optimal with respect to the γ deriving from the maintenance() operations we design.

Correctness (∆S, CU M )

To prove the correctness of P reg we demonstrate that the termination property is satisfied i.e, that read() and write() operations terminates. For the validity property we follow the same four steps as defined in 6.4.4.

Lemma 36 If a correct client c i invokes write(v) operation at time t then this operation terminates at time t + δ.

Proof The claim simply follows by considering that a write_confirmation event is returned to the writer client c i after δ time, independently of the behavior of the servers (see lines 3-4, Figure 6.29).

Lemma 36

Lemma 37 If a correct client c i invokes read() operation at time t then this operation terminates at time t + 2δ.

Proof The claim simply follows by considering that a read() returns a value to the client after 2δ time, independently of the behaviour of the servers (see lines 12-15, Figure 6.30). Proof The proof simply follows from Lemma 36 and Lemma 37.

T heorem 21

Lemma 38 (Step 1.) Let v be the value stored at #echo CU M correct servers s j ∈ Co(T i ), v ∈ V j ∀s j ∈ Co(T i ). Then ∀s c ∈ Cu(T i ) at T i + δ (i.e., at the end of the maintenance()) v is returned by the function select_three_pairs_max_sn(echo_vals i ).

Proof By hypotheses at T i there are #echo CU M correct servers s j storing the same v and running the code in Figure 6.28. In particular each server broadcasts a echo() message with attached the content of V j which contains v (line 11). Messages sent by #echo CU M correct servers are delivered by s c and stored in echo_vals c . The system is synchronous, thus by time T i+δ function select_three_pairs_max_sn(echo_vals c ) returns v.

Lemma 38

Lemma 39 Let s i be a correct server running the maintenance() operation at time T i , then if v is returned by the function select_three_pairs_max_sn(echo_vals i ) there exist a write() operation that wrote such value.

Proof Let us suppose that select_three_pairs_max_sn(echo_vals i ) returns v and there no exist a write()(v ). This means that s i collects in echo_vals i more than #echo CU M occurrences of v coming from cured and Byzantine servers. Let us consider cured servers s c at time T c . At the beginning of the maintenance() operation s c broadcasts values contained in V i and W i (Figure 6.28 line 11). V i is reset at each operation with the content of V saf e i which is reset at each operation (line 6). It follows that s c broadcasts non valid values contained in V i only during the maintenance() operation run a T c . Contrarily, values in W i , depending on k, are broadcast only at T c or also at T c+1 . Let us consider two cases: k = 1 and k = 2. case k = 1: In this case since ∆ ≥ 2δ and the maximum value of the timer associated to a value is 2δ, then each cured server s c broadcasts a non valid value contained in W i only during the first maintenance() operation. Thus, during each maintenance() operation there are f Byzantine servers and f cured servers, those are not enough to send #echo CU M = 2f + 1 occurrences of v . For Lemma 38 this is the necessary condition to return v invoking select_three_pairs_max_sn(echo_vals i ), leading to a contradiction. case k = 2: ∆ ≤ 2δ and the maximum value of the timer associated to a value is 2δ, then each cured server s c broadcasts a non valid value contained in W i during the first and the second maintenance() operations. Thus, each cured server s c broadcast a non valid value contained in W i during two maintenance() operations. Summing up, during each maintenance() operation at time T i there are f Byzantine servers, f cured servers and f servers that were cured during the previous operation. Those servers are not enough to send #echo CU M = 3f + 1 occurrences of v , for Lemma 38 this is the necessary condition to return v invoking select_three_pairs_max_sn(echo_vals i ), leading to a contradiction and concluding the proof.

Lemma 39

From the reasoning used in this Lemma, the following Corollary follow.

Corollary 10

Let s i be a non faulty process and v a value in W i . Such value is in W i during at most k sequential maintenance() operations.

Finally, considering that servers reply during a read() operation with values in W i it follows that servers can be in a cured state for 2δ time.

Corollary 11 Protocol P implements a maintenance() operation that implies γ ≤ 2δ.

Lemma 40 Let T c be the time at which s c become cured. Each cured server s c can reply back with incorrect message to a read() message during a period of 2δ time.

Proof The proof directly follows considering that the content of a reply() message comes from the V c , V saf ec and W i sets. The first one is filled with the content of V saf ec at the beginning of each manteneance() operation and after δ time is reset (cf. Figure 6.28 lines 12-14). The second one is emptied at the beginning of each manteneance() operation and the third one keeps its value during k maintenance() operations (cf. Corollary 10). Thus by time T c + 2δ s c cleans all the values that could come from a mobile agent. Proof Due to the communication channel synchrony, the write messages from c k are delivered by servers within the time interval [t, t + δ]; any non faulty server s j executes the correct algorithm code. When s j delivers write message it executes line 5 Figure 6.29, it stores the value in W j and sets the associated timer to 2δ. For Lemma 11 in the [t, t + δ] time interval there are maximum 2f Byzantine servers, For simplicity, from now on, given a write() operation op W we call t B (op W ) + δ = t wC the completion time of op W , the time at which there are at least #reply CU M servers storing the value written by op W . Lemma 42 (Step 3.) Let op W be a write() operation and let v be the written value. If there are no other write() operations, the value written by op W is stored by all correct servers forever (i.e., v is returned invoking the conCut() function). Proof From Lemma 41 at time t wC there are at least n -2f > #reply CU M correct servers s j that returns v when invoke function conCut(). We consider two cases: δ ≤ ∆ < 2δ (k = 2) and ∆ ≥ 2δ. case 1 δ ≤ ∆ < 2δ: in this case there is a set of 3kf + 1 = 6f + 1 non faulty servers s i such that v ∈ W i . At the beginning of the next maintenance() operation, for Corollary 10 those non faulty servers still have v ∈ W i . Up to f mobile agents move and such set of servers decreases to 5f + 1 ≥ #echo CU M . For Lemma 38 at the end of the maintenance() all non faulty servers return v when invoking select_three_pairs_max_sn(echo_vals i ). Since there are no more write() operation and v is the last written value (i.e., has the highest sequence number), n -f non faulty servers insert v in V saf e i . It follows that cyclically before each mobile agents movements there are f servers more that store v thanks to the maintenance() and f servers that lose v because affected, but the remaining set of non faulty servers is enough to successfully run the maintenance() operation (cf. Lemma 38)) so all correct servers store v. case 2 ∆ ≥ 2δ: let [t, t + δ] be the time interval during which op W took place and let T i be the time at which mobile agent move, two cases may occur, case (2.1)

thus at t + δ v ∈ W j at n -2f = (3k + 2)f + 1 -2f = 3kf + 1 ≥ #reply CU M correct servers if ∆ < 3δ. Otherwise, v ∈ W j at 4f + 1 -2f = 2f + 1 ≥ #reply CU M correct servers if ∆ ≥ 3δ.
T i ∈ [t, t + δ] and case (2.2) T i / ∈ [t, t + δ].
In case (2.1) T i occurs during the write() operation. There are n -2f correct servers s j having v ∈ W j , Figure 6.29, line 5 .Those servers may deliver v before or after T i . In the first case v is broadcast at the beginning of the maintenance() operation (cf. s 4 in the first part in Figure 6.31, Figure 6.28, line 11), v ∈ W j for Corollary 10. In the second case v is broadcast just after the delivery (cf. s 3 in the first part in Figure 6.31, Figure 6.29, line 6), at most v is delivered by time t+δ and hereafter broadcast. It follows that by time t+2δ all non Byzantine servers return v from function select_three_pairs_max_sn(echo_vals i )(). Since there are no more write() operation and v is the last written value (i.e., has the highest sequence number), then v is inserted in V saf e i at all correct servers. Being ∆ ≥ 2δ then t + 2δ < T i+1 , the next mobile agents movement. Finally in case (2.2), since T i / ∈ [t, t + δ] then at t wC there are n -f servers storing v. Which is the same situation that happens in case (2.1) at time t + 2δ < T i+1 . It follows that cyclically before each agent movements there are f servers more that store v thanks to the maintenance() and f servers that lose v because faulty, but this set of non faulty servers is enough to successfully run the maintenance() operation (cf. Lemma 38)) so all correct servers store v. Before to prove the validity property, let us consider how many Byzantine and cured servers can be present during a read() operation that last 2δ, cf. Figure 6.32. If k = 2 there can be up to (k + 1)f = 3f Byzantine servers and 2f cured servers. If k = 1 there can be up to (k + 1)f = 2f Byzantine servers and f cured servers.

Upper Bounds for the (IT B, CU M ) Synchronous model

In this section, we present an optimal protocol P reg with respect to the number of replicas, that implements a SWMR Regular Register in a round-free synchronous system for (IT B, CU M ) and consequently (IT U, CU M ) instances of the proposed MBF model. In this model we use all techniques we used so far, in particular the maintenance() operation needs to be carefully managed. In this model, as for the (∆S, CU M ) model, servers are not aware of their failure state, thus they have to run such operation either they are correct or cured. In addition, in the (IT B, CU M ) model, the moment at which mobile agents move is not known, thus as for the (IT B, CAM ) case, a request-reply pattern is used to implement the maintenance() operation. The read() and write() operations follows the same approach as in the previous models. Table 6.8 reports the parameters for the protocol. In particular n CU M is the bound on the number of servers, #reply CU M is minimum number of occurrences from different servers of a value to be accepted as a reply during a read() operation and #echo CU M is the minimum number of occurrences from different servers of a value to be accepted during the maintenance() operation.

k = 2δ ∆ ≥ 1 n CU M ≥ (5k + 2)f + 1 #reply CU M ≥ (3k + 1)f + 1 #echo CU M ≥ (3k) + 1f k = 2 12f + 1 7f + 1 6f + 1 k = 1 7f + 1 4f + 1 4f + 1 n CU M #reply CU M #echo CU M 3δ ≤ ∆ < 4δ 6f + 1 3f + 1 3f + 1 4δ ≤ ∆ < 5δ 5f + 1 3f + 1 3f + 1 ∆ ≥ 5δ 4f + 1 3f + 1 3f + 1

P reg Detailed Description

The protocol P reg for the (IT B, CU M ) model is described in Figures 6. 33 -6.35, which present the maintenance(), write(), and read() operations, respectively.

Local variables at client c i . Each client c i maintains a set reply i that is used during the read() operation to collect the three tuples j, v, sn sent back from servers. In particular v is the value, sn is the associated sequence number and j is the identifier of server s j that sent the reply back. Additionally, c i also maintains a local sequence number csn that is incremented each time it invokes a write() operation and is used to timestamp such operations monotonically.

Local variables at server s i . Each server s i maintains the following local variables (we assume these variables are initialized to zero, false or empty sets according their type):

• V i : an ordered set containing 3 tuples v, sn , where v is a value and sn the corresponding sequence number. Such tuples are ordered incrementally according to their sn values.

• V saf e j : this set has the same characteristic as V j . The insert(V saf e i , v k , sn k ) function places the new value in V saf e i according to the incremental order and if dimensions exceed 3 then it discards from V saf e i the value associated to the lowest sn.

• W i : is the set where servers store values coming directly from the writer, associating to it a timer, v, sn, timer . Values from this set are deleted when the timer expires or has a value non compliant with the protocol.

• pending_read i : set variable used to collect identifiers of the clients that are currently reading.

• echo_vals i and echo_read i : two sets used to collect information propagated through echo messages. The first one stores tuple j, v, sn propagated by servers just after the mobile Byzantine agents moved, while the second stores the set of concurrently reading clients in order to notify cured servers and expedite termination of read().

• curing i : set used to collect servers running the maintenance() operation. Notice, to keep the code simple we do not explicitly manage how to empty such set since has not impact on safety properties. by the function timerCheck()) and the content of V saf e i , which overrides the content of V i , before to be reset. Then s i choses a random number to associate to such particular maintenance() operation instance 8 , broadcast the echo_req() message and waits 2δ before to restart the operation. In the meantime echo() messages are delivered and stored in the echo_vals i set. When there is value v whose occurrence overcomes the #echo CU M threshold, such value is stored in V saf e i and a reply() message with v is sent to current reader clients (if any). Notice that, contrarily to all the previous models, servers are not aware about their failure state and do not synchronize the maintenance() operation with each other. The first consequence is a that a mobile agent may leave a cured server running such operation with garbage in server variables, making the operation unfruitful. Such server has to wait 2δ to run again the maintenance() operation with clean variables, so that next time it will be effective, which implies γ ≤ 4δ. The write() operation. When the writer wants to write a value v, it increments its sequence number csn and propagates v and csn to all servers. Then it waits for δ time units (the maximum message transfer delay) before returning. When a server s i delivers a write message, it updates W i , associating to such value a timer 4δ. 4δ it is a consequence of the double maintenance() operation that a cured server has to run in order to be sure to be correct. Thus if a server is correct it keeps v in W i during 4δ, which is enough for our purposes. On the other side a cured servers keeps a value (not necessarily coming from a write() operation) no more than the time it is in a cured state, 4δ, which is safe. After storing v in W i , such value is inserted in reply() message to all clients that are currently reading (clients in pending_read i ) to notify them about the concurrent write() operation and to any server executing the maintenance() operation (servers in curing i ). The read() operation. When a client wants to read, it broadcasts a read() request to all servers and waits 2δ time (i.e., one round trip delay) to collect replies. When it is unblocked from the wait statement, it selects a value v invoking the select_value Proof From Lemma 41 at time t wC there are at least n -2f > #reply CU M non faulty servers s j such that v ∈ W i . For sake of simplicity let us consider Figure 6 let v be the written value by such operation and let t wC be its completion time. Then v is in the register (there are #reply CU M correct servers that return it when invoke the function conCut()) up to time at least t B W k+3 .

Proof The proof simply follows considering that:

• for Lemma 50 if there are no more write() operation then v, after t wC , is in the register forever.

• any new written value eventually is stored in an ordered set V saf e and then V (cf. Figure 6.33 line 6 or line 10) whose dimension is three.

• write() operation occur sequentially.

It follows that after three write() operations, op W k+1 , op W k+2 , op W k+3 in V V saf e and W there are three values whose sequence number is higher than the one associated to v, thus by construction conCut() does not return v anymore, v is no more stored in the regular register. T heorem 25 10 Servers where affected in the previous 4δ time period, thus they are still running the two maintenance() operations, that last at most 4δ. the Function n CAM LB described in Table 6.1 with values from Table 6.2 (setting γ = 4δ).

The distance between the two lines is just 1 server. Proof The proof follows from Theorem 14 using the values in Table 6.2 to compute n CU M LB as defined in Table 6.8. We can use such Theorem since does exists a tight protocol that solves Regular Register in the (∆S, CU M ) model so we can apply Lemma 20. From Corollary 12, γ ≤ 4δ. For k ≥ 1, let us consider graphic depicted in Figure 6.37, the two functions are depicted for k increasing, proving that the bound for the protocol is just above, by one server, over the lower bound. For ∆ ≥ 3δ is it enough to substitute values in Table 6.2 to compute n CU M LB concluding the proof.

Theorem 26

Lemma 52

Concluding remarks

In the following tables are reported part of the results found so far. For simplicity we are reporting particular cases for δ ≥ ∆ considering ∆S and IT B movement models.

CAM ∆S

T r = 2δ γ ≤ δ IT B T r = 2δ γ ≤ 2δ δ ≤ ∆ < 2δ n ≥ 4f + 1 n ≥ 4f + 1 2δ ≤ ∆ < 3δ n ≥ 5f + 1 n ≥ 6f + 1 CUM ∆S T r = 2δ γ ≤ 2δ IT B T r = 2δ γ ≤ 4δ δ ≤ ∆ < 2δ n ≥ 5f + 1 n ≥ 7f + 2δ ≤ ∆ < 3δ n ≥ 8f + 1 n ≥ 12f + CAM ∆S T r = 3δ γ ≤ δ ∆ ≥ 3δ n ≥ 3f + 1 CUM ∆S T r = 3δ γ ≤ 2δ IT B T r = 2δ γ ≤ 4δ 3δ ≤ ∆ < 4δ n ≥ 4f + 1 n ≥ 6f + 4δ ≤ ∆ < 5δ n ≥ 4f + 1 n ≥ 5f + ∆ ≥ 5δ n ≥ 4f + 1 n ≥ 4f +
It is interesting to notice that for ∆ ≥ 3δ the Register protocol lower bounds match the lower bounds imposed by the maintenance() operation, respectively n ≥ 3f + 1 for the (∆S, CAM ) model (cf. Lemma 8) and n ≥ 4f + 1 for the (∆S, CU M ) model (cf. Lemma 9). Thus, those bounds are optimal in terms of correct replicas with respect to the optimal maintenance() operation. Interestingly those bounds match also the lower bounds presented in the Round-Based MBF models (Chapter 5). In particular the n ≥ 3f + 1 lower bound for the (∆S, CAM ) model matches the Garay's model lower bound, where cured servers are aware about their failure state as for the ( * , CAM ) model. On the other side, the n ≥ 4f + 1 lower bound for the (∆S, CU M ) model matches the Bonnet's model (and Sasaki's model) lower bound, where cured servers are not aware about their failure state as for the ( * , CU M ) model. Concerning the (IT B, CAM ) models, as we stated, we conjecture that, even for ∆ ≥ 3δ there exists no protocol solving the Regular Register with less than n ≥ 4f +1 replicas. On the other side, for the (IT B, CU M ) models we proposed a protocol solving the regular register for n ≥ 4f + 1 when ∆ > 5δ. Thus, also in this case the protocol for the maintenance() operation is optimal in terms of correct replicas.

Chapter 7

Approximate Agreement in the Round Based Model

In this chapter we address Approximate Agreement problem in the Mobile Byzantine Failure model. Our contribution is three-fold. First, refined the problem specification to adapt it to the Mobile Byzantine Failure environment. Then, we propose the the first mapping from the existing variants of Mobile Byzantine models to the Mixed-Mode faults model.This mapping further help us to prove the correctness of class MSR (Mean-Subsequence-Reduce) algorithms in our context and is of independent interest. We also prove lower bounds for solving Approximate Agreement under all existing Mobile Byzantine faults models

7.1

Mobile Byzantine Approximate Agreement specification.

The Byzantine Approximate Agreement problem has been accurately specified in [START_REF] Lynch | Distributed Algorithms[END_REF]. Here, we adapt such specification to the case of Mobile Byzantine Failures. Informally, in the Byzantine Approximate Agreement, each process starts proposing a real-value input and eventually every correct process decides a real-valued output; given any two correct processes, their decided values can differ for at most , where is the tolerance in the approximation. When considering Mobile Byzantine Failures we have that each process p i can switch between faulty and correct states several times during the computation. Thus, we need to extend the specification of Byzantine Approximate Agreement to Mobile Byzantine Approximate Agreement in order to take into account such aspect. The key point in the extension is to specify that multiple decisions can be taken by the same process due to the fact that its failure state is not permanent. However, every decision taken by a process p i while it is correct must be "consistent" with the others (i.e., the decided value should be at most far from values decided by others correct processes). More formally:

• Eventual -Convergence: There exists a round r such that, for every round r > r, every correct process in r decides a value.

• -Agreement: Let v i and v j be two values decided respectively by p i and p j when they are correct, then v i and v j are within of each other i.e., |v i -v j | ≤ ;

• Validity: Let V be the set of initial values proposed by correct processes at round r 0 and let v min and v max be respectively the minimum and the maximum value in V . Let v i be a value decided by process p i when it is correct then v i must be in the range [v min , v max ].

Lower Bounds

In order to formulate the strongest impossibility results related to Approximate Agreement in the Mobile Byzantine faults model we examine a weaker version of this problem referred in [START_REF] Fischer | Easy impossibility proofs for distributed consensus problems[END_REF] as Simple Approximate Agreement. Each correct node has a real value from [0, 1] as input and chooses a real value. Correct behaviors must satisfy the following properties: Agreement: The maximum difference between values chosen by correct nodes must be strictly smaller than the maximum difference between the inputs, or be equal to the latter difference if it is zero. Validity: Each correct node chooses a value in the range of the inputs of the nodes. We prove lower bounds for each Mobile Byzantine faults models: Garay's (M1), Bonnet's(M2), Sasaki's (M3) and Burhman's (M4). The bounds for the models (M3) and (M4) result from the classical bounds proved in [START_REF] Fischer | Easy impossibility proofs for distributed consensus problems[END_REF] and the mapping defined in 7.3.3. In the case of models (M1) and (M2), since the behavior of cured processes cannot be totally controlled by the Byzantine adversary, specific proofs are needed. Note that the lower bounds below do not concern the class of algorithms whose computations end before the end of the first round and that start in a configuration where there are f Byzantine processes and no cured ones. It is trivial that for this class of algorithms the lower bounds are the same as those proven in [START_REF] Fischer | Easy impossibility proofs for distributed consensus problems[END_REF] (i.e., n ≥ 3f + 1).

Theorem 27 (Lower bound for Garay's model) There is no algorithm that solves Simple Approximate Agreement in the Garay's model (M1) under the Mobile Byzantine faults model if n ≤ 4f .

Proof The proof goes by contradiction. Suppose that there exists an algorithm A verifying the Simple Approximate Agreement properties in the (M1) Mobile Byzantine faults model with n ≤ 4f . Consider w.l.g. a system with four processes and one Byzantine mobile agent. The generalization of the proof can be done by replacing any process with a group of f processes.

Consider the system with four processes denoted p 0 , p 1 , p 2 , p 3 and consider that p0 is occupied by the Byzantine agent while p 1 is cured and p 2 and p 3 are correct processes. Note that the cured process in (M1) model is silent. Consider three executions of A denoted E1, E2 and E3 constructed as follows. In E1 the correct processes propose both the value 0. It follows, from the Agreement and Validy properties of A, that the value chosen by p 1 , p 2 and p 3 should be 0 (independently of the value sent by the Byzantine process, assume it 1). In E2 the correct processes propose both 1. It follows, from the Agreement and Validity properties of A, that the

Theorem 30 (Lower bound for Burhman's model) There is no algorithm that solves Simple Approximate Agreement in the Burhman's model (M4) under the Mobile Byzantine faults model if n ≤ 3f .

Proof The proof follows directly from the lower bound for Simple Approximate Agreement [START_REF] Fischer | Easy impossibility proofs for distributed consensus problems[END_REF] and the mapping defined 7.3.3. Note that in the Burhman's model in each round there are exactly f asymmetric faulty processes.

T heorem 30

Upper Bounds

In this chapter, we prove that the family of Mean-Subsequence-Reduce (MRS) algorithms is able to solve the Mobile Byzantine Approximate Agreement Problem. In order to to that, we will show a mapping between each MBF model presented in Section 7.3.3 and the mixed-fault model considered in [START_REF] Kieckhafer | Reaching approximate agreement with mixed-mode faults. Parallel and Distributed Systems[END_REF] where MSR have been proved to work for a certain mix of Byzantine failure types.

In the following, we first introduce the mixed-fault model presented in [START_REF] Kieckhafer | Reaching approximate agreement with mixed-mode faults. Parallel and Distributed Systems[END_REF], then we provide some background notions and formalization about MRS and then we will show the mapping.

Mixed-fault Model

In [START_REF] Kieckhafer | Reaching approximate agreement with mixed-mode faults. Parallel and Distributed Systems[END_REF], three particular categories of failures have been considered: (i) benign, (ii) symmetric and (iii) asymmetric.

• A process p i is said to be benign faulty if it exposes a self-incriminating, or immediately self-evident fault to all non-faulty processes. An example of benign fault is a crash failure or an omitted reply in a synchronous system. Indeed, given the knowledge about upper bounds on latencies in synchronous systems, such behaviors can be immediately detected by every non-faulty process. .

• A process p i is said to be symmetrically faulty if its behavior is perceived identically by all non-faulty processes. A symmetric fault is generally a malicious fault such as unexpected message broadcast to all processes.

• A process p i is said to be asymmetrically faulty if its behavior may be perceived differently by different non-faulty processes. An asymmetric fault is a classical arbitrary fault such as a broadcast where the sender can send different values to different correct processes.

Background on Mean-Subsequence-Reduce Algorithms

Convergent voting algorithms represent a family of algorithms that can be used to solve the Byzantine Approximate Agreement problem. Convergent voting algorithms start from an initial set of proposed values {v 1 , v 2 , . . . v n } and guarantee that any process p i converges to a value v i satisfying the Byzantine Approximate Agreement specification. In [START_REF] Kieckhafer | Reaching approximate agreement with mixed-mode faults. Parallel and Distributed Systems[END_REF] convergent voting algorithms are called Mean-Subsequence-Reduce (MSR). computation at the beginning of each round. In the following, we will prove that the mobility does not affect the mapping as moving from one round to the following does not alter the proportion of processes in the mixed-fault model. This will allow us to prove that in presence of mobile Byzantine agents the MSR family of algorithms verifies the Byzantine Approximate Agreement specification.

n M i M1 n > 3f + b = 4f M2 n > 3f + 2s = 5f M3 n > 3(f + a) = 6f M4 n > 3f = 3f
In order to do that, we first characterize configurations produced by a MSR algorithm in presence of static Byzantine faulty nodes. Then, we prove that each configuration produced in presence of mobile Byzantine agents has the same characterization. Hence, the mobility of Byzantine agents does not affect the correctness of MSR family. Moreover, we prove that the necessary condition over the number of replicas in [START_REF] Kieckhafer | Reaching approximate agreement with mixed-mode faults. Parallel and Distributed Systems[END_REF] still holds in the Mobile Byzantine failures model with the mapping defined in the previous section.

Preliminaries and Basic Notation

In order to proceed with our proof, we first need to recall some basic notations from [START_REF] Dolev | Reaching approximate agreement in the presence of faults[END_REF][START_REF] Kieckhafer | Reaching approximate agreement with mixed-mode faults. Parallel and Distributed Systems[END_REF]. Let V be a set of values:

• min(V ): is the minimum value of the elements in V ;

• max(V ) is the maximum value of the elements in V ;

• ρ(V ): (also called range of V ) is the interval of real spanned by V (i.e., ρ(V ) = [min(V ), max(V )]);

• δ(V ): (also called diameter of V ) is the difference between the maximum and the minimum values of V (i.e., δ(V ) = min(V ) -max(V ));

• N i r k : is the multi-set of values received by a non-faulty process p i in a given round r k . Let U ⊆ N i r k be the subset of values generated by non-faulty processes In addition, we need to recall the two fundamental properties that allows to prove the correctness of the MSR algorithms family. If n > 3a + 2s + b then the following two properties hold: Property 1 For each non-faulty process p i , the value computed at the end of round r k is in the range of non-faulty values, i.e.,

F M SR (N i r k ) ∈ ρ(U ).
Property 2 For each pair of non-faulty processes p i and p j , the difference between their computed values is strictly less than the diameter of the sub-multiset of nonfaulty values received, i.e.,

|F M SR (N i r k ) -F M SR (N j r k )| < δ(U ).
In the following v i r k denotes the value obtained at the end of round r k (computation phase) by process p i , applying the MSR function vector N i r k (i.e., v i r k ← F M SR (N i r k )) and we will refer to such value as correct value.

Lemma 57 Let T * r k be the set of cured processes at the beginning of round r k in the models M1-M4. If n > n M i and every p j ∈ T * r k executes computation-phase of a MSR-algorithm then at the end of r k we have |T * r k | = 0.

a valid value to the reading client. Finally we proposed an optimal solution for the Approximate Agreement specification in the mobile Byzantine round-based models. Interestingly, concerning the Approximate Agreement, we show how the already existing solutions can be used also in presence of mobile Byzantine failures and under which conditions. Moreover, we found out that, as in the Byzantine failures model, consensus problem and approximate agreement problem share the same lower bounds on the fraction of required correct servers.

Future works. The round-free MBF models presented in this thesis open to several future works. Fundamentally, any known problem solved in presence of Byzantine failures can be studied in presence of Mobile Byzantine failures and nevertheless is it worthy to study the maintenance operation optimality in the different MBF models. From our side, the most immediate future work concerns the Atomic Register problem, which is the last register specification left to be solved. [START_REF] Bonomi | Tight selfstabilizing mobile byzantine-tolerant atomic register[END_REF] considers for the first time both transient failures Besides Registers, the natural consequence of the round-free MBF models definition is the study of Consensus and Approximate Agreement in such models and in particular the study of the necessary conditions to solve those problems. Contrarily to the Approximate Agreement problem, the existence of a process that is always correct is a necessary condition to solve Consensus in the round-based MBF model. Thus the first question to address is if one process always correct is enough in the round-free models or if we need more.

Regarding the MBF model itself another interesting study concerns the possible mapping between mobile Byzantine and churn. Informally, in models prone to churn there is a fraction of processes that leave the system and another fraction that join the system. Join the system means that those processes has to retrieve the state of the other correct processes, exactly what happens for cured processes running the maintenance operation.

Figure 4 . 1 .Figure 4 . 2 .

 4142 Figure 4.1. Example of a run with Garay's MBF model

Figure 4 . 3 .Figure 4 . 4 .

 4344 Figure 4.3. Example of a run with Sasaki's MBF model

Figure 4 . 5 .

 45 Figure 4.5. Example of a (∆S, * ) run with f = 2.

Figure 4 . 6 .

 46 Figure 4.6. Example of a (IT B, * ) run with f = 2.

Figure 4 . 7 .Figure 4 . 8 .

 4748 Figure 4.7. Example of a (IT U, * ) run with f = 2.

Figure 5 . 3 .

 53 Figure 5.3. A reg implementation: code executed by any server s i .

Figure 5 . 4 .

 54 Figure 5.4. A reg implementation: code executed by any client c i for the read() operation.

- Computation Phase of round r ( 4 )Figure 5 . 5 .

 455 Figure 5.5. A reg implementation: code executed by any client c i for the write() operation.

Lemma 2 Lemma 3

 23 Any read() operation eventually terminates.Proof When a reader invokes a read() operation op r at round r, it executes line 1 in Figure5.4 by setting op R _start i = 0 just before entering in the send phase when it sends the read request, let us say at round r + 1. Then op R _start i is set to 1 in the computation phase of r + 1 (line 17, Figure5.4). During the computation phase of round r + 2, c i executes lines 9-15, Figure5.4 returning from the operation and the claim follows.

Lemma 3 Theorem 5 (

 35 Termination) Any operation invoked on the register eventually terminates.

  -5.5 and let n ≥ αf . If α = 3, for each round r A reg implements a MWMR Atomic register in the Garay model.

Figure 5 . 7 . 8 Theorem 9 9 Theorem 10 10 Theorem 11

 57899101011 Figure 5.7. Examples of runs showing in details how operations can be aligned given the round-based nature of the system.

Corollary 4

 4 Let P reg = {A R , A W , A M } be a protocol implementing a safe register in the (∆S, CAM ) Mobile Byzantine Failure Model. Let f > 0 be the number of Byzantine Agents controlled by the external adversary. Any algorithm A M must involve at least one communication step.

Lemma 7

 7 Let P reg = {A R , A W , A M } be a protocol implementing a safe register in the (∆S, CAM ) Mobile Byzantine Failure Model. Let f > 0 be the number of Byzantine Agents controlled by the external adversary. Any algorithm A W must involve at least one communication step.

Lemma 7 Lemma 8

 78 Let f > 0 be the number of Byzantine Agents controlled by the external adversary. If n ≤ 3f then there exists no algorithm A M implementing the maintenance() operation in the (∆S, CAM ) MBF model.

Lemma 8 Lemma 9

 89 Let f > 0 be the number of Byzantine Agents controlled by the external adversary. If n ≤ 4f then there exists no algorithm A M implementing the maintenance() operation in the (∆S, CU M ) MBF model.

T 0

 0 T 1 T 2 T 3 T 4 T 5 T 6 T 7 . . . . . .

Figure 6 . 1 .

 61 Figure 6.1. Representation of S * where mobile agents affect groups of f different servers each T i period. In particular here γ > ∆. The gray rectangles represent the time during which servers are in a cured state.

Figure 6 . 7 .

 67 Figure 6.7. Representation of S * when we consider a (∆S, CU M ) model, in particular t B B(s c ) = t + 2δ -, for > 0 and arbitrarily small.

Lemma 13 Lemma 14

 1314 Let us consider a time interval [t, t+T r ], T r ≥ 2δ and an arbitrarily small number > 0, then in the (∆S, CU M ) model M axCu(t) = R( Tr--Tr ∆ ∆+γ ∆

Lemma 15 Lemma 16

 1516 Let us consider a time interval [t, t+T r ], T r ≥ 2δ and an arbitrarily small number > 0, then in the (∆S, CU M ) model M axSil(t, t + T r ) = Tr--Tr ∆ ∆+γ-δ ∆

Lemma 18 Lemma 19

 1819 Let us consider a time interval[t, t+T r ], T r ≥ 2δ then in the (∆S, CU M ) model then if maxCu(t) > 0 min CBC = Tr--δ ∆ +R( Tr ∆ -γ-δ ∆ )+(M axCu(t)-M axSil(t, t+T r )), otherwise min CBC assumes the same values as in the (∆S, CAM ) case.

  (∆S, CU M ) scenario.

Figure 6 . 8 .

 68 Figure 6.8. (∆S, CAM ) and (∆S, CU M ) scenarios considering 2δ ≤ ∆ < 3δ .

Figure 6 . 10 .

 610 Figure 6.10. (IT B, CAM ) scenario for 2δ ≤ ∆ < 3δ and f = 2.

Figure 6 .

 6 Figure 6.11. A M algorithm implementing the maintenance() operation (code for server s i ) in the (∆S, CAM ) model for δ ≤ ∆ < 3δ.

Figure 6 . 12 .

 612 Figure 6.12. A W algorithm implementing the write(v) operation in the (∆S, CAM ) model for δ ≤ ∆ < 3δ.

Figure 6 . 13 .

 613 Figure 6.13. A R algorithm implementing the read() operation in the (∆S, CAM ) model for δ ≤ ∆ < 3δ.

Figure 6 . 14 .

 614 Figure 6.14. A M algorithm implementing the maintenance() operation (code for server s i ) in the (∆S, CAM ) model for ∆ < δ.

Figure 6 . 15 .

 615 Figure 6.15. A R algorithm implementing the read() operation in the (∆S, CAM ) model for ∆ < δ.

Figure 6 .

 6 Figure 6.16. A M algorithm implementing the maintenance() operation (code for server s i ) in the (∆S, CAM ) model for ∆ ≥ 3δ.

Figure 6 . 17 .

 617 Figure 6.17. A W algorithm implementing the write(v) operation in the (∆S, CAM ) model for ∆ ≥ 3δ.

Figure 6 . 18 .

 618 Figure 6.18. Blue arrows are the write() message delivery, green arrows are the write_fw() messages and orange arrows are the echo() messages sent.

Figure 6 . 19 .

 619 Figure 6.19. Scenario representing case (a) and case (b) for δ ≤ ∆ < 3δ. Blue arrows are the write() message delivery, green arrows are the write_fw() messages sent.

Figure 6 . 20 .

 620 Figure 6.20. Scenario representing case (a) and case (b) for ∆ > 3δ. Blue arrows are the write() message delivery, green arrows are the write_fw() messages sent.

Figure 6 . 21 .

 621 Figure 6.21. The red line is the n CAM function for δ > ∆, (k+ k 2 + 2)f + 1.The blue line is the Function n CAM LB described in Table6.1 with values from Table6.2. The distance between the two lines is just 1 server.

Figure 6 . 22 .

 622 Figure 6.22. The red line is the n CAM LB function for k = 1 and T r ∈ [2δ, . . . , 10δ]. The blue line is the n CAM LB function for k = 2 and T r ∈ [2δ, . . . , 10δ]. The green dots is the n CAM LB function for ∆ ≥ 3δ and T r ∈ [2δ, . . . , 10δ] .

Figure 6 . 23 .

 623 Figure 6.23. A M algorithm implementing the maintenance() operation (code for server s i ) in the (IT B, CAM ) model.

Figure 6 . 24 .

 624 Figure 6.24. A W algorithm implementing the write(v) operation in the (IT B, CAM ) model.

Figure 6 . 25 .

 625 Figure 6.25. A R algorithm implementing the read() operation in the (IT B, CAM ) model.

6. 5 . 3 PFigure 6 . 26 .

 53626 Figure 6.26. The blue line is the Function n CAM LB described in Table6.1 with values from Table6.2. We consider f = 1 and γ = 2δ.

Figure 6 . 27 .

 627 Figure 6.27. The red line is the n CAM function for δ > ∆, 2(k + 2)f + 1. The blue line isthe Function n CAM LB described in Table6.1 with values from Table6.2 (setting γ = 2δ).The distance between the two lines is just 1 server.

Figure 6 . 28 .

 628 Figure 6.28. A M algorithm implementing the maintenance() operation (code for server s i ) in the (∆S, CU M ) model.

Lemma 37 Theorem 21 (

 3721 Termination) If a correct client c i invokes an operation, c i returns from that operation in finite time.

Figure 6 . 34 .

 634 Figure 6.34. A W algorithm implementing the write(v) operation in the (IT B, CU M ) model.

Figure 6 . 37 .

 637 Figure 6.37. The red line is the n CU M function for k ≥ 1, (5k + 2)f + 1. The blue line isthe Function n CAM LB described in Table6.1 with values from Table6.2 (setting γ = 4δ).The distance between the two lines is just 1 server.

  Let n be the number of servers emulating the register and let f be the number of Byzantine agents in the (IT B, CU M ) round-free Mobile Byzantine Failure model. Let δ be the upper bound on the communication latencies in the synchronous system. If n ≥ (5k + 2)f + 1, then P reg implements a SWMR Regular Register in the (IT B, CU M ) round-free Mobile Byzantine Failure model. Proof The proof simply follows from Theorem 24 and Theorem 25.

T heorem 26 Lemma 52

 2652 Protocol P reg is tight in the (IT B, CU M ) model with respect to γ ≤ 4δ.

Table 7 . 1 .

 71 Mapping between the behavior of faulty processes in the Mixed-Mode faulty model and faulty and cured processes in the four Mobile Byzantine faulty models.

Figure 7 . 1 .

 71 Figure 7.1. On the left M1 model and on the right the "Mixed-Mode" Failure model.Processes are colored according to the mapping defined in 7.3.3. V and U are the proposed values sets by all and by correct processes respectively. In both cases, round after round U is shrinking and the computation is carried out by the same fraction of correct processes. What change is that in the first case they change identifiers over the rounds.

  1 and Mobile Byzantine failures in the round based specification. In particular in such failures model the Atomic Register is optimally solved. This open to the study of Register problem in a model prone to both transient failures and round-free Mobile Byzantine failures.

Definition 1 (Valid State at time

  t) Let st i,t be the internal state of a process p i at some time t. st i,t is said to be a valid state at time t if it does exist a fictional process p0 always executing P such that st 0,t = st i,t .

	Definition 2 (

Correct process at time

  t) A process is said to be correct at time t if (i) it is executing its protocol P and (ii) its state is a valid state at time t. We denote as Co(t) the set of correct processes at time t while, given a time interval [t, t ], we denote as Co([t, t ]) the set of all the processes that are correct during the whole interval [t, t ] (i.e., Co([t, t ]) = τ ∈ [t,t ] Co(τ )).

	Definition 3 (

Faulty process at time

  while, given a time interval [t, t ], we denote as B([t, t ]) the set of all the processes that are faulty during the whole interval [t, t ] (i.e., B([t, t ]) = τ ∈ [t,t ] B(τ )).

	Definition 4 (

t) A process is said to be faulty at time t if it is controlled by a mobile Byzantine agent and it is executing a protocol B = P (i.e., it is behaving arbitrarily). We denote as B(t) the set of faulty processes at time t

Cured process at time

  t) A process is said to be cured at time t if (i) it is executing its protocol P and (ii) its state is not a valid state at time t. We denote as Cu(t) the set of cured processes at time t while, given a time interval [t, t ], we denote as Cu([t, t ]) the set of all the processes that are cured during the whole interval [t, t ] (i.e., Cu([t, t ]) = τ ∈ [t,t ] Cu(τ )).

  As in the previous model, agents can move arbitrarily from a server to another at the beginning of each round (i.e., before the send phase starts). Differently from the Garay's model, in both models it is assumed that servers do not know if they are correct or cured when the Byzantine agent moved. The main difference between these two models is that in the (M3) a cured process still acts as a Byzantine one extra round. Example are depicted in Figure4.2 and Figure 4.3 respectively.

• Bonnet et al.'s model [5] (M2) and Sasaki et al.'s model [40] (M3).

• Buhrman's model

[START_REF] Buhrman | Optimal resiliency against mobile faults[END_REF]

(M4). Differently from the previous models, agents move together with the message (i.e., with the send or broadcast operation).

  .Proof The claim simply follows by considering that the Bonnet model is a particular case of Sasaki model, in which cured servers act as less powerful faulty servers, forced to send the same message to all. The same reasoning as in the proof of Theorem 3 is applied.

				Corollary 2
		req rep rep . . . rep
	r 1	r 2	r 3	r t
	s 1		. . .	. . .
	s 2		. . .	. . .
	s 3		. . .	. . .
	s 4		. . .	. . .
	Figure 5.1. Scenario representing the mobile agent movement in execution E 1
		req rep rep . . . rep
	r 1	r 2	r 3	r t
	s 1		. . .	. . .
	s 2		. . .	. . .
	s 3		. . .	. . .
	s 4		. . .	. . .
	Figure 5.2. Scenario representing the mobile agent movement in execution E 2

Table 5 .1. A reg

 5 parameters for the four different Mobile Byzantine Failure models.

	Failure model	Mid α β	Oracle
	Garay [21]	M1 3 2 enabled
	Bonnet et al. [5]	M2 4 2 disabled
	Sasaki et al. [40]	M3 4 2 disabled
	Burhman et al. [11] M4 2 1 enabled

  Let α M i and β M i be the parameters for each of the 4 failure models Mi as reported in Table5.1 and used by the algorithm in Figures 5.3-5.5.

	Lemma 4
	Theorem 6 (Validity)

Let n > α M i f for each failure model, Mi, considered. A read() operation, if it does not overlap any write() operation, returns the last value written before its invocation ( i.e., the value written by the latest completed write() preceding it).

Table 5

 5

.1 and used by the algorithm in

. Let n > α M i f for each failure model Mi considered. There exists a total order S such that (i) any operation invoked on the register belongs to S, (ii) given op and op belonging to S, if op ≺ op , then op appears before op in S and (iii) any read() operation returns the value v written by the last write() preceding it in S.

Table 5

 5

.2. As we can see, with respect to the Consensus problem, are required f fewer servers to solve the Atomic Register problem. This is no true only for the Sasaki's model that requires the same lower bound as the Bonnet's model. Intuitively from the Register point of MBF model Atomic Register tight bound Consensus tight bound Burhman

Table 5 . 2 .

 52 Comparison between lower bounds to solve the Atomic Register and Consensus problems in the round-based MBF models.view, the fact that a cured server sends different non valid values (Sasaki's model) or the same (Bonnet's model) has not affect on the solution. Roughly speaking, the maintenance() operation act as a Consensus algorithm where all correct servers propose the same value. Concerning the read() operation, it is transparent the fact that a cured server can send the same non valid value or different non valid values since it is interacting only with one client per time.

Definition 10 (Failure State of servers in a time interval

  B (op R ), t E (op R )) is the set containing all servers that have been Byzantine for at least one time unit during op R . Similarly, Co(t B (op R ), t E (op R )) and Cu(t B (op R ), t E (op R )) are the sets containing all servers that have been Correct and Cured respectively, for at least one time unit during op R . In the following, we define two additional sets: (i) the set of servers that during op R contribute sending to the client both correct and incorrect replies and (ii) the set of servers that during op R do not reply at all. Let [t, t + T r ] be time a interval such that in the given scenario | B(t, t + T r )| = M ax B(t, t+T r ). In particular we have that in the time interval[t , t +T r ], | B(t , t +T r )| = M ax B(t, t+T r ). While in the time interval [t , t +T r ], | B(t , t +T r )| < M ax B(t, t+T r ).

	t	t + 3δ	t	t + 3δ
	s 0
	s 1
	s 2
	s 3
	Figure 6.2.

) Let [t, t + T t ] be a time interval and let t , t > 0, be a time instant. Let s i be a server and state i be s i state, state i ∈ {correct, cured, Byzantine}. Let S(t ) be the set of servers s i that are in the state state i at t , S(t ) ∈ {Co(t ), Cu(t ), B(t )}. S(t, t + T r ) is the set of servers that have been in the state state i for at least one time unit during [t, t + T r ]. More formally, S(t, t + T r ) = t≤t ≤t+Tr S(t ). For instance, let op R be a read() operation, B(t Definition 11 ( CBC(t, t + T r )) Let [t, t + T r ] be a time interval, CBC(t, t + T r ) denotes servers that during a time interval [t, t + T r ] belong first to B(t, t + T r ) or Cu(t) (only in ( * , CU M ) model) and then to Co(t + δ, t + T r -δ) or vice versa. In particular let us denote: • BC(t, t + T r ) servers that during a time interval [t, t + T r ] belong to B(t, t + T r ) or Cu(t) (only in ( * , CU M ) model) and to Co(t + δ, t + T r -δ). • CB(t, t + T r ) servers that during a time interval [t, t + T r ] belong to Co(t + δ, t + T r -δ) and to B(t, t + T r ). Definition 12 (Sil(t, t + T r )) Let [t, t + T r ] be a time interval. Sil(t, t + T r ) is the set of servers in Cu(t, t + T R -δ).

  Definition 14 (M axSil(t, t + T r )) Let S be a scenario and [t, t+T r ] a time interval. The cardinality of Sil S (t, t + T r ) is maximum with respect to S if for any t , t ≥ 0 we have that |Sil(t, t + T r )| ≥ |Sil(t , t + T r )| and B(t, t + T r ) = M ax B(t, t + T r ). Then we call the value of such cardinality as M axSil S (t, t + T r ). If we consider only Let us consider the time instant t and the depicted scenario such that |Cu(t)| = M axCu(t). In particular, in this case |Cu(t )| = M axCu(t) and |Cu(t )| < M axCu(t).

	t	t + 3δ	t	t + 3δ
	s 0
	s 1
	s 2
	s 3
	Figure 6.3.

Definition 16 (min Co

  (t, t + T r )) Let S be a scenario and [t, t + T r ] be a time interval then min CS (t, t + T r ) denotes the minimum number of correct servers during a time interval [t + δ, t + T r -δ]. If we consider only one scenario per time then we can omit the subscript related to it and write directly min C(t, t + T r ). Notice that we are not interested in servers that are always correct during the read() operation op R , but in servers that surely can reply. A reply sent before t E (op R ) -δ is for sure delivered by client. Figure 6.4 depicts a scenario where during the both intervals [t , t + T r ] and [t , t + T r ] the number of correct servers is minimum. Definition 17 (min CBC(t, t + T r )) Let [t, t+T r ] be a time interval then min CBC(t, t+ T r ) denotes the minimum number of servers that during a time interval [t, t + T r ] belong first to B(t, t + T r ) or Cu(t) (only in (IT B, CU M ) model) and then to Co(t + δ, t + T r -δ) or vice versa and B(t, t + T r ) = M ax B(t, t + T r ). Let [t, t+T r ] be a time interval such that in the depicted scenario | Co(t, t+T r )| = min Co(t, t + T r ). Then in both time intervals [t , t + T r ] and [t , t + T r ] we have that | Co(t , t + T r )| = | Co(t , t + T r )| = min Co(t, t + T r ).

	t	t + 3δ	t	t + 3δ
	s 0
	s 1
	s 2
	s 3
	Figure 6.4. s 0 t	t + 3δ	t	t + 3δ
	s 1
	s 2
	s 3
	In particular let us denote as:

Figure 6.5. Let [t, t+T r ] a time interval such that in the depicted scenario CBC(t, t+T r ) = min CBC(t, t+T r ). Then CBC(t , t +T r ) > min CBC(t, t+T r ) and CBC(t , t +T r ) = min CBC(t, t + T r ). • min BC(t, t + T r ) the minimum number of servers that during a time interval [t, t + T r ] belong to B(t, t + T r ) or Cu(t) (only in (IT B, CU M ) model) and to Co(t + δ, t + T r -δ). • min CB(t, t + T r ) the minimum number of servers that during a time interval [t, t + T r ] belong to Co(t + δ, t + T r -δ) and to B(t, t + T r ).

Definition 19 (minReplies_Co(t, t

  Definition 18 (M axReplies_N Co(t, t + T r ) k ) Let M axReplies_N Co(t, t + T r ) k be the multi-set maintained by client c k containing m ij elements, where m ij is the i -th message delivered by c k and sent at time t , t ∈ [t, t + T r ] by s j such that s In the worst case scenario, during a read operation lasting T r ≥ 2δ issued by client c i , c i delivers M ax B(t, t + T r ) incorrect replies in the ( * , CAM ) model and M ax B(t, t + T r ) + M axCu(t) incorrect replies in the ( * , CU M ) model . + T r ) k ) Let minReplies_Co(t, t + T r ) k be the multi-set maintained by client c k containing m ij elements, where m ij is the i -th message delivered by c k and sent at time t , t ∈ [t, t + T r ] by s j such that s j ∈ Co(t ). Note that correct replies come from servers that (i) have never been affected during the time interval [t, t+T r ], or (ii) where in a cured state at t but do not belong to the Sil(t, t + T r ) set, or (iii) servers that reply both correctly and incorrectly. The next Corollary follows. In the worst case scenario, during a read operation lasting T r ≥ 2δ issued by client c i , c i delivers n-(M ax B(t, t+T r )+M axSil(t, t+T r ))+min CBC(t, t+ T r ) correct replies in the (∆S, CAM ) model and n -[M ax B(t, t + T r ) + M axCu(t)] + min CBC(t, t + T r ) correct replies in the (∆S, CU M ) model.

	Corollary 6

j / ∈ Co(t ).

Considering the definitions of both M ax B(t, t + T r ) and M axCu(t) the next Corollary follows:

Corollary 5

Table 6 . 1 .

 61 be the number of messages delivered by c i during op, then M axReplies_N Co(t, t + T r ) k contains x mod n messages m ij whose occurrences is x At this point we can compute how many correct and incorrect replies a client c k can deliver in the worst case scenario during a time interval [t, t + T r ]. Trivially, c k in order to distinguish correct and incorrect replies needs to get minReplies_Co(t, t + T r ) k > M axReplies_N Co(t, t + T r ) k . It follows that the number of correct servers n CAM LB [2M ax B(t, t + Tr) + M axSil(t, t + Tr) -min CBC(t, t + Tr)]f n CU M LB [2(M ax B(t, t + Tr) + M axCu(t, t + Tr)) -min CBC(t, t + Tr)]f How to compute the number of replicas in each model. has to be enough to guarantee this condition. Table 6.1 follows directly from this observation. In a model with b Byzantine (non mobile) a client c i requires to get at least 2b + 1 replies to break the symmetry and thus n ≥ 2b + 1. In presence of mobile Byzantine we have to sum also servers that do not reply (silent) and do not count twice servers that reply with both incorrect and correct values. Theorem 14 If n < n CAM LB (n < n CU M LB ) as defined in Table 6.1, then there not exists a protocol P reg solving the safe register specification in (∆S, CAM ) model ((∆S, CU M ) model respectively). Let us suppose that n < n CAM LB (n < n CU M LB ) and that protocol P reg does exist. If a client c i invokes a read operation op, lasting T r ≥ 2δ time, if no write operations occur, then c i returns a valid value at time t B (op). Let us consider an execution E 0 where c i invokes a read operation op and let 0 be the valid value at t

	Proof

n + 1 and (n -x (mod n)) messages whose occurrences is x n . B (op). Let us assume that all Byzantine severs involved in such operation reply once with 1. From Corollaries 5 and 6, c i collects M axReplies_N Co(t, t + T r ) i occurrences of 1 and minReplies_Co(t, t + T r ) i occurrences of 0. Since P reg exists and no write operations occur, then c i returns 0. Let us now consider a another execution E 1 where c i invokes a read operation op and let 1 be the valid value at t B (op). Let us assume that all Byzantine severs involved in such operation replies once with 0. From Corollaries 5 and 6 and Corollary 7 and Corollary 8, c i collects M axReplies_N Co(t, t+T r ) i occurrences of 0 and minReplies_Co(t, t+T r ) i occurrences of 1. Since P reg exists and no write operations occur, then c i returns 1.

0

  Lemma[START_REF] Charron-Bost | Approximate consensus in highly dynamic networks: The role of averaging algorithms[END_REF] Let us consider a time interval [t, t + T r ], T r ≥ 2δ and an arbitrarily small number > 0, then in fthe (∆S, CAM ) model M axCu(t) = R( γ-∆+ Representation of S * when we consider a (∆S, CAM ) model, in particular t E B(s 1 ) = t + , for > 0 and arbitrarily small.

	s -2=-c	t	t + 2δ	. . .
	s 1
		s 2
	s -1		s 3=b
	Figure 6.6. s -2=-c	t	t + 2δ	. . .
	s 1
		s 2
	s -1		s 3=b

∆

).

Proof As we defined, s -1 is the most recent server that entered in a cured state, with respect to the considered time interval. Intuitively each s -j is in Cu(t) if t E Cu(s -j ) > t. Considering that t E Cu(s -j ) -t E Cu(s -j-1 ) = ∆ then the number

Table 6 . 2 .

 62 Values for a general read() operation that terminates after T r time.

  and min CBC = 1 (cf. Lemma

			t	t + 2δ
	t	t + 2δ	s 0
	s 0		s 1
	s 1		s 2
	s 2		s 3
	s 3		s 4
	s 4		s 5
	(a) (∆S, CAM ) scenario.

(b) (∆S, CU M ) scenario.

Figure 6.9. (∆S, CAM ) and (∆S, CU M ) scenarios considering δ ≤ ∆ < 2δ .

17). In particular, s 0 , s 1 and s 3 incorrectly reply, contrarily to s 3 and s 4 . Moreover s 2 is correct before t + δ, thus reply correctly as well. Thus, considering the reasoning in Theorem 14 we have that for n = 5 we can build two indistinguishable executions. In case (b) we consider the (∆S, CU M ) model. In such case we have M ax B(t, t+2δ) = 3 (cf.

Lemma 11)

, M axCu(t) = 1 (cf.

Lemma 14)

, M axSil(t, t + 2δ) = 0 (cf.

Lemma 16)

and min CBC = 2 (cf.

Lemma 19)

. s 1 , s 2 , s 3 and s 4 incorrectly reply, contrarily to s 0 and s 5 . Moreover s 4 is correct before t + δ and s 1 complete the maintenance() operation before t + δ, thus both reply correctly as well. Thus, considering the reasoning in Theorem 14 we have that for n = 6f we can build two indistinguishable executions.

Table 6 . 3 .

 63 Parameters for P Rreg Protocol in the (∆S, CAM ) model for δ ≤ ∆ < 3δ.

Table 6 . 4

 64

. Parameters for P Rreg Protocol in the (∆S, CAM ) model for ∆ < δ.

Table 6 . 5 .

 65 Parameters for P Rreg Protocol in the (∆S, CAM ) model for ∆ ≥ 3δ.

Table 6 . 6 .

 66 Parameters for P Rreg Protocol in the (IT B, CAM ) model.

Lemma 31 Lemma 32 (Step 2.) Let

  op W be a write(v) operation invoked by a client c k at time t B (op W ) = t then at time t+δ there are at least #reply CAM servers s j / ∈ B(t+δ)

  Let op W 0 , op W 1 , . . . , op W k-1 , op W k , op W k+1 , . . . be the sequence of write() operations issued on the regular register. Let us consider a particular op W k , let v be the value written by op W k and let t E w k be its completion time. Then the register stores v (there are at least #reply CAM correct servers storing it) up to time at least t B W k+3 .

	Lemma 33
	Lemma 34 (Step 3.)

  Any read() operation returns the last value written before its invocation, or a value written by a write() operation concurrent with it.Proof Let us consider a read() operation op R . We are interested in the time interval[t B (op R ), t B (op R ) + δ].Since such operation lasts 2δ, the reply messages sent by correct servers within t B (op R )+δ are delivered by the reading client. For 0 < ∆ < 4δ during [t, t + δ] time interval there are n -k 2 -1 ≥ #reply CAM correct servers that have the time to deliver the read request and reply. Now we have to prove that what those correct servers reply with is a valid value. There are two cases, op R is concurrent with some write() operations or not.

	Lemma 34
	Theorem 19 (Step 4.)

  .6 then P reg implements a SWMR Regular Register in the (IT B, CAM ) and (IT U, CAM ) round-free Mobile Byzantine Failure model.

Table 6 . 7 .

 67 Parameters for P Rreg Protocol in the (∆S, CU M ).

  Blue arrows are the write() message delivery, orange arrows are the write_fw() messages sent. Blue dots are the time at which servers return v invoking select_three_pairs_max_sn(echo_vals i ).

	write() t wC	write()	t wC
	T i	T i
	s 0	s 0
	s 1	s 1
	s 2	s 2
	s 3	s 3
	s 4	s 4
	s 5	s 5
	Figure 6.31.
			Lemma 40

Lemma 41 (Step 2.) Let op W be a write(v) operation invoked by a client c k at time t B (op W ) = t then at time t + δ there are at least n -2f ≥ #reply CU M non faulty servers s j / ∈ B(t, t + δ) such that v ∈ W i and is returned by the function concCut().

  Since write() operations are sequential, during [t, t + δ] there is only one new value inserted in W i , which is returned by the function conCut() by construction.

	Lemma 41

Lemma 42 Lemma 43 (Step 3.) Let

  op W 0 , op W 1 , . . . , op W k-1 , op W k , op W k+1 , . . . be the sequence of write() operation issued on the regular register. Let us consider a generic op W k , let v be the written value by such operation and let t wC be its completion time. Then v is in the register (there are #reply CU M correct servers storing it) up to time at least t B W k+3 .

			s 0
			s 1
	t	t + 2δ	s 2
	s 0		s 3
	s 1		s 4
	s 2		s 5
	s 3		s 6	. . .
	s 4		s 7
	s 5		s 8
	Proof The proof simply follows considering that:
	• for Lemma 42 if there are no more write() operation then v, after t wC , is in
	the register forever;
	• any new written value eventually is stored in ordered set V saf e , whose dimension
	is 3;
	• write() operation occur sequentially.

t t + 2δ Figure 6.32. In the first scenario ∆ ≥ 2δ and in second one is ∆ ≥ δ.

It follows that after 3 write() operations, op W k+1 , op W k+2 , op W k+3 , v is no more stored in the regular register.

Lemma 43

Theorem 22 (Step 4.) Any

  read() operation returns the last value written before its invocation, or a value written by a write() operation concurrent with it.Proof Let us consider a read() operation op R . We are interested in the time interval [t B (op R ), t B (op R ) + δ]. The operation lasts 2δ, thus reply messages sent by correct servers within t B (op R ) + δ are delivered by the reading client. For 0 < ∆ < 4δ during [t, t + δ] time interval there are n -k 2 -1 ≥ #reply CU M correct servers that have the time to deliver the read request and reply. Now we have to prove that what those correct servers reply with is a valid value. There are two cases, op R is concurrent with some write() operations or not. op R is not concurrent with any write() operation. Let op W be the last write() operation such that t E (op W ) ≤ t B (op R ) and let v be the last written value. For Lemma 42 after the write completion time t wC there are at least #reply CU M correct servers storing v (i.e., v ∈ conCut(V i , V saf e i , W i ). Since t B (op R ) + δ ≥ t C w, then there are #reply CU M correct servers replying with v. So the last written value is returned.op R is concurrent with some write() operation. Let us consider the timeinterval [t B (op R ), t B (op R ) + δ].In such time there can be at most three write() operations. Thus for Lemma 43 the last written value before t B (op R ) is still present in #reply CU M correct servers. At least the last written value is returned. To conclude, for Lemma 40 Byzantine and cured servers can no force correct servers to store and thus to reply with a never written value. Only cured and Byzantine servers can reply with non valid values. As we stated, if k = 1 there are up to 3f non correct servers. If k = 2 there are 5f non correct servers. In both cases the threshold #reply CU M is higher than the occurrences of non valid values that a reader can deliver. Mobile agents can not force the reader to read another or older value and even if an older values has #reply CU M occurrences the one with the highest sequence number is chosen.Theorem 23Let n be the number of servers emulating the register and let f be the number of Byzantine agents in the (∆S, CU M ) round-free Mobile Byzantine Failure model. Let δ be the upper bound on the communication latencies in the synchronous system. If (i) ∆ ≥ δ and (ii) n follows values listed in Table6.7, then P reg implements a SWMR Regular Register in the (∆S, CU M ) round-free Mobile Byzantine Failure model. Proof The proof simply follows from Theorem 21 and Theorem 22. Lemma 44 Protocol P reg for ∆ ≥ δ is tight with respect to γ ≤ 2δ.Proof The proof follows from Theorem 14 using the values in Table6.2 to compute n CU M LB as defined in Table6.1. From Lemma 38 and Corollary 11 we can set γ ≤ 2δ. In particular if ∆ ≥ δ then lower bounds are respectively 8f if k = 1 and 5f if k = 2, whose match n CU M = (3k + 2)f + 1. Finally 4f if ∆ ≥ 3δ matches the lower bound for the (∆S, CU M ) model (cf. Lemma 9), concluding the proof.

	T heorem 22
	T heorem 23
	Lemma 44

Table 6 . 8 .

 68 Parameters for P Rreg Protocol for the (IT B, CU M ) model.

  .[START_REF] Ostrovsky | How to withstand mobile virus attacks[END_REF]. Let us consider that:• for Lemma 49, all non faulty servers s i have v in W i at most at t wC ;• when s i runs the next maintenance(), at the end of such operation, v is returned by select_three_pairs_max_sn(echo_vals i ) function and since it is the value with the highest sequence number (there are no other write() operation) then v is inserted in V saf e i (cf. Figure6.33 line 10), thus such value is present in the ECHO() message replies for the next 2δ time;• this is trivially true up to time t = t + 4δ, for the timer associated to each v in W i . In [t, t ] there are 2k + 1 Byzantine servers, thus v ∈ W j at n -(2k + 1) non faulty servers, and n -(2k + 1) = (3k + 1)f + 1 = #reply CU M ≥ #echo CU M ; operation terminates with such value. If the situation is mixed, then servers type B, when run op M -1 , deliver echo() messages from both type A and type B servers. Thus if there are enough occurrence of v they can store v ∈ V saf e b and during op M 1 v ∈ V b . During such operation both servers type A and type B have vinV . Again, if there are enough occurrences of v, the operation ends with v ∈ V saf e b . It follows that servers type A, when run op M 1 delivers echo() messages containing v from both type A and type B servers. During the time interval [t , t + 2δ] there are k correct servers that are affected by mobile agent, cf. Figure6.36, s 5 and s 6 . At the same time there is server s 0 , type A, that terminate its maintenanace() with v ∈ V saf e 0 , and thus compensates s 5 , allowing s 1 , type B, to terminate the maintenanace() operation with v ∈ V saf e 1 , which compensates s 6 . This cycle, between type A and type B servers can be extended forever. By hypothesis there are no more write() operation, thus all correct servers have v ∈ V saf e or V , and v is returned when servers invoke function conCut(). Let op W 0 , op W 1 , . . . , op W k-1 , op W k , op W k+1 , . . . be the sequence of write() operation issued on the regular register. Let us consider a generic opW k , V saf e 0 v ∈ V saf e 1 op M -1 op M 1 op M -1 op M 1Figure 6.36. maintenance() operation op M1 analysis after a write() operation, t = t + 4δ.White rectangles are maintenance() operation run by correct servers. In particular s 10 runs such operation during the first δ period after t , while s 1 1 runs it during the second δ period.

	write(v)
	s 0
	s 1
	s 2
	s 3
	s 4
	s 5
	s 6
	s 7	. . .
	s 8
	s 9
	s 10
	s 11
	s 12
	s 13
		Lemma 50

• for each non faulty server the next maintenance() operation op M can happen either in [t , t + δ] or in [t + δ, t + 2δ] (cf. Figure 6.36)s 10 and s 11 respectively: t B (op M ) ∈ [t , t + δ] (cf. s 10 Figure 6.36): s 10 starts op M 1 before t + δ, let us name it server type A. This means that t B (op M -1 ) + δ < t -δ, thus for Lemma 48, at the end of the operation v ∈ V saf e 10 and during op M 1 v ∈ V 10 ; t B (op M ) ∈ [t + δ, t + 2δ] (cf. s 11 Figure 6.36): s 11 starts op M 1 after t + 2δ let us name it server type B. This means that t B (op M -1 ) + δ > t , thus at the end of the operation we can not say that v ∈ V saf e 1 0 but at least during op M -1 v ∈ V 11 . If all non faulty servers are type A, during op M 1 all non faulty servers have v ∈ V and insert v in the echo() message. The same happens if all non faulty servers are type B, during op M -1 , all of them inter v in the echo() message and the maintenance() Lemma 51 (Step 3.) t v ∈ V saf e 5 v ∈ V saf e 6 v ∈ V saf e 7 v ∈ V saf e 8 v ∈ V saf e 9 v ∈ V saf e 10 v ∈ V saf e 11 v ∈ V saf e 12 v ∈ V saf e 13 t + 2δ v ∈

  Proof Let us consider a read() operation op R . We are interested in the time interval [t B (op R ), t B (op R ) + δ]. Since such operation lasts 2δ, the reply messages sent by correct servers within t B (op R ) + δ are delivered by the reading client. During [t, t + δ], for Lemma 47 there are at least #reply CU M correct servers that reply. Now we have to prove that what those correct servers reply with is a valid value. There are two cases, op R is concurrent with some write() operations or not.op R is not concurrent with any write() operation. Let op W be the last write() operation such that t E (op W ) ≤ t B (op R ) and let v be the last written value. For Lemma 50 after the write completion time t wC there are at least #reply CU M correct servers storing v (i.e., v ∈ conCut(V j , V saf e j )). Since t B (op R ) + 2δ ≥ t C w, then there are #reply CU M correct servers replying with v (cf. Lemma 47), by hypothesis there are no further write() operation and v has the highest sequence number. It follows that the last written value v is returned.op R is concurrent with some write() operation. Let us consider the time interval [t B (op R ), t B (op R ) + δ]. In such time there can be at most two write() operations. Thus for Lemma 51 the last written value before t B (op R ) is still present in #reply CU M correct servers and all of them reply (cf. Lemma 47) thus at least the last written value is returned. To conclude, for Lemma 11, during the read() operation there are at most (k + 1)f Byzantine servers and 2k cured servers 10 , being #reply CU M = (3k + 1)f + 1 > (3k + 1)f then Byzantine servers may not force the reader to read another or older value and even if an older values has #reply CU M occurrences the one with the highest sequence number is returned, concluding the proof.

Lemma 51

Theorem 25 (Step 4.) Any read() operation returns the last value written before its invocation, or a value written by a write() operation concurrent with it.

Table 7 . 2 .

 72 Number of required replicas in each failure model.

  1 .

				V							V
					U						U
							p 2 vectors
	r 1	p 0	p 1	p 2	p 3	p 4	V	U	p 0	p 1	p 2	p 3	p 4
	r 2	p 0	p 1	p 2	p 3	p 4		U	p 0	p 1	p 2	p 3	p 4
	r 3	p 0 p 0	p 1 p 1	p 2 p 2	p 3 p 3	p 4 p 4		U	p 0 p 0	p 1 p 1	p 2 p 2	p 3 p 3	p 4 p 4
	r k	. . .	. . .	. . .	. . .	. . .			. . .	. . .	. . .	. . .	. . .

Related Work

If the protocol defines the write completion predicate so that completion can be determined locally by a writer and all writes eventually completes.

Let us note that such an operation can also be embedded in the other algorithm. However, for the sake of clarity, we consider here only protocols where valid state recovery is managed by a specific operation.

In Garay's model s2 is aware of being cured, so it can ignore its own value.

Recall that such write() message is sent by the writer client in the send phase of the first round starting after the write() invocation and it is delivered by any non-faulty server in the same round.

Let us note that such an operation can also be embedded in the other algorithm. However, for the sake of clarity, we will consider here only protocols where valid state recovery is managed by a specific operation.

The exact number of processes is given by the implementation of AW algorithm. In any case, such number does not affect the proof and it must be at least one.

Results on safe register can be directly extended to the other register specifications.

Consider Figure6.6, s2 is the most recent server that entered in the cured state. This is the server that spend more time in such state with respect to the others. It follows that other servers are in a cured state if during this time interval there is enough time for a "jump"

Is it out of the scope of this work to describe such function, we assume that Byzantine server can not predict the random number chosen next. The aim of such number is to prevent Byzantine servers to send reply to maintenance() operations before their invocation, or, in other words, it prevents correct servers to accept those replies.

We prove hereafter that γ ≤ 4δ, but to prove it we have first to prove that the maintenance() lasts 2δ time.

Since the communication graph is fully connected then this set is equal for any correct process

Local variables of any process can be arbitrarily modified[START_REF] Dolev | Self-Stabilization[END_REF]. It is nevertheless assumed that transient failures are quiescent i.e., there exists a time (unknown to the processes) after which no more transient failures are going to happen.

========= Client code ========== operation write(v):

(1) csn ← csn + 1;

(2) broadcast write(v, csn);

(3) wait (δ); (4) return write_confirmation;

========= Server code ========== when write(v, csn) is received:

(5) W i ← W i ∪ v, csn , setT imer(2δ) ; [START_REF] Bonomi | Tight selfstabilizing mobile byzantine-tolerant atomic register[END_REF] broadcast echo(i, v, csn , pending_read i ); [START_REF] Bonomi | Approximate agreement under mobile byzantine faults[END_REF] for each j ∈ (pending_read i ∪ echo_read i ) do [START_REF] Bonomi | Optimal mobile byzantine fault tolerant distributed storage[END_REF] send reply (i, { v, csn }); (9) endFor (1) reply i ← ∅;

(2) broadcast read(i);

(3) wait (2δ); (4) v, sn ← select_value(reply i ); [START_REF] Bonnet | Tight bound on mobile byzantine agreement[END_REF] broadcast read_ack(i); (6) return v; -----------------------when reply (j, V _set) is received: [START_REF] Bonomi | Approximate agreement under mobile byzantine faults[END_REF] for each ( v, sn ∈ V _set) do [START_REF] Bonomi | Optimal mobile byzantine fault tolerant distributed storage[END_REF] reply i ← reply i ∪ { j, v, sn }; (9) endFor ========= Server code ========== when read (j) is received: [START_REF] Bouzid | Optimal byzantineresilient convergence in uni-dimensional robot networks[END_REF] pending_read i ← pending_read i ∪ {j}; [START_REF] Buhrman | Optimal resiliency against mobile faults[END_REF] send reply (i, conCut(V i , V saf e i , W i )); [START_REF] Cachin | Optimal resilience for erasure-coded byzantine distributed storage[END_REF] broadcast read_fw(j); ------------------------when read_fw (j) is received: (13) pending_read i ← pending_read i ∪ {j}; ------------------------when read_ack (j) is received: [START_REF] Denning | An intrusion-detection model[END_REF] pending_read i ← pending_read i \ {j}; [START_REF] Dolev | Reaching approximate agreement in the presence of faults[END_REF]

P reg for δ > ∆

From Corollary 4, maintenance() operation can not last less than δ time. When δ > ∆, during such operation Byzantine agent movements may occur and contrarily to the (∆S, CAM ) model, servers are not aware of their failure state. Thus servers can not trigger maintenance() operation when they enter in a cured state and neither at each agent movements, they have to trigger it by themselves periodically. As we already declared, the maintenance() operation is not the main scope of such work, thus in such case we propose the same maintenance() implementation in both (∆S, CU M ) for δ > ∆ and (IT B, CU M ) models (cf. 6.7). In such case the resulting curing time γ ≤ 4δ. Being γ the same in both cases, this implies that lower bounds operation timerCheck(W i ) executed while (true) :

(1) for each ( v, csn , timer j ∈ W i ) do [START_REF] Attiya | Sharing memory robustly in message-passing systems[END_REF] if (Expires(timer) ∧ (timer > 4δ)) [START_REF] Banu | An improved byzantine agreement algorithm for synchronous systems with mobile faults[END_REF] W i ← W i \ v, csn , timer j ; (4) endif (5) endFor - -----------------------------------operation maintenance() executed while (true) : (6) echo_vals i ← ∅; V i ← V saf e i ; V saf e ← ∅; [START_REF] Bonomi | Approximate agreement under mobile byzantine faults[END_REF] rand ← new_rand(); [START_REF] Bonomi | Optimal mobile byzantine fault tolerant distributed storage[END_REF] broadcast echo_req(i, rand); [START_REF] Bouzid | Byzantine convergence in robot networks: The price of asynchrony[END_REF] wait(2δ); ----------------------------------when select_three_pairs_max_sn(echo_vals i ) = ⊥ (10) insert(V saf e i , select_three_pairs_max_sn(echo_vals i )); [START_REF] Buhrman | Optimal resiliency against mobile faults[END_REF] for each (j ∈ (pending_read i ∪ echo_read i )) do [START_REF] Cachin | Optimal resilience for erasure-coded byzantine distributed storage[END_REF] send reply (i, V saf e ) to c j ; (13) endFor ------------------------------------when echo (j, S, pr, r) is received: [START_REF] Denning | An intrusion-detection model[END_REF] if (rand = r)then: [START_REF] Dolev | Reaching approximate agreement in the presence of faults[END_REF] echo_vals i ← echo_vals i ∪ v, sn j ; ( 16) In order to simplify the code of the algorithm, let us define the following functions:

• select_three_pairs_max_sn(echo_vals i ): this function takes as input the set echo_vals i and returns, if they exist, three tuples v, sn , such that there exist at least #echo CU M occurrences in echo_vals i of such tuple. If more than three of such tuples exist, the function returns the tuples with the highest sequence numbers.

• select_value(reply i ): this function takes as input the reply i set of replies collected by client c i and returns the pair v, sn occurring occurring at least #reply CU M times. If there are more pairs with the same occurrence, it returns the one with the highest sequence number.

• conCut(V i , V saf e i , W i ): this function takes as input three 3 dimension ordered sets and returns another 3 dimension ordered set. The returned set is composed by the concatenation of V saf e i • V i • W i , without duplicates, truncated after the first 3 newest values (with respect to the timestamp). e.g.,

The maintenance() operation. Such operation is executed by servers every 2δ times. Each time s i resets its variables, except for W i (that is continuously checked function on reply i set, sends an acknowledgement message to servers to inform that its operation is now terminated and returns v as result of the operation.

When a server s i delivers a read(j) message from client c j it first puts its identifier in the set pending_read i to remember that c j is reading and needs to receive possible concurrent updates, then s i sends a reply back to c j . Note that, in the reply() message is carried the result of conCut(V i , V saf e i , W i ). In this case, if the server is correct then V i contains valid values, and V saf e i contains valid values by construction, since it comes from values sent during the current maintenance(). If the server is cured, then V i and W i may contain any value. Finally, s i forwards a read_fw message to inform other servers about c j read request. This is useful in case some server missed the read(j) message as it was affected by mobile Byzantine agent when such message has been delivered. When a read_ack(j) message is delivered, c j identifier is removed from both pending_read i set as it does not need anymore to receive updates for the current read() operation.

========= Client code ========== operation read():

(1) reply i ← ∅;

(2) broadcast read(i);

(3) wait (2δ); (4) v, sn ← select_value(reply i );

(5) broadcast read_ack(i); (6) return v; -----------------------when reply (j, V j ) is received: [START_REF] Bonomi | Approximate agreement under mobile byzantine faults[END_REF] for each ( v, sn ∈ V j ) do [START_REF] Bonomi | Optimal mobile byzantine fault tolerant distributed storage[END_REF] reply i ← reply i ∪ { j, v, sn }; (9) endFor ========= Server code ========== when read (j) is received: [START_REF] Bouzid | Optimal byzantineresilient convergence in uni-dimensional robot networks[END_REF] ------------------------when read_fw (j) is received: (13) pending_read i ← pending_read i ∪ {j}; ------------------------when read_ack (j) is received:

P reg for the (IT U, CU M ) model

By definition (IT U, CU M ) is an instance of the (IT B, CU M ) such that ∆ = 1. Thus, given δ and the relationship 2δ ∆ = k is it straightforward to have an algorithm to solve the SWMR Regular Register in the (IT U, CU M ) model.

Correctness (IT B, CU M )

To prove the correctness of P reg we demonstrate that the termination property is satisfied i.e, that read() and write() operations terminates. For the validity property we follow te same four steps as defined in 6.4.4.

Lemma 45 If a correct client c i invokes write(v) operation at time t then this operation terminates at time t + δ.

Proof The claim simply follows by considering that a write_confirmation event is returned to the writer client c i after δ time, independently of the behavior of the servers (see lines 3-4, Figure 6.34). Proof This follows considering the definition of minimum number of correct replies during a time interval (cf. Corollary 6). Since does exist a tight protocol P solving a regular register in the (∆S, CAM ) model, then for Lemma 20, is it possible to apply values from Table 6.2 to compute the minimum number of correct replies during the considered time interval, substituting values in each case the result is always at least #reply CU M .

Lemma 47

Lemma 48 (Step 1.) Let T i be the time at which mobile agent ma i leave s c and let t ≤ T i + 2δ the time at which s c run the second maintenance() operation. Let v be the value stored at

Proof The proof follows considering that:

• the maintenance() employs a request-reply pattern and during such operation, by hypothesis, there are #echo CU M servers that are never affected during the [t, t + δ] time period and are storing v at time t + δ. i.e., there are #echo CU M servers that deliver the echo_req() message (the can be either correct or cured) but are storing v in V at time t + δ such that the reply is delivered by s c by time t + 2δ.

• during the maintenance() operation can incorrectly contribute (k + 1)f Byzantine servers, and (2k)f servers that were Byzantine in [t -4δ, t] time period, thus they could be still in a cured state 9 .

• when the echo_req() message is sent, s c uses a random number in order to be able to accept only echo() message sent after t.

#echo CU M = (3k)f + 1 > 3kf thus Byzantine servers can not force the function select_three_pairs_max_sn(echo_vals c ) to return a not valid value so it returns v that occurs #reply CU M times, which is true since there exist #echo_CU M non faulty servers that reply to the echo_req() message sending back v, concluding the proof.

Lemma 38

In the sequel we consider γ ≤ 4δ. In the previous Lemma we proved that cured servers s c can get valid values in 2δ time. Contrarily to all the previous model, the maintenance() operation is triggered each 2δ. Thus a mobile agent, just before to leave could leave s c with the timer just reset and garbage in the echo_set c and V c sets, which does not allow s c to correctly terminate the operation. Thus s c has to wait 2δ before to effectively starts a correct maintenance() operation. In the sequel we refer to the first maintenance as the operation that may be ineffective and we refer to the second maintenance as the operation that allows a cured server to retrieve and store valid values. It is straightforward that γ ≤ 4δ and the next Corollary just follows.

Corollary 12

Protocol P implements a maintenance() operation that implies γ ≤ 4δ. Lemma 49 (Step 2.) Let op W be a write(v) operation invoked by a client c k at time t B (op W ) = t then at time t + δ there are at least n -2f > #reply CU M non faulty servers s i such that v ∈ W i (so that when

Proof When the write() message is delivered by non faulty servers s i , such message is stored in W i and a timer associated to it is set to 4δ, after that the value expires. For Lemma 11 in the [t, t + δ] time interval there are maximum 2f Byzantine servers. All the remaining n -2f non faulty servers execute the correct protocol code, Figure 6.34 line 5 inserting v in W i . Since write() operations are sequential, during [t, t + δ] there is only one new value inserted in W i , which is returned by the function conCut() by construction.

Lemma 49

For simplicity, for now on, given a write() operation op W we call t B (op W )+δ = t wC the completion time of op W , the time at which there are at least #reply CU M servers storing the value written by op W . Lemma 50 (Step 3.) Let op W be a write() operation and let v be the written value and let t wC be its time completion. Then if there are no other write() operation, the value written by op W is stored by all correct servers forever (i.e., v ∈ conCut(V i , V saf e i , W i )). value chosen by p 1 , p 2 and p 3 is 1 (independently of the value sent by the Byzantine process, assume it 0).

The E3 brings the contradiction: some correct processes choose 1 while others choose 0, which contradicts the Agreement property of A. The execution E3 is as follows: the process occupied by the Byzantine agent sends 0 to process p2 and 1 to process p3. Let us consider only the processes p 2 and p 3 . The multiset held by p 2 is {0,0,1}. This multiset is identical with the one p 2 gathered in E1, hence its choice in E3 should be 0 (identical to the one in E1). The multiset gathered by p 3 in E3 is {1,0,1} and identical with the one p 3 gathered in E2. Thus, p 3 should choose 1 in E3. Execution E3 violates the Agreement property of Simple Approximate Agreement. This contradicts the assumption that A verifies the Simple Approximate Agreement properties.

T heorem 27

Theorem 28 (Lower bound for Bonnet's model) There is no algorithm that solves Simple Approximate Agreement in the Bonnet's model (M2) under the Mobile Byzantine faults model if n ≤ 5f .

Proof The proof follows the same general idea as the proof of Theorem 27. Suppose that exists an algorithm A verifying Simple Approximate Agreement properties in Mobile Byzantine model (M2) with n ≤ 5f . In all of them we consider five processes p 0 , p 1 , p 2 , p 3 and p 4 , where p 0 is occupied by a Byzantine agent while p 1 is cured (its state may be corrupted) and p 2 , p 3 and p 4 are correct processes.

Consider three executions: E1, E2 and E3. Execution E1 starts in a configuration where p 2 , p 3 and p 4 propose 0 while p 1 proposes 1. Assume p 0 sends 1 to all processes. Each non faulty process gathers in E1 the multi-set {1,1,0,0,0} and following the Agreement and Validity properties of A , they have all to choose 0 in E1.

Execution E2 starts in a configuration where p 2 , p 3 and p 4 propose 1 while p 1 proposes 0. Assume p 0 sends 0 to all processes. Each non faulty process gathers in E2 the multi-set {0,0,1,1,1} and following the Agreement and Validity properties of A , they have all to choose 1 in E2.

Execution E3 brings the contradiction. Assume that in E3 p 0 sends 0 to p 2 and 1 to p 3 . p2 gathers the multiset {1,1,0,0,0} hence it has the same multi-set as in E1. p2 then chooses 0. p3 gathers the multi-set {0,0,1,1,1} and since this multi-set is identical with the one gathered in E2, p3 has to make the same choice, namely 1. Execution E3 violates the Agreement property, hence A do not implement the Simple Approximate Agreement.

T heorem 28

Theorem 29 (Lower bound for Sasaki's model) There is no algorithm that solves Simple Approximate Agreement in the Sasaki's model (M3) under the Mobile Byzantine faults model if n ≤ 6f .

Proof The proof follows directly from the lower bound for the Simple Approximate Agreement [START_REF] Fischer | Easy impossibility proofs for distributed consensus problems[END_REF] and the mapping defined in 7.3.3. Note that in the Sasaski's model the number of processes with asymmetric behavior is 2f where f is the number of Byzantine agents.

T heorem 29

More in details, any algorithm in this family proceeds in rounds and during any round r j , every process p i executes the following actions:

1. send-phase: p i sends its "voted" value to the others; 2. received-phase: p i aggregates values in a multiset N r k ; 3. computation-phase: p i applies a deterministic function F(N r k ) to decide the value to vote in the next round r k+1 .

Their computation function can be expressed in the general form:

where Sel is a selection function and Red is a reduction function used to filter values. The correctness of MSR algorithms in the Mixed-mode faults model is guaranteed by the single-step convergence property. Informally, at the end of each round r k , the range of values voted by correct processes shrinks with respect to the beginning of the round.

In [START_REF] Kieckhafer | Reaching approximate agreement with mixed-mode faults. Parallel and Distributed Systems[END_REF], the authors proved that, given the number of benign faults b, the number of symmetric faults s and the number of asymmetric faults a, the minimum number of processes n needed to solve the Byzantine Approximate Agreement by an algorithm in the class MSR is

Mapping MBF on to Mixed-Fault Model

In order to prove that MSR algorithms are able to solve the Mobile Byzantine Approximate Agreement problem, we will map each Mobile Byzantine Failure model to the Mixed-mode faults and we will exploit the constraint on n established in the Mixed-fault model to compute the number of processes required to solve Mobile Byzantine Approximate Agreement problem in the Mobile Byzantine Failure model. Note that the behavior of Mobile Byzantine processes concern only the send/receive phases of MSR algorithms. Therefore, we focus on the behavior of the faulty processes during the execution of these phases. In order to match our models the send-phase of MSR algorithms should be sightly modified in order to prevent correct processes to participate to the communication as per the requirement of the M1 model. Proof A cured process, in M1 is aware of its failure state thus if it is forced to skip the send phase then it is detected by any correct process in round r k .

Lemma 53

Lemma 54 Let T s r k be the set of cured processes at the beginning of round r k in model M2. If the send phase send(vote) to all processes; is executed by any p j ∈ T s r k then the computation executed in round r k is equivalent to the computation under Mixed-mode fault model executed with a = f and s = |T s r k |.

Proof A cured process in M2 is not aware of its state, hence it sends its vote to every process in the system. This value may be the result of a corrupted state. This is identical to the behavior of a process exhibiting a symmetric fault. Proof A cured process in M3 is not aware of its state hence it sends its vote to every process in the system. Moreover, Byzantine agent prepares the outgoing message queue (cf. [START_REF] Sasaki | Mobile byzantine agreement on arbitrary network[END_REF]). Thus, a cured process executes the sending phase as any correct process. However, differently from the correct processes it sends possibly different values (left behind by the Byzantine agent) to every process in the system. This is identical to the behavior of a process exhibiting an asymmetric fault.

Lemma 55

Lemma 56 Let T c r k be the set of cured processes at the beginning of round r k in model M4. If the send phase send(vote) to all processes; is executed by any p j ∈ T c r k then the computation executed in round r k is equivalent to the computation under Mixed-mode fault model executed with a = f . Proof In this failure model, Byzantine agents move along with the messages. Thus during the sending phase there are no processes in T c r k .

Lemma 56 Table 7.1 summarizes the mapping results proven in Lemmas 53-56. Given Lemmas 53-56 and considering equation [START_REF]The high price of it downtime[END_REF], it is possible to define the number n of processes required to run a MSR algorithm. Results are shown in Table 7.2 for each Mobile Byzantine Failure model.

In the previous Section we shown that each of the four round based MBF models described in Chapter 4 can be mapped in a particular configuration of the Mixedfault model. Let us note that such mapping holds if we take a snapshot of the Proof The proof is done by induction. During the first round r 0 no Byzantine agent moved yet. Thus, at the end of r 0 trivially |T * r 0 | = 0. In the next round r 1 Byzantine agents move thus affecting up to f processes. Therefore, at the beginning of r 1 there are up to f cured processes, |T * r 1 | ≤ f . If we substitute, for each model M1-M4 (cf. Table 7.1), values in n > 3a + 2s + b if follows that despite agents movement, n > n M i still holds. Thus, for the definition of F M SR () the value that each process computes at computation-phase is correct. Hence, at the end of round r 1 we have |T * r 1 | = 0. For each further r k the reasoning is similar.

Lemma 57

From Lemma 57 it follows that during each round there are not cured processes related to the previous round but only the ones due to the last Byzantine agents movement, hence the corollary below.

Corollary 13 Let T r k be the set of cured processes at the beginning of round r k . Note that with fixed a,s and b, the relation n > 3a + 2s + b always holds in a static computation of a MSR algorithm ( [START_REF] Kieckhafer | Reaching approximate agreement with mixed-mode faults. Parallel and Distributed Systems[END_REF]).

Definition 23 (mobile computation)

) is said to be a mobile computation if for any two subsequent configurations C r k , C r k +1 , any process may change the failure state but the relation n > 3a + 2s + b holds at each round.

Definition 24 (configurations equivalence) A configuration C r k is said to be equivalent to a configuration Cr k if:

• C r k and Cr k produce the same U ;

• ∀k, C r k has at least the same number of tuples correct, correct value as Cr k .

Note that in a static computation a correct process is correct for the whole computation, while in a mobile one is correct with respect to the observed round.

Definition 25 (correct computation)

Given a static computation Cr 0 , . . . , Cr k of an algorithm in the MSR class, if n > 3a + 2s + b, then each configuration Cr j , j ∈ [0, k], is characterized as follows:

• up to a asymmetric Byzantine processes;

• up to s symmetric Byzantine processes;

• up to b benign faults;

• at least n -(a + s + b) correct processes such that each p j of them computes a correct value v r j j . The first three points are due to the failures static nature. The last one is given by the failures static nature plus the correctness of the algorithm in the static case (as proven in [START_REF] Kieckhafer | Reaching approximate agreement with mixed-mode faults. Parallel and Distributed Systems[END_REF]).

MSR correctness under Mobile Byzantine fault model

In the following we prove that despite the mobility of Byzantine agents, the MSR family of algorithms satisfies the Mobile Byzantine Approximate Agreement specification. In the presence of mobile Byzantine agents, each round is characterized by correct, cured and faulty processes. As we showed previously, depending on the failure model considered, cured processes behave accordingly to a different kind of fault (asymmetric, symmetric or benign). Figure 7.1 presents an example of execution of a MSR algorithm in presence of Mobile Byzantine Failures (left side) and Mixed-Mode Failures (right side) and informally shows that at the beginning of each round we obtain the same configuration that satisfy the properties required for the convergence.

The following theorem proves the mapping between the Mobile Byzantine faults model and the Mixed-mode fault model. Let us start proving that if n > n M i then a mobile computation is also a correct computation, as defined in subsection 7.3.4.

Theorem 31

Let us consider a mobile computation C 0 , C 1 , . . . , C k , ∀k ∈ N of an algorithm AA in the class MSR. If in each round n > n M i (cf. Table 7.2) then the sequence C 0 , . . . , C k is a correct computation.

Proof We have to show that for each iteration of AA we can build a static computation equivalent to the dynamic one. The proof is done by induction. Let us denote by C, T * and B the set of correct, cured and Byzantine processes respectively and let t * denote the cardinality of T * . Let us denote, in the static case, by C , T , and B the set of correct, non correct (which may be asymmetric, symmetric, or benign), and asymmetric faulty processes, respectively, and let t * denote the cardinality of T .

• Rounds 0 → 1: At the begining of round 0, Byzantine agents never move.

Thus, the configuration is as follows:

The protocol executes its first iteration. Processes exchange their value and each non Byzantine process p i updates its state: failure state, proposing value ← v 0 i = F M SR (V 0 ) . At this point the situation is as follow:

Up to now, the same happens in a static computation. At the begining of round 1, at most f Byzantine agents move affecting other processes. Thus there are up to t * = f cured processes storing a non correct value (e.g., v 0 / ∈ ρ(N 0 )).

-

At the begining of round 1, there are at least n -(f + t * ) correct processes. If we map it to the Mixed-mode failures model (cf. Table 7.1), this is equivalent to a static configuration where there are f asymmetric processes and t * non correct that may be asymmetric, symmetric or benign:

The mobile and static configurations are equivalent. Thus the current mobile configuration (and the mobile computation up to now) is correct.

• Rounds 1 → 2: From the previous point, the configuration at the beginning of round 1 is correct. The second iteration of the protocol takes place. Processes exchange their value and each non Byzantine process p i updates its state: failure state, proposing value ← v 1 i = F M SR (N 1 i ) . At this point, for Lemma 57, each process in T * becomes correct. In other words, there are up to f Byzantine processes and at least n -f correct processes. We are in the same situation as at the end of previous round 0. At the beginning of next round, at most f Byzantine agents can move to other processes, leaving up to t * = f cured processes with non correct value. Thus there are at least n -(f + t * ) correct processes at the begining of round 2. The mobile and static configurations are equivalent. Thus the current mobile configuration (and the mobile computation up to now) is correct.

• Rounds i → i + 1: generalizing, for each round starting with a correct configuration we can apply the previous reasoning ending in a subsequent round characterized by a correct configuration.

T heorem 31

In the following we prove the correctness of any algorithm in the class MSR under Mobile Byzantine failure model. Proof From Theorem 31, if n > n M i then algorithm AA generates a sequence of correct configurations, i.e., a sequence of converging values exactly as in [START_REF] Dolev | Reaching approximate agreement in the presence of faults[END_REF][START_REF] Kieckhafer | Reaching approximate agreement with mixed-mode faults. Parallel and Distributed Systems[END_REF], thus the Eventual-Convergence property is satisfied in the same way the Termination is satisfied by the [START_REF] Dolev | Reaching approximate agreement in the presence of faults[END_REF][START_REF] Kieckhafer | Reaching approximate agreement with mixed-mode faults. Parallel and Distributed Systems[END_REF] solutions. Proof From Theorem 31, if n > n M i then algorithm AA generates a sequence of correct configurations, i.e., a sequence of converging values exactly as in [START_REF] Dolev | Reaching approximate agreement in the presence of faults[END_REF][START_REF] Kieckhafer | Reaching approximate agreement with mixed-mode faults. Parallel and Distributed Systems[END_REF]. Thus, the -Agreement property is satisfied in the same way this is satisfied by the [START_REF] Dolev | Reaching approximate agreement in the presence of faults[END_REF][START_REF] Kieckhafer | Reaching approximate agreement with mixed-mode faults. Parallel and Distributed Systems[END_REF] solutions.

In the following we prove that once -Agreement is achieved among the currently non faulty processors, it is preserved among the (possible different) uninfected processors. Let us consider an arbitrarily long mobile computation C 0 , . . . , C k . If -Agreement is achieved then there exists a round r a , a ∈ [0, k] where all non faulty processes agree on values that are close to each other. Considering that n > n M i then from Theorem 31 the whole mobile computation C 0 , . . . , C k is correct. Thus from round to round the two properties P 1 and P 2 hold and correct processes values can not diverge from each other. Proof From Theorem 31, if n > n M i then algorithm AA generates a sequence of correct configurations, i.e., a sequence of converging values exactly as in the validity proof in [START_REF] Dolev | Reaching approximate agreement in the presence of faults[END_REF][START_REF] Kieckhafer | Reaching approximate agreement with mixed-mode faults. Parallel and Distributed Systems[END_REF].

Lemma 60

The three above lemmas provide the proof of the theorem below.

Theorem 32 If n > n M i then the class MSR verifies the Byzantine Approximate Agreement specification.

Chapter 8

Conclusions

In this thesis we have deeply studied the Mobile Byzantine Failures model. The importance of such model arises when we have to design a Byzantine Tolerant protocol ables to tolerate f Byzantine replicas in a long lasting execution. Thus, a situation where it is more likely that the number of Byzantine replicas exceeds f , yielding to the necessity to restore the correct state of compromised replicas. In this thesis, we coped with the new challenges that such model unveils, from new definitions of failure states to the impact of the operations duration. Indeed, in such models we can not assume anymore that during an operation there are f Byzantine processes but depending on the characteristic of the system model considered we have to be able to compute how many Byzantine processes can be involved during each operation, so that also the way to prove lower bounds has been rethought. In particular in this work we first proposed optimal solutions for the Atomic Register problem in the already defined mobile Byzantine round-based models. As we saw, solving such problem in presence of mobile Byzantine failures implies higher lower bounds with respect to solutions coping with Byzantine failure. On the other side, given the round-based nature of the model the solution is algorithmically simple. This observation advocate to our main contribution, a general round-free mobile Byzantine failure model which can be deployed in four different models. Those models describe the different processes awareness about their failure state and mobile agent movements (coordinated or uncoordinated). We prove that in each model (round-based and consequently round-free) an additional operation, the maintenance, is necessary to implement registers. Moreover we prove that maintenance is not solvable in a system model where communications are asynchronous. Later we provided a framework to compute lower bounds in each instance of the MBF models. Once lower bounds have been proved we solve the Regular Register problem in all the four different model variants. In those cases, register protocols, in addition to read and write operations, implement the maintenance operation to cope with mobile Byzantine failures. Interestingly, we saw that read and write operations do not really change through the four different failures models. This is due to the maintenance operation that changes from a model to another and makes transparent the mobile agents movements to the read a write operations. In short, such operation guarantees that during each operation there is a set of correct processes, large enough, to provide