1 Introduction

Nowadays cloud computing has become a principal companion of mobile systems with the advancement of cellular network. In today’s life instead of using desktop computers people are very much familiar with laptop, smart phone, tablets etc. However, there are various challenges come in the way to meet the need of people for high speed data communication in such mobile devices. The challenges are lack of storage, computational power, limited resource and limited battery life of mobile devices. For solving these difficulties, cloud computing has come in the scenario. The shortcomings of mobile devices such as small storage, low capacity and processing ability, have been overcome by integrating cloud computing with mobile computing.

Mobile cloud computing (MCC) is an amalgamation of mobile computing and cloud computing [1]. MCC is used to process the task of mobile devices in the cloud to save its processing power and battery life. The mobile devices may not be able to process all the tasks because of limited ability of processing. In such a case, cloud provides the infrastructure, platform and software oriented supports as services [2]. The method of migrating the storage and computation from the mobile device to the cloud server is referred as offloading [3, 4]. In offloading, delay and power consumption are two principal parameters of quality-of-experience (QoE). Sometimes offloading a task to the remote cloud increases the communication overhead from the perspective of delay and power consumption. Cloudlet has been introduced to overcome this problem [5,6,7]. Cloudlet acts as a middleware between the mobile device and the remote cloud. Resource interactive and intensive mobile tasks are supported by cloudlets. From the existing work it can be seen that tasks are delegated either in public cloud or in cloudlet for reducing delay [7,8,9,10]. If cloudlet fails to process the task, it is forwarded to the public cloud which increases delay. It also may happen that full delegation of a task is not required. Only a segment of the task needs to be delegated to the cloudlet or public cloud server. As solutions to these problems, in this paper we have proposed multilevel full and partial offloading algorithms.

1.1 Motivations and Contributions

Offloading is a challenging issue with respect to delay and power consumption. For reducing delay and power consumption, cloudlet is used. Nevertheless, sometimes cloudlet fails to serve the user request. In that case use of public cloud may enhance the delay and power consumption. Sometimes it also may require to delegate a segment of a task instead of offloading the whole [11]. In that case, partial offloading to public cloud increases the delay. Our objective is to provide solutions towards these problems. The contributions of this paper are:

  1. 1.

    A multilevel full offloading strategy is proposed where cloudlet, private cloud and public cloud are used. A mobile device first requests its nearest cloudlet for delegating a task. If it fails, then the private cloud is used. If the private cloud is also unable to serve, then the public cloud is used. In the proposed work, two-level offloading to cloudlet, three-level offloading to private cloud and four-level offloading to public cloud are performed. Use of nearby private cloud reduces the probability of offloading to the public cloud which is remotely located. This reduces the delay and power consumption. This is the unique feature of the proposed work in comparison to the existing works [6,7,8] where only cloudlet and public cloud are used to offload.

  2. 2.

    Offloading is a promising issue if a task is partially executable inside the mobile device. In this paper we have introduced a multilevel partial offloading method, where a task is partitioned into two segments. One segment is executed inside the mobile device and the other is partially or fully offloaded to the nearest cloudlet or private cloud or public cloud. Use of the private cloud reduces the delay and power consumption with respect to the public cloud.

  3. 3.

    Theoretical and experimental analyses of the proposed two strategies are carried out to demonstrate their efficiency in terms of power and delay with respect to the existing approaches [6,7,8, 11].

The organization of the paper is: Sect. 2 contains the related works, Sect. 3 and 4 contain the proposed multilevel full and partial offloading strategies respectively with their performance analysis, and conclusion is given in Sect. 5.

2 Related Works

Computation and data offloading are emerging research domains in MCC, where either data or code is offloaded. Mobile data offloading for traffic optimization is a challenging domain [12, 13]. A queuing analytical approach for data offloading has been discussed in [14]. The mobile data offloading through opportunistic communication has been discussed in [15], where target-set selection problem has been used for data traffic minimization. Opportunistic mobile data offloading has been discussed in [16].

In case of computation offloading, the computational task is performed by some other device instead of the mobile device itself [17, 18]. However, depending on the intensity of computation and resource requirement, it has to be decided whether to offload a task or not. The decision for offload or not to offload has been considered as a prospect-theory non-cooperative game in [19], where distributed offloading has been proposed to obtain Nash equilibrium. Depending on the complexity of the moble applications, a multi-objective decision making system has been proposed in [20]. The decision making regarding offloading or local execution from the perspective of energy efficiency has been discussed in [3, 11]. If a computation needs resources which is not avalibale inside the mobile device or will consume huge amount of time and energy that may drop its battery, then offloading can be a better option. However, in this regard it has to be observed that the mobile device’s energy consumption during data transmission should not be more than the energy consumption while executing the computation itself. Usually the resource hungry computations are offloaded to save the energy of the mobile device [3, 11]. In our previous work, we have considered the deadline and power consumption of the mobile device during local and remote execution, to decide whether to offload a computation or not [11]. A context-aware offloading model is proposed in [21].

However, offloading to remote cloud may suffer from higher delay and power consumption, which has been solved using cloudlet [5,6,7,8] and fog computing [22,23,24,25]. In fog computing the intermediate devices between the end node and cloud perform partial data processing [22,23,24,25]. Use of edge and fog devices in case of computation offloading has been focused in various research works [26,27,28]. Computation offloading along with resource allocation in an integrated edge-fog system has been discussed in [29]. Cooperative computation offloading in edge and fog based systems has been discussed in [30, 31]. Cooperative computation offloading between fog and cloud has been discussed along with content placement in [32]. Multi-user computation offloading under a dynamic environment has been highlighted in [19]. A joint computation offloading and resource allocation with edge computing has been discussed in [33]. For saving the battery of the user device and minimizing the delay, task offloading problem has been dealt with through the solutions of the sub problems task placement and resource allocation [34].

For latency aware offloading cloudlet is also a popular option [5,6,7,8]. In cloudlet based framework, a computer or a cluster of computers act as middleware between end node and cloud, to provide low latency services to the users [5,6,7,8]. The placement of cloudlets and allocation in wireless metropolitan area network has been discussed in [7]. However, to offload a task if multiple cloudlets are available nearby a mobile device, then finding out the optimum cloudlet is a challenge that has been addressed in [6].

However, in the existing offloading strategies either the cloudlet or the remote cloud is used. As a result if none of the cloudlet is able to serve the mobile device, the remote cloud is used and the delay increases. Accordingly the power consumption also increases. In our paper we have proposed full and partial offloading methods based on cloudlet, private cloud server and public cloud server. A mobile device first requests its nearest cloudlet for delegating a task. If it fails, then private cloud server is used that reduces the possibility of offloading to the public cloud server which is located distantly. This decreases the delay and power consumption.

3 Proposed Multilevel Full Offloading Strategy

In this section we have proposed a multilevel full offloading strategy. The decision of offloading or local execution is first taken based on power consumption and latency. The parameters used in this calculation are defined in Table 1.

Table 1 Parameters used in calculating power and delay consumption

If the task has I number of instructions, the delay in executing them locally inside the mobile device is computed as [6],

$$D_{loc} = (I/S_{m} )$$
(1)

The power consumption in executing I instructions locally inside the mobile device is computed as [6],

$$P_{loc} = P_{mob} \cdot D_{loc}$$
(2)

The propagation delay is computed as [6],

$$D_{prop} = (Di_{cl} /S_{p} )$$
(3)

The power consumption by the mobile device during propagation is given as [6],

$$P_{prop} = P_{idle} \cdot D_{prop}$$
(4)

The delay in executing I instructions inside the cloudlet considering the data sending and receiving, and propagation, is computed as [6],

$$D_{rem} = (I/S_{cl} ) + (D_{sen} /R_{mcl} ) + (D_{rec} /R_{clm} ) + D_{prop}$$
(5)

where \((I/S_{cl} )\) is the instruction execution delay, \((D_{sen} /R_{mcl} )\) is the data sending delay, \((D_{rec} /R_{clm} )\) is the data receiving delay and \(D_{prop}\) is the propagation delay.

The power consumption in executing I instructions inside the cloudlet considering the data sending and receiving, and propagation, is computed as [6],

$$P_{rem} = P_{idle} \cdot (I/S_{cl} ) + P_{prop} + P_{sen} \cdot (D_{sen} /R_{mcl} ) + P_{rec} \cdot (D_{rec} /R_{clm} )$$
(6)

If \(P_{loc} < P_{rem}\) and \(D_{loc} < D_{rem}\), the code is executed locally.

Otherwise the code is offloaded using the multilevel full offloading method proposed in Sect. 3.1. In that case if the task deadline is less than Drem, a delay extension request is generated.

3.1 Proposed Multilevel Full Offloading Algorithm

The proposed algorithm for multilevel full offloading is presented in Table 2. This method is shown in Fig. 1. In our method, the user asks to delegate a task Ti. The task can be related to data or code offloading. For code offloading, the user gives input for the code to be offloaded. The task is delegated to the nearest cloudlet (Ck) selected by the mobile device using Service Location Protocol [20]. If the nearest cloudlet fails to serve the user, the task is delegated to the private cloud server (Pr). If the private cloud server is also unable to provide service, the task is delegated to the public cloud server (Pu).

Table 2 Proposed multilevel full offloading algorithm
Fig. 1
figure 1

Multilevel full offloading using proposed strategy

In Fig. 1, Level 1 contains mobile device. Level 2 and Level 3 contains cloudlet and private cloud servers respectively. Public cloud servers are included in level 4. Initially the mobile device requests for task delegation to nearby cloudlet. If the cloudlet is able to perform the task it executes the task and sends the result to the mobile device. Otherwise the cloudlet requests private cloud for delegating the task. If the private cloud is able, it accomplishes the task and the result is directed to mobile device via cloudlet. Else the private cloud requests public cloud for executing the task. The public cloud executes the task and the result is sent to the mobile device via private cloud and cloudlet.

3.2 Delay in Full Offloading

As observed from the proposed algorithm, three following cases appear:

  • Task delegation to cloudlet

  • Task delegation to private cloud

  • Task delegation to public cloud.

Case 1: Task delegation to cloudlet

In this case, the cloudlet executes the task. Then the propagation delay is given by [6],

$$D_{pcl} = (Di_{cl} /S_{p} )$$
(7)

The delay for sending data to the cloudlet by the mobile device is given by [6],

$$D_{mcl} = (D_{sen} /R_{mcl} )$$
(8)

If the cloudlet executes the task, the delay during the queuing and execution is given as [6],

$$D_{excl} = q_{cl} + (I/S_{cl} )$$
(9)

