2

So a client starts a TCP connection by sending a SYN packet to a server with seq. # X. The server then responds with a SYN+ACK for X+1. The same goes for a FIN packet when the close connection protocol is enacted.

So my question is why does the server ACK for X+1 instead of just X? I thought SYN and FIN packets didn't piggyback any data. Is there some other reason for this? I'm confused as to why the server will ACK X+1 instead of X.

4

1 回答 1

3

正在发送的序列号是下一个预期的序列号。如果它没有增加,那么回复将表明数据包没有被接受,请重新发送。这将以无限循环结束。

SYN 是一种特殊情况,它本身就传输信息。(它初始化目标上接收到的计数。)ACK 将用于下一个预期字节(SYN + 1)。

ACK 计数并不总是增加,并且可能增加超过 1。考虑这种交换,其中数据包 2 被延迟并且无序到达。

收到 ACK
  1 2
  3 2
  4 2
  2 5
于 2011-02-23T01:00:04.050 回答