ACK Message
Each
exchange of data between two connected peers involves a 32-bit sequence number
(coordinating position within the data stream and identifying which data has
been previously sent) and, if the ACK flag is set, an acknowledgment number
(defining which segments have been received and which sequence is expected
next). An ACK message acknowledges that all segments up to the specified
acknowledgment number have been received.
For each segment that is
transmitted by an originating node, a duplicate copy of the segment is placed in
a retransmission queue and a retransmission timer is started. If the
retransmission timer set for that segment expires before an acknowledgment
number that includes the segment is received from the recipient, the segment is
retransmitted from the retransmission queue. If an acknowledgment number is
received that includes the segment before the retransmission timer expires, the
segment has been delivered successfully and is removed from the retransmission
queue. If the timer set for the segment continues to expire, an error condition
is generated resulting in termination of the connection. Acknowledgment is
generated when the data has passed checksum verification and is stored in the
TCP receive buffer, waiting to be pulled out by the application process.