Package org.cloudbus.cloudsim.network
Class VmPacket
java.lang.Object
org.cloudbus.cloudsim.network.VmPacket
- All Implemented Interfaces:
NetworkPacket<NetworkVm>
Represents a packet that travels from a
NetworkVm
to another, through the virtual network
within a NetworkHost
. It contains information about NetworkCloudlet
s which are
communicating.
Please refer to following publication for more details:
- Since:
- CloudSim Toolkit 1.0
- Author:
- Saurabh Kumar Garg, Manoel Campos da Silva Filho
-
Constructor Summary
ConstructorDescriptionVmPacket
(NetworkVm sourceVm, NetworkVm destinationVm, long size, NetworkCloudlet senderCloudlet, NetworkCloudlet receiverCloudlet) Creates a packet to be sent to a VM inside the Host of the sender VM. -
Method Summary
Modifier and TypeMethodDescriptionGets the VM that has to receive the packet.Gets the cloudlet that has to receive the packet.double
Gets the time (in seconds) when the packet was received.Gets the cloudlet sending the packet.double
Gets the time (in seconds) when the packet was sent.long
getSize()
Gets the size of the packet in bytes.Gets the VM sending the packet.void
setDestination
(NetworkVm destinationVm) Sets the VM that has to receive the packet.void
setReceiveTime
(double receiveTime) Sets the time when the packet was received.void
setSendTime
(double sendTime) Sets the time when the packet was sent.void
Sets the VM sending the packet.
-
Constructor Details
-
VmPacket
public VmPacket(NetworkVm sourceVm, NetworkVm destinationVm, long size, NetworkCloudlet senderCloudlet, NetworkCloudlet receiverCloudlet) Creates a packet to be sent to a VM inside the Host of the sender VM.- Parameters:
sourceVm
- id of the VM sending the packetdestinationVm
- id of the VM that has to receive the packetsize
- data length of the packet in bytessenderCloudlet
- cloudlet sending the packetreceiverCloudlet
- cloudlet that has to receive the packet
-
-
Method Details
-
getSendTime
public double getSendTime()Description copied from interface:NetworkPacket
Gets the time (in seconds) when the packet was sent.- Specified by:
getSendTime
in interfaceNetworkPacket<NetworkVm>
- Returns:
-
setSendTime
public void setSendTime(double sendTime) Description copied from interface:NetworkPacket
Sets the time when the packet was sent.- Specified by:
setSendTime
in interfaceNetworkPacket<NetworkVm>
- Parameters:
sendTime
- the time to set (in seconds)
-
getReceiveTime
public double getReceiveTime()Description copied from interface:NetworkPacket
Gets the time (in seconds) when the packet was received.- Specified by:
getReceiveTime
in interfaceNetworkPacket<NetworkVm>
- Returns:
-
setReceiveTime
public void setReceiveTime(double receiveTime) Description copied from interface:NetworkPacket
Sets the time when the packet was received.- Specified by:
setReceiveTime
in interfaceNetworkPacket<NetworkVm>
- Parameters:
receiveTime
- the time to set (in seconds)
-
getSource
Gets the VM sending the packet. This is the VM where thesending cloudlet
is running.- Specified by:
getSource
in interfaceNetworkPacket<NetworkVm>
- Returns:
-
setSource
Sets the VM sending the packet. This is the VM where thesending cloudlet
is running.- Specified by:
setSource
in interfaceNetworkPacket<NetworkVm>
- Parameters:
sourceVm
- the source VM to set
-
getDestination
Gets the VM that has to receive the packet. This is the VM where threceiver cloudlet
is running.- Specified by:
getDestination
in interfaceNetworkPacket<NetworkVm>
- Returns:
-
setDestination
Sets the VM that has to receive the packet. This is the VM where threceiver cloudlet
is running.- Specified by:
setDestination
in interfaceNetworkPacket<NetworkVm>
- Parameters:
destinationVm
- the destination VM to set
-
getDestinationHost
-
getSenderCloudlet
Gets the cloudlet sending the packet.- Returns:
-
getReceiverCloudlet
Gets the cloudlet that has to receive the packet.- Returns:
-
getSize
public long getSize()Description copied from interface:NetworkPacket
Gets the size of the packet in bytes.- Specified by:
getSize
in interfaceNetworkPacket<NetworkVm>
- Returns:
- size of the packet in bytes.
-