public class SenderStateSlowStart extends SenderState
after3xDupACKstate, congestionAvoidanceState, sender, slowStartState
Constructor and Description |
---|
SenderStateSlowStart(Sender sender,
SenderState congestionAvoidanceState,
SenderState after3xDupACKstate)
Constructor for the slow start state of a TCP sender.
|
Modifier and Type | Method and Description |
---|---|
protected int |
calcCongWinAfterNewAck(int ackSequenceNumber_,
int lastByteAcked_)
Helper method to calculate the new value of the congestion
window after a "new ACK" is received that acknowledges
data never acknowledged before.
|
protected SenderState |
lookupNextStateAfterNewAck()
Helper method to look-up the next state
that the sender will transition to after this one.
|
(package private) void |
setAfter3xDupACKstate(SenderState after3xDupACKstate)
Same as for
setCongestionAvoidanceState(SenderState) |
(package private) void |
setCongestionAvoidanceState(SenderState congestionAvoidanceState)
The reason for this method is that the constructors TCPSenderStateSlowStart
and TCPSenderStateCongestionAvoidance need each other, so one has to be
created first, and then the other will be set using this method.
Thus package visibility only. |
handleDupACK, handleNewACK, handleRTOtimeout
public SenderStateSlowStart(Sender sender, SenderState congestionAvoidanceState, SenderState after3xDupACKstate)
sender
- congestionAvoidanceState
- after3xDupACKstate
- protected int calcCongWinAfterNewAck(int ackSequenceNumber_, int lastByteAcked_)
During recovery from a segment loss, the sender limits the number of
segments sent in response to each ACK to two segments during slow-start.
Therefore, cumulative ACKs for segments sent before the loss was
detected count the same as individual ACKs towards increasing CongWin.
(The limit during Reno-style fast recovery is one segment,
SenderStateFastRecovery.calcCongWinAfterNewAck(int, int)
).
calcCongWinAfterNewAck
in class SenderState
ackSequenceNumber_
- acknowledged data sequence numberlastByteAcked_
- last byte previously acknowledgedprotected SenderState lookupNextStateAfterNewAck()
lookupNextStateAfterNewAck
in class SenderState
void setAfter3xDupACKstate(SenderState after3xDupACKstate)
setCongestionAvoidanceState(SenderState)
after3xDupACKstate
- the after3xDupACKstate to setvoid setCongestionAvoidanceState(SenderState congestionAvoidanceState)
congestionAvoidanceState
- The congestion avoidance state to set