Proactive Caching in D2D Assisted Multitier Cellular Network

Cache-enabled networks suffer hugely from the challenge of content caching and content delivery. In this regard, cache-enabled device-to-device (D2D) assisted multitier cellular networks are expected to relieve the network data pressure and effectively solve the problem of content placement and content delivery. Consequently, the user can have a better opportunity to get their favored contents from nearby cache-enabled transmitters (CETs) through reliable and good-quality links; however, as expected, designing an effective caching policy is a challenging task due to the limited cache memory of CETs and uncertainty in user preferences. In this article, we introduce a joint content placement and content delivery technique for D2D assisted multitier cellular networks (D2DMCN). A support vector machine (SVM) is employed to predict the content popularity to determine which content is to be cached and where it is to be cached, thereby increasing the overall cache hit ratio (CHR). The content request is satisfied either by the neighboring node through the D2D link or by the cache-enabled base stations (BSs) of the multitier cellular networks (MCNs). Similarly, to solve the problem of optimal content delivery, the Hungarian algorithm is employed aiming to improve the quality of satisfaction. The simulation results indicate that the proposed content placement strategy effectively optimizes the overall cache hit ratio of the system. Similarly, an effective content delivery approach reduces the request content delivery delay and power consumption.


Introduction
In the recent era, although various technologies have been developed in the field of wireless communication, device-to-device (D2D) communication can be distinguished. This technology has received extensive attraction due to the fact that it can communicate directly within a certain range of distance without the assistance of an intermediate node, thus reducing the huge cost of back haul and transmission power [1,2]. In addition to this, the emergence of edge caching technology enables users to get their favored contents from their neighboring cache-enabled nodes, thus reducing latency and enhancing user experience [3] and satisfaction ratio [4]. Similarly, the introduction of multitier networks brings the network closer to the user, thus enhancing the link quality [5]. Therefore, the combination of these three techniques allows embarking on a new research arena for researchers in data traffic offloading in wireless communication. Consequently, the user can get their favored contents with little delay through good links. Highly favored contents can be cached in D2D transmitters and in the BSs of the multitier cellular networks in advance. If the requested contents are cached in neighboring D2D transmitters, then a request is served; otherwise, the request is sent to the cache-enabled multi-tier cellular networks. Every new technology has certain issues. The same is the case with proactive caching. Here, one of the big issues is content placement. The content placement determines the amount of data unloaded from the cache-enabled nodes. Hence, the cache hit ratio plays a vital role [6,7]. In this regard, the popularity of the contents should be known in advance for optimal cache placement [8][9][10][11]. Hence, if the contents are cached properly in the cache-limited memory of caching nodes, then users can download their requested contents from neighboring nodes within a short distance, thus achieving a high data rate. Similarly, the same content may be requested by different users simultaneously or the request of a user may be satisfied by multiple transmitters. Thus, content delivery needs a proper mechanism. In the nest section of this research article, we introduce some results and limitations prior to our work.

Motivation and Related Work
The existing literature includes huge data related to various proactive caching and content delivery techniques. The authors in [12,13] introduced probabilistic caching schemes by optimizing the D2D link and reliability of transmission. Similarly, the author in [14] used the Indian buffet process (IBP) to increase the caching performance by predicting the content requests. System performance was also improved by estimating the future contents requests using logistic regression models [15,16]. The author in [17] also designed new caching techniques considering user preferences. The problem of data sparsity in [18] was solved using collaborative filtering (CF) and the latent factor model. For better prediction, a deep learning algorithm was also used, which fairly and accurately predicted content popularity [19,20]. Stochastic geometry was used to address the problem of contents in terms of CHR, the density of served requests, and power consumption. In [21], the Poisson point process (PPP) solved the problem of optimal geographical content placement. Golrezaei et al. [22] introduced a caching technique for each base station (BS) to reduce the downloading delay. The survey in [23] discussed caching in two-tier small networks. In [24], the performance analysis of content caching in three-tier heterogeneous networks was discussed. However, few studies have utilized the concept of multitier caching. For instance, in [25], the authors discussed the performance analysis of content caching in three-tier heterogeneous networks while keeping content size identical. In [26], the authors suggested a caching mechanism in two-tier networks. However, the authors in [25,26] did not discuss the different caching strategies with practical considerations for limited cache. Similarly, the authors in [27][28][29] suggested different content delivery schemes from BSs to users. However, these studies were only limited to single-tier caching. On other hand, few studies have been conducted on small base station D2D (SBS-D2D) caching, again limited to single-tier only. For example, in [30], for SBS-D2D caching, an optimal cooperative-based caching policy was discussed. The authors in [31] suggested an intelligent caching technique based on Z-Pf request distribution in cache-enabled D2D networks. Similarly, the authors in [32] proposed user mobility-based content caching and solved energy and delay minimization using reinforcement learning, albeit restricted to D2D networks. In contrast to all existing studies, we combined cache-enabled D2D networks and cache-enabled multitier cellular networks to solve the problems of content caching and content delivery using SVM and the Hungarian algorithm, respectively. SVM is one of the best learners and is used in wireless communication in different scenarios [33][34][35]. It uses the radial basis function (RBF) as a kernel for transformation. The RBF can better map feature vectors into a nonlinear space as compared to other learners [36][37][38]. On the other hand, the Hungarian algorithm is also already utilized to solve various assignment issues such as resource allocation in wireless communication systems [39][40][41].

Contributions and Outcomes
The existing work mainly focused on caching favored contents in cache-enabled D2D networks. This article not only exclusively encompasses the proactive caching issues but also solves the delay and power consumption minimization problems in D2D assisted cache-enabled multitier cellular networks (D2DMCNs).
Two different algorithms are employed, one for content caching and the second one for power and delay minimization. The support vector algorithm predicts the popularity of the contents, and the Hungarian algorithm optimizes the delay and power consumption on the basis of a reward function. The content popularity prediction is based on content attributes such as the number of likes, numbers of dislikes, shares, and first-day view counts. Cache placement is carried out in the D2DMCN after predicting first-day view counts.
Although limitations exist, the addition of D2D technology to MCN greatly increases the satisfaction ratio of the users. As there is no free lunch, an agreement between D2D users and the cellular network operator is necessary. Therefore, as an incentive, extra free MBs are allocated for D2D transmitters, as their memories and battery power are used for content caching and content delivery, although incentive-based mechanisms are not discussed in this paper. This allocation of extra MBs is bounded to the memory and battery power of the D2D transmitter volunteered for proactive caching.
The major contributions of this research paper are described below.

Novel Caching Scheme
In this research work, a joint content caching and content delivering scheme is developed to solve the cache hit problems, content delay, and power requirements in D2DMCN. This content caching policy considers different contents attributes for their popularity. The most popular contents are placed in incentivized D2D transmitters (ID2DTs) and MCN. A picocell, microcell, and macrocell constitute an MCN.

Implementation of Content Placement Techniques
In this research, we use the SVM-based learning algorithm to predict content popularity. Then, on the basis of SVM's predictions, content placement is carried out in ID2DTs and MCN. Hence, the cache hit ratio is maximized, and the delay and power consumption are minimized.

Content Delivery Decision Making
The content delivery problem in a cache-enabled D2DMCN is formulated as an assignment problem, where the distances of the D2D receivers (D2DRs) from ID2DTs and BSs of the MCN, channel gain, and transmission power are considered as inputs. A dynamic content delivery link is established between D2DRs and ID2DTs or between D2DRs and BSs of the MCN with the goal of minimizing the content delivery delay and power consumption, thereby solving the problem of content delivery using the Hungarian algorithm.

Maximization of Objective Function
A reward function is constructed, consisting of power consumption and content delay. Contents may be delivered from ID2DTs or BSs of the MCN depending on their reward function.
A simulation is conducted from the perspective of the cache-enabled ID2DTs, cacheenabled MCN, and D2D receiver. The weight coefficients of the reward function are adjusted so that the content delivery problem is optimized. Hence, the D2DRs receive contents from neighboring ID2DTs or the MCN.
Clusters based on similarities of ID2DTs are formed using K-means clustering. The ID2DTs are selected, and clusters are further squeezed into those D2DRs which are in the threshold distance range of the selected ID2DTs.
Clusters based on similarities of ID2DTs are formed using K-means clustering. The ID2DTs are selected, and clusters are further squeezed into those D2DRs which are in the threshold distance range of the selected ID2DTs.

