Package org.cloudbus.cloudsim.network
Interface NetworkPacket<T extends Identifiable>
- Type Parameters:
T
- the class of objects involved in the packet transmission. if they areHost
s,Vm
s,Switch
es, 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 TypeMethodDescriptionGets 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
getSize()
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
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
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
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)
-