views:

58

answers:

1

HI,

Let us say that there are 10 packets 1-10 and the 6th Packet gets dropped because of a network fault. Does TCP resend's all packets from 6-10 or just 6th ?

+4  A: 

It will resend all packets 6 through 10. In fact, since the receiver only tells the sender what sequence number was the last good one, the sender may choose to split up the packets differently (ie. by consolidating packets 6 through 10 into one bigger packet) when resending.

However, I should note that in all my years of socket programming, I've never actually needed to know that detail. I've never written an actual TCP driver, which is the only place you'd need to know that information.

The TCP/IP Illustrated series of books is an excellent resource for this.

Greg Hewgill
This is not entirely true. Firstly, the "Selective Acknowledgement" TCP option (RFC2018) allows a receiver to indicate that it has receieved the data in packets 7 to 10 in the example. Secondly, even without that option, the sender *may* choose to only resend packet 6 and then wait to see what ACK that elicits from the receiver.
caf
Good points, thanks. I suppose my answer applies to "basic TCP" without optional features.
Greg Hewgill