3

TCP 中,没有 SACK 能力的接收方,也会缓存 LastRcvd 之后的数据包吗?

 2 years ago
source link: https://www.v2ex.com/t/813146
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

V2EX  ›  程序员

TCP 中,没有 SACK 能力的接收方,也会缓存 LastRcvd 之后的数据包吗?

  amiwrong123 · 10 小时 18 分钟前 · 264 次点击

我现在知道了,tcp 在三次握手的时候会确认双方有没有 SACK 的能力(通过选项)。

如果有的话,那么接收方可能下面这种情况:

即已经收到了 14-20 的包,但由于网络原因,又收到了 22-23 的包。这时候,可能接收方会回复信息 ACK = 21 、SACK = [22-23]、window = 5 。所以,接收方有缓存 LastRcvd 之后的数据包的能力( 22-23 ),即使 21 没有收到。

但我现在想问,如果接收方没有 SACK 的能力,

  • 那么接收方也会缓存 LastRcvd 之后的数据包(22-23)吗,只是单纯不会通知出来 SACK 信息而已?
  • 还是 既不会缓存 LastRcvd 之后的数据包(22-23),也不会通知出来 SACK 信息?
5 条回复    2021-11-04 23:58:47 +08:00

ManjusakaL

ManjusakaL   9 小时 46 分钟前   ❤️ 1

SACK 只是为了加快 Retransmit 的速率而已

没有 SACK 该缓存的缓存,对端接到 duplicate ACK 或者定时器触发重传 21 后,接收端做 reorder 就行了。

amiwrong123

amiwrong123   9 小时 42 分钟前

@ManjusakaL #1
好吧,我也觉得应该是这样。是我想太多了

amiwrong123

amiwrong123   9 小时 40 分钟前

@ManjusakaL #1
也就是说,不管有没有 SACK ,接收方都会缓存 LastRcvd 之后的数据包

choury

choury   8 小时 57 分钟前

并不强制,tcp 中甚至可以接受丢弃 sack 中确认的包,发送端不能把 sack 的内容当 ack 处理

ManjusakaL

ManjusakaL   8 小时 7 分钟前 via iPhone

@amiwrong123 RFC 2018 中有很明确的描述了

SACK 要解决的是 “With the limited information available from cumulative acknowledgments, a TCP sender can only learn about a single lost packet per round trip time.” 这个问题。它和你 LastRcvd 行为无关

更进一层说,你想一下,仅仅是一个包有延迟,就 drop 到后面 seq 更大的包。那么你带来的问题是你还需要让对端重传 N 个包。那么在网络一般会有偶发丢包的情况下,这种行为毫无疑问会导致网络负荷的进一步增加

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK