需要了解TCP序列号和ACK号的帮助吗

需要了解TCP序列号和ACK号的帮助吗,tcp,Tcp,序列号是如何生成的?假设发送方发送2个数据包: 序列号:68确认号:69长度:62字节 序列号:130确认号:131长度:62字节 然后从接收方接收序列号为131 og ACK number 130的数据包,发送方下次发送数据包时,序列号是什么?是131+62=193吗?“当主机启动TCP会话时,其初始序列号实际上是随机的;它可以是0到4294967295之间的任意值,包括0和4294967295。” 所以我们无法计算它?初始序列是由主机A的操作系统随机生成的。初始确认号设置为零,因为主机B尚未

序列号是如何生成的?假设发送方发送2个数据包:

序列号:68确认号:69长度:62字节
序列号:130确认号:131长度:62字节

然后从接收方接收序列号为131 og ACK number 130的数据包,发送方下次发送数据包时,序列号是什么?是131+62=193吗?

“当主机启动TCP会话时,其初始序列号实际上是随机的;它可以是0到4294967295之间的任意值,包括0和4294967295。”


所以我们无法计算它?初始序列是由主机A的操作系统随机生成的。初始确认号设置为零,因为主机B尚未响应。当主机B作出响应时,其操作系统将生成一个Seq#,并且确认号将变为主机Seq#。每次交互只需将这些初始数字迭代1;下一次发送方发送数据包时,序列号将是131?我编辑了我的答案,试图包括一个例子。如果初始序列#是主机A的131,则在主机B响应之后。第二次主机A发送数据时,序列号#将为132,Ack#将为主机B的序列号#如果主机同时发送序列号为68和130的2个数据包会怎么样。主机A下次发送的是序列号131或130+68+1?当我得到问题的答案时,我会选择正确答案:)
At the sender:
- Send one packet, and keep track of its sequence number and
  transmission time
- Once an ACK is received for that packet, delete the stored
  sequence number, and send a new packet (using the same strategy
  of saving its sequence number and waiting for an ACK)
- If an ACK hasn't been received after timeout seconds since the
  packet's transmission time, retransmit it to the receiver.

 At the receiver:
- Upon receipt of packet k, send an ACK for packet k
- If k is greater than the last sequence number we received (or if
  we haven't received any packets yet), then deliver the packet to
  the application and keep track of k

Example :
Host A: Seq#: 111 Ack #: 0
Host B: Seq#: 222 Ack #: 112
Host A: Seq : 112 Ack#: 223