TCP Retransmissions

TCP is known for its reliability compared to UDP, and one of the ways that it does this is by sequence numbers and acknowledgements. Retransmissions are also a big factor in its reliability as well. There is a timer called “retransmission timeout timer” and when the segment is sent the retransmission timer starts for it. The segment will be temporarily stored in a retransmission queue, and it will sit in that queue until an ACK is sent. If an ACK is received, then the segment will be deleted from the retransmission queue and if no ACK is received within the retransmission timeout interval then that same segment will be retransmitted from the buffer. It will continue to retransmit the same segment until the ACK is received, while increasing the retransmission timeout using exponential backoff. If no ACK is received after several attempts, the connection will be closed.

Fast Retransmit- TCP also has a feature called a “fast retransmit.” This allows TCP to retransmit segments before a retransmit timeout timer expires. In order for a segment to be resent before the retransmission timeout timer, the sender must receive three duplicate ACKs. Common reasons duplicate ACKs occur are for out of order segments being received or packet loss. The duplicate ACK is the receiver saying “I still need this segment starting at this sequence number” whether because of packet loss or later segments arriving before it. 

Leave a Reply

Your email address will not be published. Required fields are marked *