GithubHelp home page GithubHelp logo

vijayaramb / cloudsimplus Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cloudsimplus/cloudsimplus

0.0 0.0 0.0 44.44 MB

State-of-the-art Framework 🏗for Cloud Computing ⛅️ Simulation ☕️🎓: a modern, full-featured, easier-to-use, highly extensible 🧩, faster 🚀 and more accurate Java 17+ tool for cloud computing research

Home Page: https://cloudsimplus.org

License: GNU General Public License v3.0

Shell 1.81% Java 98.19%

cloudsimplus's Introduction

Overview | Exclusive Features | Structure | How to use | Example | Docs and Help | Consulting | General Features | Publications | Related Projects | License | Contributing

1. Overview Open in Gitpod (You need to log in at gitpod.io first)

Consulting Build Status Codacy Code Quality Codacy Code Coverage Maven Central Documentation Status GPL licensed GitHub Repo stars Twitter Follow

CloudSim Plus is a modern, up-to-date, full-featured and fully documented Java 17 simulation framework. It's easy to use and extend, enabling modeling, simulation, and experimentation of Cloud computing infrastructures and application services. It allows developers to focus on specific system design issues to be investigated, without concerning the low-level details related to Cloud-based infrastructures and services.

CloudSim Plus is a fork of CloudSim 3, re-engineered primarily to avoid code duplication, provide code reuse and ensure compliance with software engineering principles and recommendations for extensibility improvements and accuracy. It's currently the state-of-the-art in cloud computing simulation framework.

The efforts dedicated to this project have been recognized by the EU/Brasil Cloud FORUM. A post about CloudSim Plus is available at this page of the Forum, including a White Paper available in the Publications Section.

CloudSim Plus started through a partnership between the Instituto de Telecomunicações (IT, Portugal), the Universidade da Beira Interior (UBI, Portugal) and the Instituto Federal de Educação Ciência e Tecnologia do Tocantins (IFTO, Brazil). It was partially supported by the Portuguese Fundação para a Ciência e a Tecnologia (FCT) and by the Brazilian foundation Coordenação de Aperfeiçoamento de Pessoal de Nível Superior (CAPES).

NOTE

If you are using CloudSim Plus in your research, please make sure you cite this paper: M. C. Silva Filho, R. L. Oliveira, C. C. Monteiro, P. R. M. Inácio, and M. M. Freire. CloudSim Plus: a Cloud Computing Simulation Framework Pursuing Software Engineering Principles for Improved Modularity, Extensibility and Correctness, in IFIP/IEEE International Symposium on Integrated Network Management, 2017, p. 7.

IMPORTANT

  • Developing and maintaining this project takes a huge effort. This way, any kind of contribution is encouraged. Show your support by giving it a star ⭐ using the button at the top of the GitHub page. It takes no time, helps promoting the project and keeps it evolving. Thanks in advance 👏.
  • If you aren't intending to make changes and contribute back to the project, you shouldn't fork it. Your fork tends to become obsolete as the project is updated.
  • If you're willing to use the framework to develop your own project on top of it, creating a fork is the worst way. You aren't supposed to change the framework code to implement your project, but to extend it by creating some subclasses. Unless you are planning to contribute your changes back, you'll end up with an incompatible and obsolete version of the framework. The project is constantly evolving and bugfixes are a priority. Your fork with personal changes will miss those updates and high performance improvements.
  • If you've just came across this project and wants to check it later, star it ⭐, we appreciate 👏.

⬆️

2. 🧰 Main Exclusive Features