System Model
As shown in Figure 1, consider a cache-enabled D2DMCN consisting of cache-limited pico BSs, micro BSs, and macro BSs. The ID2DTs are also employed to serve the neighboring D2DRs. Popular contents are cached in ID2DTs and in the cache-enabled BSs of MCN. The contents are cached from a content library set ℱ = 1,2, … , , … . . The ID2Ds set is = 1,2, … … . , , … … and D2DRs set is ℛ = 1,2,3, … … . . , , … … . ID2DTs can store files while pico BSs, micro BSs, and macro BSs can store up to , , and files, respectively. ID2DTs have limited cache memory while , , and are the cache memories of pico BSs, micro BSs, and macro BSs, respectively.  The delay and power consumption in cellular communications are huge as compared to D2D communication. Consequently, the user satisfaction rate is high as they are served by ID2DTs lying in the neighborhood. However, this can be accomplished only when they are in the threshold distance range of the ID2DTs. Otherwise, the signal quality will be very bad. If a D2DR finds its requested contents in the neighboring ID2DTs, it establishes a D2D link with them; otherwise, it sends its request to the cache-enabled MCN to offload the contents via cellular link. Each file size is considered to be the same; mostly, at each time slot, the D2DR can only request one file, and ID2DTs can send one file. The D2D users with the same content requirements form a virtual cluster. This cluster is further squeezed, and only those D2D users which are in the threshold range of the ID2DTs occupy the cluster. Figure 2 shows the formation of a squeezed cluster in proximity of the ID2DTs. The contents can be cached in pico BSs, micro BSs, and macro BSs depending on the behavior of their users. The contents are placed in ID2DTs for some allocated time and then they are replaced by new contents. The time allocation for contents to The delay and power consumption in cellular communications are huge as compared to D2D communication. Consequently, the user satisfaction rate is high as they are served by ID2DTs lying in the neighborhood. However, this can be accomplished only when they are in the threshold distance range d max of the ID2DTs. Otherwise, the signal quality will be very bad. If a D2DR finds its requested contents in the neighboring ID2DTs, it establishes a D2D link with them; otherwise, it sends its request to the cache-enabled MCN to offload the contents via cellular link. Each file size is considered to be the same; mostly, at each time slot, the D2DR can only request one file, and ID2DTs can send one file. The D2D users with the same content requirements form a virtual cluster. This cluster is further squeezed, and only those D2D users which are in the threshold range of the ID2DTs occupy the cluster. Figure 2 shows the formation of a squeezed cluster in proximity of the ID2DTs. The contents can be cached in pico BSs, micro BSs, and macro BSs depending on the behavior of their users. The contents are placed in ID2DTs for some allocated time and then they are replaced by new contents. The time allocation for contents to be present in the cache memory of the devices depends on the variation in the popularity of the favored contents.

Problem Formulation
In cache-enabled cellular networks, prime issues are what to cache and where to cache, as well as how to deliver and from where to deliver. In addition to this, efficient prediction of popularity of contents is also necessary for maximization of the cache hit ratio and minimization of the delay and power consumption. All of these problems directly affect the efficiency of cache-enabled cellular communication systems. In order to formulate our problems, we have to define certain system parameters. Table 1 shows the system-related parameters and their descriptions.

Parameters
Descriptions maximum transmit power of ID2DT minimum sensitivity of D2DR = ( / ) / [42] proximity of the ID2DT path loss coefficient for D2D link path loss coefficient for a link between pico BS p and D2DR j path loss coefficient for a link between micro BS m and D2DR j path loss coefficient for a link between macro BS M and D2DR j , distance between pico BS p and D2DR j , distance between micro BS m and D2DR j , distance between macro BS M and D2DR Any D2DR positioned within the proximity of the ID2DTs is considered to be in the squeezed cluster (SC), i.e., if

Problem Formulation
In cache-enabled cellular networks, prime issues are what to cache and where to cache, as well as how to deliver and from where to deliver. In addition to this, efficient prediction of popularity of contents is also necessary for maximization of the cache hit ratio and minimization of the delay and power consumption. All of these problems directly affect the efficiency of cache-enabled cellular communication systems. In order to formulate our problems, we have to define certain system parameters. Table 1 shows the system-related parameters and their descriptions. Any D2DR positioned within the proximity of the ID2DTs is considered to be in the squeezed cluster (SC), i.e., if λ i,j = 1, then D2DR j exists within the proximity of ID2DT i.
Similarly, D2DRs are connected in one of the following modes: (i) D2D mode, (ii) pico mode, (iii) micro mode, or (iv) macro mode.
Otherwise, Z M,j = 1, D2DR is connected to macro mode 0, D2DR is connected to remote server .
Let R j, f be the request sent by the D2DR j for file f to ID2DT i. If the file f is cached by the ID2DT i, then S j , S P , S m , and S M are cache memories of the ID2DT, pico BS, micro BS, and macro BS, respectively. The overall cache hit ratio of the system is given as One of the tasks of this research is to optimize the overall cache hit ratio of the cache enabled D2DMCN, which is expressed as follows: The objective function in Equation (2) accounts for the overall cache ratio of the system. Constraint C 1 shows the limitations for the cache memory of BSs of MCN, while constraints C 2 and C 3 are binary variables. Thus, in order to maximize the overall cache hit ratio of the cache-enabled D2DMCN, the optimal variables X i, f and Y t, f are set by constructing a suitable cache placement framework to maximize the cache hit ratio. We represent the cache hit ratio as a mixed integer linear programming (MILP) problem, which is NP-hard, whose computational complexity increases exponentially with the increasing size of the D2Ds. Hence, we suggest a machine learning-based distributed solution which has less complexity and is based on prediction of popularity of newly published contents and placement of those contents which are mostly to be viewed in near future. Accordingly, the optimization objectives of this research are described below.
First, the popularity of the contents is determined, and contents are placed in ID2DTs and the MCN, with the prime goal of improving the cache hit ratio of the system using the support vector algorithm. Then, the dynamic content delivery scheme is implemented on the basis of the Hungarian algorithm, which reduces the overall time delay and power consumption. Those D2D transmitters and receivers which have a common content interest are combined in virtual clusters. An agreement is established between ID2DTs and cellular network operators. After this, each cluster is further squeezed, and those D2DRs not in the proximity of the ID2DTs are removed from the clusters. Furthermore, a content delivery policy is also necessary to minimize the delay and power consumption. The transmission rate of either ID2DTs or the MCN varies due to the difference in channel gain and channel fading. Therefore, the transmission rate R i,j of the cache-enabled ID2DTs can be given as where P i,j is the transmit power of ID2DT i to D2DR j, g i,j and d i,j are the channel gain and distance between D2D transmitter i and D2D receiver j, respectively, d −α i,j indicates the path loss, α shows the channel attenuation index, and σ 2 is the power of Gaussian noise. P p,j , g p,j , and P m,j , g m,j are the transmit power and channel gains of the pico cell transmitter and micro cell transmitter, respectively, while d p,j and d m,j are the distance between the pico transmitter and D2DR j and between the micro transmitter and D2DR j, respectively. Similarly, P M,j is the power transmitted by the macro cell transmitter, and g M,j and d M,j are the channel gain and distance between the macro cell transmitter and D2DR j, respectively. Therefore, the delay D ij faced by D2DR j for content request and receiving that content from the neighboring D2D transmitter i is given as Now, the power consumed to deliver content from ID2DT i to D2DR j is given as where P is the power consumed for successful transmission of the requested content in a unit distance under ideal channel conditions, and γ i,j indicates the balance between the ideal channel and current channel. Similarly, the transmission rate R p,j of the pico BS is given as Now, the power consumed to deliver content from pico cell transmitter p to D2DR j is given as where γ p,j indicates the balance between the ideal channel and current channel in pico mode. The delay D p,j in getting the content from the neighboring pico cell transmitter p by the D2DR j is given as Similarly, the transmission rate R m,j of the micro cell transmitter m can be given as Now, the power consumed to deliver content from micro cell transmitter m to D2D receiver j is given as where γ m,j shows the balance between the ideal channel and current channel in micro mode. The delay D m,j in getting the content from the micro cell transmitter m by the D2DR j is given as Similarly, the transmission rate R M,j of the macro BS M can be given as Now, the power consumed to deliver content from macro cell transmitter M to D2D receiver j is given as The delay D M,j in getting the content f from the macro BS M by the D2DR j is given as Therefore, the overall delay of the system is represented by τ and is given as The overall power consumed by the system is In order to minimize the delay and power consumption of the system, we can write the relation as where ξ and are weight coefficients. Both τ and ρ are expected to be very small. For optimal transmission, weights need to be adjusted in such a way that the delay and the transmission power reach to an optimal balance. However, this is more challenging in the cache-enabled D2DMCN as the request sent by a user may be satisfied by multiple transmitters. These transmitters may be ID2DTs or BSs of the MCN. This means that D2DR can get its favored contents from any of the transmitters, i.e., (i) ID2DTs, (ii) pico BSs, (iii) micro BSs, or (iv) macro BSs. The selection is based on three factors: the power transmitted, the gain of the channel, and the distance between transmitter and receiver. To simplify the process, we consider only those D2DRs which are in the range of multiple ID2DTs and the MCN, and which are considered as common receivers. For this, the subscript j is replaced with j*. Hence, ID2DT is generally expressed with i*. Thus, Equations (18)- (20) are generalized and are given as Now, for the selection of transmitters, we introduce a decision variable y i * ,j * . Our prime goal is to minimize the power consumption and content delay in the cache-enabled D2DMCN. For this purpose, we introduce a system reward function R v . This system Sensors 2022, 22, 5078 9 of 21 reward minimizes the total delay and power consumption of the system. The reward of the system is defined as where ξ and are the weight coefficients indicating the significance of content delay and power consumption, respectively. These weight coefficients can be used to balance the relative importance of the content delay and power consumption. If the value of is high, then, in that the scenario, the importance of content delivery will be high. Hence, the second optimization problem is given below.
subject to The objective function in Equation (25) accounts for the reward of the system, which is maximized when the content delay and power consumption are minimized. Constraint C 4 is a binary variable whose value is 1 when content is delivered from transmitter i * to D2DR j * and 0 otherwise. C 5 represents that D2DR j * can be served by a single transmitter i * at a time, while constraint C 6 indicates the power range of the system.

