Class NetworkHost

All Implemented Interfaces:
Comparable<Host>, AbstractMachine<FileStorage>, ChangeableId, Identifiable, Machine, ResourceStatsComputer<HostResourceStats>, Host, PowerAware<PowerModelHost>, Resourceful

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:

CloudSim Toolkit 3.0
Saurabh Kumar Garg
  • Field Details

  • Constructor Details

    • NetworkHost

      public NetworkHost(long ram, long bw, long storage, List<Pe> peList)
      Creates and powers on a NetworkHost using a VmSchedulerSpaceShared as default.
      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
  • Method Details

    • updateProcessing

      public double updateProcessing(double currentTime)
      Description copied from interface: Host
      Updates the processing of VMs running on this Host, that makes the processing of cloudlets inside such VMs to be updated.
      Specified by:
      updateProcessing in interface Host
      updateProcessing in class HostSimple
      currentTime - the current time
      the predicted completion time of the earliest finishing cloudlet (which is a relative delay from the current simulation time), or Double.MAX_VALUE if there is no next Cloudlet to execute
    • createVm

      public HostSuitability createVm(Vm vm)
      Try to allocate resources to a new VM in the Host.

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

      Specified by:
      createVm in interface Host
      createVm in class HostSimple
      vm - Vm being started
      a HostSuitability to indicate if the Vm was placed into the host or not (if the Host doesn't have enough resources to allocate the Vm)
    • getTotalDataTransferBytes

      public int getTotalDataTransferBytes()
    • 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.
      hostPacket - received network packet
    • getEdgeSwitch

      public EdgeSwitch getEdgeSwitch()
      Gets the Switch the Host is directly connected to.
    • setEdgeSwitch

      public void setEdgeSwitch(EdgeSwitch edgeSwitch)
      Sets the Switch the Host is directly connected to. This method is to be called only by the EdgeSwitch.connectHost(NetworkHost) method.
      edgeSwitch - the Switch to set