GridSim 5.0 beta

gridsim.net
Interface Packet

All Known Implementing Classes:
FlowPacket, FnbDroppedUserObject, FnbNetPacket, InfoPacket, NetPacket

public interface Packet

This class contains the structure for a network packet.

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

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

Overrides:
toString in class Object
Returns:
description of this packet
Pre Condition:
$none
Post Condition:
$none

getSize

long getSize()
Returns the size of this packet

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

setSize

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

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

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

getID

int getID()
Returns the ID of this packet

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

getSrcID

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

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

getNetServiceType

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

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

setNetServiceType

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

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

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

int getTag()
Gets this packet tag

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

GridSim 5.0 beta

The University of Melbourne, Australia, 2009