Clustering and Cache Making Strategy
K-means clustering and the support vector algorithm were used for clustering and content caching, respectively.

K-means Clustering and the Concept of Squeezed Cluster
The caching process becomes easier and more efficient if similar D2Ds are placed in virtual groups called clusters. These clusters are formed on the basis of the similarity of the contents, as requested by the users. There are many unsupervised learning algorithms for cluster formation, but the K-means clustering algorithm is more viable. The inputs to the algorithm are the ratings given by the users to different contents. ID2DTs are selected, and an agreement is made between ID2DTs and cellular operators. According to that agreement, the cellular operator can use the limited memory and battery power of ID2DTs; in response, the cellular operator allocates extra MBs for this purpose. After this, squeezed clusters are formed, and those D2DRs within the threshold distance range of ID2DTs are left in the cluster. This means that every ID2DT has its own squeezed cluster, and there is a fairly greater chance of D2DRs getting their requested contents from ID2DTs. Sometime, a D2DR can be in the range of two or more ID2DTs. In such a scenario, the Hungarian algorithm is used for content delivery, as discussed later.

Support Vector Algorithm for Estimating the Popularity Matrix and Proactive Caching
In cache-enabled D2DMCN, content caching has a direct impact on the cache hit ratio and satisfaction rate. Thus, content caching plays a pivotal role. Each user can easily find their favored contents in their neighborhood if content caching is properly carried out. The neighborhood may have a cache-enabled ID2DT or the BS of a cache-enabled MCN. This can hugely reduce the backhaul link load and transmission delays. On the other hand, if content caching is not properly designed, then the user's frustration level will increase as they cannot find their requested content with ease. Thus, for more effective content caching, the user content request distribution plays a vital role. This will ease the process of what to cache and where to cache. Different machine learning algorithms are employed for predicting the content popularity. In our research work, we used the support vector algorithm. The attributes of the contents are numbers of likes, numbers of shares, numbers of dislikes, numbers of comments, first-day view counts, etc. First, the machine is trained, and the popularity is predicted. Then, highly popular contents are cached in the ID2DTs and BSs of-cache enabled MCNs. Few contents are cached in the limited memory of the ID2DT. MCNs are also limited in terms of cache memory. Therefore, the first problem, which is related to the overall cache hit ratio, can be solved by the support vector algorithm. The support vector machine uses the radial basis function (RBF) as a kernel for transformation. The RBF can better map feature vectors into a nonlinear space. This nonlinear property of RBF kernel transformation performs better prediction of the content popularity because it does not rely only on the linear relation between first-day view count and the view count on later days. The SVM finds the evaluation pattern in the dataset and predicts the content's first-day view count accordingly. According to the SVM-based model, the numbers of views of contents f at θ t can be defined as where ∧ ρ( f , θ t , θ r ) indicates the predicted numbers of views for content f at time θ r when a prediction is made at time θ t . Similarly, ϕ(w, y) = exp w−y 2 2δ 2 is a Gaussian RBF with δ parameter, W(s, θ r ) is a feature vector for content f at time θ r , W(s, θ r ) S s = 1 is the support vector returned by the SVR algorithm with a set coefficient {γ s } S s = 1 , and G is the intercept.

