Cooperative Offloading in D2D-Enabled Three-Tier MEC Networks for IoT

,


Introduction
Mobile devices (MDs) have limited computing resources and power capacity due to their portable sizes [1]. To cope with computation-intensive, delay-sensitive, and high-energycost tasks, mobile/multi-access edge computing (MEC) has been proposed to deploy resource-rich servers at base stations (BSs) within the proximity of MDs [2][3][4][5]. In Internet of Things (IoT), MEC has been advocated as a promising technique for providing massive MDs with enhanced computing and storage capabilities [6].
For one thing, due to the physical proximity, MEC can significantly reduce the transmission latency [7,8] involving in communication compared with mobile cloud computing (MCC) [9][10][11][12]. For another thing, MEC enables MDs to perform computation offloading, which can migrate their computing tasks [13] to resource-rich nodes and send results back to the MDs [14]. Offloading has always been a hot topic which can guarantee low computing time, as well as saving the battery energy of MDs [15], increasing the network throughput. Therefore, MEC can improve users' satisfaction [16] or quality-of-experience (QoE) of the end-users [17], relieve network congestion [18,19], prolong the battery lifetime [20] of MDs, and further reduce the total latency distinctly. Thus, MEC is an efficient solution for IoT.
Nevertheless, offloading can obtain computing resources at the expense of extra transmission delay and associated energy consumption, due to the communication between the MDs and edge servers over the wireless channels [21]. Offloading may be really beneficial to MDs with large amounts of computation and relatively small amounts of communication [22].
However, the edge servers associated with BSs have limited computing resources and can not always meet the requirements of the served MDs [23]. D2D cooperation can help to solve this problem, where the helpers (resource-rich MDs) can execute computing tasks from resource-limited MDs [24]. D2D-assisted cooperative offloading services play a complementary role in MEC, which is helpful when processing some small-scale tasks for energy-efficiency [25]. When a task has already been done well through D2D cooperation, accordingly, it can free up radio resources for other purposes and reduce the uplink delay of the task [26]. Therefore, in this paper, we propose cooperative computation offloading in D2D-enabled MEC networks for IoT aiming to minimize the total delay of tasks with the maximum energy consumption constraints. By leveraging the advantages of both MEC and D2D cooperation techniques, computing resources can be fully used. Our contributions can be summarized as follows: (1) We propose a computing architecture where cooperative offloading can be carried out in the D2Denabled three-tier MEC networks. Each task can be processed locally by MD itself or its neighboring MDs at device tier, by edge servers at edge tier, or by remote cloud servers at cloud tier (2) The proposed three-tier MEC networks provide MDs with multiple optional offloading destinations. We formulate the offloading decisions and resource allocation in this MEC networks as an optimization problem aiming to minimize the total delay of tasks (3) The formulated problem is a mixed-integer nonlinear problem which is hard to solve. We decompose the problem into 3 subproblems. Then, we solve it utilizing the alternating direction method of multipliers (ADMM). Extensive simulation results validate that the proposed scheme is effective The organization of this article is as follows. Section 2 provides a review of related work. Sections 3 presents the system model, including the network model, communication model, and computing model. In Section 4, we formulate the problem and give the equivalent form. In Section 5, we propose a parallel optimization framework to solve the problem and develop an efficient computation offloading scheme. Related simulations are provided in Section 6. Finally, we conclude this article in Section 7.

Related Work
Extensive research has been conducted on MEC. Many existing works paid attention to the computation offloading problem [15,16,20,21,[27][28][29][30][31][32]. Some works jointly considered the computation offloading policy and the involved resource allocation [15,[33][34][35]. Others jointly considered the offload-ing decisions, content caching [28,36], and the resource allocation [20,30]. All of these above works focused on two-tier edge computing networks. Works focusing on the task offloading problem in threetier edge computing networks can be found in [17,[37][38][39][40]. Tong et al. [39] first proposed a three-tier hierarchical edge cloud architecture to maximize the amount of peak mobile workloads from MDs being served. The performance of the proposed hierarchical edge cloud architecture was evaluated by a small-scale system experiment. The deployment of edge servers and cloud servers formed a three-tier MEC architecture, where local computing, edge computing, and cloud computing could coexist and cooperate to assist the task execution [38]. This scheme provided multiple offloading decisions for devices. The different offloading decisions may largely impact the network performance [21]. For example, offloading the tasks to the edge node or remote cloud DC will inevitably incur additional long communication delay [39], whereas executing the task locally may result in larger computing delay. Consequently, it is critical for devices to make proper offloading decisions in the three-tier computing networks.
Some works study cooperative offloading in MEC networks. du et al. [40] considered vertical cooperation between the fog and the cloud, in which the application can be processed in the MD locally, in the fog or in the cloud. The authors assumed that the offloading requests were usually very small; no buffer was needed for queueing the computing requests. Xiao and Krunz [17] designed optimal workload allocation solutions in a cooperative fog computing network. Instead of always relying on the cloud data center to process its unprocessed workload, each fog node can also forward part or all of its unprocessed workload to its neighboring fog nodes to further improve the QoE of its users. This paper solved the optimal workload allocation problem with the distributed ADMM. Wang et al. [38] developed a cooperative task offloading and computing resource allocation scheme in three-tier computing networks, considering the cooperation among the devices, the edge servers, and cloud servers vertically as well as the cooperation between the edge nodes horizontally. In these above works, they did not consider the cooperation among MDs.
D2D cooperation focuses on the collaborative computation among MDs. Feng et al. [24] developed a computation offloading scheme based on D2D communications, in which resource-limited MDs could offload their computationintensive tasks to appropriate nearby resource-rich MDs. Xing et al. [41] studied D2D-enabled multihelper MEC networks, where a local user could be helped by its nearby wireless devices serving as helpers for cooperative computation. Literature [26] considered offloading computational tasks to nearby devices or to an edge cloud and developed a decentralized algorithm to allocate the computational tasks among them. However, these works were not carried out in threetier networks.
In MEC networks, there are horizontal collaboration at the device tier [41] and the edge tier [17] as well as the vertical collaboration [40] among MDs, edge nodes, and cloud nodes [2]. Different from the above literatures, our paper 2 Wireless Communications and Mobile Computing proposes cooperative computation offloading in D2Denabled three-tier MEC networks for IoT. Each task can be processed locally by MD itself or its neighboring MDs, by edge servers at edge tier, or by cloud servers at cloud tier.

System Model
In this section, the system model adopted in this paper is described. We introduce the proposed network model and present the communication and the computing model in detail. Finally, we calculate the total delay of tasks and energy consumption.
3.1. Network Model. As depicted in Figure 1, we propose a D2D-enabled three-tier MEC network architecture as a part of the IoT, which consists of N MDs labeled as N = f1, 2, ⋯, Ng, M base stations (BSs), and a remote central cloud DC equipped with many remote cloud servers. Each MD has the ability of D2D communication and is connected to the closest BS via a wireless link. Each BS is equipped with some edge servers in edge cloud at edge tier and can be regarded as an edge node. The BSs are connected to the remote cloud servers in central cloud DC at cloud tier via a low-latency wired backhaul link (e.g., optical link) [4]. Optical backhauling is a promising solution [42,43] to offer high throughput, low latency, and reduced energy consumption. Moreover, the flexibility and reliability can be effectively improved by the adoption of artificial intelligence-driven autonomous optical networks [44].
In this D2D-enabled cooperative architecture, we assume that each MD has a computing task to be processed locally by MD itself or its neighboring MDs at device tier, by edge cloud, or by central cloud DC. MDs can help each other when they are free or have surplus computing resources. The helper may be rewarded in terms of accumulated reward points. MDs with more accumulated reward points can be helped with higher precedence when they need help. Multiple neighboring local MDs can communicate with each other through WiFi [45] or Bluetooth [46]. The network operator (e.g., BS) can gather sufficient D2D connectivity information through network-assisted device discovery and local information reporting by the devices [25]. If the network condition is bad, the task of each local MD is small and/or delay-sensitive; MDs may be more willing to choose D2D cooperation due to short transmission time. That is to say, these tasks prefer to be processed among local MDs.
The computation offloading process is shown in Figure 2 [35]. Each MD can send an offloading request including the information of the MD such as its local processing capability and power consumption, the properties of the task such as the size and emergency of the task, and the maximum tolerable delay [40]. According to this collected information, MDs finally decide where should the tasks be processed. The computing task of MD n can be completed locally within its CPU, or by its neighboring MD via D2D cooperation, or remotely in the edge cloud via MEC offloading, or further up the cloud DC via cloud offloading [35].
After being processed in one of these nodes, the result of the computing task is transmitted back to the corresponding MD. Similar to many previous works about MEC [18,20,21,26], we neglect the return result time of the computed tasks in this work. The assumption is justified for many applications including face recognition and anomaly detection, where the size of the result is much smaller than the size of the uplink data. We do not consider the queueing of offloading tasks, as in [19,40]. To obtain tractable analysis, we also omit the delay due to decision-making [20].

Communication
Model. For the communication model, the computing task of MD n is described by Γ n = ðL n , τ max n , C n ), where L n (in bits) stands for the input data size of task Γ n , τ max n (in s) stands for the task computation deadline for MD n, and C n (in CPU cycles) stands for the number of required CPU cycles to accomplish the task Γ n .
When a task of an MD can not be processed well by MD itself or its neighboring MDs, the task can be sent to the BS. The bandwidth resource of the BS is denoted as B Hz. However, the limited radio bandwidth needs to be allocated among all the edge-processing and the cloud-executing MDs for communication with the edge node. Within our communication model, all the devices equally share the bandwidth. The uplink bandwidth of MD n is B n Hz; the uplink achievable transmission rate R n for radio access can be approximated by Shannon's formula: where p n is the transmission power density of MD n, G n stands for the channel gain between the MD n and the BS, and σ 2 denotes the power of additive white Gaussian noise. Furthermore, the uplink transmission delay for MD n offloading the task Γ n to the BS is calculated as

Wireless Communications and Mobile Computing
And the transmission energy consumption for MD n offloading the task Γ n to the BS can be given as where P n is the total power consumption of MD n for transmission in the uplink, consisting of the static power consumption and transmit power [38].

Computing Model.
We denote the offloading decisions for MD n by x n,j , y n , z n ∈ f0, 1g, where x n,j = 1, y n = 1, z n = 1 indicate that the task of MD n is executed by MD itself (e.g., n = j) or its neighboring MD j, by edge server, or by cloud server, respectively; otherwise, x n,j = 0, y n = 0, z n = 0. Thus, the offloading decisions of device n is constrained by In the constraint, it should be noted that one and only one of the offloading decisions x n,j , y n , and z n for the MD n can be 1 at any time. It also implies that the task of each MD is impartible in this paper.
Next, we will discuss the computation overhead in terms of processing delay and energy consumption of MD n with different offloading approaches.

Local
Processing. For the local task processing approach, let f L n denote the local computing capability (in CPU cycles/s) of MD n. Then, the computing delay of processing the task Γ n locally can be The CPU power consumption is a function of execution frequency f L n . We can compute the energy consumption of MD n as [47,48] From (5) and (6), we can notice that both T L n and E L n are only related to C n and f L n , which are the known inherent features of MD n and its computing task.

D2D Cooperation.
For D2D cooperation, we define d n,j as the D2D link between local MD n and j, P D n as the power consumption of MD n, and T tr n,j as the round trip time (RTT) for task transferring between the D2D pairs. This RTT is assumed to be stable during an offloading period, while it may change across different periods. It can be estimated at the beginning of the offloading period, by using the history information or empirical formula [49]. Thus, when the task Γ n is executed finally at MD j, the total delay T D n consists of the communication delay T tr n,j between MD n and MD j and the processing delay T j Γ n at MD j. It can be calculated as according to (5), T j Γ n = C n /f L j . Note that T tr n,j = 0 when n = j, because there is no task to transfer within the local MD. Thus, the delays of tasks in the device tier all meet (7).
In this case, the energy cost of MD n is mainly the transmission energy consumption. It can be given as 3.3.3. Edge Computing. For the edge computing approach, the total computing capacity of the BS is denoted as F (in CPU cycles/s), which can be allocated to the computing tasks processed by the BS. Denote f B n as the computing resource allocated to MD n by the BS. Thus, the computing delay of MD n executed by BS is given as When the tasks are computed in the edge server, the MD n sends the task Γ n to the associated BS. Then, the BS will process the offloaded task by employing its computing  Wireless Communications and Mobile Computing resources. Combining with equation (2), the total delay of task Γ n processed by the BS is calculated by 3.3.4. Cloud Computing. For the computing task offloaded to the cloud DC, MD n firstly transmits the task Γ n to the nearest BS through a wireless link. Then, the BS forwards the task Γ n to the cloud DC through a fiber optical link. Since the cloud servers have plenty of computing resources and the fiber optical link between the edge cloud and the cloud DC is of sufficiently large capacity, the allocation of these resources will not be discussed here. Ordinarily, the computing capability of the cloud DC is much higher than that of the MEC servers. Let the RTT for task transmission between the edge server at BS and cloud server be T B,C . Denote f C n as the cloud computing capability (in CPU cycles/s) assigned to MD n, which is assumed to be a predetermined value according to the cloud computing service [40]. Therefore, the cloud computing delay of MD n is given by Then, combining with equation (2), the total delay of cloud processing for MD n can be expressed as The above notations that will be used in this paper are summarized in Table 1.
As mentioned earlier, we ignore the return result time of the computed tasks. According to (2)-(12), the total task delay and energy consumption of MD n are calculated, respectively, as

Problem Formulation.
To minimize the total delay, we formulate the task offloading and resource allocation problem with the maximum energy cost constraints. Let the offloading strategy vector of MD n as Θ n = fx n,1 , x n,2 , ⋯, x n,N , y n , z n g and the offloading decision profile of all devices as Θ = fΘ n , n ∈ N g. The computing resource allocation vector of all devices is denoted as Ω = f f B n , n ∈ N g. The maximum energy cost of MD n is denoted as E max n (e.g., the battery capacity). As a result, the joint task offloading and resource allocation problem are formulated as x n,j , y n , z n ∈ 0, 1 f g, ∀n ∈ N , ð17Þ x n,n E L n + 〠 The constraints (16) and (17) denote that each task is processed locally by MD itself or by its neighboring MDs, by edge servers, or by cloud servers. The constraint (18) states the computing resource consumption of all the MDs can not exceed the computing capacity of the edge servers. The constraint (19) indicates the maximum energy cost of MD n. Based on (7), (10), (12), and (13), the total delay of MD n can be written as ð20Þ The optimization problem P1 is a mixed-integer nonlinear problem and is difficult to solve due to the following observation. Since that x n,j , y n , and z n are binary variables, the feasible set of problem (15) is not convex, so that the objective function of problem (15) is not convex. As is shown, problem (15) is a mixed discrete and nonconvex optimization problem, and this kind of problem is usually considered as NP-hard [20]. Then, we rewrite the objective function (15) as In that, P1 is a convex problem with all binary variables fixed. We can use the branch-and-bound method to find a near-optimal solution [38]. But as far as our objective  (15) is concerned, we should note that the complexity of the method remains exponential. The scale of the problem becomes large as the number of MDs grows, which makes it hard to obtain the solution in a reasonable amount of time. Then, in the next section, we will decouple the optimization problem (15) to present an effective computation offloading scheme ADMM to solve the problem P1.

Problem Transformation.
To make it possible for each offloading decisions participating in the computation, we will decompose the problem P1 into several small subproblems, so that it can be solved in a distributed manner. Thus, we need to properly handle the coupling constraint among variables. Specially speaking, the optimization variables x n,j , y n , and z n are coupled in the constraints (16), which make the problem inseparable. Thus, to make the problem separable, we introduce the local copies of the global variables and denote them asx n,j ,ŷ n , andẑ n , respectively. Then, we havê x n,j = x n,j , ∀n ∈ N , j ∈ N , y n = y n , ∀n ∈ N , z n = z n , ∀n ∈ N : Based on equation (22), the coupling constraint of (16) can be written as 〠 N j=1x n,j +ŷ n +ẑ n = 1, ∀n ∈ N : Let b Θ = fx n,1 ,x n,2 , ⋯,x n,N ,ŷ n ,ẑ n , n ∈ N g be the local variables vector of all MDs. Then, we give the equivalent global consensus version of P1 by substituting (16) with (22) and (23) Now, it is obvious that in problem P2, the objective functions ΨðΘÞ with feasible sets are separable. But the consensus constraints (23) remain coupled. As far as the problem P2 is concerned, the numbers of variables and constraints reach N 2 + 2N and 2N 2 + 4N, respectively. The size of this problem becomes extremely large as the number of MDs grows.
ADMM is a promising approach to solve the large-scale optimization problem [20], which is originally devised to solve convex optimization problems. Recently, it has been further explored to solve nonconvex problems due to the flexibility of the ADMM framework [30]. In the next section, we will apply ADMM to solve the problem in a distributed fashion.

Efficient Computation Offloading Scheme
In this section, we develop a parallel optimization framework based on ADMM and difference of convex function (D.C.) programming. First, we derive the augmented Lagrangian function. With corresponding global consensus constraints, we formulate the ADMM iteration steps [28,38,50]. Then, the update methods for ADMM iterations are presented, and the overall algorithm is summarized.

Augmented Lagrangian and ADMM Variables.
According to [50], the augmented Lagrangian function is expressed as where λ = fλ n,j g n,j∈N , μ = fμ n g n∈N , and γ = fγ n g n∈N are the Lagrange multipliers with respect to the constraint (23), respectively. ρ > 0 is the so-called penalty parameter, augmented Lagrangian parameter, which is a constant parameter intend to adjust the convergence speed of ADMM [50].
With the ADMM method to solve the problem P2, the resulting optimization steps are described as follows.

Global Variable Update.
The global variables fΘ, λ, μ, γg are updated in the ½t + 1-th iteration by settling the following optimization problem [51]: where the superscript ½t stands for the iteration index.
We denote x n = fx n,j , j ∈ N g as the local offloading decision vector of MD n, y = fy n , n ∈ N g as the decision vector of offloading tasks to BS j. For cloud computing, z = fz n , n ∈ N g is the decision vector of offloading tasks to the cloud DC. Then, omitting the local copies of the variablesx n,j ,ŷ n , z n , the objective function in P3 can be rewritten as where the functions f j ðx n Þ, gðyÞ, and hðzÞ are given Therefore, it is easy to recognize that the objective function and the feasible region in P3 are separable completely. As a result, P3 can be decomposed equivalently into the following three subproblems (P1 ′ , P2 ′ , and P3 ′ ), which are given by P2′ : min y g y ð Þ s:t: y n ∈ 0, 1 f g, ∀n ∈ N : Meanwhile, the subproblem P3′ related to the cloud servers is written as By replacing the binary constraint with (34) and (35) After the above equivalent transformations, the objective function of P4 is linear and constraints except (34) are convex. To deal with (34), we further transform P4 as given by where α acts as a penalty factor. It is proven for a sufficiently large amount; the problem P5 is equivalent to P4 [52].
Here, we define φ j ðx n Þ and ϕ j ðx n,j Þ as Then, it can be found that the objective function can be written as the difference of the two convex functions φ j ðx n Þ and ϕ j ðx n,j Þ. We can find that P5 is a D.C. programming problem [53]. Therefore, to solve P5, we can exploit the sequential convex approximation [24] of ϕ j ðx n,j Þ in the x n 7 Wireless Communications and Mobile Computing domain. ϕ j ðx n,j Þ can be approximated by its first-order Taylor expansion, and the objective function can be derived as where ∇ x n ϕ j ðx n,j Þ is the gradient of ϕ j ðx n,j Þ at x n and can be expressed as ∇ x n ϕ j ðx n,j Þ = ð∂ϕ j ðx n,j ÞÞ/∂x n,j , ∀j ∈ N : Then, we can obtain an approximation solution to get a local optimal solution x ½t n during each iteration, which is sketched in Algorithm 1, where x ½t n is the solution at the t -th iteration. As a result, P5 is a convex problem and can be solved efficiently by the standard convex optimization methods [54]. We can obtain near-optimal solution x ½t n of P 5 by iteratively solving.
It is worth noting that the solution x ½t n is better than the previous solution x ½t−1 n . Since the constraint set is compact, the sequence fx ½t n g t=1,2,3,⋯,n is proved to be convergent [52] by Cauchy theorem. The iterative process can stop after finite iterations. Given an initial point, due to the convexity of each iteration, Algorithm 1 converges to the same solution. In the issue, the convergence properties in Algorithm 1 could facilitate the convergence of ADMM.

The Solutions of the Subproblem P2
′ . For the subproblem P2′, it is an unconstrained binary optimization problem. Due to the fact that possible values of y n are 0 and 1, we have y 2 n = y n . Then, the expression after the summation sign of (29) is By comparing the corresponding objective function values of two possible solutions, the solution can be given by 5.2.3. The Solutions of the Subproblem P3 ′ . For the subproblem P3 ′ , it is also an unconstrained binary optimization problem as P2 ′ . Thus, the solution can also be given as 5.3. Local Variable Update. Now, we move on to the local variables. After obtaining the global variables, at the ½t + 1-th iteration, the local variables b Θ are updated by solving the following optimization problem: After eliminating some constant terms from the objective function, it is equivalent to solve the following problem: where the function Fð b Θ n Þ is given by As mentioned earlier, the constraint (23) implies that only one of x n,j , y n , and z n for the MD n can be 1 at any time. Thus, there are total N + 2 possible solutions for each MD n. We only need to calculate the corresponding objective function values of the N + 2 different offloading decisions and choose the minimum one, which corresponds to the optimal solution. Formally, the optimal solution of P6 is written aŝ x n,j = 1,ŷ n = 0,ẑ n = 0, if c n,j = C n,min ,∀n ∈ N , x n,j = 0,ŷ n = 1,ẑ n = 0, if c n,N+1 = C n,min ,∀n ∈ N , x n,j = 0,ŷ n = 0,ẑ n = 1, if c n,N+2 = C n,min ,∀n ∈ N , n,j g of P1′, t=0.
Algorithm 1: D.C-based algorithm for subproblem P1′. 8 Wireless Communications and Mobile Computing value of all possible solutions for MD n, which is expressed as C n,min = min fc n,j∈N , c n,N+1 , c n,N+2 g.

Dual Variable Update.
After obtaining the global and local variables, we perform the process of dual variable update. In the ½t + 1-th iteration, the dual variables are updated as follows: In summary, the efficient offloading scheme is obtained by sequential iteration for global variables, local variables, and dual variables. By leveraging the ADMM algorithm to the problem P3, we firstly minimize the augmented Lagrangian function (25) over the global variables and decompose the optimization problem into some smaller subproblems, which is executed in parallel to improve the computing speed. Then, we performed the local variable update based on equation (47). Finally, the dual variables are updated based on equations (48)- (50). The algorithm is summarized in Algorithm 2.

Evaluation
In this section, we will present simulation results to verify the performance of the proposed D2D-enabled three-tier MEC networks. In our simulations, the number of BSs is 4. Each BS has a radius of 400 m. And there are 80 MDs uniformly distributed in the coverage of each BS. We assume that each MD can establish one wireless link with the BS and one D2D link with a neighboring MD. The maximum range of each D2D link is set as 50 m. The channel gain model of all wireless links is chosen as h = 127 + 30 log 10 d (d in km), as suggested in [55]. Each MD has a task to be computed. The input data size of task n is L n ∈ [0.1, 4.0] Mbits. And the required computation amount of each task is assumed to be C n ∈ ½2 × 10 9 , 5 × 10 9 CPU cycles. The maximum delay tolerance of each task is 1 s. The computing capability of each MD is uniformly distributed from 0:5 × 10 9 to 2 × 10 9 CPU cycles/s. The maximum transmission power is set as 0.5 W [56] for each MD.
All random variables are independent for different MDs, modeling heterogeneous mobile computing resources. The main system parameters used in the simulation are summarized in Table 2, if not specified.

Performance Comparison.
We first compare the performance of the proposed D2D-enabled three-tier MEC framework with the other two networks [23,35,58]: (1) In the D2D networks, tasks which can be cooperatively processed only among local MDs (2) In the MEC networks, vertical cooperation among local MD itself, edge node, and remote cloud node.
(3) In the D2D-enabled MEC networks, where each task can be processed locally by MD itself or its neighboring MDs, by edge cloud, or by remote cloud. Output the optimal solution fx n,j , y n , z n g * .
Algorithm 2: Parallel optimization algorithm via ADMM. Local computational capability f L n 0.5GHz [56] Local computation power P L n 24 dBm [20] The computing capability of BSs F 20 GHz [38] The computing capability of cloud F 100 GHz [33] 9 Wireless Communications and Mobile Computing From Figure 3, we can observe that the number of supporting MDs in these different networks to edge computing resources. First of all, the numbers of supporting MDs in the MEC networks and the D2D-enabled MEC networks both increases with the edge computing resources. While the number of supporting MDs in the D2D networks keeps invariable. The reason is that the D2D networks does not utilize the edge computing resources. Secondly, the D2Denabled three-tier MEC networks achieves the best performance among these three systems. The reason is that the D2D-enabled MEC networks can utilize the computing resources of MDs, the edge servers, even the central cloud servers when the edge computing resource is insufficient. Moreover, the computing capacity of the D2D-enabled MEC networks is larger than that of the MEC networks since the computing resource of the MDs can be used for processing the offloaded computing tasks. Finally, the upper bounds of the computing capacity of the D2D-enabled MEC networks and the MEC networks are the same, that is the overall number of MDs, i.e., 80. The result indicates that employing D2D communications can notably save the required computing resources from edge data center or cloud data center. Figure 4 depicts the access ratio. It is the proportion of MDs that can be supported versus the total number of MDs. It can be observed that the access rates of both the MEC networks and D2D-enabled MEC networks decreasing with the number of MDs due to the limited edge computing resources, while the access rate of the D2D networks will correspondingly increase. The reason is that, the allocated edge computing resources for each MD in the MEC networks and D2D-enabled MEC networks decreases with the total number of MDs, which results in the smaller proportion of MDs that can be supported. Furthermore, the MDs computing resources can be fully utilized as the total number of MDs in the D2D networks increase, which eventually improves the access rate. We can also observe that the access rate of the D2D-enabled MEC networks decreases slower than that of the MEC networks since it utilizes the MD computing resources for capacity enhancement. Figure 5 illustrates the average required computing resources for each MD, versus the maximum range of D2D links in the MEC networks and D2D-enabled three-tier MEC networks, respectively. It shows that the average required computing resources in the D2D-enabled MEC networks are smaller than those in the MEC networks, especially when the maximum range of D2D links becomes large. This is because each MD has more potential neighboring MDs to offload tasks as the range of D2D link becomes larger. In this way, the computing resources of all MDs can be further utilized via D2D offloading. We can also observe a reduced required computing resource with the decreased delay tolerance in both networks.   10 Wireless Communications and Mobile Computing Figure 6 presents the total delay with different computation processing densities. Comparing the proposed scheme with two benchmarks (i.e., MEC networks and D2D networks), we can observe the following: when the processing density is low, the task processed at the device tier performs well compared to offloading to the edge cloud or central cloud DC. This is because the transmission latency on account of offloading from the MD to the edge node or cloud node dominates over the local processing time at the local device tier.
Nevertheless, as the processing density increases, the proposed scheme outperforms the D2D processing at the device tier. Furthermore, with higher processing density, only the MEC networks may not be able to meet the low-latency requirement. On the other hand, as our proposed D2Denabled MEC networks optimize the offloading decisions, we obtain a significantly lower total latency compared to the other solutions.

Conclusion
In this article, we consider cooperative offloading in D2Denabled three-tier MEC networks as a part of the IoT. By leveraging the advantages of both MEC and D2D cooperation techniques, the computing resources in edge nodes, cloud nodes, and D2D MDs can be effectively utilized. We jointly optimize the task offloading decisions and computing resource allocation to minimize the total delay of tasks. The formulated problem is a mixed-integer nonlinear optimization problem. When networks grow larger, it is difficult to be solved. To work out this problem, we adopt a parallel optimization framework based on the ADMM algorithm. Simulation results show that the proposed framework and solution outperform the other solutions with various parameters. In our future work, we may consider the queue of tasks, partible offloading, and privacy protection when investigating the offloading problem.

Data Availability
No data were used to support this study.

Conflicts of Interest
The authors declare that there is no conflict of interests regarding the publication of this paper.