Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

25/02/2024

CloudSim Simulator

CLOUDSIM

 CloudSim is a framework for modeling and simulation of cloud


computing infrastructures and ser vices.
 Originally built at the Cloud Computing and Distributed
Systems (CLOUDS) Laborator y, The University of Melbourne,
Australia, CloudSim has become one of the most popular open
source cloud simulators in the research and academia.
 CloudSim is completely written in Java.
 The primar y objective of this project is to provide a
generalized and extensible simulation framework that enables
seamless modeling, simulation, and experimentation of
emerging Cloud computing infrastructures and application
ser vices.

1
25/02/2024

MAJOR FUNCTIONALITIES

 General idea of CloudSim functionalities


▪ Support modeling and simulation of large scale Cloud computing data
centers.
▪ Support modeling and simulation of virtualized server hosts, with
customizable policies for provisioning host resources to virtual machines.
▪ Support modeling and simulation of energy -aware computational
resources.
▪ Support modeling and simulation of data center network topologies and
message passing applications.
▪ Support modeling and simulation of federated clouds.
▪ Support dynamic insertion of simulation elements, stop and resume of
simulation.
▪ Support user-defined policies for allocation of hosts to virtual machines
and policies for allocation of host resources to virtual machines.

CLOUDSIM ARCHITECTURE

User code
Simulation
Specification
I I CiCiJd
Scenario I I
User
R~uirements I D I Appficatioo
Confiluration I I
SCheduling
Policy

CloudSim
I I User or Data Center Broker
I I
User I V.nual
Interface
Structures I Cloudlet
I I Machine I I
VM
Services
I I Cloudlet
Execution I I IfM
Manae§!ment I I
Cloud
services II ~rnYi~niog II II CPU
Allocation I I Memory
AIocation
Storage
Allocation II Bandwidh
AIocation II
Cloud
Resources
I I Events
Handing I I
I I Sensor Cloud
Coordinator I I DataCenter
I I
Network
I I NafW: I I ToooI
Message delay
Calculation I I
CloudSlm core simulation engine 4

2
25/02/2024

DESIGN AND IMPLEMENTATION OF


CLOUDSIM

!Ne1v.otkTopologyI
!sANstomgel

ICloudte11

DESIGN OF CLOUDSIM

 The design of the CloudSim can be under stand by CloudSim


Class Structure . Below are the fundamental classes of
CloudSim, which are building blocks of the simulator.

3
25/02/2024

CLOUDSIM CLASSES

 Clo udSim: This is the prime class, with the role of managing entity
event queues and controlling the sequential execution of simulation
events. Ever y event that is generated by the CloudSim entity at run-
time is stored in the queue called future events. These events are
sor ted by their time parameter s and are enqueued into the future
queue. Next, the events that are scheduled at each step of the
simulation are removed from the future events queue and transferred
to the deferred event queue. Following this, an event processing
method is invoked for each entity, which chooses events from the
deferred event queue and per forms appropriate actions. Such an
organization allows flexible management of simulation and provides
the following power ful capabilities:

▪ Deactivation (hold/pause) of entities.


▪ Context switching of entities between different states (e.g. waiting to active).
Pause and resume the process of simulation.
▪ Creation of new entities at run-time.
▪ Aborting and restarting simulation at run -time.

CLOUDSIM CLASSES

 Cloudlet: This class model(define specific attributes such as


length of instruction, input/output filesize, no of processor
required, etc) the Cloud-based application ser vices (program
based tasks) such as content deliver y, social networking, etc.
CloudSim implements the complexity of an application in
terms of its computational requirements. As a developer, we
know that ever y individual executable application/ser vice
workload has a pre-defined instruction length and requires
cer tain network data flow (both pre and post fetches)
overhead that it needs to under take during its life cycle. this
class allows modeling all the above -said requirements

4
25/02/2024

CLOUDSIM CLASSES

 CloudletScheduler: This is responsible for the implementation


of different policies that determine the share of processing
power among Cloudlets in a VM. There are two types of
provisioning policies of fered: space -shared and time-shared

 Datacenter: This class model the core infrastructure-level


ser vices (i.e. hardware) that are offered by Cloud providers
(Amazon, Azure, and App Engine). It encapsulates a set of
hosts(resembling ser ver machine model) instances that can
either be homogeneous or heterogeneous concerning their
hardware configurations (memor y, cores, capacity, and
storage). Also, ever y Datacenter component takes care of
generalized application provisioning that enforces a set of
policies for the allocation of bandwidth, memor y, and storage
devices to hosts and its related VMs.

CLOUDSIM CLASSES

 DatacenterBroker or Cloud Broker: This class model a broker,