Clustered-SVM
We combined K-means clustering and SVM, which we named clustered-SVM. As shown in Figure 3, the content popularity was predicted by SVM, and D2D clustering was carried out by K-means clustering. ID2DTs were selected and squeezed clusters were formed, consisting of those D2DRs in the proximity of ID2DTs. Then, we connected selected ID2DTs with the content popularity and decided on what to cache and where to cache. Similarly, the popularity of contents in each tier of the MCN was predicted by the SVM, and contents were cached accordingly. The two cache decision variables X i, f , Y t, f could be obtained using clustered-SVM, as given in Algorithm 1. Let D 1 , D , D train be the datasets for the distance between the D2Ds, ratings of the past requested contents, and attributes of contents, respectively, while D testd2d , D test1 , D test2 , D test3 are the testing data of content popularity for the D2D, pico BS, micro BS, and macro BS respectively. Similarly, D is the dataset for fresh content file f request R j, f of D2DR j. Initially, using dataset D , clusters C 1 , C 2 , . . . , C c , having similar D2Ds, are formed using K-means clustering. Then, ID2DTs are selected and, using D 1 , squeezed clusters sc i are formed, thereby removing those D2DRs not in the proximity d max of the selected ID2DTs. SVM is trained with D train and tested with D testd2d , and the popularity of the contents is determined by predicting the first-day view count of the contents. Then, the popularity is sorted in descending order, and the most popular contents are cached in the ID2DTs in descending order until the cache memory is not fully occupied. The same process applied for the pico BS, micro BS, and macro BS. The process is repeated until all cache memories of the BSs of MCN are occupied by the popular contents. Finally, cache decision variables X i, f , Y t, f are obtained.

Algorithm 1. Clustered-SVM to Predict Content Popularity and Implement Decision Making for Proactive Caching in Cache-Enabled D2DMCN
Require: D , D 1 , D , D train , D testd2d , D test1 , D test2 , D test3 , S, ρ min Ensure: X i, f , Y t, f , β Step 0: Clustering and contents popularity predication 1.
Randomly select a set of incentivized D2D transmitters 5.
sc i ← j // sc i is squeezed cluster i 10.
Update the D2D receiver in the squeezed cluster 11. end if 12.
end for 13. end for 14.
end for 15.
Train SVM using the data set D train 16.
Determine the content popularity in each case.

18.
Sort the content popularity in descending order in each case Step1: Content caching at incentivized D2D transmitter 19. for i = 1 : K do 20.
Initialize the cache size s i and caching matrix X i 21.
Return β dicting the first-day view count of the contents. Then, the popularity is sorted in descending order, and the most popular contents are cached in the ID2DTs in descending order until the cache memory is not fully occupied. The same process applied for the pico BS, micro BS, and macro BS. The process is repeated until all cache memories of the  , ' Step 0: Clustering and contents popularity predication 1.

Hungarian Algorithm for Content Delivery
The second problem in cache-enabled D2DMCN is the fast deliverance of the requested content to the D2DRs. This problem is a combinatorial assignment problem and can be solved by the Hungarian algorithm. The D2DRs can get the requested contents through D2D links or through cellular links. This content delivery becomes more cumbersome in the cache-enabled D2DMCN, since (1) the content request of a user can be satisfied by multiple transmitters at the same time, and (2) content cached by any of the transmitters may be requested by multiple receivers simultaneously. These transmitters are ID2DTs and BSs of the MCN. The said issues can be solved using the Hungarian algorithm. The Hungarian algorithm predominantly solves assignment problems. The Hungarian algorithm takes the decision of connecting D2DRs either with ID2DTs or with BSs of the MCN to get the requested contents as mentioned in the Algorithm 2 in details. To this end, the reward function is optimized. The reward function depends on the transmit power P i,j , which is the minimum transmission power required by transmitter i and receiver j for complete transfer of information in a fading environment, the channel gain g i,j , and the distance d i,j between transmitter i receiver j. Hungarian algorithm aims to maximize the reward function and minimize the power consumption and content delivery delay. The whole process is shown in Figure 4. T this end, the reward function is optimized. The reward function depends on the transm power , , which is the minimum transmission power required by transmitter and r ceiver for complete transfer of information in a fading environment, the chann gain , , and the distance , between transmitter receiver . Hungarian algorith aims to maximize the reward function and minimize the power consumption and conte delivery delay. The whole process is shown in Figure 4.   The D2DRs which are in the range of multiple ID2D transmitters are considered as common receivers and are designated by j * ∈ . Their distances and channel gains are loaded from datasets D 1 and D 2 , respectively. Similarly, distance and channel gains of common D2DRs from BSs of MCN are loaded from datasets D 3 and D 4 , respectively. The power consumed, transmission rate, and content delay are determined in each case, and the reward function is formed. The maximization of that reward function accounts for minimization of the overall system delay and power consumption to solve the problem of content delivery.

