# MDS-Coded Distributed Caching for Low Delay Wireless Content Delivery

## Abstract

We investigate the use of maximum distance separable (MDS) codes to cache popular content to reduce the download delay of wireless content delivery. In particular, we consider a cellular system where devices roam in an out of a cell according to a Poisson random process. Popular content is cached in a limited number of the mobile devices using an MDS code and can be downloaded from the mobile devices using device-to-device communication. We derive an analytical expression for the delay incurred in downloading content from the wireless network and show that distributed caching using MDS codes can dramatically reduce the download delay with respect to the scenario where content is always downloaded from the base station and to the case of uncoded distributed caching.

## I Introduction

The proliferation of mobile devices and the surge of a myriad of multimedia applications has resulted in an exponential growth of the mobile data traffic. In this context, wireless caching has emerged as a powerful technique to overcome the backhaul bottleneck, by reducing the backhaul rate and the delay in retrieving content from the network. The key idea is to store popular content closer to the end users. In [1], a novel system architecture named femtocaching was proposed. It consists of deploying a number of small base stations (BSs) with large storage capacity, in which content is stored during periods of offpeak traffic. The mobile users can download content from the small BSs, which results in a higher throughput per user. In [2], it was proposed to store content directly in the mobile devices. Users can then retrieve content from neighboring devices using device-to-device (D2D) communication or, alternatively, from the serving BS.

In both scenarios, content may be stored using an erasure correcting code, which brings gains with respect to uncoded caching [3, 4, 5, 6]. The use of erasure correcting codes establishes an interesting link between distributed caching for content delivery and distributed storage (DS) for reliable data storage. The key difference is that in the wireless network scenario, data can be downloaded from the storage nodes (the small BSs or the mobile devices) but also from a serving macro BS, which has always the content available. Therefore, the reliability requirements in DS for reliable data storage can be relaxed. In [5], the placement of content encoded using a maximum distance separable (MDS) code to small BSs was investigated and it was shown that a careful placement allows to significantly reduce the backhaul rate. In [3], for the scenario where content is stored directly in the mobile devices, the repairing of the lost data when a device storing data leaves the network was considered. Assuming instantaneous repair, the communication cost of data download and repair was investigated. In [4, 6], a repair scheduling where repair is performed periodically was introduced and analytical expressions for the overall communication cost of content download and data repair as a function of the repair interval were derived. Using these expressions, the overall communication cost entailed by storing content using MDS codes, regenerating codes [7], and locally repairable codes [8] was evaluated in [6] and it was shown that storing content using erasure correcting code can reduce the overall communication cost with respect to the scenario where content is downloaded solely from the BS.

In this paper, we consider a similar cellular network scenario as the one in [3, 6], where content is stored in a number of mobile devices using an erasure correcting code. Mobile devices roam in an out of a cell according to a Poisson random process. However, as opposed to [3, 6], where the download of a single file is considered, here we consider that users may request files, of different popularity, from a library of files. Our focus is on the delay of retrieving content from the network, which was not considered in [3, 6]. We derive analytical expressions for the download delay if content is stored in the mobile devices using MDS codes and show that MDS-coded distributed caching can significantly reduce the download delay with respect to the case where content is solely downloaded from the BS and the case where uncoded caching is used. The download delay of a single file was analyzed in [9].

The remainder of the paper is organized as follows. The system model is introduced in Section II. The average download delay incurred when MDS-coded distributed caching is used is analyzed in Sections III and Section IV. Section V presents and discusses numerical results and finally some conclusions are drawn in Section VI.

Notation. The probability density function (pdf) of a random variable is denoted by and the expectation with respect to is denoted by . Probability is denoted by and represents the all-ones vector of length . We denote by the stationary distribution of an queueing system described by a Poisson birth-death process with arrival rate and departure rate per node , which is given by

where .

## Ii System Model

