|
DRCL J-Sim API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectdrcl.DrclObj
drcl.comp.Component
drcl.net.Module
drcl.inet.Protocol
drcl.inet.transport.TCP
This component implements the single-session sender TCP. Only one TCP session is handled in this component. Open and close of the connection is not implemented, nor is the 3-way handshaking.
Several variants of TCP are implemented: Tahoe, Reno, New-Reno ([Fall96])
and Vegas ([Brakmo95]).
Each can be used with the SACK option. Currently only New-Reno takes advantage
of the SACK blocks in an ACK.
To specify the implementation, use setImplementation(String)
with "Tahoe", "Reno", "New-Reno" or "Vegas" as argument.
To enable SACK, use setSackEnabled(boolean).
The initial sequence number is set as 0, instead of a random value suggestted in [TCPILL2]
For Tahoe and Reno, the RTT and RXT timer base estimation is based on
[TCPILL2]. The sending time of a segment is recorded as ts_
in the TCP header (similar to the timestamp option in the real TCP header)
and returned by the corresponding acknowledgment packet.
ts_ is set to -1 if the segment is
a retransmitted one, so no RTT estimation is performed
for retransmitted segments. The algorithm is described in [RFC793] and
[TCPILL1].
SampleRTT = current time - ts_;
SmoothedRTT[new] = 7/8*SmoothedRTT[old] + 1/8*SampleRTT;
Delta = |SampleRTT - SmoothedRTT[old]|;
RTTVariance[new] = 3/4*RTTVariance[old] + 1/4*Delta;
and the retransmission timer base is
RTO[new] = SmoothedRTT[new] + 4*RTTVariance[new].
The exception is that for the first acknowledgment received:
SampleRTT = current time - ts_;
SmoothedRTT[new] = SampleRTT;
RTTVariance[new] = SampleRTT/2;
and the retransmission timer base is
RTO[new] = SmoothedRTT[new] + 4*RTTVariance[new].
Additional usage infomation:
setMaxburstEnabled(boolean).
This option restricts the maximum number of bytes that can be sent in
response to a single ACK to be one segment during Reno-style fast recovery,
and two segments otherwise. This is based on [RFC2018] and is different
from similar setting in [Fall96].
For Vegas, only two segments restriction applies since Vegas does not have
fast recovery.
setTTL(int).
setMSS(int).
setTick(double).
References:
TCPPacket,
TCPSink,
Serialized Form| Nested Class Summary | |
static class |
TCP.VegasVariables
Stores variables for implementing TCP-VEGAS. |
| Nested classes inherited from class drcl.comp.Component |
Component.Locks |
| Field Summary | |
static int |
AWND_DEFAULT
Default advertisement window size (unit of MSS bytes). |
static int |
DEBUG_ACK
|
static int |
DEBUG_DUPACK
|
static java.lang.String[] |
DEBUG_LEVELS
|
static int |
DEBUG_RTT
|
static int |
DEBUG_SACK
|
static int |
DEBUG_SAMPLE
|
static int |
DEBUG_SEND
|
static int |
DEBUG_TIMEOUT
|
static int |
DEBUG_VEGAS
|
static int |
INIT_SS_THRESHOLD
Initial slow-start threshold (unit of MSS bytes). |
static int |
MAXCWND_DEFAULT
Default maximum congestion window size (unit of MSS bytes). |
static boolean |
NS_COMPATIBLE
Sets to true to make TCP ns compatible |
static int |
NUMDUPACKS
Number of duplicate ACKs to trigger fast RXT as specified in [RFC2581] (for Reno, Tahoe). |
int |
state
FSM State of this TCP component. |
| Fields inherited from class drcl.net.Module |
downPort, PortGroup_DOWN, PortGroup_UP, upPort |
| Fields inherited from interface drcl.inet.transport.TCPConstants |
ACK_EVENT, ACK_PORT_ID, CLOSE_WAIT, CLOSED, CLOSING, CWND_EVENT, CWND_PORT_ID, DEFAULT_PID, DELAY_ACK, ESTABLISHED, ESTABLISHED_FIN, ESTABLISHED_OVER, FIN_WAIT_1, FIN_WAIT_2, LAST_ACK, LISTEN, LISTEN1, LISTEN2, NEW_RENO, PRE_CLOSED, PRE_LAST_ACK, PRE_SYN_SENT, RECEIVE, RENO, RTT_EVT, RTTVAR_EVENT, RTTVAR_PORT_ID, RXT_EVT, SEND, SEQNO_EVENT, SEQNO_PORT_ID, SEQNO_RCV_EVENT, SEQNO_RCV_PORT_ID, SEQNO_SENT_EVENT, SEQNO_SENT_PORT_ID, SRTT_EVENT, SRTT_PORT_ID, SST_EVENT, SST_PORT_ID, STATES, SYN_RCVD, SYN_SENT, TAHOE, TIME_WAIT, TIMEOUT_TYPES, VEGAS |
| Constructor Summary | |
TCP()
|
|
TCP(java.lang.String id_)
|
|
| Method Summary | |
java.lang.String |
configInfo()
|
void |
configureRTT(double tick_,
double srtt_init_,
double rttvar_init_,
double basertt_init_,
double maxrto_)
Configures RTT parameters. |
void |
duplicate(java.lang.Object source_)
Duplicates the content of source_, including ID, name, child components and connections among them, to this component. |
double |
getBASERTT_INIT()
Returns the initial value of baseRTT (in second). |
java.lang.String[] |
getDebugLevelNames()
Returns the names of defined debug levels; subclasses should override this method if debug levels are defined. |
java.lang.String |
getImplementation()
|
long |
getLocalAddr()
Returns the local address. |
int |
getLocalPort()
Returns the local port. |
int |
getMAXCWND()
|
double |
getMAXRTO()
Returns the maximum retr timeout (in second). |
int |
getMSS()
|
java.lang.String |
getName()
Returns the (informational) name of the component. |
long |
getNumBytesRetransmitted()
Returns # of bytes retransmitted. |
int |
getNumTimeouts()
Returns # of coarse-grained timeouts. |
long |
getPeer()
Returns the peer address. |
int |
getRemotePort()
Returns the peer port. |
double |
getRTTVAR_INIT()
Returns the initial value of rttvar (in second). |
double |
getSRTT_INIT()
Returns the initial value of srtt (in second). |
int |
getState()
|
double |
getTick()
|
int |
getTTL()
|
java.lang.String |
info()
Returns information regarding this component. |
boolean |
isMaxburstEnabled()
|
boolean |
isSackEnabled()
|
void |
reset()
Resets the component for being used anew. |
void |
setBASERTT_INIT(double v_)
Sets the initial value of baseRTT (in second). |
void |
setImplementation(java.lang.String impl_)
|
void |
setMaxburstEnabled(boolean maxburst_)
|
void |
setMAXCWND(int max_)
|
void |
setMAXRTO(double v_)
Sets the maximum retr timeout (in second). |
void |
setMSS(int mss)
Sets the maximum segment size. |
void |
setPeer(long peer_)
|
void |
setRTTVAR_INIT(double v_)
Sets the initial value of rttvar (in second). |
void |
setSackEnabled(boolean sack_)
|
void |
setSRTT_INIT(double v_)
Sets the initial value of srtt (in second). |
void |
setTick(double tick_)
Sets the clock tick for RTT estimation. |
void |
setTTL(int ttl)
|
| Methods inherited from class drcl.net.Module |
cancelTimeout, setTimeout, setTimeoutAt |
| Methods inherited from class drcl.DrclObj |
clone |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static boolean NS_COMPATIBLE
public static int AWND_DEFAULT
public static int MAXCWND_DEFAULT
public static int INIT_SS_THRESHOLD
public static int NUMDUPACKS
public static final java.lang.String[] DEBUG_LEVELS
public static final int DEBUG_ACK
public static final int DEBUG_DUPACK
public static final int DEBUG_SEND
public static final int DEBUG_TIMEOUT
public static final int DEBUG_RTT
public static final int DEBUG_SACK
public static final int DEBUG_SAMPLE
public static final int DEBUG_VEGAS
public transient int state
| Constructor Detail |
public TCP()
public TCP(java.lang.String id_)
| Method Detail |
public java.lang.String[] getDebugLevelNames()
Component
getDebugLevelNames in class Componentpublic java.lang.String getName()
Component
getName in class Componentpublic void reset()
Component
reset in class Componentpublic void duplicate(java.lang.Object source_)
Component
duplicate in interface ObjectDuplicableduplicate in class Protocolpublic int getState()
public void setPeer(long peer_)
public long getPeer()
drcl.inet.transport.Connection
getPeer in interface drcl.inet.transport.Connectionpublic void setTTL(int ttl)
public int getTTL()
public void setMSS(int mss)
public int getMSS()
public void setMAXCWND(int max_)
public int getMAXCWND()
public void setTick(double tick_)
public double getTick()
public void setSRTT_INIT(double v_)
public double getSRTT_INIT()
public void setRTTVAR_INIT(double v_)
public double getRTTVAR_INIT()
public void setBASERTT_INIT(double v_)
public double getBASERTT_INIT()
public void setMAXRTO(double v_)
public double getMAXRTO()
public long getNumBytesRetransmitted()
public int getNumTimeouts()
public void configureRTT(double tick_,
double srtt_init_,
double rttvar_init_,
double basertt_init_,
double maxrto_)
tick_ - time unit for RTT variables.srtt_init_ - initial value of srtt.rttvar_init_ - initial value of rttvar.basertt_init_ - initial value of baseRTT.maxrto_ - maximum retrx timeout.public void setImplementation(java.lang.String impl_)
public java.lang.String getImplementation()
public void setSackEnabled(boolean sack_)
public boolean isSackEnabled()
public void setMaxburstEnabled(boolean maxburst_)
public boolean isMaxburstEnabled()
public int getLocalPort()
drcl.inet.transport.Connection
getLocalPort in interface drcl.inet.transport.Connectionpublic int getRemotePort()
drcl.inet.transport.Connection
getRemotePort in interface drcl.inet.transport.Connectionpublic long getLocalAddr()
drcl.inet.transport.Connection
getLocalAddr in interface drcl.inet.transport.Connectionpublic java.lang.String info()
Component
info in class Componentpublic java.lang.String configInfo()
|
DRCL J-Sim API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||