Simulation Setup
In this section, we provide different simulation results for the performance of the D2DMCN with the proposed content caching and content delivery scheme. D2DRs can obtain contents either from ID2DTs or from multiple tiers of the cellular network. These tiers are the macrocell tier, microcell tier, and picocell tier. All tiers are in the coverage circle of macrocell with radius R = 800m. Additionally, 200 D2DRs are distributed randomly forming a Poisson distribution. The macro BS and pico BS are also installed with radii of 300 m and 150 m, respectively. Almost 10% of the D2Ds are ID2DTs, while the remainder are D2DRs. For simplicity, one ID2DT can only be connected to one D2DR at a time for file transfer. Similarly, one file can be transmitted at each time. On the other hand, the MCN has also its own receivers, which can obtain contents directly from the BSs of the MCN. Each D2D transmitter can cache up to 10 files. The size of file is similar (1 MB for simplicity). The maximum transmit power is 1 W, the sensitivity of each D2DR is ρ min = −70 dBm, and the path loss exponent is α = 3. Different parameters and their values/types used in this research are given in Table 2. For validation of the performance of the experiment, huge datasets were required [43][44][45]. A few datasets were selected from Movie Lens (ML) as experimental data containing records of 5000 ratings, while others were generated according to the social behavior of the users. These datasets comprised requests of the users for various contents, attributes of the contents for content popularity, distances between D2Ds located at a different locations, distances between D2Ds and multitier BSs, channel gain and transmitted power for D2D communication, channel gain and transmitted power for cellular communication, etc. For content popularity, the number of training data was 3000, and the number of testing data was 2000.
6.2. Numerical Results and Discussion 6.2.1. Performance Evaluation of Content Caching Based on Different Learning Algorithms for D2DMCN Figure 5 depicts the overall cache hit ratio of the cache-enabled D2D assisted MTCNs. It can be observed that content caching based on SVM is better compared to the fine K-nearest neighbor (FKNN), medium K-nearest neighbor (MKNN), and complex tree algorithms. The reason is that SVM has a higher prediction accuracy owing to the fact that the RBF can better map feature vectors into a nonlinear space. This nonlinear property of RBF kernel transformation enables better prediction of the content popularity because it does not rely only on the linear relationship between first-day view count and the view count on later days. SVM finds the evaluation pattern in the dataset and predicts the content's first-day view count accordingly.

Performance Comparison of Different Proactive Content Caching T D2DMCN
We consider the following contents caching polices for D2DMCN: • Ground truth content caching method In this method, the most popular contents are cached in differen transmitters without predicting the popularity of contents [42,46].
• Random content caching method In this technique, random sets of content files are proactively period different cache-enabled transmitters [47].
• SVM-based content caching method The content popularity is predicated on using SVM from a training s popular contents are cached accordingly. Figure 6 shows the performance comparison of SVM-based caching truth caching technique and random caching technique. As expected, the better as compared to the other two caching techniques due to the prior p tent popularity of newly published contents.

Performance Comparison of Different Proactive Content Caching Techniques for D2DMCN
We consider the following contents caching polices for D2DMCN:

• Ground truth content caching method
In this method, the most popular contents are cached in different cache-enabled transmitters without predicting the popularity of contents [42,46].

Random content caching method
In this technique, random sets of content files are proactively periodically cached in different cache-enabled transmitters [47]. •

SVM-based content caching method
The content popularity is predicated on using SVM from a training set, and the most popular contents are cached accordingly. Figure 6 shows the performance comparison of SVM-based caching with the ground truth caching technique and random caching technique. As expected, the SVM performed better as compared to the other two caching techniques due to the prior prediction of content popularity of newly published contents.      Figure 8 shows that, when the number of ID2DTs is increased, then the cache hit r is increased accordingly. This is due to fact that more cache-enabled ID2DTs share t cache memory for content caching.  Figure 8 shows that, when the number of ID2DTs is increased, then the cache hit ratio is increased accordingly. This is due to fact that more cache-enabled ID2DTs share their cache memory for content caching.  Figure 9 illustrates the reward of the system with varying values of weight coefficients and . We can see that, when = 0.3 and = 0.7, then the total delay of the system is low; on the other hand, when = 0.7 and = 0.3, then the total power consumption of the system is low. The first case is conducive for the D2D receiver to send content requests, while the second case is conducive for the contents to be delivered from the cache-enabled transmitters. Hence, by adjusting the values of the two weight coefficients, and , the performance of the system can be improved. Figure 9. Reward of the system based on Hungarian algorithm with varying weight coefficients.