We consider a single cell in a cellular network where mobile devices, referred to as nodes, request files, each of size bits, from a library of files. The files have different popularities and accordingly have a given probability to be requested. Depending on the placement strategy, some files are encoded and stored into mobile devices, referred to as storage nodes. For ease of language, the set of storage nodes is referred to as the DS network and nodes not storing any content are referred to as regular nodes. A copy of each encoded file is also available at the BS serving the cell. A node requesting a file attempts to retrieve it from the storage nodes using D2D communication, and, if the file cannot be completely retrieved from the DS network, the BS assists in providing the missing data. In order to increase the system efficiency, we allow multiple D2D communications to coexist if they are sufficiently far apart in space. Therefore, we divide the cell in virtual clusters and assume that the size of the cluster and the transmit power are properly chosen such that only one D2D communication can be established between any two nodes in the cluster and the interference across different clusters can be neglected. A similar model is considered in [2, 10].

Data allocation and coding strategy.
We adopt a deterministic allocation strategy, where the most popular files are cached in a distributed fashion in storage nodes in the cell, according to the storage capacity of the devices. These files are partitioned into packets, called symbols, of bits each and are encoded into coded symbols using an MDS erasure correcting code of rate . We use the same code for every file in order to simplify the analysis.
We assume that each storage node stores a single symbol for each of the most popular files. Overall, symbols are stored in storage nodes and no two storage nodes store the same symbol.
We model the popularity of the files in the library using the time-invariant Zipf distribution [11].^{1}

(1) |

where parameter regulates the relative popularity of the files. In the following, the set of files stored in the cache of the mobile devices will be referred to as the DS library.

We assume that the mobile devices are free to move inside the cell. We consider a uniform spatial distribution of the nodes in the cell, and hence there are devices per cluster on average and among them storage nodes. We focus on a single cluster in isolation, and assume that the devices roam in and out of it. The arrival, departure and request model of the nodes are borrowed from [6]. The considered scenario is shown in Fig. 1.

Arrival-departure model. We assume that nodes arrive to the cluster according to a Poisson random process with exponential independent, identically distributed (i.i.d.) random inter-arrival times with pdf

(2) |

where is the expected arrival rate and is time, measured in time units (t.u.). The nodes stay in the cluster for an i.i.d. exponential random lifetime with pdf

(3) |

where is the expected departure rate per node. We assume that , which implies that the expected number of nodes in the cluster is . This model corresponds to an queuing model and the probability that there are nodes in the cluster is . The arrival of storage nodes to the cluster can also be described as a Poisson random process. In particular, the inter-arrival times of the set of storage nodes has pdf

The related lifetime is described by (3) and the probability that there are storage nodes in the cluster is .^{2}

DS network update. We assume that the nodes storing content that arrive to the cluster from neighboring clusters are not immediately available for download, but the BS serving the cell keeps track of them and periodically updates and broadcasts to all mobile devices the list of storage nodes in the cell every t.u.. In the sequel, parameter is referred to as the update interval and the set of storage nodes in the list broadcasted by the BS as the DS list.

Data delivery. Nodes request the file at random times with i.i.d. random inter-request time with pdf

(4) |

where is the expected request rate per node. We focus on the download process. The node that requests a file attempts to retrieve it from the DS network using D2D communication. Thanks to the MDS property, an encoded file can be reconstructed by accessing any encoded symbols. If the file cannot be completely retrieved from the DS network, the BS assists in providing the missing coded symbols. The download of a coded symbol from a storage node incurs t.u. and from the BS t.u.. We assume that due to the congestion of the BS-to-node link and the fact that D2D communication occurs over a better channel due to the reduced distance between the involved nodes. We further assume that only one D2D link at a time can be established, and that the D2D communication does not interfere with the communication between the BS and the nodes. We say that the D2D network is idle if there is no active D2D communication in the cluster. If the D2D network is not idle when one node requests the file, the whole file is downloaded from the BS. Moreover, to simplify the analysis, we assume that multiple BS-to-node links can coexist.

## Iii File Average Download Delay

