Why does this connection keep closing – SYN->SYN,ACK->ACK->RST,ACK

networkingtcp

I have an application that is sending web requests and after some variable period of time we start getting connection timeout errors. Analysis of the TCP/IP packets reveals the following occurring for each connection attempted:

No. Time Source Destination Protocol Info

98635 2011-04-21 10:13:47.192237 172.22.3.250 172.22.3.100 TCP [TCP Port numbers reused] httpx > http-alt [SYN] Seq=0 Win=65535 Len=0 MSS=1460

98639 2011-04-21 10:13:47.192397 172.22.3.100 172.22.3.250 TCP http-alt > httpx [SYN, ACK] Seq=0 Ack=1 Win=5840 Len=0 MSS=1460

98641 2011-04-21 10:13:47.192425 172.22.3.250 172.22.3.100 TCP httpx > http-alt [ACK] Seq=1 Ack=1 Win=65535 Len=0

98646 2011-04-21 10:13:47.192502 172.22.3.250 172.22.3.100 TCP httpx > http-alt [RST, ACK] Seq=1 Ack=1 Win=0 Len=0

Once this happens the client machine must be rebooted to fix the issue. Restarting the client or server application, or rebooting the server have no effect. Comparison of the packet details between working and non-working messages reveal no differences for flags, etc.

Thank you,

Neil

Best Answer

TCP Port numbers reused is a clue. It might be your client is re-using the port numbers of the old connection which is supposed to be closed.

Does your client bind to a static source port? If yes it might be that the clients operating system is rejecting the packets from the server because it thinks they belong to an old connection. The OS is rejecting the packets, that's why only a client reboot solves the problem. (Alternatively try waiting a couple of minutes).

When opening the connection on the client, don't assign a source port.

Related Topic