The delay for receiving data from the cloudlet by the mobile device is given by [6],

$$D_{clm} = (D_{rec} /R_{clm} )$$
(10)

Thus the total offloading delay in case 1 is given as,

$$D_{cs1} = D_{pcl} + D_{mcl} + D_{excl} + D_{clm}$$
(11)

Case 2: Task delegation to private cloud

In this case, the private cloud executes the task. Then the propagation delay is given by [6, 11],

$$D_{ppr} = [(Di_{cl} /S_{p} ) + (Di_{pr} /S_{p} )]$$
(12)

The delay during sending data from cloudlet to the private cloud is given by [6, 11],

$$D_{clpr} = (D_{sen} /R_{clpr} )$$
(13)

Hence, the delay in sending data from mobile device to the private cloud via cloudlet is \((D_{mcl} + D_{clpr} )\).

If the private cloud executes the task, the delay during the queuing and execution is given as [6, 11],

$$D_{\exp r} = q_{pr} + (I/S_{pr} )$$
(14)

The delay during receiving data by cloudlet from the private cloud is given by [6, 11],

$$D_{prcl} = (D_{rec} /R_{prcl} )$$
(15)

Hence, the delay in receiving data from the private cloud to the mobile device via cloudlet is \((D_{prcl} + D_{clm} )\).

Thus the total offloading delay in case 2 is given as,

$$D_{cs2} = D_{ppr} + (D_{mcl} + D_{clpr} ) + D_{\exp r} + (D_{prcl} + D_{clm} )$$
(16)

Case 3: Task delegation to public cloud

In this case, the public cloud executes the task. Then the propagation delay is given by [6, 11],

$$D_{ppu} = [(Di_{cl} /S_{p} ) + (Di_{pr} /S_{p} ) + (Di_{pu} /S_{p} )]$$
(17)

The delay during sending data from private cloud to the public cloud is given by [6, 11],

$$D_{prpu} = (D_{sen} /R_{prpu} )$$
(18)

Hence, the delay in sending data from mobile device to the public cloud via cloudlet and private cloud is \((D_{mcl} + D_{clpr} + D_{prpu} )\).

If the public cloud server executes the task, the delay during the queuing and execution is given as [6, 11],

$$D_{\exp u} = q_{pu} + (I/S_{pu} )$$
(19)

The delay during receiving data by the private cloud from the public cloud is given by [6, 11],

$$D_{pupr} = (D_{rec} /R_{pupr} )$$
(20)

Hence, the delay in receiving data from the public cloud to the mobile device via cloudlet and private cloud is \((D_{pupr} + D_{prcl} + D_{clm} )\).

Thus the total offloading delay in case 3 is given as,

$$D_{cs3} = D_{ppu} + (D_{mcl} + D_{clpr} + D_{prpu} ) + D_{\exp u} + (D_{pupr} + D_{prcl} + D_{clm} )$$
(21)

Delay Considering Three Cases

If the probability of occurrence of case 1, case 2 and case 3 are p1, p2 and p3 respectively, the delay is given as,

$$D_{full} = p_{1} \cdot D_{cs1} + p_{2} \cdot D_{cs2} + p_{3} \cdot D_{cs3}$$
(22)

3.3 Power Consumption in Full Offloading

To calculate the power consumption of the mobile device during offloading, again three following cases are considered:

  • Task delegation to cloudlet

  • Task delegation to private cloud

  • Task delegation to public cloud

Case 1: Task delegation to cloudlet

If the cloudlet executes the task, the power consumption of the mobile device during propagation is given by [6],

$$P_{pcl} = P_{idle} \cdot D_{pcl}$$
(23)

The power consumption of the mobile device for sending data to the cloudlet is given by [6],

$$P_{mcl} = P_{sen} \cdot D_{mcl}$$
(24)

If the cloudlet executes the task, the power consumption of the mobile device during the queuing and execution period is given as [6],

$$P_{excl} = P_{idle} \cdot D_{excl}$$
(25)

The power consumption of the mobile device for receiving data from the cloudlet is given by [6],

$$P_{clm} = P_{rec} \cdot D_{clm}$$
(26)

Thus the power consumption of the mobile device in case 1 is given as,

$$P_{cs1} = P_{pcl} + P_{mcl} + P_{excl} + P_{clm}$$
(27)

Case 2: Task delegation to private cloud

If the private cloud executes the task, the power consumption by the mobile device during propagation is given by [6, 11],

$$P_{ppr} = P_{idle} \cdot D_{ppr}$$
(28)

The power consumption of the mobile device during sending data from cloudlet to the private cloud is given by [6, 11],

$$P_{clpr} = P_{idle} \cdot D_{clpr}$$
(29)

Hence, the power consumption of the mobile device during sending data to the private cloud via cloudlet is \((P_{mcl} + P_{clpr} )\).

If the private cloud executes the task, the power consumption of the mobile device during the queuing and execution period is given as [6, 11],

$$P_{\exp r} = P_{idle} \cdot D_{\exp r}$$
(30)

The power consumption of the mobile device during receiving data by cloudlet from the private cloud is given by [6, 11],

$$P_{prcl} = P_{idle} \cdot D_{prcl}$$
(31)

Hence, the power consumption of the mobile device while receiving data from the private cloud via cloudlet is \((P_{prcl} + P_{clm} )\).

Thus the power consumption of the mobile device in case 2 is given as,

$$P_{cs2} = P_{ppr} + (P_{mcl} + P_{clpr} ) + P_{\exp r} + (P_{prcl} + P_{clm} )$$
(32)

Case 3: Task delegation to public cloud

If the public cloud executes the task, the power consumption of the mobile device during propagation is given by [6, 11],

$$P_{ppu} = P_{idle} \cdot D_{ppu}$$
(33)

The power consumption of the mobile device during sending data from private cloud to the public cloud is given by [6, 11],

$$P_{prpu} = P_{idle} \cdot D_{prpu}$$
(34)

Hence, the power consumption of the mobile device during sending data to the public cloud via cloudlet and private cloud is \((P_{mcl} + P_{clpr} + P_{prpu} )\).

If the public cloud executes the task, the power consumption of the mobile device during the queuing and execution period is given as [6, 11],

$$P_{\exp u} = P_{idle} \cdot D_{\exp u}$$
(35)

The power consumption of the mobile device during receiving data by the private cloud from the public cloud is given by [6, 11],

$$P_{pupr} = P_{idle} \cdot D_{pupr}$$
(36)

Hence, the power consumption of the mobile device while receiving data from the public cloud via cloudlet and private cloud is \((P_{pupr} + P_{prcl} + P_{clm} )\).

Thus the power consumption of the mobile device in case 3 is given as,

$$P_{cs3} = P_{ppu} + (P_{mcl} + P_{clpr} + P_{prpu} ) + P_{\exp u} + (P_{pupr} + P_{prcl} + P_{clm} )$$
(37)

Power Consumption Considering Three Cases

If the probability of occurrence of case 1, case 2 and case 3 are p1, p2 and p3 respectively, the power consumption of the mobile device is given as,

$$P_{cs3} = p_{1} \cdot P_{cs1} + p_{2} \cdot P_{cs2} + p_{3} \cdot P_{cs3}$$
(38)

3.4 Performance Analysis

In this section we have evaluated the performance of the proposed full offloading method based on the theoretical analysis performed using MATLAB 2015 and experimental analysis performed using the cloudlet, private cloud server and public cloud server.

3.4.1 Theoretical Analysis

Figures 2 and 3 respectively shows the offloading delay and power consumption of the mobile device in the proposed strategy and the existing strategies where only cloudlet and public cloud servers are used for offloading purpose. The power consumption is measured in watt (W) and delay is measured in second (s). Figure 2 shows that the proposed multilevel full offloading scheme reduces the delay by approximately 3%, 14% and 22% than [6,7,8] respectively. It is observed from Fig. 3 that the proposed multilevel full offloading scheme reduces the power consumption by approximately 8–9%, 12–13% and 20–22% than [6,7,8] respectively. Hence the proposed scheme offers green and high speed offloading to the users. In [6,7,8], either the cloudlet or the remote cloud server serves the device. If the cloudlet cannot satisfy the user’s demand, the remote cloud server is used. But in our method private cloud server is used as a middleware which serves the device if the cloudlet fails. As a result the delay and power consumption reduce.

Fig. 2
figure 2

Delay in proposed multilevel full offloading strategy and existing approaches [6,7,8]

Fig. 3
figure 3

Power consumption of mobile device in proposed multilevel full offloading strategy and existing approaches [6,7,8]

3.4.2 Experimental Analysis

The experimental results are obtained using the cloudlet, private cloud server and public cloud server. The experimental setup used for analyzing the performance of our approach is presented in Fig. 4.

Fig. 4
figure 4

Experimental environment used in the performance evaluation of proposed schemes

In the MCC laboratory of West Bengal University of Technology (WBUT) we have our own private cloud servers in the experiment. The configurations of the mobile devices, cloudlets and private cloud servers used in the experiment are presented in Table 3. According to the proposed method, a mobile device delegates its task to its nearest cloudlet. If the cloudlet fails, then private cloud server is used for offloading. If the private cloud server is also unable to do the same, then public cloud server is asked for offloading. In the existing approaches if the cloudlet fails to offload, then public cloud server is used. This enhances the delay which degrades the QoE. Using private cloud server as a middleware, this delay has been reduced in the proposed scheme. Table 4 shows the power and delay consumed in delegating three types of tasks using our proposed strategy. In the experiment the code of Tower of Hanoi is executed inside cloudlet 1. Cloudlet 1 is unable to execute the code of chess game, hence it executed inside the private cloud server. For audio data offloading public cloud server is used as both of the cloudlet 1 and private cloud server are unable to do this task. The delay and power consumed in each of the considered cases are shown in Table 4.

Table 3 Configurations of devices used in experiment
Table 4 Power consumption and delay in proposed multilevel full offloading strategy

4 Proposed Multilevel Partial Offloading Strategy

In the previous section it is observed that the task is either entirely offloaded or executed inside the mobile device. However, it may also possible that the task cannot be executable by the mobile device as a whole but a segment of the task is executable by the mobile device. In this section a partial offloading method is proposed. In the proposed method, if the requested task is not fully executable inside the mobile device, then it is segmented. Each task is composed of a number of jobs. Based on the delay and power consumption, the task is segmented into two parts: Sl and Sr. Each of the segments will contain a number of jobs. Sl will contain the jobs to be locally executed and Sr will contain the jobs to be offloaded. Now which segment will be locally executed and which one will be offloaded is decided based on the power consumption and delay. If the local execution of a job Jk consumes more power and delay than its offloading to the nearby cloudlet, then the job is put into the segment Sr. Otherwise the job is put into the segment Sl. The power consumption and delay in local execution of Sl are less than that of its offloading, and the power consumption and delay in local execution of Sr are more than that of its offloading. The parameters used in power and delay calculation are defined in Table 1 of Sect. 3.