We investigate the average time that is required to retrieve one file from the wireless network, referred to as the download delay. If a requested file is stored in the DS library, the requesting node attempts to retrieve it from the DS network using D2D communication, otherwise the file is entirely downloaded from the BS. Therefore, we introduce the binary random variable (RV) which describes the hitting of the DS cache, i.e., if a file of the DS library is requested and otherwise. Moreover, the D2D network can be used only if it is idle, i.e., if there are no active D2D communications. Accordingly, we introduce the binary RV that describes the status of the D2D network. if the network is idle and otherwise. If the D2D network is idle, the requesting node tries to collect the necessary coded symbols from the nodes of the DS list provided by the BS using D2D communication. If the requesting node is a storage node of the DS list, it needs to download symbols, otherwise symbols must be downloaded. We thus introduce the binary RV , which represents the type of request, i.e., for requests originating from a node that belongs to the DS list and for the other requests. The download from the storage nodes can be either fully successful or partially accomplished, in which case the requesting node turns to the BS to recover the missing symbols. On the other hand, if the D2D network is not idle and the requested file is stored in the DS library, the node downloads or symbols from the BS, depending on the type of node.

From the discussion above, the average file download delay, , may be formalized as

###### Proposition 1.

The average file download for the cellular network described in Section II where the most popular files are stored in the mobile devices using an MDS code is

(5) |

where is the average number of coded symbols downloaded per request using D2D communication and , referred to as the average D2D download delay, is the corresponding delay.

The computation of , and is addressed in Section IV. The probability of hitting the cache can be expressed as

where the probabilities are given in (1). It follows that if .

The next step is the computation of the probability that the D2D network is idle. Let be the status of the network at the time of the th request. It follows

(6) |

In order to compute , we introduce the RV that denotes the time instant of the th request. Also, let be the time during which the D2D network is occupied by the th request. The D2D network is idle at the time of the th request if none of the previous requests is still using D2D communication. Therefore, and

(7) |

Assuming that if the D2D network is not idle at time is because of the th request, the product in (7) reduces to the term involving the th request only, i.e.,

(8) | ||||

Since the requests are i.i.d. with inter-request time distributed as in (4) and on average there are nodes in the cluster, we can compute

and (8) can be written as

If ,

(9) |

and

(10) |

In (10), we used the fact that the probability of hitting the cache and the average D2D download delay are independent of the request index (if is sufficiently large), as it is proven in Lemma 1 in Section IV. Substituting (10) in (6) and after some simple calculations, we obtain

(11) |

## Iv Download From Storage Nodes

In this section, we consider the computation of the average D2D download delay and the average number of coded symbols downloaded per request using D2D communication. We assume that a node cannot download in parallel from multiple nodes, but it serially tries to download the coded file symbols from the nodes in the DS list. When a node requests the file, if the D2D network is idle and the requested file belongs to the DS library, it randomly chooses one of the storage nodes from the list supplied by the BS. After each downloaded symbol, the requesting node randomly chooses another storage node from the DS list and still alive.^{3}

To derive the average D2D download delay, we introduce three RVs describing the number of nodes of different type that are present in the cluster at the instant of a request: the number of storage nodes of the DS list, the total number of storage nodes (belonging or not to the list, the latter corresponding to the storage nodes that arrive to the cluster after the DS list update and that have not left the cluster at the time of the request), and the number of regular nodes. In particular, we denote by the RV that describes the number of storage nodes of the DS list when a request arrives. We describe by the RVs and the total number of storage nodes and the number of regular nodes at the instant of a request, respectively. Moreover, we denote by the RV that represents the total number of storage nodes (belonging or not to the DS list) at the beginning of the update interval of length . In the following three lemmas, we give a probabilistic description of the above RVs.

###### Lemma 1.

The probability that there are storage nodes of the DS list at the time of a request is

(12) |

where is the probability that is equal to , given that storage nodes are in the cluster at the beginning of the update interval of length , and is

(13) |

