#### Abstract

Caching content by users constitutes a promising solution to decrease the costly transmissions with going through the base stations (BSs). To improve the performance of in-network caching in device-to-device (D2D) communications, caching placement and content delivery should be jointly optimized. To this end, we jointly optimize caching decision and content discovery strategies by considering the successful content delivery in D2D links for maximizing the in-network caching gain through D2D communications. Moreover, an in-network caching placement problem is formulated as an integer nonlinear optimization problem. To obtain the optimal solution for the proposed problem, Lagrange dual decomposition is applied in order to reduce the complexity. Simulation results show that the proposed algorithm has a near-optimal performance, approaching that of the exhaustive search method. Furthermore, the proposed scheme has a notable in-network caching gain and an improvement in traffic offloading compared to that of other caching placement schemes.

#### 1. Introduction

The recent explosion in the number of smart mobile devices and new applications has caused data traffic to rise sharply, which challenges the capacity of network infrastructure. To address this, caching has been leveraged as an efficient way that increases offloading demand for various types of contents [1, 2] and recognized as a service component of future 5G networks [3].

D2D communication is a new technology that enables mobile users to communicate directly with neighboring users, without going through the BSs. In particular, D2D communication can enable caching and sharing of content of common interest with nearby devices [4].

Recent research has focused on caching placement in D2D communications from different perspectives. However, due to the limited storage capacity at devices, two main challenges exist in employing caching at D2D communications: the content preference of devices should be considered in cache placement and ways to maximize content sharing via D2D communication should be found. The authors of [5] formulated a problem of the selection of communication pairs with a high transmission rate, in which devices without the caching and matching mechanism cannot utilize D2D communication. Although this work presents a distributed caching mechanism and maximal cellular traffic offloading with D2D communications, it does not address the success of content delivery over a D2D link sufficiently. However, joint optimization of caching and discovery, with consideration of successful content delivery among devices, is crucial for improving the performance of D2D caching network.

In this paper, we describe a joint design of caching decision and content discovery strategy to improve the performance of in-network caching in D2D communications. We model the in-network caching placement as a joint optimization problem of caching decision and content discovery strategy by deriving the probability of success for a content delivery to maximize in-network caching gain. The optimization problem is formulated as an integer nonlinear problem. To reduce the complexity and obtain a near-optimal solution, dual decomposition is used to solve the maximization problem. Simulation results demonstrate that the proposed scheme provides a distributed solution that can achieve performance comparable to that of exhaustive search. This will allow us to characterize the optimality test of the proposed algorithm, compared to that of the optimal search-based solution. Further, the performance of the proposed scheme is markedly greater than that of other caching placement policies.

The remainder of this paper is organized as follows. In Section 2, we summarize the related work. Section 3 describes the model and defines the probability of success for a content delivery. In Section 4, the joint caching decision and content discovery optimization problem framework is formulated and defined as an in-network caching placement problem. In Section 5, we analyze the proposed optimization problem. In Section 6, the simulation results are discussed, and the conclusions of the study are presented in Section 7.

#### 2. Related Work

Wireless D2D caching networks have been studied in different ways. Cooperative caching at base stations can improve the spectral efficiency gain [6, 7] and reduce the impact on the backhaul network [8, 9]. When cooperative caching occurs between BSs and devices, the network performance can be improved when cache placement is optimally designed [10], and content delivery delay can be decreased [11, 12]. By caching the popular files on mobile devices and exploiting D2D communications, content distribution in cellular networks and the system capacity can be enhanced [13].

Several studies on D2D networks have focused on different aspects of the caching placement policy to improve the efficiency of cache [14–18]. The authors of [14] showed an optimal caching placement scheme to maximize the offloading probability with considering the impact of transmission device availability. In [15], the authors described a probabilistic caching placement scheme that takes the cache-aided throughput into account; it measures the density of successfully served requests through own local cache of the user or through its nearby devices via D2D transmission. Moreover, in [16], the authors identified a conflict between the cooperative distance (i.e., the distance at which a device can find a requested content cached on another device) and interference and focused on the optimal caching distribution to maximize the average number of connections. The authors of [17] modeled the distribution of the total number of observed requests and analyzed cache performance focusing on the tradeoff between the cache insertion rate and the cache miss rate. The authors of [18] provided closed-form expressions for the optimal content caching distribution and the optimal caching strategies that aimed to maximize the average density of successful receptions in the presence of interference and noise. In these studies, caching placement strategies have often overlooked the following issues: first, it is unclear whether a cache-enabled user is interested in caching a specific content; second, it is not known which user, who has already cached the desired content, can serve a requesting user through a D2D link or a cellular link.

