Package org.cloudbus.cloudsim.network
Class VmPacket
java.lang.Object
org.cloudbus.cloudsim.network.VmPacket
- All Implemented Interfaces:
NetworkPacket<Vm>
public class VmPacket extends java.lang.Object implements NetworkPacket<Vm>
Represents a packet that travels from a
Vm
to another, through the virtual network
within a Host
. It contains information about Cloudlets 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
-
Method Summary
Modifier and Type Method Description Vm
getDestination()
Gets the id of the VM that has to receive the packet.Cloudlet
getReceiverCloudlet()
Gets the cloudlet that has to receive the packet.double
getReceiveTime()
Gets the time when the packet was received.Cloudlet
getSenderCloudlet()
Gets the cloudlet sending the packet.double
getSendTime()
Gets the time when the packet was sent.long
getSize()
Gets the size of the packet in bytes.Vm
getSource()
Gets the VM sending the packet.void
setDestination(Vm destinationVmId)
Sets the id of 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
setSource(Vm sourceVmId)
Sets the id of the VM sending the packet.
-
Constructor Details
-
VmPacket
public VmPacket(Vm sourceVm, Vm destinationVm, long size, Cloudlet senderCloudlet, Cloudlet receiverCloudlet)Creates a packet to be sent to 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 when the packet was sent.- Specified by:
getSendTime
in interfaceNetworkPacket<Vm>
- 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<Vm>
- Parameters:
sendTime
- the time to set
-
getReceiveTime
public double getReceiveTime()Description copied from interface:NetworkPacket
Gets the time when the packet was received.- Specified by:
getReceiveTime
in interfaceNetworkPacket<Vm>
- 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<Vm>
- Parameters:
receiveTime
- the time to set
-
getSource
Gets the VM sending the packet. This is the VM where thesending cloudlet
is running.- Specified by:
getSource
in interfaceNetworkPacket<Vm>
- Returns:
-
setSource
Sets the id of the VM sending the packet. This is the VM where thesending cloudlet
is running.- Specified by:
setSource
in interfaceNetworkPacket<Vm>
- Parameters:
sourceVmId
- the source VM id to set
-
getDestination
Gets the id of the VM that has to receive the packet. This is the VM where threceiver cloudlet
is running.- Specified by:
getDestination
in interfaceNetworkPacket<Vm>
- Returns:
-
setDestination
Sets the id of the VM that has to receive the packet. This is the VM where threceiver cloudlet
is running.- Specified by:
setDestination
in interfaceNetworkPacket<Vm>
- Parameters:
destinationVmId
- the destination VM id to set
-
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<Vm>
- Returns:
-