Performance Analysis and Optimization of Delayed Offloading System With Opportunistic Fog Node

Fog node (FN) close to Internet of Things (IoT) devices can be exploited to offload the computing task of IoT devices. However, when lots of tasks are simultaneously offloaded from multiple IoT devices, FN can be overloaded. To mitigate this problem, we introduce a DYSON: DelaYed offloading System with Opportunistic fog Node (OFN) such as vehicles and mobile phones which can opportunistically reduce the load of static FN thanks to their mobility. In DYSON, to maximize the offloading effect of OFN, when IoT device cannot use OFN, it delays the task offloading with the expectation of future contacts of OFN. To assess the performance of DYSON, we develop an analytic model for the opportunistic offloading probability that the task can be offloaded to OFN. Based on the analytic model, we derive the optimal delay timer to maximize the opportunistic offloading probability while maintaining the probability that the task cannot be processed within the deadline below a target probability. Extensive simulation results are provided to show the superiority of DYSON.


I. INTRODUCTION
In these days, along with the development of Internet of Things (IoT) applications, the cloud computing architecture has been used for the task processing of IoT devices owing to the flexibility and scalability on the resource management of the cloud service [1]. However, the physical distance between the cloud servers and IoT devices leads to long service delay and consumes lots of bandwidth and energy of the network. This triggers the concept of the fog computing where computing resources are located close to the IoT devices [2], [3].
In the fog computing architecture, tasks from IoT devices usually can be offloaded to the fog node (FN) which is connected to the access network device (e.g., a cellular base station (BS) [4]). However, even though FN is promising to offload the tasks, the scalability issue can occur because of limited computation resources and latency requirement of IoT applications [5]. For example, if lots of IoT devices exist at similar location and offload excessive tasks at the same time, FN can be easily overloaded. To solve this problem, there are several works (e.g., co-operation with other FNs and remote cloud) [4], [6]. One of promising solutions is to introduce opportunistic FNs (OFNs). OFN denotes FN with the mobility, such as vehicles and mobile phones, to which IoT devices can offload their tasks [7]. OFNs can connect with IoT devices and provide resources to them only when they are physically near IoT devices. That is, IoT devices opportunistically offload tasks to OFNs when OFNs are close to them [5], [8]- [12]. In [5], moving vehicles are utilized as OFNs to reduce the average system response time. Zhu et al. [8] provide a task offloading scheme to shorten the average service latency while reducing the overall quality loss when the nearby OFNs are discovered. In [9], predictive offloading with OFNs is introduced to distribute the load of static FN that suffers from its resource limitation and save the backhaul resources. Under information asymmetry and uncertainty in the vehicular fog computing (VFC) scenario, Zhou et al. [10] present a contract-based server recruitment method to share the available resources and propose matching-learningbased task offloading method that matches user vehicles and OFNs to minimize the delay performance. Meanwhile, privacy and security concerns of offloading also have been considered [11], [12]. In [11], blockchain is utilized to validate offloaded data transactions among OFNs and cloud nodes. In addition, Liao et al. [12] introduce the blockchain-based VFC framework where BS plays the consensus role in the blockchain network. However, in these works, tasks can be offloaded to OFN only when there is available OFN. That is, if there is no OFN, tasks have to be unwillingly handled by static FN.
To offload more tasks to OFN, 1 we introduce the DelaYed offloading System with OFN, named DYSON. In DYSON, the offloading of the task can be delayed with the expectation of future OFN contacts. That is, when IoT device cannot use OFN (i.e., there is no available OFN close to IoT device), it delays the offloading up to a pre-defined delay timer. Then, if OFN appears before the delay timer expires, the pending task can be delivered to OFN, which means higher utilization of OFN. Meanwhile, after the delay timer expires, IoT device always offloads its task to FN. To evaluate the performance of DYSON, we develop the analytical model for the opportunistic offloading probability that the task of IoT device is offloaded to OFN. Note that the opportunistic offloading probability can be considered as the load distribution effect. Based on the developed model, we derive the optimal delay timer to maximize the opportunistic offloading probability while maintaining the probability that the task cannot be processed within the deadline below a target probability. Extensive simulation results validate the analytic model and demonstrate that DYSON with the optimal timer has up to 298% opportunistic offloading probability with 1% outage probability compared to that of the conventional on-the-spot offloading system which offloads the task without the delay timer.
The main contribution is as follow: 1) even though the benefits of delayed offloading are considered in Wi-Fi offloading to reduce the traffic over the cellular networks [13]- [15], to the best of our knowledge, this is the first analytic work that considers the delayed task offloading in the fog computing architecture considering OFN. Specifically, we develop the analytic models for the opportunistic offloading probability and derive the optimal delay timer to maximize the offloading effect while considering the task completion deadline; 2 and 2) extensive The remainder of this paper is organized as follows. DYSON is introduced in Section II. Performance analysis and simulation results are provided in Sections III and IV, respectively. Finally, this paper is concluded with future works in Section V.

II. DELAYED OFFLOADING SYSTEM WITH OPPORTUNISTIC
FOG NODES (DYSON) Fig. 1 shows the system model of this paper. It is assumed that FN attached to BS is always available whereas OFN is only available when it moves close enough to IoT device. In Fig. 1, the grey circle centered on IoT device represents for the communication range of IoT device. Therefore, only when OFN enters into this grey circle, IoT device can offload its task to OFN. Meanwhile, this paper assumes continuous time model where the specific events can occur at any time. For example, in Fig. 1, offloading to OFN is possible between τ 1 and τ 2 (i.e., contact time). Thus, if the task of IoT device occurs between τ 1 and τ 2 , it immediately offloads the task to OFN without a delay timer. Otherwise, when the task occurs before τ 1 , IoT device cannot immediately use OFN. Thus, it delays the offloading up to a pre-defined delay timer t D . Before the delay timer expires, if OFN becomes available owing to its mobility, the pending task can be delivered to OFN. If the task is completed by OFN before τ 2 , IoT device can get the result of the task from OFN. However, if the task cannot be completed by OFN during the contact time with IoT device, the task can be offloaded from IoT device to FN again. Then, IoT device can receive the result from it. Note that the disconnection with OFN can be recognized by IoT device by means of the periodic signaling messages [8], [16]. Meanwhile, when OFN is still not available even after the delay timer expires, the task is delivered from IoT device to FN.
For the description of the system model and performance analysis, important notations are described in Table I. We assumed that the contact time between OFN and IoT device, t OF N , follows an exponential distribution whose mean value is 1/μ OF N as it is widely exploited for the OFN residence time of the vehicles [16], [17] and mobile users [15]. The probability density function (PDF) and cumulative density function (CDF) can be represented as and In addition, a general distribution with mean 1/μ F N is assumed for the period when OFN is not available, t F N (i.e., non-contact time) [15].
Meanwhile, we assume that the task processing times of FN and OFN follow the exponential distribution as it is widely utilized in the previous fog computing systems [18], [19]. The task processing time of FN, t s,F N , follows the exponential distribution with mean ωv F N /u F N where ω, v F N , and u F N are the mean size of the task, computation intensity, and computing capacity of FN, respectively [18]. Then, the PDF and CDF for the task processing time of FN are denoted by and (4) Similarly, the exponential distribution with mean ωv OF N /u OF N is assumed for the task processing time of OFN, t s,OF N , where v OF N and u OF N are the computation intensity and computing capacity of OFN [18]. The PDF and CDF of t s,OF N are given by and Furthermore, the delay timer, t D , is assumed to follow an exponential distribution with mean 1/λ D [19]. Then, the PDF and CDF of t D can be represented as By means of the exponential delay timer, the fixed optimal timer can be derived and utilized practically instead of the exponential delay timer [20], [21].

III. PERFORMANCE ANALYSIS
In this section, in order to evaluate the performance of DYSON compared to that of the on-the-spot offloading system, 3 the analytic models for both systems are provided. Specifically, the opportunistic offloading probability, which is defined as the probability that the task of IoT device can be offloaded to OFN, is derived as an important performance metric of each system.

