|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectyass.packet.Packet
public class Packet
Represents a data packet which traverses the simulated network
| Field Summary | |
|---|---|
protected double |
creationTimestamp
The time at which this packet was created |
protected double |
deadline
The time by which this packet must arrive at its destination to be useful |
protected Node |
destination
Eventual destination node of this packet |
protected int |
headerSize
Size of this packet's header, in bits |
protected int |
id
Globally-unique ID for this packet |
protected java.lang.Object |
payload
Packet payload |
protected int |
payloadSize
Size of this packet's payload, in bits |
protected java.util.Set<Node> |
proposedNextHops
The intended next-hop nodes for the next transmission of this packet |
protected Route |
route
Route traversed thus far by this packet |
protected int |
size
Total size of this packet, in bits |
protected Node |
source
Source node of this packet |
protected int |
ttl
Remaining packet TTL in network hops |
protected PacketType |
type
The type of data encapsulated by this packet |
| Constructor Summary | |
|---|---|
protected |
Packet()
No-args constructor to implement initialisation common to all Packet instances. |
|
Packet(int id,
Node source,
Node destination,
int headerSize,
int payloadSize,
java.lang.Object payload,
java.util.Set<Node> proposedNextHops,
double deadline,
double creationTimestamp,
int ttl,
PacketType type)
Constructs a new instance of Packet. |
| Method Summary | |
|---|---|
void |
appendToTrace(Node node)
Appends an additional node to the existing node-traversal trace |
Packet |
copy()
Copies this packet, supplying an object representing a distinct instance of the same packet. |
int |
decrementTtl()
Reduces the TTL by 1, and return the new TTL |
boolean |
equals(java.lang.Object o)
Determines if the supplied arbitrary object is equal to this Packet |
double |
getCreationTimestamp()
Obtains the simulation-global time at which the packet was created |
double |
getDeadline()
Obtains the packet delivery deadline |
Node |
getDestination()
Obtains the destination node for this packet |
int |
getHeaderSize()
Obtains the header size, in bits |
int |
getId()
Obtains the globally-unique identifier for this packet |
java.lang.Object |
getPayload()
Obtains the payload attached to this packet |
int |
getPayloadSize()
Obtains the payload size, in bits |
java.util.Set<Node> |
getProposedNextHops()
Obtains the set of proposed next-hop nodes for the next transmission of this packet |
Route |
getRoute()
Obtains the route traversed thus far by this packet |
int |
getSize()
Obtains the total size of this packet, in bits |
Node |
getSource()
Obtains the source node for this packet |
int |
getTtl()
Obtains the remaining TTL in network hops |
PacketType |
getType()
Obtains the type of this packet |
int |
hashCode()
Obtains a hashcode value for this Packet |
void |
setDestination(Node destination)
Sets the packet destination to the supplied node |
java.lang.String |
toString()
Obtains a textual representation of this packet |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected int id
protected int size
protected int headerSize
protected int payloadSize
protected Node source
protected Node destination
protected Route route
protected java.lang.Object payload
protected java.util.Set<Node> proposedNextHops
protected double deadline
protected double creationTimestamp
protected int ttl
protected PacketType type
| Constructor Detail |
|---|
protected Packet()
public Packet(int id,
Node source,
Node destination,
int headerSize,
int payloadSize,
java.lang.Object payload,
java.util.Set<Node> proposedNextHops,
double deadline,
double creationTimestamp,
int ttl,
PacketType type)
Packet. Subclasses are
responsible for overriding this operation if necessary and returning an
object of appropriate type, but this return type will always implement
the interface of Packet.
ttl - the number of remaining permitted node-node hops forid - globally-unique ID for this packetsource - source node of this packetdestination - eventual destination node of this packetpayload - packet payloadproposedNextHops - intended next-hop nodes for the next transmission
of this packetdeadline - the time by which this packet must arrive at its
destination to be considered usefulcreationTimestamp - the simulation-global time at which the packet
was created, not the node-local time at which the node thinks it created
the packetheaderSize - header size, in bitspayloadSize - payload size, in bitstype - the packet type| Method Detail |
|---|
public Packet copy()
public void appendToTrace(Node node)
node - the node to append to the existing tracepublic int decrementTtl()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objecto - the object against which a test of equality is to be applied
public java.lang.String toString()
toString in class java.lang.Objectpublic int getId()
public int getSize()
public int getHeaderSize()
public int getPayloadSize()
public Node getSource()
public Node getDestination()
public void setDestination(Node destination)
destination - the new destinationpublic Route getRoute()
public java.util.Set<Node> getProposedNextHops()
public java.lang.Object getPayload()
public double getDeadline()
public double getCreationTimestamp()
public int getTtl()
public PacketType getType()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||