Performance Comparison for the Content Delay and Power Consumption
In Figure 10a,b, we compare the Hungarian-based content delivery scheme with the random content delivery scheme [48][49][50][51][52][53] for minimizing the overall content delay and the power consumption of the system, respectively. We show that the Hungarian-based delivery scheme works much better as compared to random content delivery. Hence, the power consumption and the content delay of the system are minimized when content delivery is conducted from the D2DMCN using the Hungarian algorithm. As expected, the inclusion of cache-enabled ID2DTs in the MCN optimized the overall power consumption  Figure 9 illustrates the reward of the system with varying values of weight coefficients ξ and . We can see that, when ξ = 0.3 and = 0.7, then the total delay of the system is low; on the other hand, when ξ = 0.7 and = 0.3, then the total power consumption of the system is low. The first case is conducive for the D2D receiver to send content requests, while the second case is conducive for the contents to be delivered from the cache-enabled transmitters. Hence, by adjusting the values of the two weight coefficients, ξ and , the performance of the system can be improved.  Figure 9 illustrates the reward of the system with varying values of weight co cients and . We can see that, when = 0.3 and = 0.7, then the total delay of the tem is low; on the other hand, when = 0.7 and = 0.3, then the total power consu tion of the system is low. The first case is conducive for the D2D receiver to send co requests, while the second case is conducive for the contents to be delivered from cache-enabled transmitters. Hence, by adjusting the values of the two weight coeffici and , the performance of the system can be improved. In Figure 10a,b, we compare the Hungarian-based content delivery scheme wit random content delivery scheme [48][49][50][51][52][53] for minimizing the overall content delay an power consumption of the system, respectively. We show that the Hungarian-based livery scheme works much better as compared to random content delivery. Hence Figure 9. Reward of the system based on Hungarian algorithm with varying weight coefficients.

Performance Comparison for the Content Delay and Power Consumption
In Figure 10a,b, we compare the Hungarian-based content delivery scheme with the random content delivery scheme [48][49][50][51][52][53] for minimizing the overall content delay and the power consumption of the system, respectively. We show that the Hungarian-based delivery scheme works much better as compared to random content delivery. Hence, the power consumption and the content delay of the system are minimized when content delivery is conducted from the D2DMCN using the Hungarian algorithm. As expected, the inclusion of cache-enabled ID2DTs in the MCN optimized the overall power consumption and delay of the system. On the other hand, if caching is performed at the tier level only, then, as expected, the power consumption and delay of the system are greater. This means that, if more ID2DTs are selected and more contents are cached in them, then the overall delay and power consumption will be decreased, and the content downloading speed will be high. Similarly, if there is no caching, then the overall delay and power consumption of the system will be much greater. and delay of the system. On the other hand, if caching is performed at the tier level only, then, as expected, the power consumption and delay of the system are greater. This means that, if more ID2DTs are selected and more contents are cached in them, then the overall delay and power consumption will be decreased, and the content downloading speed will be high. Similarly, if there is no caching, then the overall delay and power consumption of the system will be much greater.

Conclusions
In this study, we proposed novel frameworks for content caching and content delivery in D2DMCN. Specifically, on the basis of the similarities of the contents, virtual clusters of D2Ds were formed. These clusters were reduced to squeeze clusters, thus leaving behind only those D2D receivers in the threshold distance range of the ID2DTs. According to the attributes of the contents, the popularity of the contents was predicted using the SVM, and popular contents were cached in the limited cache of ID2DTs and in the cacheenabled MCN. The simulation results depict that the inclusion of ID2DTs in the MCN and the use of SVM improved the overall cache hit ratio of the system. On the other hand, to solve the problem of content delivery and power consumption, a reward function of the system was constructed, which was maximized using the Hungarian algorithm. As expected, the simulation results show that the maximization of the reward function led to a minimization of the content delay and power consumption. Hence, combining the content caching and content delivery, we can greatly improve the performance of the system.

Conclusions
In this study, we proposed novel frameworks for content caching and content delivery in D2DMCN. Specifically, on the basis of the similarities of the contents, virtual clusters of D2Ds were formed. These clusters were reduced to squeeze clusters, thus leaving behind only those D2D receivers in the threshold distance range of the ID2DTs. According to the attributes of the contents, the popularity of the contents was predicted using the SVM, and popular contents were cached in the limited cache of ID2DTs and in the cache-enabled MCN. The simulation results depict that the inclusion of ID2DTs in the MCN and the use of SVM improved the overall cache hit ratio of the system. On the other hand, to solve the problem of content delivery and power consumption, a reward function of the system was constructed, which was maximized using the Hungarian algorithm. As expected, the simulation results show that the maximization of the reward function led to a minimization of the content delay and power consumption. Hence, combining the content caching and content delivery, we can greatly improve the performance of the system.