|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object InfoPacket
public class InfoPacket
InfoPacket class can be used to gather information from the network layer.
An InfoPacket traverses the network topology similar to a
NetPacket
,
but it collects information like bandwidths, and Round Trip Time etc. It is
the equivalent of ICMP in physical networks.
You can set all the parameters to an InfoPacket that can be applied to a NetPacket. So if you want to find out the kind of information that a particular type of NetPacket is experiencing, set the size and network class of an InfoPacket to the same as the NetPacket, and send it to the same destination from the same source.
Constructor Summary | |
---|---|
InfoPacket(String name,
int packetID,
long size,
int srcID,
int destID,
int netServiceType)
Constructs a new Information packet. |
Method Summary | |
---|---|
void |
addBaudRate(double baudRate)
Every entity that the InfoPacket traverses should add the baud rate of the link on which this packet will be sent out next. |
void |
addEntryTime(double time)
This method should be called by routers and other entities when this InfoPacket reaches them along with the current simulation time. |
void |
addExitTime(double time)
This method should be called by routers and other entities when this InfoPacket is leaving them. |
void |
addHop(int id)
This method should be called by network entities that count as hops, for e.g. |
double |
getBaudRate()
Returns the bottleneck bandwidth between the source and the destination |
int |
getDestID()
Gets the id of the entity to which the packet is destined. |
Object[] |
getDetailBaudRate()
Returns the list of all the bandwidths that this packet has traversed |
Object[] |
getDetailEntryTimes()
Returns the list of all entry time that this packet has traversed. |
Object[] |
getDetailExitTimes()
Returns the list of all exit time that this packet has traversed. |
Object[] |
getDetailHops()
Returns the list of all the hops that this packet has traversed. |
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 |
int |
getNumHop()
Returns the number of hops that this packet has traversed. |
long |
getOriginalPingSize()
Gets original size of ping request |
long |
getSize()
Gets the size of this packet. |
int |
getSrcID()
Gets the id of the entity that sent out this packet |
int |
getTag()
Gets this packet tag |
double |
getTotalResponseTime()
Gets the total time that this packet has spent in the network. |
void |
setDestID(int id)
Sets the destination ID for this packet |
void |
setLast(int last)
Sets an entity ID from the last hop that this packet has traversed. |
void |
setNetServiceType(int netServiceType)
Sets the network service type of this packet |
void |
setOriginalPingSize(long size)
Sets original size of ping request |
boolean |
setSize(long size)
Sets the size of this packet |
boolean |
setTag(int tag)
Sets the tag of this packet |
String |
toString()
Returns a human-readable information of this packet. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public InfoPacket(String name, int packetID, long size, int srcID, int destID, int netServiceType)
name
- Name of this packetpacketID
- The ID of this packetsize
- size of the packetsrcID
- The ID of the entity that sends out this packetdestID
- The ID of the entity to which this packet is destinednetServiceType
- the class of traffic this packet belongs toMethod Detail |
---|
public int getID()
getID
in interface Packet
public void setOriginalPingSize(long size)
size
- ping data size (in bytes)public long getOriginalPingSize()
public String toString()
toString
in interface Packet
toString
in class Object
public long getSize()
getSize
in interface Packet
public boolean setSize(long size)
setSize
in interface Packet
size
- size of the packet
public int getDestID()
getDestID
in interface Packet
public int getSrcID()
getSrcID
in interface Packet
public int getNumHop()
public double getTotalResponseTime()
RTT is taken as the final entry time - first exit time.
public double getBaudRate()
public void addHop(int id)
id
- the id of the hop that this InfoPacket is traversingpublic void addEntryTime(double time)
time
- current simulation time, use
GridSim.clock()
to obtain thispublic void addExitTime(double time)
time
- current simulation time, use
GridSim.clock()
to obtain thispublic void addBaudRate(double baudRate)
baudRate
- the entity's baud rate in bits/spublic Object[] getDetailBaudRate()
public Object[] getDetailHops()
public Object[] getDetailEntryTimes()
public Object[] getDetailExitTimes()
public int getLast()
getLast
in interface Packet
public void setLast(int last)
setLast
in interface Packet
last
- an entity ID from the last hoppublic int getNetServiceType()
getNetServiceType
in interface Packet
public void setNetServiceType(int netServiceType)
setNetServiceType
in interface Packet
netServiceType
- the packet's network service typepublic int getTag()
getTag
in interface Packet
public boolean setTag(int tag)
tag
- the packet's tag
public void setDestID(int id)
id
- this packet's destination ID
|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |