|
GridSim 5.0 beta | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectFlowPacket
public class FlowPacket
Structure of a packet used to encapsulate flow passing through the network.
| Constructor Summary | |
|---|---|
FlowPacket(Object data,
int pktID,
long size,
int tag,
int srcID,
int destID)
Constructs a network flow for data that fits into a single network flow packet. |
|
FlowPacket(Object data,
int pktID,
long size,
int tag,
int srcID,
int destID,
int netServiceType,
int pktNum,
int totalPkts)
This is used to construct a flow that is one in a series. |
|
| Method Summary | |
|---|---|
void |
addBaudRate(Link link)
Adds baud rate of current link, and sets bottleneck bandwidth and ID if the link is this flow's bottleneck |
void |
addLatency(double latency)
Adds to the current sum of latency over the path from source to dest. |
void |
addLink(Link link)
Adds current link, and calls addBaudRate() and addLatency() |
double |
getBandwidth()
Returns the current bottleneck bandwidth of this flow. |
int |
getBottleneckID()
Returns the FlowLink ID of the bottleneck of this flow |
Object |
getData()
Returns the data encapsulated in this FlowPacket |
int |
getDestID()
Returns the destination ID of this flow packet |
int |
getID()
Returns the ID of this packet |
int |
getLast()
Returns the ID of the last hop that this flow packet traversed. |
double |
getLatency()
Returns the current sum of latency over the path from source to dest. |
Vector |
getLinks()
Returns a vector of links that make up this flow's path |
int |
getNetServiceType()
Returns the class type of this flow packet. |
int |
getPacketNum()
Returns the serial number of this flow packet. |
long |
getRemSize()
Returns the remaining size of a flow |
long |
getSize()
Gets the size of this flow packet |
int |
getSrcID()
Returns the source ID of this packet. |
double |
getStartTime()
Returns the current start time of this flow. |
int |
getTag()
Returns the tag associated originally with data that was encapsulated in this flow packet. |
int |
getTotalPackets()
Returns the total number of flow packets in this stream. |
double |
getUpdateTime()
Returns the last time a flow was updated (i.e. |
void |
setBandwidth(double bandwidth_)
Sets the current bottleneck bandwidth of this flow. |
void |
setBottleneckID(int bottleneckID)
Sets the FlowLink ID of the bottleneck of this flow param bottleneckID the ID of the bottleneck FlowLink |
void |
setData(Object data)
Modifies the data encapsulated in this FlowPacket. |
void |
setDestID(int id)
Sets the destination id of this flow packet |
void |
setLast(int last)
Sets the last hop that this FlowPacket traversed. |
void |
setLatency(double latency)
Sets the current latency over the path from source to dest. |
void |
setNetServiceType(int netServiceType)
Sets the network class type of this flow packet, so that it can receive differentiated services. |
void |
setRemSize(long remSize)
Sets the remaining size of a flow param remSize the remaining size of a flow |
boolean |
setSize(long size)
Sets the packet size |
void |
setSrcID(int srcID)
Sets the source ID for a FlowPacket param srcID the id of the source of this flow |
void |
setStartTime(double startTime)
Sets the current start time of this flow. |
void |
setTag(int tag)
Sets the tag of this packet |
void |
setUpdateTime(double updateTime)
Sets the last time a flow was updated (i.e. |
String |
toString()
Returns a description of this flow |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public FlowPacket(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 FlowPacket(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 PackettoString in class Objectpublic Object getData()
public int getSrcID()
getSrcID in interface Packetpublic int getID()
getID in interface Packetpublic void setData(Object data)
data - the packet's datapublic long getSize()
getSize in interface Packetpublic boolean setSize(long size)
setSize in interface Packetsize - the flow packet size
public int getTag()
getTag in interface Packetpublic int getDestID()
getDestID in interface Packetpublic void setDestID(int id)
id - the destination idpublic void setLast(int last)
setLast in interface Packetlast - the entity ID from the last hoppublic int getLast()
getLast in interface Packetpublic void setNetServiceType(int netServiceType)
setNetServiceType in interface PacketnetServiceType - a network service typepublic int getNetServiceType()
getNetServiceType in interface Packetpublic int getPacketNum()
public int getTotalPackets()
public double getLatency()
public void setLatency(double latency)
public void addLatency(double latency)
latency - the latency of a given linkpublic void addBaudRate(Link link)
link - a given linkpublic double getBandwidth()
public void setBandwidth(double bandwidth_)
public void addLink(Link link)
link - a given linkpublic double getStartTime()
public void setStartTime(double startTime)
startTime - the time a flow begins holding at the destinationpublic double getUpdateTime()
public void setUpdateTime(double updateTime)
updateTime - the time a flow's forecast was last updatedpublic long getRemSize()
public void setRemSize(long remSize)
public Vector getLinks()
public int getBottleneckID()
public void setBottleneckID(int bottleneckID)
public void setSrcID(int srcID)
public void setTag(int tag)
tag - the packet's tag
|
GridSim 5.0 beta | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||