Re-transmissions, Timeouts and Duplicate Acknowledgements
TCP is relegated to rely mostly upon implicit signals it learns from the network and remote host. TCP must make an educated guess as to the state of network and trust the information from the remote host in order to control the rate of data flow.
A sender’s implicit knowledge of network conditions may be achieved through the use of a timer. For each TCP segment sent the sender expects to receive an acknowledgement within some period of time otherwise an error in the form of a timer expiring signals that something is wrong.
Whenever the TCP transmits a segment the sender starts a timer which keeps track how long it takes for an acknowledgement for that segment to return.
This timer is known as re-transmission timer.
- If acknowledgement is returned before the timer expires the timer is reset with no consequence.
- If an acknowledgement for the segment does not return with in the timeout period, the sender re-transmit the segment and double the re-transmission timeout period.
TCP keeps track of when data is sent and at what time acknowledgements covering those sent bytes are returned. TCP uses this information to calculate an estimate of round trip time.
As packets are sent and acknowledged, TCP adjusts its round trip time estimate and uses this information to come up with a reasonable timeout value for packets sent.
Slow Start(Sender based flow control)
This is accomplished through return rate acknowledgement from the receiver. In other words, the rate of acknowledgements returned from the receiver determine the rate at which the sender can transmit data.
When a TCP connection first begins, the slow start algorithm initializes a congestion window to one segment ,which is maximum segment size (1 MSS) initialized by the receiver during the connection establishment phase when acknowledgements are returned by the receiver, the congestion window increases by one segment for each acknowledgement returned.
Thus the sender can transmit the minimum of the congestion window and the advertised window of the receiver. which is simply called the transmission window.
For example: The first successful transmission and acknowledgement of TCP segment increases the window to two segments. After successful transmission of two segments and acknowledgement completes, the window is increased to four segments. doubling from there on out up to the maximum window size is advertised by the receiver or until the congestion finally does occur.
At some point the congestion window may become too large for the network or network conditions may change such that packets may be dropped.Packet lost will trigger a time out at the sender. When this happens, the sender goes into congestion mode.
Congestion Avoidance
A re-transmission timer expiring or the reception of duplicate acknowledgements can implicitly signal the sender that a network congestion situation is occurring.
The sender immediately sets its transmission window to one half of the current window size (the minimum of the congestion window and the receiver advertised windows), but to at least two segments.
- If congestion was indicated by a timeout the congestion window is reset to one segment, which automatically puts the sender into slow start mode
- If congestion was indicated by duplicate Acknowledgements the fast re-transmit and fast recovery algorithms are invoked.
Fast Re-transmit
- When a duplicate acknowledgement is received the sender does not know if it is because a TCP segment was lost or simply that a segment was delayed and received out of order at the receiver.
- If more than two duplicate Acknowledgements are received by the sender, it is a strong indication that at least one segment has been lost.
- When three or more duplicate acknowledgements are received, the sender does not even wait for a re-transmission time to expire before re-transmitting the segment ( the sender enters the congestion avoidance mode).
State | Event | TCP sender Congestion control action |
Slow start | Ack. receipt | Congwin = Congwin + MSS
if ( Congwin >= threshold) { set state to “Congestion avoidance” } |
Congestion Avoidance | Ack. receipt | Congwin = Congwin + MSS .(MSS/Congwin) |
Slow start or Congestion Avoidance | lost event by triple duplicate Ack. | Threshold = Congwin/2
Congwin = Threshold set state to congestion avoidance |
Slow start or Congestion Avoidance | Time out | Threshold = Congwin/2
Congwin = 1MSS set state to slow start |
Slow start or Congestion Avoidance | Duplicate Ack. | Increment duplicate Ack. count for segment being acknowledged |
Congwin = Congestion Window
Ӏ neеded to thank you for thijs greɑt гead!! I absoluteⅼy loved every
littpe bit ߋf it.I һave ɡot you book marked
to ceck out neԝ stufcf уou post…