This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

TCP retransmissions with additional payload data?

1

I'm seeing exactly what the question suggests - TCP retransmissions in which the retransmitted packet has more payload data than does the original transmission. In other words, packet A has X bytes of data when originally transmitted, but the retransmitted packet A has X+Y bytes of data.

I've found one or two references that simply say, "Oh, that's perfectly acceptable," but they provide no references to definitive information on the subject. It seems to me that once a TCP segment is assigned a sequence number, sent, and placed in the retransmission queue, it doesn't make sense to go add data to it later. Assuming that both the original packet and the (extra payload) retransmission arrive at the destination endpoint, how is the receiving stack supposed to handle two packets with the same sequence number?

Is there anything in the RFCs to address this behavior one way or the other?

asked 19 Feb '14, 09:23

wesmorgan1's gravatar image

wesmorgan1
411101221
accept rate: 4%


One Answer:

2

The short answer:

The behavior you describe is the way TCP works.

The somewhat longer answer:

TCP is a streaming protocol (not a block oriented protocol).

There's no notion of what you call a "tcp segment with an assigned sequence number".

Each byte has its own sequence number. (0, 1, 2, 3, ...). A TCP packet specifies the sequence number of the first byte and the length (and thus the sequence number of the last byte can be determined).

So: a retransmission may include additional data if the sender has same available at the time of retransmission. The receiver just keeps track (via the sequence numbers) of what bytes have been received.

This is the way TCP works and will be described in most any book about TCP/IP and in the TCP RFCs.

answered 19 Feb '14, 09:40

Bill%20Meier's gravatar image

Bill Meier ♦♦
3.2k1850
accept rate: 17%

edited 19 Feb '14, 09:42

Found it - in RFC 793 under 'Managing the Window': "The sending TCP packages the data to be transmitted into segments which fit the current window, and may repackage segments on the retransmission queue. Such repackaging is not required, but may be helpful."

You're right - I was conflating IP packets with TCP segments. Argh.

Thanks!

(19 Feb '14, 10:37) wesmorgan1