public class InfoPacket extends java.lang.Object implements Packet
gridsim.net.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 and Description |
|---|
InfoPacket(java.lang.String name,
int packetID,
long size,
int srcID,
int destID,
int netServiceType)
Constructs a new Information packet.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
java.lang.Object[] |
getDetailBaudRate()
Returns the list of all the bandwidths that this packet has traversed.
|
java.lang.Object[] |
getDetailEntryTimes()
Returns the list of all entry time that this packet has traversed.
|
java.lang.Object[] |
getDetailExitTimes()
Returns the list of all exit time that this packet has traversed.
|
java.lang.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.
|
java.lang.String |
toString()
Returns a human-readable information of this packet.
|
public InfoPacket(java.lang.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 topublic int getId()
public void setOriginalPingSize(long size)
size - ping data size (in bytes)public long getOriginalPingSize()
public java.lang.String toString()
public long getSize()
public boolean setSize(long size)
public int getDestId()
public int getSrcId()
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.CloudSim#clock() to obtain thispublic void addExitTime(double time)
time - current simulation time, use gridsim.CloudSim#clock() to obtain thispublic void addBaudRate(double baudRate)
baudRate - the entity's baud rate in bits/spublic java.lang.Object[] getDetailBaudRate()
public java.lang.Object[] getDetailHops()
public java.lang.Object[] getDetailEntryTimes()
public java.lang.Object[] getDetailExitTimes()
public int getLast()
public void setLast(int last)
public int getNetServiceType()
getNetServiceType in interface Packetpublic void setNetServiceType(int netServiceType)
setNetServiceType in interface PacketnetServiceType - the packet's network service typepublic int getTag()
public boolean setTag(int tag)
tag - the packet's tagpublic void setDestId(int id)
id - this packet's destination ID