• AVR Freaks

Hot!Ask for advice : In TCP connection state, ethernet down after about 1 day 3 hours.

Author
toipaz
Starting Member
  • Total Posts : 24
  • Reward points : 0
  • Joined: 2020/08/19 16:17:36
  • Location: 0
  • Status: offline
2020/10/12 03:26:50 (permalink)
0

Ask for advice : In TCP connection state, ethernet down after about 1 day 3 hours.

I use the TCP connection on TCP/IP Lite stack.
As mentioned in the title, after the communication was connected, the communication went well, and after about three and a half hours a day, the communication was interrupted.
after that, No subsequent attempts will resume communication until reboot.
UDP communication, ping test, is also not responding.
 
I'm using the device PIC18F67J60, TCP/IP Lite stack 2.12.
 
I'm a little at a loss. Where should I start checking?
Let's ask for the advice from masters.
#1
toipaz
Starting Member
  • Total Posts : 24
  • Reward points : 0
  • Joined: 2020/08/19 16:17:36
  • Location: 0
  • Status: offline
Re: Ask for advice : In TCP connection state, ethernet down after about 1 day 3 hours. 2020/10/13 03:24:55 (permalink)
0
I tested it by enabling TCP & IP log, and the error occurred as follows.:
 
<6>1 2020-10-13T10:16:55Z 10.11.12.227 - - - -[tcp timeout]
<6>1 2020-10-13T10:16:56Z 10.11.12.227 - - - -[tcp timeout]
<6>1 2020-10-13T10:16:56Z 10.11.12.227 - - - -[ESTABLISHED: timeout]
<6>1 2020-10-13T10:16:57Z 10.11.12.227 - - - -[tcp timeout]
<6>1 2020-10-13T10:16:58Z 10.11.12.227 - - - -[tcp timeout]
<6>1 2020-10-13T10:16:58Z 10.11.12.227 - - - -[ESTABLISHED: timeout]
 
Is there any way to fix the error?
#2
toipaz
Starting Member
  • Total Posts : 24
  • Reward points : 0
  • Joined: 2020/08/19 16:17:36
  • Location: 0
  • Status: offline
Re: Ask for advice : In TCP connection state, ethernet down after about 1 day 3 hours. 2020/10/14 01:36:17 (permalink)
0
I left it in the error state, but the log changes further.
Besides, you reset the IP address.
The logs are as follows:
 
<6>1 2020-10-13T23:40:32Z 10.11.12.227 - - - -[ESTABLISHED:  timeout]
<6>1 2020-10-13T23:40:33Z 10.11.12.227 - - - -[tcp timeout]
<6>1 2020-10-13T23:40:34Z 10.11.12.227 - - - -[tcp timeout]
<6>1 2020-10-13T23:40:34Z 10.11.12.227 - - - -[ESTABLISHED:  timeout]
<6>1 2020-10-13T23:40:35Z 10.11.12.227 - - - -[tcp timeout]

 Log len =   268, gen =     4, no =   256, ID =       270, iFirst =     0, idFirst =         1, iLast =   269, idLast =       270
 Log gen =     4, no =   255, ID =       270, time =     61234, utc = 1602632435, code =     4, cat =    61, msg = Ethernet link is down.<6>1 2020-10-13T23:40:35Z 10.11.12.227 - - - -[tcp_close]
<6>1 2020-10-13T23:40:35Z 10.11.12.227 - - - -[ESTABLISHED: close]
<6>1 2020-10-13T23:40:35Z 10.11.12.227 - - - -[tcp_close]
<6>1 2020-10-13T23:40:35Z 10.11.12.227 - - - -[tcp_close]
<6>1 2020-10-13T23:40:35Z 10.11.12.227 - - - -[tcp_close]
<6>1 2020-10-13T23:40:35Z 10.11.12.227 - - - -[tcp_close]
<6>1 2020-10-13T23:40:35Z 10.11.12.227 - - - -[tcp_close]
<6>1 2020-10-13T23:40:35Z 10.11.12.227 - - - -[tcp_close]
<6>1 2020-10-13T23:40:35Z 10.11.12.227 - - - -[tcp_close]
<6>1 2020-10-13T23:40:35Z 10.11.12.227 - - - -[tcp_close]
<6>1 2020-10-13T23:40:35Z 10.11.12.227 - - - -[tcp_close]
<6>1 2020-10-13T23:40:35Z 10.11.12.227 - - - -[tcp_close]
<6>1 2020-10-13T23:40:35Z 10.11.12.227 - - - -[tcp_close]
<6>1 2020-10-13T23:40:35Z 10.11.12.227 - - - -[tcp_close]
<6>1 2020-10-13T23:40:35Z 10.11.12.227 - - - -[tcp_close]
<6>1 2020-10-13T23:40:35Z 10.11.12.227 - - - -[tcp_close]
<6>1 2020-10-13T23:40:35Z 10.11.12.227 - - - -[tcp_close]
<6>1 2020-10-13T23:40:35Z 10.11.12.227 - - - -[tcp_close]
<6>1 2020-10-13T23:40:35Z 10.11.12.227 - - - -[tcp_close]
<6>1 2020-10-13T23:40:35Z 10.11.12.227 - - - -[tcp_close]
<6>1 2020-10-13T23:40:35Z 10.11.12.227 - - - -[tcp_close]
<6>1 2020-10-13T23:40:35Z 10.11.12.227 - - - -[tcp_close]
<6>1 2020-10-13T23:40:35Z 10.11.12.227 - - - -[tcp_close]
<6>1 2020-10-13T23:40:35Z 10.11.12.227 - - - -[tcp_close]
<6>1 2020-10-13T23:40:35Z 10.11.12.227 - - - -[tcp_close]
<6>1 2020-10-13T23:40:35Z 10.11.12.227 - - - -[tcp_close]
<6>1 2020-10-13T23:40:35Z 10.11.12.227 - - - -[tcp_close]
<6>1 2020-10-13T23:40:35Z 10.11.12.227 - - - -[tcp_close]
<6>1 2020-10-13T23:40:35Z 10.11.12.227 - - - -[tcp_close]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp timeout]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp_close]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp_close]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp_close]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp_close]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp_close]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp_close]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp_close]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp_close]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp_close]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp_close]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp_close]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp_close]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp_close]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp_close]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp_close]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp_close]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp_close]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp_close]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp_close]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp_close]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp_close]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp_close]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp_close]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp_close]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp_close]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp_close]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp_close]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp_close]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp_close]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp_close]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp_close]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp_close]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp_close]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp_close]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp_close]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp_close]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp_close]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp_close]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp_close]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp_close]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp_close]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp_close]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp_close]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp_close]
<6>1 2020-10-13T23:40:36Z 0.0.0.0 - - - -[tcp_close]
#3
toipaz
Starting Member
  • Total Posts : 24
  • Reward points : 0
  • Joined: 2020/08/19 16:17:36
  • Location: 0
  • Status: offline
