NetworkPacket

public interface NetworkPacket<T extends Identifiable>

Defines the structure for a network packet.

Author:

Gokul Poduval, Chen-Khong Tham, National University of Singapore, Manoel Campos da Silva Filho

Parameters:
  • <T> – the class of objects involved in the packet transmission, if they are Hosts, VMs, Switches, etc.

Methods

getDestination

T getDestination()

Gets the entity that the packet is going to.

getReceiveTime

double getReceiveTime()

Gets the time when the packet was received.

getSendTime

double getSendTime()

Gets the time when the packet was sent.

getSize

long getSize()

Gets the size of the packet in bytes.

getSource

T getSource()

Gets the entity that this packet is coming from (the sender).

setDestination

void setDestination(T destination)

Sets the entity that the packet is going to (the receiver).

Parameters:
  • destination – the destination to set

setReceiveTime

void setReceiveTime(double time)

Sets the time when the packet was received.

Parameters:
  • time – the time to set

setSendTime

void setSendTime(double time)

Sets the time when the packet was sent.

Parameters:
  • time – the time to set

setSource

void setSource(T source)

Sets the entity that this packet is coming from (the sender).

Parameters:
  • source – the source ID to set