[En-Nut-Discussion] Strange TCP/IP behavior

Brett Abbott Brett.Abbott at digital-telemetry.com
Tue Jan 31 07:06:01 CET 2006


Michael

Im unsure if you have solved your problem.  I have noticed a similar but 
different scenario that may be related.

I have a single thread which manages a remote TCP connection with 
infrequent data packets, with the TCP conversation held open unless broken.

In a scenario where the TCP connection fails due to network failure, the 
ethernut (client) realises that the connection has failed.  FIN messages 
are not exchanged due to network outage so the ethernut eventually gives 
up and abandons the socket (as planned).  Once the network connection is 
restored, the ethernut succesfully re-connects to the server.  Note that 
the server still has an open session for the original (now abandoned) 
TCP session as it hasnt (and never will) been notified.

At a named period later, a timeout on the lost session occurs at the 
server and the server goes about tearing down the original socket and 
issues a FIN or RST to the remote site.

The interesting thing (which Im trying to get to the bottom of) is that 
this reset, even though issued from a different ethernut TCP port number 
goes about reseting the current new connection.  Ethernut receives the 
"old" FIN/RST and shuts down the new current TCP session.  The port 
number on the remote server is the same each time and the ethernut 
differs - as expected.  TCP sequence numbers are as expected - ie. old 
session has the old sequence numbers but still the session is abandoned.

I had expected that the TCP sessions should be independant.  We're using 
version 3.9.5 of NutOS.

Any thoughts much appreciated.

Cheers
Brett

Michael Jones wrote:

>Hello,
>
>Just a question - has anybody observed this (or similar) behavior?
>
>Scenario:
>
>I've got two threads each connecting to a different server (connection made
>by the nut board). Both threads attempt to reconnect if they lose
>connection. None of the connection relevant data is shared by the threads. 
>
>The non strange part:
>
>When one of the servers disconnects the pending NutTcpReceive in the
>corresponding will return -1 (connection error). The thread then closes the
>socket enters a NutSleep and will attempt reconnecting. 
>
>Now the strange part:
>
>Very shortly after the first thread closes the pending NutTcpReceive in the
>second thread also receives an -1 ... And I am currently clueless as why?
>
>
>So, anybody out there with similar observations? Any Hint welcome!
>
>
>Cu,
>Michael
>
>
>
>
>_______________________________________________
>En-Nut-Discussion mailing list
>En-Nut-Discussion at egnite.de
>http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion
>
>
>  
>

-- 
-----------------------------------------------------------------
Brett Abbott, Managing Director, Digital Telemetry Limited
Email: Brett.Abbott at digital-telemetry.com
PO Box 24 036 Manners Street, Wellington, New Zealand
Phone +64 (4) 5666-860  Mobile +64 (21) 656-144
------------------- Commercial in confidence --------------------





More information about the En-Nut-Discussion mailing list