Get to Know Cloud Simulations Using FOSS

0
7316

cloud-servers_0

This article delves into cloud simulations, which is a fast-evolving domain. Virtual machines, hypervisors, data centres and cloud simulation tools like CloudSim and GreenCloud are covered extensively.

You must be aware that in cloud computing, remote resources are used on demand and there is no physical infrastructure at the client end. The actual resources are installed and deployed at remote locations, and are accessed remotely by different network-based protocols. There is a provision for computational resources on-demand, with end users being unaware about the physical location and configuration of the servers.

Virtualisation technology and the cloud
Virtualisation is the major technology that works with cloud computing. Dynamic virtual machines are created to provide end users and developers access to actual infrastructure at another remote location.
A virtual machine or VM is the software implementation of any computing device, machine or computer that executes the programs as a physical (actual) machine. When a user or developer works on a virtual machine, all the resources including programs installed on the remote machine are accessible using a specific set of protocols. For the end user of the cloud service, the virtual machine acts like the actual machine.

The term VM was originally proposed and defined by Popek and Goldberg as “…an efficient, isolated duplicate of a real machine.”
Virtual machines are classified into two groups, depending on their use and degree of correspondence to any real machine:

  • System virtual machine: A system virtual machine provides a complete system platform that supports the execution of a complete operating system (OS). It emulates an existing system architecture and is built for two purposes. The first is to provide a platform to run programs where the real hardware is not available. The second is to have multiple instances of VMs leading to more efficient use of computing resources, in terms of energy consumption and cost effectiveness, or both. This is known as hardware virtualisation, which is the key to a cloud computing environment.
  • Process virtual machine (language virtual machine): This type of VM is designed to execute a single program, which means that it supports a single process. Such VMs are closely suited to one or more programming language and are built to provide program portability and flexibility. An essential characteristic of a VM machine is that the software running inside is limited to the resources and abstractions provided by the VM – it cannot fragment or break out of its virtual environment.

Prominent virtualisation software
Here’s a list of the major Windows- and Linux-based virtualisation software:

Windows as the host OS

  • VMware workstation (Any guest OS)
  • VirtualBox (Any guest OS)
  • Hyper-V (Any guest OS)

Linux as the host OS

  • VMware workstation
  • Microsoft virtual PC
  • VMLite workstation
  • VirtualBox
  • Xen

A hypervisor or virtual machine monitor (VMM) is a piece of computer software, firmware or hardware that creates and runs virtual machines. A computer on which a hypervisor is running one or more VMs is defined as a host machine. Each VM is called a guest machine. The hypervisor presents the guest OSs with a virtual operating platform, and manages the execution of the guest operating systems. Multiple instances of a variety of operating systems may share the virtualised hardware resources.

Hypervisors of Type 1 (bare metal installation) and Type 2 (hosted installation)
When implementing and deploying a cloud service, Type 1 hypervisors are used. These are associated with the concept of bare metal installation. It means there is no need of any host operating system to install the hypervisor. When using this technology, there is no risk of corrupting the host OS. These hypervisors are directly installed on the hardware without the need for any other OS. Multiple VMs are created on this hypervisor.

A Type 1 hypervisor is a type of client hypervisor that interacts directly with hardware that is being virtualised. It is completely independent of the operating system, unlike a Type 2 hypervisor, and boots before the OS. Currently, Type 1 hypervisors are being used by all the major players in the desktop virtualisation space, including but not limited to VMware, Microsoft and Citrix.

The classical virtualisation software or Type 2 hypervisor is always installed on any host OS. If the host OS gets corrupt or crashes for any reason, the virtualisation software or Type 2 hypervisor will also crash and, obviously, all VMs and other resources will be lost. That’s why the hypervisor technology or bare metal installation is very popular in the cloud computing world.

Type 2 (hosted) hypervisors execute within a conventional OS environment. With the hypervisor layer as a distinct second software level, guest OSs run at the third level above the hardware. A Type 2 hypervisor is a type of client hypervisor that sits on top of an OS. Unlike a Type 1 hypervisor, a Type 2 hypervisor relies heavily on the operating system. It cannot boot until the OS is already up and running, and if for any reason the OS crashes, all end users are affected. This is a big drawback of Type 2 hypervisors, as they are only as secure as the OS on which they rely. Also, since Type 2 hypervisors depend on an OS, they are not in full control of the end user’s machine.

Box 1

Table 1
Table 1 : HYpervisors and their cloud service providers

Data centres and uptime tier levels

Just as a virtual machine is mandatory for cloud computing, the data centre is also an essential part of the technology. All the cloud computing infrastructure is located in remote data centres where resources like computer systems and associated components, such as telecommunications and storage systems, reside. Data centres typically include redundant or backup power supplies, redundant data communications connections, environmental controls, air conditioning, fire suppression systems as well as security devices.

The tier level is the rating or evaluation aspect of the data centres. Large data centres are used for industrial scale operations that can use as much electricity as a small town. The standards comprise a four-tiered scale, with Tier 4 being the most robust and full-featured (Table 2).
Table-1

