TCP:服务器从客户端收到[SYN]后立即发送[RST,ACK] [英] TCP: Server sends [RST, ACK] immediately after receiving [SYN] from Client

查看:3195
本文介绍了TCP:服务器从客户端收到[SYN]后立即发送[RST,ACK]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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]标志以建立连接.但是Host_B响应[RST,ACK]而不是[SYN,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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