<?xml-model href='http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng' schematypens='http://relaxng.org/ns/structure/1.0'?><TEI xmlns="http://www.tei-c.org/ns/1.0">
	<teiHeader>
		<fileDesc>
			<titleStmt><title level='a'>Semi-Fast Byzantine-tolerant Shared Register without Reliable Broadcast</title></titleStmt>
			<publicationStmt>
				<publisher></publisher>
				<date>2020 December</date>
			</publicationStmt>
			<sourceDesc>
				<bibl> 
					<idno type="par_id">10176146</idno>
					<idno type="doi"></idno>
					<title level='j'>40th IEEE International Conference on Distributed Computing Systems</title>
<idno></idno>
<biblScope unit="volume"></biblScope>
<biblScope unit="issue"></biblScope>					

					<author>KishoriKumar Konwar</author>
				</bibl>
			</sourceDesc>
		</fileDesc>
		<profileDesc>
			<abstract><ab><![CDATA[Shared register emulations on top of message- passing systems provide an illusion of a simpler shared memory system which can make the task of a system designer easier. Numerous shared register applications have a considerably high read to write ratio. Thus having algorithms that make reads more efficient than writes is a fair trade-off.Typically such algorithms for reads and writes are asymmetric and sacrifice the stringent consistency condition atomicity as it is impossible to have fast reads for multi-writer atomicity. Safety is a consistency condition has has gathered interest from both the systems and theory community as it is weaker than atomicity yet provides strong enough guarantees like “strong consistency” or read-my-write consistency. One requirement that is assumed by many researchers is that of the reliable broadcast (RB) primitive, which ensures the all or none property during a broadcast. One drawback is that such a primitive takes 1.5 rounds to complete.This paper implements an efficient multi-writer multi-reader safe register without using a reliable broadcast primitive. More- over, we provide fast reads or one-shot reads – our read operation can be completed in one round of client-to-server communication. Of course, this comes with the price of requiring more servers when compared to prior solutions assuming reliable broadcast. However, we show that this increased number of servers is indeed necessary as we prove a tight bound on the number of servers required to implement Byzantine-fault tolerant safe registers in a system without reliable broadcast.We extend our results to data stored using erasure coding as well. We present an emulation of single-writer multi-reader safe register based on MDS code. The usage of MDS code reduces storage cost and communication cost. On the negative side, we also show that to use MDS code and achieve one-shot read at the same time, we need even more servers.]]></ab></abstract>
		</profileDesc>
	</teiHeader>
	<text><body xmlns="http://www.tei-c.org/ns/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink">
