Interface NetworkPacket<T extends Identifiable>

Type Parameters:
T - the class of objects involved in the packet transmission. if they are Hosts, Vms, Switches, etc.
All Known Implementing Classes:
HostPacket, IcmpPacket, VmPacket

public interface NetworkPacket<T extends Identifiable>
Defines the structure for a network packet.
Since:
CloudSim Toolkit 1.0
Author:
Gokul Poduval, Chen-Khong Tham, National University of Singapore, Manoel Campos da Silva Filho
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the entity that the packet is going to.
    double
    Gets the time (in seconds) when the packet was received.
    double
    Gets the time (in seconds) when the packet was sent.
    long
    Gets the size of the packet in bytes.
    Gets the entity that this packet is coming from (the sender).
    void
    setDestination(T destination)
    Sets the entity that the packet is going to (the receiver).
    void
    setReceiveTime(double time)
    Sets the time when the packet was received.
    void
    setSendTime(double time)
    Sets the time when the packet was sent.
    void
    setSource(T source)
    Sets the entity that this packet is coming from (the sender).
  • Method Details

    • getSize

      long getSize()
      Gets the size of the packet in bytes.
      Returns:
      size of the packet in bytes.
    • getSource

      T getSource()
      Gets the entity that this packet is coming from (the sender).
      Returns:
    • setSource

      void setSource(T source)
      Sets the entity that this packet is coming from (the sender).
      Parameters:
      source - the source ID to set
    • getDestination

      T getDestination()
      Gets the entity that the packet is going to.
      Returns:
    • setDestination

      void setDestination(T destination)
      Sets the entity that the packet is going to (the receiver).
      Parameters:
      destination - the destination to set
    • getSendTime

      double getSendTime()
      Gets the time (in seconds) when the packet was sent.
      Returns:
    • setSendTime

      void setSendTime(double time)
      Sets the time when the packet was sent.
      Parameters:
      time - the time to set (in seconds)
    • getReceiveTime

      double getReceiveTime()
      Gets the time (in seconds) when the packet was received.
      Returns:
    • setReceiveTime

      void setReceiveTime(double time)
      Sets the time when the packet was received.
      Parameters:
      time - the time to set (in seconds)