TCP -- 接收方滑动中的部分段 window

TCP -- partial segments in receiver's sliding window

RFC793 指出,在接收方,传入的段在以下检查后被接受:

The first part of this test checks to see if the beginning of the segment falls in the window, the second part of the test checks to see if the end of the segment falls in the window; if the segment passes either part of the test it contains data in the window.

但是,可能会出现段的开头落在 window 中但段的结尾不落在 window 中的情况。这是 window 中仍有空间但段大小比缓冲区中剩余的 space 长的情况。如果是这样的话——会发生什么?

TCP 是否丢弃该段?或者它是否根据最大段大小安排缓冲区,以便它可以使用这些部分段?

TIA。

通常情况下,发送方发送的数据不会超过接收方在其 window 中可以接受的数据,因为当前 window 大小是在每个 TCP header 上发送的。如果接收方的 window 正在填充,它将发送一个较小的 window 大小值,因此发送方将知道接收方在填充之前可以接受多少数据。