简体   繁体   中英

TCP — acknowledgement

The 32-bit acknowledgement field, say x, on the TCP header tells the other host that "I received all the bytes up until and including x-1, now expecting the bytes from x and on". In this case, the receiver may have received some further bytes, say x+100 through x+180, but it hasn't yet received x-th byte yet.

Is there a case that, although the receiver hasn't received x through x+100 bytes but received the bytes say x+100 through x+180, the receiver is acknowledging that it received x+180?

One resource I read indicates the acknowledgement of bytes received despite a gap in the earlier bytes. However, every other source tells

"acknowledgement of x tells all bytes up until x-1 are received".

Are there any exceptional cases? I'm looking to verify this.

TIA.

This can be achieved by TCP option called SACK.

Here, client can say through a duplicate ACK that it has only up to particular packet number 2 (sequence number of packet) in order and append SACK(Selective Acknowledgement) option for the range of contiguous packets received like packets numbered 4 to 5 (sequence number). This in turn shall enable the server to retransmit only the packets(3 sequence number) that were not received by the client.

Provided below an extract from RFC 2018 : TCP Selective Acknowledgement Options

The SACK option is to be sent by a data receiver to inform the data sender of non-contiguous blocks of data that have been received and
queued. The data receiver awaits the receipt of data (perhaps by
means of retransmissions) to fill the gaps in sequence space between
received blocks. When missing segments are received, the data
receiver acknowledges the data normally by advancing the left window
edge in the Acknowledgement Number Field of the TCP header. The SACK option does not change the meaning of the Acknowledgement Number
field.

From the TCP RFC at https://www.rfc-editor.org/rfc/rfc793.txt :

3.3. Sequence Numbers

A fundamental notion in the design is that every octet of data sent over a TCP connection has a sequence number. Since every octet is sequenced, each of them can be acknowledged. The acknowledgment mechanism employed is cumulative so that an acknowledgment of sequence number X indicates that all octets up to but not including X have been received.

That seems pretty clear to me, the sequence number stops at the first missing data.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM