Introduction to Cloud Computing
Cloud computing is a revolutionary technology that has completely transformed the way modern applications are developed and maintained. It provides high scalability and low latency, making it an invaluable tool for software developers.
# What is CloudSim?
CloudSim is an open-source framework that is used to simulate cloud computing infrastructure and services. It is developed by the CLOUDS Lab organization and is written entirely in Java. CloudSim is used for modelling and simulating a cloud computing environment, thus allowing users to evaluate hypotheses prior to software development.
Benefits of Simulation over Actual Deployment
No Capital Investment Necessary
One of the main benefits of using a simulation tool such as CloudSim is that there is no installation or maintenance cost involved. This eliminates the need for a large initial investment or ongoing upkeep costs.
Easy to Use and Scalable
CloudSim is easy to use and can be scaled to meet your needs. It allows you to add or delete resources with just a few lines of code, meaning that you can quickly make changes and adjust according to your requirements.
Evaluate Risks at an Earlier Stage
Simulation also allows you to test your product against test cases and resolve issues before actual deployment without any limitations. This eliminates the need for costly and time consuming try-and-error approaches.
Repeatable and Controlled Environment
Using a simulation tool like CloudSim enables you to test your services in a repeatable and controlled environment free of cost. This helps you to gain a better understanding of how the different components of your service will interact and provides a more precise evaluation of service performance and potential revenue generation.
Why Use CloudSim?
1. Open Source and Cost-Effective
CloudSim is an open source tool that is free of cost, making it a great choice for researchers and developers working in the field. It is easy to download and set-up, and does not require any high-spec computers to work on.
2. Flexible and Extensible
CloudSim is highly flexible and extensible, allowing users to implement their own algorithms and policies to manage resources. It also provides pre-defined allocation policies and utilization models which can be used to reduce risk, lower costs, increase performance, and raise revenue.
3. Documentation and Examples
The documentation for CloudSim provides pre-coded examples for new developers to get familiar with the basic classes and functions. This helps to make the development process more efficient and easier to understand.
Conclusion
CloudSim is an open source tool that is free of cost and easy to download and set-up. It is highly flexible and extensible, allowing users to implement their own algorithms and policies to manage resources. With its pre-defined allocation policies, utilization models, and pre-coded examples, CloudSim is an ideal tool for researchers and developers looking to tackle bottlennecks before deployment.
CloudSim Architecture:

Introduction to CloudSim Core Simulation Engine
The CloudSim Core Simulation Engine is a framework for simulation of cloud computing environments. It provides a powerful set of tools for the management of virtualized datacenters and their resources such as virtual machines (VMs), memory and bandwidth. It also provides the necessary interfaces to the user code layer where developers can write code to define their hardware requirements according to the scenario.
Key Classes Used in CloudSim
The following classes are commonly used in CloudSim simulations:
Datacenter:
This class is used to model the foundational hardware equipment of a cloud environment, such as datacenters. It provides methods to specify the functional requirements of the datacenters, as well as set the allocation policies of VMs and other resources.
Host:
This class is responsible for managing virtual machines, including provisioning memory and bandwidth to the VMs, as well as allocating CPU cores.
VM:
This class represents a virtual machine, providing data members that define its bandwidth, RAM, mips (million instructions per second), and size. It also provides setter and getter methods for these parameters.
Cloudlet:
A cloudlet class represents any task that is run on a VM, such as a processing task, memory access task, or file updating task. It stores parameters that define the characteristics of a task, such as its length, size, and mips, as well as provides methods to define its execution time, status, cost, and history.
DatacenterBroker:
This entity acts on behalf of the user/customer and is responsible for the functioning of VMs, including VM creation, management, destruction, and submission of cloudlets to the VM.
CloudSim:
This class is responsible for initializing and starting the simulation environment after all the necessary cloud entities have been defined, and later stopping after all the entities have been destroyed.
Features of CloudSim:
Large Scale Virtualized Datacenters, Servers and Hosts
CloudSim provides support for simulating and modelling large scale virtualized datacenters, servers and hosts. It enables users to customize policies for provisioning host to virtual machines, as well as to create energy-aware computational resources.
Application Containers and Federated Clouds
CloudSim also supports the joining and management of multiple public clouds, allowing users to create application containers and federated clouds. Additionally, CloudSim provides support for dynamic insertion of simulation entities with the ability to stop and resume simulation.
User-Defined Allocation and Provisioning Policies
CloudSim enables users to define their own allocation and provisioning policies, allowing for greater flexibility and control when creating virtualized environments. Furthermore, CloudSim also supports the simulation of datacenter network topologies and message-passing applications.
Prerequisites:
In order to use CloudSim, you must have basic knowledge of Core Java language features such as OOP and Collections. Additionally, it is helpful to have some understanding of cloud computing concepts.
Installation:
CloudSim is available for download here. For this tutorial, we have downloaded the zip file of CloudSim 3.0.3. Note: CloudSim also uses some utilities of Apache’s commons-math3 library. Download its Binaries zip file
Steps to Setup CloudSim
Follow these steps to setup CloudSim:
Step 1: Extract the Files
First, extract the zip folder containing the CloudSim-3.0.3 files and the commons-math3-3.6.1 jar file into the same folder.

Step 2: Open Eclipse IDE
Next, open Eclipse IDE. Go to File -> New -> Java Project.

Step 3: Select the CloudSim Folder
Enter any name for your project and then uncheck the Use default location box just under it. Click on Browse and select the cloudsim-3.0.3 folder.


Step 4: Add External JARs
Click Next and go to Libraries -> Add External JARs. Now browse to the same folder where you extracted the commons-math3 jar file and open it.


Step 5: Finish Setup
Finally, click on Finish and wait for the project to build. After the project has been built, from the Project Explorer you can click on your project and from the dropdown go-to examples -> org.cloudbus.cloudsim.examples. Here, you can find pre-written sample codes and try to run them.

Simulation using CloudSim has been applied to a variety of research topics, including but not limited to:
Task Scheduling
Task scheduling is an important component of cloud computing that enables efficient utilization of resources and better performance. CloudSim provides an extensible platform for simulating different task scheduling algorithms and studying their performance in various cloud environments. It is used to analyze the impact of different scheduling strategies on the system’s performance and resource utilization.
Green Computing
Green computing is the practice of using energy efficient computing technologies and practices to reduce energy consumption, cost, and environmental impact. CloudSim facilitates research in this area by providing a customizable platform for simulating various green computing strategies. This enables researchers to study the effect of various green computing techniques on the overall performance and energy efficiency of the cloud infrastructure.
Resource Provisioning
Resource provisioning is the process of allocating resources to users or applications in a cloud environment. CloudSim enables researchers to develop and evaluate different resource provisioning strategies in a simulated environment. By simulating different resource allocation scenarios, researchers can determine the optimal utilization of resources and the best ways to achieve the desired performance.
Secure Log Forensics
Secure log forensics is the process of analyzing log data to detect and investigate security incidents. CloudSim can be used to simulate different approaches to secure log forensics and study their effectiveness in different cloud environments. This helps researchers gain insights into the efficacy of different log analysis techniques for detecting security threats and understanding their impact on the system’s performance.