CloneCloud: Mobile Computing meets the Cloud


cloud

By Jad Oueis

jad.oueis@insa-lyon.fr



"The average person checks his phone 110 times a DAY"
Well, if this number indicates something, it’s how much we’ve become dependent on our beloved smartphones to survive through a day. The reason? Mobile Applications, obviously. Whether you’re an “iCustomer”, an “Androider” or an ever-loyal Windows fan, various services are being easily provided to you by your corresponding app store: from the most interesting and useful, to the most silly and time-wasting. In fact, the past few years witnessed an explosive growth of mobile applications that’s not going to stop anytime soon. Mobile computing largely developed in a relatively short time, and is still developing by the hour after becoming one of the most trending topics in the IT world, and also one of the most lucrative businesses. However, all of the computation your smartphone is struggling to achieve is crazily draining the battery, overwhelming the bandwidth and consuming what’s left from the poor storage space. No matter how smart it may seem, your phone is still after all a device with limited resources.
On the other hand, the tech world also witnessed in the past few years the rise of the so-called Cloud. Cloud computing revolves mainly around the concept that a user has access to computing resources on-demand and without the need for their physical presence at his location. A service provider, like Google or Amazon, provides servers, storages, operating systems, applications and much more for the user to access via internet, at a low cost. Seeing its many benefits, Cloud Computing quickly became a very attractive option.

What now? Merge the two concepts, you get Mobile Cloud Computing!
Integration of Cloud Computing into the mobile environment seemed to be an obvious solution to the many mobile computation bottlenecks. The Cloud is a place of plentiful resources that can ensure huge computations quickly and accurately, without exhausting the limited mobile phone resources from energy to processing capability. The main idea is to benefit from the many services provided by the cloud, and enhance the performance of the mobile applications, by offloading the computation workload to the Cloud. Many Mobile Cloud Computing technologies emerged in the past few years. One of them is CloneCloud, a technology from Intel Research, developped by Byung-Gon Chun and Petros Maniatishave.



What is CloneCloud?

CloneCloud consists of off-loading some tasks from your mobile to the cloud, where they will be executed in a cloned image of the system of your device.
A "copy" of your smartphone is first made in the cloud-computing world on distant server(s). Processes will be sent via your high speed smartphone connectivity (Wifi, 3G, 4G) to the distant servers to be executed there instead of local execution on the phone. The results will be reintegrated to the smartphone upon completion in a fraction of the time. This concept transforms a single-machine execution to a distributed execution.



ditributed

What are the Advantages?



CloneCloud Features

Clonecloud functions can be classified into five features:

  1. Primary
    A Client/Server service. The Client sends parts of the application to be executed by the server that sends back the results once finished. The connection takes place between the OS of the mobile and of the Cloud. The mobile has a Controller and a Replicator component. The server has an Augmenter and a Replicator component. The Replicator exists to keep the synchronization between the mobile and the cloud. The Controller at the mobile device starts the change process and updates the results when sent to the device. The Augmenter at the server is responsible of returning the results to the device.

  2. Background
    The clone on the server can be running background processes like virus scanning and indexing files for example, even when the mobile is offline. Once the device connects again to the server, there’s synchronization between the two.

  3. Mainline
    The mainline processes are in between outsourcing and background functionalities. The user can decide to execute a certain application in a “wrapped” fashion, where he can change how the process should be run but not what it does. Mainline examples include debugging and leak detection of private-data.

  4. Hardware
    The smartphone using Clone Clouds have hardware limitations like limited memory space. The hardware at the servers compensate for this shortness and provides more execution capability like unlimited storage space through the cloud. The hardware can be as simple as nearby desktops or laptops, or servers provided by the telecommunications company.

  5. Multiplicity
    CloneClouds allows for several clones of the smartphone to be copied onto the servers. The system image’s multiple copies are executed in different ways. This allows several different processes to run simultaneously.

ditributed

How does the Partitioning happen?

The partitioning in CloneCloud has to choose which parts of the execution to run on the mobile device, and which ones should be sent to the cloud. The partitioning of the service between client and server portions is not done statically in the design phase. In CloneCloud, the programmer has no role at all in the application partitioning. Instead, CloneCloud tries to automatically find the right spots in the application where the execution has to can be partitioned and sent to the cloud.
For this, a partitioning mechanism is applied. The output of this mechanism is a partition, meaning an indication of the execution points where the application has to transfer part of its execution and state to the clone. Depending on the expected workload and the execution conditions (like CPU speed, and energy consumption), the partitioning decision could result in having different amounts of the original application planned to be executed at the cloud. The partitioning mechanism also tries to obtain the partitions that are optimal regarding execution time and energy consumption. Therefore, it is run several times with different conditions at each run. All the yielded partitions are stored in one database. At run time, the execution picks one partition from the stored ones, and sends it to the Cloud.
Technically speaking, the partitioning framework has three components: static analyzer, dynamic profiler and optimization solver. The static analyzer performs static analysis in order to find the constraints. The dynamic profiler tries to build the cost model for execution and migration under different partitions. This cost model is the result of profiling the executable on the mobile device as well as on the cloud clone. Finally, the optimizer uses the constraints determined by the static analyzer and the cost models of the profiler, in order to derive the best partition.

For more details on each step of the partitioning mechanisms, Check this article from Intel Research.



