Comments
The key point is to use ack num and sequence of packets.
Posted by sagitraz
The key to reliable communication using TCP is the use of sequence and acknowledgment numbers. These numbers are attached to the various segments of information that are sent between two hosts to identify what order they should be assembled in to re-create the original data, and to keep track of whether any segments went missing along the way. When a host sends a segment of data, it is labeled with a sequence number that identifies that segment and where it belongs in the series of segments being sent. When the receiving host gets that segment, it sends an acknowledgment back to the sender with an acknowledgment number; the value of this number is the sequence number of the last segment it received, plus one. In effect, the receiver is saying, "I got your last one, now I am ready for the next one."
Posted by thomas