The latency in executing Il instructions inside the mobile device is computed as [6],

$$D_{locl} = (I_{l} /S_{m} )$$
(39)

where Il is the number of instructions equal to the sum of the number of instructions for executing the jobs in Sl and the number of instruction for performing task segmentation procedure. Thus we are considering the overhead in task segmentation performed in partial offloading.

The power consumption of mobile device while executing Il instructions locally is computed as [6],

$$P_{locl} = P_{mob} \cdot D_{locl}$$
(40)

The latency in executing Il instructions inside the cloudlet considering the data sending and receiving, and propagation, is computed as [6],

$$D_{reml} = (I_{l} /S_{cl} ) + (D_{senp} /R_{mcl} ) + (D_{recp} /R_{clm} )$$
(41)

where the instruction execution delay is \((I_{l} /S_{cl} )\), data sending delay is \((D_{senp} /R_{mcl} )\) and data receiving delay is \((D_{recp} /R_{clm} )\).

The power consumption of mobile device while offloading Sl to the cloudlet, is computed as [6],

$$P_{reml} = P_{idle} \cdot (I_{l} /S_{cl} ) + P_{sen} \cdot (D_{senp} /R_{mcl} ) + P_{rec} \cdot (D_{recp} /R_{clm} )$$
(42)

The latency in executing Ir instructions locally inside the mobile device is computed as [6],

$$D_{locr} = (I_{r} /S_{m} )$$
(43)

where Ir is the number of instructions equal to the sum of the number of instructions for executing the jobs in Sr and the number of instruction for performing task segmentation procedure. Thus we are considering the overhead in task segmentation performed in partial offloading.

The power consumption of mobile device while executing Ir instructions locally is computed as [6],

$$P_{locr} = P_{mob} \cdot (I_{r} /S_{m} )$$
(44)

The latency in executing Ir instructions remotely inside the cloudlet considering the data sending and receiving, and propagation is computed as [6],

$$D_{remr} = (I_{r} /S_{cl} ) + (D_{senp} /R_{mcl} ) + (D_{recp} /R_{clm} )$$
(45)

The power consumption in executing Ir instructions remotely inside the cloudlet considering the data sending and receiving, and propagation, is computed as [6],

$$P_{remr} = P_{idle} \cdot (I_{r} /S_{cl} ) + P_{sen} \cdot (D_{senp} /R_{mcl} ) + P_{rec} \cdot (D_{recp} /R_{clm} )$$
(46)

The condition of partitioning is that,

$$P_{locl} < P_{reml}$$
(47)
$$D_{locl} < D_{reml}$$
(48)
$$P_{locr} > P_{remr}$$
(49)
$$D_{locr} > D_{remr}$$
(50)

The segment Sl is executed inside the mobile device. The mobile device requests the nearest cloudlet to execute the segment Sr. If the cloudlet is able, it executes the jobs in that segment. But if the cloudlet is unable to execute all the jobs in that segment, it forwards the segment to the private cloud. But if the cloudlet fails to execute some of the jobs based on its infrastructure, present load and deadline, then the cloudlet forwards these jobs to the private cloud. In this case the cloudlet partially offloads the segment. One sub-segment is executed inside the cloudlet and the other is offloaded to the private cloud. If the private cloud is unable to execute all the jobs, then public cloud is asked for offloading. Otherwise if the private cloud fails to execute some of the jobs based on its infrastructure, present load and deadline, then these jobs are forwarded to the public cloud.

4.1 Proposed Multilevel Partial Offloading Algorithm

The proposed multilevel partial offloading strategy is shown in Fig. 5 and the algorithm is stated in Table 5. Figure 5 describes multilevel partial offloading strategy where the task is divided into two segments. Segment 1 is executed inside the mobile device. Mobile device asks nearest cloudlet for executing segment 2. If the cloudlet is able it executes segment 2 and produces the result. Otherwise if the cloudlet is partially able to execute the segment, this segment is subdivided into two parts. One part is executed inside the cloudlet and the private cloud is asked for executing another part. If the private cloud is able, then it executes the part and sends back the result to the cloudlet. Else if the private cloud is partially able, the part is again divided into two subparts. One subpart is executed inside the private the cloud, and another subpart is offloaded to the public cloud. After execution, public cloud sends back the result to the private cloud. The private cloud integrates the result with the result of execution of the other subpart, and forwards it to the cloudlet. Else if the private cloud is unable, it offloads the part to the public cloud. The public cloud after execution sends the result to the private cloud that forwards it to the cloudlet. The cloudlet then integrates the received result with the result of execution of the other part to produce the result of execution of segment 2. If the cloudlet is completely unable to execute segment 2, asks private cloud for executing segment 2. If the private cloud is able, it executes segment 2 and sends back the result to the cloudlet. Else if the private cloud is partially able, the segment is divided into two parts. One part is executed inside the private cloud and another part is offloaded to the public cloud. After execution, the public cloud sends back the result to the private cloud that forwards it to the cloudlet after integrating with the result of execution of the other part, to produce the result of execution of segment 2. Else if the private cloud is unable to execute segment 2, it offloads the segment to the public cloud. The public cloud after executing the segment sends back the result to the private cloud which forwards it to the cloudlet. The cloudlet sends the result of execution of segment 2 to the mobile device. The mobile device integrates the result with the result of execution of segment 1, i.e. the mobile device integrates the results of remote and local execution to produce the final result.