where and .

###### Proof.

The proof is given in Appendix A. ∎

###### Lemma 2.

The probability that there are storage nodes in the cluster at the time of a request is given by

(14) |

###### Proof.

The proof follows the same lines as the proof of Lemma 1. ∎

###### Lemma 3.

The probability that there are regular nodes in the cluster at the time of a request is given by

(15) |

###### Proof.

The proof follows the same lines as the proof of Lemma 1. ∎

Based on the above lemmas, we can compute the probability that the request originates from a storage node of the DS list and the probability of having a given number of storage nodes in the DS list at the time of the request conditioned to the type of request.

Using Bayes’ rule, the probability that there are storage node of the DS list alive at the time of a request, conditioned to the type of request, is given by

(16) |

The probability is given in Lemma 1. We now compute and . We start with the probability of having one request from the DS list conditioned to the number of storage nodes in the DS list at the time of the request. For , it can be written as

(17) |

Clearly, the condition implies that the request cannot originate from a storage node of the DS list, therefore . We approximate the probability that there are storage nodes at the instant of the request, given the number of nodes of the DS list alive, by using the steady state probability of a Poisson birth-death process with arrival rate and departure rate . In particular, we compute

(18) |

where the expectations and are obtained starting from the probabilities (14) and (12), respectively. The number of regular nodes is independent of the number of storage nodes at the instant of the request, therefore we finally have

(19) |

where is given in Lemma 3. Note that in the expression above, with some abuse of notation, we used equal sign to avoid carrying all the way the approximation sign due to the approximation introduced in (18). Starting from this result, we compute the probability that the request originates from the DS list as

(20) |

where is given in Lemma 1. The probability is easily computed as . Similarly, we have . Following the same approach for the proof of Lemma 1, it is easy to show that and are independent of the specific request (when grows large), where is the binary RV describing the type of the th request.

The case represents the case of instantaneous update, where the nodes contact directly the BS when they request a file and receive the list of the storage nodes through a dedicated link. For instantaneous update, the number of storage nodes at the instant of the request and the type of request is described by the following probabilities

(21) | |||

(22) | |||

(23) |

The probability that there are storage nodes at the time of the request given the type of request can be computed by replacing the above probabilities in (16).

In order to describe the D2D download, let be the binary RV that describes the success of the download at the first attempt. More precisely, represents the successful download of the coded symbol from the first contacted storage node. If the download is not successful from the first contacted storage node, . Similarly, we denote by the binary RV describing the download at the th attempt and we denote by , the random vector (). In the following, in Lemmas 4, 5, and 6, we derive the probability that no symbols can be downloaded from the D2D network, , the probability that the content is fully recovered from the DS network, , and the probability that it is only partially recovered, , respectively.

###### Lemma 4.

The probability that no symbols are downloaded through D2D communication, conditioned to the type of request, is given by

where is given in (16) and

(24) |

with .

###### Proof.

The proof is given in Appendix B. ∎

###### Lemma 5.

The probability that the file can be completely retrieved from the DS network, i.e., the probability that k symbols are downloaded through D2D communication when , or when , conditioned to the type of request, is given by

where is defined by the recursion

(25) |

for and , with initial condition

(26) |

and where

###### Proof.

The proof is given in Appendix C. ∎

###### Lemma 6.

The probability of consecutively download symbols and to fail the download of the th one is

where , , and is given in (25).

###### Proof.

The proof follows the same lines as the proof of Lemma 5. ∎

Finally, the average D2D download delay and the average number of downloaded symbols from DS network are given in the following theorem.

###### Theorem 1.

Consider the network described in Section II, where an MDS erasure correcting code is employed and where there are storage nodes in the cluster on average. Let be the time to download a symbol through D2D communication. The average D2D download delay and the corresponding average number of downloaded symbols are given by

where is the probability that the request comes from a storage node of the DS list, and

where for and otherwise.

###### Proof.

