tcp - 为什么 TCP 的三向握手在确认时会撞到序列号?

标签 tcp handshake

为什么 the TCP three-way handshake在初始握手期间 acking 时增加序列号?这比让确认号等于序列号更好吗?

建立连接

Client sends SYN,A
Server responds with SYN-ACK,A+1,B
Client confirms with ACK,B+1

这比

好在哪里
Client sends SYN,A
Server responds with SYN-ACK,A,B
Client confirms with ACK,B

最佳答案

那是因为 ACK 字段在设置 ACK 标志时意味着:

Acknowledgment number (32 bits) – if the ACK flag is set then the value of this field is the next sequence number that the receiver is expecting.

如果未设置为(初始序列号+1),则表示同时确认SYN(SYNACK)是不一致的 必须在此数据包中设置标志)并表示它再次期待该序列号(即尚未收到)。

关于tcp - 为什么 TCP 的三向握手在确认时会撞到序列号?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6804979/

相关文章:

c# - NetworkStream.Write数据似乎没有到达接收套接字

android - 一旦客户端 2 连接,Kryonet 就会断开客户端 1

linux - 从 struct tcp_sock 获取 TCP 端口号

javax.net.ssl.SSLKeyException : Invalid signature on ECDH server key exchange message( in java)

ssl - 服务器在服务器问候后立即发送加密握手

facebook - Ubuntu 中的 OpenSSL 1.0.1 握手解决方法?

握手后的 TCP : seq ack homework

c - 通过 c 中的 ssl channel 接收一半消息

sockets - 在 Windows 中如何检测哪个程序正在监听 TCP/IP 端口?

Node.js - 在运行时动态更改 HTTPS 服务器的 SSL 证书