|
GridSim v3.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Objectgridsim.net.NetPacket
Structure of a packet used to encapsulate data passing through the network.
Constructor Summary | |
NetPacket(Object data,
int pktID,
long size,
int tag,
int srcID,
int destID)
Constructs a network packet for data that fits into a single network packet. |
|
NetPacket(Object data,
int pktID,
long size,
int tag,
int srcID,
int destID,
int netServiceType,
int pktNum,
int totalPkts)
This is used to construct a packet that is one in a series. |
Method Summary | |
Object |
getData()
Returns the data encapsulated in this NetPacket |
int |
getDestID()
Returns the destination ID of this packet |
int |
getID()
Returns the ID of this packet |
int |
getLast()
Returns the ID of the last hop that this packet traversed. |
int |
getNetServiceType()
Returns the class type of this packet. |
int |
getPacketNum()
Returns the serial number of this packet. |
long |
getSize()
Gets the size of this packet |
int |
getSrcID()
Returns the source ID of this packet. |
int |
getTag()
Returns the tag associated originally with data that was encapsulated in this packet. |
int |
getTotalPackets()
Returns the total number of packets in this stream. |
void |
setData(Object data)
Modifies the data encapsulated in this NetPacket. |
void |
setDestID(int id)
Sets the destination id of this packet |
void |
setLast(int last)
Sets the last hop that this NetPacket traversed. |
void |
setNetServiceType(int netServiceType)
Sets the network class type of this packet, so that it can receive differentiated services. |
boolean |
setSize(long size)
Sets the packet size |
String |
toString()
Returns a description of this packet |
Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public NetPacket(Object data, int pktID, long size, int tag, int srcID, int destID)
data
- The data to be encapsulated.pktID
- The ID of this packetsize
- The size of the data (in bytes)tag
- The original tag which was used with the data, its
reapplied when the data is extracted from the NetPacket.srcID
- The id of the entity where the packet was created.destID
- The destination to which the packet has to be sent.public NetPacket(Object data, int pktID, long size, int tag, int srcID, int destID, int netServiceType, int pktNum, int totalPkts)
data
- The data to be encapsulated.pktID
- The ID of this packetsize
- The size of the data (in bytes)tag
- The original tag which was used with the data, its
reapplied when the data is extracted from the NetPacket.srcID
- The id of the entity where the packet was created.destID
- The destination to which the packet has to be sent.netServiceType
- the network class type of this packetpktNum
- The packet number of this packet in its series. If there
are 10 packets, they should be numbered from 1 to 10.totalPkts
- The total number of packets that the original data was
split into. This is used by the receiver to confirm that
all packets have been received.Method Detail |
public String toString()
toString
in interface Packet
public Object getData()
public int getSrcID()
getSrcID
in interface Packet
public int getID()
getID
in interface Packet
public void setData(Object data)
data
- the packet's datapublic long getSize()
getSize
in interface Packet
public boolean setSize(long size)
setSize
in interface Packet
size
- the packet size
public int getTag()
getTag
in interface Packet
public int getDestID()
getDestID
in interface Packet
public void setDestID(int id)
id
- the destination idpublic void setLast(int last)
setLast
in interface Packet
last
- the entity ID from the last hoppublic int getLast()
getLast
in interface Packet
public void setNetServiceType(int netServiceType)
setNetServiceType
in interface Packet
netServiceType
- a network service typepublic int getNetServiceType()
getNetServiceType
in interface Packet
public int getPacketNum()
public int getTotalPackets()
|
GridSim v3.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |