Reputation: 63
Can somebody just simplely describe the retransmission mechanism in TCP? I want to know how it deal in this situation?
A send a packet to B:
In this situation B will receive 2 same packets, how can B do to avoid dealing the same packet again?
Thanks.
Upvotes: 0
Views: 1293
Reputation: 7698
Each packet has a sequence number associated with it. As data is sent, the sequence number is incremented by the amount of original data in the packet. You can think of the sequence number as the offset of the first byte in the packet from the beginning of the data stream although it may not, likely will not, start at zero. When A sends the retry, it will use the same sequence number it used the first time. B tracks the sequence numbers as it receives data and can know that it has seen the retry's sequence number before. If it has already made that data available to the (upper layer) client, then it knows that it should not do so again.
Upvotes: 3