Class NetworkHost
java.lang.Object
org.cloudbus.cloudsim.hosts.HostSimple
org.cloudbus.cloudsim.hosts.network.NetworkHost
- All Implemented Interfaces:
Comparable<Host>
,AbstractMachine
,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:
- Since:
- CloudSim Toolkit 3.0
- Author:
- Saurabh Kumar Garg
-
Field Summary
Fields inherited from class org.cloudbus.cloudsim.hosts.HostSimple
cpuUtilizationStats
Fields inherited from interface org.cloudbus.cloudsim.hosts.Host
DEF_IDLE_SHUTDOWN_DEADLINE, NULL
-
Constructor Summary
Constructors Constructor Description NetworkHost(long ram, long bw, long storage, List<Pe> peList)
Creates and powers on a NetworkHost using aVmSchedulerSpaceShared
as default. -
Method Summary
Modifier and Type Method Description 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.boolean
createVm(Vm vm)
Try to allocate resources to a new VM in the Host.EdgeSwitch
getEdgeSwitch()
Gets the Switch the Host is directly connected to.int
getTotalDataTransferBytes()
void
setEdgeSwitch(EdgeSwitch edgeSwitch)
Sets the Switch the Host is directly connected to.double
updateProcessing(double currentTime)
Updates the processing of VMs running on this Host, that makes the processing of cloudlets inside such VMs to be updated.Methods inherited from class org.cloudbus.cloudsim.hosts.HostSimple
addMigratingInVm, addOnShutdownListener, addOnStartupListener, addOnUpdateProcessingListener, addVmMigratingOut, addVmToCreatedList, addVmToList, compareTo, createTemporaryVm, deallocateResourcesOfAllVms, deallocateResourcesOfVm, destroyAllVms, destroyTemporaryVm, destroyVm, disableStateHistory, enableStateHistory, enableUtilizationStats, equals, getAllocatedMipsForVm, getAvailableStorage, getBusyPeList, getBusyPesNumber, getBusyPesPercent, getBusyPesPercent, getBw, getBwProvisioner, getBwUtilization, getCpuMipsUtilization, getCpuPercentUtilization, getCpuUtilizationStats, getDatacenter, getDefaultBwCapacity, getDefaultRamCapacity, getDefaultStorageCapacity, getFailedPesNumber, getFinishedVms, getFirstStartTime, getFreePeList, getFreePesNumber, getId, getIdleShutdownDeadline, getLastBusyTime, getMigratableVms, getMips, getNumberOfPes, getPeList, getPowerModel, getProvisioner, getRam, getRamProvisioner, getRamUtilization, getResources, getShutdownTime, getSimulation, getStartTime, getStateHistory, getStorage, getSuitabilityFor, getTotalAllocatedMips, getTotalAllocatedMipsForVm, getTotalAvailableMips, getTotalMipsCapacity, getTotalUpTime, getTotalUpTimeHours, getUpTime, getUpTimeHours, getVmCreatedList, getVmList, getVmScheduler, getVmsMigratingIn, getVmsMigratingOut, getWorkingPeList, getWorkingPesNumber, hasEverStarted, hashCode, hasMigratingVms, isActive, isFailed, isLazySuitabilityEvaluation, isStateHistoryEnabled, isSuitableForVm, reallocateMigratingInVms, removeMigratingInVm, removeOnShutdownListener, removeOnStartupListener, removeOnUpdateProcessingListener, removeVmMigratingOut, setActive, setBwProvisioner, setDatacenter, setDefaultBwCapacity, setDefaultRamCapacity, setDefaultStorageCapacity, setFailed, setId, setIdleShutdownDeadline, setLazySuitabilityEvaluation, setPeStatus, setPowerModel, setRamProvisioner, setShutdownTime, setSimulation, setStartTime, setVmScheduler, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.cloudbus.cloudsim.core.AbstractMachine
getIdleInterval, isIdle, isIdleEnough
Methods inherited from interface org.cloudbus.cloudsim.core.Machine
getExpectedRelativeCpuUtilization, getRelativeBwUtilization, getRelativeCpuUtilization, getRelativeMipsCapacityPercent, getRelativeRamUtilization
Methods inherited from interface org.cloudbus.cloudsim.resources.Resourceful
getResource
-
Constructor Details
-
NetworkHost
Creates and powers on a NetworkHost using aVmSchedulerSpaceShared
as default.- Parameters:
ram
- the RAM capacity in Megabytesbw
- the Bandwidth (BW) capacity in Megabits/sstorage
- the storage capacity in MegabytespeList
- the host'sPe
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 interfaceHost
- Overrides:
updateProcessing
in classHostSimple
- Parameters:
currentTime
- the current time- Returns:
- 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
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 interfaceHost
- Overrides:
createVm
in classHostSimple
- Parameters:
vm
- Vm being started- Returns:
- $true if the VM could be started in the host; $false otherwise
-
getTotalDataTransferBytes
public int getTotalDataTransferBytes() -
addReceivedNetworkPacket
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
-
getEdgeSwitch
Gets the Switch the Host is directly connected to.- Returns:
-
setEdgeSwitch
Sets the Switch the Host is directly connected to. This method is to be called only by theEdgeSwitch.connectHost(NetworkHost)
method.- Parameters:
edgeSwitch
- the Switch to set
-