How does all of that take place?

  1. The user launches the partitioned application
  2. Current execution conditions like the availability of the cloud resources and the connection link with the cloud characteristics are looked up in the database of the pre-computed partitions
  3. A partition configuration file is chosen from the database
  4. Migration and Re-integration Points are added to the chosen methods (for synchronization)
  5. When the process execution on the mobile device reaches the indicated Migration Point:
    1. the executing thread is suspended
    2. the current state of the thread is packaged and sent to the synchronized clone
  6. On the clone, a new thread is started having the same state as the sent thread (same stack, same heap objects)
  7. When the execution on this thread reaches the Re-integration point:
    1. the executing thread is suspended
    2. the current state of the thread is packaged and sent back to the synchronized mobile device
  8. The returned thread is merged into the state of the original process
  9. Thread execution resumes

Note that CloneCloud migration operates using threads. This means a multi-threaded process can still work. Consider that two threads of the same process are running on the mobile device and then one of them is offloaded to the cloud at a certain point. The other thread can proceed with the processing. However, if it also reaches a migration point, it will block until the other thread comes back. For instance, while the worker thread of an application is offloaded to the cloud, the user interface thread of this application can still be running and interacting with the user. There’s no disruption in the processing.



Migration Overview

There are 3 components that effectively assure the migration process:

ditributed



And the Results?

A CloneCloud prototype was created and tested. The prototype runs on Google’s Android mobile with the clones executing on a Dell desktop running Ubuntu. Many applications were used for testing like image search, virus scanner, and privacy-preserving targeted advertising which are all processor, memory and power consuming tasks. The applications were executed on a phone (alone), and with the CloneCloud implementations: one with WiFi connectivity and one with 3G. In general, CloneCloud with Wifi connection gave the best results. In the following, the first figure represents the results obtained for an image search application with different number of images in each case, and the second shows the results obtained for virus scanning. The plots show mean execution times (1st row) & mean phone energy consumption (2nd row) caused by the apps. Each graph shows three different cases: Phone, CloneCloud with WiFi (CC-WiFi), and CloneCloud with 3G (CC-3G).
I’ll let the graphs speak for themselves about the obvious benefits of CloneCloud and the obvious gain made in processing speed and energy consumption.

ditributed Results from image search app

ditributed Results from virus scanning app



However...

So CloneCloud seems to be the perfect solution for your smartphone after all... But is it really?
Even though prototypes proved the efficiency of implementing CloneCloud to extend the battery lifetime and achieve faster processing, CloneCloud is not perfect (yet). Many flaws could further cause limitations to this promising technology.

Is it really secure? This question is legitimate here like in all the cloud-based services. Security vulnerabilities could arise in CloneCloud seeing that all of the user’s private data could be cloned into a public server. Using private cloud systems is an option. Moreover, Authentication has to be considered: Immunity against IP spoofing, ARP poisoning, DNS poisoning is a must when exchanging data. On the other hand, Data tampering, Data loss and Data theft are also serious concerns. CloneCloud must prove it is a trust-worthy technology or it is doomed.

Furthermore CloneCloud is highly dependent on the network reliability. Coupling between the mobile and the cloud is done via the internet connection. Network latency and bandwidth limitations are the deciding factors when it comes to suitable tasks for CloneCloud. It is mainly the phone's connection speed that determines what CloneCloud can and cannot achieve. So if you don't have the perfect internet connection, CloneCloud is not for you.
Moreover, this connection must be very reliable in order to assure a flawless information exchange. Hence, mobility can be harmful. If the user is mobile, the connection speed varies when moving through different coverage zones. In the worst case scenario, the connection is cut-off. If this happens, it would lead to severe data losses. If you think about it, it is somehow ironic how mobility could lead to performance degradation, seeing that this method was in the first place implemented for "mobile" devices, we use when we're "mobile"...

From a technical point of view, limitations in CloneCloud reside in the fact that methods that require access to special features in the mobile device like the camera or GPS cannot be offloaded. Well, how many applications not using GPS or camera can you name?
Finally, the (previously mentioned) idea that processing can get blocked if some thread is offloaded is also one of the limitations. In fact as long as the state on the mobile device remains unchanged, and the running thread does not attempt to change it, the thread can run at peace while the other is at the clone. Otherwise, it has to block. There is no full concurrency between the mobile device and clones.
All of these reflections prove that CloneCloud still has many margins for improvement and development while it is still in its prototype phase. Security, latency, connectivity range and Data transfer cost are all important setbacks for this technology to handle in order to prove its efficiency.
One might wonder, what if the battery life, the processing capability and the never-ending relationship between them were dramatically enhanced in smartphones before CloneCloud is fully developed?



Finally

With an up to 20 times speedup and 20 times energy reduction for simple applications, and without intervention from the programmer, CloneCloud proves to be a promising, effective technology. It opens up further research opportunities and paves the way for practical deployments on large scales.
Eventually, it seems that our smartphones and their power-hungry applications can finally satisfy their urgent needs from the power of Cloud Computing, the technology that took the world by storm.







This blogpost and all the Figures are referenced by the following articles:

- Chun, Byung-Gon, et al. "Clonecloud: elastic execution between mobile device and cloud." Proceedings of the sixth conference on Computer systems. ACM, 2011.
- Chun, Byung-Gon, and Petros Maniatis." Augmented Smartphone Applications Through Clone Cloud Execution." HotOS. Vol. 9. 2009.
- Title Figure from exelanz.com