All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class network.NetworkPacket

java.lang.Object
   |
   +----link.LinkPacket
           |
           +----network.NetworkPacket

public class NetworkPacket
extends LinkPacket
The extra data carried by a network-level packet. This extends the LinkPacket structure in the link package, from which it inherits the field
   public byte[] data;
The network level adds addressing. NetworkPacket is extended by the reliability layer with sequence numbers and control bits.

Like all packets, NetworkPacket implements a toString for use by packet tracing.

While you are programming in the network level, feel free to add reasonable fields here.

See Also:
LinkPacket

Variable Index

 o destinationAddr
Address of the packet's intended recipient
 o sourceAddr
Address of the packet's sender
 o timeToLive
Maximum number of hops before this packet dies

Constructor Index

 o NetworkPacket()
Constructor for some default setup.

Method Index

 o toString()
Make a string for packet trace messages.

Variables

 o sourceAddr
 public Address sourceAddr
Address of the packet's sender

 o destinationAddr
 public Address destinationAddr
Address of the packet's intended recipient

 o timeToLive
 public int timeToLive
Maximum number of hops before this packet dies

Constructors

 o NetworkPacket
 public NetworkPacket()
Constructor for some default setup. The defaults are

Methods

 o toString
 public String toString()
Make a string for packet trace messages. Should be short

Overrides:
toString in class LinkPacket

All Packages  Class Hierarchy  This Package  Previous  Next  Index