<div xmlns="http://www.tei-c.org/ns/1.0"><head>I. INTRODUCTION</head><p>A longstanding vision of distributed computing has been to design algorithms that emulate reliable systems on unreliable components. For example, fault tolerant storage <ref type="bibr">[1]</ref>, reliable broadcast <ref type="bibr">[2]</ref>, atomic broadcast <ref type="bibr">[3]</ref>, failure detectors <ref type="bibr">[4]</ref>, etc. As we are increasingly dependent on services (online banking software, e-shopping, online auctions, etc) provided by distributed systems over the Internet, "fault-tolerance" is becoming a necessary property of these services in order to make them usable.</p><p>These faults can range from benign (crash-faults) to extremely adversarial (Byzantine faults). The term "Byzantine" fault represents the whole spectrum of failures imaginable Authors ordered alphabetically. ranging from malicious attacks and operator mistakes to software errors and conventional crashes. Driscoll et al. <ref type="bibr">[5]</ref> presented a case study of Byzantine faults in several realworld applications. Naturally, over the past four decades, there has been a significant work on developing Byzantine-fault tolerant solutions to distributed problems like consensus <ref type="bibr">[6]</ref> and read/write registers <ref type="bibr">[7]</ref>. In this paper, we focus on Byzantinetolerant read/write registers, as it has prevalent usage in industry, e.g., geo-replicated key-value storage (Cassandra [8]), and distributed shared memory (Redis [9]).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>A. Read/Write Register</head><p>The emulation of shared storage on top of a message passing system allows the system designers to develop applications designed for the simpler shared memory model. Typically such emulation algorithms provide fault-tolerant storage of shared data by replicating the data on to several data stores. The ABD algorithm <ref type="bibr">[1]</ref> showed that it is possible to implement a shared atomic register on top of an n-process asynchronous message-passing system if just a majority of servers were not crash-faulty.</p><p>This paper set forth a wave of research papers on faulttolerant read/write registers. Although the theory literature has a huge body of work implementing atomic registers, in practice atomicity can be quite expensive and unnecessary. For example, popular geo-replicated storages such as Amazon Dynamo and Cassandra all adopt a weaker notion of consistency. Bailis et al. <ref type="bibr">[10]</ref> quantitatively demonstrate how such eventually consistent systems offer significant latency benefits over full quorums.</p><p>Consistency conditions like safety <ref type="bibr">[11]</ref> and regularity are weaker than atomicity and can be cheaper to implement with improved latencies of operations, especially read operations. In many applications <ref type="bibr">[12]</ref> <ref type="foot">foot_0</ref> , the number of read operations are much larger than the number of writes. As a result it is desirable to have reads that are faster than writes.</p><p>In a semi-fast register implementation the read (or write) operation is fast and the write (or read) operation is slow. Since it is impossible to implement a semi-fast multi-writer/multi-reader (MWMR) atomic register even with just crash failures <ref type="bibr">[13]</ref>, we choose to sacrifice atomicity to achieve a semi-fast safe register with fast reads. In our emulation, our read only takes one round of client-to-server communication, achieving optimal round complexity.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B. To RB or Not to RB</head><p>It is a common practice in the literature of shared read/write registers (e.g., <ref type="bibr">[14]</ref>, <ref type="bibr">[15]</ref>) to assume the existence of a reliable broadcast primitive <ref type="bibr">[2]</ref> or communication layer that ensures the eventual "all or none" property. Closely related work in the literature is discussed in Section VI.</p><p>In this paper, we take a different route. We show that it is possible to implement a Byzantine-tolerant safe register without the existence of a reliable broadcast mechanism if we assume more redundancy, i.e., our model assumes f more servers than the results <ref type="bibr">[15]</ref> that assume reliable broadcast where f is the maximum number of servers that can be Byzantine faulty.</p><p>Again, our design choice is motivated by the observation that reducing response time is one of the most important goals in many latency-sensitive applications. Plus, most storage systems can be built upon commodity machines, making the cost of adding f extra machines minimal. Finally, reliable broadcast is simple to argue with, but it comes with a cost. Such an "all-ornothing" property is typically not guaranteed by any networking protocol. Reliable broadcast implementation on top of reliable point-to-point channel typically requires 1.5 rounds of delay, e.g., <ref type="bibr">[2]</ref>. If an emulation algorithm uses reliable broadcast for every message exchanged, the accumulated latency will eventually become blow up by a factor of 1.5.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>C. Erasure Coding</head><p>To further reduce latency, we also consider a practical approach -reducing communication bandwidth consumption. This will be particularly useful when network has limited bandwidth or the data is too large. We achieve this by using erasure coding-based approach. An added benefit of using erasure codes is the reduced storage space at each server.</p><p>In comparison with the traditional replication-based approach (i.e., all servers storing the same copy of data), consistent memory emulation algorithms that use erasure codes reduce both the storage and communication costs of the implementation. In an erasure coding-based algorithm, an [n, k] erasure code splits the value v of size 1 unit into k elements, each of size 1 k units, creates n coded elements, and stores one coded element per server. The size of each coded element is also 1  k units, and thus, the total storage cost across the n servers is n k units. Same analysis applies to bandwidth consumption as well.</p><p>A class of erasure codes known as Maximum Distance Separable (MDS) codes have the property that value v can be reconstructed from any k out of these n coded elements. The usage of MDS codes to emulate consistent and fault-tolerant shared storage is an ongoing research topic, including tolerating crash-failures <ref type="bibr">[16]</ref>, <ref type="bibr">[17]</ref> and Byzantine failures <ref type="bibr">[18]</ref>, <ref type="bibr">[14]</ref>. None of the prior solutions that we know of provides fast read or one-shot read.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>D. Main Contributions</head><p>Motivated by the practical interests in reducing latency, we have the following positive results:</p><p>&#8226; An algorithm emulating Multi-Writer-Multi-Reader replicated-based safe register with one-shot read (Section III). &#8226; An algorithm emulation Single-Writer-Multi-Reader<ref type="foot">foot_1</ref> erasure coding-based safe register with one-shot read (Section IV). We also briefly discuss two methods to extend our work to provide an even stronger guarantee, Multi-Writer Regularity. All our algorithms do not assume the existence of reliable broadcast.</p><p>Our replication-based algorithm requires n &#8805; 4f +1, whereas our erasure coding-based algorithm requires n &#8805; 5f + 1. These numbers are worse than prior solutions that only require n &#8805; 3f + 1, e.g., <ref type="bibr">[15]</ref>. However, we show in Section V these two numbers are necessary. In other words, the propose solutions have optimal resilience and optimal round complexity of reads.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>II. MODELS AND DEFINITIONS</head><p>In this section, we describe the models of computation, explain the concepts of safe and regular registers, erasure codes, and the performance metrics used in the paper.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>A. System Model</head><p>We consider a distributed system consisting of asynchronous processes of three types: a set of readers, a set of writers and a set of n servers. The readers and writers are together referred to as clients. Asynchronous means processes progress at their own speed, which can vary with time and remains always unknown to the other processes. There is also no bound on the message delays.</p><p>Each process is associated with a unique identifier (ID), and we denote the sets of IDs of the readers, writers and servers as R, W and S, respectively. The set R &#8746; W &#8746; S forms a totally ordered set under some defined relation (&gt;), for example lexicographical order if the IDs are alphanumeric strings.</p><p>The reader and writer processes initiate read and write operations, respectively, and communicate with the servers using messages. At all times, at most one operation can run on a client.</p><p>At most f servers can be Byzantine faulty, i.e., it can behave arbitrarily and deviate from the algorithm in any way. For example, a Byzantine server can send incorrect register values, incorrect timestamp values, no reply or multiple replies to a certain request, etc All clients may suffer crash failures; otherwise, they follow the protocol specification.</p><p>We assume that every client is connected to every sever by bidirectional reliable communication channels that neither loses, duplicates nor creates messages, but may reorder messages arbitrarily. The model allows the sender process to fail after placing the message in the communication channel; messagedelivery depends only on whether the destination is non-faulty. This means that as long as the destination process is nonfaulty, any message sent on the link is guaranteed to eventually reach the destination process. We do not make any assumptions regarding relative order of message delivery in the same channel. The communication channels connecting servers and clients provide message authentication using digital signatures <ref type="bibr">[19]</ref>. This prevents Byzantine servers from spreading misinformation about the sender of a message.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B. Shared Memory Abstraction</head><p>Our system consists of a finite set of shared variables (or read/write objects). The object values v come from some set V ; initially, v is set to a distinguished default value v 0 (&#8712; V ). Reader r requests a read operation on object x. Similarly, a write operation is requested by a writer w.</p><p>Each operation at a non-faulty client begins with an invocation step and terminates with a response step. An operation &#960; is incomplete in an execution when the invocation step of &#960; does not have the associated response step; otherwise, we say that &#960; is complete. An execution is set of possibly infinite sequences (one for each process) of invocation and responses. In an execution, we say that an operation (read or write) &#960; 1 precedes another operation &#960; 2 , if the response step for &#960; 1 precedes the invocation step of &#960; 2 . Two operations are concurrent if neither operation precedes the other.</p><p>A response event e r is said to match an invocation event e i if (i) they are associated with the same client, and (ii) e i precedes e r at the invoking process. An execution is said to be valid if for every client process: (i) it is empty (client crashes before invoking any operation), or its first event is an invocation; (ii) an invocation can only be followed by a client crash event or a matching response event; (iii) every invocation event has at most one matching response event; and (iv) there are no more events after the client's crash event (if there is any). An operation is said to be live if it terminates within a finite amount of time.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>C. Definitions</head><p>We define our consistency conditions over complete operations in an execution. We present the definition of the correctness conditions safety <ref type="bibr">[11]</ref> and regularity <ref type="bibr">[15]</ref>, <ref type="bibr">[20]</ref> for multi-writer multi-reader (MWMR) registers. Definition 1. A MWMR register is safe if it satisfies the following (i) a read r that is not concurrent with any write returns the value of some write w that precedes r, as long as no other write falls completely between w and r (ii) otherwise the value returned is within the register's allowed range of values.</p><p>Definition 2. A MWMR register is regular if it satisfies the safety property above and the linearization of any two reads agree on the ordering of all writes that began before both the reads complete.</p><p>Note that both consistency conditions imply some form of "strong consistency" used widely in industry -no stale version of value will be read. The discussion is intentionally informal, as there is no standard definition of "strong consistency" used in industry. Here, we follow the RIAK discussion on strong consistency. <ref type="foot">3</ref>Another important property is the fast read or one-shot read. For a read operation, a round (or round-trip delay) consists of a read request message from the client initiating the read operation to the server, and subsequently, the server sending at least one version of the object value in its response. No server-to-server is involved in the process.</p><p>Definition 3 (One-Shot Read). One-shot reads require that each read operation completes in one round of client-to-server communication.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>III. BSR ALGORITHM</head><p>In this section, we present the algorithm for Byzantine replication-based Safe Register (BSR). In our algorithm, we rely on the notion of witness at a reader client C r . A server p is called a witness of value v if p sends v to C r as a response to a read request from C r .</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>A. Pseudocode</head><p>Below we describe the key elements of the emulation algorithm BSR before presenting the pseudocode in Figures <ref type="figure">1,  2,</ref> and<ref type="figure">3</ref> a) State Variables: Every server s i , for i &#8712; [n], contains a list L of pairs of tags and values corresponding to each written value stored. Initially L has only the initial value v 0 of the register.</p><p>b) Write Operation: A write operation initiated by some writer w consists of two phases get-tag and put-data. In the get-tag phase, w sends a message of type QUERY-TAG to all servers in S and waits for responses from n -f servers from which it selects the (f + 1)-th highest tag t. Then the writer initiates the put-data phase where it creates a new tag as (t.num + 1, w), and sends the message (PUT-DATA, (t w , v)) to server s i in S for any i &#8712; [n]; v is the value the writer wants to write to the register. Once w receives acknowledgements from n -f servers w completes the write. c) Read operation: A read operation initiated by some reader r consists of only one phase, which we refer to as get-data. During this phase r sends out read request messages in the form of (QUERY-DATA) to servers in S and waits for responses from n -f servers in S. Reader r completes the read by returning value with the highest tag that was verified by at least f + 1 servers. otherwise it returns the most recent value it has previously heard of (which may be the initial value v 0 ). d) Server responses: The servers responses correspond to the two phases for the writers and one phase for the reader.</p><p>Response to writers: When any server s i receives a (QUERY-TAG) message from a writer w, a get-tag-resp occurs, during which s i responds by sending the maximum of tag stored in its L to w. When a server s i receives a message (PUT-DATA, (t in , v in )), a put-data-resp occurs at s i where if the incoming tag t in is higher then the tags in L then s i adds (t in , v in ) to L, and sends an acknowledgement to w.</p><p>Response to readers: When s i receives a (QUERY-DATA) from a reader r, a get-data-resp occurs where s i sends the locally available (t max , c max ) pair (corresponding to the highest tag t max in L) to r.</p><p>Fig. <ref type="figure">1</ref> BSR for write operation write(v) w , for writer w &#8712; W.</p><p>Send QUERY-TAG to servers in S 3:</p><p>Wait for responses from n -f servers in S 4:</p><p>Select the (f + 1)-th highest tag t 5: put-data: 6:</p><p>Create new tag tw = (t.num + 1, w).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>7:</head><p>Send (PUT-DATA, (tw, v)) to servers in S 8:</p><p>Wait for ACKs from n -f servers in S Fig. <ref type="figure">2</ref> BSR for read operation, read r , for reader r &#8712; R.</p><p>Wait for responses from n -f servers in S 5:</p><p>P &#8592; the set of all pairs with &#8805; f + 1 witnesses 6:</p><p>Select pair, say (tr, vr), with the highest tag among P 7:</p><p>if (P = &#8709; &amp; (tr, vr) &gt; (t local , v local )) then 8:</p><p>(t local , v local ) (tr, vr) 9:</p><p>Return value v local Fig. <ref type="figure">3</ref> BSR for any server s &#8712; S.</p><p>Send max{t : (t, * ) &#8712; L} to w 4: put-data-resp (PUT-DATA, (tin, vin)) received: 5:</p><p>if t in is higher than the locally available tag then 6:</p><p>Send ACK to writer w of tag t in 8: get-data-resp (QUERY-DATA) from r &#8712; R: 9:</p><p>Send the locally available (t, v) pair.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B. Correctness of BSR</head><p>Theorem 1. BSR satisfies liveness if at any point of the time, n -f servers are available, i.e., at most f servers crash.</p><p>Proof. All operations (reads and writes) wait for only n -f replies from the servers. Thus liveness is satisfied if there are n -f correct servers in the system.</p><p>Lemma 1. For each pair of read r and write w, if w completes before r begins and r is not concurrent with any write, then the timestamp of w &#8804; the timestamp of r.</p><p>Proof. A client has to hear from at least n -f servers for an operation to complete. The write operation w completes by contacting server set W 1 , and, |W 1 | &#8805; n-f . Let the timestamp of the write be m. Thus the timestamp at the servers in W 1 after w completes will be &#8805; m. Suppose the read operation r contacts the server set</p><p>, which means the timestamp &#8805; m was written to at least 2f + 1 servers that r reads from. Of these at most f are Byzantine faulty, and thus, the (-th highest tag will be &#8805; m.</p><p>Lemma 2. The write operations are totally ordered by timestamp, and the resulting order respects the real-time order.</p><p>Proof. Every write operation has two phases: get-tag and put-data. The get-tag phase collects the tags of the most recent writes known by the servers and the put-data phase sends out the new value and timestamp to be updated by the servers.</p><p>Note that servers update their local value only as a response to put-data. Every pair of writes w 1 and w 2 , will satisfy one of the following conditions:</p><p>&#8226; Case 1: The writes are not concurrent. WLOG, let w 1 completes before w 2 starts and let the timestamp of w 1 be m. This means, at least n -f servers have heard of w 1 and thus their timestamp is &#8805; m. When w 2 is invoked, at least n -2 &#8805; 2f + 1 of these nodes reply to the get-tag query for w 2 . Since at most f nodes can be Byzantine faulty, the f + 1th highest tag (by line number 4) id at least m. This tag value gets incremented by 1 in the next phase. Thus the tag value of w 1 is strictly smaller than that of w 2 &#8226; Case 2: The writes are concurrent. This means that the real time of w 1 and w 2 overlap with each other. In this case, there may be two scenarios:</p><p>-One write hears about the other concurrent write in the get-tag phase. WLOG, let w 2 hears about w 1 in its get-tag phase<ref type="foot">foot_3</ref> . This scenario is similar to Case 1 and the tag of w 2 will be larger than that of w 1 . -The two writes are unaware of each other. In this case, the get-tag query returns the same tag value for both the write operations. Since a writer can have at most one write operation the "tie" is broken by the total order on the ids of the two writers.</p><p>Lemma 3. For every read operation r, there exists w denoted &#961;(r) such that it is some write operation that began before r began, such that r returns the value written by w or the initial value v 0 and has the same timestamp as w or 0.</p><p>Proof. Any value v returned by a reader R at the end of a read operation r must have f + 1 witnesses. If not R returns the last known value, which is v 0 initially. This ensures that at least one fault-free server S has sent v to R. Since S is fault-free, v is written by some write w i or is the initial value v 0 . Moreover, by definition, when R receives the value v, the read operation r is not terminated yet. In other words, w must have begun before r terminates. Letting &#961;(r) = w completes the proof.</p><p>A completed write is a write operation that executes line number 8 of Algorithm 1 and a completed read is read operation that executes line number 9 of Algorithm 2.</p><p>Theorem 2. Every well-formed execution of BSR satisfies safety given n &#8805; 4f + 1.</p><p>Proof. We show that, for every execution, there is a total order on each completed read r and completed writes that begin before r begins. We now show that the execution satisfies safety. Intuitively, the lemma holds because for each completed read r we can construct a total order on r and completed writes It is easy to see why a natural construction based on timestamps leads to a legal order. There are three cases to consider:</p><p>&#8226; A write followed by a read: due to Lemma 1 &#8226; A write followed by a write: due to Lemma 2 &#8226; A read followed by a write: due to Lemma 3. Consider any read r. We now show how to construct a total order &#964; r on the set consisting of r and all write operations as follows:</p><p>&#8226; Case I: If r is not concurrent with any write:</p><p>1) Order all the writes that began before r before any write that began after r. 2) Order all the writes that began before r in timestamp order among themselves. 3) Order all the writes that began after r in timestamp order among themselves. 4) Order r immediately after &#961;(r) before the following write.</p><p>&#8226; Case II: If r is concurrent with some write: 1) Order all writes based on timestamps 2) Order r immediately after &#961;(r) before the following write. From lemma 3, we know that &#961;(r) exists; hence, such a construction is always feasible. The total order is legal by construction because a read concurrent with a write returns some valid value (&#8712; V ) and a read not concurrent with any write returns the value of the most recent write. Using the construction above, the total order on the writes respects realtime order (from Lemma 2).</p><p>This completes the proof of Theorem 2.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>C. MWMR Regular Register from BSR algorithm</head><p>Regularity is a stronger consistency condition than safety as indicated by the following theorem. WLOG, suppose server S 5 is faulty. Writer W 1 performs a write of value v 1 which completes by contacting all the servers. After w 1 completes, writers W 2 to W 5 initiate one write each that write values v 2 , v 3 , v 4 and v 5 respectively. The get-tag phase (line number 4 of Algorithm 1) of each of these writes completes quickly. The PUT-DATA message (line number 7 of Algorithm 1) sent out for each of these writes reaches servers S 2 , S 3 , S 4 and S 5 quickly and these servers S i update their local value to v i . However the other messages sent out in the put-data phase are slow. Assume the R starts a read after each server S i has updated its value to v i . All messages related to this read are fast and servers S 1 , &#8226; &#8226; &#8226; , S 5 reply with their local values which are currently v 1 , v 2 , v 3 , v 4 and v 5 respectively. As a result, the set P on line number 5 for the read is empty and the reader R returns the initial value v 0 , violating regularity.</p><p>In order to ensure regularity of operations we can modify the BSR algorithm in two different ways:</p><p>&#8226; We can send the history of writes to a reader. We change line number 9 of Algorithm 3 to send the entire history of writes (L) instead of sending just the locally available (t, v) pair. &#8226; We make the reads slow. Each read has two phases as well. A get-tag phase and a get-data phase. The get-tag phase is similar to the one in the writer algorithm. But the get-tag-resp from the servers is different. Instead of the most recent tag value, the sever sends a history of all the tags back to the reader. The reader chooses the largest tag t verified by &#8805; f + 1 servers and in the get-data phase, asks the servers for the write corresponding to this tag t. A read is complete when the reader receives f + 1 matching replies corresponding to the get-data request. These two different approaches to BSR takes into account the worst case scenario mentioned in Theorem 3 and guarantees regularity. The full algorithms and proofs will be presented in the future technical report.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>IV. BCSR ALGORITHM</head><p>In this section, we present the algorithm for Byzantine Coded Safe Register (BCSR). We will first focus our discussion on SWMR safety, as it will be easy to show that there does not exist a one-shot erasure coding-based MWMR safe register.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>A. MDS Erasure Code</head><p>In our algorithm, we rely on the MDS code that fix erroneous coded elements. Particularly, we will use</p><p>where f is the maximum number of erasures and e is the maximum number of erroneous coded elements used in decoding. The meaning of erroneous element will become clear later. In our emulation algorithm, e is bounded by 2f . Therefore, k = n -5f .</p><p>In BCSR, we use a linear [n, k] MDS erasure code <ref type="bibr">[21]</ref> over a finite field F q to encode and store the value v among the n servers. An [n, k] MDS erasure code has the property that any k out of the n coded elements, computed by encoding v, can be used to recover (decode) the value v.</p><p>For encoding, v is divided into k elements v 1 , v 2 , . . . v k with each element having size 1 k (assuming size of v is 1). The encoder takes the k elements as input and produces n coded elements c 1 , c 2 , . . . , c n as output, i.e.,</p><p>where &#934; denotes the encoder. For ease of notation, we simply write &#934;(v) to mean [c 1 , . . . , c n ].</p><p>The vector [c 1 , . . . , c n ] is referred to as the codeword corresponding to the value v. Each coded element c i also has size 1 k . In our scheme we store one coded element per server. We use &#934; i to denote the projection of &#934; on to the i th output component, i.e., c i = &#934; i (v). Without loss of generality, we associate the coded element c i with server i,</p><p>Recall that the decoder function &#934; -1 can correctly decode the original value if the input contains n -f coded elements and among these used elements, up to e may be erroneous. In our scenarios, a coded element may be erroneous if the server is Byzantine faulty or the server is slow (hence, returning stale data, i.e., an earlier version of the value).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B. BCSR Pseudocode</head><p>Below we describe the key elements of the emulation algorithm BCSR before presenting the pseudocode in Figures <ref type="figure">4, 5,</ref> and<ref type="figure">6:</ref> a) State Variables: Every server s i , for i &#8712; [n], contains a list L of pairs of tags and coded elements corresponding to the i-th elements for values stored. Initially L has a set of initial values, corresponding to the default or initial value stored in the object.</p><p>b) Write Operation: A write operation is very similar to the one in Fig 1 . The only difference is that the writers send out a coded element (PUT-DATA, (t w , c i )) instead of the complete value of the simulated register.</p><p>c) read operation: The query part of the read operation is similar to the read operation in BSR. After the (QUERY-DATA) message is sent out, r waits for responses from n -f servers in S, to receive coded element c i from server i &#8712; S. Reader r completes the read by returning the decoded value, v r , &#8592; &#934; -1 (c i ), if possible, otherwise, the default value v 0 is returned.</p><p>d) Server responses: The get-tag-resp at any server is the same as in BSR. The put-data-resp is similar to BSR except that the server stores the timestamp, code pair instead of the entire value of the register. The get-data-resp occurs when s i receives a (QUERY-DATA) from a reader r, where s i sends the locally available (t max , c max ) pair corresponding the highest tag t max in L. Send QUERY-TAG to servers in S 3:</p><p>Wait for responses from n -f servers in S 4:</p><p>Select the (f + 1)-th highest tag t 5: put-data: 6:</p><p>Create new tag tw = (t.num + 1, w).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>7:</head><p>Send (PUT-DATA, (tw, c i )) to s i for i &#8712; [n] , where c i = &#934; i (v) 8:</p><p>Wait for ACKs from n -f servers in S Fig. <ref type="figure">5</ref> BCSR for read operation, read r , r &#8712; R.</p><p>1: get-data: 2: Send (QUERY-DATA) to servers in S 3:</p><p>Wait for responses from n -f servers in S, say receiving coded element c i from server i &#8712; S 4:</p><p>Return the decoded value vr &#8592; &#934; -1 (c i ), if possible; O.W., return v 0</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>C. Correctness of BCSR</head><p>We now prove that BCSR is correct when n &#8805; 5f + 1. The following theorem can be proved similarly as in the previous section.</p><p>Theorem 4. The BSCR algorithm is live if any reader may crash fail, and any writer and up to f servers can exhibit Byzantine failure.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Lemma 4. Every well-formed execution of BCSR is safe given</head><p>Proof. Suppose a write W (v) that is not concurrent with another write completes, and a subsequent non-overlapping read R will return the the value v. We only need to consider this scenario due to the definition of MWMR safeness condition.</p><p>First, by the time W (v) completes, at least n -2f fault-free servers i have the pair (t, c i ) for some t in their local state variable.</p><p>Second, a reader then will receive &#8805; n -3f correct pair (t, c i ), i.e., the coded element is not corrupted by a faulty server, and corresponds to the most recent value written by W (V ). Therefore, among all the coded elements received by the reader, &#8804; (n -f ) -(n -3f ) = 2f are erroneous. Hence, by assumption of the decoder function, the reader will be able to decode the correct value v.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>V. LOWER BOUND FOR SAFETY OF ONE-SHOT READS</head><p>In the proofs below, we assume that there are n servers of which &#8804; f are Byzantine. We first show that there need to be enough "witnesses" to safely return a value. Lemma 5. Safety is violated if value returned by a read operation is not witnessed by at least f + 1 servers Proof. Suppose not by way of contradiction. Since a read requires at most f witness servers, the f Byzantine servers may choose to send a value v b / &#8712; V . If a read returns v b , validity (and thus safety) of the register is violated.</p><p>The following lemma directly follow form our model definition and liveness property. L &#8838; T &#215; V, initially {(t 0 , c s 0 )} 2: get-tag-resp (QUERY-TAG) from w &#8712; W: 3:</p><p>Send max{t : (t, * ) &#8712; L} to w 4: put-data-resp (PUT-DATA, (tin, cin)) received: 5:</p><p>if t in is higher than the locally available tags then 6:</p><p>Send ACK to writer w of tag t in 8: get-data-resp (QUERY-DATA) from r &#8712; R: 9:</p><p>Send (tmax, cmax) pair, where tmax &#8801; max{t : (t, * ) &#8712; L} Lemma 6. Liveness cannot be guaranteed if an operation needs to wait for more than n -f replies from servers.</p><p>For Lemma 7 and Theorem 5, we consider a system and a replication-based safe register algorithm A, with four servers s 0 , s 1 , s 2 and s 3 . The system contains two writers w 1 and w 2 , and one reader r. Suppose n = 4 and f = 1. Moreover, assume that server s 0 is Byzantine faulty. Let v 0 be the initial default value stored in the replicated register. Lemma 7. Safety cannot be guaranteed if write operations do not communicate with at least 3f servers.</p><p>Proof. Assume by contradiction A emulates a safe register where writes do not communicate with at least 3 servers. Suppose there is only one write operation W (v 1 ), writing value v 1 initiated by writer w 1 . Let the writer communicate with just two servers: s 0 and s 1 . Now, consider a read operation R from reader r that starts after W completes. Lemma 6 states that to guarantee liveness, any operation can wait for at most n -f = 3 servers. Suppose R receives replies from servers s 0 , s 2 and s 3 . Servers s 2 and s 3 , have not heard of the write W and hence they return the initial value of the register v 0 . Additionally, since s 0 is Byzantine, it falsely returns the value v 0 as a response to R. Therefore, R completes by returning the initial value v 0 . This violates safety leading to a contradiction. Thus, any write must communicate with at least 3 servers. By a simple simulation argument, the lemma is implied.</p><p>Theorem 5. It is impossible to emulate a replicated safe register and guarantee liveness of reads and writes where reads are one-shot, with n servers of which at most f &#8805; n 4 may be Byzantine faulty.</p><p>Proof. Assume by contradiction, A emulates a safe register with 4 servers of which s 0 is Byzantine faulty. Consider the following scenario: Two write operations W 1 (v 1 ) and W 2 (v 2 ) are invoked on the register by writers w 1 and w 2 , respectively.</p><p>Let W 2 (v 2 ) be invoked after W 1 (v 1 ) completes. A read operation R is invoked by a reader r other than w 1 and w 2 after W 2 (v 2 ) completes. By the correctness of A, R completes.</p><p>By Lemmas 6 and 7, each write waits for exactly 3 responses. Suppose write operation W 1 communicates with servers s 0 , s 1 , s 2 and write operation W 2 (v 2 ) communicates with servers s 0 , s 2 , s 3 . Servers s 0 , s 1 and s 2 respond to the invocation of R ny returning the whole history. Since s 0 is Byzantine it can return any arbitrary message to reader r in its response. Suppose s 0 returns v 1 instead of v 2 . Thus, R receives the values v 1 from s 0 and s 1 , and v 1 , v 2 from s 2 .</p><p>Lemma 5 states that R cannot return v 2 , as it is witnessed by only f = 1 server. Thus R returns v 1 , violating safety. Again, by the simulation argument, the theorem follows.</p><p>Remark 1. Our proof works because we assume that the algorithms or the networking layer do not use nor provide the reliable broadcast abstraction. In many prior works <ref type="bibr">[15]</ref>, <ref type="bibr">[20]</ref>, <ref type="bibr">[22]</ref>, a reader can wait until all the fault-free servers receive enough messages regarding recent write operations. In our case, it is possible that two fault-free servers would never receive the same set of messages, especially if the sender crashes.</p><p>Remark 2. Our proof can be extended to the case with multiple client-to-server communication. The only thing we exclude is the server-to-server communication. Since in that case, the reliable broadcast primitive can be implemented on top of reliable channel with n &#8805; 3f + 1 servers <ref type="bibr">[2]</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Erasure-Coding-based Register</head><p>We now focus on the EC-based register emulation. Suppose the emulation uses [n, k] code, where k = n -f -2e. The proof is similar to the one above. The difference is that now the quorum intersection between readers and writers need to be larger due to the usage of erasure code. We include the full proof below for completeness.</p><p>First, is should be easy to observe the following lemma if we have only 5f servers.</p><p>Lemma 8. Safety cannot be guaranteed if write operations do not communicate with at least 4f servers.</p><p>Then, we are ready to present the key proof. Theorem 6. It is impossible to emulate a safe register and guarantee liveness of reads and writes where reads are oneshot, with n &#8804; 5f .</p><p>Proof. Assume by contradiction, A emulates a safe register with 5 servers of which s 0 is Byzantine faulty with f = 1. Consider the following scenario: Two write operations W 1 (v 1 ) and W 2 (v 2 ) are invoked on the register by writer w 1 .</p><p>Let W 2 (v 2 ) be invoked after W 1 (v 1 ) completes. A read operation R is invoked by a reader r other than w 1 after W 2 (v 2 ) completes. By the correctness of A, R completes.</p><p>By Lemmas 6 and 8, each write waits for exactly 4 responses. Suppose write operation W 1 communicates with servers s 0 , s 1 , s 2 , s 3 and write operation W 2 (v 2 ) communicates with servers s 0 , s 2 , s 3 , s 4 .</p><p>Servers s 0 , s 1 , s 2 , s 3 respond to the invocation of R by returning the whole history of values. Since s 0 is Byzantine, it can return any arbitrary message to reader r in its response. Suppose s 0 returns the coded element corresponding to v 1 instead of v 2 . Thus, R receives the coded element corresponding to v 1 from s 0 , s 1 , s 2 , s 3 , and coded element to v 2 from s 2 and s 3 . Recall that to use the MDS code, we need to have n -f coded elements with up to e erroneous coded elements. Hence, the only choice is to return v 1 . If the algorithm chose to return v 1 , then there are one missing coded element (which is stored at s 4 ), and two erroneous (in this case, stale) coded elements (which are returned by s 0 , s 1 ). Consequently, the decoding function does not work.</p><p>Finally, by the simulation argument, the theorem follows.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>VI. RELATED WORK</head><p>Reliable computing must handle malfunctioning components that give potentially conflicting information to different parts of the system. The term "Byzantine" nodes was introduced by Pease et al. to describe such malfunctioning components. In this paper <ref type="bibr">[6]</ref>, the problem of reaching agreement or consensus was studied in the presence of Byzantine faults. Lamport et al. <ref type="bibr">[22]</ref> showed that using unforgeable or digitally signed <ref type="bibr">[19]</ref> messages, this problem is solvable if and only if more than two-thirds of the nodes not Byzantine faulty. Martin et al. <ref type="bibr">[23]</ref> present protocols for asynchronous Byzantine Quorum Systems (BQS) built on top of reliable channels by using read and write quorums of different sizes and show how to remove dependency on reliable networking. The paper by Marko Vukolic <ref type="bibr">[24]</ref> provides a detailed survey of the evolution of quorum systems for distributed storage and consensus.</p><p>Shared memory implementations on top of message-passing has been of great interest to the distributed systems community as it makes programming (for the shared memory model) simpler. The register is one of the most basic objects of computer science as most shared data structures are built using using registers as a building block at some point in their construction. Lamport <ref type="bibr">[11]</ref> defines three classes of shared read/write registers called safe, regular, and atomic which vary in their consistency conditions in the presence of concurrency.</p><p>The most famous atomic register implementation <ref type="bibr">[1]</ref> on top of an n-process asynchronous message-passing system is termed the ABD algorithm after its authors Attiya, Bar-Noy and Dolev. They showed that f &lt; n/2 (where f is the maximal number of processes that may crash and n is the number of servers in the system) is a necessary and sufficient requirement to build an atomic register on top of a crash-prone asynchronous message passing system.</p><p>Dutta et al. <ref type="bibr">[25]</ref> showed how to obtain fast crash-tolerant implementations of a single-writer/multi-reader atomic registers in which both read and write operations complete in one communication round-trip, under the constraint that the number of readers is less than n f -2. Georgiou et al. <ref type="bibr">[13]</ref> prove that no semi-fast implementation exists for the multi-reader/multiwriter atomic register even with crash failures. Mostefaoui et al. <ref type="bibr">[26]</ref> devise a new time-efficient asynchronous algorithm for atomic registers that reduces latency in many cases. Several papers <ref type="bibr">[27]</ref>, <ref type="bibr">[28]</ref> have explored mechanisms to implement waitfree multivalued registers from a collection of binary registers.</p><p>Taubenfeld <ref type="bibr">[29]</ref> considers generalizations of Lamport's notions, called k-safe, k-regular and k-atomic and provides constructions for implementing 1-atomic registers (the strongest type) in terms of k-safe registers (the weakest type). These constructions allow solving of classical synchronization problems, such as mutual exclusion <ref type="bibr">[30]</ref> and l-exclusion, using SWMR k-safe bits, for any k &#8805; 1. Shao et al. <ref type="bibr">[20]</ref> modify Lamport's definitions of a regular register to give four new consistency conditions, implementing some form of regularity for a MWMR register. They also provide algorithms to emulate multi-writer regularity for each of these newly defined consistency conditions. In <ref type="bibr">[15]</ref>, Kanjani et al. present a simple replication-based register emulation that tolerates Byzantine faults. They assume the existence of reliable broadcast, and they rely on a technique called relay <ref type="foot">5</ref> .</p><p>The importance of the register has has motivated many directions for research on this simple data structure. Pozzo et al. <ref type="bibr">[31]</ref> emulate a regular read/write register in a synchronous distributed system with anonymous clients. In their paper servers may be rational malicious Byzantine processes. The authors model this problem as a Bayesian game and design a protocol implementing the regular register that forces the rational malicious server to behave correctly. In addition to building registers from scratch, much effort has been put into building stronger wait-free registers from weaker ones. Johnen and Higham <ref type="bibr">[32]</ref> present a wait-free implementation of a singlewriter/single-reader regular register using single-writer/singlereader safe registers. Jayanti et al. <ref type="bibr">[33]</ref> implement a singlewriter/single-reader atomic register from two regular registers.</p><p>Significant gains over replication-based strategies can still be achieved while using erasure codes that can tolerate crashfailures <ref type="bibr">[16]</ref>, <ref type="bibr">[17]</ref> and Byzantine failures <ref type="bibr">[18]</ref>, <ref type="bibr">[14]</ref>. Here, we focus on Byzantine-tolerant work. In <ref type="bibr">[18]</ref>, the erasure code is used, along with cryptographic hashes to provide strong consistency guarantees. <ref type="bibr">[14]</ref> provides an erasure coded implementation of strong consistency with Byzantine failure. These works do not provide one-shot read, and assumed a reliable broadcast primitive.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>VII. CONCLUSION</head><p>This paper identifies optimal approaches to emulate MWMR replication-based safe register and SWMR erasure coding-based safe register with one-shot read. The first algorithm requires &#8805; 4f + 1 servers, whereas the second one requires &#8805; 5f + 1 servers. We prove that these numbers are optimal.</p></div><note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="1" xml:id="foot_0"><p>This paper states that across all Facebook products, read requests form around 99.8% of of all operations while write requests form only around 0.2%</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="2" xml:id="foot_1"><p>Our implementation actually provides stronger guarantees than Single-Writer-Multi-Reader safety. It can tolerate multiple writers as long as writes are not concurrent.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="3" xml:id="foot_2"><p>https://docs.riak.com/riak/kv/latest/learn/concepts/strong-consistency/ index.html</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="4" xml:id="foot_3"><p>This is possible if at least one server has heard of the put-data phase of w 1 and has sent out her ack but w 1 hasn't completed because some messages related to this write are still in transit</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="5" xml:id="foot_4"><p>In this paper, we show that by adding f more nodes into the system, we are able to make the system more practical by eliminating the usage of reliable broadcast and relay.</p></note>
		</body>
		</text>
</TEI>
