0% found this document useful (0 votes)
17 views6 pages

Untitled Document

Uploaded by

darjih460
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views6 pages

Untitled Document

Uploaded by

darjih460
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Exercise

1. Simulate resource management using Cloudsim.

Basic example of simulating resource management using Cloudsim:

1. Setting Up the Environment:

● Download and install Cloudsim (Java based) and its dependencies like Apache
Commons Math. You'll need an IDE like Eclipse to work with the Java code.
● Refer to Cloudsim tutorials (https://cloudsimtutorials.online/) for detailed setup
instructions.

2. Building the Simulation:

Here's a basic structure for your simulation code:

public class CloudSimExample {

public static void main(String[] args) {

// Create a new data centre object

Datacenter datacenter = createDatacenter();

// Create a list of virtual machines (VMs)

List<Vm> vmList = createVMs();

// Create a list of cloudlets (tasks to be executed on VMs)

List<Cloudlet> cloudletList = createCloudlets();


// Create a CloudSim Scheduler object (defines VM allocation policy)

CloudScheduler scheduler = new CloudSchedulerTimeShared();

// Submit VMs and cloudlets to the datacenter

datacenter.submitVmList(vmList);

datacenter.submitCloudletList(cloudletList);

// Run the CloudSim simulation

datacenter.simulate();

// Print simulation results (e.g., VM execution time, resource utilisation)

printCloudletList(cloudletList);

// Helper methods to create Datacenter, VMs, and Cloudlets with desired


configurations

private static Datacenter createDatacenter() {

// ... (Define datacenter properties like number of hosts, processing power, etc.)

private static List<Vm> createVMs() {

// ... (Define VM properties like MIPS, RAM, storage etc. Create multiple VMs)
}

private static List<Cloudlet> createCloudlets() {

// ... (Define Cloudlet properties like length, number of required PEs etc. Create
multiple Cloudlets)

private static void printCloudletList(List<Cloudlet> list) {

// ... (Iterate through Cloudlet list and print execution time etc.)

3. Resource Management Simulation:

In this example, the createDatacenter method defines the datacenter with its computing
resources (hosts). The createVMs method defines virtual machines with their CPU, RAM,
and storage configurations. Finally, the createCloudlets method defines tasks (cloudlets)
with their resource requirements (processing power) and length (execution time).

You can modify this code to explore resource management scenarios. Here are some ideas:

● Different VM allocation policies: The CloudScheduler object defines the VM


allocation policy. CloudSim offers various policies like time-shared, space-shared,
and priority-based. Implement different schedulers and observe how they impact
cloudlet execution time and resource utilisation.
● Varying VM and Cloudlet configurations: Experiment with different VM
configurations (CPU, RAM) and cloudlet requirements to see how resource
contention affects performance.
● Overload scenarios: Simulate situations where the datacenter is overloaded with
VMs or cloudlets exceeding its capacity. Analyse how the chosen scheduler handles
resource allocation under pressure.

4. Running the Simulation:

Compile and run the Java code. Cloudsim will simulate the scenario and provide output based
on your defined configurations. You can analyse the results such as cloudlet execution time,
resource utilisation of VMs and datacenter, and identify resource management bottlenecks.
2. Simulate secure file sharing using Cloudsim.

Cloudsim itself isn't directly designed to simulate secure file sharing functionalities.
However, you can leverage it to model the underlying infrastructure and integrate security
aspects at a conceptual level. Here's how you can approach it:

1. Modelling the Infrastructure:

● Datacenter: Create a datacenter in Cloudsim representing the cloud platform


facilitating file sharing.
● Virtual Machines (VMs): Define VMs representing the servers responsible for storing
and managing files.
● Cloudlets (Tasks): Use cloudlets to represent the actions of uploading, downloading,
and accessing files.

2. Security Considerations:

● Encryption: While Cloudsim doesn't handle data directly, you can conceptually model
encryption by adding a processing step to cloudlets representing file uploads. This
step would simulate the encryption process before storing the file on the VM
(datacenter storage).
● Authentication and Authorization: Cloudlets representing file access requests could be
assigned user IDs. The VM could perform a conceptual check against an access
control list (ACL) to simulate verifying user permissions before allowing downloads
or modifications.

3. Limitations:

● Cloudsim doesn't handle actual data transfer or encryption. It simulates the resource
usage of these processes.
● Security protocols and mechanisms like key management or digital signatures can't be
directly implemented in Cloudsim.
4. Alternative Approaches:

● Focus on Performance of Secure Protocols: You can model different secure file
sharing protocols (e.g., SFTP) within Cloudsim by focusing on the resource usage
(CPU, network bandwidth) associated with their encryption and decryption processes.
● Integration with External Tools: Consider using Cloudsim to model the infrastructure
and integrate external security libraries for simulating specific cryptographic
operations. However, this requires advanced programming expertise.

5. Overall Purpose:

● Simulating secure file sharing with Cloudsim aims to understand the impact of
security measures on resource utilisation and performance. It won't directly model the
intricate details of secure communication protocols.

You might also like