The average D2D download delay is obtained as the sum of the average D2D delays in the case of requests originated from the DS list and of requests originating from the other nodes, weighted by the probabilities and , respectively. The same approach is used for the corresponding average number of downloaded symbols. According to our model, the requesting node completes the download of symbols from the DS network in t.u. with probability , while the partial download of symbols happens with probability and incurs t.u.. For , in the computation of the average D2D download delay, we also consider the case where download from the DS network completely fails. The corresponding probability is and the delay is . When the request originates from the DS list and , i.e. , no symbols need to be downloaded, therefore and are equal to zero. ∎

###### Corollary 1.

The average D2D download time for the th request, , is independent of the specific request if the index is sufficiently large.

###### Proof.

Similarly to the average D2D download delay, is

where

The Lemma follows from the fact that the probabilities in the expressions above are independent of , when grows large. ∎

## V Numerical Results

In this section, we evaluate the average download delay when content is cached using MDS codes for a cluster with nodes on average, departure rate , and request rate . We compare the average file download delay of the considered network with MDS-coded DS with the delay of the traditional scenario where the content is solely downloaded from the BS, denoted by and with uncoded caching. In the following, with no loss of generality, we set t.u..

We recall that each file that is cached in the DS library is divided into symbols, and encoded using an () MDS code, where is the number of storage nodes in the cell. The code parameters are chosen such that . In this way, the average storage overhead in a cluster, , is positive, which increases the probability that the content is downloaded through D2D communication only. Alternatively, we can use the same MDS code for each cluster, but in this case the BS must continuously restore the initial state of reliability of the DS network when storage nodes leave the clusters [6].

We first consider the special case where , therefore the probability of hitting the cache is . In Figs. 2–4, we show the gain that can be achieved using MDS-coded caching, by reporting the ratio between and as a function of the update interval . The infinite series involved in the computation of are truncated to a given value , chosen according to when involving the number of storage nodes and to when involving the number of nodes in general. We fix the ratio to be , and consider several MDS codes. Moreover, we also consider an uncoded scenario where one storage node on average in the cluster stores the uncoded files. In Figs. 2, 3, and 4, is , , and times, respectively, smaller than . In the figures, the solid lines correspond to the analytical closed-form expressions derived in the previous sections and markers correspond to simulation results. It is observed that the analytical expressions predict very well the actual performance, which shows the goodness of the approximations introduced in (11) and (18). The results clearly show that MDS-coded DS can greatly improve the performance in terms of content download delay with respect to the case where content is downloaded from the BS, provided that the update interval, , is sufficiently small. For example, for and , a speed-up factor of around in the download is achieved with respect to the case of downloading from the BS using a MDS code. Interestingly, the results also show that the performance improves when increases. In particular, simple replication (repetition coding) is very inefficient and much better performance are achieved using larger MDS codes (of the same rate).

We now consider the more general case where only part of the library of files is cached in the devices. We assume that the library has a size of files, and each storage node stores one symbol for each of the most popular files. We assume that the each file is of size MB, which corresponds to a -minutes video. We further assume that each storage node makes GB available for caching. In this case, the number of cached files , that corresponds to the number of symbols cached by each storage node, increases by increasing , since the size of one encoded symbols is MB and is clearly obtained by dividing the storage capacity of the node by the symbol size. In Fig. 5, we show the download speedup factor as a function of the parameter , which regulates the relative popularity of the files. For example, a large value of represents the case where few popular files are responsible for the majority of the download traffic. The figure refers to the case where and . The results confirm the gain that can be achieved by MDS-coded distributed caching, but highlight another important aspect. When the whole library is not cached in the network, i.e., , the gain reduction is not negligible, especially for low values of . This fact suggests that the adopted deterministic allocation, where the most popular files are equally stored in the DS network, is suboptimal.

## Vi Conclusions

In this paper, we considered the cache of popular content in the mobile devices of a cellular network using maximum distance separable erasure correcting codes to speed-up content delivery. We derived analytical expressions for the average download delay and showed that MDS-coded distributed caching may dramatically reduce the download delay with respect to the traditional case where content is always downloaded from the base station.

## Appendix A Proof of Lemma 1

We denote by the number of storage nodes available for download at the time of the th download request, i.e., the number of storage nodes of the DS list that have not left the cluster at the time of the request. We compute by averaging over an infinite number of requests,

(27) |

Similarly, let be the number of storage nodes at the beginning of the update interval wherein the th request arrives, denoted by . We have

(28) |

In [6], it was shown that the probability does not depend on (when grows large), and is given by (13). Its derivation is based on the observation that the number of storage nodes available for download in the update interval is described by a Poisson death process. The probability can be written as

(29) |

where in the second equality we used Bayes’ rule. In (29), is the number of storage nodes at the beginning of the update interval, which is described by a birth-death Poisson process, thus . The probability is the probability that there is at least one request in . It depends on the inter-request time, which in turn depends on the number of nodes in the cluster. Therefore, we compute

where is the probability that the inter-request time is shorter than when nodes are present in the cluster. Similarly, we compute as

where is the probability that there are nodes in the cluster, given that there are storage nodes. Since these probabilities are independent of the specific request, we conclude that is also independent of . Substituting (29) into (28), we observe that is also independent of and using (27) we prove the lemma.

## Appendix B Proof of Lemma 4

We compute the conditional probability that no symbols are downloaded by averaging over an infinite number of requests,

where is the RV describing the download of the first symbol for the th request. We now consider the computation of . The recovery of the first symbol fails with probability if the requesting node leaves the cell before completing the download. It also fails if the requesting node stays in the cluster but no storage nodes are available or if it chooses to download from a storage node which departs before t.u. from the start of the download. Let be the departure time of the node which places the th request and let be the event that the node which places the th request stays in the network for more than t.u. from the start of the download. The corresponding probability does not depend on and is easily computed as . Similarly, the probability that the requesting node departs before t.u. from the start of the download is . Therefore, the conditional probability that the th request fails the first symbol download is

(30) |

Let be the number of storage nodes useful for download for the th request, i.e., the number of storage nodes in the DS list that have not left the cluster at the time of the th request, excluding the requesting node itself if it belongs to the DS list. Let the number of departures in t.u. among the storage nodes. The probability can be written as

(31) |

Equation (31) is obtained by observing that the probability that the download of the first symbol fails conditioned to and is independent of the type of request, and that the number of useful storage nodes and the number of departures in t.u. among them is independent of the departure of the requesting node. The probability is equal to 1 if there are no useful storage nodes, i.e., . Otherwise, it equals the probability to choose one of the storage nodes that leave the cell in t.u., i.e., , with . We observe that the number of departures of useful storage nodes conditioned to their number is independent of the type of request and that the number of storage nodes useful for download is related to by

since when the request originates from a storage node of the DS list, the requesting node itself is not counted among the useful storage nodes. Therefore, the probability can be written as

(32) |

We denote by the probability , given in (24). Its derivation is similar to that of [6]. The probability is independent of the specific request and is given by (16).

After simple manipulations, we finally obtain

(33) |

Since the probabilities involved in (33) are all independent of , the lemma is proved.

## Appendix C Proof of Lemma 5

To evaluate the probability of complete download from the DS network, we start with the following limit,

where and describes the successful symbol download at the th attempt of the th request. We consider the th request and, similarly to the proof of Lemma 4, we will find that this probability is independent of . We denote by the RV the number of storage nodes useful for download at the time of the th attempt of the th request, i.e., the storage nodes of the DS list not yet contacted, excluding the requesting node if it belongs to the DS list. We denote by the RV the number of departures in t.u. among the nodes. We also denote by the event that the node which places the th request stays in the network for more than t.u. from the start of the download. The corresponding probability does not depend on and is given by . The probability of complete download is zero if the requesting node departs before t.u. from the start of the download, therefore we can write

(34) |

The probability can be written as