A. Dyson
To obtain the opportunistic offloading probability of DYSON, six disjoint cases need to be considered in Fig. 2: (a) and τ r are the times when the task occurs in IoT device, IoT device offloads its task, and IoT device receives the result of the task, respectively. As mentioned above, t s,F N and t s,OF N denote the task processing times of FN and OFN, respectively. When we let E Y,D be the partial opportunistic offloading probability in the case Y ∈ {a, b, c, d, e, f} for DYSON, it can be derived as follows.
1) E a,D : When τ k , τ k + t D , τ r < τ 1 , the task is processed by FN because OFN is not available even after the delay timer t D . Therefore, E a,D is simply 0.
2) E b,D : When τ k , τ k + t D < τ 1 ≤ τ r , E b,D is also simply 0 because IoT device offloads its task to FN before OFN is available at τ 1 .
3) E c,D : When τ k < τ 1 ≤ τ k + t D , τ r ≤ τ 2 , thanks to the delay timer, the offloading to OFN can be possible although the task occurs before OFN is available. In addition, IoT device can get the result of the task from OFN because OFN completes the task within the contact time.
We can calculate the partial opportunistic offloading probability in case c by means of the PDF of t s,OF N , τ k , and t OF N . The joint PDF of the t s,OF N , τ k , and t OF N is denoted by f s,k,OF N (t s,OF N , τ k , t OF N ).
Since t s,OF N , τ k , and t OF N are independent, the joint PDF is the product of each PDF (i.e., f s (t s,OF N )f k (τ k )f OF N (t OF N )). As a result, E c,D is given by (9) as shown in the top of the next page.

4) E d,D :
When τ k < τ 1 ≤ τ k + t D ≤ τ 2 < τ r , although the offloading to OFN can be possible owing to the delay timer, IoT device cannot get the result of the task because the contact time between OFN and IoT device is not enough for the task processing (i.e., OFN moves away from the communication range of IoT device before it completes the task processing). In this case, IoT device can offload the task to FN again and receive the result from it. Therefore, E d,D is 0.

5) E e,D :
Because τ 1 ≤ τ k and τ r ≤ τ 2 represent that the task of IoT device can be delivered to OFN and IoT device can get the result from it, E e,D can be obtained by (10) as shown in the top of the current page.
6) E f,D : The case, τ 1 ≤ τ k ≤ τ 2 < τ r , represents that, even though the task occurs when OFN is available, IoT device cannot get the result of the task because OFN moves away from the communication range of IoT device before it completes the task processing. Thus, as similar with case d, the task is offloaded to FN again and IoT device receives the result from it. Therefore, E f,D is 0. Since the cases from a to f are disjoint events, the opportunistic offloading probability, E, for DYSON can be obtained by E a,D + On the other hand, even though the longer delay timer means the more opportunities to meet OFN, it leads to the longer task completion time which can directly result in the quality of service (QoS) degradation. Note that QoS of the task offloading service can be generally guaranteed by processing the task within a certain deadline instead of processing the task unconditionally quickly [22]. Therefore, the optimal delay timer is required to maximize the opportunistic offloading probability while maintaining the probability that the task cannot be processed within the deadline (i.e., outage probability, P D ) below a target probability α. 4 In this paper, the optimal delay timer is derived based on P D for the worst case (i.e., case d in Fig. 2). Then, this optimal delay timer can maintain P D below α for all other cases. As t D is inversely proportional to λ D , the optimal rate of t D , λ * D , can be obtained by where argmin() returns the minimum argument satisfying the given inequality. Let Z be the sum of t D , t OF N , and t s,F N . Since t D , t OF N , and t s,F N follow the exponential distribution with mean 1/λ D , 1/μ OF N , and ωv F N /u F N , respectively, PDF and CDF of Z can be represented as [23] f and where respectively. By exploiting (13), (11) can be rearranged as Based on (15), the optimal timer λ * D can be derived using an iterative method such as the Newton's method [24]. Note that the delay timer can be 0 when there is no λ D which satisfies (15). This means that D t and/or α are too tight to determine λ D . On the other hand, in the case of the delay tolerable tasks, the delay timer can be infinity.

B. On-the-Spot Offloading System
Similarly, the opportunistic offloading probability of the on-the-spot offloading system can be obtained by considering four cases in Fig. 3: a) τ k , τ r < τ 1 , b) τ k < τ 1 ≤ τ r , c) τ 1 ≤ τ k , τ r ≤ τ 2 , and d) τ 1 ≤ τ k ≤ τ 2 < τ r . Note that, since the task of IoT device is immediately offloaded in both DYSON and the on-the-spot offloading system, the cases c and d of the on-the-spot offloading system are same to those of e and f for DYSON, respectively. Let E X,O be the partial opportunistic offloading probability in the case X ∈ { a, b, c, d } for the on-the-spot offloading system. Then, E X,O can be derived as follows.
1) E a,O : When τ k , τ r < τ 1 , the task is processed by FN because OFN is not available yet. Therefore, E a,O is simply 0.
2) E b,O : When τ k < τ 1 ≤ τ r , E b,O is also simply 0 because IoT device offloads its task to FN.
3) E c,O : As mentioned above, the case c is same to case e in DYSON. Consequently, E c,O can be obtained from (10).

