drcl.inet.transport
Class TCPPacket
java.lang.Object
|
+--drcl.DrclObj
|
+--drcl.net.Packet
|
+--drcl.inet.transport.TCPPacket
- All Implemented Interfaces:
- java.lang.Cloneable, ObjectDuplicable, PacketWrapper, java.io.Serializable
- public class TCPPacket
- extends Packet
This class defines the TCP packet header.
Fields implemented in this class are
SOURCE_port, DEST_port, SEQNo, ACKNo, AdvertisedWnd, ACK, SYN, FIN, SACK option,
timestamp option.
RFC requirements NOT implemented in this class are
URG, PSH, RST, TCP checksum, Urgent pointer, and other options
References:
- [TCPILL1] W. Stevens, TCP/IP Illustrated vol.1: The Protocols, Addison-Wesley,1994.
- [TCPILL2] G. Wright and W. Stevens, TCP/IP Illustrated vol.2: The Implementation, Addison-Wesley,1995
- [RFC793] J. Postel, Transmission Control Protocol, September 1981.
- [RFC2018] M. Mathis, J. Mahdavi, S. Floyd and A. Romanow, TCP Selective Acknowledgment Options, Octobor 1996.
- [RFC2581] M. Allman, V. Paxson and W. Stevens, TCP Congestion Control, April 1999.
- See Also:
- Serialized Form
|
Field Summary |
static int |
FLAG_ACK
|
static int |
FLAG_FIN
|
static int |
FLAG_SACK
|
static int |
FLAG_SYN
|
static long |
MSS
Size of maximum transmission unit, used to set/calculate packet count from sequence number. |
|
Constructor Summary |
TCPPacket()
|
TCPPacket(int sport_,
int dport_,
long Seqno_,
long AckNo_,
int AdvWin_,
boolean Ack_,
boolean SYN_,
boolean FIN_,
double ts_,
double ats_,
boolean sack_,
int sackLen_,
int hsize_,
int bsize_,
java.lang.Object body_)
Constructor for TCPPacket with SACK option. |
TCPPacket(int sport_,
int dport_,
long Seqno_,
long AckNo_,
int AdvWin_,
boolean Ack_,
boolean SYN_,
boolean FIN_,
double ts_,
double ats_,
int hsize_,
int bsize_,
java.lang.Object body_)
Constructor for TCPPacket without SACK option. |
| Methods inherited from class drcl.net.Packet |
equals, getBody, getHeaderSize, getPacketSize, setBody, setBody, setHeaderSize, setPacketSize, setSize, toString, toString, wraps |
| Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
MSS
public static long MSS
- Size of maximum transmission unit, used to set/calculate packet count from sequence number.
FLAG_ACK
public static final int FLAG_ACK
FLAG_SYN
public static final int FLAG_SYN
FLAG_FIN
public static final int FLAG_FIN
FLAG_SACK
public static final int FLAG_SACK
TCPPacket
public TCPPacket()
TCPPacket
public TCPPacket(int sport_,
int dport_,
long Seqno_,
long AckNo_,
int AdvWin_,
boolean Ack_,
boolean SYN_,
boolean FIN_,
double ts_,
double ats_,
int hsize_,
int bsize_,
java.lang.Object body_)
- Constructor for TCPPacket without SACK option.
- Parameters:
Seqno_ - Sequence number of dataAckNo_ - Acknowledge sequence numberAdvWin_ - Advertised windowAck_ - flag ACKSYN_ - flag SYNFIN_ - flag FINts_ - Timestampats_ - Ackknowledge Timestamphsize_ - header size, calculated by callerbsize_ - body sizebody_ - body
TCPPacket
public TCPPacket(int sport_,
int dport_,
long Seqno_,
long AckNo_,
int AdvWin_,
boolean Ack_,
boolean SYN_,
boolean FIN_,
double ts_,
double ats_,
boolean sack_,
int sackLen_,
int hsize_,
int bsize_,
java.lang.Object body_)
- Constructor for TCPPacket with SACK option.
- Parameters:
Seqno_ - Sequence number of dataAckNo_ - Acknowledge sequence numberAdvWin_ - Advertised windowAck_ - flag ACKSYN_ - flag SYNFIN_ - flag FINts_ - Timestampats_ - Ackknowledge Timestampsack_ - flag SACKsackLen_ - # of SACK blockshsize_ - header size, calculated by callerbsize_ - body sizebody_ - body
getName
public java.lang.String getName()
- Description copied from class:
Packet
- Returns the name of this packet.
- Overrides:
getName in class Packet
getPacketCount
public int getPacketCount()
- Description copied from class:
Packet
- Returns the count of this packet in the connection to which this packet belongs.
By default, it delegates the call to the encapsulated packet, and throws
a
PacketException if the encapsulated object is not a packet.
- Overrides:
getPacketCount in class Packet
getByteCount
public long getByteCount()
- Description copied from class:
Packet
- Returns the byte count of this packet in the connection to which this packet belongs.
By default, it delegates the call to the encapsulated packet, and throws
a
PacketException if the encapsulated object is not a packet.
This method approximates the byte count with the byte count obtained from
the encapsulated packet plus the header size times the packet count.
- Overrides:
getByteCount in class Packet
getDPort
public int getDPort()
getSPort
public int getSPort()
getTS
public double getTS()
setTS
public void setTS(double ts_)
getaTS
public double getaTS()
setaTS
public void setaTS(double aTS_)
setSeqNo
public void setSeqNo(long seqno_)
getSeqNo
public long getSeqNo()
getAckNo
public long getAckNo()
getAdvWin
public int getAdvWin()
setACK
public void setACK(boolean enabled_)
isACK
public boolean isACK()
setSYN
public void setSYN(boolean enabled_)
isSYN
public boolean isSYN()
setFIN
public void setFIN(boolean enabled_)
isFIN
public boolean isFIN()
setSACK
public void setSACK(boolean enabled_)
isSACK
public boolean isSACK()
getSACKLen
public int getSACKLen()
setSACKLen
public void setSACKLen(int len_)
getLEblk
public long[] getLEblk()
setLEblk
public void setLEblk(long[] LEblk_)
getREblk
public long[] getREblk()
setREblk
public void setREblk(long[] REblk_)
setSACKBlocks
public void setSACKBlocks(long[] LEblk_,
long[] REblk_)
clone
public java.lang.Object clone()
- Description copied from interface:
PacketWrapper
- Returns a clone of this wrapper instance.
- Overrides:
clone in class DrclObj
duplicate
public void duplicate(java.lang.Object source_)
- Description copied from class:
DrclObj
- opies the content of the
source_ object to this object.
he subclass must implement this method to realize DrclObj.clone().
- Overrides:
duplicate in class Packet
getPacketType
public java.lang.String getPacketType()
- Description copied from class:
Packet
- Returns the type of packet.
By default, it delegates the call to the encapsulated packet, and
returns
Packet.getName() otherwise.
- Overrides:
getPacketType in class Packet
_toString
public java.lang.String _toString(java.lang.String separator_)
- Description copied from class:
Packet
- Prints the packet header.
- Overrides:
_toString in class Packet
Copyright © 2001 - DRCL, OSU ~ Back to JavaSim Home ~