Fig. 5
figure 5

Multilevel partial offloading using proposed strategy

Table 5 Proposed multilevel partial offloading algorithm

4.2 Delay in Partial Offloading

Let the code to be executed has I number of instructions (including the instructions executed for task segmentation). The code is partially executable by the mobile device. Let the device can execute Il number of instructions. Hence (I-Il) number of instruction is to be executed by the cloudlet, private cloud server or public cloud server.

Case 1: Task execution in mobile device and cloudlet

In this case, one segment of the task is executed inside the mobile device and the other segment is offloaded to the cloudlet. Hence, the delay for sending and receiving data in case 1 is given by [6],

$$D_{sr1} = (D_{senp} /R_{mcl} ) + (D_{recp} /R_{clm} )$$
(51)

If the cloudlet and mobile device execute the code, the delay during the queuing and execution is given as [6],

$$D_{ex1p} = (I_{l} /S_{m} ) + q_{cl} + ((I - I_{l} )/S_{cl} )$$
(52)

Thus the total delay is given as,

$$D_{csp1} = D_{pcl} + D_{ex1p} + D_{sr1}$$
(53)

where \(D_{pcl} = (Di_{cl} /S_{p} )\).

Case 2: Task execution in mobile device, cloudlet and private cloud

In this case, the task is divided into three segments: one segment is executed inside the mobile device, one segment is executed inside the cloudlet and one segment is executed inside the private cloud. Hence, the delay for sending and receiving data in case 2 is given by [6, 11],

$$\begin{aligned} D_{sr2} & = (D_{senp1} /R_{mcl} ) + (D_{senp2} /R_{clpr} ) \\ & \quad + (D_{recp2} /R_{prcl} ) + (D_{recp1} /R_{clm} ) \\ \end{aligned}$$
(54)

where Dsenp1 and Dsenp2 are the amount of data transmission from mobile device to cloudlet, and from cloudlet to private cloud server respectively, and Drecp1 and Drecp2 are the amount of data reception by mobile device from cloudlet, and by cloudlet from private cloud server respectively.

If the private cloud server, cloudlet and mobile device executes the code, the delay during the queuing and execution is given as [6, 11],

$$D_{ex2p} = (I_{l} /S_{m} ) + q_{cl} + q_{pr} + (I_{cl} /S_{cl} ) + (I_{pr} /S_{pr} )$$
(55)

where Icl and Ipr number of instructions are executed inside the cloudlet and private cloud server respectively.

Thus the total delay is given as [6, 11],

$$D_{csp2} = D_{pcl} + D_{ppr} + D_{sr2} + D_{ex2p}$$
(56)

where \(D_{ppr} = [(Di_{cl} /S_{p} ) + (Di_{pr} /S_{p} )]\).

Case 3: Task execution in mobile device, cloudlet, private cloud and public cloud

In this case, the task is divided into four segments: one segment is executed inside the mobile device, one segment is executed inside the cloudlet, one segment is executed inside the private cloud and one segment is executed inside the public cloud. Hence, the delay for sending and receiving data in case 3 is given by [6, 11],

$$D_{sr3} = (D_{senp1} /R_{mcl} ) + (D_{senp2} /R_{clpr} ) + (D_{senp3} /R_{prpu} ) + (D_{recp3} /R_{pupr} ) + (D_{recp2} /R_{prcl} ) + (D_{recp1} /R_{clm} )$$
(57)

where Dsenp3 and Drecp3 are the amount of data transmission and reception between private and public cloud server respectively.

If the public cloud server, private cloud server, cloudlet and mobile device executes the code, the delay during the queuing and execution is given as [6, 11],

$$D_{ex3p} = (I_{l} /S_{m} ) + q_{cl} + q_{pr} + q_{pu} + (I_{cl} /S_{cl} ) + (I_{pr} /S_{pr} ) + (I_{pu} /S_{pu} )$$
(58)

where Icl, Ipr and Ipu number of instructions are executed inside the cloudlet, private cloud server and public cloud server respectively.

Thus the total delay is given as,

$$D_{csp3} = D_{pcl} + D_{ppr} + D_{ppu} + D_{sr3} + D_{ex3p}$$
(59)

where \(D_{ppu} = [(Di_{cl} /S_{p} ) + (Di_{pr} /S_{p} ) + (Di_{pu} /S_{p} )]\).

Now a situation may occur where (I − I1) numbers of instructions are executed inside the cloudlet and public cloud server. Then the value of Ipr and qpr will be 0. If (I − I1) numbers of instructions are executed inside the private and public cloud server, then the value of Icl and qcl will be 0.

Delay Considering Three Cases

If the probability of occurrence of case 1, case 2 and case 3 are p1, p2 and p3 respectively, the delay is given as,

$$D_{csp} = p_{1} \cdot D_{csp1} + p_{2} \cdot D_{csp2} + p_{3} \cdot D_{csp3}$$
(60)

