Class VmPacket

java.lang.Object
org.cloudbus.cloudsim.network.VmPacket
All Implemented Interfaces:
NetworkPacket<Vm>

public class VmPacket
extends 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 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 packet
      destinationVm - id of the VM that has to receive the packet
      size - data length of the packet in bytes
      senderCloudlet - cloudlet sending the packet
      receiverCloudlet - 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 interface NetworkPacket<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 interface NetworkPacket<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 interface NetworkPacket<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 interface NetworkPacket<Vm>
      Parameters:
      receiveTime - the time to set
    • getSource

      public Vm getSource()
      Gets the VM sending the packet. This is the VM where the sending cloudlet is running.
      Specified by:
      getSource in interface NetworkPacket<Vm>
      Returns:
    • setSource

      public void setSource​(Vm sourceVmId)
      Sets the id of the VM sending the packet. This is the VM where the sending cloudlet is running.
      Specified by:
      setSource in interface NetworkPacket<Vm>
      Parameters:
      sourceVmId - the source VM id to set
    • getDestination

      public Vm getDestination()
      Gets the id of the VM that has to receive the packet. This is the VM where th receiver cloudlet is running.
      Specified by:
      getDestination in interface NetworkPacket<Vm>
      Returns:
    • setDestination

      public void setDestination​(Vm destinationVmId)
      Sets the id of the VM that has to receive the packet. This is the VM where th receiver cloudlet is running.
      Specified by:
      setDestination in interface NetworkPacket<Vm>
      Parameters:
      destinationVmId - the destination VM id to set
    • getSenderCloudlet

      public Cloudlet getSenderCloudlet()
      Gets the cloudlet sending the packet.
      Returns:
    • getReceiverCloudlet

      public Cloudlet 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 interface NetworkPacket<Vm>
      Returns: