NetworkHost

public class NetworkHost extends HostSimple

NetworkHost class extends HostSimple to support simulation of networked datacenters. It executes actions related to management of packets (sent and received) other than that of virtual machines (e.g., creation and destruction). A host has a defined policy for provisioning memory and bw, as well as an allocation policy for PE’s to virtual machines.

Please refer to following publication for more details:

Author:Saurabh Kumar Garg

Constructors

NetworkHost

public NetworkHost(long ram, long bw, long storage, List<Pe> peList)

Creates a NetworkHost.

Parameters:
  • ram – the RAM capacity in Megabytes
  • bw – the Bandwidth (BW) capacity in Megabits/s
  • storage – the storage capacity in Megabytes
  • peList – the host’s Pe list

NetworkHost

public NetworkHost(long ram, long bw, long storage, List<Pe> peList, VmScheduler vmScheduler)

Creates a NetworkHost.

Parameters:
  • ram – the RAM capacity in Megabytes
  • bw – the Bandwidth (BW) capacity in Megabits/s
  • storage – the storage capacity in Megabytes
  • peList – the host’s Pe list
  • vmScheduler – the VM scheduler

Methods

addReceivedNetworkPacket

public void addReceivedNetworkPacket(HostPacket hostPacket)

Adds a packet to the list of received packets in order to further submit them to the respective target VMs and Cloudlets.

Parameters:
  • hostPacket – received network packet

createVm

public boolean createVm(Vm vm)

{@inheritDoc}

It also creates and sets a for each Vm that doesn’t have one already.

Parameters:
Returns:

{@inheritDoc}

getBandwidth

public double getBandwidth()

Gets the Host bandwidth capacity in Megabits/s.

getEdgeSwitch

public EdgeSwitch getEdgeSwitch()

getTotalDataTransferBytes

public int getTotalDataTransferBytes()

setBandwidth

public void setBandwidth(double bandwidth)

Sets the Host bandwidth capacity in Megabits/s.

Parameters:
  • bandwidth – the bandwidth to set

setEdgeSwitch

public void setEdgeSwitch(EdgeSwitch edgeSwitch)

updateProcessing

public double updateProcessing(double currentTime)