CloudSim Plus provides lots of exclusive features, from the most basic ones to build simple simulations, to advanced features for simulating more realistic cloud scenarios:

  1. It is easier to use. A complete and easy-to-understand simulation scenario can be built in few lines of code.
  2. Creation of joint power- and network-aware simulations. Regular classes such as DatacenterSimple, HostSimple and VmSimple now allow power-aware simulations. By using the network version of such classes, simulations that are both power- and network-aware can be created. (#45);
  3. Vertical VM Scaling that performs on-demand up and down allocation of VM resources such as Ram, Bandwidth and PEs (CPUs) (#7);
  4. Horizontal VM scaling, allowing dynamic creation of VMs according to an overload condition. Such a condition is defined by a predicate that can check different VM resources usage such as CPU, RAM or BW (#41);
  5. Highly accurate power usage computation for different Datacenter's scheduling intervals (#153).
  6. Built-in computation of CPU utilization history and energy consumption for VMs (and Hosts) (#168).
  7. Virtual Memory and Reduced bandwidth allocation: when a Cloudlet requests more RAM or BW then there is available, its processing is delayed. For RAM, the required amount may be allocated, relying on the VM disk for virtual memory (VMem / swap). For BW, it's allocated only the available capacity, meaning slower data transfer and consequent processing delay. (#170).
  8. Automatically power Hosts on and off according to demand (#128) and support defining a startup and shutdown delay/power consumption (#238).
  9. Parallel execution of simulations in multi-core computers, allowing multiple simulations to be run simultaneously in an isolated way (#38);
  10. Delay creation of submitted VMs and Cloudlets, enabling simulation of dynamic arrival of tasks (#11, #23);
  11. Allow dynamic creation of VMs and Cloudlets without requiring creation of Datacenter Brokers at runtime, enabling VMs to be created on-demand according to arrived cloudlets (#43);
  12. Listeners to enable simulation monitoring and creation of VMs and Cloudlets at runtime;
  13. Process trace files from Google Cluster Data creating Hosts and Cloudlets (tasks). A script to download the trace files is available at download-google-cluster-data.sh. Examples are available here (#149).
  14. It is a strongly object-oriented framework that creates relationships among classes and allows chained calls such as cloudlet.getVm().getHost().getDatacenter(). And guess what? You don't even have to worry about NullPointerException when making such a chained call because CloudSim Plus uses the Null Object Design Pattern to avoid that (#10);
  15. Classes and interfaces to allow implementation of heuristics such as Tabu Search, Simulated Annealing, Ant Colony Systems and so on. See an example using Simulated Annealing here;
  16. Implementation of the Completely Fair Scheduler used in recent versions of the Linux Kernel. See an example here (#58);
  17. A Functional DatacenterBrokerSimple class that enables changing, at runtime, policies for different goals. This dynamic behavior allows implementing specific policies without requiring the creation of new DatacenterBroker classes. The policies that can be dynamically changed are:
    • selection of a Datacenter to place waiting VMs (#28);
    • selection of a VM to run each Cloudlet (#25);
    • definition of the time when an idle VM should be destroyed (#99);
    • sorting of requests to create submitted VMs and Cloudlets, defining priorities to create such objects (#102).
  18. Host Fault Injection Mechanism to enable injection of random failures into Hosts CPU cores: it injects failures and reallocates working cores to running VMs. When all cores from a Host fail, it starts clones of failed VMs to recovery from failure. This way, it is simulated the instantiation of VM snapshots into different Hosts (#81).
  19. Creation of Hosts at Simulation Runtime to enable physical expansion of Datacenter capacity (#124).
  20. Enables the simulation to keep running, waiting for dynamic and even random events such as the arrival of Cloudlets and VMs (#130).
  21. TableBuilder objects that are used in all examples and enable printing simulation results in different formats such as Markdown Table, CSV or HTML. It shows results in perfectly aligned tables, including data units. Check the last line of the BasicFirstExample constructor to see how it is easy to print results;
  22. Defines types and colors for log messages and enables filtering the level of messages to print. The image below shows how easy is to check things that may be wrong in your simulation (#24). And for instance, if you want to see just messages from warning level, it's as simple as calling Log.setLevel(ch.qos.logback.classic.Level.WARN);
  23. Enables running the simulation synchronously, making it easier to interact with it and collect data inside a loop, as the simulation goes on. This brings freedom to implement your simulations (#205).
  24. Enables Broker to destroy a VM and return the list of unfinished Cloudlets, so that they can be resubmitted to another VM. (#209).
  25. Allows placing a group of VMs into the same Host. (#90).
  26. Enables Broker to try selecting the closest Datacenter to place VMs, according to their time zone. (#212).
  27. It outperforms CloudSim 4, as can be seen in the table below*.
VmAllocationPolicy CloudSim 4.0.0 Simulation Time (min) CloudSim Plus 4.3.4 Simulation Time (min) DCs Hosts VMs Cloudlets
Simple (WorstFit) 23.9 15.7 1 20000 40000 50000
BestFit** 19.6 15.7 1 20000 40000 50000
FirstFit** 13.6   1.3 1 20000 40000 50000

* More details and results here. ** Only officially available in CloudSim Plus.

3. 🏗 Project's Structure

CloudSim Plus has a simpler structure to make it ease to use and understand. It consists of 4 modules, 2 of which are new, as presented below.

CloudSim Plus Modules

  • cloudsim-plus: the CloudSim Plus cloud simulation framework API, which is used by all other modules. It is the main and only required module you need to write cloud simulations.
  • cloudsim-plus-examples: includes a series of different examples, since minimal simulation scenarios using basic CloudSim Plus features, to complex scenarios using workloads from trace files or Vm migration examples. This is an excellent starting point for learning how to build cloud simulations using CloudSim Plus.
  • cloudsim-plus-testbeds: enables implementation of simulation testbeds in a repeatable manner, allowing a researcher to execute several simulation runs for a given experiment and collect statistical data using a scientific approach.
  • cloudsim-plus-benchmarks: a new module used just internally to implement micro benchmarks to assess framework performance.

It also has a better package organization, improving Separation of Concerns (SoC) and making it easy to know where a desired class is and what is inside each package. The figure below presents the new package organization. The dark yellow packages are new in CloudSim Plus and include its exclusive interfaces and classes. The light yellow ones were introduced just to better organize existing CloudSim classes and interfaces.

CloudSim Plus Packages

⬆️

4. 👩🏽‍💻 How to Use CloudSim Plus

⚠️ IMPORTANT

  • Before trying to use this project, make sure you have JDK 17 installed.

There are 4 ways to use CloudSim Plus. It can be downloaded and executed: (i) from Maven Central since you include it as a dependency inside your own project. (ii) downloading a zip file using the button at the top of this page; (iii) from the command line; (iv) directly from some IDE;

You can check this video or follow the instructions in one of the next subsections.

4.1 Adding it as a Dependency into Your Own Project

You can add CloudSim Plus API module (which is the only one required to build simulations) as a dependency inside your own Maven or Gradle project. This way you can start building your simulations from scratch.

4.1.1 Maven

Add the following dependency into the pom.xml file of your own Maven project.

<dependency>
    <groupId>org.cloudsimplus</groupId>
    <artifactId>cloudsim-plus</artifactId>
    <!-- Set a specific version or use the latest one -->
    <version>LATEST</version>
</dependency>

4.1.2 Gradle

Add the following dependency into the build.gradle file of your own Gradle project.

dependencies {
    //Set a specific version or use the latest one
    implementation 'org.cloudsimplus:cloudsim-plus:LATEST'
}

4.2 Downloading sources via Command Line

Considering that you have git and maven installed on your operating system, download the project source by cloning the repository issuing the command git clone https://github.com/manoelcampos/cloudsim-plus.git at a terminal.

The project has a bash script you can use to build and run CloudSim Plus examples. This is a script for Unix-like systems such as Linux, FreeBSD and macOS.

To run some example, type the following command at a terminal inside the project's root directory: bash script/bootstrap.sh package.ExampleClassName. For instance, to run the BasicFirstExample you can type: bash script/bootstrap.sh org.cloudsimplus.examples.BasicFirstExample.

The script checks if it is required to build the project, using maven in this case, making sure to download all dependencies. To see which examples are available, just navigate through the examples directory. To check more script options, run it without any parameter.

4.3 By Means of an IDE

The easiest way to use the project is relying on some IDE such as NetBeans, Eclipse or IntelliJ IDEA. Below are the steps to start using the project:

  • Download the project sources by using: the download button on top of this page; your own IDE for it; or the command line as described above.
  • Open/import the project in your IDE:
    • For NetBeans, just use the "Open project" menu and select the directory where the project was downloaded/cloned.
    • For Eclipse or IntelliJ IDEA, you have to import the project selecting the folder where the project was cloned. Check an Eclipse tutorial here.
  • Inside the opened/imported project you will have the cloudsim-plus and cloudsim-plus-examples modules. The cloudsim-plus module is where the simulator source code is, that usually you don't have to change, unless you want to contribute to the project. The cloudsim-plus-examples is where you can start.
  • Open the cloudsim-plus-examples module. The most basic examples are in the root of the org.cloudbus.cloudsim.examples package. You can run any one of the classes in this package to get a specific example.
  • If you want to build your own simulations, the easiest way is to create another class inside this module.

⬆️

5. ⚙️ A Minimal but Complete Simulation Example

In order to build a simulation scenario, you have to create at least:

  • a datacenter with a list of physical machines (Hosts);
  • a broker that allows submission of VMs and Cloudlets to be executed, on behalf of a given customer, into the cloud infrastructure;
  • a list of customer's virtual machines (VMs);
  • and a list of customer's cloudlets (objects that model resource requirements of different applications).

Due to the simplicity provided by CloudSim Plus, all the code to create a minimal simulation scenario can be as simple as presented below. A more adequate and reusable example is available here, together with other examples. Specific examples of CloudSim Plus, showing several new exclusive features and advanced scenarios, can be found here.

//Enables just some level of logging.
//Make sure to import org.cloudsimplus.util.Log;
//Log.setLevel(ch.qos.logback.classic.Level.WARN);

//Creates a CloudSim object to initialize the simulation.
CloudSim cloudsim = new CloudSim();

/*Creates a Broker that will act on behalf of a cloud user (customer).*/
DatacenterBroker broker0 = new DatacenterBrokerSimple(cloudsim);

//Creates a list of Hosts, each host with a specific list of CPU cores (PEs).
List<Host> hostList = new ArrayList<>(1);
List<Pe> hostPes = new ArrayList<>(1);
//Uses a PeProvisionerSimple by default to provision PEs for VMs
hostPes.add(new PeSimple(20000));
long ram = 10000; //in Megabytes
long storage = 100000; //in Megabytes
long bw = 100000; //in Megabits/s

//Uses ResourceProvisionerSimple by default for RAM and BW provisioning
//Uses VmSchedulerSpaceShared by default for VM scheduling
Host host0 = new HostSimple(ram, bw, storage, hostPes);
hostList.add(host0);

//Creates a Datacenter with a list of Hosts.
//Uses a VmAllocationPolicySimple by default to allocate VMs
Datacenter dc0 = new DatacenterSimple(cloudsim, hostList);

//Creates VMs to run applications.
List<Vm> vmList = new ArrayList<>(1);
//Uses a CloudletSchedulerTimeShared by default to schedule Cloudlets
Vm vm0 = new VmSimple(1000, 1);
vm0.setRam(1000).setBw(1000).setSize(1000);
vmList.add(vm0);

//Creates Cloudlets that represent applications to be run inside a VM.
List<Cloudlet> cloudletList = new ArrayList<>();
//UtilizationModel defining the Cloudlets use only 50% of any resource all the time
UtilizationModelDynamic utilizationModel = new UtilizationModelDynamic(0.5);
Cloudlet cloudlet0 = new CloudletSimple(10000, 1, utilizationModel);
Cloudlet cloudlet1 = new CloudletSimple(10000, 1, utilizationModel);
cloudletList.add(cloudlet0);
cloudletList.add(cloudlet1);

broker0.submitVmList(vmList);
broker0.submitCloudletList(cloudletList);

/*Starts the simulation and waits all cloudlets to be executed, automatically
stopping when there is no more events to process.*/
cloudsim.start();

/*Prints results when the simulation is over
(you can use your own code here to print what you want from this cloudlet list).*/
new CloudletsTableBuilder(broker0.getCloudletFinishedList()).build();

The presented results are structured and clear to allow better understanding. For example, the image below shows the output for a simulation with two cloudlets (applications).

Simulation Results

⬆️

6. 📘❓ Documentation and Help

The project documentation originated from CloudSim was entirely updated and extended. You can see the javadoc documentation for classes and their elements directly on your IDE.

The documentation is available online at ReadTheDocs, which includes a FAQ and guides. CloudSim Plus has extended documentation of classes and interfaces and also includes extremely helpful package documentation that can be viewed directly on your IDE or at the link provided above. Such a package documentation gives a general overview of the classes used to build a cloud simulation. Also, check the publications section to access published CloudSim Plus papers.

A Google Group forum is available at https://groups.google.com/group/cloudsim-plus and you can also use the Discussions page here. Do not open an issue to post a question, they will be just deleted.

⬆️

⬆️

7. 👨🏽‍🏫 Consulting

If you are doing research on cloud computing simulation and facing challenging issues, I've started to offer my consulting services.

I can help you with different kinds of issues and provide specific features for your simulations, including resource allocation, task scheduling, VM placement and migration, metrics computation, process automation, debugging, results analysis, validation and more.

If you have a CloudSim project and want to migrate to CloudSim Plus to benefit from its extensive documentation, active development and support, exclusive features, great accuracy and performance, the consulting can be fit for you too.

Get the contact e-mail here.

8. 🛠 General Features of the Framework

CloudSim Plus supports modeling and simulation of:

  • large scale Cloud computing data centers;
  • virtualized server hosts, with customizable policies for provisioning host resources to virtual machines;
  • data center network topologies and message-passing applications;
  • federated clouds;
  • user-defined policies for allocation of hosts to virtual machines and policies for allocation of host resources to virtual machines.

⬆️

8. 📝 CloudSim Plus Publications

  1. M. C. Silva Filho, R. L. Oliveira, C. C. Monteiro, P. R. M. Inácio, and M. M. Freire. CloudSim Plus: a Cloud Computing Simulation Framework Pursuing Software Engineering Principles for Improved Modularity, Extensibility and Correctness, in IFIP/IEEE International Symposium on Integrated Network Management, 2017, p. 7. If you are using CloudSim Plus in your research, please make sure you cite that paper. You can check the paper presentation here.
  2. White Paper. CloudSim Plus: A Modern Java 8 Framework for Modeling and Simulation of Cloud Computing Infrastructures and Services. 2016.
  3. R. L. Oliveira. Virtual Machine Allocation in Cloud Computing Environments based on Service Level Agreements (only in Portuguese). Master's Dissertation. University of Beira Interior, 2017 (Supervisor: M. M. Freire).

⬆️

9. 🧩 Related Projects

Here, it's presented a list of some projects based on CloudSim Plus, which trust in its accuracy, performance, maintainability and extensibility. If you want your project to be listed here, send us a Pull Request. Make sure your project has a descriptive README.

  1. PureEdgeSim: A simulation toolkit for performance evaluation of Fog and pure Edge computing environments.
  2. CloudSim Plus Py4j gateway: building CloudSim Plus simulations in Python
  3. RECAP Discrete Event Simulation Framework an extension for CloudSimPlus
  4. CloudSim Plus Automation: defining CloudSim Plus simulation scenarios into a YAML file.
  5. LEAF: Simulator for modeling Large Energy-Aware Fog computing environments
  6. EPCSAC: Extensible Platform for Cloud Scheduling Algorithm Comparison.
  7. SatEdgeSim: A Toolkit for Modeling and Simulation of Performance Evaluation in Satellite Edge Computing Environments.

⬆️

10. ⚖️ License

This project is licensed under GNU GPLv3, as defined inside CloudSim 3 source files.

⬆️

11. 🤝 Contributing

You are welcome to contribute to the project. However, make sure you read the contribution guide before starting. The guide provides information on the different ways you can contribute, such as by requesting a feature, reporting an issue, fixing a bug or providing some new feature.

⬆️

cloudsimplus's People

Contributors

abderrahmanl avatar andreacappelletti97 avatar beloglazov avatar birnbaum avatar dependabot[bot] avatar douglasleer avatar humaira-salam avatar katrinleinweber avatar manoelcampos avatar monkeywithacupcake avatar nickdelta avatar nikolayg avatar pkoperek avatar raysaoliveira avatar reiz avatar romantic668 avatar snyk-bot avatar tewsmax avatar tnanukem avatar wadewaleganesh avatar williamvoor avatar wuusn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.