0904.4057v2
0904.4057v2
b b b bb bb
b b b b
b b b
b b b
b bb b bb b
b
b
Abstract—We consider large-scale wireless sensor networks
b b
bb b bb b b b b b
bbb b
b
b
b b
with n nodes, out of which k are in possession, (e.g., have sensed b b b b bbbb bb
b
b
b
b b bb
b b b
or collected in some other way) k information packets. In the bb b b
b b b
b
b
bb b
b
b b b b b
b
b
bb bb b b b
b
b
b b b
b
bb b
b b
arXiv:0904.4057v2 [cs.IT] 27 Oct 2009
I. I NTRODUCTION
Wireless sensor networks consist of small devices (sensors) Fountain codes have also been considered because they
with limited resources (e.g., low CPU power, small bandwidth, are rateless and because of their coding efficiency and low
limited battery and memory). They are mainly used to monitor complexity. In [9] Dimakis el al. proposed a decentralized
and detect objects, fires, temperatures, floods, and other phe- implementation of Fountain codes using fast random walks to
nomena [1], often in challenging environments where human disseminate source data to the storage nodes and geographic
involvement is limited. Consequently, data acquired by sensors routing over a grid, which requires every node to know its
may have short lifetime, and any processing of such data location. In [10], Lin et al. proposed a solution employing
within the network should have low complexity and power random walks with stops, and used the Metropolis algorithm
consumption [1]. to specify transition probabilities of the random walks.
Consider a wireless sensor network with n sensors, where k In another line of work, Kamra et al. in [11] proposed
sensors collect(sense) independent information. Because of the a novel technique called growth coding to increase data
network vulnerability and/or inaccessibility, it is desirable to persistence in wireless sensor networks, that is, the amount
disseminate the acquired information throughout the network of information that can be recovered at any storage node at
so that each of the n nodes stores one (possibly coded) any time period whenever there is a failure in some other
packet and the original k source packets can be recovered nodes. In [12], Lin et al. described how to differentiate
in a computationally simple way from any k(1 + ǫ) of nodes data persistence using random linear codes. Network coding
for some small ǫ > 0. Two such scenarios are of particular has also been considered for distributed storage in various
practical interest: to have the information acquired by the networks scenarios [13]–[17].
k sensors recoverable (1) locally from any neighborhood All previous work assumes some access to global informa-
containing k(1+ǫ) nodes or (2) from the last k(1+ǫ) surviving tion, for example, the total numbers of nodes and sources,
nodes. Fig. 1 illustrates such an example. which, for large-scale wireless sensor networks, may not be
Many algorithms have been proposed to solve related dis- easily obtained or updated by each individual sensor. By
tributed storage problems using coding with either centralized contrast, the algorithms proposed in this paper require no
or mostly decentralized control. Reed-Solomon based schemes global information. For example, in [10], the knowledge of
have been proposed in [2]–[5] and Low-Density Parity Check the total number of sensors n and the number of sources k is
codes based schemes in [6]–[8], and references therein. required to calculate the number of random walks that each
source has to initiate, and the probability of trapping data at
Manuscript received January 29, 2009; revised August 7, 2009. each sensor. The knowledge of the maximum node degree (i.e.,
Parts of this work were presented in IPSN’08 and ISIT’08 conferences.
Z. Kong is with the Department of Electrical Engineering, Yale University, the maximum number of node neighbors) of the graph is also
New Haven, CT 06520, USA, (email: [email protected]). required to perform the Metropolis algorithm. Furthermore, the
S. A. Aly is with the Department of Computer Science, Texas A&M algorithms proposed in [10] request each sensor to perform
University, College Station, TX 77843, USA, (email: [email protected]).
E. Soljanin is with Bell Laboratories, Alcatel-Lucent, Murray Hill, NJ encoding only after receiving enough source packets. This
07974, USA, (email: [email protected]). demands each sensor to maintain a large temporary memory
IEEE JOURNAL ON SELECTED AREAS IN COMMUNICATIONS, TO APPEAR IN 2010 2
buffer, which may not be practical in real sensor networks. or the Robust Soliton√distribution, which is defined as follows:
In this paper, we propose two new algorithms to solve Let R = c0 ln(k/δ) k, where c0 is a suitable constant and
the distributed storage problem for large-scale wireless sen- 0 < δ < 1. Define
sor networks: LT-Codes based distributed storage (LTCDS)
R/dk, d = 1, . . . , k/R − 1,
algorithm and Raptor Codes based distributed storage (RCDS) τ (d) = R ln(R/δ)/k, d = k/R, (3)
algorithm. Both algorithms employ simple random walks.
0, d = k/R + 1, . . . , k.
Unlike all previously developed schemes, both LTCDS and
RCDS algorithms are truly distributed. That is, except for The Robust Soliton distribution is given by
their own neighborhoods, sensors do not need to know any τ (d) + ΩI (d)
global information, e.g., the total number of sensors n, the ΩR (d) = Pk , d = 1, 2, . . . , k. (4)
i=1 τ (i) + ΩI (i)
number of sources k, or routing tables. Moreover, in both
algorithms, instead of waiting until all the necessary source Raptor codes are concatenated codes whose inner codes are
packets have been collected to perform encoding, each sensor LT and outer codes are traditional erasure correcting codes.
makes decisions and performs encoding upon each reception They have linear encoding and decoding complexity [21].
of a source packet. This mechanism significantly reduces the If each node in the network ends up storing an LT or Raptor
node’s storage requirements. code output block corresponding to the k source blocks, then
The remainder of this paper is organized as follows. In the the k source blocks can be recovered in a computationally
Sec. II, we introduce the network and coding model. In simple way from any k(1 + ǫ) of nodes for some small ǫ > 0,
Sec. III, we present the LTCDS algorithm and provide its [20], [21]. For different goals, different distributions Ω may be
performance analysis. In Sec. IV, we present the RCDS of interest. Our storage algorithm can take any Ω as its input.
algorithm. In Sec. V, we present simulation results for various
performance measures of the proposed algorithms III. LT C ODES BASED A LGORITHMS
II. N ETWORK AND C ODING M ODELS A. Algorithm Design
We model a wireless sensor network consisting of n nodes The goal of our storage algorithm is to have each of the
as a random geometric graph [18], [19], as follows: The nodes n nodes store an LT code output block corresponding to
are distributed uniformly at random on the plane and all have the k input (source) blocks without involvement of a central
communication radii of 1. Thus, two nodes are neighbors and authority. To achieve this goal, a node in a network would
can communicate iff their distance is at most 1. Among the n have to store, with probability Ω(d), a binary sum (XOR)
nodes, there are k source nodes (uniformly and independently of d randomly and independently chosen source packets. Our
picked from the n) that have independent information to be main idea to approach this goal in a decentralized way is to
disseminated throughout the network for storage. A similar (1) disseminate the k source packets throughout the network
model was considered in [10]. Our algorithms and results by k simple random walks and (2) XOR a packet “walking”
apply for many network topologies, e.g., regular grids of [3]. through a node with a probability d/k where d is chosen at
We assume that no node has knowledge about the locations the node randomly according to Ω.
of other nodes and no routing table is maintained; thus the To ensure that each of the k random walks at least once
algorithm proposed in [3] cannot be applied. Moreover, we visits each network node, we will let the random walks last
assume that no node has any global information, e.g., the longer than the network (graph) cover time [22], [23].
total number of nodes n, the total number of sources k, or Definition 1: (Cover Time) Given a graph G, let Tcover (u)
the maximal number of neighbors in the network. Hence, the be the expected length of a simple random walk that starts at
algorithms proposed in [10] cannot be applied. We assume node u and visits every node in G at least once. The cover
that each node knows its neighbors. Let N (u) denote the set time of G is defined by Tcover (G) = maxu∈G Tcover (u).
of neighbors of u. We will refer to the number of neighbors Lemma 2 (Avin and Ercal [24]): Given a random geomet-
of u as the node degree of u, and denote it by µ(u) = |N (u)|. ric graph G with n nodes, if it is a connected graph with high
The mean degree of a graph G is then given by probability, then
1 X Tcover (G) = Θ(n log n). (5)
µ= µ(u). (1)
|V |
u∈G
In addition, the probability that a random walk on G will
For k source blocks {x1 , . . . , xk } and a probability dis- require more time than Tcover (G) to visit every node of G
tribution Ω over the set {1, . . . , k}, a Fountain code with is O(1/n log n) [22]. Therefore, we can virtually ensure that
parameters (k, Ω) is a potentially limitless stream of output a random walk visits each network node by requiring that it
blocks {y1 , y2 , . . . } [20], [21]. Each output block is generated makes C1 n log n steps for some C1 > 0. To implement this
by XORing d randomly and independently chosen source requirement for the k random walks, we set a counter for each
blocks, where d is drawn from Ω(d). source packet and increment it after each transmission. Each
LT (Luby Transform) codes [20], [21] are Fountain codes time a node receives a packet whose counter is smaller than
that employ either the Ideal Soliton distribution C1 n log n, it accepts the packet for storage with probability
1/k, d = 1, d/k (where d is chosen at the node according to Ω), and then,
ΩI (d) = (2)
1/[d(d − 1)], d = 2, 3, . . . , k, regardless of the acceptance decision, it forwards the packet
IEEE JOURNAL ON SELECTED AREAS IN COMMUNICATIONS, TO APPEAR IN 2010 3
to one of its randomly chosen neighbors. Packets older than Definition 7: (LTCDS Algorithm)
C1 n log n are discarded. with system parameters C1 , C2 > 0 and Ω
Note that the above procedure requires the knowledge of n Initialization Phase
and k at each node. To devise a fully decentralized storage Each source node s, s = 1, . . . , k
algorithm, we note that each node can observe (1) how often 1) attaches a header to its data xs , containing its ID and a
it receives a packets and (2) how often it receives a packets life-counter c(xs ) set to zero, and then
from each source. Naturally, one expects that these numbers 2) sends its packet to a randomly selected neighbor.
depend on the network connectivity (µ(u) for all u), the size Each node u sets its storage yu = 0.
of the graph n, and the number of different random walks k. Inference Phase (at all nodes u)
We next describe this dependence and show how it can be 1) Suppose xs(u)1 is the first source packet that visits u,
used to obtain local estimates of global parameters. (j)
and denote by ts(u)1 the time when xs(u)1 makes its j-th
The following definitions and claims either come from [22],
visit to u. Concurrently, u maintains a record of visiting
[23], [25], or can be easily derived based on the results therein.
times for all packets xs(u)i “walking” through it. Let
(j)
Definition 3: (Inter-Visit Time) For a random walk on a ts(u)i be the time when source packet xs(u)i makes its
graph, the inter-visit time of node u, Tvisit (u), is the amount j-th visit to u. After xs(u)1 visits u C2 times, where
of time between any two consecutive visits of the walk to u. C2 > 0 is system parameter, u stops this monitoring
Lemma 4: For a node u with node degree µ(u) in a random and recoding procedure. Denote by k(u) the number of
geometric graph, the mean inter-visit time is source packets that have visited at least once until that
time.
E[Tvisit (u)] = µn/µ(u), (6) 2) Let J(s(u)i ) be the number of visits of source packet
where µ is the mean degree of the graph given by (1). xs(u)i to u and let
Lemma 4 implies n = µ(u)E[Tvisit (u)]/µ. While node u J(s(u)i )−1
1 X (j+1) (j)
can easily measure E[Tvisit (u)], the mean degree µ is a piece Ts(u)i = ts(u)i − ts(u)i
J(s(u)i ) − 1
of global information and may be hard to obtain. Thus we j=1
make a further approximation and let the estimate of n by 1
(J(s(u) )) (1)
= ts(u)i i − ts(u)i . (10)
node u be J(s(u)i ) − 1
n̂(u) = E[Tvisit (u)]. (7) Then, the average inter-visit time for node u is
Note that to estimate n, it is enough to consider only one k(u)
1 X
of the k random walks. Now to estimate k, we also need to T̄visit (u) = Ts(u)i . (11)
k(u) i=1
consider the k walks jointly without distinguishing between
packets originating from different sources. (1) (J(s(u)i ))
Let Jmin = min {ts(u)i } and Jmax = max{ts(u)i }.
Definition 5: (Inter-Packet Time) For multiple random s(u)i s(u)i
walks on a graph, the inter-packet time of node u, Tpacket (u), Then the inter-packet time is
is the amount of time between any two consecutive visits by Jmax − Jmin
any of the walks to u. T̄packet (u) = P , (12)
s(u)i J(s(u)i )
Lemma 6: For a node u with node degree µ(u) in a random
geometric graph with k simple random walks, the mean inter- and u can estimate n and k as
packet time is T̄visit (u)
n̂(u) = T̄visit (u) and k̂(u) = . (13)
T̄packet (u)
E[Tvisit (u)] µn
E[Tpacket (u)] = = , (8) 3) In this phase, the counter c(xsi ) of each source packet
k kµ(u)
c(xsi ) is incremented by one after each transmission.
where µ is the mean degree of the graph given by (1). Encoding and Storage Phase (at all nodes u)
Proof: For a given node u, each of the k random walks has 1) Node u draws dc (u) from {1, . . . , k̂(u)} according to
µn
expected inter-visit time µ(u) . We now view this process from Ω.
another perspective: we assume there are k nodes {v1 , . . . , vk } 2) Upon reciving packet x, if c(x) < C1 n̂ log n̂, node u
uniformly distributed in the network and an agent from node • puts x into its forward queue and increments c(x).
u following a simple random walk. Then the expected inter- • with probability dc (u)/k̂, accepts x for storage and
visit time for this agent to visit any particular vi is the same updates its storage variable yu− to yu+ as
µn
as µ(u) . However, the expected inter-visit time for any two
µn
nodes vi and vj is k1 µ(u) , which gives (8). yu+ = yu− ⊕ xs , (14)
Based on Lemmas 4 and 6, that is equations (6) and (8), we If c(x) < C1 n̂ log n̂, x is removed from circulation.
see that each node u, can estimate k as 3) When a node receives a packet before the current round,
it forwards its head-of-line (HOL) packet to a randomly
k̂(u) = E[Tvisit (u)]/E[Tpacket (u)]. (9)
chosen neighbor.
We are now ready to state the entire storage algorithm: 4) Encoding phase ends and storage phase begins when
each node has seen its k̂(u) source packets.
IEEE JOURNAL ON SELECTED AREAS IN COMMUNICATIONS, TO APPEAR IN 2010 4
Remark: One interesting implication of (15) and (17) is that 2) Each of the remaining n − k nodes chooses to serve
in order to achieve the same performance as that of original LT as a parity node with probability (m − k)/(n − k).
codes, more than (1 − e−2 /2)−1 K ≈ 1.07K nodes, but less These parity nodes and the original source nodes are
than (1 − e−2 )−1 K ≈ 1.15K nodes are required to recover pre-coding output nodes. Each pre-coding output node
the original k source packets. w generate a random number a(w) according to the
Another main performance metric is the transmission cost following distribution:
of the algorithm, which is characterized by the total number of d k−d
transmissions (the total number of steps of k random walks). k E[b] E[b]
Pr(a(w) = d) = 1− ,
Theorem 9: The total number of transmissions of the d m m
LTCDS algorithm is Θ(kn log n). P
where E[b] = b bPLDPC (b).
Proof: In the interference phase of the LTCDS algorithm, the 3) Each node that has packets in its forward queue before
total number of transmissions is upper bounded C ′ n for some the current round sends its HOL packet to one of its
constant C ′ > 0. That is because each node needs to receive randomly chosen neighbors.
the first visit source packet for C2 times, and by Lemma 4, 4) When a node u receives a packet x with c(x) <
the mean inter-visit time is Θ(n). In the encoding phase, C3 n log(n), u puts the packet into its forward queue
in order to guarantee that each source packet visits all the and increments the counter.
nodes, the number of steps of each of the k random walks is 5) Each pre-coding output node w accepts the first a(w)
required to be Θ(n log n). Since there are k source packets, copies of different a(w) source packet with counters
the total number of transmissions algorithm is Θ(kn log n). c(x) ≥ C3 n log(n), and updates w’s pre-coding result
each time as
Note that the algorithm proposed in [10] has similar order + −
yw = yw ⊕ x. (18)
of total number transmissions. If geometric information is
available,
√ as in [9], the complexity can be reduced, e.g., If a copy of x is accepted, it will not be forwarded
Θ(k n log n) for the algorithm proposed in [9]. any more, and w will not accept any other copy of xsj .
When the node w completes a(w) updates, yw becomes
IV. R APTOR C ODES BASED A LGORITHMS its pre-coding packet.
Recall that Raptor codes are concatenated codes whose
inner codes are LT and outer codes (pre-codes) are tradi- V. P ERFORMANCE E VALUATION
tional erasure correcting codes. For the pre-codes will use
is randomized LDPC codes with k inputs and m outputs We evaluate the performance of LTCDS and RCDS algo-
(m ≥ k). Assume n and k are known or have been estimated rithms by simulation. Our main performance metric is the
at every node. To perform the LDPC coding for k sources successful decoding probability vs. the query ratio.
in a distributed manner, we again use simple random walks. Definition 11: The query ratio η is the ratio between the
Each source node first generates b copies of its own source number of queried nodes h and the number of sources k:
packet, where b follows some distribution PLDPC defining the η = h/k. (19)
LDPC precode. (See [21] for the design of randomized LDPC
codes for Raptor codes.) These b copies are then sent into Definition 12: (successful decoding) We say that decoding
the network by random walks. Each of the remaining n − k is successful if it results in recovery of all k source packets.
nodes in the network chooses to serve as a parity node with For a query ratio η, we evaluate Ps by simulation as follows:
probability (m − k)/(n − k). We refer to the parity nodes Let h = ηk denote the number of queried nodes. We select
(uniformly at random) 10% of the nh possible subsets of
together with the original (systematic) source nodes as the
pre-coding output nodes. All pre-coding output nodes accept size h of the n network nodes, and try to decode the k
a source packet copy with the same probability; consequently, source packets from each subset. Then the fraction of times
the b copies of a given source packet get distributed uniformly the decoding is successful measures our Ps .
among all pre-coding output nodes. In this way, we have m Fig. 2 shows the decoding performance of LTCDS algorithm
pre-coding output nodes, each of which contains an XOR of a with known n and k. For Ω, we chose the Ideal Soliton
random number of source packets. The detailed description of distribution (2). The network is deployed in A = [0, 5]2 with
the pre-coding algorithm is given below. After obtaining the m density λ = 40 9 , and the system parameter C1 = 3. From the
pre-coding outputs, to obtain Raptor codes based distributed simulation results, we can see that when the query ratio is
storage, we apply the LTCDS algorithm with these m nodes above 2, the successful decoding probability Ps is about 99%.
as new sources and an appropriate Ω as discussed in [21]. When n increases but k/n and η remain constant, Ps increases
Definition 10: (Pre-coding Algorithm) when η ≥ 1.5 and decreases when η < 1.5. This is because
1) Each source node s, s = 1, . . . , k draws a random when there are more nodes, it is more likely that each node
number b(s) according to the distribution of predefined has the Ideal Soliton distribution.
LDPC codes, generates b(s) copies of its source packet In Fig. 3, we fix η to 1.4 and 1.7 and k/n = 0.1. From the
xs with its ID and a counter c(xs ) with an initial value results, it can be seen that as n increases, Ps increases until it
of zero in the packet header, and sends each of them to reaches a plateau, which is the successful decoding probability
one of its randomly chosen neighbors. of LT codes.
IEEE JOURNAL ON SELECTED AREAS IN COMMUNICATIONS, TO APPEAR IN 2010 6
1 1
0.7 0.7
0.6 0.6
0.5 0.5
0.4 0.4
0.3 0.3
Fig. 2. Performance of LTCDS with known n and k for (a) n=200, k=20; Fig. 4. Performance of LTCDS algorithm with small number of nodes and
(b) n=500, k=50; and (c) n=1000, k=100. sources for (a) known n=100 and k = 10; (b) known n=200 and k = 20;
(c) unknown n=100 and k = 10; (d) unknown n=200 and k = 20.
1
1
0.95
Successful Decoding Probability Ps
0.9
0.9
1 400
100
0.9 350
s
80
Successful Decoding Probability P 300
0.8
Number of nodes
Number of nodes
250
60
0.7
200
0.6 40 150
100
0.5 20
50
0.4
0 0
0 500 1000 1500 2000 2500 0 50 100 150
0.3 Estimation of n Estimation of k
Fig. 6. Performance of LTCDS algorithm with different system parameter [6] C. Huang and L. Xu, “Star: An efficient coding scheme for correcting
C1 for two cases: (a) n = 500 and k = 50, (b) n = 1000 and k = 100. triple storage node failures,” in Proc. 4th Usenix conference on file and
storage technologies (FAST ’05), San Francisco, CA, USA, pp. 15–15,
2005.
1 [7] J. S. Plank, “Erasure codes for storage applications,” in (Tutorial)Proc.
0.9 4th Usenix conference on file and storage technologies (FAST ’05), San
Francisco, CA, USA, 2005.
Successful Decoding Probability Ps
Number of nodes
20 80 [21] A. Shokrollahi, “Raptor codes,” IEEE Tran. Information Theory, vol. 52,
15 60
pp. 2551–2567, 2006.
[22] D. Aldous and J. Fill, Reversible Markov Chains and
10 40 Random Walks on Graphs. Preprint, available at
5 20
http://statwww.berkeley.edu/users/aldous/RWG/book.html, 2002.
[23] S. Ross, Stochastic Processes. New York: Wiley, second ed., 1995.
0
0 100 200 300 400 500
0
0 10 20 30 40 [24] C. Avin and G. Ercal, “On the cover time of random geometric graphs,”
Estimation of n Estimation of k in Proc. 32nd International Colloquium of Automata, Languages and
(a) (b) Programming (ICALP’05), Lisboa, Portugal, pp. 677–689, July, 2005.
[25] R. Motwani and P. Raghavan, Randomized Algorithms. Cambridge
Fig. 8. Histograms for estimates of n (a) and k (b) in LTCDS algorithm University Press, 1995.
with n = 200 and k = 20.