4.3 Power Consumption in Partial Offloading

Let the code to be executed has I number of instructions (including the instructions executed for task segmentation). The code is partially executable by the mobile device. Let the device can execute Il number of instructions. Hence (I − Il) number of instructions are to be executed by the cloudlet, private cloud server or public cloud server.

Case 1: Task execution in mobile device and cloudlet

The power consumption of the mobile device during data sending and receiving period is given by [6],

$$P_{sr1} = P_{sen} \cdot (D_{senp} /R_{mcl} ) + P_{rec} \cdot (D_{recp} /R_{clm} )$$
(61)

If the cloudlet and mobile device executes the code, the power consumption of the mobile device during the queuing and execution period is given as [6],

$$P_{ex1p} = P_{mob} \cdot (I_{l} /S_{m} ) + P_{idle} \cdot [q_{cl} + ((I - I_{l} )/S_{cl} )]$$
(62)

Thus the power consumption of the mobile device in case 1 is given as,

$$P_{csp1} = P_{pcl} + P_{sr1} + P_{ex1p}$$
(63)

where \(P_{pcl} = P_{idle} \cdot D_{pcl}\) and \(D_{pcl} = (Di_{cl} /S_{p} )\).

Case 2: Task execution in mobile device, cloudlet and private cloud server

The power consumption of the mobile device during data sending and receiving period is given by [6, 11],

$$P_{sr2} = P_{sen} \cdot (D_{senp1} /R_{mcl} ) + P_{idle} \cdot (D_{senp2} /R_{clpr} ) + P_{idle} \cdot (D_{recp2} /R_{prcl} ) + P_{rec} \cdot (D_{recp1} /R_{clm} )$$
(64)

If the private cloud server, cloudlet and mobile device executes the code, the power consumption of the mobile device during the queuing and execution period is given as [6, 11],

$$P_{ex2p} = P_{mob} \cdot (I_{l} /S_{m} ) + P_{idle} \cdot [q_{cl} + q_{pr} + (I_{cl} /S_{cl} ) + (I_{pr} /S_{pr} )]$$
(65)

where Icl and Ipr number of instructions are executed inside the cloudlet and private cloud server respectively.

Thus the power consumption of the mobile device in case 2 is given as,

$$P_{csp2} = P_{pcl} + P_{ppr} + P_{sr2} + P_{ex2p}$$
(66)

where \(P_{ppr} = P_{idle} \cdot D_{ppr}\) and \(D_{ppr} = [(Di_{cl} /S_{p} ) + (Di_{pr} /S_{p} )]\).

Case 3: Task execution in mobile device, cloudlet, private cloud and public cloud server

The power consumption of the mobile device during data sending and receiving period is given by [6, 11],

$$\begin{aligned} P_{sr3} & = P_{sen} \cdot (D_{senp1} /R_{mcl} ) + P_{idle} \cdot (D_{senp2} /R_{clpr} ) + P_{idle} \cdot (D_{senp3} /R_{prpu} ) + P_{idle} \cdot (D_{recp3} /R_{pupr} ) \\ & \quad + P_{idle} \cdot (D_{recp2} /R_{prcl} ) + P_{rec} \cdot (D_{recp1} /R_{clm} ) \\ \end{aligned}$$
(67)

If the public cloud server, private cloud server, cloudlet and mobile device executes the code, the power consumption by the mobile device during the queuing and execution period is given as [6, 11],

$$P_{ex3p} = P_{mob} \cdot (I_{l} /S_{m} ) + P_{idle} \cdot [q_{cl} + q_{pr} + q_{pu} + (I_{cl} /S_{cl} ) + (I_{pr} /S_{pr} ) + (I_{pu} /S_{pu} )]$$
(68)

where Icl, Ipr and Ipu number of instructions are executed inside the cloudlet, private cloud server and public cloud server respectively.

Thus the power consumption of the mobile device in case 3 is given as,

$$P_{csp3} = P_{pcl} + P_{ppr} + P_{ppu} + P_{sr3} + P_{ex3p}$$
(69)

where \(P_{ppu} = P_{idle} \cdot D_{ppu}\) and \(D_{ppu} = [(Di_{cl} /S_{p} ) + (Di_{pr} /S_{p} ) + (Di_{pu} /S_{p} )]\).

Now a situation may occur where the (I-Il) numbers of instructions are executed inside the cloudlet and public cloud server. Then the value of Ipr and qpr will be 0. If the (I-Il) numbers of instructions are executed inside the private and public cloud server, then the value of Icl and qcl will be 0.

Power Consumption Considering Three Cases

If the probability of occurrence of case 1, case 2 and case 3 are p1, p2 and p3 respectively, the power consumption of the mobile device is given as,

$$P_{csp} = p_{1} \cdot P_{csp1} + p_{2} \cdot P_{csp2} + p_{3} \cdot P_{csp3}$$
(70)

4.4 Performance Analysis

In this section we have performed the theoretical and experimental analysis to evaluate the performance of the proposed scheme.

4.4.1 Theoretical Analysis

Figures 6 and 7 illustrate the delay and power consumption in the proposed strategy and the existing strategy where only cloud servers are used for offloading purpose. Figure 6 shows that the proposed multilevel partial offloading scheme reduces the delay up to 8% approximately than partial offloading to cloud server [11]. It is observed from Fig. 7 that the proposed multilevel partial offloading scheme reduces the power consumption by approximately 20% than partial offloading to cloud server [11]. Hence the proposed scheme offers green and high speed offloading to the users. In [11] only private and public cloud servers have been used, but in our method cloudlet is also involved. As the distance between the cloudlet and the mobile device is much lesser than that of the mobile device and cloud server, the delay and power consumption both are reduced.

Fig. 6
figure 6

Delay in proposed multilevel partial offloading strategy and existing approach [11]

Fig. 7
figure 7

Power consumption of the mobile device in proposed multilevel partial offloading strategy and existing approach [11]

4.4.2 Experimental Analysis

The performance of the proposed multilevel partial offloading strategy is analyzed through the experimental results obtained using the cloudlet, private cloud server and public cloud server. The configurations of the cloudlet and private cloud servers used in the experiment are given in Table 3 of Sect. 3. In the proposed method, if the requested task is not fully executable inside the mobile device, then it is segmented. One segment of task is executed inside the mobile device and the other segment is offloaded to the nearest cloudlet. If the cloudlet fails, then private cloud server is used for offloading the segment. Otherwise if the cloudlet can partially offload the segment, it is again divided. One sub-segment is executed inside the cloudlet and the other is offloaded to the private cloud server.

If the private cloud server is also unable to do the same, then public cloud server is asked for offloading. In the existing approaches if the cloudlet fails to offload, then public cloud server is used which increases delay. In the proposed approach as private cloud server is used, this delay can be reduced. Table 6 shows the power and latency consumed in two types of tasks considered in our experiment while using the proposed strategy. Table 6 shows that mobile phone 1 has to partially offload the code of binary search. Now binary search is applicable only on sorted array. To find an element using binary search, first the list of element i.e. the array has to be sorted. So the code of binary search is divided into two segments. The first segment contains the code for sorting the array. The second segment contains the code for searching element in that sorted array. Hence this code is partially offloaded.

Table 6 Power consumption and delay in proposed multilevel partial offloading strategy

The sorting process is offloaded to cloudlet 1 which is the nearest cloudlet of mobile phone 1. After that the sorted array is returned and the searching process is executed inside the mobile phone 1. Hence segment 2 is executed in cloudlet 1 and segment 1 is executed in mobile phone 1. The time consumption in case of sorting is 12.07 s. The time consumption in searching is 9.51 s. The total time consumption is 21.58 s and power consumption of the mobile device during that period is 2.374 W. Mobile phone 2 asks for offloading the code of matrix inversion which requires the determinant, co-factors and transpose of the matrix. This code is partially executable into the mobile phone 2. Hence the code is segmented into four parts. Segment 2 contains the code of calculating determinant, segment 3 contains the code of calculating co-factors, segment 4 contains the code of calculating transpose and segment 1 contains the code of calculating inverse. Cloudlet 1 is able to execute segment 2 and unable to execute segment 3 and 4. Private cloud server 1 is able to execute segment 3 but unable to execute segment 4. Therefore segment 4 is offloaded to the public cloud server. After finding the determinant, co-factors and transpose, segment 1 is executed locally within the mobile phone 2. Total time consumption in executing the total task is 19.432 s and power consumption is 2.138 W.

In case of partial offloading, the calculation of delay and power consumption has considered the overhead of the task segmentation procedure. However, in experiment the jobs are getting sliced and forwarded to the cloudlet/cloud server for processing with very small size of code. Here we are not fetching the data for processing but sending the small piece of code. For sending the file of small size the bandwidth requirement is very less and the forwarding time is also very less. As a result the proposed approach has lower time and power consumption in offloading.

4.5 Comparison of Proposed Strategy with Existing Works

The power consumption and delay of our proposed approach are compared with the existing offloading strategies [6,7,8, 11]. Table 7 shows that in [6,7,8] cloudlet and public cloud are used and in [11] private and public cloud servers are used for offloading. But in our approach we have used cloudlet, private cloud server and public cloud server. If the cloudlet fails, private cloud can serve the user. Use of cloudlet, private as well as public cloud reduces and delay and power consumption both than the existing schemes [6,7,8, 11]. This is the novelty and advantage of the proposed methods with respect to the existing approaches as illustrated in Table 7.

Table 7 Novelty of the proposed strategy in respect of the existing works [6,7,8, 11]

5 Conclusion

Power and delay efficient offloading is an important area of research. Multilevel full and partial offloading approach is proposed in this paper where cloudlet, private cloud server and public cloud server are used. A mobile device first requests its nearest cloudlet for offloading a task. If it cannot execute the task, then the private cloud server performs the task. Even if the private cloud server is unable to provide the service, then the public cloud server is used. Two-level offloading to cloudlet, three-level offloading to private cloud server and four-level offloading to public cloud server are performed in the proposed work. Use of private cloud server lessens the chances of offloading to the public cloud server located distantly. This decreases the delay and power consumption. In the proposed partial offloading method a task is divided into two segments. One segment is accomplished inside the mobile device and the other is partially or fully offloaded to the nearest cloudlet or private cloud server or public cloud server. Experimental analyses of the proposed two strategies are performed. Simulation results show that the proposed multilevel full and partial offloading strategies diminish the power consumption by approximately 8–9% and 20% respectively than the existing methods. From the comparative analysis we can conclude that the proposed strategies are suitable for the applications seeking power and delay efficiency.