Re: Ask for advice : In TCP connection state, ethernet down after about 1 day 3 hours. 2020/10/18 19:50:41 (permalink)
0
[tcp_close] is my mistake.
 
But, The unfinished [ESTABLISHED: timeout] message is a problem.
Looking for a related part in the source, it looks like this.
 
                case TIMEOUT:
                    logMsg("ESTABLISHED: timeout",LOG_INFO, LOG_DEST_CONSOLE);
                    if (currentTCB->timeoutsCount)
                    {
                        TCP_TimoutRetransmit(); //jira: CAE_MCU8-6056
                    }else
                    {
                        // reset the connection if there is no reply
                        currentTCB->flags = TCP_RST_FLAG;
                        if(TCP_Snd(currentTCB) == (TX_QUEUED || SUCCESS)) //jira: CAE_MCU8-5647, CAE_MCU8-6056
                        {
                            nextState = CLOSED;
                            TCB_Reset(currentTCB);
                        }
                    }
                    break;

 
Q1:
The enum declares:
  TX_QUEUED = 18,
  SUCCESS = 1,
In the code, "if(TCP_Snd(currentTCB) == (TX_QUEUED || SUCCESS))" is correct?
 
Q2:
this "if(TCP_Snd(currentTCB) == (TX_QUEUED || SUCCESS))" is needed?
(I think, the problem caused by this "TCP_Snd()" call.)
#4
ric
Super Member
  • Total Posts : 28943
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: online
Re: Ask for advice : In TCP connection state, ethernet down after about 1 day 3 hours. 2020/10/18 20:17:04 (permalink)
5 (1)
I have noi experience with this driver, but that line
In the code, "if(TCP_Snd(currentTCB) == (TX_QUEUED || SUCCESS))" is correct?

looks like a stupid bug from someone who doesn't understand C conditional statements...
 

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#5
toipaz
Starting Member
  • Total Posts : 24
  • Reward points : 0
  • Joined: 2020/08/19 16:17:36
  • Location: 0
  • Status: offline
Re: Ask for advice : In TCP connection state, ethernet down after about 1 day 3 hours. 2020/10/19 21:22:14 (permalink)
0
Thanks for your reply.
I think so.
#6
toipaz
Starting Member
  • Total Posts : 24
  • Reward points : 0
  • Joined: 2020/08/19 16:17:36
  • Location: 0
  • Status: offline
Re: Ask for advice : In TCP connection state, ethernet down after about 1 day 3 hours. 2020/10/23 18:21:10 (permalink)
0
I finally solved it. There was a tx bug in the provided j60 driver.
Thank you for your interest.
#7
ric
Super Member
  • Total Posts : 28943
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: online
Re: Ask for advice : In TCP connection state, ethernet down after about 1 day 3 hours. 2020/10/23 19:17:36 (permalink)
0
It would be useful if you detailed what the bugs were.
You hint at them here: https://www.microchip.com/forums/m1156117.aspx#1156117
but don't really explain what they were, or how you fixed them.
 
 

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#8
toipaz
Starting Member
  • Total Posts : 24
  • Reward points : 0
  • Joined: 2020/08/19 16:17:36
  • Location: 0
  • Status: offline
Re: Ask for advice : In TCP connection state, ethernet down after about 1 day 3 hours. 2020/10/24 01:29:21 (permalink)
0
That is 2nd item.
 
This symptom can be reproduced if a lot of load is generated, and you can test it with only one unit.
An error occurs when the tx packet linked list increases more than two.
If you know and look for this, it will be easy to find errors in source code.
However, it is difficult to get to this point only with symptoms. (I put off all schedules, and it seems that it took about 5 days to reproduce the symptoms and solve the problem.)
#9
Jump to:
© 2020 APG vNext Commercial Version 4.5