Detecting TCP dropout over an unreliable network

Posted by yx on Stack Overflow See other posts from Stack Overflow or by yx
Published on 2010-05-17T19:19:08Z Indexed on 2010/05/17 20:30 UTC
Read the original article Hit count: 174

Filed under:
|
|

I am doing some experimentation over an unreliable radio network (home brewed) using very rudimentary java socket programming to transfer messages back and forth between the end nodes.

The setup is as follows:

Node A --- Relay Node --- Node B

One problem I am constantly running into is that somehow the connection drops out and neither Node A or B knows that the link is dead, and yet continues to transmit data. The TCP connection does not time out either. I have added in a heartbeat message that causes a timeout after a while, but I still would like to know what is the underlying cause of why TCP does not time out.

Here are the options I am enabling when setting up a socket:

channel.socket().setKeepAlive(false);
channel.socket().setTrafficClass(0x08); // for max throughput

This behavior is strange since it is totally different than when I have a wired network. On a wired network, I can simulate a disconnected connection by pulling out the ethernet cord, however, once I plug the cord back in, the connection becomes restablished and messages begin to be passed through once more.

On the radio network, the connection is never reestablished and once it silently dies, the messages never resume.

Is there some other unknown java implentation or setting for a socket that I can use, also, why am I seeing this behavior in the first place?

And yes, before anyone says anything, I know TCP is not the preffered choice over an unreliable network, but in this case I wanted to ensure no packet loss.

© Stack Overflow or respective owner

Related posts about tcp

Related posts about network