Cloud simulations
Cloud service providers charge users depending upon the space or service provided.
In R&D, it is not always possible to have the actual cloud infrastructure for performing experiments. For any research scholar, academician or scientist, it is not feasible to hire cloud services every time and then execute their algorithms or implementations.

For the purpose of research, development and testing, open source libraries are available, which give the feel of cloud services. Nowadays, in the research market, cloud simulators are widely used by research scholars and practitioners, without the need to pay any amount to a cloud service provider.

Using cloud simulators, researchers can execute their algorithmic approaches on a software-based library and can get the results in different parameters including energy optimisation, security, integrity, confidentiality, bandwidth, power and many others.

Tasks performed by cloud simulators
The following tasks can be performed with the help of cloud simulators:

  • Modelling and simulation of large scale cloud computing data centres
  • Modelling and simulation of virtualised server hosts, with customisable policies for provisioning host resources to VMs
  • Modelling and simulation of energy-aware computational resources
  • Modelling and simulation of data centre network topologies and message-passing applications
  • Modelling and simulation of federated clouds
  • Dynamic insertion of simulation elements, stopping and resuming simulation
  • User-defined policies for allocation of hosts to VMs, and policies for allotting host resources to VMs

Scope and features of cloud simulations
The scope and features of cloud simulations include:

  • Data centres
  • Load balancing
  • Creation and execution of cloudlets
  • Resource provisioning
  • Scheduling of tasks
  • Storage and cost factors
  • Energy optimisation, and many others

Cloud simulation tools and plugins
Cloud simulation tools and plugins include:

  • CloudSim
  • CloudAnalyst
  • GreenCloud
  • iCanCloud
  • MDCSim
  • NetworkCloudSim
  • VirtualCloud
  • CloudMIG Xpress
  • CloudAuction
  • CloudReports
  • RealCloudSim
  • DynamicCloudSim
  • WorkFlowSim

CloudSim
CloudSim is a famous simulator for cloud parameters developed in the CLOUDS Laboratory, at the Computer Science and Software Engineering Department of the University of Melbourne.
The CloudSim library is used for the following operations:

  • Large scale cloud computing at data centres
  • Virtualised server hosts with customisable policies
  • Support for modelling and simulation of large scale cloud computing data centres
  • Support for modelling and simulation of virtualised server hosts, with customisable policies for provisioning host resources to VMs
  • Support for modelling and simulation of energy-aware computational resources
  • Support for modelling and simulation of data centre network topologies and message-passing applications
  • Support for modelling and simulation of federated clouds
  • Support for dynamic insertion of simulation elements, as well as stopping and resuming simulation
  • Support for user-defined policies to allot hosts to VMs, and policies for allotting host resources to VMs
  • User-defined policies for allocation of hosts to virtual machines

The major limitation of CloudSim is the lack of a graphical user interface (GUI). But despite this, CloudSim is still used in universities and the industry for the simulation of cloud-based algorithms.

Downloading, installing and integrating CloudSim
CloudSim is free and open source software available at http://www.cloudbus.org/CloudSim/. It is a code library based on Java. This library can be directly used by integrating with the JDK to compile and execute the code.
For rapid applications development and testing, CloudSim is integrated with Java-based IDEs (Integrated Development Environment) including Eclipse or NetBeans.
Using Eclipse or NetBeans IDE, the CloudSim library can be accessed and the cloud algorithm implemented.
The directory structure of the CloudSim toolkit is given below:
CloudSim/       — CloudSim root directory
docs/               — API documentation
examples/         — Examples
jars/                 — JAR archives
sources/           — Source code
tests/                — Unit tests
CloudSim needs to be unpacked for installation. To uninstall CloudSim, the whole CloudSim directory needs to be removed.
There is no need to compile CloudSim source code. The JAR files with the CloudSim package have been provided to compile and run CloudSim applications:

  • jars/CloudSim-<CloudSimVersion>.jar— contains the CloudSim class files
  • jars/CloudSim-< CloudSimVersion >-sources.jar— contains the CloudSim source code files
  • jars/CloudSim-examples-< CloudSimVersion >.jar-– contains the CloudSim examples class files
  • jars/CloudSim-examples-< CloudSimVersion >-sources.jar— contains the CloudSim examples source code files
1
Figure 1 : Creating a new Java project in Eclipse
2
Figure 2 : Assigning a name to the Java Project

Steps to integrate CloudSim with Eclipse
After installing Eclipse IDE, let’s create a new project and integrate CloudSim into it.
1. Create a new project in Eclipse.
2. This can be done by File->New->Project->Java Project
3. Give a name to your project.
4. Configure the build path for adding the CloudSim library.
5. Search and select the CloudSim JAR files.

3
Figure 3 : Build path for Cloudsim LIbrary
4
Figure 4 : Go to the path of CloudSim library
5
Figure 5 : Select all JAR files of CloudSim for integration
6
Figure 6 : JAR Files of CloudSim visible in the referenced libraries of Eclipse with Java project