which is responsible for mediating negotiations between SaaS
and Cloud providers and such negotiations are driven by QoS
requirements. The broker class acts on behalf of applications.
Its prime role is to quer y the CIS to discover suitable
resources/ser vices and under takes negotiations for the
allocation of resources/ser vices that can fulfill the
application’s QoS needs. This class must be extended for
evaluating and testing custom brokering policies.

10

5
25/02/2024

CLOUDSIM CLASSES

 DatacenterCharacteristics : This class contains configuration


information of data center resources like the available host list,
the fine-grained cost for each resource type, etc.

 Host: This class model a physical resource such as a computer or


storage server. It encapsulates important information such as
the amount of memory and storage, a list and type of processing
cores (if it is a multi-core machine), an allocation of policy for
provisioning the compute, memory and bandwidth to the VMs.

 NetworkTopology: This class contains the information for


inducing network behavior (latencies) in the simulation. It stores
the topology information, which is generated using the BRITE
topology generator.

11

CLOUDSIM CLASSES

 RamProvisioner : This is an abstract class that represents the


provisioning policy for allocating primary memory (RAM) to
Virtual Machines. The execution and deployment of VM on a host
are feasible only if the RamProvisioner component approves that
the host has the required amount of free memory. The
RamProvisionerSimple does not enforce any limitation on the
amount of memory that a VM may request. The RAM resource
request will be rejected if it is beyond the available capacity.

 BwProvisioner: The main role of this component is to undertake


the allocation of network bandwidths to a set of competing VMs
that are deployed across the data center. Cloud system
developers and researchers can extend this class with their
policies (priority, QoS) to reflect the needs of their applications.

12

6
25/02/2024

CLOUDSIM CLASSES

 Vm: This class model a Vir tual Machine (VM), which is


managed and hosted by a Cloud host component. Ever y VM
component has access to a component that stores the
following characteristics related to a VM (i.e.) accessible
memor y, processor, storage size, and the VM’s internal
provisioning policy that is extended from an abstract class
called the CloudletScheduler.

 VmAllocationPolicy: This is an abstract class that represents a


provisioning policy to be utilized by VM Monitor for mapping
VMs to hosts. The primar y role is to select the best fit host in
a data center that meets the memor y, storage, and
availability requirement for VM deployment mapping.

13

CLOUDSIM CLASSES

 VmScheduler: This is an abstract class implemented by a Host


component that models the allocation policies (space -shared,
time-shared) defining the rules for processor cores allocations to
VMs. To accommodate application -specific processor sharing
policies, the class functionality can be extended to define a new
set of provisioning rules.

 FutureQueue: This class implements the future event queue


accessed by CloudSim and acts as a ready queue to the
simulation engine .

 DeferredQueue: This class implements the deferred event queue


used by CloudSim and hold such events which are failed or
paused. It acts as a wait queue of the simulation engine, where
preempted resource requests are kept.

14

7
25/02/2024

CLOUDSIM CLASSES

 SimEntity: This is an abstract class, which represents a


simulation entity (such as DataCenter, DatacenterBroker, etc)
) that is able to send messages to other entities and
processes received messages as well as fire and handle
events. SimEntity class provides the ability to schedule new
events and send messages to other entities, where network
delay is calculated according to the BRITE model. Once
created, entities automatically register with CIS. All entities
must extend this class and override its three core methods:

▪ startEntity(), which define actions for entity initialization.


▪ processEvent(), which defines actions processing of each called
event(s) with respect to the entity.
▪ shutdownEntity(),which define actions for entity destruction.

15

CLOUDSIM CLASSES

 CloudInformationSer vice : A CIS is an entity that provides


resource registration, indexing, and discovering capabilities.
CIS suppor ts two basic primitives:
▪ publish(), on the start of simulation it allows entities to register
themselves with CIS
▪ search(), allows Brokers in discovering resources status and endpoint
addresses of other entities. This entity also acts as a notification
service to the other entities about the end of the simulation.

 CloudSimTags . This class contains various static


event/command tags that indicate the type of action that
needs to be under taken by CloudSim entities when they
receive or send events.

16

8
25/02/2024

CLOUDSIM CLASSES

 SimEvent: This entity represents a simulation event that is


passed between two or more entities. SimEvent stores the
following information about an event:
▪ type,
▪ init time,
▪ time at which the event should occur,
▪ finish time,
▪ time at which the event should be delivered to its destination entity,
▪ IDs of the source and destination entities,
▪ the tag of the event, and
▪ Data that have to be passed to the destination entity.

17

CLOUDSIM
LIFE CYCLE

Stop SimulAtion

18

You might also like