How anish1206/cloud2sim works
1. Overall structure
Cloud2Sim is a multi-module Maven repository built around the original CloudSim simulator. The main architectural boundary is:
- modules/cloudsim: the base simulation engine and domain model.
- modules/cloud2sim: Cloud2Sim’s distributed, adaptive, and map-reduce extensions.
- modules/cloudsim-examples: reference simulations and benchmark-style examples.
Supporting folders provide runtime configuration, distribution packaging, and documentation.
2. Core simulation engine
The cloudsim module contains the simulation kernel and simulation entities: CloudSim, SimEntity, events/queues, datacenters, brokers, hosts, VMs, cloudlets, schedulers, provisioners, and utility classes. It also includes richer subdomains for:
- network-aware simulation,
- power-aware simulation,
- workload/distribution models.
Cloud2Sim builds on these classes rather than replacing them.
3. Cloud2Sim runtime layer
The cloud2sim module is where the project’s main architecture lives. It adds orchestration for:
- static local simulation,
- parallel/concurrent execution,
- distributed execution across nodes,
- adaptive scaling,
- fault injection and analysis,
- MapReduce workloads.
This module is the bridge between CloudSim’s in-memory simulation model and distributed cluster runtimes.
4. Execution entry points
The main launchers are organized by mode:
- applications.main.statics.Simulator for single-node runs,
- applications.main.dynamics.ScalableSimulator for master-side adaptive scaling,
- scale.ias.IntelligentAdaptiveScaler for worker nodes,
- mapreduce.hazelcast.HzMapReduceSimulator and mapreduce.infinispan.InfMapReduceSimulator for distributed word-count style jobs,
- infinispan.Initiator and related Hazelcast initiator classes to form clusters.
These classes define the top-level control flow for each runtime mode.
5. Adaptive scaling subsystem
The scaling architecture is split into several cooperating pieces:
- scale.auto and scale.predictive estimate future load,
- scale.health monitors node/cluster health,
- scale.ias coordinates the intelligent adaptive scaling workflow,
- scale.core and scale.adaptive hold shared cluster/scaler abstractions.
The master/worker pattern is explicit: the simulator side decides when to scale, while worker-side scalers join and leave based on cluster needs.
6. Distributed state and concurrency
Cloud2Sim uses a concurrency layer to distribute simulation state and lifecycle operations:
- submitters for VM lists and cloudlet lists,
- runnables that clean up submitted cloudlets and user objects,
- partitioning utilities to manage placement and locality.
This layer is the glue between simulation objects and distributed storage/compute backends.
7. Distributed backends: Hazelcast and Infinispan
The repo supports two cluster technologies:
- Hazelcast under cloud2sim.hazelcast and cloud2sim.mapreduce.hazelcast,
- Infinispan under cloud2sim.infinispan and cloud2sim.mapreduce.infinispan.
These packages contain backend-specific wrappers for cloudlets, VMs, jobs, initiators, and MapReduce implementations. Runtime configuration is driven by the XML files in conf/ and by JGroups config for Infinispan clustering.
8. MapReduce subsystem
MapReduce is a distinct simulation family inside Cloud2Sim, centered on word-count style workloads:
- core job model in mapreduce.core,
- Hazelcast implementation with mapper/combiner/reducer/collator,
- Infinispan implementation with mapper/combiner/reducer/task classes.
Input data comes from conf/mapreduce/load/*.txt, and simulation parameters come from conf/cloud2sim.properties such as input folder, line count, and verbosity. This subsystem is designed to run either locally or across a cluster.
9. Configuration and serialization boundaries
The runtime depends heavily on externalized configuration:
- conf/cloud2sim.properties for simulation/map-reduce parameters,
- conf/hazelcast.xml, conf/infinispan.xml, and JGroups configs for cluster behavior,
- topology.json and topology parser classes for network topology modeling.
Serializer classes convert CloudSim entities such as datacenters, hosts, VMs, cloudlets, and utilization models into XML. That suggests the system supports loading/saving simulation models as structured configuration rather than hardcoding them.
10. Auxiliary subsystems
A few supporting pieces matter to the architecture:
- fault provides failure models and injection,
- search supports indexed lookup over simulation data,
- workload generates synthetic arrivals using Poisson/Weibull-style distributions,
- util provides logging and load generation,
- distribution is used by the base CloudSim layer for stochastic behavior.
These are not the main control paths, but they influence simulation inputs, observability, and fault scenarios.
11. Build and packaging
The repo is packaged as a Maven multi-module project with a top-level setup.sh that builds the project and generates a launch wrapper. distribution/ contains assembly packaging, while documentation/ is mostly paper assets, diagrams, and experiment artifacts. For architecture diagrams, the important runtime boundaries are the simulation engine, the distributed coordination layer, and the backend cluster systems.
12. Primary data flow to capture in a diagram
A good diagram should show:
- a launcher class starting a simulation mode,
- configuration and input files feeding the simulator,
- CloudSim entities forming the simulation model,
- optional distribution through Hazelcast or Infinispan,
- adaptive scaling and worker coordination as a separate control loop,
- MapReduce jobs flowing through mapper/combiner/reducer stages when that mode is used.
The key distinction is between single-node simulation logic and cluster-backed coordination/execution.
Main entry points: Cloud2SimEngine.java Cloud2Sim engine · cloudsim Simulation model · scale Adaptive scaling · CloudSim.java CloudSim kernel
Components 23
Repository
Top-level Maven workspace and supporting assets
- Maven root · Multi-module build and workspace entrypoint
pom.xml - Setup script · Builds the project and prepares launch wrapper
setup.sh - Runtime config · Simulation, cluster, and MapReduce configuration files
conf - Topology model · Network topology definition used by serializers and parsers
topology.json
CloudSim Core
Base simulator engine and built-in simulation domains
- CloudSim kernel · Discrete-event simulator with entities, queues, and event loop
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/core/CloudSim.java - Simulation model · Datacenters, brokers, hosts, VMs, cloudlets, and schedulers
modules/cloudsim/src/main/java/org/cloudbus/cloudsim - Network sim · Topological network and network-aware datacenter support
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/network - Power sim · Energy-aware hosts, policies, and power models
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/power - CloudSim utils · Workload readers, math helpers, and runtime utilities
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/util
Cloud2Sim Extensions
Distributed execution, adaptive scaling, clustering, and auxiliary subsystems
- Cloud2Sim engine · Core bridge between CloudSim state and distributed execution
modules/cloud2sim/src/main/java/pt/inesc_id/gsd/cloud2sim/core/Cloud2SimEngine.java - Static runs · Single-node simulation mode and local control flow
modules/cloud2sim/src/main/java/pt/inesc_id/gsd/cloud2sim/applications/main/statics/Simulator.java - Parallel runs · Concurrent simulation execution path
modules/cloud2sim/src/main/java/pt/inesc_id/gsd/cloud2sim/applications/main/parallel/ParallelSimulator.java - Adaptive runs · Master-side adaptive and scalable simulation entrypoint
modules/cloud2sim/src/main/java/pt/inesc_id/gsd/cloud2sim/applications/main/dynamics/ScalableSimulator.java - Adaptive scaling · Load prediction, health monitoring, and cluster scaling workflow
modules/cloud2sim/src/main/java/pt/inesc_id/gsd/cloud2sim/scale - Concurrency glue · Submitters and cleanup tasks for distributed simulation objects
modules/cloud2sim/src/main/java/pt/inesc_id/gsd/cloud2sim/concurrent - Hazelcast backend · Hazelcast-based distributed simulation and object collection
modules/cloud2sim/src/main/java/pt/inesc_id/gsd/cloud2sim/hazelcast - Infinispan backend · Infinispan-based distributed simulation runtime
modules/cloud2sim/src/main/java/pt/inesc_id/gsd/cloud2sim/infinispan - MapReduce jobs · Word-count style jobs and backend-specific MapReduce implementations
modules/cloud2sim/src/main/java/pt/inesc_id/gsd/cloud2sim/mapreduce - Fault models · Failure injection and failure model definitions
modules/cloud2sim/src/main/java/pt/inesc_id/gsd/cloud2sim/fault - Workload gen · Synthetic arrival distributions and workload generation
modules/cloud2sim/src/main/java/pt/inesc_id/gsd/cloud2sim/workload - Serializers · XML serializers for simulation entities and utilization models
modules/cloud2sim/src/main/java/pt/inesc_id/gsd/cloud2sim/serializer - Topology parser · Loads and models network topology for simulation inputs
modules/cloud2sim/src/main/java/pt/inesc_id/gsd/cloud2sim/topology
Examples
Reference simulations and benchmarks built on CloudSim
- CloudSim examples · Reference and benchmark simulations for CloudSim features
modules/cloudsim-examples/src/main/java/org/cloudbus/cloudsim/examples
Connections 36
- Maven root → CloudSim kernel: builds · Maven workspace includes the base simulator module
- Maven root → Cloud2Sim engine: builds · Maven workspace includes Cloud2Sim extensions
- Maven root → CloudSim examples: builds · Maven workspace includes example simulations
- Setup script → Maven root: invokes · Script bootstraps the multi-module build
- Runtime config → Static runs: configures · Properties and XML files feed runtime modes
- Runtime config → Adaptive runs: configures · Adaptive and cluster settings drive scaling runs
- Runtime config → MapReduce jobs: configures · MapReduce parameters and input data are externalized
- Topology model → Topology parser: parsed by · JSON topology feeds the topology model and parser
- Topology parser → Serializers: supports · Topology and entity models are serialized to structured config
- Cloud2Sim engine → CloudSim kernel: bridges to · Cloud2Sim layers on top of CloudSim execution primitives
- Cloud2Sim engine → Simulation model: orchestrates · Manages simulation objects and core entities
- Cloud2Sim engine → Concurrency glue: uses · Distributed state is coordinated through concurrent submitters and cleaners
- Cloud2Sim engine → Hazelcast backend: uses · One distributed backend option is Hazelcast
- Cloud2Sim engine → Infinispan backend: uses · Another distributed backend option is Infinispan
- Cloud2Sim engine → Adaptive scaling: uses · Adaptive execution relies on scaling control loops
- Cloud2Sim engine → Fault models: uses · Failure injection hooks into the runtime
- Cloud2Sim engine → Workload gen: feeds · Synthetic arrivals and distributions shape simulation load
- Cloud2Sim engine → Serializers: uses · Entity definitions can be persisted and reloaded as XML
- Static runs → CloudSim kernel: runs · Single-node launcher drives the simulation kernel
- Parallel runs → Concurrency glue: runs through · Parallel mode coordinates distributed state updates
- Adaptive runs → Adaptive scaling: starts · Adaptive launcher begins the scaling workflow
- Adaptive scaling → Concurrency glue: coordinates · Scaler and workers exchange simulation state and lifecycle signals
- Adaptive scaling → Hazelcast backend: clusters with · Scaling can operate over Hazelcast-based cluster state
- Adaptive scaling → Infinispan backend: clusters with · Scaling can operate over Infinispan-based cluster state
- Hazelcast backend → Concurrency glue: stores state for · Hazelcast backend hosts distributed cloudlets and VMs
- Infinispan backend → Concurrency glue: stores state for · Infinispan backend supports distributed state and jobs
- MapReduce jobs → Hazelcast backend: implements · Hazelcast MapReduce path provides mapper/combiner/reducer flow
- MapReduce jobs → Infinispan backend: implements · Infinispan MapReduce path provides task-based reduction
- MapReduce jobs → Runtime config: reads inputs from · Job parameters and text corpora are loaded from config assets
- CloudSim examples → CloudSim kernel: demonstrates · Example simulations exercise the CloudSim kernel and domains
- CloudSim examples → Network sim: demonstrates · Network examples cover topology-aware execution
- CloudSim examples → Power sim: demonstrates · Power examples cover energy-aware policies and host models
- CloudSim kernel → Simulation model: drives · The event engine coordinates simulation entities
- Simulation model → Network sim: extends to · Network-aware datacenter and workflow models build on core entities
- Simulation model → Power sim: extends to · Power-aware hosts, VMs, and datacenters extend the base model
- Simulation model → CloudSim utils: uses · Entities depend on workload readers and runtime helpers