There are also a few existing works that have addressed the joint design of caching and association strategies. In [19], the authors proposed a joint design caching and routing policy that minimizes the requests routed to the macro base station (MBS) by considering the scenario of content delivery that is satisfied by the small cell base stations (SBSs). The authors of [20] investigated the joint design and optimization of the user association and caching policy to minimize the average delay of small cell users, which is aware of the transmission delay over the backhaul.

However, most of these works have largely focused on how a user can be associated efficiently with BSs (MBS and SBS) in the joint strategy, and ignored exploiting D2D communications. Exploring the joint caching and association policy design in D2D communications is the goal of this paper.

#### 3. System Model and Successful Content Delivery Criterion

##### 3.1. System Model

We consider the locations of the base stations (BSs), and the users are modeled as two homogeneous Poisson point processes (PPPs) denoted as and with density and , respectively, such that . We assume a D2D communications system in the downlink with single-antenna BSs. Let denote the proportion of cache-enabled users who serve as D2D transmitters (DTs). The set of contents is denoted as , and the size of content item is , . The content popularity distribution follows a Zipf distribution [21], which is given asHere, the parameter indicates the skewness of the popularity. From (1), a content with a smaller corresponds to a higher popularity.

To describe the cache strategy decision, we introduce , which is defined as the content caching decision probability that DT user decides to cache content , randomly. As a result, the distribution of the DTs deciding to cache content follows the PPP with density . Let us assume that D2D pairs can be assigned only within a cooperative distance of the requesting user , within which DTs can establish D2D links with the requesting user.

##### 3.2. Successful Content Delivery Criterion

Per the successful content delivery in D2D link, a requesting user can be associated with a DT device. We define the probability of success for a content delivery as the probability that a user successfully receives its requested content from nearby DTs, which is given byThe following lemma expresses this probability numerically.

Lemma 1. *The probability of success for a content delivery between the neighboring DT and the requesting user, , isHere and .*

*Proof. *The probability density function (pdf) of the distance between a typical user requesting the -th content who is located at the origin and its nearest neighboring DT is ; it is given by the following equation:so, , which is the cumulative distribution function (cdf) . As a result, the pdf of the D2D link distance can be expressed as follows.The probability indicates the successful detection of content between the typical user and its corresponding neighboring DT with respect to a given signal-to-interference ratio target . In addition, the received at the user requesting the -th content is given bywhere denotes the set of DTs; and denote the transmit power for each DT and BS, respectively; is the channel power gain, denoted as with mean 1 for Rayleigh fading; is the distance between the user and the serving neighboring DT with the requested content cached; is the path loss exponent; is the total interference power from all neighboring DTs except the serving DT ; is the interference from the BSs; and denotes the interference channel power from a DT or from a BS. Therefore, the probability is given bywhere (a) is given from the complementary cumulative distribution function of , which follows the exponential distribution with unit mean, and is the Laplace transform of the interference . The Laplace transforms can be calculated using the following procedure.

We have , shown as follows,where (a) results from the assumption of the exponential distribution of with mean 1 and following Theorem 2 in [22]. Note that this step comes from the interferer devices with content cached and without content cached; (b) is derived from a change in variable ; (c) is from the integration in [23]; for the DTs caching other contents except content , , , and denotes the Gauss hypergeometric function.

Similar to (8), the Laplace transform can be obtained asand then we complete the proof by substituting (5), (8), and (9) into (7).

Note that upon receipt of a request for content , the cache-enabled user can access the requested content from its local cache if content is locally cached, otherwise from a DT with the content cached through the cooperative distance. Else, the nearest BS handles the access request. In this paper, we focus on in-network caching placement in D2D communications and then neglect local-service impact in the following analysis, similar to the authors of [24–26].

#### 4. In-Network Caching Placement and Problem Formulation

In this section, we present the optimal caching decision and content discovery strategies in conjunction. This can facilitate an improvement in traffic offloading through D2D communications. Let us consider the caching decision and content discovery variables, denoted as and , respectively. The caching decision variable is described in Section 3. Further, the caching decision matrix is defined as follows:To indicate the content discovery strategy for a D2D pair , we introduce a binary discovery variable . A random user in can access content from a DT that has the requested content via a D2D link; in this case, . Otherwise, . Content discovery can be described through the following 3-D matrix:

With consideration of the successful content delivery in D2D link, the joint caching decision and content discovery problem to maximize the in-network caching gain through D2D communication is formulated asConstraints of the optimization problem are specified in (13)-(17). Constraint (13) dictates that the desired content at a DT cannot exceed the cache storage capacity constraint of the device. Constraints (14) and (15) ensure that requested content cached in one of the DTs can be shared with only one requesting user and that each requesting user can communicate with only one DT that provides content, respectively. Constraint (16) defines the range of the content caching decision probability. Finally, constraint (17) guarantees the integer nature of the binary variable.

#### 5. Duality-Based In-Network Caching Placement

The proposed optimization problem is an integer programming problem with nonlinear constraints. It is difficult to find the optimal solution. A well-known approach for solving the above problem is to introduce a new constraint in place of constraint (13), which also satisfies the cache storage capacity constraint, as follows:Therefore, by applying (18), the optimization problem defined in (12)–(17) can be formulated asIn the following, it is shown that the solution of the optimization problem can be obtained by applying the dual decomposition method [27].

By plugging (3), the Lagrangian function of problem (19) is given byHere is the dual vector for the user cache storage constraint. Then, the dual problem can be achieved asHere is the Lagrange dual function. The duality gap of any optimization problem is negligible if the optimization problem satisfies the time-sharing condition for a significantly large number of contents. Typically, the number of contents is sufficiently large; therefore, we can neglect the duality gap [28]. can be decomposed into subproblems, which are solved independently at each caching decision. The -th subproblem can be formulated as follows:where and are the vector of and the matrix of at content , respectively. By visiting the constraints in (23), we assume that is a matrix of all zeros, except for one binary nonzero entry. Thus, we first obtain the optimal value ofat each ; then, the optimal value for subproblem within the matrix of can be determined for any given . In (24), the numerator of the fraction and the single function are convex functions and the denominator is a concave function with respect to , which satisfy the conditions specified of the problem in [29]. Thus, the optimization problem in (24) can be solved by using a similar method to that in [29] to obtain an approximate global optimal solution of .

Then, the optimal content discovery of D2D pair for content in (23) is given byIn (25), the D2D link between devices and can be assigned if and only if the content has been already cached by device .

By solving all subproblems in (23) and obtaining the values of and , we apply the subgradient method to update the dual variable at each iteration and achieve the dual optimum . In the -th iteration, for , the dual variable is updated aswhere is the step size of the -th iteration, is the subgradient of the dual problem with respect to , and is represented as follows: Denote the selected step size as , where is the positive constant value, is the upper bound on each iteration, and is the value of the Lagrange function at the -th iteration [20]. A feasible solution of the primal problem is used to obtain the . Note that, for a nonsummable diminishing step length rule, the algorithm is guaranteed to converge to the optimal value. A summary of the proposed algorithm is given in Algorithm 1.

#### 6. Simulation Results

In this section, we provide simulation and numerical results to validate the analysis and evaluate the performance of the proposed scheme. We considered a cellular network wherein the BSs and devices are distributed according to independent homogeneous PPPs with densities of . The system parameters are listed in Table 1. For performance comparison, we compare three different caching placement schemes in terms of the in-network caching gain: (i) the Most Popular Content (MPC) caching policy, in which users cache the most popular contents; (ii) a greedy caching policy, in which a set of any content (i.e., a content without relative popularity) is considered to be cached (Greedy Cache); and (iii) the proposed caching placement scheme. Further, we examine data offloading ratio of our system to demonstrate the effectiveness of the proposed scheme compared to the other caching placement policies in traffic offloading. The data offloading ratio is defined as the percentage of requested content that can be obtained through D2D communication rather than served from the BS.

