edu.gwu.simplenetsim
Class TransportPacket

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

public class TransportPacket
extends NetsimPacket

This is the packet that is handled by the transport layer and, for simplicity, the application layer as well. Fields can be set by the constructor or directly.

See Also:
NetsimPacket

Field Summary
 int connID
          The connection identifier.
 java.lang.String data
          The payload is a string.
 int dest
          Destination node ID.
 int portNum
          Receiving port number.
 int seqnum
          Sequence numbers are used by protocols.
 int src
          Source node ID.
 
Fields inherited from class edu.gwu.simplenetsim.NetsimPacket
CIRCLE, IDCount, SQUARE
 
Constructor Summary
TransportPacket()
          Optional empty constructor.
TransportPacket(int connID, int src, int dest, int portNum, java.lang.String data)
          Constructor: Creates a new TransportPacket instance.
 
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

connID

public int connID
The connection identifier.


src

public int src
Source node ID.


dest

public int dest
Destination node ID.


data

public java.lang.String data
The payload is a string.


seqnum

public int seqnum
Sequence numbers are used by protocols.


portNum

public int portNum
Receiving port number. This is currently being used only by the webserver.

Constructor Detail

TransportPacket

public TransportPacket(int connID,
                       int src,
                       int dest,
                       int portNum,
                       java.lang.String data)
Constructor: Creates a new TransportPacket instance.

Parameters:
connID - an int value
src - an int value
dest - an int value
portNum - an int value
data - a String value

TransportPacket

public TransportPacket()
Optional empty constructor.

Method Detail

toString

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

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