buglwIP - A Lightweight TCP/IP stack - Bugs: bug #57976, TCP data communication broken due...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #57976: TCP data communication broken due to ACK transmission delay

Submitter:  Praveen Kumar <praveen_embedded>
Submitted:  Mon 09 Mar 2020 10:41:34 AM UTC
   
 
Category:  IPv4 Severity:  3 - Normal
Item Group:  Faulty Behaviour Status:  Works For Me
Privacy:  Public Assigned to:  None
Open/Closed:  Open Planned Release:  None
lwIP version:  2.0.3

Tue 10 Mar 2020 07:31:28 AM UTC, comment #4: 

Hi Simon,

In Cycle2 log, if you see line number 3,4,5 - The TCP packet is received from ECU at time 0.009955 seconds, immediately I will initiate TCP ACk packet and tcp_output(). But at the same time, data packet needs to be sent to ECU every 10ms once. So I will initiate tcp_write(data) with tcp_output().
Later when I see the packets in wireshark, I am seeing the ACK & SEQ number which needs to be updated with ACK packet, are updated in data packet and sent out, and later around 100uS, the ACK pack t is transmitted with different ACK & SEQ numbers.

As the ACK & SEQ numbers are different in acknowledgment packet, our ECU is recording error and initiating re-transmission.
This is happening very frequently and recording an error in ECU system.

So I just want to know that how to send ACK immediately once I receive input packet.

Regards,
PraveenKumar.

Praveen Kumar <praveen_embedded>
Mon 09 Mar 2020 07:22:48 PM UTC, comment #3: 

I won't go through a pcap of multiple 100K and search for the right line that you think is an error. Again, I can see no bug in lwIP here. You might want to explain further.

Simon Goldschmidt <goldsimon>
Group administrator
Mon 09 Mar 2020 12:08:42 PM UTC, comment #2: 

Hi Simon,

Thanks for quick reply.

We are not seeing this issue in initial communication state.
We are seeing this issue when the ECU goes to sleep and wakeup. After ECU wake up, TCP sync will be sent from ECU and start the communication again. In this cycle, the communication is not going well.

I will call tcp_close() before ECU goes to sleep. After that i will call tcp_bind(), tcp_listen() & tcp_accept() and when ECU wakes up, it will send SYNC message again and starts transferring the data. From the second cycle which explained above onwords, we are seeing the communication issue.

I have tried in different ways to solve the issue but i couldn't. I removed tcp_close() and other followed functions mentioned above but still issue is not resolved.

Here i attached the TCP logs(pcap)files for your reference.
Please check and suggest something to resolve our issue.

Regards,
PraveenKumar.

(file #48566, file #48567)

Praveen Kumar <praveen_embedded>
Mon 09 Mar 2020 11:40:08 AM UTC, comment #1: 

Please, no pictures. If you do have pcaps worthy of attaching, attach them, don't attach pictures.

Anyway, from it seems like when frame #12 is transmitted, frame #11 hasn't been processed, yet. Seems like a performance issue of your hardware?

Simon Goldschmidt <goldsimon>
Group administrator
Mon 09 Mar 2020 10:41:34 AM UTC, original submission:  

Hi ,
we are using LWIP 2.0.3 for one of our project to establish the TCP connection from ECU and Atmel micro.
We got the LWIP from atmel itself and i have modified little to support VLAN data receive and transmit.
But now we are seeing some issue during data transmission.
When the ECU goes to sleep, it cut down the Ethernet link and when it wakes up it will establish the Ethernet connection.
But here when the ECU wakes up the communication is not going well from our LWIP stack. We are seeing multiple re transmissions which are causing issues in data transmission.
I have seen new behavior like when i received new frame on TCP, i am trying to ACK back using ACK now function(pcb->prio = TCP_PRIO_MAX;tcp_ack_now(pcb);tcp_send_empty_ack(pcb);tcp_output(pcb);), but i am seeing the ACK packet after my data packet is been transferred.
This i didn't understand like why the ACK packet is transferred after data packet? this is also one of the reason for us to see communication failure.
Can someone please help me here that how to send ACK immediately after receiving the TCP packet(currently my data packets are sent out every 10ms once and the ACK is transmitted after data packet is being sent out). Please let know how to send ACK immediate, currently we are stuck here and our communication is not proper.
I am attaching the images for our communication issues.
Here LWIP_IP: 192.168.6.182
     ECU IP : 192.168.6.144
If you see LWIP_TCP_DataSentoutFirst.JPG, the data is send first and ACK is sent after that even though the ACK transmission is initiated first with priority level set to MAX.

Thanks & Regards,
PraveenKumar.

Praveen Kumar <praveen_embedded>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #48566:  Cycle1_No@Issues@in@TCP@comm.pcap added by praveen_embedded (716KiB - application/octet-stream)
file #48567:  Cycle2_TCP@Comm@Fail.pcap added by praveen_embedded (619KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by praveen_embedded (Submitted the item)
  • -email is unavailable- added by praveen_embedded
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-03-09 goldsimon StatusNone Works For Me
    2020-03-09 praveen_embedded Attached File- Added Cycle1_No@Issues@in@TCP@comm.pcap, #48566
        Attached File- Added Cycle2_TCP@Comm@Fail.pcap, #48567
    2020-03-09 praveen_embedded Attached File- Added LWIP_TCP_DataSentoutFirst.JPG, #48564
        Attached File- Added LWIPCommunicationIssue.JPG, #48565
        Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code