In the integration and implementation of Java code and CloudSim, the Java-based methods and packages can be used. In this approach, the Java library is directly associated with CloudSim code.
After executing the code in Eclipse, the following output will be generated, which makes it evident that the integration of the dynamic key exchange is implemented with the CloudSim code:

Starting Cloud Simulation with Dynamic and Hybrid Secured Key
Initialising...
MD5 Hash Digest(in Hex. format):: 6e47ed33cde35ef1cc100a78d3da9c9f
Hybrid Approach (SHA+MD5) Hash Hex format: b0a309c58489d6788262859da2e7da45b6ac20a052b6e606ed1759648e43e40b
Hybrid Approach Based (SHA+MD5) Security Key Transmitted =>
ygcxsbyybpr4¢­ ª¢£?¡®­£
Starting CloudSim version 3.0
CloudDatacentre-1 is starting...
CloudDatacentre-2 is starting...
Broker is starting...
Entities started.
0.0: Broker: Cloud Resource List received with 2 resource(s)
0.0: Broker: Trying to Create VM #0 in CloudDatacentre-1
0.0: Broker: Trying to Create VM #1 in CloudDatacentre-1
[VmScheduler.vmCreate] Allocation of VM #1 to Host #0 failed by MIPS
0.1: Broker: VM #0 has been created in Datacentre #2, Host #0
0.1: Broker: Creation of VM #1 failed in Datacentre #2
0.1: Broker: Trying to Create VM #1 in CloudDatacentre-2
0.2: Broker: VM #1 has been created in Datacentre #3, Host #0
0.2: Broker: Sending cloudlet 0 to VM #0
0.2: Broker: Sending cloudlet 1 to VM #1
0.2: Broker: Sending cloudlet 2 to VM #0
160.2: Broker: Cloudlet 1 received
320.2: Broker: Cloudlet 0 received
320.2: Broker: Cloudlet 2 received
320.2: Broker: All Cloudlets executed. Finishing...
320.2: Broker: Destroying VM #0
320.2: Broker: Destroying VM #1
Broker is shutting down...
Simulation: No more future events
CloudInformationService: Notify all CloudSim entities for shutting down.
CloudDatacentre-1 is shutting down...
CloudDatacentre-2 is shutting down...
Broker is shutting down...
Simulation completed.
Simulation completed.

============================= OUTPUT ================= ========
Cloudlet ID STATUS Data centre ID VM ID Time Start Time Finish Time
==============================================================
1 SUCCESS 3 1 160 0.2 160.2
0 SUCCESS 2 0 320 0.2 320.2
2 SUCCESS 2 0 320 0.2 320.2

Cloud Simulation Finish
Simulation Scenario Finish with Successful Matching of the Keys
Simulation Scenario Execution Time in MillSeconds => 5767
Security Parameter => 30.959372773933122
2014-07-09 16:15:21.19

The CloudAnalyst cloud simulator
CloudAnalyst is another cloud simulator that is completely GUI-based and supports the evaluation of social network tools according to the geographic distribution of users and data centres. Communities of users and data centres supporting the social networks are characterised and based on their location. Parameters such as user experience while using the social network application and the load on the data centre are obtained/logged.

7
Figure 7 : Create a new Java program for integration with CloudSim
8
Figure 8 : Writing the Java code with the import of cloudsim packages
9
Figure 9 : Execution of the Java code integrated with CloudSim

CloudAnalyst is used to model and analyse real world problems through case studies of social networking applications deployed on the cloud.

  • The main features of CloudAnalyst are:
  • User friendly graphical user interface (GUI)
  • Simulation with a high degree of configurability and flexibility
  • Performs different types of experiments with repetitions
  • Connectivity with Java for extensions

The GreenCloud cloud simulator
GreenCloud is also getting famous in the international market as the cloud simulator that can be used for energy-aware cloud computing data centres with the main focus on cloud communications. It provides the features for detailed fine-grained modelling of the energy consumed by the data centre IT equipment like the servers, communication switches and communication links. GreenCloud simulator allows researchers to investigate, observe, interact and measure the cloud’s performance based on multiple parameters. Most of the code of GreenCloud is written in C++. TCL is also included in the library of GreenCloud.

GreenCloud is an extension of the network simulator ns-2 that is widely used for creating and executing network scenarios. It provides the simulation environment that enables energy-aware cloud computing data centres. GreenCloud mainly focuses on the communications within a cloud. Here, all of the processes related to communication are simulated at the packet level.

Previous articleUse GIT for Linux Kernel Development
Next articleWorking with Docker
The author is the managing director of Magma Research and Consultancy Pvt Ltd, Ambala Cantonment, Haryana. He has 16 years experience in teaching, in industry and in research. He is a projects contributor for the Web-based source code repository SourceForge.net. He is associated with various central, state and deemed universities in India as a research guide and consultant. He is also an author and consultant reviewer/member of advisory panels for various journals, magazines and periodicals. The author can be reached at kumargaurav.in@gmail.com.

LEAVE A REPLY

Please enter your comment!
Please enter your name here