public abstract class SenderState
extends java.lang.Object
This class implements the State design pattern.
SenderStateSlowStart
,
SenderStateCongestionAvoidance
,
SenderStateFastRecovery
Modifier and Type | Field and Description |
---|---|
protected SenderState |
after3xDupACKstate |
protected SenderState |
congestionAvoidanceState |
protected Sender |
sender
TCP sender.
|
protected SenderState |
slowStartState |
Constructor and Description |
---|
SenderState() |
Modifier and Type | Method and Description |
---|---|
protected abstract 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.
This method also resets the RTO timer for any outstanding segments. This abstract method is implemented by different actual sender states. |
SenderState |
handleDupACK(Segment dupAck_)
Counts a duplicate ACK and checks if the count equals 3.
|
SenderState |
handleNewACK(Segment ack_)
Processes a single new (i.e., not duplicate) acknowledgment.
|
SenderState |
handleRTOtimeout(Segment oldestUnackedSeg_)
Processes the TCP sender reaction to a retransmission timer (RTO) timeout.
Method called on the expired retransmission timeout (RTO) timer. |
protected abstract SenderState |
lookupNextStateAfterNewAck()
Helper method to look-up the next state
that the sender will transition to after it received
a "new ACK".
|
protected SenderState after3xDupACKstate
protected SenderState congestionAvoidanceState
protected Sender sender
protected SenderState slowStartState
protected abstract int calcCongWinAfterNewAck(int ackSequenceNumber_, int lastByteAcked_)
Clarification: Recent variants of TCP, such as NewReno, distinguish "partial" and "full" new acknowledgments. Any data that was outstanding unacknowledged at the time when a segment loss is detected is considered "old data". An ACK that acknowledges these data partially is called a "partial ACK". An ACK that acknowledges these data completely is called a "full ACK".
ackSequenceNumber_
- acknowledged data sequence numberlastByteAcked_
- last byte previously acknowledgedpublic SenderState handleDupACK(Segment dupAck_)
Tahoe ignores additional dupACKs over and above the first three.
Reno doesn't—it counts them within its fast recovery
procedure. See SenderStateFastRecovery.handleDupACK(Segment)
.
public SenderState handleNewACK(Segment ack_)
calcCongWinAfterNewAck(int, int)
to
perform the state-dependent calculation of the new congestion
window size, as well as to reset the RTO timer.ack_
- The current acknowledgment segment, to be processed.public SenderState handleRTOtimeout(Segment oldestUnackedSeg_)
oldestUnackedSeg_
- Currently the oldest unacknowledged segment (presumably lost), to be retransmitted.protected abstract SenderState lookupNextStateAfterNewAck()