edu.gwu.simplenetsim
Class NetworkPacket

java.lang.Object
  extended by edu.gwu.simplenetsim.NetsimPacket
      extended by edu.gwu.simplenetsim.NetworkPacket

public class NetworkPacket
extends NetsimPacket

This class contains all the packet info for a network-level packet, including the whole transport-packet. There are a number of public fields, all of which are typical in network layers.

See Also:
NetsimPacket

Field Summary
 java.lang.String controlInfo
          The control payload.
 TransportPacket data
          The payload.
 int dest
          Where it needs to go.
 boolean isControl
          Is this a control packet, generated solely by and used by network layers?
 int seqnum
          Sequence numbers.
 int src
          Where it came from.
 int timeToLive
          Long-lived packets are often assumed to be useless and are discarded.
 
Fields inherited from class edu.gwu.simplenetsim.NetsimPacket
CIRCLE, IDCount, SQUARE
 
Constructor Summary
NetworkPacket(int src, int dest, java.lang.String controlInfo)
          The constructor for control packets.
NetworkPacket(int src, int dest, TransportPacket data)
          The constructor for regular packets.
 
Method Summary
 java.lang.String toString()
          For debugging.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

src

public int src
Where it came from.


dest

public int dest
Where it needs to go.


data

public TransportPacket data
The payload.


isControl

public boolean isControl
Is this a control packet, generated solely by and used by network layers?


controlInfo

public java.lang.String controlInfo
The control payload.


seqnum

public int seqnum
Sequence numbers.


timeToLive

public int timeToLive
Long-lived packets are often assumed to be useless and are discarded.

Constructor Detail

NetworkPacket

public NetworkPacket(int src,
                     int dest,
                     TransportPacket data)
The constructor for regular packets.

Parameters:
src - an int value
dest - an int value
data - a TransportPacket value

NetworkPacket

public NetworkPacket(int src,
                     int dest,
                     java.lang.String controlInfo)
The constructor for control packets.

Parameters:
src - an int value
dest - an int value
controlInfo - a String value
Method Detail

toString

public java.lang.String toString()
For debugging.

Overrides:
toString in class java.lang.Object
Returns:
a String value