TCP:服务器在收到客户端的 [SYN] 后立即发送 [RST, ACK] [英] TCP: Server sends [RST, ACK] immediately after receiving [SYN] from Client
问题描述
Host_A 尝试通过 TCP 向 Host_B 发送一些数据.Host_B 正在侦听端口 8181.Host_B 是 Linux 机器(Red Hat Enterprise).TCP 层是使用 Java NIO API 实现的.
Host_A tries to send some data to Host_B over TCP. Host_B is listening on port 8181. Both Host_A & Host_B are Linux boxes (Red Hat Enterprise). The TCP layer is implemented using Java NIO API.
无论 Host_A 发送什么,Host_B 都无法接收.使用 WireShark 嗅探电线上的数据导致以下日志:
Whatever Host_A sends, Host_B is unable to receive. Sniffing the data on wire using WireShark resulted in the following log:
1) Host_A (33253) > Host_B (8181): [SYN] Seq=0 Win=5840 Len=0 MSS=1460 TSV=513413781 TSER=0 WS=7
2) Host_B (8181) > Host_A (33253): [RST, ACK] Seq=1 Ack=1 Win=0 Len=0
1) Host_A (33253) > Host_B (8181): [SYN] Seq=0 Win=5840 Len=0 MSS=1460 TSV=513413781 TSER=0 WS=7
2) Host_B (8181) > Host_A (33253): [RST, ACK] Seq=1 Ack=1 Win=0 Len=0
日志显示 Host_A 向 Host_B 发送 [SYN] 标志以建立连接.但不是 [SYN, ACK] Host_B 以 [RST, ACK] 响应,它重置/关闭连接.这种行为总是被观察到.
The logs show that Host_A sends a [SYN] flag to Host_B in order to establish connection. But instead of [SYN, ACK] Host_B responds with an [RST, ACK] which resets/closes the connection. This behavior is observed always.
我想知道在什么情况下 TCP 侦听器会发送 [RST,ACK] 以响应 [SYN]?
I am wondering under what circumstance does a TCP listener sends [RST,ACK] in response to a [SYN]?
推荐答案
RST, ACK
表示端口关闭.您确定 Host_B 正在侦听正确的 IP/接口吗?
RST, ACK
means the port is closed. You sure Host_B is listening on the right IP/interface?
还要检查您的防火墙是否有 -j REJECT --reject-with tcp-reset
Also check your firewall for a -j REJECT --reject-with tcp-reset
这篇关于TCP:服务器在收到客户端的 [SYN] 后立即发送 [RST, ACK]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!