简体   繁体   English

TCP - 确认

[英]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". TCP标头上的32位确认字段(比如说x)告诉另一个主机“我收到了所有字节,直到并包括x-1,现在期望x和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. 在这种情况下,接收器可能已经接收了一些其他字节,比如x + 100到x + 180,但它还没有接收到第x个字节。

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? 有没有这样的情况,虽然接收器没有收到x到x + 100字节,但收到的字节比如x + 100到x + 180,接收器是否确认收到了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". “确认x告诉所有字节,直到收到x-1”。

Are there any exceptional cases? 有没有例外情况? I'm looking to verify this. 我想验证这一点。

TIA. TIA。

This can be achieved by TCP option called SACK. 这可以通过称为SACK的TCP选项来实现。

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). 在这里,客户端可以通过重复的ACK来说明它只有特定的包号2(包的序列号),并且对于接收的连续包的范围附加SACK(选择性确认)选项,如编号为4到5的包(序列)数)。 This in turn shall enable the server to retransmit only the packets(3 sequence number) that were not received by the client. 这又将使服务器能够仅重传未被客户端接收的分组(3个序列号)。

Provided below an extract from RFC 2018 : TCP Selective Acknowledgement Options 下面提供了RFC 2018的摘录:TCP选择性确认选项

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 SACK选项由数据接收器发送,以通知数据发送器已接收的非连续数据块和
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. TCP标头的确认号字段中的边缘。 The SACK option does not change the meaning of the Acknowledgement Number SACK选项不会更改确认号的含义
field. 领域。

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

3.3. 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. 设计中的一个基本概念是通过TCP连接发送的每个八位字节数据都有一个序列号。 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. 所采用的确认机制是累积的,因此序列号X的确认表明已经接收到所有八位组但不包括X.

That seems pretty clear to me, the sequence number stops at the first missing data. 这对我来说非常清楚,序列号在第一个缺失的数据处停止。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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