Socket Connection Failure

Learn about how packets get dropped due to no connection, hang time due to connection failure, and how to find the solution.

The failing connections

After the failed connection point, any attempt to read or write from the socket on either end did not result in a TCP reset or an error due to a half-open socket. Instead, the TCP/IP stack sent the packet, waited for an ACK, didn’t get one, and retransmitted. The faithful stack tried and tried to reestablish contact, and that firewall just kept dropping the packets on the floor, without so much as an “ICMP destination unreachable” message.

Long blockages

My Linux system, running on a 2.6 series kernel, has its tcp_retries2 set to the default value of 15, which results in a twenty-minute timeout before the TCP/IP stack will inform the socket library that the connection is broken. The HP-UX servers we were using at the time had a 30-minute timeout. That application’s one-line call to write to a socket could block for 30 minutes!

Get hands-on with 1200+ tech skills courses.