GridSim
v3.1

gridsim.net
Interface Packet

All Known Implementing Classes:
InfoPacket, NetPacket

public interface Packet

This the structure for packets.

Since:
GridSim Toolkit 3.1
Author:
Gokul Poduval & Chen-Khong Tham, National University of Singapore

Method Summary
 int getDestID()
          Returns the destination id of this packet.
 int getID()
          Returns the ID of this packet
 int getLast()
          Gets an entity ID from the last hop that this packet has traversed.
 int getNetServiceType()
          Gets the network service type of this packet
 long getSize()
          Returns the size of this packet
 int getSrcID()
          Returns the ID of the source of this packet.
 int getTag()
          Gets this packet tag
 void setLast(int last)
          Sets an entity ID from the last hop that this packet has traversed.
 void setNetServiceType(int serviceType)
          Sets the network service type of this packet.
 boolean setSize(long size)
          Sets the size of this packet
 String toString()
          Returns a string describing this packet in detail.
 

Method Detail

toString

public String toString()
Returns a string describing this packet in detail.

Returns:
description of this packet
Pre Condition:
$none
Post Condition:
$none

getSize

public long getSize()
Returns the size of this packet

Returns:
size of the packet
Pre Condition:
$none
Post Condition:
$none

setSize

public boolean setSize(long size)
Sets the size of this packet

Parameters:
size - size of the packet
Returns:
true if it is successful, false otherwise
Pre Condition:
size >= 0
Post Condition:
$none

getDestID

public int getDestID()
Returns the destination id of this packet.

Returns:
destination id
Pre Condition:
$none
Post Condition:
$none

getID

public int getID()
Returns the ID of this packet

Returns:
packet ID
Pre Condition:
$none
Post Condition:
$none

getSrcID

public int getSrcID()
Returns the ID of the source of this packet.

Returns:
source id
Pre Condition:
$none
Post Condition:
$none

getNetServiceType

public int getNetServiceType()
Gets the network service type of this packet

Returns:
the network service type
Pre Condition:
$none
Post Condition:
$none

setNetServiceType

public void setNetServiceType(int serviceType)
Sets the network service type of this packet.

By default, the service type is 0 (zero). It is depends on the packet scheduler to determine the priority of this service level.

Parameters:
serviceType - this packet's service type
Pre Condition:
serviceType >= 0
Post Condition:
$none

getLast

public int getLast()
Gets an entity ID from the last hop that this packet has traversed.

Returns:
an entity ID
Pre Condition:
$none
Post Condition:
$none

setLast

public void setLast(int last)
Sets an entity ID from the last hop that this packet has traversed.

Parameters:
last - an entity ID from the last hop
Pre Condition:
last > 0
Post Condition:
$none

getTag

public int getTag()
Gets this packet tag

Returns:
this packet tag
Pre Condition:
$none
Post Condition:
$none

GridSim
v3.1

The University of Melbourne, Australia, 2004