4) E d,O :
As mentioned above, the case d is same to case f in DYSON. This means that E d,O is simply 0.
Since the above cases are disjoint, the opportunistic offloading probability, E, for the on-the-spot offloading system can be obtained

IV. SIMULATION RESULTS
To verify the derived analytical models, extensive simulation by means of a developed event-driven simulator was conducted. The default values of μ OF N , μ F N , ω, u OF N , u F N , v OF N , and v F N are 100, 10, 1 MB, 5×10 8 cycles per second, 10×10 8 cycles per second, 50  cycles per MB, and 100 cycles per MB, respectively [18]. Based on the assumed distributions, 20,000 random numbers of t OF N , t F N , t s,F N , and t s,OF N are generated. Then, with the optimal delay timer 1/λ * D which can be obtained based on the Newton's method [24], they are used to calculate the opportunistic offloading probability. Consequently, the average values are used to show the results. Also, task completion deadline and the target probability (i.e., D t and α) are 0.3 and 0.05 , 5 respectively.
The comparison between the analytical and simulation results is shown in Table II. As shown in Table II, the simulation results are very similar with the analytic results (i.e., less than 2% difference). In addition, from Table II, it can be found that the opportunistic offloading probability (i.e., E) and the task completion time (i.e., T c ) become higher with the increase of the target probability. This can be explained as follows. When α has a large value (i.e., loose outage probability constraint), the optimal delay timer can be set to larger value as shown in the second column of Table II. Fig. 4 shows the opportunistic offloading probability E with the contact time 1/μ OF N which is normalized by the non-contact time  1/μ F N . Meanwhile, as 1/μ OF N increases, E increases for both systems. This is because as 1/μ OF N increases, which can also mean the decrease of the moving speed of OFN, there is more chance to utilize OFN. Fig. 4 also shows that E of DYSON with the optimal delay timer for any α is higher than that of the on-the-spot offloading system under every 1/μ OF N . The on-the-spot offloading system starts offloading immediately when the task occurs while DYSON defers the offloading at most t D . Therefore, the on-the-spot offloading system relatively has little chance to use OFN than that of DYSON, which results in lower E. In addition, the efficiency of DYSON becomes apparent as α increases. For example, with the setting 1/μ OF N = 0.6 (i.e., the sixth x-axis point), E of DYSON is improved by 121%, 149%, and 175% compared to the on-the-spot offloading system, when α = 0.01, 0.05, and 0.1, respectively. On the other hand, it can be found that the efficiency of DYSON decreases as 1/μ OF N increases. For example, the improvement rate of E of DYSON compared to the on-the-spot offloading system is 298% when 1/μ OF N is 0.1. However, it becomes 103% when 1/μ OF N is 1. The reason is that the optimal delay timer becomes reduced according to the increasing contact time, which decreases the effect of the delay. Fig. 5 shows the opportunistic offloading probability E with the mean size of the task ω when α = 0.05. It is found that E decreases according to the increase of ω for both systems. The reason is that according to the increase of ω, the task processing time also increases, which reduces the probability that the task can be completed by OFN within the contact time. E is reduced by 62% according to the change of ω from 1 to 5 when u = 5x 10 8 for both systems. Even though E decreases according to ω for both systems, DYSON has higher E than that of the on-the-spot offloading system with the same u. This is because DYSON has more chance to offload the task to OFN owing to t D than the on-the-spot offloading system. Specifically, with the setting ω = 10, E of DYSON is improved by 388% and 387% when u = 5 x10 8 and 15x10 8 , respectively. In addition, it can be checked from Fig. 5 that E increases when u increases. The reason is that the task processing time can be reduced when u increases.

V. CONCLUSION
This paper introduced a DYSON where IoT device can delay the task offloading to maximize the offloading effect of opportunistic fog node (OFN). In addition, the analytic model of the opportunistic offloading probability was developed to assess the performance of the proposed system. Based on the analytic model, we derive the optimal delay timer to maximize the opportunistic offloading probability while maintaining the probability that the task cannot be processed within the deadline below a target probability. Analytic and simulation results demonstrated that DYSON with the optimal delay timer can significantly improve the opportunistic offloading probability compared to the on-the-spot offloading system. In addition, it is shown that the opportunistic offloading probability is influenced by the task processing time, delay timer, task size, and computing capacity. In our future work, this paper will be extended to handle the competition to get the constrained computing resource of OFN considering multiple IoT devices.