First, the proposed algorithm was compared against exhaustive search in a small network where devices with a cache storage capacity of were located randomly and independently. The number of contents and the size of each content were set to 50 and 8, respectively. Figure 1 shows that the proposed algorithm had nearly the same caching gain as exhaustive search, which demonstrates the close optimality condition of our algorithm. It can also be seen that the in-network caching gain increased substantially when the cooperative distance was small, which implies that caching placement through D2D communications is more applicable for devices within a small cooperative distance.

Figure 2 shows the results of the evaluation of the proposed caching placement scheme for various cache storage capacities as the value of the Zipf parameter was varied. It can be seen that as the size of cache storage increases, the in-network caching gain increases as the value of Zipf parameters increases. This may be attributed to the increase in popularity distribution; when a small number of contents are more popular, the in-network caching effectiveness is improved. Moreover, larger cache storage provides more opportunities to cache more of the popular contents. As a result, more contents can be accessed from the caches of neighboring DTs within a cooperative distance instead of via BS.

In Figure 3, the optimal content caching decision probability of each content is plotted against various values of the Zipf parameter, where lower indexed content indicates higher popularity; i.e., if . We observe that with an increase in the Zipf parameter value, the optimal content caching decision probability of the contents with a high indexes decreases monotonically. This result is consistent with expectations. For highly concentrated content popularity (), the caching decision probability for the contents with higher popularity is higher. Therefore, we can conjecture that for high values of the Zipf parameter, the caching decision for the most popular contents is beneficial for improving the in-network caching performance.

Figure 4 compares the three different caching placement schemes in terms of the in-network caching gain. It can be inferred that the proposed scheme improves the in-network caching performance for any given Zipf parameter . For high values of the Zipf parameter, the gain is more substantial, which indicates that this parameter significantly affects the joint optimization of the caching decision and content discovery strategies. On the other hand, for large values of , the performance of the MPC scheme is better than that of the Greedy Cache scheme, and approaches the performance of the proposed scheme. This can be attributed to the fact that a large value of leads to more requests, which are influenced by the popularity of the contents cached.

In Figures 5 and 6, we compare the three different caching placement policies for the data offloading ratio under different Zipf parameters and cooperative distances .

In Figure 5, the data offloading ratio increases with an increment in the Zipf parameter , as expected. We can see that with a higher value of , our proposed scheme outperforms other policies significantly, which shows that the joint optimization of the caching decision and content discovery strategies highly depends on the popularity distribution, as is also observed from Figure 4.

In Figure 6, the data offloading ratio of the proposed scheme improves more with the increase of the cooperative distance compared to the other policies. This is because the proposed scheme has a greater possibility of sharing the content via D2D links to offload traffic. On the other hand, with the increase in , the traffic ratio achieved by all three schemes increases slower. The reason for this is that the increase of the cooperative distance leads to more DTs, generating more interference.

Lastly, we discuss the complexity of the proposed algorithm. The complexity of the caching decision for each content is . Further, the complexity to solve all subproblems in (23) is , where denotes the number of devices. Hence, the complexity of the proposed algorithm in each iteration can be named by . As a result, the overall complexity of the proposed algorithm is where is the accuracy required of subgradient method [30].

#### 7. Conclusion

In this paper, we have proposed caching decision and content discovery strategies for maximizing the in-network caching gain through D2D communications. We first considered the successful content delivery between D2D users for cooperation. Then, we modeled an in-network caching placement scheme in D2D communications as a joint optimization problem of the caching decision and content discovery strategies by formulating an integer nonlinear optimization problem. To reduce the complexity and find the optimal solution of the problem, we applied Lagrange dual decomposition. The simulation results demonstrated the notable in-network caching gain achieved by the proposed scheme and the improvement in traffic offloading of the proposed scheme compared to other caching placement policies. However, the limited cache storage and the mobility of devices necessitate the consideration of caching decision and content discovery scheme, where we tried to determine which contents must be stored in a cache-enabled device and which cache-enabled device can serve the requested content.

#### Data Availability

No data were used to support this study.

#### Conflicts of Interest

The authors declare that they have no conflicts of interest.

#### Acknowledgments

This work is supported by the Beijing Municipal S&T project under Grant Z181100003218003, the Beijing Science and Technology Commission Foundation under Grant 201702005, the National Nature Science Foundation of China Project under Grant 61701042 and 61428102, and the 111 Project of China under Grant B16006.